aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/usb
AgeCommit message (Collapse)AuthorFilesLines
2013-11-20r8152: support stopping/waking tx queuehayeswang1-0/+22
The maximum packet number which a tx aggregation buffer could contain is the tx_qlen. tx_qlen = buffer size / (packet size + descriptor size). If the tx buffer is empty and the queued packets are more than the maximum value which is defined above, stop the tx queue. Wake the tx queue if tx queue is stopped and the queued packets are less than tx_qlen. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-20r8152: modify the tx flowhayeswang1-43/+3
Remove the code for sending the packet in the rtl8152_start_xmit(). Let rtl8152_start_xmit() to queue the packet only, and schedule a tasklet to send the queued packets. This simplify the code and make sure all the packet would be sent by the original order. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-20r8152: fix tx/rx memory overflowhayeswang1-13/+17
The tx/rx would access the memory which is out of the desired range. Modify the method of checking the end of the memory to avoid it. For r8152_tx_agg_fill(), the variable remain may become negative. However, the declaration is unsigned, so the while loop wouldn't break when reaching the end of the desied memory. Although to change the declaration from unsigned to signed is enough to fix it, I also modify the checking method for safe. Replace remain = rx_buf_sz - sizeof(*tx_desc) - (u32)((void *)tx_data - agg->head); with remain = rx_buf_sz - (int)(tx_agg_align(tx_data) - agg->head); to make sure the variable remain is always positive. Then, the overflow wouldn't happen. For rx_bottom(), the rx_desc should not be used to calculate the packet length before making sure the rx_desc is in the desired range. Change the checking to two parts. First, check the descriptor is in the memory. The other, using the descriptor to find out the packet length and check if the packet is in the memory. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-14net: cdc_ncm: cleanup a type issue in cdc_ncm_setup()Dan Carpenter1-1/+1
This is harmless but cdc_ncm_setup() returns negative error codes truncated to u8 values. There is only one caller and treats all non-zero returns as errors but doesn't store the the return code. So the code works correctly but it's messy and upsets the static checkers. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-14usbnet: fix status interrupt urb handlingFelix Fietkau1-3/+0
Since commit 7b0c5f21f348a66de495868b8df0284e8dfd6bbf "sierra_net: keep status interrupt URB active", sierra_net triggers status interrupt polling before the net_device is opened (in order to properly receive the sync message response). To be able to receive further interrupts, the interrupt urb needs to be re-submitted, so this patch removes the bogus check for netif_running(). Signed-off-by: Felix Fietkau <[email protected]> Tested-by: Dan Williams <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-05net: cdc_ncm: remove non-standard NCM device IDsEnrico Mioso1-11/+0
Remove device IDs of NCM-like (but not NCM-conformant) devices, that are handled by the huawwei_cdc_ncm driver now. Signed-off-by: Enrico Mioso <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-05net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driverEnrico Mioso3-0/+246
This driver supports devices using the NCM protocol as an encapsulation layer for other protocols, like the E3131 Huawei 3G modem. This drivers approach was heavily inspired by the qmi_wwan/cdc_mbim approach & code model. Signed-off-by: Enrico Mioso <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-05net: cdc_ncm: Export cdc_ncm_{tx, rx}_fixup functions for re-useEnrico Mioso1-2/+4
Some drivers implementing NCM-like protocols, may re-use those functions, as is the case in the huawei_cdc_ncm driver. Export them via EXPORT_SYMBOL_GPL, in accordance with how other functions have been exported. Signed-off-by: Enrico Mioso <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-04net: cdc_mbim: fixup error return valueBjørn Mork1-4/+2
Reported-by: Oliver Neukum <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-04net: cdc_mbim: no need to check for resume if suspend existsBjørn Mork1-1/+1
Reported-by: Oliver Neukum <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-04net: qmi_wwan: no need to check for resume if suspend existsBjørn Mork1-1/+1
Reported-by: Oliver Neukum <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-04net: qmi_wwan: manage_power should always set needs_remote_wakeupBjørn Mork1-6/+4
Reported-by: Oliver Neukum <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-04net: cdc_mbim: manage_power should always set needs_remote_wakeupBjørn Mork1-5/+3
Reported-by: Oliver Neukum <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-04Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-6/+5
Conflicts: drivers/net/ethernet/emulex/benet/be.h drivers/net/netconsole.c net/bridge/br_private.h Three mostly trivial conflicts. The net/bridge/br_private.h conflict was a function signature (argument addition) change overlapping with the extern removals from Joe Perches. In drivers/net/netconsole.c we had one change adjusting a printk message whilst another changed "printk(KERN_INFO" into "pr_info(". Lastly, the emulex change was a new inline function addition overlapping with Joe Perches's extern removals. Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: no not set tx_max higher than the device supportsBjørn Mork1-2/+1
There are MBIM devices out there reporting dwNtbInMaxSize=2048 dwNtbOutMaxSize=2048 and since the spec require a datagram max size of at least 2048, this means that a full sized datagram will never fit. Still, sending larger NTBs than the device supports is not going to help. We do not have any other options than either a) refusing to bindi, or b) respect the insanely low value. Alternative b will at least make these devices work, so go for it. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: improve bind error debug messagesBjørn Mork1-10/+26
Make it a bit easier for users to figure out what goes wrong when bind fails. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: return proper error if setup failsBjørn Mork1-2/+2
Most setup errors are ignored to ensure maximum firmware compatibilty. But GET_NTB_PARAMETERS and the functional descriptors are required. Use proper error codes and log level if these fail. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: refactoring cdc_ncm_setupBjørn Mork1-64/+44
Rewriting the "set max datagram" part of dc_ncm_setup to separate the selection and validatation of the size from the code which optionally informs the device of this value. This ensures that we use the correct value regardless of device support for the get and set commands. Removing some of the many indent levels while doing this to make the code more readable. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: endian convert constants instead of variablesBjørn Mork1-2/+2
Converting the constants used in these comparisons at build time instead of converting the variables for every received frame at run time. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: log signatures in hexBjørn Mork1-4/+6
These signatures are well known bit patterns, mostly made up of ascii characters. Mentally parsing works best if they are printed in hex. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: use netif_* and dev_* instead of pr_*Bjørn Mork1-50/+48
Take advantage of standard device name prefixing and netdevice msglvl control where possible. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: log the length we warn aboutBjørn Mork1-1/+1
Fix cut'n'paste typo. Log the bogus length and not the irrelevant signature. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: set correct dev->hard_mtuBjørn Mork1-7/+2
usbnet use the hard_mtu value for sizing the tx queue and nothing else. We will be transmitting buffers of up to tx_max size, so that's the proper value to give usbnet. The individual datagram size is completely irrelevant here. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove ethtool opsBjørn Mork1-26/+0
No need to keep this code duplicated from usbnet. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove probe and disconnect wrappersBjørn Mork1-18/+2
These functions were merely wrappers around the usbnet variants. Remove them. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: no point in filling up the NTBs if we send ZLPsBjørn Mork1-1/+5
Padding NTBs to max size is part of the support for devices optimizing their DMA transfers. This optimization depends on max sized NTBs not being ZLP terminated. So we are much better off dropping the padding if we are going to send a ZLP anyway. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: only the control intf can be probedBjørn Mork1-6/+8
The probed interface must be the master/control interface of the function. Make this explicit and simplify redundant tests. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove descriptor pointersBjørn Mork1-6/+6
header_desc was completely unused and union_desc was never used outside cdc_ncm_bind_common. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: fix SET_MAX_DATAGRAM_SIZEBjørn Mork1-0/+1
We need to inform the device about the *new* value, not the old one. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove ncm_parm fieldBjørn Mork1-23/+23
Moving the call to cdc_ncm_setup() after the endpoint setup removes the last remaining reference to ncm_parm outside cdc_ncm_setup. Collecting all the ncm_parm based calculations in cdc_ncm_setup improves readability. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove tx_speed and rx_speed fieldsBjørn Mork1-23/+14
These fields are only used to prevent printing the same speeds multiple times if we receive multiple identical speed notifications. The value of these printk's is questionable, and even more so when we filter out some of the notifications sent us by the firmware. If we are going to print any of these, then we should print them all. Removing little used fields is a bonus. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove unused udev fieldBjørn Mork1-2/+0
We already use the usbnet udev field everywhere this could have been used. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove redundant netdev fieldBjørn Mork2-37/+38
Too many pointers back and forth are likely to confuse developers, creating subtle bugs whenever we forget to syncronize them all. As a usbnet driver, we should stick with the standard struct usbnet fields as much as possible. The netdevice is one such field. Cc: Greg Suarez <[email protected]> Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove redundant endpoint pointersBjørn Mork1-19/+19
No need to duplicate stuff already in the common usbnet struct. We still need to keep our special find_endpoints function because we need explicit control over the selected altsetting. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: remove redundant "intf" fieldBjørn Mork1-3/+1
This is always a duplicate of the "control" field. It causes confusion wrt intf_data updates and cleanups. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_ncm: simplify and optimize frame paddingBjørn Mork1-12/+19
We can avoid the costly division for the common case where we pad the frame to tx_max size as long as we ensure that tx_max is either the device specified dwNtbOutMaxSize or not a multiplum of wMaxPacketSize. Using the preconverted 'maxpacket' field avoids converting wMaxPacketSize to CPU endianness for every transmitted frame And since we only will hit the one byte padding rule for short frames, we can drop testing the skb for tailroom. The change means that tx_max now represents the real maximum skb size, enabling us to allocate the correct size instead of always making room for one extra byte. Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_mbim: change the default to send ZLPsBjørn Mork1-11/+17
A number of devices in the wild have turned out to require ZLPs. Even if this is a spec violation, our priority is to make any device work as good as possible. Devices needing ZLPs will fail to receive any full sized frame we send. On the other hand, devices which do not need the ZLP will still work if we send them. This gives us no other option than sending ZLPs by default. This will prevent devices conforming to the spec from making the optimizations which are possible without ZLPs. Adding known such devices to a whitelist, to avoid the possible negative impact of the new spec violating default. Cc: Greg Suarez <[email protected]> Cc: Alexey Orishko <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-02net: cdc_mbim: handle IPv6 Neigbor SolicitationsBjørn Mork1-0/+58
MBIM is a point-to-point protocol transporting raw IP packets with no L2 headers. Only IPv4 and IPv6 are supported. ARP in particular is not, which is quite logical given the lack of L2 headers. The driver still emulates an ethernet interface, dropping all unsupported protocols, and avoiding neigbour resolving by setting the IFF_NOARP flag. The MBIM specification does not explicitly forbid IPv6 Neighbor Discovery, and it seems the other OS support will respond to Neighbor Solicitations on MBIM links. There are therefore buggy devices out there, which despite the pointlessness, still require Neighbor Discovery for IPv6 over MBIM. This is incompatible with the IFF_NOARP flag which disables both ARP and ND. We cannot support ARP in any case, so we have to keep that flag. This patch implements a workaround for the buggy devices, letting the driver respond directly to Neighbor Solicitations from the device. This is not optimal, but will have minimal effect on any sane device. Cc: Greg Suarez <[email protected]> Reported-and-tested-by: Thomas Schäfer <[email protected]> Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-10-25ax88179_178a: Remove AX_MEDIUM_ALWAYS_ONE bit in AX_MEDIUM_STATUS_MODE ↵Freddy Xin1-6/+5
register to avoid TX throttling Remove AX_MEDIUM_ALWAYS_ONE in AX_MEDIUM_STATUS_MODE register. Setting this bit may cause TX throttling in Half-Duplex mode. Signed-off-by: Freddy Xin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-10-23Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller3-4/+24
Conflicts: drivers/net/usb/qmi_wwan.c include/net/dst.h Trivial merge conflicts, both were overlapping changes. Signed-off-by: David S. Miller <[email protected]>
2013-10-22ax88179_178a: Add VID:DID for Samsung USB Ethernet AdapterFreddy Xin1-1/+18
Add VID:DID for Samsung USB Ethernet Adapter. Signed-off-by: Freddy Xin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-10-22ax88179_178a: Correct the RX error definition in RX headerFreddy Xin1-2/+2
Correct the definition of AX_RXHDR_CRC_ERR and AX_RXHDR_DROP_ERR. They are BIT29 and BIT31 in pkt_hdr seperately. Signed-off-by: Freddy Xin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-10-17net: qmi_wwan: Olivetti Olicard 200 supportEnrico Mioso1-0/+1
This is a QMI device, manufactured by TCT Mobile Phones. A companion patch blacklisting this device's QMI interface in the option.c driver has been sent. Signed-off-by: Enrico Mioso <[email protected]> Signed-off-by: Antonella Pellizzari <[email protected]> Tested-by: Dan Williams <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-10-17usbnet: fix error return code in usbnet_probe()Wei Yongjun1-1/+3
Fix to return -ENOMEM in the padding pkt alloc fail error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Oliver Neukum <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-10-02net:drivers/net: Miscellaneous conversions to ETH_ALENJoe Perches1-4/+4
Convert the memset/memcpy uses of 6 to ETH_ALEN where appropriate. Also convert some struct definitions and u8 array declarations of [6] to ETH_ALEN. Signed-off-by: Joe Perches <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-10-01Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller3-8/+23
Conflicts: drivers/net/ethernet/emulex/benet/be.h drivers/net/usb/qmi_wwan.c drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h include/net/netfilter/nf_conntrack_synproxy.h include/net/secure_seq.h The conflicts are of two varieties: 1) Conflicts with Joe Perches's 'extern' removal from header file function declarations. Usually it's an argument signature change or a function being added/removed. The resolutions are trivial. 2) Some overlapping changes in qmi_wwan.c and be.h, one commit adds a new value, another changes an existing value. That sort of thing. Signed-off-by: David S. Miller <[email protected]>
2013-09-30dm9601: fix IFF_ALLMULTI handlingPeter Korsgaard1-1/+1
Pass-all-multicast is controlled by bit 3 in RX control, not bit 2 (pass undersized frames). Reported-by: Joseph Chang <[email protected]> Signed-off-by: Peter Korsgaard <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-09-30net: qmi_wwan: fix Cinterion PLXX product IDAleksander Morgado1-1/+1
Cinterion PLXX LTE devices have a 0x0060 product ID, not 0x12d1. The blacklisting in the serial/option driver does actually use the correct PID, as per commit 8ff10bdb14a52e3f25d4ce09e0582a8684c1a6db ('USB: Blacklisted Cinterion's PLxx WWAN Interface'). CC: Hans-Christoph Schemmel <[email protected]> CC: Christian Schmiedl <[email protected]> CC: Nicolaus Colberg <[email protected]> Signed-off-by: Aleksander Morgado <[email protected]> Acked-by: Bjørn Mork <[email protected]> Acked-by: Christian Schmiedl <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-09-30net: qmi_wwan: fix checkpatch warningsFabio Porcedda1-20/+36
Signed-off-by: Fabio Porcedda <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-09-30net: qmi_wwan: add Telit LE920 newer firmware supportFabio Porcedda1-0/+1
Newer firmware use a new pid and a different interface. Signed-off-by: Fabio Porcedda <[email protected]> Acked-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>