aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-10-23net: cdc_mbim: Device Service Stream supportcdc_mbim-net-next.v4Bjørn Mork
MBIM devices can support up to 256 generic streams called Device Service Streams (DSS). The MBIM spec says The format of the Device Service Stream payload depends on the device service (as identified by the corresponding UUID) that is used when opening the data stream. Example use cases are serial AT command interfaces and NMEA data streams. We cannot make any assumptions about these device services. Adding support for Device Service Stream by extending the MBIM session to VLAN mapping scheme, allocating VLAN IDs 256 to 511 for DSS, using the DSS SessionID as the lower 8bit of the VLAN ID. Using a netdev for DSS keeps the device framing intact and allows userspace to do whatever it want with the streams. For example, exporting an AT command interface using DSS session #0 to a PTY for use with a terminal application like minicom: vconfig add wwan0 256 ip link set dev wwan0 up ip link set dev wwan0.256 up socat INTERFACE:wwan0.256,type=2 PTY:,echo=0,link=/tmp/modem Device configuration must be done using MBIM control commands over the /dev/cdc-wdmx device. The userspace management application should coordinate host VLAN configuration and the device MBIM configuration using the device capabilities to find out if it needs to set up PTY mappings etc. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: map MBIM IPS SessionID to VLAN IDBjørn Mork
MBIM devices can support up to 256 independent IP Streams. The main network device will only handle SessionID 0. Mapping SessionIDs 1 to 255 to VLANs using the SessionID as VLAN ID allow userspace to use these streams with traditional tools like vconfig. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: do not bind to NCM compatible MBIM devicesBjørn Mork
The MBIM specification allows a MBIM device to disguise itself as NCM for backwards compatibility, using additional altsettings with different subclass (control) or protocol (data): C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0d Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=7ms I:* If#= 0 Alt= 1 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=7ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=01 Driver=cdc_mbim I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=01 Driver=cdc_mbim E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 2 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms If the MBIM driver is enabled then that should have priority for devices providing such a NCM 1.0 backward compatibility mode. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Greg Suarez <gsuarez@smithmicro.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_mbim: build the MBIM driverBjørn Mork
Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_mbim: adding MBIM driverGreg Suarez
The CDC Mobile Broadband Interface Model (MBIM) specification extends CDC NCM by - removing the redundant ethernet header from the point-to-point USB channel - adding support for multiple IP (v4 and/or v6) sessions multiplexed on the same USB channel - adding a MBIM control channel encapsulated in CDC - adding Device Service Streams (DSS), which are non IP generic data streams multiplexed on the same USB channel as the IP sessions MBIM devices are managed using the dedicated control channel, and no data will flow on the data channel until a control session has been established. This driver has no knowledge of MBIM control messages. It just exports the control channel to a /dev/cdc-wdmX character device for userspace management applications. Such an application is therefore required to use this driver. This patch implements basic MBIM support, reusing the NCM and WDM driver APIs, currently limited to IP sessions with SessionID 0. DSS and multiplexed IP sessions are not yet supported. Signed-off-by: Greg Suarez <gsuarez@smithmicro.com> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: export shared symbols and definitionsBjørn Mork
Move symbols and definitons which can be shared with a MBIM driver in a new header. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: refactoring for tx multiplexingBjørn Mork
Adding multiplexed NDP support to cdc_ncm_fill_tx_frame, allowing transmissions of multiple independent sessions within the same NTB. Refactoring the code quite a bit to avoid having to store copies of multiple NDPs being prepared for tx. The old code would still reserve enough room for a maximum sized NDP in the skb so we might as well keep them in the skb while they are being prepared. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: splitting rx_fixup for code reuseBjørn Mork
Verifying and handling received MBIM and NCM frames will need to be different in three areas: - verifying the NDP signature - checking valid datagram length - datagram header manipulation This makes it inconvenient to share rx_fixup in whole. But some verification parts are common. Split these out in separate functions. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: process chained NDPsBjørn Mork
The NCM 1.0 spefication makes provisions for linking more than one NDP into a single NTB. This is important for MBIM support, where these NDPs might be of different types. Following the chain of NDPs is also correct for NCM, and will not change anything in the common case where there is only one NDP Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: refactor bind preparing for MBIM supportGreg Suarez
NCM and MBIM can share most of the bind function. Split out the shareable part and add MBIM functional descriptor parsing. Signed-off-by: Greg Suarez <gsuarez@smithmicro.com> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: adding MBIM support to ncm_setupGreg Suarez
MBIM and NCM are very similar, so we can reuse most of the setup and bind logic in cdc_ncm for CDC MBIM devices. Handle a few minor differences in ncm_setup. Signed-off-by: Greg Suarez <gsuarez@smithmicro.com> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23USB: cdc: add MBIM constants and structuresGreg Suarez
Based on revision 1.0 of "Universal Serial Bus Communications Class Subclass Specification for Mobile Broadband Interface Model" available from www.usb.org Signed-off-by: Greg Suarez <gsuarez@smithmicro.com> [bmork: added DSS defines] Signed-off-by: Bjørn Mork <bjorn@mork.no> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net: cdc_ncm: workaround NTB input size firmware bugBjørn Mork
Some devices do not support the 8 byte variants of the NTB input size control messages despite announcing such support in their NCM or MBIM functional descriptor. According to the NCM specification, all devices must support the 4 byte variant regardless of whether or not the flag is set: If bit D5 is set in the bmNetworkCapabilities field of function’s NCM Functional Descriptor, the host may set wLength either to 4 or to 8. If wLength is 4, the function shall assume that wNtbInMaxDatagrams is to be set to zero. If wLength is 8, then the function shall use the provided value as the limit. The function shall return an error response (a STALL PID) if wLength is set to any other value. We do not set wNtbInMaxDatagrams in any case, so we can just as well unconditionally use the 4 byte variant without losing any functionality. This works around the known firmware bug, and simplifies the code considerably. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net/at91_ether: add pdata flag for reverse Eth addrJoachim Eastwood
This will allow us to remove the last mach include from at91_ether and also make it easier to share address setup with macb. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net/at91_ether: select MACB in KconfigJoachim Eastwood
Now that HAVE_NET_MACB is gone let's just select MACB to satisfy the dependecies in at91_ether. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net/cadence: get rid of HAVE_NET_MACBJoachim Eastwood
macb is a platform driver and there is nothing that prevents this driver from being built on non-ARM/AVR32 platforms. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net/macb: fix truncate warningsJoachim Eastwood
When building macb on x86_64 the following warnings show up: drivers/net/ethernet/cadence/macb.c: In function macb_interrupt: drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c: In function macb_reset_hw: drivers/net/ethernet/cadence/macb.c:792:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c:793:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c:796:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] Use -1 insted of ~0UL, as done in other places in the driver, to silence these warnings. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23ipv6: add support of equal cost multipath (ECMP)Nicolas Dichtel
Each nexthop is added like a single route in the routing table. All routes that have the same metric/weight and destination but not the same gateway are considering as ECMP routes. They are linked together, through a list called rt6i_siblings. ECMP routes can be added in one shot, with RTA_MULTIPATH attribute or one after the other (in both case, the flag NLM_F_EXCL should not be set). The patch is based on a previous work from Luc Saillard <luc.saillard@6wind.com>. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-22ipv4: 16 slots in initial fib_info hash tableEric Dumazet
A small host typically needs ~10 fib_info structures, so create initial hash table with 16 slots instead of only one. This removes potential false sharing and reallocs/rehashes (1->2->4->8->16) Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-22tcp: speedup SIOCINQ ioctlEric Dumazet
SIOCINQ can use the lock_sock_fast() version to avoid double acquisition of socket lock. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-22tcp: RFC 5961 5.2 Blind Data Injection Attack MitigationEric Dumazet
RFC 5961 5.2 [Blind Data Injection Attack].[Mitigation] All TCP stacks MAY implement the following mitigation. TCP stacks that implement this mitigation MUST add an additional input check to any incoming segment. The ACK value is considered acceptable only if it is in the range of ((SND.UNA - MAX.SND.WND) <= SEG.ACK <= SND.NXT). All incoming segments whose ACK value doesn't satisfy the above condition MUST be discarded and an ACK sent back. Move tcp_send_challenge_ack() before tcp_ack() to avoid a forward declaration. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Neal Cardwell <ncardwell@google.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Jerry Chu <hkchu@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21pkt_sched: use ns_to_ktime() helperEric Dumazet
ns_to_ktime() seems better than ktime_set() + ktime_add_ns() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Update driver versionPadmanabh Ratnakar
Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix skyhawk VF PCI Device IDPadmanabh Ratnakar
Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix FW flashing on Skyhawk-RPadmanabh Ratnakar
FW flash layout on Skyhawk-R is different from BE3-R. Hence the code needs to be fixed to flash FW on Skyhawk-R. Also cleaning up code in BE3-R flashing function. Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Enabling Wake-on-LAN is not supported in S5 statePadmanabh Ratnakar
be_shutdown is enabling wake-on-lan by calling be_setup_wol. Emulex adapter do not support wake-on-lan in S5 state. Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix VF driver load on newer Lancer FWPadmanabh Ratnakar
PF driver should enable VF so that VF goes to ready state in new Lancer FW. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix unnecessary delay in PCI EEHPadmanabh Ratnakar
During PCI EEH, driver waits for all functions in the card. Wait is needed only once per card. Fix is to wait only for the first PCI function. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix issues in error recovery due to wrong queue statePadmanabh Ratnakar
During recovery from a FW error, destroy queue operation may fail. Queue should be marked as destroyed so that recovery code can recreate the queue. Also fix queue created state not getting checked at one instance. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix ethtool get_settings output for VFPadmanabh Ratnakar
Return default values for fields for which VFs dont have privilege to get the required information from FW. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix error messages while driver load for VFsPadmanabh Ratnakar
VF does not have privileges to execute many commands. When VFs try to execute those commands there are unnecessary error messages. Fix this by executing only those commands for which VF has privilege. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix configuring VLAN for VF for LancerPadmanabh Ratnakar
Allow adding VLANs for Lancer VF. VLAN ID 0 should not be added to list of VLANs sent to FW. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Wait till resources are available for VF in error recoveryPadmanabh Ratnakar
After FW error, driver should wait for NO_RESOURCE error to disappear before proceeding with recovery. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix change MAC operation for VF for LancerPadmanabh Ratnakar
For changing MAC of VF from PF, delete MAC operation needs to be done before assigning new MAC. Also in ndo_set_mac_address operation avoid delete MAC if it has been already deleted by PF. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix setting QoS for VF for LancerPadmanabh Ratnakar
Use Lancer specific command to set QoS for VF. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21be2net: Fix driver load failure for different FW configs in LancerPadmanabh Ratnakar
Driver assumes FW resource counts and capabilities while creating queues and using functionality like RSS. This causes driver load to fail in FW configs where resources and capabilities are reduced. Fix this by querying FW configuration during probe and using resources and capabilities accordingly. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21net:dev: remove double indentical assignment in dev_change_net_namespace().Rami Rosen
This patch removes double assignment of err to -EINVAL in dev_change_net_namespace(). Signed-off-by: Rami Rosen <ramirose@gmail.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21sockopt: Make SO_BINDTODEVICE readablePavel Emelyanov
The SO_BINDTODEVICE option is the only SOL_SOCKET one that can be set, but cannot be get via sockopt API. The only way we can find the device id a socket is bound to is via sock-diag interface. But the diag works only on hashed sockets, while the opt in question can be set for yet unhashed one. That said, in order to know what device a socket is bound to (we do want to know this in checkpoint-restore project) I propose to make this option getsockopt-able and report the respective device index. Another solution to the problem might be to teach the sock-diag reporting info on unhashed sockets. Should I go this way instead? Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21unix: Remove unused field from unix_sockPavel Emelyanov
The struct sock *other one seem to be unused. Grep and make do not object. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21pktgen: Use ipv6_addr_anyJoe Perches
Use the standard test for a non-zero ipv6 address. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-21hyperv: Remove unnecessary comments in rndis_filter_receive_data()Haiyang Zhang
Checked with Windows networking team, there is only one RNDIS message in each netvsc packet. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-19Merge branch 'master' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next Jeff Kirsher says: ==================== This series contains updates to ixgbe and igb. Alexander Duyck (13): ixgbe: Initialize q_vector cpu and affinity masks correctly ixgbe: Enable jumbo frames support w/ SR-IOV ixgbe: Move message handling routines into their own functions ixgbe: Add mailbox API version negotiation support to ixgbe PF igb: Split Rx timestamping into two separate functions igb: Do not use header split, instead receive all frames into a single buffer igb: Combine post-processing of skb into a single function igb: Map entire page and sync half instead of mapping and unmapping half pages igb: Move rx_buffer related code in Rx cleanup path into separate function igb: Lock buffer size at 2K even on systems with larger pages igb: Combine q_vector and ring allocation into a single function igb: Move the calls to set the Tx and Rx queues into igb_open igb: Split igb_update_dca into separate Tx and Rx functions Tushar Dave (1): igb: Correcting and improving small packet check and padding ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-19Merge branch 'at91'David S. Miller
Joachim Eastwood says; ==================== This patch series prepares the old at91_ether driver for code sharing with the macb driver. The hardware is similar except for DMA TX/RX, so its not quite clear if it is practical to support both in one driver. But stuff like MDIO and statistics should be possible to share. Patch 1 adds some register defines and bits that is only found on RM9200. Patch 2-4 uses the register defines and access functions from the macb header. These can be squashed if it cause too much churn. Patch 5 merges the private at91_ether struct with the private macb struct. This makes it easier to later share code with the macb. The private macb struct becomes quite large, but most at91_ether specific members are removed in later patches. Patch 8 make macb compile when we select at91_ether. Is this approach okey? Patch 9 makes use of MDIO code from macb. This rips out the private phy handling code in at91_ether. One thing that is lost is the interrupt support for phy. But this should easy to add to macb which will then benefit both drivers. Patch 10 makes use of the macb_set_rx_mode from macb. Patch 11-12 makes at91_ether share the rx dma struct members from macb. Patch also moves the rx buffer allocation into netdev open and dealloc into netdev close. Last patch remove the now unused rm9200 emac header from include/mach. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-19ARM: AT91: remove old RM9200 EMAC register definitionsJoachim Eastwood
This file is unused after at91_ether was converted to use macb.h Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: convert to devm_* functionsJoachim Eastwood
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: clean up rx buffer handlingJoachim Eastwood
This patch does two things: * Use macb struct members and remove at91_ether ones * Alloc DMA buffers on netdev start and dealloc on stop Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: use macb dma description structJoachim Eastwood
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: share macb_set_rx_mode with macbJoachim Eastwood
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: use ethtool and mdio from macbJoachim Eastwood
This rips out the at91_ether phy handling and ethtool stuff and replace it with equivalent stuff from macb. The only thing lost is the phy irq support from at91_ether, but this can be added to macb and then benefit all users. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: compile macb for exported functionsJoachim Eastwood
Comile macb as well as at91_ether to access exported functions. Signed-off-by: Joachim Eastwood <manabian@gmail.com>