Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361475
b: refs/heads/master
c: c62dce6
h: refs/heads/master
i:
  361473: ad8508d
  361471: 5fc232c
v: v3
  • Loading branch information
David S. Miller committed Mar 17, 2013
1 parent 45e8bb7 commit 5d204ce
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3a3440063d6b01470507ecde9cf8ed0b033362a
refs/heads/master: c62dce61261c9bb90f74a493f55b35ae2480c8ae
6 changes: 4 additions & 2 deletions trunk/drivers/isdn/hisax/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ config HISAX_MIC

config HISAX_NETJET
bool "NETjet card"
depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
depends on VIRT_TO_BUS
help
This enables HiSax support for the NetJet from Traverse
Technologies.
Expand All @@ -248,7 +249,8 @@ config HISAX_NETJET

config HISAX_NETJET_U
bool "NETspider U card"
depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
depends on VIRT_TO_BUS
help
This enables HiSax support for the Netspider U interface ISDN card
from Traverse Technologies.
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/dec/tulip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ config TULIP_DM910X
config DE4X5
tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"
depends on (PCI || EISA)
depends on VIRT_TO_BUS || ALPHA || PPC || SPARC
select CRC32
---help---
This is support for the DIGITAL series of PCI/EISA Ethernet cards.
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ethernet/ti/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ static int emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev)
/* If there is no more tx desc left free then we need to
* tell the kernel to stop sending us tx frames.
*/
if (unlikely(cpdma_check_free_tx_desc(priv->txchan)))
if (unlikely(!cpdma_check_free_tx_desc(priv->txchan)))
netif_stop_queue(ndev);

return NETDEV_TX_OK;
Expand Down
11 changes: 1 addition & 10 deletions trunk/drivers/net/usb/cdc_mbim.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,9 @@ static int cdc_mbim_bind(struct usbnet *dev, struct usb_interface *intf)
struct cdc_ncm_ctx *ctx;
struct usb_driver *subdriver = ERR_PTR(-ENODEV);
int ret = -ENODEV;
u8 data_altsetting = CDC_NCM_DATA_ALTSETTING_NCM;
u8 data_altsetting = cdc_ncm_select_altsetting(dev, intf);
struct cdc_mbim_state *info = (void *)&dev->data;

/* see if interface supports MBIM alternate setting */
if (intf->num_altsetting == 2) {
if (!cdc_ncm_comm_intf_is_mbim(intf->cur_altsetting))
usb_set_interface(dev->udev,
intf->cur_altsetting->desc.bInterfaceNumber,
CDC_NCM_COMM_ALTSETTING_MBIM);
data_altsetting = CDC_NCM_DATA_ALTSETTING_MBIM;
}

/* Probably NCM, defer for cdc_ncm_bind */
if (!cdc_ncm_comm_intf_is_mbim(intf->cur_altsetting))
goto err;
Expand Down
49 changes: 32 additions & 17 deletions trunk/drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@

#define DRIVER_VERSION "14-Mar-2012"

#if IS_ENABLED(CONFIG_USB_NET_CDC_MBIM)
static bool prefer_mbim = true;
#else
static bool prefer_mbim;
#endif
module_param(prefer_mbim, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(prefer_mbim, "Prefer MBIM setting on dual NCM/MBIM functions");

static void cdc_ncm_txpath_bh(unsigned long param);
static void cdc_ncm_tx_timeout_start(struct cdc_ncm_ctx *ctx);
static enum hrtimer_restart cdc_ncm_tx_timer_cb(struct hrtimer *hr_timer);
Expand Down Expand Up @@ -550,9 +558,12 @@ void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf)
}
EXPORT_SYMBOL_GPL(cdc_ncm_unbind);

static int cdc_ncm_bind(struct usbnet *dev, struct usb_interface *intf)
/* Select the MBIM altsetting iff it is preferred and available,
* returning the number of the corresponding data interface altsetting
*/
u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf)
{
int ret;
struct usb_host_interface *alt;

/* The MBIM spec defines a NCM compatible default altsetting,
* which we may have matched:
Expand All @@ -568,23 +579,27 @@ static int cdc_ncm_bind(struct usbnet *dev, struct usb_interface *intf)
* endpoint descriptors, shall be constructed according to
* the rules given in section 6 (USB Device Model) of this
* specification."
*
* Do not bind to such interfaces, allowing cdc_mbim to handle
* them
*/
#if IS_ENABLED(CONFIG_USB_NET_CDC_MBIM)
if ((intf->num_altsetting == 2) &&
!usb_set_interface(dev->udev,
intf->cur_altsetting->desc.bInterfaceNumber,
CDC_NCM_COMM_ALTSETTING_MBIM)) {
if (cdc_ncm_comm_intf_is_mbim(intf->cur_altsetting))
return -ENODEV;
else
usb_set_interface(dev->udev,
intf->cur_altsetting->desc.bInterfaceNumber,
CDC_NCM_COMM_ALTSETTING_NCM);
if (prefer_mbim && intf->num_altsetting == 2) {
alt = usb_altnum_to_altsetting(intf, CDC_NCM_COMM_ALTSETTING_MBIM);
if (alt && cdc_ncm_comm_intf_is_mbim(alt) &&
!usb_set_interface(dev->udev,
intf->cur_altsetting->desc.bInterfaceNumber,
CDC_NCM_COMM_ALTSETTING_MBIM))
return CDC_NCM_DATA_ALTSETTING_MBIM;
}
#endif
return CDC_NCM_DATA_ALTSETTING_NCM;
}
EXPORT_SYMBOL_GPL(cdc_ncm_select_altsetting);

static int cdc_ncm_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret;

/* MBIM backwards compatible function? */
cdc_ncm_select_altsetting(dev, intf);
if (cdc_ncm_comm_intf_is_mbim(intf->cur_altsetting))
return -ENODEV;

/* NCM data altsetting is always 1 */
ret = cdc_ncm_bind_common(dev, intf, 1);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/usb/cdc_ncm.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ struct cdc_ncm_ctx {
u16 connected;
};

extern u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf);
extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting);
extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);
extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2621,7 +2621,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
struct rtattr *attr = (void *)nlh + NLMSG_ALIGN(min_len);

while (RTA_OK(attr, attrlen)) {
unsigned int flavor = attr->rta_type;
unsigned int flavor = attr->rta_type & NLA_TYPE_MASK;
if (flavor) {
if (flavor > rta_max[sz_idx])
return -EINVAL;
Expand Down
5 changes: 1 addition & 4 deletions trunk/net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,10 +798,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev

if (dev->header_ops && dev->type == ARPHRD_IPGRE) {
gre_hlen = 0;
if (skb->protocol == htons(ETH_P_IP))
tiph = (const struct iphdr *)skb->data;
else
tiph = &tunnel->parms.iph;
tiph = (const struct iphdr *)skb->data;
} else {
gre_hlen = tunnel->hlen;
tiph = &tunnel->parms.iph;
Expand Down

0 comments on commit 5d204ce

Please sign in to comment.