* [net-next 11/11] igb: add support for NETIF_F_RXHASH
From: Jeff Kirsher @ 2011-10-11 15:45 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1318347952-25068-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This patch adds support for Rx hashing.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 52 +++++++++++++++++++---------
1 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index c4c3acf..b3a2e3d 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1931,23 +1931,32 @@ static int __devinit igb_probe(struct pci_dev *pdev,
dev_info(&pdev->dev,
"PHY reset is blocked due to SOL/IDER session.\n");
- netdev->hw_features = NETIF_F_SG |
- NETIF_F_IP_CSUM |
- NETIF_F_IPV6_CSUM |
- NETIF_F_TSO |
- NETIF_F_TSO6 |
- NETIF_F_RXCSUM |
- NETIF_F_HW_VLAN_RX;
-
- netdev->features = netdev->hw_features |
- NETIF_F_HW_VLAN_TX |
- NETIF_F_HW_VLAN_FILTER;
-
- netdev->vlan_features |= NETIF_F_TSO;
- netdev->vlan_features |= NETIF_F_TSO6;
- netdev->vlan_features |= NETIF_F_IP_CSUM;
- netdev->vlan_features |= NETIF_F_IPV6_CSUM;
- netdev->vlan_features |= NETIF_F_SG;
+ /*
+ * features is initialized to 0 in allocation, it might have bits
+ * set by igb_sw_init so we should use an or instead of an
+ * assignment.
+ */
+ netdev->features |= NETIF_F_SG |
+ NETIF_F_IP_CSUM |
+ NETIF_F_IPV6_CSUM |
+ NETIF_F_TSO |
+ NETIF_F_TSO6 |
+ NETIF_F_RXHASH |
+ NETIF_F_RXCSUM |
+ NETIF_F_HW_VLAN_RX |
+ NETIF_F_HW_VLAN_TX;
+
+ /* copy netdev features into list of user selectable features */
+ netdev->hw_features |= netdev->features;
+
+ /* set this bit last since it cannot be part of hw_features */
+ netdev->features |= NETIF_F_HW_VLAN_FILTER;
+
+ netdev->vlan_features |= NETIF_F_TSO |
+ NETIF_F_TSO6 |
+ NETIF_F_IP_CSUM |
+ NETIF_F_IPV6_CSUM |
+ NETIF_F_SG;
if (pci_using_dac) {
netdev->features |= NETIF_F_HIGHDMA;
@@ -5757,6 +5766,14 @@ static inline void igb_rx_checksum(struct igb_ring *ring,
le32_to_cpu(rx_desc->wb.upper.status_error));
}
+static inline void igb_rx_hash(struct igb_ring *ring,
+ union e1000_adv_rx_desc *rx_desc,
+ struct sk_buff *skb)
+{
+ if (ring->netdev->features & NETIF_F_RXHASH)
+ skb->rxhash = le32_to_cpu(rx_desc->wb.lower.hi_dword.rss);
+}
+
static void igb_rx_hwtstamp(struct igb_q_vector *q_vector,
union e1000_adv_rx_desc *rx_desc,
struct sk_buff *skb)
@@ -5889,6 +5906,7 @@ static bool igb_clean_rx_irq(struct igb_q_vector *q_vector, int budget)
}
igb_rx_hwtstamp(q_vector, rx_desc, skb);
+ igb_rx_hash(rx_ring, rx_desc, skb);
igb_rx_checksum(rx_ring, rx_desc, skb);
if (igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) {
--
1.7.6.4
^ permalink raw reply related
* [net-next 10/11] igb: move TX hang check flag into ring->flags
From: Jeff Kirsher @ 2011-10-11 15:45 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1318347952-25068-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change moves the Tx hang check into the ring flags.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb.h | 1 -
drivers/net/ethernet/intel/igb/igb_main.c | 6 +++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index 04dd6d7..5def94c 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -230,7 +230,6 @@ struct igb_ring {
struct igb_tx_queue_stats tx_stats;
struct u64_stats_sync tx_syncp;
struct u64_stats_sync tx_syncp2;
- bool detect_tx_hung;
};
/* RX */
struct {
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 689c2c2..c4c3acf 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3684,7 +3684,7 @@ static void igb_watchdog_task(struct work_struct *work)
}
/* Force detection of hung controller every watchdog period */
- tx_ring->detect_tx_hung = true;
+ set_bit(IGB_RING_FLAG_TX_DETECT_HANG, &tx_ring->flags);
}
/* Cause software interrupt to ensure rx ring is cleaned */
@@ -5651,14 +5651,14 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
q_vector->tx.total_bytes += total_bytes;
q_vector->tx.total_packets += total_packets;
- if (tx_ring->detect_tx_hung) {
+ if (test_bit(IGB_RING_FLAG_TX_DETECT_HANG, &tx_ring->flags)) {
struct e1000_hw *hw = &adapter->hw;
eop_desc = tx_buffer->next_to_watch;
/* Detect a transmit hang in hardware, this serializes the
* check with the clearing of time_stamp and movement of i */
- tx_ring->detect_tx_hung = false;
+ clear_bit(IGB_RING_FLAG_TX_DETECT_HANG, &tx_ring->flags);
if (eop_desc &&
time_after(jiffies, tx_buffer->time_stamp +
(adapter->tx_timeout_factor * HZ)) &&
--
1.7.6.4
^ permalink raw reply related
* Re: [PATCH] bonding: L2L3 xmit doesn't support IPv6
From: Jay Vosburgh @ 2011-10-11 15:58 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: Yinglin Sun, netdev
In-Reply-To: <20111011143348.GA20605@gospo.rdu.redhat.com>
Andy Gospodarek <andy@greyhouse.net> wrote:
>On Fri, Oct 07, 2011 at 10:36:45PM -0700, Yinglin Sun wrote:
>> Add IPv6 support in L2L3 xmit policy.
>> L3L4 doesn't support IPv6 either, and I'll try to fix that later.
>>
>> Signed-off-by: Yinglin Sun <Yinglin.Sun@emc.com>
>> ---
>> drivers/net/bonding/bond_main.c | 7 +++++++
>> 1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index 6d79b78..d6fd282 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -41,8 +41,10 @@
>> #include <linux/ptrace.h>
>> #include <linux/ioport.h>
>> #include <linux/in.h>
>> +#include <linux/in6.h>
>> #include <net/ip.h>
>> #include <linux/ip.h>
>> +#include <linux/ipv6.h>
>> #include <linux/tcp.h>
>> #include <linux/udp.h>
>> #include <linux/slab.h>
>> @@ -3372,10 +3374,15 @@ static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count)
>> {
>> struct ethhdr *data = (struct ethhdr *)skb->data;
>> struct iphdr *iph = ip_hdr(skb);
>> + struct ipv6hdr *ipv6h = ipv6_hdr(skb);
>>
>> if (skb->protocol == htons(ETH_P_IP)) {
>> return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^
>> (data->h_dest[5] ^ data->h_source[5])) % count;
>> + } else if (skb->protocol == htons(ETH_P_IPV6)) {
>> + return ((ntohl(ipv6h->saddr.s6_addr32[3] ^
>> + ipv6h->daddr.s6_addr32[3]) & 0xffff) ^
>> + (data->h_dest[5] ^ data->h_source[5])) % count;
>> }
>>
>
>There have been some attempts to add support for ipv6 hashing this in
>the past, but none have been committed. The best one I had seen was one
>that did some extensive testing one a wide variety of ipv6 traffic and
>it showed nice traffic distribution. I'm not sure if it was ever posted
>upstream, so I will see if I can dig it up.
>
>Can you quantify how traffic was distributed with this algorithm?
As I recall, the IPv6 issues had to do with the "layer3+4" hash,
because the IPv6 TCP or UDP port numbers can be harder to get at than in
IPv4 (which typically has a fixed size header). The above is just for
layer 2, so it only hits the IPv6 addresses, which don't move around.
That said, I believe that many IPv6 addresses are derived from
the MAC address, the autoconf addresses in particular, so s6_addr32[3]
may not show a lot more variation than just the MAC address. I don't
know for sure though, since I haven't tested it.
I don't recall seeing the patch you mention, Andy, that checks
ipv6 traffic; can you post it?
-J
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
^ permalink raw reply
* Re: big picture UDP/IP performance question re 2.6.18 -> 2.6.32
From: Chris Friesen @ 2011-10-11 16:24 UTC (permalink / raw)
To: Eric Dumazet
Cc: starlight, linux-kernel, netdev, Peter Zijlstra,
Christoph Lameter, Willy Tarreau, Ingo Molnar, Stephen Hemminger,
Benjamin LaHaise, Joe Perches, Chetan Loke, Con Kolivas,
Serge Belyshev
In-Reply-To: <1317966007.3457.47.camel@edumazet-laptop>
On 10/06/2011 11:40 PM, Eric Dumazet wrote:
> Le jeudi 06 octobre 2011 à 23:27 -0400, starlight@binnacle.cx a écrit :
>> If the older kernels are switching to NAPI
>> for much of surge and the switching out
>> once the pulse falls off, it might
>> conceivably result in much better latency
>> and overall performance.
> Thats exactly the opposite : Your old kernel is not fast enough to
> enter/exit NAPI on every incoming frame.
>
> Instead of one IRQ per incoming frame, you have less interrupts :
> A napi run processes more than 1 frame.
>
> Now increase your incoming rate, and you'll discover a new kernel will
> be able to process more frames without losses.
I wonder if it would make sense to adjust the interrupt mitigation
parameters in the NIC to allow it to accumulate a few packets before
interrupting the CPU. We had good luck using this to reduce interrupt
rate on a quasi-pathological case where we were bouncing in and out of
NAPI because we were *just* fast enough to keep up with incoming packets.
Chris
--
Chris Friesen
Software Developer
GENBAND
chris.friesen@genband.com
www.genband.com
^ permalink raw reply
* Re: [net-next 00/11 v2][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2011-10-11 19:25 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
In-Reply-To: <1318347952-25068-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 11 Oct 2011 08:45:41 -0700
> The following series contains updates to e1000e and igb. This
> version of the series contains the following changes:
>
> - Added the e1000e bug fix patch
> - Dropped the igb patch "igb: Use node specific allocations for
> the q_vectors and rings" based on feedback
>
> Based on the feedback, I am working on re-working the igb patch that
> was dropped in this series and will re-submit it later on.
>
> The remain 10 igb patches are unchanged from the previous pull request
> and are the continuation of the cleanups and refactoring that Alex has done.
> After this series there are 4-5 more patches to complete the work
> that Alex has done on igb.
>
> The following are changes since commit 3ed6f6958c0ac21958285d8648f14d34da4bbcb3:
> ll_temac: convert to SKB paged frag API.
> and are available in the git repository at
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next.git
Pulled, thanks Jeff.
^ permalink raw reply
* pull request: wireless-next 2011-10-11
From: John W. Linville @ 2011-10-11 19:16 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev
[-- Attachment #1: Type: text/plain, Size: 18913 bytes --]
commit bfb3780bc9b622422c1f0d3e12371a70863000da
Dave,
Here is another wireless batch intended for 3.2... Highlights include a
bluetooth pull with some refactoring, a big pull of ath6kl updates, a
flurry of mac80211 patches from Johannes, and the usual strong ath9k
showing.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 3ed6f6958c0ac21958285d8648f14d34da4bbcb3:
ll_temac: convert to SKB paged frag API. (2011-10-10 15:19:13 -0400)
are available in the git repository at:
git://git.infradead.org/users/linville/wireless-next.git for-davem
Amitkumar Karwar (5):
mwifiex: remove unnecessary mwifiex_dump_station_info() call
mwifiex: remove unreachable code
mwifiex: fix Tx data rate display issue
mwifiex: correct AMSDU aggregation check
mwifiex: handle an error path correctly
Anderson Lizardo (1):
Bluetooth: use recommended LE connection parameters
Andre Guedes (1):
Bluetooth: hci_le_adv_report_evt code refactoring
Andy Shevchenko (1):
wireless: at76c50x: use native hex_pack_byte() method
Arik Nemtsov (5):
nl80211: support sending TDLS commands/frames
mac80211: standardize adding supported rates IEs
mac80211: handle TDLS high-level commands and frames
nl80211/mac80211: allow adding TDLS peers as stations
mac80211: data path modification for TDLS peers
Daniel Drake (1):
libertas: detect TX lockups and reset hardware
Don Fry (1):
iwlagn: rename iwlagn module iwlwifi and alias to iwlagn.
Edward Lu (4):
ath6kl: Support channel set request for startscan command
ath6kl: Fix a typo in ath6k context
ath6kl: Fix default key installation in AP mode
ath6kl: Do not clear CONNECT bit setting in AP mode for STA disconnect
Eliad Peller (1):
mac80211: pass vif param to conf_tx() callback
Greg Dietsche (1):
iwlagn: iwl-agn-rs: remove unnecessary null check for sta and lq_sta
Helmut Schaa (1):
mac80211: Allow noack flag overwrite for injected frames
Johannes Berg (17):
cfg80211/mac80211: apply station uAPSD parameters selectively
mac80211: let drivers inform it about per TID buffered frames
mac80211: unify TIM bit handling
mac80211: also expire filtered frames
mac80211: split PS buffers into ACs
mac80211: remove return value from add_pending_skbs
mac80211: clear more-data bit on filtered frames
mac80211: allow releasing driver-buffered frames
mac80211: implement uAPSD
mac80211: send (QoS) Null if no buffered frames
mac80211: reply only once to each PS-poll
mac80211: optimise station flags
mac80211: add missing station flags to debugfs
mac80211: explicitly notify drivers of frame release
mac80211: allow out-of-band EOSP notification
mac80211: document client powersave
mac80211: dont assign seqno to or aggregate QoS Null frames
John W. Linville (3):
Merge branch 'for-linville' of git://github.com/kvalo/ath6kl
Merge branch 'master' of git://github.com/padovan/bluetooth-next
Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davem
Jouni Malinen (37):
ath6kl: Use cfg80211_inform_bss instead of cfg80211_inform_bss_frame
ath6kl: Add functionality for starting AP mode
ath6kl: Fix AP mode (Re)AssocReq IE processing
ath6kl: Delay initial group key setup in AP mode
ath6kl: Use change_station() to authorize/unauthorize STAs
ath6kl: Add new WMI commands and events for P2P
ath6kl: Implement remain_on_channel and cancel_remain_on_channel
ath6kl: Implement mgmt_tx
ath6kl: Request P2P capabilities during target init
ath6kl: Add cfg80211 calls for remain-on-channel events
ath6kl: Use set_appie command to add Probe Request IEs
ath6kl: Report received Probe Request frames to cfg80211
ath6kl: Notify cfg80211 of TX status of mgmt_tx frames
ath6kl: Report received Action frames to cfg80211
ath6kl: Advertise supported mgmt_stypes
ath6kl: Add support for new P2P iftypes in mode changes
ath6kl: Include P2P IE(s) in GO Probe Response depending on request
ath6kl: Return error from wmi.c instead of -EIO in ath6kl_cfg80211_scan
ath6kl: Define __CHECK_ENDIAN__ for sparse
ath6kl: Do not enable Probe Request reporting by default
athk6l: Fix channel list processing in scan requests
ath6kl: Fix WMI message structure for AP_SET_PVB
ath6kl: Fix AP mode connect event parsing and TIM updates
ath6kl: Allow AP mode to be configured
ath6kl: Allow enabling of P2P support
ath6kl: Fix static WEP configuration in AP mode
ath6kl: Fix BSS update on roaming
ath6kl: Remove deprecated WMI_OPT_RX_FRAME_EVENTID processing
ath6kl: Remove RSSI update for internal node table
ath6kl: Remove unnecessary node table update on disconnect event
ath6kl: Replace internal node table with cfg80211 BSS table
ath6kl: Remove the unused node table implementation
ath6kl: Remove unnecessary bssinfo event header conversion
ath6kl: Update BSS information after connection
ath6kl: Export beacon interval and DTIM period through STA info
ath6kl: Report PMKSA candidate events through cfg80211
ath6kl: fix TCP corruption
Kalle Valo (28):
ath6kl: fix indentation in htc_issued_send()
ath6kl: implement suspend support
ath6kl: add testmode support
ath6kl: fix compilation when NL80211_TESTMODE is disabled
ath6kl: add firmware log support
ath6kl: implement support to set firmware log parameters
ath6kl: cleanup diagnose window read and write functions
ath6kl: read fwlog from firmware ring buffer
ath6kl: unify tx function names in htc.c
ath6kl: unify rx function naming in htc.c
ath6kl: separate firmware fetch from upload
ath6kl: fix busy loop in ath6kl_bmi_get_rx_lkahd()
ath6kl: add support for firmware API 2 format
ath6kl: refactor firmware load address code
ath6kl: refactor firmware ext data addr and reserved ram handling size
ath6kl: read firmware start address from hardware
ath6kl: read reserved ram size from firmware file
ath6kl: add firmware capabilities support
Merge remote branch 'wireless-next/master' into ath6kl-next
ath6kl: pass only unicast frames for aggregation
ath6kl: allow firmware to override firmware patch address
ath6kl: silence "invalid rate" warning
ath6kl: add prefix parameter to ath6kl_dbg_dump()
ath6kl: add sdio debug messages
ath6kl: add debug logs for booting
ath6kl: improve wmi debug messages
ath6kl: fix size_t related warnings
ath6kl: include vmalloc.h in debug.c
Kevin Fang (1):
ath6kl: Add beginning of AR6004 initialisation support
Larry Finger (2):
rtlwifi: Remove unused routine _usb_readN_sync
rtlwifi: Remove unused _usb_nbytes_read_write and _usb_writeN_sync
Lorenzo Bianconi (1):
mac80211: max_tp_rate2 management of minstrel_ht
Luis R. Rodriguez (1):
ath9k_htc: add AVM FRITZ!WLAN 11N v2 support
Mat Martineau (3):
Bluetooth: Linearize skbs for use in BNEP, CMTP, HIDP, and RFCOMM
Bluetooth: Handle fragmented skbs in bt_sock_stream_recvmsg()
Bluetooth: Perform L2CAP SDU reassembly without copying data
Mohammed Shafi Shajakhan (4):
ath9k/ath9k_htc: Fix PS wrappers for RF kill
ath9k_hw: extend GPIO pin select mask for rfkill
ath9k_hw: Fix number of GPIO pins for AR9287/9300
ath9k_hw: set pci_express capability true for AR9480
Oliver Neukum (1):
btusb: add device entry for Broadcom SoftSailing
Peter Hurley (1):
Bluetooth: Allow ACL packets over USB in HCI_RAW mode
Raja Mani (2):
ath6kl: Avoid finding bss presence in cfg80211 scan list
ath6kl: Check sme state before delivering disconnect event to cfg80211
Rajkumar Manoharan (4):
ath6kl: Fix compilation error while compiling w/o debug
ath9k: Remove unnecessary AMPDU check at tx status
ath9k: Remove redundant my beacon check at ath_rx_ps_beacon
mac80211: Send nullfunc frames at lower rate during connection monitor
Sam Leffler (1):
ath6kl: query device tree for firmware board-id
Sangwook Lee (1):
net:rfkill: add a gpio setup function into GPIO rfkill
Stephen Rothwell (1):
wireless/ath6kl: use of module_param requires the inclusion of moduleparam.h
Szymon Janc (1):
Bluetooth: Mark not declared l2cap_core functions as static
Vasanthakumar Thiagarajan (21):
ath6kl: Release ar->lock right afer updating net_stats in ath6kl_rx()
ath6kl: Minor cleanup in min_hdr_len computation
ath6kl: Cleanup ath6kl_wmi_data_hdr_remove()
ath6kl: Fix bug in computing AMSU subframe padding
ath6kl: Fix buffer alignment for scatter-gather I/O
ath6kl: Fix system freeze under heavy data load
ath6kl: Remove unused meta_v2 from ath6kl_data_tx()
ath6kl: Add wmi meta data information only it is available
ath6kl: Avoid rolling back of entire scatter setup in case of failure
ath6kl: Add initial debugfs changes
ath6kl: Add debugfs entry to dump target stats
ath6kl: Add debugfs file entry to dump credit distribution stats
ath6kl: Add debugfs interface to dump diagnostic registers from firmware
ath6kl: Fix endianness in requesting chip register read
ath6kl: Make ath6kl_diag_write32() non-static
ath6kl: Fix endianness in register write
ath6kl: Add debugfs support to write a chip register
ath6kl: Remove auth type fall back in auto authentication mode
ath6kl: Set the sme_state to disconnected in disconnect() callback
ath6kl: Fix disconnect event reporting
ath6kl: Remove unnecessary retrieval of first list entry in ath6kl_htc_tx_setup_scat_list()
Vivek Natarajan (4):
ath6kl: Add debugfs entry to modify roaming parameters.
ath6kl: Process regulatory requests from firmware.
ath6kl: deinitialise wiphy on error
ath6kl: Indicate the roaming capability of the firmware
Waldemar Rymarkiewicz (1):
Bluetooth: Fix possible NULL pointer dereference
Yogesh Ashok Powar (1):
mwifiex: add cfg80211 handlers add/del_virtual_intf
Documentation/DocBook/80211.tmpl | 11 +-
Documentation/feature-removal-schedule.txt | 9 +
drivers/bluetooth/btusb.c | 6 +-
drivers/net/wireless/Makefile | 2 +-
drivers/net/wireless/at76c50x-usb.c | 18 +-
drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +-
drivers/net/wireless/ath/ath6kl/Makefile | 4 +-
drivers/net/wireless/ath/ath6kl/bmi.c | 23 +-
drivers/net/wireless/ath/ath6kl/bmi.h | 4 +-
drivers/net/wireless/ath/ath6kl/cfg80211.c | 894 ++++++++++++-----
drivers/net/wireless/ath/ath6kl/common.h | 83 --
drivers/net/wireless/ath/ath6kl/core.h | 145 +++-
drivers/net/wireless/ath/ath6kl/debug.c | 784 +++++++++++++++
drivers/net/wireless/ath/ath6kl/debug.h | 49 +-
drivers/net/wireless/ath/ath6kl/hif-ops.h | 5 +
drivers/net/wireless/ath/ath6kl/hif.h | 1 +
drivers/net/wireless/ath/ath6kl/htc.c | 271 +++---
drivers/net/wireless/ath/ath6kl/init.c | 794 ++++++++++++----
drivers/net/wireless/ath/ath6kl/main.c | 448 ++++++---
drivers/net/wireless/ath/ath6kl/node.c | 234 -----
drivers/net/wireless/ath/ath6kl/sdio.c | 79 ++-
drivers/net/wireless/ath/ath6kl/target.h | 41 +-
drivers/net/wireless/ath/ath6kl/testmode.c | 167 ++++
drivers/net/wireless/ath/ath6kl/testmode.h | 36 +
drivers/net/wireless/ath/ath6kl/txrx.c | 61 +-
drivers/net/wireless/ath/ath6kl/wmi.c | 1126 +++++++++++++++-------
drivers/net/wireless/ath/ath6kl/wmi.h | 350 ++++++-
drivers/net/wireless/ath/ath9k/ath9k.h | 3 +-
drivers/net/wireless/ath/ath9k/eeprom.h | 7 +-
drivers/net/wireless/ath/ath9k/gpio.c | 7 +-
drivers/net/wireless/ath/ath9k/hif_usb.c | 1 +
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 10 +-
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 +-
drivers/net/wireless/ath/ath9k/hw.c | 11 +-
drivers/net/wireless/ath/ath9k/main.c | 6 +-
drivers/net/wireless/ath/ath9k/rc.c | 6 -
drivers/net/wireless/ath/ath9k/recv.c | 23 +-
drivers/net/wireless/ath/ath9k/xmit.c | 19 +-
drivers/net/wireless/ath/carl9170/main.c | 3 +-
drivers/net/wireless/b43/main.c | 3 +-
drivers/net/wireless/b43legacy/main.c | 3 +-
drivers/net/wireless/iwlegacy/iwl-4965-tx.c | 2 +-
drivers/net/wireless/iwlegacy/iwl-core.c | 3 +-
drivers/net/wireless/iwlegacy/iwl-core.h | 3 +-
drivers/net/wireless/iwlwifi/Kconfig | 22 +-
drivers/net/wireless/iwlwifi/Makefile | 40 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 3 -
drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-agn.c | 1 +
drivers/net/wireless/iwlwifi/iwl-core.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-core.h | 3 +-
drivers/net/wireless/iwlwifi/iwl-shared.h | 2 +-
drivers/net/wireless/libertas/dev.h | 1 +
drivers/net/wireless/libertas/main.c | 35 +
drivers/net/wireless/mac80211_hwsim.c | 3 +-
drivers/net/wireless/mwifiex/11n_aggr.c | 2 -
drivers/net/wireless/mwifiex/11n_aggr.h | 1 +
drivers/net/wireless/mwifiex/cfg80211.c | 176 +++-
drivers/net/wireless/mwifiex/cfg80211.h | 3 +-
drivers/net/wireless/mwifiex/decl.h | 8 -
drivers/net/wireless/mwifiex/init.c | 2 +-
drivers/net/wireless/mwifiex/main.c | 266 +----
drivers/net/wireless/mwifiex/main.h | 19 +-
drivers/net/wireless/mwifiex/sta_ioctl.c | 46 +-
drivers/net/wireless/mwifiex/wmm.c | 32 +-
drivers/net/wireless/mwl8k.c | 5 +-
drivers/net/wireless/p54/main.c | 3 +-
drivers/net/wireless/p54/txrx.c | 2 +-
drivers/net/wireless/rt2x00/rt2400pci.c | 5 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 5 +-
drivers/net/wireless/rt2x00/rt2800lib.h | 3 +-
drivers/net/wireless/rt2x00/rt2x00.h | 3 +-
drivers/net/wireless/rt2x00/rt2x00mac.c | 3 +-
drivers/net/wireless/rt2x00/rt61pci.c | 5 +-
drivers/net/wireless/rt2x00/rt73usb.c | 5 +-
drivers/net/wireless/rtl818x/rtl8187/dev.c | 3 +-
drivers/net/wireless/rtlwifi/core.c | 3 +-
drivers/net/wireless/rtlwifi/usb.c | 40 -
drivers/net/wireless/rtlwifi/wifi.h | 8 +-
drivers/net/wireless/wl1251/main.c | 3 +-
drivers/net/wireless/wl12xx/main.c | 3 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 7 +-
include/linux/ieee80211.h | 85 ++
include/linux/if_ether.h | 1 +
include/linux/nl80211.h | 44 +
include/linux/rfkill-gpio.h | 4 +
include/net/bluetooth/l2cap.h | 3 +-
include/net/cfg80211.h | 29 +
include/net/ieee80211_radiotap.h | 1 +
include/net/mac80211.h | 229 +++++-
net/bluetooth/af_bluetooth.c | 30 +-
net/bluetooth/bnep/core.c | 5 +-
net/bluetooth/cmtp/core.c | 5 +-
net/bluetooth/hci_conn.c | 14 +-
net/bluetooth/hci_event.c | 20 +-
net/bluetooth/hidp/core.c | 10 +-
net/bluetooth/l2cap_core.c | 255 ++----
net/bluetooth/rfcomm/core.c | 5 +-
net/mac80211/Kconfig | 12 +
net/mac80211/agg-rx.c | 2 +-
net/mac80211/agg-tx.c | 2 +-
net/mac80211/cfg.c | 380 +++++++-
net/mac80211/debugfs_sta.c | 37 +-
net/mac80211/driver-ops.h | 33 +-
net/mac80211/driver-trace.h | 77 ++
net/mac80211/ht.c | 2 +-
net/mac80211/ibss.c | 4 +-
net/mac80211/ieee80211_i.h | 16 +-
net/mac80211/iface.c | 4 +-
net/mac80211/key.c | 4 +-
net/mac80211/main.c | 18 +
net/mac80211/mesh.c | 58 --
net/mac80211/mesh.h | 4 -
net/mac80211/mesh_plink.c | 12 +-
net/mac80211/mlme.c | 34 +-
net/mac80211/pm.c | 2 +-
net/mac80211/rate.c | 8 +-
net/mac80211/rc80211_minstrel_ht.c | 2 +
net/mac80211/rx.c | 118 ++-
net/mac80211/sta_info.c | 636 ++++++++++---
net/mac80211/sta_info.h | 136 ++--
net/mac80211/status.c | 54 +-
net/mac80211/tx.c | 187 +++--
net/mac80211/util.c | 76 ++-
net/mac80211/wme.c | 4 +-
net/rfkill/rfkill-gpio.c | 11 +
net/wireless/nl80211.c | 109 ++-
net/wireless/util.c | 5 +-
128 files changed, 6629 insertions(+), 2696 deletions(-)
delete mode 100644 drivers/net/wireless/ath/ath6kl/node.c
create mode 100644 drivers/net/wireless/ath/ath6kl/testmode.c
create mode 100644 drivers/net/wireless/ath/ath6kl/testmode.h
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: pull request: wireless-next 2011-10-11
From: John W. Linville @ 2011-10-11 19:38 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20111011191616.GF6558-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 19505 bytes --]
On Tue, Oct 11, 2011 at 03:16:16PM -0400, John W. Linville wrote:
> commit bfb3780bc9b622422c1f0d3e12371a70863000da
>
> Dave,
>
> Here is another wireless batch intended for 3.2... Highlights include a
> bluetooth pull with some refactoring, a big pull of ath6kl updates, a
> flurry of mac80211 patches from Johannes, and the usual strong ath9k
> showing.
>
> Please let me know if there are problems!
There was a problem -- a warning in ath6kl. Sorry about that!
commit 094daf7db7c47861009899ce23f9177d761e20b0
Dave,
Here is another wireless batch intended for 3.2... Highlights include a
bluetooth pull with some refactoring, a big pull of ath6kl updates, a
flurry of mac80211 patches from Johannes, and the usual strong ath9k
showing.
Please let me know if there are problems!
Thanks,
John
P.S. This version correct a warning due to some merge damage in
ath6kl...
---
The following changes since commit 3ed6f6958c0ac21958285d8648f14d34da4bbcb3:
ll_temac: convert to SKB paged frag API. (2011-10-10 15:19:13 -0400)
are available in the git repository at:
git://git.infradead.org/users/linville/wireless-next.git for-davem
Amitkumar Karwar (5):
mwifiex: remove unnecessary mwifiex_dump_station_info() call
mwifiex: remove unreachable code
mwifiex: fix Tx data rate display issue
mwifiex: correct AMSDU aggregation check
mwifiex: handle an error path correctly
Anderson Lizardo (1):
Bluetooth: use recommended LE connection parameters
Andre Guedes (1):
Bluetooth: hci_le_adv_report_evt code refactoring
Andy Shevchenko (1):
wireless: at76c50x: use native hex_pack_byte() method
Arik Nemtsov (5):
nl80211: support sending TDLS commands/frames
mac80211: standardize adding supported rates IEs
mac80211: handle TDLS high-level commands and frames
nl80211/mac80211: allow adding TDLS peers as stations
mac80211: data path modification for TDLS peers
Daniel Drake (1):
libertas: detect TX lockups and reset hardware
Don Fry (1):
iwlagn: rename iwlagn module iwlwifi and alias to iwlagn.
Edward Lu (4):
ath6kl: Support channel set request for startscan command
ath6kl: Fix a typo in ath6k context
ath6kl: Fix default key installation in AP mode
ath6kl: Do not clear CONNECT bit setting in AP mode for STA disconnect
Eliad Peller (1):
mac80211: pass vif param to conf_tx() callback
Greg Dietsche (1):
iwlagn: iwl-agn-rs: remove unnecessary null check for sta and lq_sta
Helmut Schaa (1):
mac80211: Allow noack flag overwrite for injected frames
Johannes Berg (17):
cfg80211/mac80211: apply station uAPSD parameters selectively
mac80211: let drivers inform it about per TID buffered frames
mac80211: unify TIM bit handling
mac80211: also expire filtered frames
mac80211: split PS buffers into ACs
mac80211: remove return value from add_pending_skbs
mac80211: clear more-data bit on filtered frames
mac80211: allow releasing driver-buffered frames
mac80211: implement uAPSD
mac80211: send (QoS) Null if no buffered frames
mac80211: reply only once to each PS-poll
mac80211: optimise station flags
mac80211: add missing station flags to debugfs
mac80211: explicitly notify drivers of frame release
mac80211: allow out-of-band EOSP notification
mac80211: document client powersave
mac80211: dont assign seqno to or aggregate QoS Null frames
John W. Linville (3):
Merge branch 'for-linville' of git://github.com/kvalo/ath6kl
Merge branch 'master' of git://github.com/padovan/bluetooth-next
Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davem
Jouni Malinen (37):
ath6kl: Use cfg80211_inform_bss instead of cfg80211_inform_bss_frame
ath6kl: Add functionality for starting AP mode
ath6kl: Fix AP mode (Re)AssocReq IE processing
ath6kl: Delay initial group key setup in AP mode
ath6kl: Use change_station() to authorize/unauthorize STAs
ath6kl: Add new WMI commands and events for P2P
ath6kl: Implement remain_on_channel and cancel_remain_on_channel
ath6kl: Implement mgmt_tx
ath6kl: Request P2P capabilities during target init
ath6kl: Add cfg80211 calls for remain-on-channel events
ath6kl: Use set_appie command to add Probe Request IEs
ath6kl: Report received Probe Request frames to cfg80211
ath6kl: Notify cfg80211 of TX status of mgmt_tx frames
ath6kl: Report received Action frames to cfg80211
ath6kl: Advertise supported mgmt_stypes
ath6kl: Add support for new P2P iftypes in mode changes
ath6kl: Include P2P IE(s) in GO Probe Response depending on request
ath6kl: Return error from wmi.c instead of -EIO in ath6kl_cfg80211_scan
ath6kl: Define __CHECK_ENDIAN__ for sparse
ath6kl: Do not enable Probe Request reporting by default
athk6l: Fix channel list processing in scan requests
ath6kl: Fix WMI message structure for AP_SET_PVB
ath6kl: Fix AP mode connect event parsing and TIM updates
ath6kl: Allow AP mode to be configured
ath6kl: Allow enabling of P2P support
ath6kl: Fix static WEP configuration in AP mode
ath6kl: Fix BSS update on roaming
ath6kl: Remove deprecated WMI_OPT_RX_FRAME_EVENTID processing
ath6kl: Remove RSSI update for internal node table
ath6kl: Remove unnecessary node table update on disconnect event
ath6kl: Replace internal node table with cfg80211 BSS table
ath6kl: Remove the unused node table implementation
ath6kl: Remove unnecessary bssinfo event header conversion
ath6kl: Update BSS information after connection
ath6kl: Export beacon interval and DTIM period through STA info
ath6kl: Report PMKSA candidate events through cfg80211
ath6kl: fix TCP corruption
Kalle Valo (28):
ath6kl: fix indentation in htc_issued_send()
ath6kl: implement suspend support
ath6kl: add testmode support
ath6kl: fix compilation when NL80211_TESTMODE is disabled
ath6kl: add firmware log support
ath6kl: implement support to set firmware log parameters
ath6kl: cleanup diagnose window read and write functions
ath6kl: read fwlog from firmware ring buffer
ath6kl: unify tx function names in htc.c
ath6kl: unify rx function naming in htc.c
ath6kl: separate firmware fetch from upload
ath6kl: fix busy loop in ath6kl_bmi_get_rx_lkahd()
ath6kl: add support for firmware API 2 format
ath6kl: refactor firmware load address code
ath6kl: refactor firmware ext data addr and reserved ram handling size
ath6kl: read firmware start address from hardware
ath6kl: read reserved ram size from firmware file
ath6kl: add firmware capabilities support
Merge remote branch 'wireless-next/master' into ath6kl-next
ath6kl: pass only unicast frames for aggregation
ath6kl: allow firmware to override firmware patch address
ath6kl: silence "invalid rate" warning
ath6kl: add prefix parameter to ath6kl_dbg_dump()
ath6kl: add sdio debug messages
ath6kl: add debug logs for booting
ath6kl: improve wmi debug messages
ath6kl: fix size_t related warnings
ath6kl: include vmalloc.h in debug.c
Kevin Fang (1):
ath6kl: Add beginning of AR6004 initialisation support
Larry Finger (2):
rtlwifi: Remove unused routine _usb_readN_sync
rtlwifi: Remove unused _usb_nbytes_read_write and _usb_writeN_sync
Lorenzo Bianconi (1):
mac80211: max_tp_rate2 management of minstrel_ht
Luis R. Rodriguez (1):
ath9k_htc: add AVM FRITZ!WLAN 11N v2 support
Mat Martineau (3):
Bluetooth: Linearize skbs for use in BNEP, CMTP, HIDP, and RFCOMM
Bluetooth: Handle fragmented skbs in bt_sock_stream_recvmsg()
Bluetooth: Perform L2CAP SDU reassembly without copying data
Mohammed Shafi Shajakhan (4):
ath9k/ath9k_htc: Fix PS wrappers for RF kill
ath9k_hw: extend GPIO pin select mask for rfkill
ath9k_hw: Fix number of GPIO pins for AR9287/9300
ath9k_hw: set pci_express capability true for AR9480
Oliver Neukum (1):
btusb: add device entry for Broadcom SoftSailing
Peter Hurley (1):
Bluetooth: Allow ACL packets over USB in HCI_RAW mode
Raja Mani (2):
ath6kl: Avoid finding bss presence in cfg80211 scan list
ath6kl: Check sme state before delivering disconnect event to cfg80211
Rajkumar Manoharan (4):
ath6kl: Fix compilation error while compiling w/o debug
ath9k: Remove unnecessary AMPDU check at tx status
ath9k: Remove redundant my beacon check at ath_rx_ps_beacon
mac80211: Send nullfunc frames at lower rate during connection monitor
Sam Leffler (1):
ath6kl: query device tree for firmware board-id
Sangwook Lee (1):
net:rfkill: add a gpio setup function into GPIO rfkill
Stephen Rothwell (1):
wireless/ath6kl: use of module_param requires the inclusion of moduleparam.h
Szymon Janc (1):
Bluetooth: Mark not declared l2cap_core functions as static
Vasanthakumar Thiagarajan (21):
ath6kl: Release ar->lock right afer updating net_stats in ath6kl_rx()
ath6kl: Minor cleanup in min_hdr_len computation
ath6kl: Cleanup ath6kl_wmi_data_hdr_remove()
ath6kl: Fix bug in computing AMSU subframe padding
ath6kl: Fix buffer alignment for scatter-gather I/O
ath6kl: Fix system freeze under heavy data load
ath6kl: Remove unused meta_v2 from ath6kl_data_tx()
ath6kl: Add wmi meta data information only it is available
ath6kl: Avoid rolling back of entire scatter setup in case of failure
ath6kl: Add initial debugfs changes
ath6kl: Add debugfs entry to dump target stats
ath6kl: Add debugfs file entry to dump credit distribution stats
ath6kl: Add debugfs interface to dump diagnostic registers from firmware
ath6kl: Fix endianness in requesting chip register read
ath6kl: Make ath6kl_diag_write32() non-static
ath6kl: Fix endianness in register write
ath6kl: Add debugfs support to write a chip register
ath6kl: Remove auth type fall back in auto authentication mode
ath6kl: Set the sme_state to disconnected in disconnect() callback
ath6kl: Fix disconnect event reporting
ath6kl: Remove unnecessary retrieval of first list entry in ath6kl_htc_tx_setup_scat_list()
Vivek Natarajan (4):
ath6kl: Add debugfs entry to modify roaming parameters.
ath6kl: Process regulatory requests from firmware.
ath6kl: deinitialise wiphy on error
ath6kl: Indicate the roaming capability of the firmware
Waldemar Rymarkiewicz (1):
Bluetooth: Fix possible NULL pointer dereference
Yogesh Ashok Powar (1):
mwifiex: add cfg80211 handlers add/del_virtual_intf
Documentation/DocBook/80211.tmpl | 11 +-
Documentation/feature-removal-schedule.txt | 9 +
drivers/bluetooth/btusb.c | 6 +-
drivers/net/wireless/Makefile | 2 +-
drivers/net/wireless/at76c50x-usb.c | 18 +-
drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +-
drivers/net/wireless/ath/ath6kl/Makefile | 4 +-
drivers/net/wireless/ath/ath6kl/bmi.c | 23 +-
drivers/net/wireless/ath/ath6kl/bmi.h | 4 +-
drivers/net/wireless/ath/ath6kl/cfg80211.c | 894 ++++++++++++-----
drivers/net/wireless/ath/ath6kl/common.h | 83 --
drivers/net/wireless/ath/ath6kl/core.h | 145 +++-
drivers/net/wireless/ath/ath6kl/debug.c | 784 +++++++++++++++
drivers/net/wireless/ath/ath6kl/debug.h | 49 +-
drivers/net/wireless/ath/ath6kl/hif-ops.h | 5 +
drivers/net/wireless/ath/ath6kl/hif.h | 1 +
drivers/net/wireless/ath/ath6kl/htc.c | 271 +++---
drivers/net/wireless/ath/ath6kl/init.c | 794 ++++++++++++----
drivers/net/wireless/ath/ath6kl/main.c | 448 ++++++---
drivers/net/wireless/ath/ath6kl/node.c | 234 -----
drivers/net/wireless/ath/ath6kl/sdio.c | 79 ++-
drivers/net/wireless/ath/ath6kl/target.h | 41 +-
drivers/net/wireless/ath/ath6kl/testmode.c | 167 ++++
drivers/net/wireless/ath/ath6kl/testmode.h | 36 +
drivers/net/wireless/ath/ath6kl/txrx.c | 61 +-
drivers/net/wireless/ath/ath6kl/wmi.c | 1126 +++++++++++++++-------
drivers/net/wireless/ath/ath6kl/wmi.h | 350 ++++++-
drivers/net/wireless/ath/ath9k/ath9k.h | 3 +-
drivers/net/wireless/ath/ath9k/eeprom.h | 7 +-
drivers/net/wireless/ath/ath9k/gpio.c | 7 +-
drivers/net/wireless/ath/ath9k/hif_usb.c | 1 +
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 10 +-
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 +-
drivers/net/wireless/ath/ath9k/hw.c | 11 +-
drivers/net/wireless/ath/ath9k/main.c | 6 +-
drivers/net/wireless/ath/ath9k/rc.c | 6 -
drivers/net/wireless/ath/ath9k/recv.c | 23 +-
drivers/net/wireless/ath/ath9k/xmit.c | 19 +-
drivers/net/wireless/ath/carl9170/main.c | 3 +-
drivers/net/wireless/b43/main.c | 3 +-
drivers/net/wireless/b43legacy/main.c | 3 +-
drivers/net/wireless/iwlegacy/iwl-4965-tx.c | 2 +-
drivers/net/wireless/iwlegacy/iwl-core.c | 3 +-
drivers/net/wireless/iwlegacy/iwl-core.h | 3 +-
drivers/net/wireless/iwlwifi/Kconfig | 22 +-
drivers/net/wireless/iwlwifi/Makefile | 40 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 3 -
drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-agn.c | 1 +
drivers/net/wireless/iwlwifi/iwl-core.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-core.h | 3 +-
drivers/net/wireless/iwlwifi/iwl-shared.h | 2 +-
drivers/net/wireless/libertas/dev.h | 1 +
drivers/net/wireless/libertas/main.c | 35 +
drivers/net/wireless/mac80211_hwsim.c | 3 +-
drivers/net/wireless/mwifiex/11n_aggr.c | 2 -
drivers/net/wireless/mwifiex/11n_aggr.h | 1 +
drivers/net/wireless/mwifiex/cfg80211.c | 176 +++-
drivers/net/wireless/mwifiex/cfg80211.h | 3 +-
drivers/net/wireless/mwifiex/decl.h | 8 -
drivers/net/wireless/mwifiex/init.c | 2 +-
drivers/net/wireless/mwifiex/main.c | 266 +----
drivers/net/wireless/mwifiex/main.h | 19 +-
drivers/net/wireless/mwifiex/sta_ioctl.c | 46 +-
drivers/net/wireless/mwifiex/wmm.c | 32 +-
drivers/net/wireless/mwl8k.c | 5 +-
drivers/net/wireless/p54/main.c | 3 +-
drivers/net/wireless/p54/txrx.c | 2 +-
drivers/net/wireless/rt2x00/rt2400pci.c | 5 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 5 +-
drivers/net/wireless/rt2x00/rt2800lib.h | 3 +-
drivers/net/wireless/rt2x00/rt2x00.h | 3 +-
drivers/net/wireless/rt2x00/rt2x00mac.c | 3 +-
drivers/net/wireless/rt2x00/rt61pci.c | 5 +-
drivers/net/wireless/rt2x00/rt73usb.c | 5 +-
drivers/net/wireless/rtl818x/rtl8187/dev.c | 3 +-
drivers/net/wireless/rtlwifi/core.c | 3 +-
drivers/net/wireless/rtlwifi/usb.c | 40 -
drivers/net/wireless/rtlwifi/wifi.h | 8 +-
drivers/net/wireless/wl1251/main.c | 3 +-
drivers/net/wireless/wl12xx/main.c | 3 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 7 +-
include/linux/ieee80211.h | 85 ++
include/linux/if_ether.h | 1 +
include/linux/nl80211.h | 44 +
include/linux/rfkill-gpio.h | 4 +
include/net/bluetooth/l2cap.h | 3 +-
include/net/cfg80211.h | 29 +
include/net/ieee80211_radiotap.h | 1 +
include/net/mac80211.h | 229 +++++-
net/bluetooth/af_bluetooth.c | 30 +-
net/bluetooth/bnep/core.c | 5 +-
net/bluetooth/cmtp/core.c | 5 +-
net/bluetooth/hci_conn.c | 14 +-
net/bluetooth/hci_event.c | 20 +-
net/bluetooth/hidp/core.c | 10 +-
net/bluetooth/l2cap_core.c | 255 ++----
net/bluetooth/rfcomm/core.c | 5 +-
net/mac80211/Kconfig | 12 +
net/mac80211/agg-rx.c | 2 +-
net/mac80211/agg-tx.c | 2 +-
net/mac80211/cfg.c | 380 +++++++-
net/mac80211/debugfs_sta.c | 37 +-
net/mac80211/driver-ops.h | 33 +-
net/mac80211/driver-trace.h | 77 ++
net/mac80211/ht.c | 2 +-
net/mac80211/ibss.c | 4 +-
net/mac80211/ieee80211_i.h | 16 +-
net/mac80211/iface.c | 4 +-
net/mac80211/key.c | 4 +-
net/mac80211/main.c | 18 +
net/mac80211/mesh.c | 58 --
net/mac80211/mesh.h | 4 -
net/mac80211/mesh_plink.c | 12 +-
net/mac80211/mlme.c | 34 +-
net/mac80211/pm.c | 2 +-
net/mac80211/rate.c | 8 +-
net/mac80211/rc80211_minstrel_ht.c | 2 +
net/mac80211/rx.c | 118 ++-
net/mac80211/sta_info.c | 636 ++++++++++---
net/mac80211/sta_info.h | 136 ++--
net/mac80211/status.c | 54 +-
net/mac80211/tx.c | 187 +++--
net/mac80211/util.c | 76 ++-
net/mac80211/wme.c | 4 +-
net/rfkill/rfkill-gpio.c | 11 +
net/wireless/nl80211.c | 109 ++-
net/wireless/util.c | 5 +-
128 files changed, 6629 insertions(+), 2696 deletions(-)
delete mode 100644 drivers/net/wireless/ath/ath6kl/node.c
create mode 100644 drivers/net/wireless/ath/ath6kl/testmode.c
create mode 100644 drivers/net/wireless/ath/ath6kl/testmode.h
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: pull request: wireless-next 2011-10-11
From: David Miller @ 2011-10-11 19:40 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20111011191616.GF6558@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Tue, 11 Oct 2011 15:16:16 -0400
> Here is another wireless batch intended for 3.2... Highlights include a
> bluetooth pull with some refactoring, a big pull of ath6kl updates, a
> flurry of mac80211 patches from Johannes, and the usual strong ath9k
> showing.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* Re: [net-next 1/5] stmmac: add CHAINED descriptor mode support
From: David Miller @ 2011-10-11 19:42 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: netdev, rayagond
In-Reply-To: <1318318246-1326-2-git-send-email-peppe.cavallaro@st.com>
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Tue, 11 Oct 2011 09:30:42 +0200
> From: Rayagond Kokatanur <rayagond@vayavyalabs.com>
>
> This patch enhances the STMMAC driver to support CHAINED mode of
> descriptor (useful also on validation side).
>
> STMMAC supports DMA descriptor to operate both in dual buffer(RING)
> and linked-list(CHAINED) mode. In RING mode (default) each descriptor
> points to two data buffer pointers whereas in CHAINED mode they point
> to only one data buffer pointer.
>
> In CHAINED mode each descriptor will have pointer to next descriptor in
> the list, hence creating the explicit chaining in the descriptor itself,
> whereas such explicit chaining is not possible in RING mode.
>
> Signed-off-by: Rayagond Kokatanur <rayagond@vayavyalabs.com>
> Hacked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
These ifdefs added all over the place in the foo.c files are terrible.
Abstract out the differences between RING and CHAINED mode into helper
inline routines which live in some foo.h header file, that way you won't
need any ifdefs in the driver foo.c files.
^ permalink raw reply
* Re: pull request: wireless-next 2011-10-11
From: David Miller @ 2011-10-11 19:45 UTC (permalink / raw)
To: linville-2XuSBdqkA4R54TAoqtyWWQ
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20111011193806.GI6558-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Date: Tue, 11 Oct 2011 15:38:06 -0400
> On Tue, Oct 11, 2011 at 03:16:16PM -0400, John W. Linville wrote:
>> commit bfb3780bc9b622422c1f0d3e12371a70863000da
>>
>> Dave,
>>
>> Here is another wireless batch intended for 3.2... Highlights include a
>> bluetooth pull with some refactoring, a big pull of ath6kl updates, a
>> flurry of mac80211 patches from Johannes, and the usual strong ath9k
>> showing.
>>
>> Please let me know if there are problems!
>
> There was a problem -- a warning in ath6kl. Sorry about that!
>
> commit 094daf7db7c47861009899ce23f9177d761e20b0
I made sure I got the most recent changes.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: pull request: wireless-next 2011-10-11
From: John W. Linville @ 2011-10-11 19:51 UTC (permalink / raw)
To: David Miller
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20111011.154526.442711861363485253.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Tue, Oct 11, 2011 at 03:45:26PM -0400, David Miller wrote:
> From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
> Date: Tue, 11 Oct 2011 15:38:06 -0400
>
> > On Tue, Oct 11, 2011 at 03:16:16PM -0400, John W. Linville wrote:
> >> commit bfb3780bc9b622422c1f0d3e12371a70863000da
> >>
> >> Dave,
> >>
> >> Here is another wireless batch intended for 3.2... Highlights include a
> >> bluetooth pull with some refactoring, a big pull of ath6kl updates, a
> >> flurry of mac80211 patches from Johannes, and the usual strong ath9k
> >> showing.
> >>
> >> Please let me know if there are problems!
> >
> > There was a problem -- a warning in ath6kl. Sorry about that!
> >
> > commit 094daf7db7c47861009899ce23f9177d761e20b0
>
> I made sure I got the most recent changes.
Cool -- sorry for the confusion!
John
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2011-10-11 19:54 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
Just a few driver bugs, and one missing state update during ipv6 GRO processing.
1) When iSCSI and FCOE are both in use, bnx2x allocated conflicting client IDs.
Fix from Dmitry Kravkov.
2) MSCAN CAN driver copies one byte to many on odd packet lengths, fix from
Wolfgang Grandegger.
3) Blue frame support in mlx4_en driver is busted on PowerPC due to endian
bugs, fix from Thadeu Lima de Souza Cascardo.
4) When GRO pulls ipv6 extension headers, the protocol value changes,
so it has to reload the protocol ops pointer. Fix from Zheng Yan.
Please pull, thanks a lot!
The following changes since commit 65112dccf8a113737684366349d7f9ec373ddc47:
Merge git://git.samba.org/sfrench/cifs-2.6 (2011-10-10 14:53:11 +1200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
Dmitry Kravkov (1):
bnx2x: fix cl_id allocation for non-eth clients for NPAR mode
Thadeu Lima de Souza Cascardo (1):
mlx4_en: fix endianness with blue frame support
Wolfgang Grandegger (1):
mscan: too much data copied to CAN frame due to 16 bit accesses
Yan, Zheng (1):
gro: refetch inet6_protos[] after pulling ext headers
drivers/net/bnx2x/bnx2x.h | 20 +++++++++++++-------
drivers/net/bnx2x/bnx2x_cmn.h | 2 +-
drivers/net/can/mscan/mscan.c | 11 ++++++++---
drivers/net/mlx4/en_tx.c | 6 +++---
net/ipv6/af_inet6.c | 1 +
5 files changed, 26 insertions(+), 14 deletions(-)
^ permalink raw reply
* Re: [PATCH net 0/4] ipv4: various pmtu discovery fixes
From: David Miller @ 2011-10-11 19:54 UTC (permalink / raw)
To: steffen.klassert; +Cc: netdev
In-Reply-To: <20111011110842.GC1830@secunet.com>
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Tue, 11 Oct 2011 13:08:42 +0200
> This patchset addresses some issues I found during investigating
> pmtu discovery. These issues were introduced with
> git commit 2c8cec5 (ipv4: Cache learned PMTU information in inetpeer).
>
> The patchset is based on current net/master.
Thanks a lot for these bug fixes, Herbert Xu reported similar issues.
I'll review these patches tonight.
^ permalink raw reply
* Re: [patch] cipso: remove an unneeded NULL check in cipso_v4_doi_add()
From: Paul Moore @ 2011-10-11 21:20 UTC (permalink / raw)
To: Dan Carpenter, netdev
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, kernel-janitors
In-Reply-To: <20111011132228.GA27127@elgon.mountain>
On Tue, Oct 11, 2011 at 9:22 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We dereference doi_def on the line before the NULL check. It has
> been this way since 2008. I checked all the callers and doi_def is
> always non-NULL here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
> index 2c2a98e..86f3b88 100644
> --- a/net/ipv4/cipso_ipv4.c
> +++ b/net/ipv4/cipso_ipv4.c
> @@ -476,7 +476,7 @@ int cipso_v4_doi_add(struct cipso_v4_doi *doi_def,
> doi = doi_def->doi;
> doi_type = doi_def->type;
>
> - if (doi_def == NULL || doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
> + if (doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
> goto doi_add_return;
> for (iter = 0; iter < CIPSO_V4_TAG_MAXCNT; iter++) {
> switch (doi_def->tags[iter]) {
I'd prefer to keep the NULL check in there as it does afford a little
bit of extra safety and this is management code after all, not
per-packet processing code, so the extra check should have no
observable performance impact.
--
paul moore
www.paul-moore.com
^ permalink raw reply
* Re: [patch] cipso: remove an unneeded NULL check in cipso_v4_doi_add()
From: Dan Carpenter @ 2011-10-11 21:55 UTC (permalink / raw)
To: Paul Moore
Cc: netdev, David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, kernel-janitors
In-Reply-To: <CAHC9VhRMy-DbbkXSSWQPh8QgHAm5xzZ1qWJaYLiOERPagDfrbQ@mail.gmail.com>
On Tue, Oct 11, 2011 at 05:20:11PM -0400, Paul Moore wrote:
> > - if (doi_def == NULL || doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
> > + if (doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
> > goto doi_add_return;
> > for (iter = 0; iter < CIPSO_V4_TAG_MAXCNT; iter++) {
> > switch (doi_def->tags[iter]) {
>
> I'd prefer to keep the NULL check in there as it does afford a little
> bit of extra safety and this is management code after all, not
> per-packet processing code, so the extra check should have no
> observable performance impact.
The dereferences on the lines before mean we would Oops before
reaching the check. But I guess I can move the check forward. The
error handling at goto doi_add_return relies on a non-NULL value for
doi_def but I could just put a return in front of the dereference.
if (!doi_def)
return -EINVAL;
I'll send a patch to do this tomorrow.
regards,
dan carpenter
^ permalink raw reply
* Re: [patch] cipso: remove an unneeded NULL check in cipso_v4_doi_add()
From: David Miller @ 2011-10-11 22:42 UTC (permalink / raw)
To: dan.carpenter
Cc: paul, netdev, kuznet, jmorris, yoshfuji, kaber, kernel-janitors
In-Reply-To: <20111011215549.GC30887@longonot.mountain>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 12 Oct 2011 00:55:49 +0300
> On Tue, Oct 11, 2011 at 05:20:11PM -0400, Paul Moore wrote:
>> > - if (doi_def == NULL || doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
>> > + if (doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
>> > goto doi_add_return;
>> > for (iter = 0; iter < CIPSO_V4_TAG_MAXCNT; iter++) {
>> > switch (doi_def->tags[iter]) {
>>
>> I'd prefer to keep the NULL check in there as it does afford a little
>> bit of extra safety and this is management code after all, not
>> per-packet processing code, so the extra check should have no
>> observable performance impact.
>
> The dereferences on the lines before mean we would Oops before
> reaching the check. But I guess I can move the check forward. The
> error handling at goto doi_add_return relies on a non-NULL value for
> doi_def but I could just put a return in front of the dereference.
>
> if (!doi_def)
> return -EINVAL;
>
> I'll send a patch to do this tomorrow.
I think your original patch is still the best one.
Saying the NULL check should stay to provide "extra safety" is
complete garbage. Especially since, as Dan shows, we dereference the
pointer before to damn check.
I'll therefore apply Dan's original patch.
^ permalink raw reply
* Re: e100 + VLANs?
From: Jesse Brandeburg @ 2011-10-11 23:38 UTC (permalink / raw)
To: David Lamparter; +Cc: Michael Tokarev, Eric Dumazet, Kirsher, Jeffrey T, netdev
In-Reply-To: <20111011152917.GE2840382@jupiter.n2.diac24.net>
[-- Attachment #1: Type: text/plain, Size: 1820 bytes --]
On Tue, 11 Oct 2011 08:29:18 -0700
David Lamparter <equinox@diac24.net> wrote:
> On Tue, Oct 11, 2011 at 04:56:23PM +0400, Michael Tokarev wrote:
> > So it looks like the card merely ignores these packets.
> >
> > So little result for so much efforts... :(
> >
> > But it is not really that bad I think - it is an obsolete hardware.
>
> The knowledge and code for this is actually around line 1142 of e100.c:
> if (nic->mac >= mac_82558_D101_A4) {
> config->fc_disable = 0x1; /* 1=Tx fc off, 0=Tx fc on */
> config->mwi_enable = 0x1; /* 1=enable, 0=disable */
> config->standard_tcb = 0x0; /* 1=standard, 0=extended */
> config->rx_long_ok = 0x1; /* 1=VLANs ok, 0=standard */
>
> where rx_long_ok is the configuration bit to enable frame reception
> for >1514 byte frames. I guess your card is < mac_82558_D101_A4...
>
> (cf. "Intel 8255x 10/100 Mbps Ethernet Controller Family Open Source
> Software Developer Manual" page 78/86 - "Long Receive OK. This bit is
> reserved on the 82557 and should be set to 0. When this bit is set on
> the 82558 or 82559, the device considers received frames that have
> a data field longer than 1500 bytes as good frames.")
David, thank you for posting that, while you were typing I was
researching the same thing, so FWIW, I concur with your conclusion.
ouch, OP your hardware is really really old:
> 00:12.0 Ethernet controller: Intel Corporation 82557/8/9/0/1 Ethernet Pro 100 (rev 02)
> Subsystem: Intel Corporation EtherExpress PRO/100B (TX)
rev 2 is D100_C, which is 82557.
the hardware is NOT capable of long receives (i.e. vlan packets).
If it was then they should generally fit in the receive buffer and be
handled and not discarded.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 834 bytes --]
^ permalink raw reply
* Re: bridge: HSR support
From: Arvid Brodin @ 2011-10-11 23:51 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Lennert Buytenhek
In-Reply-To: <20111011112821.28cd3e51@nehalam.linuxnetplumber.net>
Stephen Hemminger wrote:
> On Tue, 11 Oct 2011 20:25:08 +0200
> Arvid Brodin <arvid.brodin@enea.com> wrote:
>
>> Hi,
>>
>> I want to add support for HSR ("High-availability Seamless Redundancy",
>> IEC-62439-3) to the bridge code. With HSR, all connected units have two network
>> ports and are connected in a ring. All new Ethernet packets are sent on both
>> ports (or passed through if the current unit is not the originating unit). The
>> same packet is never passed twice. Non-HSR units are not allowed in the ring.
>>
>> This gives instant, reconfiguration-free failover.
>>
>> I'd like your input on how to design the user interface. To me it seems natural
>> to use bridge-utils, which of course today supports STP.
>>
>> One solution is to simply add an "hsr" command:
>>
>> # brctl hsr <bridge> on|off
>>
>> But HSR is mutually exclusive to other modes, and I think that STP and standard
>> bridge mode are mutually exclusive, too? Perhaps it would be better (more user-
>> friendly) to
>>
>> # brctl type <bridge> standard|stp|hsr
>>
>> ?
>>
>> 'brctl stp <bridge> on|off' would have to be kept for compatibility, but could
>> be a simple wrapper for 'brctl type <bridge> stp|standard'
>>
>> What do you think about this?
>>
>>
>
> Why is it a bridge thing and not a standalone or bonding (or the new team
> device feature? Wouldn't users want to use it without all the stuff
> related to bridging. The fact that it doesn't work with STP is a big
> red flag that it doesn't belong in the bridge.
Good question! I'm new to the more advanced networking possibilities in Linux, so
I really don't know where HSR fits best.
HSR is a layer 2 only protocol, with the host acting as bridge for packets not
destined for itself. It also sends all originating Ethernet packets on both ports,
adding a HSR sequence tag to the packet (using a dedicated EtherType of 0x88FB).
As described above, the HSR units are connected in a ring, in which only HSR units
are allowed.
Having looked now at bonding, it seems to act on several network layers, doing
multiple things mainly centered around 802.3ad (link aggregation). I'm not sure
how HSR would fit there.
If I understand correctly, team device is an emerging userspace implementation of
the bonding driver?
I guess my take was that HSR seems like a special bridging mode, much like STP.
> Please discuss this on netdev mailing list, others may have different
> opinions.
Done! :)
--
Arvid Brodin
Enea Services Stockholm AB
^ permalink raw reply
* iproute2 back at kernel.org
From: Stephen Hemminger @ 2011-10-11 23:59 UTC (permalink / raw)
Cc: netdev
In-Reply-To: <20110916103031.7f22b35f@nehalam.linuxnetplumber.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Now that kernel.org is back online, the iproute2 repository is back
at it's old location.
git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2
I have frozen and tagged the v3.0 release, but don't have a good place
to put the tar ball yet (stay tuned). Also the signing key for the release
will be changing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAEBCAAGBQJOlNhMAAoJEICnf2CVzeR+3voP/A0OwSrzaGZIf8VMpPwqvhgM
xZ6EUasgIRPTqd0FNDkcoNTqT8hIUL+Cd26nxp09oySzPKYqhnWR0XHRLDrPEuir
dhifz6WXUF1ZqoKZU7hs1Ztg/tvM3S9nV8SI1hKNMp8tvxNS5p1kadTRb+yiyejz
oXj9fV7t8TCTwL0fzdFxo7dTeuCYo6q1nusbXVwGFUwqCd/i+XAPGPmCOx/KsYTf
F/JuseHBiylVKtBMbI/O1at4c6vxwih6KkXdwFFxVeDlFZHD+SroSn5UjxG+CvvB
vsAt6L0m3fbIHVksw9ULbMzeGU5/OdWMwxe6krHulXJdS8BWvSWaOVfEWoqdGoGT
fb2qvZRxsvTifhxUnKd7J1z2WfFKb+zkv4YyNWjtM0BJDozkta4JsuRWMBlhhSbr
3BA8mPIQyR4b+Qw64pGGaalx03RNCcdUSEbRKPVef6RXdEF6MK4UAuHrPdnzwWrM
k7qvBC0Ryk2xdq9eJZv4iCsC9LN/+copNAiYDooSas/w+Pg3PHKgpPTVNdHMSowI
gOhSANhG9qYXhhJETVTWmRDG8nMruS6RIM0XhxHYGJHtgZaKQAJhCw4BgHeEJylR
l5KwrEYWk42TBUqkxdLabdaWwOAPkLq3ujDKg0RMdw/yW+pWrQgGZ/F6PQljelVK
VClkP7ACBkE6EIfeVSe2
=RH8O
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: [PATCH] netconsole: enable netconsole can make net_device refcnt
From: Flavio Leitner @ 2011-10-12 1:11 UTC (permalink / raw)
To: Gao feng; +Cc: Wanlong Gao, netdev, davem
In-Reply-To: <4E93F8DC.5080909@cn.fujitsu.com>
On Tue, 11 Oct 2011 16:05:48 +0800
Gao feng <gaofeng@cn.fujitsu.com> wrote:
> Im so sorry.
> the first patch has some format err.
> Please use this one.
> thanks wanlong! ^V^
>
> 11.10.2011 15:50, Wanlong Gao wrote:
> > There is no check if netconsole is enabled current.
> > so when exec echo 1 > enabled;
> > the reference of net_device will increment always.
> >
> > Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> > ---
> > drivers/net/netconsole.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> > index ed2a397..4e6323df 100644
> > --- a/drivers/net/netconsole.c
> > +++ b/drivers/net/netconsole.c
> > @@ -307,6 +307,8 @@ static ssize_t store_enabled(struct
> > netconsole_target *nt, return err;
> > if (enabled < 0 || enabled > 1)
> > return -EINVAL;
> > + if (enabled == nt->enabled)
> > + return err;
It looks like 'err' will be 0. Maybe it is better to
return -EINVAL?
fbl
^ permalink raw reply
* [PATCH v2 1/3] phylib: Convert MDIO and PHY Lib drivers to support 10G
From: Andy Fleming @ 2011-10-12 1:20 UTC (permalink / raw)
To: davem; +Cc: netdev
10G MDIO is a totally different protocol (clause 45 of 802.3).
Supporting this new protocol requires a couple of changes:
* Add a new parameter to the mdiobus_read functions to specify the
"device address" inside the PHY.
* Add a phy45_read/write function which takes advantage of that
new parameter
* Convert all of the existing drivers to use the new format
I created a new clause-45-specific read/write functions because:
1) phy_read and phy_write are highly overloaded functions, and
finding every instance which is actually the PHY Lib version
was quite difficult
2) Most code which invokes phy_read/phy_write inside PHY Lib is
Clause-22-specific. None of the phy_read/phy_write invocations
were useable on 10G PHYs
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
Documentation/networking/phy.txt | 15 +++--
arch/powerpc/platforms/pasemi/gpio_mdio.c | 6 +-
drivers/net/ethernet/adi/bfin_mac.c | 7 +-
drivers/net/ethernet/aeroflex/greth.c | 5 +-
drivers/net/ethernet/amd/au1000_eth.c | 7 +-
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 +-
drivers/net/ethernet/broadcom/sb1250-mac.c | 7 +-
drivers/net/ethernet/broadcom/tg3.c | 5 +-
drivers/net/ethernet/cadence/macb.c | 7 +-
drivers/net/ethernet/dnet.c | 7 +-
drivers/net/ethernet/ethoc.c | 5 +-
drivers/net/ethernet/faraday/ftgmac100.c | 5 +-
drivers/net/ethernet/freescale/fec.c | 7 +-
drivers/net/ethernet/freescale/fec_mpc52xx_phy.c | 7 +-
drivers/net/ethernet/freescale/fs_enet/mii-fec.c | 6 +-
drivers/net/ethernet/freescale/fsl_pq_mdio.c | 13 ++--
drivers/net/ethernet/freescale/fsl_pq_mdio.h | 11 ++-
drivers/net/ethernet/lantiq_etop.c | 5 +-
drivers/net/ethernet/marvell/mv643xx_eth.c | 5 +-
drivers/net/ethernet/marvell/pxa168_eth.c | 7 +-
drivers/net/ethernet/rdc/r6040.c | 5 +-
drivers/net/ethernet/s6gmac.c | 5 +-
drivers/net/ethernet/smsc/smsc911x.c | 22 ++++---
drivers/net/ethernet/smsc/smsc9420.c | 10 ++-
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 9 ++-
drivers/net/ethernet/ti/cpmac.c | 4 +-
drivers/net/ethernet/ti/davinci_mdio.c | 5 +-
drivers/net/ethernet/toshiba/tc35815.c | 5 +-
drivers/net/ethernet/xilinx/ll_temac_mdio.c | 5 +-
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 9 ++-
drivers/net/ethernet/xscale/ixp4xx_eth.c | 7 +-
drivers/net/phy/fixed.c | 5 +-
drivers/net/phy/icplus.c | 17 +++--
drivers/net/phy/mdio-bitbang.c | 5 +-
drivers/net/phy/mdio-octeon.c | 5 +-
drivers/net/phy/mdio_bus.c | 8 +-
drivers/net/phy/phy.c | 5 +-
drivers/net/phy/phy_device.c | 64 +++++++++++++------
include/linux/phy.h | 70 ++++++++++++++++++---
net/dsa/slave.c | 5 +-
40 files changed, 270 insertions(+), 141 deletions(-)
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt
index 9eb1ba5..cf10707 100644
--- a/Documentation/networking/phy.txt
+++ b/Documentation/networking/phy.txt
@@ -40,13 +40,14 @@ The MDIO bus
1) read and write functions must be implemented. Their prototypes are:
- int write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
- int read(struct mii_bus *bus, int mii_id, int regnum);
-
- mii_id is the address on the bus for the PHY, and regnum is the register
- number. These functions are guaranteed not to be called from interrupt
- time, so it is safe for them to block, waiting for an interrupt to signal
- the operation is complete
+ int write(struct mii_bus *bus, int addr, int devad, u16 regnum,
+ u16 value);
+ int read(struct mii_bus *bus, int addr, int devad, u16 regnum);
+
+ addr is the address on the bus for the PHY, devad is the address of the
+ internal device, and regnum is the register number. These functions are
+ guaranteed not to be called from interrupt time, so it is safe for them
+ to block, waiting for an interrupt to signal the operation is complete
2) A reset function is necessary. This is used to return the bus to an
initialized state.
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index 9886296..a7256b9 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -124,7 +124,8 @@ static void bitbang_pre(struct mii_bus *bus, int read, u8 addr, u8 reg)
}
}
-static int gpio_mdio_read(struct mii_bus *bus, int phy_id, int location)
+static int gpio_mdio_read(struct mii_bus *bus, int phy_id, int devad,
+ int location)
{
u16 rdreg;
int ret, i;
@@ -163,7 +164,8 @@ static int gpio_mdio_read(struct mii_bus *bus, int phy_id, int location)
return ret;
}
-static int gpio_mdio_write(struct mii_bus *bus, int phy_id, int location, u16 val)
+static int gpio_mdio_write(struct mii_bus *bus, int phy_id, int devad,
+ int location, u16 val)
{
int i;
diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index b6d69c9..7e343b4 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -267,7 +267,8 @@ static int bfin_mdio_poll(void)
}
/* Read an off-chip register in a PHY through the MDC/MDIO port */
-static int bfin_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
+static int bfin_mdiobus_read(struct mii_bus *bus, int phy_addr, int devad,
+ int regnum)
{
int ret;
@@ -288,8 +289,8 @@ static int bfin_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
}
/* Write an off-chip register in a PHY through the MDC/MDIO port */
-static int bfin_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
- u16 value)
+static int bfin_mdiobus_write(struct mii_bus *bus, int phy_addr, int devad,
+ int regnum, u16 value)
{
int ret;
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 6715bf5..faab1cc 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -1176,7 +1176,7 @@ static inline int wait_for_mdio(struct greth_private *greth)
return 1;
}
-static int greth_mdio_read(struct mii_bus *bus, int phy, int reg)
+static int greth_mdio_read(struct mii_bus *bus, int phy, int devad, int reg)
{
struct greth_private *greth = bus->priv;
int data;
@@ -1198,7 +1198,8 @@ static int greth_mdio_read(struct mii_bus *bus, int phy, int reg)
}
}
-static int greth_mdio_write(struct mii_bus *bus, int phy, int reg, u16 val)
+static int greth_mdio_write(struct mii_bus *bus, int phy, int devad, int reg,
+ u16 val)
{
struct greth_private *greth = bus->priv;
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 8238667..9e879c2 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -224,7 +224,8 @@ static void au1000_mdio_write(struct net_device *dev, int phy_addr,
writel(mii_control, mii_control_reg);
}
-static int au1000_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
+static int au1000_mdiobus_read(struct mii_bus *bus, int phy_addr, int devad,
+ int regnum)
{
/* WARNING: bus->phy_map[phy_addr].attached_dev == dev does
* _NOT_ hold (e.g. when PHY is accessed through other MAC's MII bus)
@@ -239,8 +240,8 @@ static int au1000_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
return au1000_mdio_read(dev, phy_addr, regnum);
}
-static int au1000_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
- u16 value)
+static int au1000_mdiobus_write(struct mii_bus *bus, int phy_addr, int devad,
+ int regnum, u16 value)
{
struct net_device *const dev = bus->priv;
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index a11a8ad..016bda7 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -139,7 +139,7 @@ static int bcm_enet_mdio_write(struct bcm_enet_priv *priv, int mii_id,
/*
* MII read callback from phylib
*/
-static int bcm_enet_mdio_read_phylib(struct mii_bus *bus, int mii_id,
+static int bcm_enet_mdio_read_phylib(struct mii_bus *bus, int mii_id, int devad,
int regnum)
{
return bcm_enet_mdio_read(bus->priv, mii_id, regnum);
@@ -149,7 +149,7 @@ static int bcm_enet_mdio_read_phylib(struct mii_bus *bus, int mii_id,
* MII write callback from phylib
*/
static int bcm_enet_mdio_write_phylib(struct mii_bus *bus, int mii_id,
- int regnum, u16 value)
+ int devad, int regnum, u16 value)
{
return bcm_enet_mdio_write(bus->priv, mii_id, regnum, value);
}
diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c
index 0a1d7f2..7d0c64e 100644
--- a/drivers/net/ethernet/broadcom/sb1250-mac.c
+++ b/drivers/net/ethernet/broadcom/sb1250-mac.c
@@ -435,7 +435,8 @@ static void sbmac_mii_senddata(void __iomem *sbm_mdio, unsigned int data,
* value read, or 0xffff if an error occurred.
********************************************************************* */
-static int sbmac_mii_read(struct mii_bus *bus, int phyaddr, int regidx)
+static int sbmac_mii_read(struct mii_bus *bus, int phyaddr, int devad,
+ int regidx)
{
struct sbmac_softc *sc = (struct sbmac_softc *)bus->priv;
void __iomem *sbm_mdio = sc->sbm_mdio;
@@ -528,8 +529,8 @@ static int sbmac_mii_read(struct mii_bus *bus, int phyaddr, int regidx)
* 0 for success
********************************************************************* */
-static int sbmac_mii_write(struct mii_bus *bus, int phyaddr, int regidx,
- u16 regval)
+static int sbmac_mii_write(struct mii_bus *bus, int phyaddr, int devad,
+ int regidx, u16 regval)
{
struct sbmac_softc *sc = (struct sbmac_softc *)bus->priv;
void __iomem *sbm_mdio = sc->sbm_mdio;
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index fe712f9..5f4007e 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -1168,7 +1168,7 @@ static int tg3_bmcr_reset(struct tg3 *tp)
return 0;
}
-static int tg3_mdio_read(struct mii_bus *bp, int mii_id, int reg)
+static int tg3_mdio_read(struct mii_bus *bp, int mii_id, int devad, int reg)
{
struct tg3 *tp = bp->priv;
u32 val;
@@ -1183,7 +1183,8 @@ static int tg3_mdio_read(struct mii_bus *bp, int mii_id, int reg)
return val;
}
-static int tg3_mdio_write(struct mii_bus *bp, int mii_id, int reg, u16 val)
+static int tg3_mdio_write(struct mii_bus *bp, int mii_id, int devad, int reg,
+ u16 val)
{
struct tg3 *tp = bp->priv;
u32 ret = 0;
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index a437b46..9479b2a 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -89,7 +89,8 @@ static void __init macb_get_hwaddr(struct macb *bp)
}
}
-static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
+static int macb_mdio_read(struct mii_bus *bus, int mii_id, int devad,
+ int regnum)
{
struct macb *bp = bus->priv;
int value;
@@ -109,8 +110,8 @@ static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
return value;
}
-static int macb_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
- u16 value)
+static int macb_mdio_write(struct mii_bus *bus, int mii_id, int devad,
+ int regnum, u16 value)
{
struct macb *bp = bus->priv;
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c
index c1063d1..70e8347 100644
--- a/drivers/net/ethernet/dnet.c
+++ b/drivers/net/ethernet/dnet.c
@@ -100,7 +100,8 @@ static void __devinit dnet_get_hwaddr(struct dnet *bp)
memcpy(bp->dev->dev_addr, addr, sizeof(addr));
}
-static int dnet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
+static int dnet_mdio_read(struct mii_bus *bus, int mii_id, int devad,
+ int regnum)
{
struct dnet *bp = bus->priv;
u16 value;
@@ -132,8 +133,8 @@ static int dnet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
return value;
}
-static int dnet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
- u16 value)
+static int dnet_mdio_write(struct mii_bus *bus, int mii_id, int devad,
+ int regnum, u16 value)
{
struct dnet *bp = bus->priv;
u16 tmp;
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index bdb348a..700e7db 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -611,7 +611,7 @@ static int ethoc_poll(struct napi_struct *napi, int budget)
return rx_work_done;
}
-static int ethoc_mdio_read(struct mii_bus *bus, int phy, int reg)
+static int ethoc_mdio_read(struct mii_bus *bus, int phy, int devad, int reg)
{
struct ethoc *priv = bus->priv;
int i;
@@ -633,7 +633,8 @@ static int ethoc_mdio_read(struct mii_bus *bus, int phy, int reg)
return -EBUSY;
}
-static int ethoc_mdio_write(struct mii_bus *bus, int phy, int reg, u16 val)
+static int ethoc_mdio_write(struct mii_bus *bus, int phy, int devad, int reg,
+ u16 val)
{
struct ethoc *priv = bus->priv;
int i;
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 54709af..c38fa69 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -865,7 +865,8 @@ static int ftgmac100_mii_probe(struct ftgmac100 *priv)
/******************************************************************************
* struct mii_bus functions
*****************************************************************************/
-static int ftgmac100_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
+static int ftgmac100_mdiobus_read(struct mii_bus *bus, int phy_addr, int devad,
+ int regnum)
{
struct net_device *netdev = bus->priv;
struct ftgmac100 *priv = netdev_priv(netdev);
@@ -901,7 +902,7 @@ static int ftgmac100_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
}
static int ftgmac100_mdiobus_write(struct mii_bus *bus, int phy_addr,
- int regnum, u16 value)
+ int devad, int regnum, u16 value)
{
struct net_device *netdev = bus->priv;
struct ftgmac100 *priv = netdev_priv(netdev);
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 1124ce0..162f367 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -886,7 +886,8 @@ spin_unlock:
phy_print_status(phy_dev);
}
-static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
+static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int devad,
+ int regnum)
{
struct fec_enet_private *fep = bus->priv;
unsigned long time_left;
@@ -912,8 +913,8 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
return FEC_MMFR_DATA(readl(fep->hwp + FEC_MII_DATA));
}
-static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
- u16 value)
+static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int devad,
+ int regnum, u16 value)
{
struct fec_enet_private *fep = bus->priv;
unsigned long time_left;
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
index 360a578..81a3fff 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
@@ -49,13 +49,14 @@ static int mpc52xx_fec_mdio_transfer(struct mii_bus *bus, int phy_id,
in_be32(&fec->mii_data) & FEC_MII_DATA_DATAMSK : 0;
}
-static int mpc52xx_fec_mdio_read(struct mii_bus *bus, int phy_id, int reg)
+static int mpc52xx_fec_mdio_read(struct mii_bus *bus, int phy_id, int devad,
+ int reg)
{
return mpc52xx_fec_mdio_transfer(bus, phy_id, reg, FEC_MII_READ_FRAME);
}
-static int mpc52xx_fec_mdio_write(struct mii_bus *bus, int phy_id, int reg,
- u16 data)
+static int mpc52xx_fec_mdio_write(struct mii_bus *bus, int phy_id, int devad,
+ int reg, u16 data)
{
return mpc52xx_fec_mdio_transfer(bus, phy_id, reg,
data | FEC_MII_WRITE_FRAME);
diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
index e0e9d6c..b4ae560 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
@@ -49,7 +49,8 @@
#define FEC_MII_LOOPS 10000
-static int fs_enet_fec_mii_read(struct mii_bus *bus , int phy_id, int location)
+static int fs_enet_fec_mii_read(struct mii_bus *bus , int phy_id, int devad,
+ int location)
{
struct fec_info* fec = bus->priv;
struct fec __iomem *fecp = fec->fecp;
@@ -72,7 +73,8 @@ static int fs_enet_fec_mii_read(struct mii_bus *bus , int phy_id, int location)
return ret;
}
-static int fs_enet_fec_mii_write(struct mii_bus *bus, int phy_id, int location, u16 val)
+static int fs_enet_fec_mii_write(struct mii_bus *bus, int phy_id, int devad,
+ int location, u16 val)
{
struct fec_info* fec = bus->priv;
struct fec __iomem *fecp = fec->fecp;
diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index 52f4e8a..94b9e17 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -62,7 +62,7 @@ struct fsl_pq_mdio_priv {
* controlling the external PHYs, for example.
*/
int fsl_pq_local_mdio_write(struct fsl_pq_mdio __iomem *regs, int mii_id,
- int regnum, u16 value)
+ int regnum, u16 value)
{
/* Set the PHY address and the register address we want to write */
out_be32(®s->miimadd, (mii_id << 8) | regnum);
@@ -87,8 +87,8 @@ int fsl_pq_local_mdio_write(struct fsl_pq_mdio __iomem *regs, int mii_id,
* and are always tied to the local mdio pins, which may not be the
* same as system mdio bus, used for controlling the external PHYs, for eg.
*/
-int fsl_pq_local_mdio_read(struct fsl_pq_mdio __iomem *regs,
- int mii_id, int regnum)
+int fsl_pq_local_mdio_read(struct fsl_pq_mdio __iomem *regs, int mii_id,
+ int regnum)
{
u16 value;
@@ -120,7 +120,8 @@ static struct fsl_pq_mdio __iomem *fsl_pq_mdio_get_regs(struct mii_bus *bus)
* Write value to the PHY at mii_id at register regnum,
* on the bus, waiting until the write is done before returning.
*/
-int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value)
+int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int devad, int regnum,
+ u16 value)
{
struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus);
@@ -132,7 +133,7 @@ int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value)
* Read the bus for PHY at addr mii_id, register regnum, and
* return the value. Clears miimcom first.
*/
-int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
+int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int devad, int regnum)
{
struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus);
@@ -191,7 +192,7 @@ static int fsl_pq_mdio_find_free(struct mii_bus *new_bus)
for (i = PHY_MAX_ADDR; i > 0; i--) {
u32 phy_id;
- if (get_phy_id(new_bus, i, &phy_id))
+ if (get_phy_id(new_bus, i, MDIO_DEVAD_NONE, &phy_id))
return -1;
if (phy_id == 0xffffffff)
diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.h b/drivers/net/ethernet/freescale/fsl_pq_mdio.h
index bd17a2a..4b5254c 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.h
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.h
@@ -41,11 +41,14 @@ struct fsl_pq_mdio {
u8 res4[2728];
} __packed;
-int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
-int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
+
+int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int devad, int regnum);
+int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int devad, int regnum,
+ u16 value);
int fsl_pq_local_mdio_write(struct fsl_pq_mdio __iomem *regs, int mii_id,
- int regnum, u16 value);
-int fsl_pq_local_mdio_read(struct fsl_pq_mdio __iomem *regs, int mii_id, int regnum);
+ int regnum, u16 value);
+int fsl_pq_local_mdio_read(struct fsl_pq_mdio __iomem *regs, int mii_id,
+ int regnum);
int __init fsl_pq_mdio_init(void);
void fsl_pq_mdio_exit(void);
void fsl_pq_mdio_bus_name(char *name, struct device_node *np);
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 6bb2b95..b5ae9d2 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -337,7 +337,8 @@ static const struct ethtool_ops ltq_etop_ethtool_ops = {
};
static int
-ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int phy_reg, u16 phy_data)
+ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int devad, int phy_reg,
+ u16 phy_data)
{
u32 val = MDIO_REQUEST |
((phy_addr & MDIO_ADDR_MASK) << MDIO_ADDR_OFFSET) |
@@ -351,7 +352,7 @@ ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int phy_reg, u16 phy_data)
}
static int
-ltq_etop_mdio_rd(struct mii_bus *bus, int phy_addr, int phy_reg)
+ltq_etop_mdio_rd(struct mii_bus *bus, int phy_addr, int devad, int phy_reg)
{
u32 val = MDIO_REQUEST | MDIO_READ |
((phy_addr & MDIO_ADDR_MASK) << MDIO_ADDR_OFFSET) |
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index f6821aa..87b8038 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -1119,7 +1119,7 @@ static int smi_wait_ready(struct mv643xx_eth_shared_private *msp)
return 0;
}
-static int smi_bus_read(struct mii_bus *bus, int addr, int reg)
+static int smi_bus_read(struct mii_bus *bus, int addr, int devad, int reg)
{
struct mv643xx_eth_shared_private *msp = bus->priv;
void __iomem *smi_reg = msp->base + SMI_REG;
@@ -1146,7 +1146,8 @@ static int smi_bus_read(struct mii_bus *bus, int addr, int reg)
return ret & 0xffff;
}
-static int smi_bus_write(struct mii_bus *bus, int addr, int reg, u16 val)
+static int smi_bus_write(struct mii_bus *bus, int addr, int devad, int reg,
+ u16 val)
{
struct mv643xx_eth_shared_private *msp = bus->priv;
void __iomem *smi_reg = msp->base + SMI_REG;
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index d17d062..84a4a36 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1302,7 +1302,8 @@ static int smi_wait_ready(struct pxa168_eth_private *pep)
return 0;
}
-static int pxa168_smi_read(struct mii_bus *bus, int phy_addr, int regnum)
+static int pxa168_smi_read(struct mii_bus *bus, int phy_addr, int devad,
+ int regnum)
{
struct pxa168_eth_private *pep = bus->priv;
int i = 0;
@@ -1326,8 +1327,8 @@ static int pxa168_smi_read(struct mii_bus *bus, int phy_addr, int regnum)
return val & 0xffff;
}
-static int pxa168_smi_write(struct mii_bus *bus, int phy_addr, int regnum,
- u16 value)
+static int pxa168_smi_write(struct mii_bus *bus, int phy_addr, int devad,
+ int regnum, u16 value)
{
struct pxa168_eth_private *pep = bus->priv;
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index 1fc01ca..3ec419f 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -243,7 +243,8 @@ static void r6040_phy_write(void __iomem *ioaddr,
}
}
-static int r6040_mdiobus_read(struct mii_bus *bus, int phy_addr, int reg)
+static int r6040_mdiobus_read(struct mii_bus *bus, int phy_addr, int devad,
+ int reg)
{
struct net_device *dev = bus->priv;
struct r6040_private *lp = netdev_priv(dev);
@@ -253,7 +254,7 @@ static int r6040_mdiobus_read(struct mii_bus *bus, int phy_addr, int reg)
}
static int r6040_mdiobus_write(struct mii_bus *bus, int phy_addr,
- int reg, u16 value)
+ int devad, int reg, u16 value)
{
struct net_device *dev = bus->priv;
struct r6040_private *lp = netdev_priv(dev);
diff --git a/drivers/net/ethernet/s6gmac.c b/drivers/net/ethernet/s6gmac.c
index a7ff8ea..7430211 100644
--- a/drivers/net/ethernet/s6gmac.c
+++ b/drivers/net/ethernet/s6gmac.c
@@ -661,7 +661,7 @@ static int s6mii_busy(struct s6gmac *pd, int tmo)
return 0;
}
-static int s6mii_read(struct mii_bus *bus, int phy_addr, int regnum)
+static int s6mii_read(struct mii_bus *bus, int phy_addr, int devad, int regnum)
{
struct s6gmac *pd = bus->priv;
s6mii_enable(pd);
@@ -677,7 +677,8 @@ static int s6mii_read(struct mii_bus *bus, int phy_addr, int regnum)
return (u16)readl(pd->reg + S6_GMAC_MACMIISTAT);
}
-static int s6mii_write(struct mii_bus *bus, int phy_addr, int regnum, u16 value)
+static int s6mii_write(struct mii_bus *bus, int phy_addr, int devad,
+ int regnum, u16 value)
{
struct s6gmac *pd = bus->priv;
s6mii_enable(pd);
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index a3aa4c0..87ee880 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -441,7 +441,8 @@ static void smsc911x_mac_write(struct smsc911x_data *pdata,
}
/* Get a phy register */
-static int smsc911x_mii_read(struct mii_bus *bus, int phyaddr, int regidx)
+static int smsc911x_mii_read(struct mii_bus *bus, int phyaddr, int devad,
+ int regidx)
{
struct smsc911x_data *pdata = (struct smsc911x_data *)bus->priv;
unsigned long flags;
@@ -477,8 +478,8 @@ out:
}
/* Set a phy register */
-static int smsc911x_mii_write(struct mii_bus *bus, int phyaddr, int regidx,
- u16 val)
+static int smsc911x_mii_write(struct mii_bus *bus, int phyaddr, int devad,
+ int regidx, u16 val)
{
struct smsc911x_data *pdata = (struct smsc911x_data *)bus->priv;
unsigned long flags;
@@ -709,11 +710,12 @@ static int smsc911x_phy_reset(struct smsc911x_data *pdata)
BUG_ON(!phy_dev->bus);
SMSC_TRACE(pdata, hw, "Performing PHY BCR Reset");
- smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_BMCR, BMCR_RESET);
+ smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MDIO_DEVAD_NONE,
+ MII_BMCR, BMCR_RESET);
do {
msleep(1);
temp = smsc911x_mii_read(phy_dev->bus, phy_dev->addr,
- MII_BMCR);
+ MDIO_DEVAD_NONE, MII_BMCR);
} while ((i--) && (temp & BMCR_RESET));
if (temp & BMCR_RESET) {
@@ -761,8 +763,8 @@ static int smsc911x_phy_loopbacktest(struct net_device *dev)
for (i = 0; i < 10; i++) {
/* Set PHY to 10/FD, no ANEG, and loopback mode */
- smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_BMCR,
- BMCR_LOOPBACK | BMCR_FULLDPLX);
+ smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MDIO_DEVAD_NONE,
+ MII_BMCR, BMCR_LOOPBACK | BMCR_FULLDPLX);
/* Enable MAC tx/rx, FD */
spin_lock_irqsave(&pdata->mac_lock, flags);
@@ -790,7 +792,8 @@ static int smsc911x_phy_loopbacktest(struct net_device *dev)
spin_unlock_irqrestore(&pdata->mac_lock, flags);
/* Cancel PHY loopback mode */
- smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_BMCR, 0);
+ smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MDIO_DEVAD_NONE,
+ MII_BMCR, 0);
smsc911x_reg_write(pdata, TX_CFG, 0);
smsc911x_reg_write(pdata, RX_CFG, 0);
@@ -1759,7 +1762,8 @@ smsc911x_ethtool_getregs(struct net_device *dev, struct ethtool_regs *regs,
}
for (i = 0; i <= 31; i++)
- data[j++] = smsc911x_mii_read(phy_dev->bus, phy_dev->addr, i);
+ data[j++] = smsc911x_mii_read(phy_dev->bus, phy_dev->addr,
+ MDIO_DEVAD_NONE, i);
}
static void smsc911x_eeprom_enable_access(struct smsc911x_data *pdata)
diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c
index 4f15680..3a08ef0 100644
--- a/drivers/net/ethernet/smsc/smsc9420.c
+++ b/drivers/net/ethernet/smsc/smsc9420.c
@@ -128,7 +128,8 @@ static inline void smsc9420_pci_flush_write(struct smsc9420_pdata *pd)
smsc9420_reg_read(pd, ID_REV);
}
-static int smsc9420_mii_read(struct mii_bus *bus, int phyaddr, int regidx)
+static int smsc9420_mii_read(struct mii_bus *bus, int phyaddr, int devad,
+ int regidx)
{
struct smsc9420_pdata *pd = (struct smsc9420_pdata *)bus->priv;
unsigned long flags;
@@ -165,8 +166,8 @@ out:
return reg;
}
-static int smsc9420_mii_write(struct mii_bus *bus, int phyaddr, int regidx,
- u16 val)
+static int smsc9420_mii_write(struct mii_bus *bus, int phyaddr, int devad,
+ int regidx, u16 val)
{
struct smsc9420_pdata *pd = (struct smsc9420_pdata *)bus->priv;
unsigned long flags;
@@ -329,7 +330,8 @@ smsc9420_ethtool_getregs(struct net_device *dev, struct ethtool_regs *regs,
return;
for (i = 0; i <= 31; i++)
- data[j++] = smsc9420_mii_read(phy_dev->bus, phy_dev->addr, i);
+ data[j++] = smsc9420_mii_read(phy_dev->bus, phy_dev->addr,
+ MDIO_DEVAD_NONE, i);
}
static void smsc9420_eeprom_enable_access(struct smsc9420_pdata *pd)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 9c3b9d5..36cdb1b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -38,13 +38,15 @@
* stmmac_mdio_read
* @bus: points to the mii_bus structure
* @phyaddr: MII addr reg bits 15-11
+ * @devad: unused
* @phyreg: MII addr reg bits 10-6
* Description: it reads data from the MII register from within the phy device.
* For the 7111 GMAC, we must set the bit 0 in the MII address register while
* accessing the PHY registers.
* Fortunately, it seems this has no drawback for the 7109 MAC.
*/
-static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int phyreg)
+static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int devad,
+ int phyreg)
{
struct net_device *ndev = bus->priv;
struct stmmac_priv *priv = netdev_priv(ndev);
@@ -70,12 +72,13 @@ static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int phyreg)
* stmmac_mdio_write
* @bus: points to the mii_bus structure
* @phyaddr: MII addr reg bits 15-11
+ * @devad: unused
* @phyreg: MII addr reg bits 10-6
* @phydata: phy data
* Description: it writes the data into the MII register from within the device.
*/
-static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
- u16 phydata)
+static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int devad,
+ int phyreg, u16 phydata)
{
struct net_device *ndev = bus->priv;
struct stmmac_priv *priv = netdev_priv(ndev);
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index aaac0c7..c89eac5 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -272,7 +272,7 @@ static void cpmac_dump_skb(struct net_device *dev, struct sk_buff *skb)
printk("\n");
}
-static int cpmac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
+static int cpmac_mdio_read(struct mii_bus *bus, int phy_id, int devad, int reg)
{
u32 val;
@@ -285,7 +285,7 @@ static int cpmac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
return MDIO_DATA(val);
}
-static int cpmac_mdio_write(struct mii_bus *bus, int phy_id,
+static int cpmac_mdio_write(struct mii_bus *bus, int phy_id, int devad,
int reg, u16 val)
{
while (cpmac_read(bus->priv, CPMAC_MDIO_ACCESS(0)) & MDIO_BUSY)
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 7615040..92ed777 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -199,7 +199,8 @@ static inline int wait_for_idle(struct davinci_mdio_data *data)
return -ETIMEDOUT;
}
-static int davinci_mdio_read(struct mii_bus *bus, int phy_id, int phy_reg)
+static int davinci_mdio_read(struct mii_bus *bus, int phy_id, int devad,
+ int phy_reg)
{
struct davinci_mdio_data *data = bus->priv;
u32 reg;
@@ -244,7 +245,7 @@ static int davinci_mdio_read(struct mii_bus *bus, int phy_id, int phy_reg)
}
static int davinci_mdio_write(struct mii_bus *bus, int phy_id,
- int phy_reg, u16 phy_data)
+ int devad, int phy_reg, u16 phy_data)
{
struct davinci_mdio_data *data = bus->priv;
u32 reg;
diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c
index 71b785c..2b166f7 100644
--- a/drivers/net/ethernet/toshiba/tc35815.c
+++ b/drivers/net/ethernet/toshiba/tc35815.c
@@ -501,7 +501,7 @@ static void panic_queues(struct net_device *dev);
static void tc35815_restart_work(struct work_struct *work);
-static int tc_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
+static int tc_mdio_read(struct mii_bus *bus, int mii_id, int devad, int regnum)
{
struct net_device *dev = bus->priv;
struct tc35815_regs __iomem *tr =
@@ -518,7 +518,8 @@ static int tc_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
return tc_readl(&tr->MD_Data) & 0xffff;
}
-static int tc_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 val)
+static int tc_mdio_write(struct mii_bus *bus, int mii_id, int devad, int regnum,
+ u16 val)
{
struct net_device *dev = bus->priv;
struct tc35815_regs __iomem *tr =
diff --git a/drivers/net/ethernet/xilinx/ll_temac_mdio.c b/drivers/net/ethernet/xilinx/ll_temac_mdio.c
index 8cf9d4f..a9ddc90 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_mdio.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_mdio.c
@@ -19,7 +19,7 @@
/* ---------------------------------------------------------------------
* MDIO Bus functions
*/
-static int temac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
+static int temac_mdio_read(struct mii_bus *bus, int phy_id, int devad, int reg)
{
struct temac_local *lp = bus->priv;
u32 rc;
@@ -38,7 +38,8 @@ static int temac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
return rc;
}
-static int temac_mdio_write(struct mii_bus *bus, int phy_id, int reg, u16 val)
+static int temac_mdio_write(struct mii_bus *bus, int phy_id, int devad, int reg,
+ u16 val)
{
struct temac_local *lp = bus->priv;
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 8018d7d..36a5b1b 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -741,6 +741,7 @@ static int xemaclite_mdio_wait(struct net_local *lp)
* xemaclite_mdio_read - Read from a given MII management register
* @bus: the mii_bus struct
* @phy_id: the phy address
+ * @devad: unused
* @reg: register number to read from
*
* This function waits till the device is ready to accept a new MDIO
@@ -749,7 +750,8 @@ static int xemaclite_mdio_wait(struct net_local *lp)
*
* Return: Value read from the MII management register
*/
-static int xemaclite_mdio_read(struct mii_bus *bus, int phy_id, int reg)
+static int xemaclite_mdio_read(struct mii_bus *bus, int phy_id, int devad,
+ int reg)
{
struct net_local *lp = bus->priv;
u32 ctrl_reg;
@@ -785,14 +787,15 @@ static int xemaclite_mdio_read(struct mii_bus *bus, int phy_id, int reg)
* xemaclite_mdio_write - Write to a given MII management register
* @bus: the mii_bus struct
* @phy_id: the phy address
+ * @devad: unused
* @reg: register number to write to
* @val: value to write to the register number specified by reg
*
* This function waits till the device is ready to accept a new MDIO
* request and then writes the val to the MDIO Write Data register.
*/
-static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int reg,
- u16 val)
+static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int devad,
+ int reg, u16 val)
{
struct net_local *lp = bus->priv;
u32 ctrl_reg;
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index ec96d91..2f5d9cb 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -473,7 +473,8 @@ static int ixp4xx_mdio_cmd(struct mii_bus *bus, int phy_id, int location,
((__raw_readl(&mdio_regs->mdio_status[1]) & 0xFF) << 8);
}
-static int ixp4xx_mdio_read(struct mii_bus *bus, int phy_id, int location)
+static int ixp4xx_mdio_read(struct mii_bus *bus, int phy_id, int devad,
+ int location)
{
unsigned long flags;
int ret;
@@ -488,8 +489,8 @@ static int ixp4xx_mdio_read(struct mii_bus *bus, int phy_id, int location)
return ret;
}
-static int ixp4xx_mdio_write(struct mii_bus *bus, int phy_id, int location,
- u16 val)
+static int ixp4xx_mdio_write(struct mii_bus *bus, int phy_id, int devad,
+ int location, u16 val)
{
unsigned long flags;
int ret;
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 1fa4d73..31f621e 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -115,7 +115,8 @@ static int fixed_phy_update_regs(struct fixed_phy *fp)
return 0;
}
-static int fixed_mdio_read(struct mii_bus *bus, int phy_id, int reg_num)
+static int fixed_mdio_read(struct mii_bus *bus, int phy_id, int devad,
+ int reg_num)
{
struct fixed_mdio_bus *fmb = bus->priv;
struct fixed_phy *fp;
@@ -139,7 +140,7 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_id, int reg_num)
}
static int fixed_mdio_write(struct mii_bus *bus, int phy_id, int reg_num,
- u16 val)
+ int devad, u16 val)
{
return 0;
}
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index d66bd8d..5228d9c 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -49,36 +49,41 @@ static int ip175c_config_init(struct phy_device *phydev)
if (full_reset_performed == 0) {
/* master reset */
- err = mdiobus_write(phydev->bus, 30, 0, 0x175c);
+ err = mdiobus_write(phydev->bus, 30, MDIO_DEVAD_NONE, 0,
+ 0x175c);
if (err < 0)
return err;
/* ensure no bus delays overlap reset period */
- err = mdiobus_read(phydev->bus, 30, 0);
+ err = mdiobus_read(phydev->bus, 30, MDIO_DEVAD_NONE, 0);
/* data sheet specifies reset period is 2 msec */
mdelay(2);
/* enable IP175C mode */
- err = mdiobus_write(phydev->bus, 29, 31, 0x175c);
+ err = mdiobus_write(phydev->bus, 29, MDIO_DEVAD_NONE, 31,
+ 0x175c);
if (err < 0)
return err;
/* Set MII0 speed and duplex (in PHY mode) */
- err = mdiobus_write(phydev->bus, 29, 22, 0x420);
+ err = mdiobus_write(phydev->bus, 29, MDIO_DEVAD_NONE, 22,
+ 0x420);
if (err < 0)
return err;
/* reset switch ports */
for (i = 0; i < 5; i++) {
err = mdiobus_write(phydev->bus, i,
- MII_BMCR, BMCR_RESET);
+ MDIO_DEVAD_NONE,
+ MII_BMCR, BMCR_RESET);
if (err < 0)
return err;
}
for (i = 0; i < 5; i++)
- err = mdiobus_read(phydev->bus, i, MII_BMCR);
+ err = mdiobus_read(phydev->bus, i, MDIO_DEVAD_NONE,
+ MII_BMCR);
mdelay(2);
diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c
index 6539189..2f6f02e 100644
--- a/drivers/net/phy/mdio-bitbang.c
+++ b/drivers/net/phy/mdio-bitbang.c
@@ -152,7 +152,7 @@ static int mdiobb_cmd_addr(struct mdiobb_ctrl *ctrl, int phy, u32 addr)
return dev_addr;
}
-static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
+static int mdiobb_read(struct mii_bus *bus, int phy, int devad, int reg)
{
struct mdiobb_ctrl *ctrl = bus->priv;
int ret, i;
@@ -181,7 +181,8 @@ static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
return ret;
}
-static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val)
+static int mdiobb_write(struct mii_bus *bus, int phy, int devad, int reg,
+ u16 val)
{
struct mdiobb_ctrl *ctrl = bus->priv;
diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
index bd12ba9..356973d 100644
--- a/drivers/net/phy/mdio-octeon.c
+++ b/drivers/net/phy/mdio-octeon.c
@@ -24,7 +24,8 @@ struct octeon_mdiobus {
int phy_irq[PHY_MAX_ADDR];
};
-static int octeon_mdiobus_read(struct mii_bus *bus, int phy_id, int regnum)
+static int octeon_mdiobus_read(struct mii_bus *bus, int phy_id, int devad,
+ int regnum)
{
struct octeon_mdiobus *p = bus->priv;
union cvmx_smix_cmd smi_cmd;
@@ -52,7 +53,7 @@ static int octeon_mdiobus_read(struct mii_bus *bus, int phy_id, int regnum)
return -EIO;
}
-static int octeon_mdiobus_write(struct mii_bus *bus, int phy_id,
+static int octeon_mdiobus_write(struct mii_bus *bus, int phy_id, int devad
int regnum, u16 val)
{
struct octeon_mdiobus *p = bus->priv;
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 6c58da2..a6fa970 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -208,14 +208,14 @@ EXPORT_SYMBOL(mdiobus_scan);
* because the bus read/write functions may wait for an interrupt
* to conclude the operation.
*/
-int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum)
+int mdiobus_read(struct mii_bus *bus, int addr, int devad, u16 regnum)
{
int retval;
BUG_ON(in_interrupt());
mutex_lock(&bus->mdio_lock);
- retval = bus->read(bus, addr, regnum);
+ retval = bus->read(bus, addr, devad, regnum);
mutex_unlock(&bus->mdio_lock);
return retval;
@@ -233,14 +233,14 @@ EXPORT_SYMBOL(mdiobus_read);
* because the bus read/write functions may wait for an interrupt
* to conclude the operation.
*/
-int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val)
+int mdiobus_write(struct mii_bus *bus, int addr, int devad, u16 regnum, u16 val)
{
int err;
BUG_ON(in_interrupt());
mutex_lock(&bus->mdio_lock);
- err = bus->write(bus, addr, regnum, val);
+ err = bus->write(bus, addr, devad, regnum, val);
mutex_unlock(&bus->mdio_lock);
return err;
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 3cbda08..00f5cfe 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -322,7 +322,8 @@ int phy_mii_ioctl(struct phy_device *phydev,
case SIOCGMIIREG:
mii_data->val_out = mdiobus_read(phydev->bus, mii_data->phy_id,
- mii_data->reg_num);
+ MDIO_DEVAD_NONE,
+ mii_data->reg_num);
break;
case SIOCSMIIREG:
@@ -354,7 +355,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
}
mdiobus_write(phydev->bus, mii_data->phy_id,
- mii_data->reg_num, val);
+ MDIO_DEVAD_NONE, mii_data->reg_num, val);
if (mii_data->reg_num == MII_BMCR &&
val & BMCR_RESET &&
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 83a5a5a..22281d4 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -4,9 +4,11 @@
* Framework for finding and configuring PHYs.
* Also contains generic PHY driver
*
+ * 10G PHY Driver support mostly appropriated from drivers/net/mdio.c
+ *
* Author: Andy Fleming
*
- * Copyright (c) 2004 Freescale Semiconductor, Inc.
+ * Copyright (c) 2004-2006, 2008-2011 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -29,6 +31,7 @@
#include <linux/module.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
+#include <linux/mdio.h>
#include <linux/phy.h>
#include <asm/io.h>
@@ -207,13 +210,13 @@ static struct phy_device* phy_device_create(struct mii_bus *bus,
* Description: Reads the ID registers of the PHY at @addr on the
* @bus, stores it in @phy_id and returns zero on success.
*/
-int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id)
+int get_phy_id(struct mii_bus *bus, int addr, int devad, u32 *phy_id)
{
int phy_reg;
/* Grab the bits from PHYIR1, and put them
* in the upper half */
- phy_reg = mdiobus_read(bus, addr, MII_PHYSID1);
+ phy_reg = mdiobus_read(bus, addr, devad, MII_PHYSID1);
if (phy_reg < 0)
return -EIO;
@@ -221,7 +224,7 @@ int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id)
*phy_id = (phy_reg & 0xffff) << 16;
/* Grab the bits from PHYIR2, and put them in the lower half */
- phy_reg = mdiobus_read(bus, addr, MII_PHYSID2);
+ phy_reg = mdiobus_read(bus, addr, devad, MII_PHYSID2);
if (phy_reg < 0)
return -EIO;
@@ -242,21 +245,31 @@ EXPORT_SYMBOL(get_phy_id);
*/
struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
{
- struct phy_device *dev = NULL;
- u32 phy_id;
+ u32 phy_id = 0x1fffffff;
+ int i;
int r;
- r = get_phy_id(bus, addr, &phy_id);
+ /* Try Standard (ie Clause 22) access */
+ r = get_phy_id(bus, addr, MDIO_DEVAD_NONE, &phy_id);
if (r)
return ERR_PTR(r);
- /* If the phy_id is mostly Fs, there is no device there */
- if ((phy_id & 0x1fffffff) == 0x1fffffff)
- return NULL;
+ /* If the PHY ID is mostly f's, we didn't find anything */
+ if ((phy_id & 0x1fffffff) != 0x1fffffff)
+ return phy_device_create(bus, addr, phy_id);
- dev = phy_device_create(bus, addr, phy_id);
+ /* Otherwise we have to try Clause 45 */
+ for (i = 1; i < 5; i++) {
+ r = get_phy_id(bus, addr, i, &phy_id);
+ if (r)
+ return ERR_PTR(r);
- return dev;
+ /* If the phy_id is mostly Fs, there is no device there */
+ if ((phy_id & 0x1fffffff) != 0x1fffffff)
+ break;
+ }
+
+ return phy_device_create(bus, addr, phy_id);
}
EXPORT_SYMBOL(get_phy_device);
@@ -424,6 +437,11 @@ int phy_init_hw(struct phy_device *phydev)
return phydev->drv->config_init(phydev);
}
+static struct phy_driver *generic_for_interface(phy_interface_t interface)
+{
+ return &genphy_driver;
+}
+
/**
* phy_attach_direct - attach a network device to a given PHY device pointer
* @dev: network device to attach
@@ -433,8 +451,8 @@ int phy_init_hw(struct phy_device *phydev)
*
* Description: Called by drivers to attach to a particular PHY
* device. The phy_device is found, and properly hooked up
- * to the phy_driver. If no driver is attached, then the
- * genphy_driver is used. The phy_device is given a ptr to
+ * to the phy_driver. If no driver is attached, then a
+ * generic driver is used. The phy_device is given a ptr to
* the attaching device, and given a callback for link status
* change. The phy_device is returned to the attaching driver.
*/
@@ -447,7 +465,9 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
/* Assume that if there is no driver, that it doesn't
* exist, and we should use the genphy driver. */
if (NULL == d->driver) {
- d->driver = &genphy_driver.driver;
+ int err;
+
+ d->driver = generic_for_interface(interface);
err = d->driver->probe(d);
if (err >= 0)
@@ -529,7 +549,7 @@ void phy_detach(struct phy_device *phydev)
* was using the generic driver), we unbind the device
* from the generic driver so that there's a chance a
* real driver could be loaded */
- if (phydev->dev.driver == &genphy_driver.driver)
+ if (phydev->dev.driver == generic_for_interface(phydev->interface))
device_release_driver(&phydev->dev);
}
EXPORT_SYMBOL(phy_detach);
@@ -640,7 +660,6 @@ static int genphy_setup_forced(struct phy_device *phydev)
return err;
}
-
/**
* genphy_restart_aneg - Enable and Restart Autonegotiation
* @phydev: target phy_device struct
@@ -665,7 +684,6 @@ int genphy_restart_aneg(struct phy_device *phydev)
}
EXPORT_SYMBOL(genphy_restart_aneg);
-
/**
* genphy_config_aneg - restart auto-negotiation or write BMCR
* @phydev: target phy_device struct
@@ -882,6 +900,7 @@ static int genphy_config_init(struct phy_device *phydev)
return 0;
}
+
int genphy_suspend(struct phy_device *phydev)
{
int value;
@@ -1022,7 +1041,7 @@ static struct phy_driver genphy_driver = {
.read_status = genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
- .driver = {.owner= THIS_MODULE, },
+ .driver = {.owner = THIS_MODULE, },
};
static int __init phy_init(void)
@@ -1035,7 +1054,12 @@ static int __init phy_init(void)
rc = phy_driver_register(&genphy_driver);
if (rc)
- mdio_bus_exit();
+ goto genphy_register_failed;
+
+ return rc;
+
+genphy_register_failed:
+ mdio_bus_exit();
return rc;
}
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 54fc413..ae1fdd8 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -6,7 +6,7 @@
*
* Author: Andy Fleming
*
- * Copyright (c) 2004 Freescale Semiconductor, Inc.
+ * Copyright (c) 2004, 2009-2011 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -22,6 +22,7 @@
#include <linux/device.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
+#include <linux/mdio.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
#include <linux/mod_devicetable.h>
@@ -65,6 +66,7 @@ typedef enum {
PHY_INTERFACE_MODE_RGMII_TXID,
PHY_INTERFACE_MODE_RTBI,
PHY_INTERFACE_MODE_SMII,
+ PHY_INTERFACE_MODE_XGMII
} phy_interface_t;
@@ -96,8 +98,10 @@ struct mii_bus {
const char *name;
char id[MII_BUS_ID_SIZE];
void *priv;
- int (*read)(struct mii_bus *bus, int phy_id, int regnum);
- int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
+ int (*read)(struct mii_bus *bus, int port_addr, int dev_addr,
+ int regnum);
+ int (*write)(struct mii_bus *bus, int port_addr, int dev_addr,
+ int regnum, u16 val);
int (*reset)(struct mii_bus *bus);
/*
@@ -134,8 +138,9 @@ int mdiobus_register(struct mii_bus *bus);
void mdiobus_unregister(struct mii_bus *bus);
void mdiobus_free(struct mii_bus *bus);
struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
-int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
-int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
+int mdiobus_read(struct mii_bus *bus, int addr, int devad, u16 regnum);
+int mdiobus_write(struct mii_bus *bus, int addr, int devad,
+ u16 regnum, u16 val);
#define PHY_INTERRUPT_DISABLED 0x0
@@ -307,6 +312,7 @@ struct phy_device {
/* See mii.h for more info */
u32 supported;
u32 advertising;
+ u32 mmds;
int autoneg;
@@ -443,6 +449,21 @@ struct phy_fixup {
};
/**
+ * is_10g_interface - Distinguishes 10G from 10/100/1000
+ * @interface: PHY interface type
+ *
+ * Returns true if the passed interface is capable of 10G,
+ * and therefore indicates the need for Clause-45-style
+ * MDIO transactions.
+ *
+ * For now, XGMII is the only 10G interface
+ */
+static inline bool is_10g_interface(phy_interface_t interface)
+{
+ return interface == PHY_INTERFACE_MODE_XGMII;
+}
+
+/**
* phy_read - Convenience function for reading a given PHY register
* @phydev: the phy_device struct
* @regnum: register number to read
@@ -453,7 +474,22 @@ struct phy_fixup {
*/
static inline int phy_read(struct phy_device *phydev, u32 regnum)
{
- return mdiobus_read(phydev->bus, phydev->addr, regnum);
+ return mdiobus_read(phydev->bus, phydev->addr, MDIO_DEVAD_NONE, regnum);
+}
+
+/**
+ * phy45_read - Convenience function for reading a given port/dev/reg address
+ * @phydev: The phy_device struct
+ * @devad: The device address to read
+ * @regnum: The register number to read
+ *
+ * NOTE: MUST NOT be called from interrupt context,
+ * because the bus read/write functions may wait for an interrupt
+ * to conclude the operation.
+ */
+static inline int phy45_read(struct phy_device *phydev, int devad, u16 regnum)
+{
+ return mdiobus_read(phydev->bus, phydev->addr, devad, regnum);
}
/**
@@ -468,10 +504,28 @@ static inline int phy_read(struct phy_device *phydev, u32 regnum)
*/
static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
{
- return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
+ return mdiobus_write(phydev->bus, phydev->addr, MDIO_DEVAD_NONE, regnum,
+ val);
+}
+
+/**
+ * phy45_write - Convenience function for writing a given port/dev/reg
+ * @phydev: the phy_device struct
+ * @devad: the device addr
+ * @regnum: register number to write
+ * @val: value to write to @regnum
+ *
+ * NOTE: MUST NOT be called from interrupt context,
+ * because the bus read/write functions may wait for an interrupt
+ * to conclude the operation.
+ */
+static inline int phy45_write(struct phy_device *phydev, u16 regnum,
+ int devad, u16 val)
+{
+ return mdiobus_write(phydev->bus, phydev->addr, devad, regnum, val);
}
-int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
+int get_phy_id(struct mii_bus *bus, int addr, int devad, u32 *phy_id);
struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
int phy_device_register(struct phy_device *phy);
int phy_init_hw(struct phy_device *phydev);
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 56cf9b8..8bcb864 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -15,7 +15,7 @@
#include "dsa_priv.h"
/* slave mii_bus handling ***************************************************/
-static int dsa_slave_phy_read(struct mii_bus *bus, int addr, int reg)
+static int dsa_slave_phy_read(struct mii_bus *bus, int addr, int devad, int reg)
{
struct dsa_switch *ds = bus->priv;
@@ -25,7 +25,8 @@ static int dsa_slave_phy_read(struct mii_bus *bus, int addr, int reg)
return 0xffff;
}
-static int dsa_slave_phy_write(struct mii_bus *bus, int addr, int reg, u16 val)
+static int dsa_slave_phy_write(struct mii_bus *bus, int addr, int devad,
+ int reg, u16 val)
{
struct dsa_switch *ds = bus->priv;
--
1.7.3.4
^ permalink raw reply related
* [RFC] phylib: Add rudimentary Generic 10G support
From: Andy Fleming @ 2011-10-12 1:20 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1318382422-2133-1-git-send-email-afleming@freescale.com>
This is mostly taken from mdio.c, and modified to work under phylib.
However, the support is skewed toward 10GBaseT, as that is the only
PHY available to me at this time.
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
This patch used to be part of the 10G PHY support patch, but I'm
breaking it out, here, so the other stuff can go in faster. My PHY
doesn't appear to provide useful information in fiber mode, and
most of my boards are hooked up via fiber. I'm not sure what the
best approach for getting this in is.
drivers/net/phy/phy_device.c | 118 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 118 insertions(+), 0 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 22281d4..e2ee8dd 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -10,6 +10,7 @@
*
* Copyright (c) 2004-2006, 2008-2011 Freescale Semiconductor, Inc.
*
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
@@ -54,6 +55,7 @@ static void phy_device_release(struct device *dev)
}
static struct phy_driver genphy_driver;
+static struct phy_driver gen10g_driver;
extern int mdio_bus_init(void);
extern void mdio_bus_exit(void);
@@ -439,6 +441,9 @@ int phy_init_hw(struct phy_device *phydev)
static struct phy_driver *generic_for_interface(phy_interface_t interface)
{
+ if (is_10g_interface(interface))
+ return &gen10g_driver;
+
return &genphy_driver;
}
@@ -632,6 +637,12 @@ static int genphy_config_advert(struct phy_device *phydev)
return changed;
}
+int gen10g_config_advert(struct phy_device *dev)
+{
+ return 0;
+}
+EXPORT_SYMBOL(gen10g_config_advert);
+
/**
* genphy_setup_forced - configures/forces speed/duplex from @phydev
* @phydev: target phy_device struct
@@ -660,6 +671,11 @@ static int genphy_setup_forced(struct phy_device *phydev)
return err;
}
+int gen10g_setup_forced(struct phy_device *phydev)
+{
+ return 0;
+}
+
/**
* genphy_restart_aneg - Enable and Restart Autonegotiation
* @phydev: target phy_device struct
@@ -684,6 +700,13 @@ int genphy_restart_aneg(struct phy_device *phydev)
}
EXPORT_SYMBOL(genphy_restart_aneg);
+int gen10g_restart_aneg(struct phy_device *phydev)
+{
+ return 0;
+}
+EXPORT_SYMBOL(gen10g_restart_aneg);
+
+
/**
* genphy_config_aneg - restart auto-negotiation or write BMCR
* @phydev: target phy_device struct
@@ -725,6 +748,12 @@ int genphy_config_aneg(struct phy_device *phydev)
}
EXPORT_SYMBOL(genphy_config_aneg);
+int gen10g_config_aneg(struct phy_device *phydev)
+{
+ return 0;
+}
+EXPORT_SYMBOL(gen10g_config_aneg);
+
/**
* genphy_update_link - update link status in @phydev
* @phydev: target phy_device struct
@@ -854,6 +883,33 @@ int genphy_read_status(struct phy_device *phydev)
}
EXPORT_SYMBOL(genphy_read_status);
+int gen10g_read_status(struct phy_device *phydev)
+{
+ int devad, reg;
+ u32 mmd_mask = phydev->mmds;
+
+ phydev->link = 1;
+
+ /* For now just lie and say it's 10G all the time */
+ phydev->speed = 10000;
+ phydev->duplex = DUPLEX_FULL;
+
+ for (devad = 0; mmd_mask; devad++, mmd_mask = mmd_mask >> 1) {
+ if (!mmd_mask & 1)
+ continue;
+
+ /* Read twice because link state is latched and a
+ * read moves the current state into the register */
+ phy45_read(phydev, devad, MDIO_STAT1);
+ reg = phy45_read(phydev, devad, MDIO_STAT1);
+ if (reg < 0 || !(reg & MDIO_STAT1_LSTATUS))
+ phydev->link = 0;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(gen10g_read_status);
+
static int genphy_config_init(struct phy_device *phydev)
{
int val;
@@ -901,6 +957,35 @@ static int genphy_config_init(struct phy_device *phydev)
return 0;
}
+/* Replicate mdio45_probe */
+int gen10g_config_init(struct phy_device *phydev)
+{
+ int mmd, stat2, devs1, devs2;
+
+ phydev->supported = phydev->advertising = SUPPORTED_10000baseT_Full;
+
+ /* Assume PHY must have at least one of PMA/PMD, WIS, PCS, PHY
+ * XS or DTE XS; give up if none is present. */
+ for (mmd = 1; mmd <= 5; mmd++) {
+ /* Is this MMD present? */
+ stat2 = phy45_read(phydev, mmd, MDIO_STAT2);
+ if (stat2 < 0 ||
+ (stat2 & MDIO_STAT2_DEVPRST) != MDIO_STAT2_DEVPRST_VAL)
+ continue;
+
+ /* It should tell us about all the other MMDs */
+ devs1 = phy45_read(phydev, mmd, MDIO_DEVS1);
+ devs2 = phy45_read(phydev, mmd, MDIO_DEVS2);
+ if (devs1 < 0 || devs2 < 0)
+ continue;
+
+ phydev->mmds = devs1 | (devs2 << 16);
+ return 0;
+ }
+
+ return -ENODEV;
+}
+
int genphy_suspend(struct phy_device *phydev)
{
int value;
@@ -916,6 +1001,12 @@ int genphy_suspend(struct phy_device *phydev)
}
EXPORT_SYMBOL(genphy_suspend);
+int gen10g_suspend(struct phy_device *phydev)
+{
+ return 0;
+}
+EXPORT_SYMBOL(gen10g_suspend);
+
int genphy_resume(struct phy_device *phydev)
{
int value;
@@ -931,6 +1022,13 @@ int genphy_resume(struct phy_device *phydev)
}
EXPORT_SYMBOL(genphy_resume);
+int gen10g_resume(struct phy_device *phydev)
+{
+ return 0;
+}
+EXPORT_SYMBOL(gen10g_resume);
+
+
/**
* phy_probe - probe and init a PHY device
* @dev: device to probe and init
@@ -1044,6 +1142,19 @@ static struct phy_driver genphy_driver = {
.driver = {.owner = THIS_MODULE, },
};
+static struct phy_driver gen10g_driver = {
+ .phy_id = 0xffffffff,
+ .phy_id_mask = 0xffffffff,
+ .name = "Generic 10G PHY",
+ .config_init = gen10g_config_init,
+ .features = 0,
+ .config_aneg = gen10g_config_aneg,
+ .read_status = gen10g_read_status,
+ .suspend = gen10g_suspend,
+ .resume = gen10g_resume,
+ .driver = {.owner = THIS_MODULE, },
+};
+
static int __init phy_init(void)
{
int rc;
@@ -1056,8 +1167,14 @@ static int __init phy_init(void)
if (rc)
goto genphy_register_failed;
+ rc = phy_driver_register(&gen10g_driver);
+ if (rc)
+ goto gen10g_register_failed;
+
return rc;
+gen10g_register_failed:
+ phy_driver_unregister(&genphy_driver);
genphy_register_failed:
mdio_bus_exit();
@@ -1066,6 +1183,7 @@ genphy_register_failed:
static void __exit phy_exit(void)
{
+ phy_driver_unregister(&gen10g_driver);
phy_driver_unregister(&genphy_driver);
mdio_bus_exit();
}
--
1.7.3.4
^ permalink raw reply related
* [PATCH] phylib: Modify Vitesse RGMII skew settings
From: Andy Fleming @ 2011-10-12 1:20 UTC (permalink / raw)
To: davem; +Cc: netdev
The Vitesse driver was using the RGMII_ID interface type to determine if
skew was necessary. However, we want to move away from using that
interface type, as it's really a property of the board's PHY connection.
However, some boards depend on it, so we want to support it, while
allowing new boards to use the more flexible "fixups" approach. To do
this, we extract the code which adds skew into its own function, and
call that function when RGMII_ID has been selected.
Another side-effect of this change is that if your PHY has skew set
already, it doesn't clear it. This way, the fixup code can modify the
register without config_init then clearing it.
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
drivers/net/phy/vitesse.c | 34 ++++++++++++++++++++++------------
1 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index 5d8f6e1..0ec8e09 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -3,7 +3,7 @@
*
* Author: Kriston Carson
*
- * Copyright (c) 2005 Freescale Semiconductor, Inc.
+ * Copyright (c) 2005, 2009 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -61,32 +61,42 @@ MODULE_DESCRIPTION("Vitesse PHY driver");
MODULE_AUTHOR("Kriston Carson");
MODULE_LICENSE("GPL");
-static int vsc824x_config_init(struct phy_device *phydev)
+int vsc824x_add_skew(struct phy_device *phydev)
{
- int extcon;
int err;
-
- err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT,
- MII_VSC8244_AUXCONSTAT_INIT);
- if (err < 0)
- return err;
+ int extcon;
extcon = phy_read(phydev, MII_VSC8244_EXT_CON1);
if (extcon < 0)
- return err;
+ return extcon;
extcon &= ~(MII_VSC8244_EXTCON1_TX_SKEW_MASK |
MII_VSC8244_EXTCON1_RX_SKEW_MASK);
- if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
- extcon |= (MII_VSC8244_EXTCON1_TX_SKEW |
- MII_VSC8244_EXTCON1_RX_SKEW);
+ extcon |= (MII_VSC8244_EXTCON1_TX_SKEW |
+ MII_VSC8244_EXTCON1_RX_SKEW);
err = phy_write(phydev, MII_VSC8244_EXT_CON1, extcon);
return err;
}
+EXPORT_SYMBOL(vsc824x_add_skew);
+
+static int vsc824x_config_init(struct phy_device *phydev)
+{
+ int err;
+
+ err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT,
+ MII_VSC8244_AUXCONSTAT_INIT);
+ if (err < 0)
+ return err;
+
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+ err = vsc824x_add_skew(phydev);
+
+ return err;
+}
static int vsc824x_ack_interrupt(struct phy_device *phydev)
{
--
1.7.3.4
^ permalink raw reply related
* [PATCH] net: Allow skb_recycle_check to be done in stages
From: Andy Fleming @ 2011-10-12 1:19 UTC (permalink / raw)
To: davem; +Cc: netdev
skb_recycle_check resets the skb if it's eligible for recycling.
However, there are times when a driver might want to optionally
manipulate the skb data with the skb before resetting the skb,
but after it has determined eligibility. We do this by splitting the
eligibility check from the skb reset, creating two inline functions to
accomplish that task.
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
include/linux/skbuff.h | 21 +++++++++++++++++++
net/core/skbuff.c | 51 ++++++++++++++++++++++++-----------------------
2 files changed, 47 insertions(+), 25 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ac6b05a..6b35ca1 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -525,6 +525,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
return __alloc_skb(size, priority, 1, NUMA_NO_NODE);
}
+extern void skb_recycle(struct sk_buff *skb);
extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
@@ -2459,5 +2460,25 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
+static inline bool skb_is_recycleable(struct sk_buff *skb, int skb_size)
+{
+ if (irqs_disabled())
+ return false;
+
+ if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)
+ return false;
+
+ if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE)
+ return false;
+
+ skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD);
+ if (skb_end_pointer(skb) - skb->head < skb_size)
+ return false;
+
+ if (skb_shared(skb) || skb_cloned(skb))
+ return false;
+
+ return true;
+}
#endif /* __KERNEL__ */
#endif /* _LINUX_SKBUFF_H */
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5b2c5f1..48bee84 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -475,6 +475,30 @@ void consume_skb(struct sk_buff *skb)
EXPORT_SYMBOL(consume_skb);
/**
+ * skb_recycle - clean up an skb for reuse
+ * @skb: buffer
+ *
+ * Recycles the skb to be reused as a receive buffer. This
+ * function does any necessary reference count dropping, and
+ * cleans up the skbuff as if it just came from __alloc_skb().
+ */
+void skb_recycle(struct sk_buff *skb)
+{
+ struct skb_shared_info *shinfo;
+
+ skb_release_head_state(skb);
+
+ shinfo = skb_shinfo(skb);
+ memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));
+ atomic_set(&shinfo->dataref, 1);
+
+ memset(skb, 0, offsetof(struct sk_buff, tail));
+ skb->data = skb->head + NET_SKB_PAD;
+ skb_reset_tail_pointer(skb);
+}
+EXPORT_SYMBOL(skb_recycle);
+
+/**
* skb_recycle_check - check if skb can be reused for receive
* @skb: buffer
* @skb_size: minimum receive buffer size
@@ -488,33 +512,10 @@ EXPORT_SYMBOL(consume_skb);
*/
bool skb_recycle_check(struct sk_buff *skb, int skb_size)
{
- struct skb_shared_info *shinfo;
-
- if (irqs_disabled())
- return false;
-
- if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)
- return false;
-
- if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE)
- return false;
-
- skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD);
- if (skb_end_pointer(skb) - skb->head < skb_size)
- return false;
-
- if (skb_shared(skb) || skb_cloned(skb))
+ if (!skb_is_recycleable(skb, skb_size))
return false;
- skb_release_head_state(skb);
-
- shinfo = skb_shinfo(skb);
- memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));
- atomic_set(&shinfo->dataref, 1);
-
- memset(skb, 0, offsetof(struct sk_buff, tail));
- skb->data = skb->head + NET_SKB_PAD;
- skb_reset_tail_pointer(skb);
+ skb_recycle(skb);
return true;
}
--
1.7.3.4
^ permalink raw reply related
* [PATCH v3] net-netlink: Add a new attribute to expose TOS values via netlink
From: Muraliraja Muniraju @ 2011-10-12 1:28 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy <kabe
Cc: linux-kernel, netdev, Murali Raja
In-Reply-To: <20111010145206.6f7e9ee2@nehalam.linuxnetplumber.net>
From: Murali Raja <muralira@google.com>
This patch exposes the tos value for the TCP sockets when the TOS flag
is requested in the ext_flags for the inet_diag request. This would mainly be
used to expose TOS values for both for TCP and UDP sockets. Currently it is
supported for TCP. When netlink support for UDP would be added the support
to expose the TOS values would alse be done.
Signed-off-by: Murali Raja <muralira@google.com>
---
Changelog since v2:
- Adding support for IPV6 class and using right API's
Changelog since v1:
- Removing reserved field
include/linux/inet_diag.h | 9 ++++++++-
net/ipv4/inet_diag.c | 5 +++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index bc8c490..e36093d 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -97,9 +97,10 @@ enum {
INET_DIAG_INFO,
INET_DIAG_VEGASINFO,
INET_DIAG_CONG,
+ INET_DIAG_TOS,
};
-#define INET_DIAG_MAX INET_DIAG_CONG
+#define INET_DIAG_MAX INET_DIAG_TOS
/* INET_DIAG_MEM */
@@ -120,6 +121,12 @@ struct tcpvegas_info {
__u32 tcpv_minrtt;
};
+/* INET_DIAG_TOS */
+
+struct inet_diag_tos {
+ __u8 idiag_tos;
+};
+
#ifdef __KERNEL__
struct sock;
struct inet_hashinfo;
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 389a2e6..f5e2bda 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -108,6 +108,9 @@ static int inet_csk_diag_fill(struct sock *sk,
icsk->icsk_ca_ops->name);
}
+ if ((ext & (1 << (INET_DIAG_TOS - 1))) && (sk->sk_family != AF_INET6))
+ RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos);
+
r->idiag_family = sk->sk_family;
r->idiag_state = sk->sk_state;
r->idiag_timer = 0;
@@ -130,6 +133,8 @@ static int inet_csk_diag_fill(struct sock *sk,
&np->rcv_saddr);
ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst,
&np->daddr);
+ if (ext & (1 << (INET_DIAG_TOS - 1)))
+ RTA_PUT_U8(skb, INET_DIAG_TOS, np->tclass);
}
#endif
--
1.7.3.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox