Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Provide device string properly for USB i2400m wimax devices, also
    don't OOPS when providing firmware string.  From Phil Sutter.

 2) Add support for sh_eth SH7734 chips, from Nobuhiro Iwamatsu.

 3) Add another device ID to USB zaurus driver, from Guan Xin.

 4) Loop index start in pool vector iterator is wrong causing MAC to not
    get configured in bnx2x driver, fix from Dmitry Kravkov.

 5) EQL driver assumes HZ=100, fix from Eric Dumazet.

 6) Now that skb_add_rx_frag() can specify the truesize increment
    separately, do so in f_phonet and cdc_phonet, also from Eric
    Dumazet.

 7) virtio_net accidently uses net_ratelimit() not only on the kernel
    warning but also the statistic bump, fix from Rick Jones.

 8) ip_route_input_mc() uses fixed init_net namespace, oops, use
    dev_net(dev) instead.  Fix from Benjamin LaHaise.

 9) dev_forward_skb() needs to clear the incoming interface index of the
    SKB so that it looks like a new incoming packet, also from Benjamin
    LaHaise.

10) iwlwifi mistakenly initializes a channel entry as 2GHZ instead of
    5GHZ, fix from Stanislav Yakovlev.

11) Missing kmalloc() return value checks in orinoco, from Santosh
    Nayak.

12) ath9k doesn't check for HT capabilities in the right way, it is
    checking ht_supported instead of the ATH9K_HW_CAP_HT flag.  Fix from
    Sujith Manoharan.

13) Fix x86 BPF JIT emission of 16-bit immediate field of AND
    instructions, from Feiran Zhuang.

14) Avoid infinite loop in GARP code when registering sysfs entries.
    From David Ward.

15) rose protocol uses memcpy instead of memcmp in a device address
    comparison, oops.  Fix from Daniel Borkmann.

16) Fix build of lpc_eth due to dev_hw_addr_rancom() interface being
    renamed to eth_hw_addr_random().  From Roland Stigge.

17) Make ipv6 RTM_GETROUTE interpret RTA_IIF attribute the same way
    that ipv4 does.  Fix from Shmulik Ladkani.

18) via-rhine has an inverted bit test, causing suspend/resume
    regressions.  Fix from Andreas Mohr.

19) RIONET assumes 4K page size, fix from Akinobu Mita.

20) Initialization of imask register in sky2 is buggy, because bits are
    "or'd" into an uninitialized local variable.  Fix from Lino
    Sanfilippo.

21) Fix FCOE checksum offload handling, from Yi Zou.

22) Fix VLAN processing regression in e1000, from Jiri Pirko.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits)
  sky2: dont overwrite settings for PHY Quick link
  tg3: Fix 5717 serdes powerdown problem
  net: usb: cdc_eem: fix mtu
  net: sh_eth: fix endian check for architecture independent
  usb/rtl8150 : Remove duplicated definitions
  rionet: fix page allocation order of rionet_active
  via-rhine: fix wait-bit inversion.
  ipv6: Fix RTM_GETROUTE's interpretation of RTA_IIF to be consistent with ipv4
  net: lpc_eth: Fix rename of dev_hw_addr_random
  net/netfilter/nfnetlink_acct.c: use linux/atomic.h
  rose_dev: fix memcpy-bug in rose_set_mac_address
  Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.
  net/garp: avoid infinite loop if attribute already exists
  x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND
  bonding: emit event when bonding changes MAC
  mac80211: fix oper channel timestamp updation
  ath9k: Use HW HT capabilites properly
  MAINTAINERS: adding maintainer for ipw2x00
  net: orinoco: add error handling for failed kmalloc().
  net/wireless: ipw2x00: fix a typo in wiphy struct initilization
  ...
This commit is contained in:
Linus Torvalds 2012-04-02 17:53:39 -07:00
commit ed359a3b7b
69 changed files with 711 additions and 300 deletions

View File

@ -1251,7 +1251,6 @@ ATHEROS ATH5K WIRELESS DRIVER
M: Jiri Slaby <jirislaby@gmail.com> M: Jiri Slaby <jirislaby@gmail.com>
M: Nick Kossifidis <mickflemm@gmail.com> M: Nick Kossifidis <mickflemm@gmail.com>
M: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com> M: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
M: Bob Copeland <me@bobcopeland.com>
L: linux-wireless@vger.kernel.org L: linux-wireless@vger.kernel.org
L: ath5k-devel@lists.ath5k.org L: ath5k-devel@lists.ath5k.org
W: http://wireless.kernel.org/en/users/Drivers/ath5k W: http://wireless.kernel.org/en/users/Drivers/ath5k
@ -3557,17 +3556,13 @@ L: linux-pm@vger.kernel.org
S: Supported S: Supported
F: arch/x86/platform/mrst/pmu.* F: arch/x86/platform/mrst/pmu.*
INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT INTEL PRO/WIRELESS 2100, 2200BG, 2915ABG NETWORK CONNECTION SUPPORT
M: Stanislav Yakovlev <stas.yakovlev@gmail.com>
L: linux-wireless@vger.kernel.org L: linux-wireless@vger.kernel.org
S: Orphan S: Maintained
F: Documentation/networking/README.ipw2100 F: Documentation/networking/README.ipw2100
F: drivers/net/wireless/ipw2x00/ipw2100.*
INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
L: linux-wireless@vger.kernel.org
S: Orphan
F: Documentation/networking/README.ipw2200 F: Documentation/networking/README.ipw2200
F: drivers/net/wireless/ipw2x00/ipw2200.* F: drivers/net/wireless/ipw2x00/
INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT) INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT)
M: Joseph Cihula <joseph.cihula@intel.com> M: Joseph Cihula <joseph.cihula@intel.com>

View File

@ -289,7 +289,7 @@ void bpf_jit_compile(struct sk_filter *fp)
EMIT2(0x24, K & 0xFF); /* and imm8,%al */ EMIT2(0x24, K & 0xFF); /* and imm8,%al */
} else if (K >= 0xFFFF0000) { } else if (K >= 0xFFFF0000) {
EMIT2(0x66, 0x25); /* and imm16,%ax */ EMIT2(0x66, 0x25); /* and imm16,%ax */
EMIT2(K, 2); EMIT(K, 2);
} else { } else {
EMIT1_off32(0x25, K); /* and imm32,%eax */ EMIT1_off32(0x25, K); /* and imm32,%eax */
} }

View File

@ -891,7 +891,7 @@ open_bchannel(struct fritzcard *fc, struct channel_req *rq)
{ {
struct bchannel *bch; struct bchannel *bch;
if (rq->adr.channel > 2) if (rq->adr.channel == 0 || rq->adr.channel > 2)
return -EINVAL; return -EINVAL;
if (rq->protocol == ISDN_P_NONE) if (rq->protocol == ISDN_P_NONE)
return -EINVAL; return -EINVAL;

View File

@ -1962,7 +1962,7 @@ open_bchannel(struct hfc_pci *hc, struct channel_req *rq)
{ {
struct bchannel *bch; struct bchannel *bch;
if (rq->adr.channel > 2) if (rq->adr.channel == 0 || rq->adr.channel > 2)
return -EINVAL; return -EINVAL;
if (rq->protocol == ISDN_P_NONE) if (rq->protocol == ISDN_P_NONE)
return -EINVAL; return -EINVAL;

View File

@ -486,7 +486,7 @@ open_bchannel(struct hfcsusb *hw, struct channel_req *rq)
{ {
struct bchannel *bch; struct bchannel *bch;
if (rq->adr.channel > 2) if (rq->adr.channel == 0 || rq->adr.channel > 2)
return -EINVAL; return -EINVAL;
if (rq->protocol == ISDN_P_NONE) if (rq->protocol == ISDN_P_NONE)
return -EINVAL; return -EINVAL;

View File

@ -1506,7 +1506,7 @@ open_bchannel(struct ipac_hw *ipac, struct channel_req *rq)
{ {
struct bchannel *bch; struct bchannel *bch;
if (rq->adr.channel > 2) if (rq->adr.channel == 0 || rq->adr.channel > 2)
return -EINVAL; return -EINVAL;
if (rq->protocol == ISDN_P_NONE) if (rq->protocol == ISDN_P_NONE)
return -EINVAL; return -EINVAL;

View File

@ -1670,7 +1670,7 @@ isar_open(struct isar_hw *isar, struct channel_req *rq)
{ {
struct bchannel *bch; struct bchannel *bch;
if (rq->adr.channel > 2) if (rq->adr.channel == 0 || rq->adr.channel > 2)
return -EINVAL; return -EINVAL;
if (rq->protocol == ISDN_P_NONE) if (rq->protocol == ISDN_P_NONE)
return -EINVAL; return -EINVAL;

View File

@ -860,7 +860,7 @@ open_bchannel(struct tiger_hw *card, struct channel_req *rq)
{ {
struct bchannel *bch; struct bchannel *bch;
if (rq->adr.channel > 2) if (rq->adr.channel == 0 || rq->adr.channel > 2)
return -EINVAL; return -EINVAL;
if (rq->protocol == ISDN_P_NONE) if (rq->protocol == ISDN_P_NONE)
return -EINVAL; return -EINVAL;

View File

@ -1015,7 +1015,7 @@ open_bchannel(struct w6692_hw *card, struct channel_req *rq)
{ {
struct bchannel *bch; struct bchannel *bch;
if (rq->adr.channel > 2) if (rq->adr.channel == 0 || rq->adr.channel > 2)
return -EINVAL; return -EINVAL;
if (rq->protocol == ISDN_P_NONE) if (rq->protocol == ISDN_P_NONE)
return -EINVAL; return -EINVAL;

View File

@ -891,9 +891,15 @@ static void bond_do_fail_over_mac(struct bonding *bond,
switch (bond->params.fail_over_mac) { switch (bond->params.fail_over_mac) {
case BOND_FOM_ACTIVE: case BOND_FOM_ACTIVE:
if (new_active) if (new_active) {
memcpy(bond->dev->dev_addr, new_active->dev->dev_addr, memcpy(bond->dev->dev_addr, new_active->dev->dev_addr,
new_active->dev->addr_len); new_active->dev->addr_len);
write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev);
read_lock(&bond->lock);
write_lock_bh(&bond->curr_slave_lock);
}
break; break;
case BOND_FOM_FOLLOW: case BOND_FOM_FOLLOW:
/* /*

View File

@ -125,6 +125,7 @@
#include <linux/if.h> #include <linux/if.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <linux/if_eql.h> #include <linux/if_eql.h>
#include <linux/pkt_sched.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
@ -143,7 +144,7 @@ static void eql_timer(unsigned long param)
equalizer_t *eql = (equalizer_t *) param; equalizer_t *eql = (equalizer_t *) param;
struct list_head *this, *tmp, *head; struct list_head *this, *tmp, *head;
spin_lock_bh(&eql->queue.lock); spin_lock(&eql->queue.lock);
head = &eql->queue.all_slaves; head = &eql->queue.all_slaves;
list_for_each_safe(this, tmp, head) { list_for_each_safe(this, tmp, head) {
slave_t *slave = list_entry(this, slave_t, list); slave_t *slave = list_entry(this, slave_t, list);
@ -157,7 +158,7 @@ static void eql_timer(unsigned long param)
} }
} }
spin_unlock_bh(&eql->queue.lock); spin_unlock(&eql->queue.lock);
eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL; eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL;
add_timer(&eql->timer); add_timer(&eql->timer);
@ -341,7 +342,7 @@ static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
struct net_device *slave_dev = slave->dev; struct net_device *slave_dev = slave->dev;
skb->dev = slave_dev; skb->dev = slave_dev;
skb->priority = 1; skb->priority = TC_PRIO_FILLER;
slave->bytes_queued += skb->len; slave->bytes_queued += skb->len;
dev_queue_xmit(skb); dev_queue_xmit(skb);
dev->stats.tx_packets++; dev->stats.tx_packets++;

View File

@ -1173,6 +1173,13 @@ enum {
}; };
struct bnx2x_prev_path_list {
u8 bus;
u8 slot;
u8 path;
struct list_head list;
};
struct bnx2x { struct bnx2x {
/* Fields used in the tx and intr/napi performance paths /* Fields used in the tx and intr/napi performance paths
* are grouped together in the beginning of the structure * are grouped together in the beginning of the structure

View File

@ -1721,6 +1721,29 @@ static void bnx2x_squeeze_objects(struct bnx2x *bp)
} while (0) } while (0)
#endif #endif
bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err)
{
/* build FW version dword */
u32 my_fw = (BCM_5710_FW_MAJOR_VERSION) +
(BCM_5710_FW_MINOR_VERSION << 8) +
(BCM_5710_FW_REVISION_VERSION << 16) +
(BCM_5710_FW_ENGINEERING_VERSION << 24);
/* read loaded FW from chip */
u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM);
DP(NETIF_MSG_IFUP, "loaded fw %x, my fw %x\n", loaded_fw, my_fw);
if (loaded_fw != my_fw) {
if (is_err)
BNX2X_ERR("bnx2x with FW %x was already loaded, which mismatches my %x FW. aborting\n",
loaded_fw, my_fw);
return false;
}
return true;
}
/* must be called with rtnl_lock */ /* must be called with rtnl_lock */
int bnx2x_nic_load(struct bnx2x *bp, int load_mode) int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
{ {
@ -1815,23 +1838,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
} }
if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP && if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP &&
load_code != FW_MSG_CODE_DRV_LOAD_COMMON) { load_code != FW_MSG_CODE_DRV_LOAD_COMMON) {
/* build FW version dword */
u32 my_fw = (BCM_5710_FW_MAJOR_VERSION) +
(BCM_5710_FW_MINOR_VERSION << 8) +
(BCM_5710_FW_REVISION_VERSION << 16) +
(BCM_5710_FW_ENGINEERING_VERSION << 24);
/* read loaded FW from chip */
u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM);
DP(BNX2X_MSG_SP, "loaded fw %x, my fw %x",
loaded_fw, my_fw);
/* abort nic load if version mismatch */ /* abort nic load if version mismatch */
if (my_fw != loaded_fw) { if (!bnx2x_test_firmware_version(bp, true)) {
BNX2X_ERR("bnx2x with FW %x already loaded, "
"which mismatches my %x FW. aborting",
loaded_fw, my_fw);
rc = -EBUSY; rc = -EBUSY;
LOAD_ERROR_EXIT(bp, load_error2); LOAD_ERROR_EXIT(bp, load_error2);
} }

View File

@ -431,6 +431,9 @@ void bnx2x_panic_dump(struct bnx2x *bp);
void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl); void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl);
/* validate currect fw is loaded */
bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err);
/* dev_close main block */ /* dev_close main block */
int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode); int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode);

View File

@ -1251,6 +1251,9 @@ struct drv_func_mb {
#define DRV_MSG_CODE_LINK_STATUS_CHANGED 0x01000000 #define DRV_MSG_CODE_LINK_STATUS_CHANGED 0x01000000
#define DRV_MSG_CODE_INITIATE_FLR 0x02000000
#define REQ_BC_VER_4_INITIATE_FLR 0x00070213
#define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000 #define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000
#define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000 #define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000
#define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000 #define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000

View File

@ -35,7 +35,6 @@
#define ETH_MAX_PACKET_SIZE 1500 #define ETH_MAX_PACKET_SIZE 1500
#define ETH_MAX_JUMBO_PACKET_SIZE 9600 #define ETH_MAX_JUMBO_PACKET_SIZE 9600
#define MDIO_ACCESS_TIMEOUT 1000 #define MDIO_ACCESS_TIMEOUT 1000
#define BMAC_CONTROL_RX_ENABLE 2
#define WC_LANE_MAX 4 #define WC_LANE_MAX 4
#define I2C_SWITCH_WIDTH 2 #define I2C_SWITCH_WIDTH 2
#define I2C_BSC0 0 #define I2C_BSC0 0

View File

@ -89,6 +89,8 @@
#define PFC_BRB_FULL_LB_XON_THRESHOLD 250 #define PFC_BRB_FULL_LB_XON_THRESHOLD 250
#define MAXVAL(a, b) (((a) > (b)) ? (a) : (b)) #define MAXVAL(a, b) (((a) > (b)) ? (a) : (b))
#define BMAC_CONTROL_RX_ENABLE 2
/***********************************************************/ /***********************************************************/
/* Structs */ /* Structs */
/***********************************************************/ /***********************************************************/

View File

@ -52,6 +52,7 @@
#include <linux/prefetch.h> #include <linux/prefetch.h>
#include <linux/zlib.h> #include <linux/zlib.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/semaphore.h>
#include <linux/stringify.h> #include <linux/stringify.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
@ -211,6 +212,10 @@ static DEFINE_PCI_DEVICE_TABLE(bnx2x_pci_tbl) = {
MODULE_DEVICE_TABLE(pci, bnx2x_pci_tbl); MODULE_DEVICE_TABLE(pci, bnx2x_pci_tbl);
/* Global resources for unloading a previously loaded device */
#define BNX2X_PREV_WAIT_NEEDED 1
static DEFINE_SEMAPHORE(bnx2x_prev_sem);
static LIST_HEAD(bnx2x_prev_list);
/**************************************************************************** /****************************************************************************
* General service functions * General service functions
****************************************************************************/ ****************************************************************************/
@ -8812,109 +8817,371 @@ static inline void bnx2x_undi_int_disable(struct bnx2x *bp)
bnx2x_undi_int_disable_e1h(bp); bnx2x_undi_int_disable_e1h(bp);
} }
static void __devinit bnx2x_undi_unload(struct bnx2x *bp) static void __devinit bnx2x_prev_unload_close_mac(struct bnx2x *bp)
{ {
u32 val; u32 val, base_addr, offset, mask, reset_reg;
bool mac_stopped = false;
u8 port = BP_PORT(bp);
/* possibly another driver is trying to reset the chip */ reset_reg = REG_RD(bp, MISC_REG_RESET_REG_2);
bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_RESET);
/* check if doorbell queue is reset */ if (!CHIP_IS_E3(bp)) {
if (REG_RD(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET) val = REG_RD(bp, NIG_REG_BMAC0_REGS_OUT_EN + port * 4);
& MISC_REGISTERS_RESET_REG_1_RST_DORQ) { mask = MISC_REGISTERS_RESET_REG_2_RST_BMAC0 << port;
if ((mask & reset_reg) && val) {
u32 wb_data[2];
BNX2X_DEV_INFO("Disable bmac Rx\n");
base_addr = BP_PORT(bp) ? NIG_REG_INGRESS_BMAC1_MEM
: NIG_REG_INGRESS_BMAC0_MEM;
offset = CHIP_IS_E2(bp) ? BIGMAC2_REGISTER_BMAC_CONTROL
: BIGMAC_REGISTER_BMAC_CONTROL;
/* /*
* Check if it is the UNDI driver * use rd/wr since we cannot use dmae. This is safe
* UNDI driver initializes CID offset for normal bell to 0x7 * since MCP won't access the bus due to the request
*/ * to unload, and no function on the path can be
val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); * loaded at this time.
if (val == 0x7) { */
u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; wb_data[0] = REG_RD(bp, base_addr + offset);
/* save our pf_num */ wb_data[1] = REG_RD(bp, base_addr + offset + 0x4);
int orig_pf_num = bp->pf_num; wb_data[0] &= ~BMAC_CONTROL_RX_ENABLE;
int port; REG_WR(bp, base_addr + offset, wb_data[0]);
u32 swap_en, swap_val, value; REG_WR(bp, base_addr + offset + 0x4, wb_data[1]);
/* clear the UNDI indication */ }
REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); BNX2X_DEV_INFO("Disable emac Rx\n");
REG_WR(bp, NIG_REG_NIG_EMAC0_EN + BP_PORT(bp)*4, 0);
BNX2X_DEV_INFO("UNDI is active! reset device\n"); mac_stopped = true;
} else {
/* try unload UNDI on port 0 */ if (reset_reg & MISC_REGISTERS_RESET_REG_2_XMAC) {
bp->pf_num = 0; BNX2X_DEV_INFO("Disable xmac Rx\n");
bp->fw_seq = base_addr = BP_PORT(bp) ? GRCBASE_XMAC1 : GRCBASE_XMAC0;
(SHMEM_RD(bp, func_mb[bp->pf_num].drv_mb_header) & val = REG_RD(bp, base_addr + XMAC_REG_PFC_CTRL_HI);
DRV_MSG_SEQ_NUMBER_MASK); REG_WR(bp, base_addr + XMAC_REG_PFC_CTRL_HI,
reset_code = bnx2x_fw_command(bp, reset_code, 0); val & ~(1 << 1));
REG_WR(bp, base_addr + XMAC_REG_PFC_CTRL_HI,
/* if UNDI is loaded on the other port */ val | (1 << 1));
if (reset_code != FW_MSG_CODE_DRV_UNLOAD_COMMON) { REG_WR(bp, base_addr + XMAC_REG_CTRL, 0);
mac_stopped = true;
/* send "DONE" for previous unload */ }
bnx2x_fw_command(bp, mask = MISC_REGISTERS_RESET_REG_2_UMAC0 << port;
DRV_MSG_CODE_UNLOAD_DONE, 0); if (mask & reset_reg) {
BNX2X_DEV_INFO("Disable umac Rx\n");
/* unload UNDI on port 1 */ base_addr = BP_PORT(bp) ? GRCBASE_UMAC1 : GRCBASE_UMAC0;
bp->pf_num = 1; REG_WR(bp, base_addr + UMAC_REG_COMMAND_CONFIG, 0);
bp->fw_seq = mac_stopped = true;
(SHMEM_RD(bp, func_mb[bp->pf_num].drv_mb_header) &
DRV_MSG_SEQ_NUMBER_MASK);
reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
bnx2x_fw_command(bp, reset_code, 0);
}
bnx2x_undi_int_disable(bp);
port = BP_PORT(bp);
/* close input traffic and wait for it */
/* Do not rcv packets to BRB */
REG_WR(bp, (port ? NIG_REG_LLH1_BRB1_DRV_MASK :
NIG_REG_LLH0_BRB1_DRV_MASK), 0x0);
/* Do not direct rcv packets that are not for MCP to
* the BRB */
REG_WR(bp, (port ? NIG_REG_LLH1_BRB1_NOT_MCP :
NIG_REG_LLH0_BRB1_NOT_MCP), 0x0);
/* clear AEU */
REG_WR(bp, (port ? MISC_REG_AEU_MASK_ATTN_FUNC_1 :
MISC_REG_AEU_MASK_ATTN_FUNC_0), 0);
msleep(10);
/* save NIG port swap info */
swap_val = REG_RD(bp, NIG_REG_PORT_SWAP);
swap_en = REG_RD(bp, NIG_REG_STRAP_OVERRIDE);
/* reset device */
REG_WR(bp,
GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR,
0xd3ffffff);
value = 0x1400;
if (CHIP_IS_E3(bp)) {
value |= MISC_REGISTERS_RESET_REG_2_MSTAT0;
value |= MISC_REGISTERS_RESET_REG_2_MSTAT1;
}
REG_WR(bp,
GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR,
value);
/* take the NIG out of reset and restore swap values */
REG_WR(bp,
GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET,
MISC_REGISTERS_RESET_REG_1_RST_NIG);
REG_WR(bp, NIG_REG_PORT_SWAP, swap_val);
REG_WR(bp, NIG_REG_STRAP_OVERRIDE, swap_en);
/* send unload done to the MCP */
bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0);
/* restore our func and fw_seq */
bp->pf_num = orig_pf_num;
} }
} }
/* now it's safe to release the lock */ if (mac_stopped)
bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RESET); msleep(20);
}
#define BNX2X_PREV_UNDI_PROD_ADDR(p) (BAR_TSTRORM_INTMEM + 0x1508 + ((p) << 4))
#define BNX2X_PREV_UNDI_RCQ(val) ((val) & 0xffff)
#define BNX2X_PREV_UNDI_BD(val) ((val) >> 16 & 0xffff)
#define BNX2X_PREV_UNDI_PROD(rcq, bd) ((bd) << 16 | (rcq))
static void __devinit bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port,
u8 inc)
{
u16 rcq, bd;
u32 tmp_reg = REG_RD(bp, BNX2X_PREV_UNDI_PROD_ADDR(port));
rcq = BNX2X_PREV_UNDI_RCQ(tmp_reg) + inc;
bd = BNX2X_PREV_UNDI_BD(tmp_reg) + inc;
tmp_reg = BNX2X_PREV_UNDI_PROD(rcq, bd);
REG_WR(bp, BNX2X_PREV_UNDI_PROD_ADDR(port), tmp_reg);
BNX2X_DEV_INFO("UNDI producer [%d] rings bd -> 0x%04x, rcq -> 0x%04x\n",
port, bd, rcq);
}
static int __devinit bnx2x_prev_mcp_done(struct bnx2x *bp)
{
u32 rc = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0);
if (!rc) {
BNX2X_ERR("MCP response failure, aborting\n");
return -EBUSY;
}
return 0;
}
static bool __devinit bnx2x_prev_is_path_marked(struct bnx2x *bp)
{
struct bnx2x_prev_path_list *tmp_list;
int rc = false;
if (down_trylock(&bnx2x_prev_sem))
return false;
list_for_each_entry(tmp_list, &bnx2x_prev_list, list) {
if (PCI_SLOT(bp->pdev->devfn) == tmp_list->slot &&
bp->pdev->bus->number == tmp_list->bus &&
BP_PATH(bp) == tmp_list->path) {
rc = true;
BNX2X_DEV_INFO("Path %d was already cleaned from previous drivers\n",
BP_PATH(bp));
break;
}
}
up(&bnx2x_prev_sem);
return rc;
}
static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp)
{
struct bnx2x_prev_path_list *tmp_list;
int rc;
tmp_list = (struct bnx2x_prev_path_list *)
kmalloc(sizeof(struct bnx2x_prev_path_list), GFP_KERNEL);
if (!tmp_list) {
BNX2X_ERR("Failed to allocate 'bnx2x_prev_path_list'\n");
return -ENOMEM;
}
tmp_list->bus = bp->pdev->bus->number;
tmp_list->slot = PCI_SLOT(bp->pdev->devfn);
tmp_list->path = BP_PATH(bp);
rc = down_interruptible(&bnx2x_prev_sem);
if (rc) {
BNX2X_ERR("Received %d when tried to take lock\n", rc);
kfree(tmp_list);
} else {
BNX2X_DEV_INFO("Marked path [%d] - finished previous unload\n",
BP_PATH(bp));
list_add(&tmp_list->list, &bnx2x_prev_list);
up(&bnx2x_prev_sem);
}
return rc;
}
static bool __devinit bnx2x_can_flr(struct bnx2x *bp)
{
int pos;
u32 cap;
struct pci_dev *dev = bp->pdev;
pos = pci_pcie_cap(dev);
if (!pos)
return false;
pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP, &cap);
if (!(cap & PCI_EXP_DEVCAP_FLR))
return false;
return true;
}
static int __devinit bnx2x_do_flr(struct bnx2x *bp)
{
int i, pos;
u16 status;
struct pci_dev *dev = bp->pdev;
/* probe the capability first */
if (bnx2x_can_flr(bp))
return -ENOTTY;
pos = pci_pcie_cap(dev);
if (!pos)
return -ENOTTY;
/* Wait for Transaction Pending bit clean */
for (i = 0; i < 4; i++) {
if (i)
msleep((1 << (i - 1)) * 100);
pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, &status);
if (!(status & PCI_EXP_DEVSTA_TRPND))
goto clear;
}
dev_err(&dev->dev,
"transaction is not cleared; proceeding with reset anyway\n");
clear:
if (bp->common.bc_ver < REQ_BC_VER_4_INITIATE_FLR) {
BNX2X_ERR("FLR not supported by BC_VER: 0x%x\n",
bp->common.bc_ver);
return -EINVAL;
}
bnx2x_fw_command(bp, DRV_MSG_CODE_INITIATE_FLR, 0);
return 0;
}
static int __devinit bnx2x_prev_unload_uncommon(struct bnx2x *bp)
{
int rc;
BNX2X_DEV_INFO("Uncommon unload Flow\n");
/* Test if previous unload process was already finished for this path */
if (bnx2x_prev_is_path_marked(bp))
return bnx2x_prev_mcp_done(bp);
/* If function has FLR capabilities, and existing FW version matches
* the one required, then FLR will be sufficient to clean any residue
* left by previous driver
*/
if (bnx2x_test_firmware_version(bp, false) && bnx2x_can_flr(bp))
return bnx2x_do_flr(bp);
/* Close the MCP request, return failure*/
rc = bnx2x_prev_mcp_done(bp);
if (!rc)
rc = BNX2X_PREV_WAIT_NEEDED;
return rc;
}
static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp)
{
u32 reset_reg, tmp_reg = 0, rc;
/* It is possible a previous function received 'common' answer,
* but hasn't loaded yet, therefore creating a scenario of
* multiple functions receiving 'common' on the same path.
*/
BNX2X_DEV_INFO("Common unload Flow\n");
if (bnx2x_prev_is_path_marked(bp))
return bnx2x_prev_mcp_done(bp);
reset_reg = REG_RD(bp, MISC_REG_RESET_REG_1);
/* Reset should be performed after BRB is emptied */
if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1) {
u32 timer_count = 1000;
bool prev_undi = false;
/* Close the MAC Rx to prevent BRB from filling up */
bnx2x_prev_unload_close_mac(bp);
/* Check if the UNDI driver was previously loaded
* UNDI driver initializes CID offset for normal bell to 0x7
*/
reset_reg = REG_RD(bp, MISC_REG_RESET_REG_1);
if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_DORQ) {
tmp_reg = REG_RD(bp, DORQ_REG_NORM_CID_OFST);
if (tmp_reg == 0x7) {
BNX2X_DEV_INFO("UNDI previously loaded\n");
prev_undi = true;
/* clear the UNDI indication */
REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
}
}
/* wait until BRB is empty */
tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS);
while (timer_count) {
u32 prev_brb = tmp_reg;
tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS);
if (!tmp_reg)
break;
BNX2X_DEV_INFO("BRB still has 0x%08x\n", tmp_reg);
/* reset timer as long as BRB actually gets emptied */
if (prev_brb > tmp_reg)
timer_count = 1000;
else
timer_count--;
/* If UNDI resides in memory, manually increment it */
if (prev_undi)
bnx2x_prev_unload_undi_inc(bp, BP_PORT(bp), 1);
udelay(10);
}
if (!timer_count)
BNX2X_ERR("Failed to empty BRB, hope for the best\n");
}
/* No packets are in the pipeline, path is ready for reset */
bnx2x_reset_common(bp);
rc = bnx2x_prev_mark_path(bp);
if (rc) {
bnx2x_prev_mcp_done(bp);
return rc;
}
return bnx2x_prev_mcp_done(bp);
}
static int __devinit bnx2x_prev_unload(struct bnx2x *bp)
{
int time_counter = 10;
u32 rc, fw, hw_lock_reg, hw_lock_val;
BNX2X_DEV_INFO("Entering Previous Unload Flow\n");
/* Release previously held locks */
hw_lock_reg = (BP_FUNC(bp) <= 5) ?
(MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) :
(MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8);
hw_lock_val = (REG_RD(bp, hw_lock_reg));
if (hw_lock_val) {
if (hw_lock_val & HW_LOCK_RESOURCE_NVRAM) {
BNX2X_DEV_INFO("Release Previously held NVRAM lock\n");
REG_WR(bp, MCP_REG_MCPR_NVM_SW_ARB,
(MCPR_NVM_SW_ARB_ARB_REQ_CLR1 << BP_PORT(bp)));
}
BNX2X_DEV_INFO("Release Previously held hw lock\n");
REG_WR(bp, hw_lock_reg, 0xffffffff);
} else
BNX2X_DEV_INFO("No need to release hw/nvram locks\n");
if (MCPR_ACCESS_LOCK_LOCK & REG_RD(bp, MCP_REG_MCPR_ACCESS_LOCK)) {
BNX2X_DEV_INFO("Release previously held alr\n");
REG_WR(bp, MCP_REG_MCPR_ACCESS_LOCK, 0);
}
do {
/* Lock MCP using an unload request */
fw = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS, 0);
if (!fw) {
BNX2X_ERR("MCP response failure, aborting\n");
rc = -EBUSY;
break;
}
if (fw == FW_MSG_CODE_DRV_UNLOAD_COMMON) {
rc = bnx2x_prev_unload_common(bp);
break;
}
/* non-common reply from MCP night require looping */
rc = bnx2x_prev_unload_uncommon(bp);
if (rc != BNX2X_PREV_WAIT_NEEDED)
break;
msleep(20);
} while (--time_counter);
if (!time_counter || rc) {
BNX2X_ERR("Failed unloading previous driver, aborting\n");
rc = -EBUSY;
}
BNX2X_DEV_INFO("Finished Previous Unload Flow [%d]\n", rc);
return rc;
} }
static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp)
@ -10100,8 +10367,16 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
func = BP_FUNC(bp); func = BP_FUNC(bp);
/* need to reset chip if undi was active */ /* need to reset chip if undi was active */
if (!BP_NOMCP(bp)) if (!BP_NOMCP(bp)) {
bnx2x_undi_unload(bp); /* init fw_seq */
bp->fw_seq =
SHMEM_RD(bp, func_mb[BP_FW_MB_IDX(bp)].drv_mb_header) &
DRV_MSG_SEQ_NUMBER_MASK;
BNX2X_DEV_INFO("fw_seq 0x%08x\n", bp->fw_seq);
bnx2x_prev_unload(bp);
}
if (CHIP_REV_IS_FPGA(bp)) if (CHIP_REV_IS_FPGA(bp))
dev_err(&bp->pdev->dev, "FPGA detected\n"); dev_err(&bp->pdev->dev, "FPGA detected\n");
@ -11431,9 +11706,18 @@ static int __init bnx2x_init(void)
static void __exit bnx2x_cleanup(void) static void __exit bnx2x_cleanup(void)
{ {
struct list_head *pos, *q;
pci_unregister_driver(&bnx2x_pci_driver); pci_unregister_driver(&bnx2x_pci_driver);
destroy_workqueue(bnx2x_wq); destroy_workqueue(bnx2x_wq);
/* Free globablly allocated resources */
list_for_each_safe(pos, q, &bnx2x_prev_list) {
struct bnx2x_prev_path_list *tmp =
list_entry(pos, struct bnx2x_prev_path_list, list);
list_del(pos);
kfree(tmp);
}
} }
void bnx2x_notify_link_changed(struct bnx2x *bp) void bnx2x_notify_link_changed(struct bnx2x *bp)

View File

@ -987,6 +987,7 @@
* clear; 1 = set. Data valid only in addresses 0-4. all the rest are zero. */ * clear; 1 = set. Data valid only in addresses 0-4. all the rest are zero. */
#define IGU_REG_WRITE_DONE_PENDING 0x130480 #define IGU_REG_WRITE_DONE_PENDING 0x130480
#define MCP_A_REG_MCPR_SCRATCH 0x3a0000 #define MCP_A_REG_MCPR_SCRATCH 0x3a0000
#define MCP_REG_MCPR_ACCESS_LOCK 0x8009c
#define MCP_REG_MCPR_CPU_PROGRAM_COUNTER 0x8501c #define MCP_REG_MCPR_CPU_PROGRAM_COUNTER 0x8501c
#define MCP_REG_MCPR_GP_INPUTS 0x800c0 #define MCP_REG_MCPR_GP_INPUTS 0x800c0
#define MCP_REG_MCPR_GP_OENABLE 0x800c8 #define MCP_REG_MCPR_GP_OENABLE 0x800c8
@ -1686,6 +1687,7 @@
[10] rst_dbg; [11] rst_misc_core; [12] rst_dbue (UART); [13] [10] rst_dbg; [11] rst_misc_core; [12] rst_dbue (UART); [13]
Pci_resetmdio_n; [14] rst_emac0_hard_core; [15] rst_emac1_hard_core; 16] Pci_resetmdio_n; [14] rst_emac0_hard_core; [15] rst_emac1_hard_core; 16]
rst_pxp_rq_rd_wr; 31:17] reserved */ rst_pxp_rq_rd_wr; 31:17] reserved */
#define MISC_REG_RESET_REG_1 0xa580
#define MISC_REG_RESET_REG_2 0xa590 #define MISC_REG_RESET_REG_2 0xa590
/* [RW 20] 20 bit GRC address where the scratch-pad of the MCP that is /* [RW 20] 20 bit GRC address where the scratch-pad of the MCP that is
shared with the driver resides */ shared with the driver resides */
@ -5606,6 +5608,7 @@
/* [RC 32] Parity register #0 read clear */ /* [RC 32] Parity register #0 read clear */
#define XSEM_REG_XSEM_PRTY_STS_CLR_0 0x280128 #define XSEM_REG_XSEM_PRTY_STS_CLR_0 0x280128
#define XSEM_REG_XSEM_PRTY_STS_CLR_1 0x280138 #define XSEM_REG_XSEM_PRTY_STS_CLR_1 0x280138
#define MCPR_ACCESS_LOCK_LOCK (1L<<31)
#define MCPR_NVM_ACCESS_ENABLE_EN (1L<<0) #define MCPR_NVM_ACCESS_ENABLE_EN (1L<<0)
#define MCPR_NVM_ACCESS_ENABLE_WR_EN (1L<<1) #define MCPR_NVM_ACCESS_ENABLE_WR_EN (1L<<1)
#define MCPR_NVM_ADDR_NVM_ADDR_VALUE (0xffffffL<<0) #define MCPR_NVM_ADDR_NVM_ADDR_VALUE (0xffffffL<<0)
@ -5732,6 +5735,7 @@
#define MISC_REGISTERS_GPIO_PORT_SHIFT 4 #define MISC_REGISTERS_GPIO_PORT_SHIFT 4
#define MISC_REGISTERS_GPIO_SET_POS 8 #define MISC_REGISTERS_GPIO_SET_POS 8
#define MISC_REGISTERS_RESET_REG_1_CLEAR 0x588 #define MISC_REGISTERS_RESET_REG_1_CLEAR 0x588
#define MISC_REGISTERS_RESET_REG_1_RST_BRB1 (0x1<<0)
#define MISC_REGISTERS_RESET_REG_1_RST_DORQ (0x1<<19) #define MISC_REGISTERS_RESET_REG_1_RST_DORQ (0x1<<19)
#define MISC_REGISTERS_RESET_REG_1_RST_HC (0x1<<29) #define MISC_REGISTERS_RESET_REG_1_RST_HC (0x1<<29)
#define MISC_REGISTERS_RESET_REG_1_RST_NIG (0x1<<7) #define MISC_REGISTERS_RESET_REG_1_RST_NIG (0x1<<7)

View File

@ -3847,7 +3847,7 @@ static bool bnx2x_credit_pool_get_entry(
continue; continue;
/* If we've got here we are going to find a free entry */ /* If we've got here we are going to find a free entry */
for (idx = vec * BNX2X_POOL_VEC_SIZE, i = 0; for (idx = vec * BIT_VEC64_ELEM_SZ, i = 0;
i < BIT_VEC64_ELEM_SZ; idx++, i++) i < BIT_VEC64_ELEM_SZ; idx++, i++)
if (BIT_VEC64_TEST_BIT(o->pool_mirror, idx)) { if (BIT_VEC64_TEST_BIT(o->pool_mirror, idx)) {

View File

@ -2778,7 +2778,9 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 && (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 &&
(tp->phy_flags & TG3_PHYFLG_MII_SERDES))) (tp->phy_flags & TG3_PHYFLG_MII_SERDES)) ||
(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
!tp->pci_fn))
return; return;
if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX || if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX ||

View File

@ -356,13 +356,13 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)
if (prop) if (prop)
tbiaddr = *prop; tbiaddr = *prop;
}
if (tbiaddr == -1) { if (tbiaddr == -1) {
err = -EBUSY; err = -EBUSY;
goto err_free_irqs; goto err_free_irqs;
} else { } else {
out_be32(tbipa, tbiaddr); out_be32(tbipa, tbiaddr);
}
} }
err = of_mdiobus_register(new_bus, np); err = of_mdiobus_register(new_bus, np);

View File

@ -164,6 +164,8 @@ static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
static bool e1000_vlan_used(struct e1000_adapter *adapter); static bool e1000_vlan_used(struct e1000_adapter *adapter);
static void e1000_vlan_mode(struct net_device *netdev, static void e1000_vlan_mode(struct net_device *netdev,
netdev_features_t features); netdev_features_t features);
static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
bool filter_on);
static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid); static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid);
static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
static void e1000_restore_vlan(struct e1000_adapter *adapter); static void e1000_restore_vlan(struct e1000_adapter *adapter);
@ -215,7 +217,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
static int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE; #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
static int debug = -1;
module_param(debug, int, 0); module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
@ -979,7 +982,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
adapter = netdev_priv(netdev); adapter = netdev_priv(netdev);
adapter->netdev = netdev; adapter->netdev = netdev;
adapter->pdev = pdev; adapter->pdev = pdev;
adapter->msg_enable = (1 << debug) - 1; adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
adapter->bars = bars; adapter->bars = bars;
adapter->need_ioport = need_ioport; adapter->need_ioport = need_ioport;
@ -1214,7 +1217,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
if (err) if (err)
goto err_register; goto err_register;
e1000_vlan_mode(netdev, netdev->features); e1000_vlan_filter_on_off(adapter, false);
/* print bus type/speed/width info */ /* print bus type/speed/width info */
e_info(probe, "(PCI%s:%dMHz:%d-bit) %pM\n", e_info(probe, "(PCI%s:%dMHz:%d-bit) %pM\n",
@ -4770,6 +4773,22 @@ static bool e1000_vlan_used(struct e1000_adapter *adapter)
return false; return false;
} }
static void __e1000_vlan_mode(struct e1000_adapter *adapter,
netdev_features_t features)
{
struct e1000_hw *hw = &adapter->hw;
u32 ctrl;
ctrl = er32(CTRL);
if (features & NETIF_F_HW_VLAN_RX) {
/* enable VLAN tag insert/strip */
ctrl |= E1000_CTRL_VME;
} else {
/* disable VLAN tag insert/strip */
ctrl &= ~E1000_CTRL_VME;
}
ew32(CTRL, ctrl);
}
static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter, static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
bool filter_on) bool filter_on)
{ {
@ -4779,6 +4798,7 @@ static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
if (!test_bit(__E1000_DOWN, &adapter->flags)) if (!test_bit(__E1000_DOWN, &adapter->flags))
e1000_irq_disable(adapter); e1000_irq_disable(adapter);
__e1000_vlan_mode(adapter, adapter->netdev->features);
if (filter_on) { if (filter_on) {
/* enable VLAN receive filtering */ /* enable VLAN receive filtering */
rctl = er32(RCTL); rctl = er32(RCTL);
@ -4799,24 +4819,14 @@ static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
} }
static void e1000_vlan_mode(struct net_device *netdev, static void e1000_vlan_mode(struct net_device *netdev,
netdev_features_t features) netdev_features_t features)
{ {
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
u32 ctrl;
if (!test_bit(__E1000_DOWN, &adapter->flags)) if (!test_bit(__E1000_DOWN, &adapter->flags))
e1000_irq_disable(adapter); e1000_irq_disable(adapter);
ctrl = er32(CTRL); __e1000_vlan_mode(adapter, features);
if (features & NETIF_F_HW_VLAN_RX) {
/* enable VLAN tag insert/strip */
ctrl |= E1000_CTRL_VME;
} else {
/* disable VLAN tag insert/strip */
ctrl &= ~E1000_CTRL_VME;
}
ew32(CTRL, ctrl);
if (!test_bit(__E1000_DOWN, &adapter->flags)) if (!test_bit(__E1000_DOWN, &adapter->flags))
e1000_irq_enable(adapter); e1000_irq_enable(adapter);

View File

@ -60,6 +60,11 @@
char e1000e_driver_name[] = "e1000e"; char e1000e_driver_name[] = "e1000e";
const char e1000e_driver_version[] = DRV_VERSION; const char e1000e_driver_version[] = DRV_VERSION;
#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
static int debug = -1;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state); static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
static const struct e1000_info *e1000_info_tbl[] = { static const struct e1000_info *e1000_info_tbl[] = {
@ -6172,7 +6177,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
adapter->hw.adapter = adapter; adapter->hw.adapter = adapter;
adapter->hw.mac.type = ei->mac; adapter->hw.mac.type = ei->mac;
adapter->max_hw_frame_size = ei->max_hw_frame_size; adapter->max_hw_frame_size = ei->max_hw_frame_size;
adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
mmio_start = pci_resource_start(pdev, 0); mmio_start = pci_resource_start(pdev, 0);
mmio_len = pci_resource_len(pdev, 0); mmio_len = pci_resource_len(pdev, 0);

View File

@ -238,6 +238,11 @@ MODULE_DESCRIPTION("Intel(R) Gigabit Ethernet Network Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
static int debug = -1;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
struct igb_reg_info { struct igb_reg_info {
u32 ofs; u32 ofs;
char *name; char *name;
@ -1893,7 +1898,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
adapter->pdev = pdev; adapter->pdev = pdev;
hw = &adapter->hw; hw = &adapter->hw;
hw->back = adapter; hw->back = adapter;
adapter->msg_enable = NETIF_MSG_DRV | NETIF_MSG_PROBE; adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
mmio_start = pci_resource_start(pdev, 0); mmio_start = pci_resource_start(pdev, 0);
mmio_len = pci_resource_len(pdev, 0); mmio_len = pci_resource_len(pdev, 0);

View File

@ -55,6 +55,11 @@ static const char igbvf_driver_string[] =
static const char igbvf_copyright[] = static const char igbvf_copyright[] =
"Copyright (c) 2009 - 2012 Intel Corporation."; "Copyright (c) 2009 - 2012 Intel Corporation.";
#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
static int debug = -1;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
static int igbvf_poll(struct napi_struct *napi, int budget); static int igbvf_poll(struct napi_struct *napi, int budget);
static void igbvf_reset(struct igbvf_adapter *); static void igbvf_reset(struct igbvf_adapter *);
static void igbvf_set_interrupt_capability(struct igbvf_adapter *); static void igbvf_set_interrupt_capability(struct igbvf_adapter *);
@ -2649,7 +2654,7 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
adapter->flags = ei->flags; adapter->flags = ei->flags;
adapter->hw.back = adapter; adapter->hw.back = adapter;
adapter->hw.mac.type = ei->mac; adapter->hw.mac.type = ei->mac;
adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
/* PCI config space info */ /* PCI config space info */

View File

@ -134,8 +134,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/10GbE Network Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
#define DEFAULT_DEBUG_LEVEL_SHIFT 3 #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
static int debug = DEFAULT_DEBUG_LEVEL_SHIFT; static int debug = -1;
module_param(debug, int, 0); module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
@ -442,7 +442,7 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
adapter->netdev = netdev; adapter->netdev = netdev;
adapter->pdev = pdev; adapter->pdev = pdev;
adapter->hw.back = adapter; adapter->hw.back = adapter;
adapter->msg_enable = netif_msg_init(debug, DEFAULT_DEBUG_LEVEL_SHIFT); adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
adapter->hw.hw_addr = pci_ioremap_bar(pdev, BAR_0); adapter->hw.hw_addr = pci_ioremap_bar(pdev, BAR_0);
if (!adapter->hw.hw_addr) { if (!adapter->hw.hw_addr) {

View File

@ -544,7 +544,7 @@ struct ixgbe_fdir_filter {
u16 action; u16 action;
}; };
enum ixbge_state_t { enum ixgbe_state_t {
__IXGBE_TESTING, __IXGBE_TESTING,
__IXGBE_RESETTING, __IXGBE_RESETTING,
__IXGBE_DOWN, __IXGBE_DOWN,

View File

@ -63,8 +63,8 @@ static char ixgbe_default_device_descr[] =
"Intel(R) 10 Gigabit Network Connection"; "Intel(R) 10 Gigabit Network Connection";
#endif #endif
#define MAJ 3 #define MAJ 3
#define MIN 6 #define MIN 8
#define BUILD 7 #define BUILD 21
#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ #define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \
__stringify(BUILD) "-k" __stringify(BUILD) "-k"
const char ixgbe_driver_version[] = DRV_VERSION; const char ixgbe_driver_version[] = DRV_VERSION;
@ -141,13 +141,16 @@ module_param(allow_unsupported_sfp, uint, 0);
MODULE_PARM_DESC(allow_unsupported_sfp, MODULE_PARM_DESC(allow_unsupported_sfp,
"Allow unsupported and untested SFP+ modules on 82599-based adapters"); "Allow unsupported and untested SFP+ modules on 82599-based adapters");
#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
static int debug = -1;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION("Intel(R) 10 Gigabit PCI Express Network Driver"); MODULE_DESCRIPTION("Intel(R) 10 Gigabit PCI Express Network Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
#define DEFAULT_DEBUG_LEVEL_SHIFT 3
static void ixgbe_service_event_schedule(struct ixgbe_adapter *adapter) static void ixgbe_service_event_schedule(struct ixgbe_adapter *adapter)
{ {
if (!test_bit(__IXGBE_DOWN, &adapter->state) && if (!test_bit(__IXGBE_DOWN, &adapter->state) &&
@ -6834,7 +6837,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
adapter->pdev = pdev; adapter->pdev = pdev;
hw = &adapter->hw; hw = &adapter->hw;
hw->back = adapter; hw->back = adapter;
adapter->msg_enable = (1 << DEFAULT_DEBUG_LEVEL_SHIFT) - 1; adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
hw->hw_addr = ioremap(pci_resource_start(pdev, 0), hw->hw_addr = ioremap(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0)); pci_resource_len(pdev, 0));

View File

@ -91,7 +91,10 @@ MODULE_DESCRIPTION("Intel(R) 82599 Virtual Function Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
#define DEFAULT_DEBUG_LEVEL_SHIFT 3 #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
static int debug = -1;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
/* forward decls */ /* forward decls */
static void ixgbevf_set_itr_msix(struct ixgbevf_q_vector *q_vector); static void ixgbevf_set_itr_msix(struct ixgbevf_q_vector *q_vector);
@ -3367,7 +3370,7 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev,
adapter->pdev = pdev; adapter->pdev = pdev;
hw = &adapter->hw; hw = &adapter->hw;
hw->back = adapter; hw->back = adapter;
adapter->msg_enable = (1 << DEFAULT_DEBUG_LEVEL_SHIFT) - 1; adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
/* /*
* call save state here in standalone driver because it relies on * call save state here in standalone driver because it relies on

View File

@ -1767,13 +1767,14 @@ static int sky2_open(struct net_device *dev)
sky2_hw_up(sky2); sky2_hw_up(sky2);
/* Enable interrupts from phy/mac for port */
imask = sky2_read32(hw, B0_IMSK);
if (hw->chip_id == CHIP_ID_YUKON_OPT || if (hw->chip_id == CHIP_ID_YUKON_OPT ||
hw->chip_id == CHIP_ID_YUKON_PRM || hw->chip_id == CHIP_ID_YUKON_PRM ||
hw->chip_id == CHIP_ID_YUKON_OP_2) hw->chip_id == CHIP_ID_YUKON_OP_2)
imask |= Y2_IS_PHY_QLNK; /* enable PHY Quick Link */ imask |= Y2_IS_PHY_QLNK; /* enable PHY Quick Link */
/* Enable interrupts from phy/mac for port */
imask = sky2_read32(hw, B0_IMSK);
imask |= portirq_msk[port]; imask |= portirq_msk[port];
sky2_write32(hw, B0_IMSK, imask); sky2_write32(hw, B0_IMSK, imask);
sky2_read32(hw, B0_IMSK); sky2_read32(hw, B0_IMSK);

View File

@ -1441,7 +1441,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
} }
#endif #endif
if (!is_valid_ether_addr(ndev->dev_addr)) if (!is_valid_ether_addr(ndev->dev_addr))
dev_hw_addr_random(ndev, ndev->dev_addr); eth_hw_addr_random(ndev);
/* Reset the ethernet controller */ /* Reset the ethernet controller */
__lpc_eth_reset(pldat); __lpc_eth_reset(pldat);

View File

@ -7,7 +7,8 @@ config SH_ETH
depends on SUPERH && \ depends on SUPERH && \
(CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \ (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \ CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7757) CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \
CPU_SUBTYPE_SH7757)
select CRC32 select CRC32
select NET_CORE select NET_CORE
select MII select MII
@ -16,4 +17,4 @@ config SH_ETH
---help--- ---help---
Renesas SuperH Ethernet device driver. Renesas SuperH Ethernet device driver.
This driver supporting CPUs are: This driver supporting CPUs are:
- SH7710, SH7712, SH7763, SH7619, SH7724, and SH7757. - SH7619, SH7710, SH7712, SH7724, SH7734, SH7763 and SH7757.

View File

@ -1,8 +1,8 @@
/* /*
* SuperH Ethernet device driver * SuperH Ethernet device driver
* *
* Copyright (C) 2006-2008 Nobuhiro Iwamatsu * Copyright (C) 2006-2012 Nobuhiro Iwamatsu
* Copyright (C) 2008-2009 Renesas Solutions Corp. * Copyright (C) 2008-2012 Renesas Solutions Corp.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
@ -38,6 +38,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/clk.h>
#include <linux/sh_eth.h> #include <linux/sh_eth.h>
#include "sh_eth.h" #include "sh_eth.h"
@ -279,8 +280,9 @@ static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp)
return &sh_eth_my_cpu_data; return &sh_eth_my_cpu_data;
} }
#elif defined(CONFIG_CPU_SUBTYPE_SH7763) #elif defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
#define SH_ETH_HAS_TSU 1 #define SH_ETH_HAS_TSU 1
static void sh_eth_reset_hw_crc(struct net_device *ndev);
static void sh_eth_chip_reset(struct net_device *ndev) static void sh_eth_chip_reset(struct net_device *ndev)
{ {
struct sh_eth_private *mdp = netdev_priv(ndev); struct sh_eth_private *mdp = netdev_priv(ndev);
@ -314,6 +316,9 @@ static void sh_eth_reset(struct net_device *ndev)
sh_eth_write(ndev, 0x0, RDFAR); sh_eth_write(ndev, 0x0, RDFAR);
sh_eth_write(ndev, 0x0, RDFXR); sh_eth_write(ndev, 0x0, RDFXR);
sh_eth_write(ndev, 0x0, RDFFR); sh_eth_write(ndev, 0x0, RDFFR);
/* Reset HW CRC register */
sh_eth_reset_hw_crc(ndev);
} }
static void sh_eth_set_duplex(struct net_device *ndev) static void sh_eth_set_duplex(struct net_device *ndev)
@ -370,8 +375,17 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
.no_trimd = 1, .no_trimd = 1,
.no_ade = 1, .no_ade = 1,
.tsu = 1, .tsu = 1,
#if defined(CONFIG_CPU_SUBTYPE_SH7734)
.hw_crc = 1,
#endif
}; };
static void sh_eth_reset_hw_crc(struct net_device *ndev)
{
if (sh_eth_my_cpu_data.hw_crc)
sh_eth_write(ndev, 0x0, CSMR);
}
#elif defined(CONFIG_CPU_SUBTYPE_SH7619) #elif defined(CONFIG_CPU_SUBTYPE_SH7619)
#define SH_ETH_RESET_DEFAULT 1 #define SH_ETH_RESET_DEFAULT 1
static struct sh_eth_cpu_data sh_eth_my_cpu_data = { static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
@ -790,7 +804,7 @@ static int sh_eth_dev_init(struct net_device *ndev)
/* all sh_eth int mask */ /* all sh_eth int mask */
sh_eth_write(ndev, 0, EESIPR); sh_eth_write(ndev, 0, EESIPR);
#if defined(__LITTLE_ENDIAN__) #if defined(__LITTLE_ENDIAN)
if (mdp->cd->hw_swap) if (mdp->cd->hw_swap)
sh_eth_write(ndev, EDMR_EL, EDMR); sh_eth_write(ndev, EDMR_EL, EDMR);
else else

View File

@ -1,8 +1,8 @@
/* /*
* SuperH Ethernet device driver * SuperH Ethernet device driver
* *
* Copyright (C) 2006-2008 Nobuhiro Iwamatsu * Copyright (C) 2006-2012 Nobuhiro Iwamatsu
* Copyright (C) 2008-2011 Renesas Solutions Corp. * Copyright (C) 2008-2012 Renesas Solutions Corp.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
@ -98,6 +98,8 @@ enum {
CEECR, CEECR,
MAFCR, MAFCR,
RTRATE, RTRATE,
CSMR,
RMII_MII,
/* TSU Absolute address */ /* TSU Absolute address */
ARSTR, ARSTR,
@ -172,6 +174,7 @@ static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
[RMCR] = 0x0458, [RMCR] = 0x0458,
[RPADIR] = 0x0460, [RPADIR] = 0x0460,
[FCFTR] = 0x0468, [FCFTR] = 0x0468,
[CSMR] = 0x04E4,
[ECMR] = 0x0500, [ECMR] = 0x0500,
[ECSR] = 0x0510, [ECSR] = 0x0510,
@ -200,6 +203,7 @@ static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
[CERCR] = 0x0768, [CERCR] = 0x0768,
[CEECR] = 0x0770, [CEECR] = 0x0770,
[MAFCR] = 0x0778, [MAFCR] = 0x0778,
[RMII_MII] = 0x0790,
[ARSTR] = 0x0000, [ARSTR] = 0x0000,
[TSU_CTRST] = 0x0004, [TSU_CTRST] = 0x0004,
@ -377,7 +381,7 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
/* /*
* Register's bits * Register's bits
*/ */
#ifdef CONFIG_CPU_SUBTYPE_SH7763 #if defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
/* EDSR */ /* EDSR */
enum EDSR_BIT { enum EDSR_BIT {
EDSR_ENT = 0x01, EDSR_ENR = 0x02, EDSR_ENT = 0x01, EDSR_ENR = 0x02,
@ -689,7 +693,7 @@ enum TSU_FWSLC_BIT {
*/ */
struct sh_eth_txdesc { struct sh_eth_txdesc {
u32 status; /* TD0 */ u32 status; /* TD0 */
#if defined(CONFIG_CPU_LITTLE_ENDIAN) #if defined(__LITTLE_ENDIAN)
u16 pad0; /* TD1 */ u16 pad0; /* TD1 */
u16 buffer_length; /* TD1 */ u16 buffer_length; /* TD1 */
#else #else
@ -706,7 +710,7 @@ struct sh_eth_txdesc {
*/ */
struct sh_eth_rxdesc { struct sh_eth_rxdesc {
u32 status; /* RD0 */ u32 status; /* RD0 */
#if defined(CONFIG_CPU_LITTLE_ENDIAN) #if defined(__LITTLE_ENDIAN)
u16 frame_length; /* RD1 */ u16 frame_length; /* RD1 */
u16 buffer_length; /* RD1 */ u16 buffer_length; /* RD1 */
#else #else
@ -751,6 +755,7 @@ struct sh_eth_cpu_data {
unsigned rpadir:1; /* E-DMAC have RPADIR */ unsigned rpadir:1; /* E-DMAC have RPADIR */
unsigned no_trimd:1; /* E-DMAC DO NOT have TRIMD */ unsigned no_trimd:1; /* E-DMAC DO NOT have TRIMD */
unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */ unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */
unsigned hw_crc:1; /* E-DMAC have CSMR */
}; };
struct sh_eth_private { struct sh_eth_private {

View File

@ -503,30 +503,32 @@ static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid);
static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid);
static void rhine_restart_tx(struct net_device *dev); static void rhine_restart_tx(struct net_device *dev);
static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool high) static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool low)
{ {
void __iomem *ioaddr = rp->base; void __iomem *ioaddr = rp->base;
int i; int i;
for (i = 0; i < 1024; i++) { for (i = 0; i < 1024; i++) {
if (high ^ !!(ioread8(ioaddr + reg) & mask)) bool has_mask_bits = !!(ioread8(ioaddr + reg) & mask);
if (low ^ has_mask_bits)
break; break;
udelay(10); udelay(10);
} }
if (i > 64) { if (i > 64) {
netif_dbg(rp, hw, rp->dev, "%s bit wait (%02x/%02x) cycle " netif_dbg(rp, hw, rp->dev, "%s bit wait (%02x/%02x) cycle "
"count: %04d\n", high ? "high" : "low", reg, mask, i); "count: %04d\n", low ? "low" : "high", reg, mask, i);
} }
} }
static void rhine_wait_bit_high(struct rhine_private *rp, u8 reg, u8 mask) static void rhine_wait_bit_high(struct rhine_private *rp, u8 reg, u8 mask)
{ {
rhine_wait_bit(rp, reg, mask, true); rhine_wait_bit(rp, reg, mask, false);
} }
static void rhine_wait_bit_low(struct rhine_private *rp, u8 reg, u8 mask) static void rhine_wait_bit_low(struct rhine_private *rp, u8 reg, u8 mask)
{ {
rhine_wait_bit(rp, reg, mask, false); rhine_wait_bit(rp, reg, mask, true);
} }
static u32 rhine_get_events(struct rhine_private *rp) static u32 rhine_get_events(struct rhine_private *rp)

View File

@ -375,8 +375,8 @@ static void rionet_remove(struct rio_dev *rdev)
struct net_device *ndev = rio_get_drvdata(rdev); struct net_device *ndev = rio_get_drvdata(rdev);
struct rionet_peer *peer, *tmp; struct rionet_peer *peer, *tmp;
free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? free_pages((unsigned long)rionet_active, get_order(sizeof(void *) *
__fls(sizeof(void *)) + 4 : 0); RIO_MAX_ROUTE_ENTRIES(rdev->net->hport->sys_size)));
unregister_netdev(ndev); unregister_netdev(ndev);
free_netdev(ndev); free_netdev(ndev);
@ -432,15 +432,16 @@ static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
int rc = 0; int rc = 0;
struct rionet_private *rnet; struct rionet_private *rnet;
u16 device_id; u16 device_id;
const size_t rionet_active_bytes = sizeof(void *) *
RIO_MAX_ROUTE_ENTRIES(mport->sys_size);
rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); get_order(rionet_active_bytes));
if (!rionet_active) { if (!rionet_active) {
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }
memset((void *)rionet_active, 0, sizeof(void *) * memset((void *)rionet_active, 0, rionet_active_bytes);
RIO_MAX_ROUTE_ENTRIES(mport->sys_size));
/* Set up private area */ /* Set up private area */
rnet = netdev_priv(ndev); rnet = netdev_priv(ndev);

View File

@ -165,13 +165,13 @@ static void rx_complete(struct urb *req)
memcpy(skb_put(skb, 1), page_address(page), 1); memcpy(skb_put(skb, 1), page_address(page), 1);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
page, 1, req->actual_length, page, 1, req->actual_length,
req->actual_length); PAGE_SIZE);
page = NULL; page = NULL;
} }
} else { } else {
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
page, 0, req->actual_length, page, 0, req->actual_length,
req->actual_length); PAGE_SIZE);
page = NULL; page = NULL;
} }
if (req->actual_length < PAGE_SIZE) if (req->actual_length < PAGE_SIZE)

View File

@ -93,6 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
/* no jumbogram (16K) support for now */ /* no jumbogram (16K) support for now */
dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN; dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
return 0; return 0;
} }

View File

@ -59,32 +59,6 @@
#define RTL8150_REQ_SET_REGS 0x05 #define RTL8150_REQ_SET_REGS 0x05
/* Transmit status register errors */
#define TSR_ECOL (1<<5)
#define TSR_LCOL (1<<4)
#define TSR_LOSS_CRS (1<<3)
#define TSR_JBR (1<<2)
#define TSR_ERRORS (TSR_ECOL | TSR_LCOL | TSR_LOSS_CRS | TSR_JBR)
/* Receive status register errors */
#define RSR_CRC (1<<2)
#define RSR_FAE (1<<1)
#define RSR_ERRORS (RSR_CRC | RSR_FAE)
/* Media status register definitions */
#define MSR_DUPLEX (1<<4)
#define MSR_SPEED (1<<3)
#define MSR_LINK (1<<2)
/* Interrupt pipe data */
#define INT_TSR 0x00
#define INT_RSR 0x01
#define INT_MSR 0x02
#define INT_WAKSR 0x03
#define INT_TXOK_CNT 0x04
#define INT_RXLOST_CNT 0x05
#define INT_CRERR_CNT 0x06
#define INT_COL_CNT 0x07
/* Transmit status register errors */ /* Transmit status register errors */
#define TSR_ECOL (1<<5) #define TSR_ECOL (1<<5)
#define TSR_LCOL (1<<4) #define TSR_LCOL (1<<4)

View File

@ -337,6 +337,11 @@ static const struct usb_device_id products [] = {
.driver_info = ZAURUS_PXA_INFO, .driver_info = ZAURUS_PXA_INFO,
}, },
{ {
/* Motorola Rokr E6 */
USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6027, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &bogus_mdlm_info,
}, {
/* Motorola MOTOMAGX phones */ /* Motorola MOTOMAGX phones */
USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),

View File

@ -625,12 +625,13 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
/* This can happen with OOM and indirect buffers. */ /* This can happen with OOM and indirect buffers. */
if (unlikely(capacity < 0)) { if (unlikely(capacity < 0)) {
if (net_ratelimit()) { if (likely(capacity == -ENOMEM)) {
if (likely(capacity == -ENOMEM)) { if (net_ratelimit()) {
dev_warn(&dev->dev, dev_warn(&dev->dev,
"TX queue failure: out of memory\n"); "TX queue failure: out of memory\n");
} else { } else {
dev->stats.tx_fifo_errors++; dev->stats.tx_fifo_errors++;
if (net_ratelimit())
dev_warn(&dev->dev, dev_warn(&dev->dev,
"Unexpected TX queue failure: %d\n", "Unexpected TX queue failure: %d\n",
capacity); capacity);

View File

@ -597,7 +597,8 @@ static void i2400m_get_drvinfo(struct net_device *net_dev,
struct i2400m *i2400m = net_dev_to_i2400m(net_dev); struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1); strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1);
strncpy(info->fw_version, i2400m->fw_name, sizeof(info->fw_version) - 1); strncpy(info->fw_version,
i2400m->fw_name ? : "", sizeof(info->fw_version) - 1);
if (net_dev->dev.parent) if (net_dev->dev.parent)
strncpy(info->bus_info, dev_name(net_dev->dev.parent), strncpy(info->bus_info, dev_name(net_dev->dev.parent),
sizeof(info->bus_info) - 1); sizeof(info->bus_info) - 1);

View File

@ -339,6 +339,23 @@ int i2400mu_bus_reset(struct i2400m *i2400m, enum i2400m_reset_type rt)
return result; return result;
} }
static void i2400mu_get_drvinfo(struct net_device *net_dev,
struct ethtool_drvinfo *info)
{
struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m);
struct usb_device *udev = i2400mu->usb_dev;
strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1);
strncpy(info->fw_version,
i2400m->fw_name ? : "", sizeof(info->fw_version) - 1);
usb_make_path(udev, info->bus_info, sizeof(info->bus_info));
}
static const struct ethtool_ops i2400mu_ethtool_ops = {
.get_drvinfo = i2400mu_get_drvinfo,
.get_link = ethtool_op_get_link,
};
static static
void i2400mu_netdev_setup(struct net_device *net_dev) void i2400mu_netdev_setup(struct net_device *net_dev)
@ -347,6 +364,7 @@ void i2400mu_netdev_setup(struct net_device *net_dev)
struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m); struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m);
i2400mu_init(i2400mu); i2400mu_init(i2400mu);
i2400m_netdev_setup(net_dev); i2400m_netdev_setup(net_dev);
net_dev->ethtool_ops = &i2400mu_ethtool_ops;
} }

View File

@ -20,7 +20,6 @@
/* Common calibration code */ /* Common calibration code */
#define ATH9K_NF_TOO_HIGH -60
static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer) static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer)
{ {
@ -346,10 +345,10 @@ static void ath9k_hw_nf_sanitize(struct ath_hw *ah, s16 *nf)
"NF calibrated [%s] [chain %d] is %d\n", "NF calibrated [%s] [chain %d] is %d\n",
(i >= 3 ? "ext" : "ctl"), i % 3, nf[i]); (i >= 3 ? "ext" : "ctl"), i % 3, nf[i]);
if (nf[i] > ATH9K_NF_TOO_HIGH) { if (nf[i] > limit->max) {
ath_dbg(common, CALIBRATE, ath_dbg(common, CALIBRATE,
"NF[%d] (%d) > MAX (%d), correcting to MAX\n", "NF[%d] (%d) > MAX (%d), correcting to MAX\n",
i, nf[i], ATH9K_NF_TOO_HIGH); i, nf[i], limit->max);
nf[i] = limit->max; nf[i] = limit->max;
} else if (nf[i] < limit->min) { } else if (nf[i] < limit->min) {
ath_dbg(common, CALIBRATE, ath_dbg(common, CALIBRATE,

View File

@ -680,7 +680,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
hw->queues = 4; hw->queues = 4;
hw->max_rates = 4; hw->max_rates = 4;
hw->channel_change_time = 5000; hw->channel_change_time = 5000;
hw->max_listen_interval = 10; hw->max_listen_interval = 1;
hw->max_rate_tries = 10; hw->max_rate_tries = 10;
hw->sta_data_size = sizeof(struct ath_node); hw->sta_data_size = sizeof(struct ath_node);
hw->vif_data_size = sizeof(struct ath_vif); hw->vif_data_size = sizeof(struct ath_vif);

View File

@ -640,7 +640,7 @@ static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta,
an->sta = sta; an->sta = sta;
an->vif = vif; an->vif = vif;
if (sta->ht_cap.ht_supported) { if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
ath_tx_node_init(sc, an); ath_tx_node_init(sc, an);
an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
sta->ht_cap.ampdu_factor); sta->ht_cap.ampdu_factor);
@ -659,7 +659,7 @@ static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta)
an->sta = NULL; an->sta = NULL;
#endif #endif
if (sta->ht_cap.ht_supported) if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
ath_tx_node_cleanup(sc, an); ath_tx_node_cleanup(sc, an);
} }

View File

@ -1913,13 +1913,13 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
if (sc->rx.frag) { if (sc->rx.frag) {
int space = skb->len - skb_tailroom(hdr_skb); int space = skb->len - skb_tailroom(hdr_skb);
sc->rx.frag = NULL;
if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) { if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
goto requeue_drop_frag; goto requeue_drop_frag;
} }
sc->rx.frag = NULL;
skb_copy_from_linear_data(skb, skb_put(hdr_skb, skb->len), skb_copy_from_linear_data(skb, skb_put(hdr_skb, skb->len),
skb->len); skb->len);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);

View File

@ -11507,9 +11507,9 @@ static int ipw_wdev_init(struct net_device *dev)
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }
/* translate geo->bg to a_band.channels */ /* translate geo->a to a_band.channels */
for (i = 0; i < geo->a_channels; i++) { for (i = 0; i < geo->a_channels; i++) {
a_band->channels[i].band = IEEE80211_BAND_2GHZ; a_band->channels[i].band = IEEE80211_BAND_5GHZ;
a_band->channels[i].center_freq = geo->a[i].freq; a_band->channels[i].center_freq = geo->a[i].freq;
a_band->channels[i].hw_value = geo->a[i].channel; a_band->channels[i].hw_value = geo->a[i].channel;
a_band->channels[i].max_power = geo->a[i].max_power; a_band->channels[i].max_power = geo->a[i].max_power;

View File

@ -2673,8 +2673,6 @@ il3945_bg_restart(struct work_struct *data)
if (test_and_clear_bit(S_FW_ERROR, &il->status)) { if (test_and_clear_bit(S_FW_ERROR, &il->status)) {
mutex_lock(&il->mutex); mutex_lock(&il->mutex);
/* FIXME: vif can be dereferenced */
il->vif = NULL;
il->is_open = 0; il->is_open = 0;
mutex_unlock(&il->mutex); mutex_unlock(&il->mutex);
il3945_down(il); il3945_down(il);

View File

@ -5652,8 +5652,6 @@ il4965_bg_restart(struct work_struct *data)
if (test_and_clear_bit(S_FW_ERROR, &il->status)) { if (test_and_clear_bit(S_FW_ERROR, &il->status)) {
mutex_lock(&il->mutex); mutex_lock(&il->mutex);
/* FIXME: do we dereference vif without mutex locked ? */
il->vif = NULL;
il->is_open = 0; il->is_open = 0;
__il4965_down(il); __il4965_down(il);

View File

@ -4508,6 +4508,7 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{ {
struct il_priv *il = hw->priv; struct il_priv *il = hw->priv;
int err; int err;
bool reset;
mutex_lock(&il->mutex); mutex_lock(&il->mutex);
D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr);
@ -4518,7 +4519,12 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
goto out; goto out;
} }
if (il->vif) { /*
* We do not support multiple virtual interfaces, but on hardware reset
* we have to add the same interface again.
*/
reset = (il->vif == vif);
if (il->vif && !reset) {
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto out; goto out;
} }
@ -4528,8 +4534,11 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
err = il_set_mode(il); err = il_set_mode(il);
if (err) { if (err) {
il->vif = NULL; IL_WARN("Fail to set mode %d\n", vif->type);
il->iw_mode = NL80211_IFTYPE_STATION; if (!reset) {
il->vif = NULL;
il->iw_mode = NL80211_IFTYPE_STATION;
}
} }
out: out:
@ -5279,9 +5288,9 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
D_MAC80211("BSSID %pM\n", bss_conf->bssid); D_MAC80211("BSSID %pM\n", bss_conf->bssid);
/* /*
* If there is currently a HW scan going on in the * If there is currently a HW scan going on in the background,
* background then we need to cancel it else the RXON * then we need to cancel it, otherwise sometimes we are not
* below/in post_associate will fail. * able to authenticate (FIXME: why ?)
*/ */
if (il_scan_cancel_timeout(il, 100)) { if (il_scan_cancel_timeout(il, 100)) {
D_MAC80211("leave - scan abort failed\n"); D_MAC80211("leave - scan abort failed\n");
@ -5290,14 +5299,10 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
} }
/* mac80211 only sets assoc when in STATION mode */ /* mac80211 only sets assoc when in STATION mode */
if (vif->type == NL80211_IFTYPE_ADHOC || bss_conf->assoc) { memcpy(il->staging.bssid_addr, bss_conf->bssid, ETH_ALEN);
memcpy(il->staging.bssid_addr, bss_conf->bssid,
ETH_ALEN);
/* currently needed in a few places */ /* FIXME: currently needed in a few places */
memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); memcpy(il->bssid, bss_conf->bssid, ETH_ALEN);
} else
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
} }
/* /*

View File

@ -1336,6 +1336,10 @@ static void qbuf_scan(struct orinoco_private *priv, void *buf,
unsigned long flags; unsigned long flags;
sd = kmalloc(sizeof(*sd), GFP_ATOMIC); sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
if (!sd) {
printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
return;
}
sd->buf = buf; sd->buf = buf;
sd->len = len; sd->len = len;
sd->type = type; sd->type = type;
@ -1353,6 +1357,10 @@ static void qabort_scan(struct orinoco_private *priv)
unsigned long flags; unsigned long flags;
sd = kmalloc(sizeof(*sd), GFP_ATOMIC); sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
if (!sd) {
printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
return;
}
sd->len = -1; /* Abort */ sd->len = -1; /* Abort */
spin_lock_irqsave(&priv->scan_lock, flags); spin_lock_irqsave(&priv->scan_lock, flags);

View File

@ -163,7 +163,13 @@ static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev,
/* Reschedule urb to read TX status again instantly */ /* Reschedule urb to read TX status again instantly */
return true; return true;
} else if (rt2800usb_txstatus_pending(rt2x00dev)) { }
/* Check if there is any entry that timedout waiting on TX status */
if (rt2800usb_txstatus_timeout(rt2x00dev))
queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
if (rt2800usb_txstatus_pending(rt2x00dev)) {
/* Read register after 250 us */ /* Read register after 250 us */
hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000), hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000),
HRTIMER_MODE_REL); HRTIMER_MODE_REL);
@ -178,7 +184,7 @@ stop_reading:
* here again if status reading is needed. * here again if status reading is needed.
*/ */
if (rt2800usb_txstatus_pending(rt2x00dev) && if (rt2800usb_txstatus_pending(rt2x00dev) &&
test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags)) !test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags))
return true; return true;
else else
return false; return false;

View File

@ -1893,7 +1893,7 @@ void rtl92c_phy_set_io(struct ieee80211_hw *hw)
break; break;
case IO_CMD_PAUSE_DM_BY_SCAN: case IO_CMD_PAUSE_DM_BY_SCAN:
rtlphy->initgain_backup.xaagccore1 = dm_digtable.cur_igvalue; rtlphy->initgain_backup.xaagccore1 = dm_digtable.cur_igvalue;
dm_digtable.cur_igvalue = 0x17; dm_digtable.cur_igvalue = 0x37;
rtl92c_dm_write_dig(hw); rtl92c_dm_write_dig(hw);
break; break;
default: default:

View File

@ -3077,7 +3077,7 @@ static void rtl92d_phy_set_io(struct ieee80211_hw *hw)
break; break;
case IO_CMD_PAUSE_DM_BY_SCAN: case IO_CMD_PAUSE_DM_BY_SCAN:
rtlphy->initgain_backup.xaagccore1 = de_digtable.cur_igvalue; rtlphy->initgain_backup.xaagccore1 = de_digtable.cur_igvalue;
de_digtable.cur_igvalue = 0x17; de_digtable.cur_igvalue = 0x37;
rtl92d_dm_write_dig(hw); rtl92d_dm_write_dig(hw);
break; break;
default: default:

View File

@ -345,7 +345,7 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)
} }
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
skb->len <= 1, req->actual, req->actual); skb->len <= 1, req->actual, PAGE_SIZE);
page = NULL; page = NULL;
if (req->actual < req->length) { /* Last fragment */ if (req->actual < req->length) { /* Last fragment */

View File

@ -22,7 +22,7 @@
#define EQL_DEFAULT_SLAVE_PRIORITY 28800 #define EQL_DEFAULT_SLAVE_PRIORITY 28800
#define EQL_DEFAULT_MAX_SLAVES 4 #define EQL_DEFAULT_MAX_SLAVES 4
#define EQL_DEFAULT_MTU 576 #define EQL_DEFAULT_MTU 576
#define EQL_DEFAULT_RESCHED_IVAL 100 #define EQL_DEFAULT_RESCHED_IVAL HZ
#define EQL_ENSLAVE (SIOCDEVPRIVATE) #define EQL_ENSLAVE (SIOCDEVPRIVATE)
#define EQL_EMANCIPATE (SIOCDEVPRIVATE + 1) #define EQL_EMANCIPATE (SIOCDEVPRIVATE + 1)

View File

@ -620,8 +620,10 @@ struct sta_bss_parameters {
* @llid: mesh local link id * @llid: mesh local link id
* @plid: mesh peer link id * @plid: mesh peer link id
* @plink_state: mesh peer link state * @plink_state: mesh peer link state
* @signal: signal strength of last received packet in dBm * @signal: the signal strength, type depends on the wiphy's signal_type
* @signal_avg: signal strength average in dBm NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
* @signal_avg: avg signal strength, type depends on the wiphy's signal_type
NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
* @txrate: current unicast bitrate from this station * @txrate: current unicast bitrate from this station
* @rxrate: current unicast bitrate to this station * @rxrate: current unicast bitrate to this station
* @rx_packets: packets received from this station * @rx_packets: packets received from this station

View File

@ -167,7 +167,8 @@ static struct garp_attr *garp_attr_lookup(const struct garp_applicant *app,
return NULL; return NULL;
} }
static void garp_attr_insert(struct garp_applicant *app, struct garp_attr *new) static struct garp_attr *garp_attr_create(struct garp_applicant *app,
const void *data, u8 len, u8 type)
{ {
struct rb_node *parent = NULL, **p = &app->gid.rb_node; struct rb_node *parent = NULL, **p = &app->gid.rb_node;
struct garp_attr *attr; struct garp_attr *attr;
@ -176,21 +177,16 @@ static void garp_attr_insert(struct garp_applicant *app, struct garp_attr *new)
while (*p) { while (*p) {
parent = *p; parent = *p;
attr = rb_entry(parent, struct garp_attr, node); attr = rb_entry(parent, struct garp_attr, node);
d = garp_attr_cmp(attr, new->data, new->dlen, new->type); d = garp_attr_cmp(attr, data, len, type);
if (d < 0) if (d < 0)
p = &parent->rb_left; p = &parent->rb_left;
else if (d > 0) else if (d > 0)
p = &parent->rb_right; p = &parent->rb_right;
else {
/* The attribute already exists; re-use it. */
return attr;
}
} }
rb_link_node(&new->node, parent, p);
rb_insert_color(&new->node, &app->gid);
}
static struct garp_attr *garp_attr_create(struct garp_applicant *app,
const void *data, u8 len, u8 type)
{
struct garp_attr *attr;
attr = kmalloc(sizeof(*attr) + len, GFP_ATOMIC); attr = kmalloc(sizeof(*attr) + len, GFP_ATOMIC);
if (!attr) if (!attr)
return attr; return attr;
@ -198,7 +194,9 @@ static struct garp_attr *garp_attr_create(struct garp_applicant *app,
attr->type = type; attr->type = type;
attr->dlen = len; attr->dlen = len;
memcpy(attr->data, data, len); memcpy(attr->data, data, len);
garp_attr_insert(app, attr);
rb_link_node(&attr->node, parent, p);
rb_insert_color(&attr->node, &app->gid);
return attr; return attr;
} }

View File

@ -1596,6 +1596,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
kfree_skb(skb); kfree_skb(skb);
return NET_RX_DROP; return NET_RX_DROP;
} }
skb->skb_iif = 0;
skb_set_dev(skb, dev); skb_set_dev(skb, dev);
skb->tstamp.tv64 = 0; skb->tstamp.tv64 = 0;
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;

View File

@ -2041,7 +2041,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (err < 0) if (err < 0)
goto e_err; goto e_err;
} }
rth = rt_dst_alloc(init_net.loopback_dev, rth = rt_dst_alloc(dev_net(dev)->loopback_dev,
IN_DEV_CONF_GET(in_dev, NOPOLICY), false); IN_DEV_CONF_GET(in_dev, NOPOLICY), false);
if (!rth) if (!rth)
goto e_nobufs; goto e_nobufs;

View File

@ -881,6 +881,16 @@ static struct rt6_info *ip6_pol_route_input(struct net *net, struct fib6_table *
return ip6_pol_route(net, table, fl6->flowi6_iif, fl6, flags); return ip6_pol_route(net, table, fl6->flowi6_iif, fl6, flags);
} }
static struct dst_entry *ip6_route_input_lookup(struct net *net,
struct net_device *dev,
struct flowi6 *fl6, int flags)
{
if (rt6_need_strict(&fl6->daddr) && dev->type != ARPHRD_PIMREG)
flags |= RT6_LOOKUP_F_IFACE;
return fib6_rule_lookup(net, fl6, flags, ip6_pol_route_input);
}
void ip6_route_input(struct sk_buff *skb) void ip6_route_input(struct sk_buff *skb)
{ {
const struct ipv6hdr *iph = ipv6_hdr(skb); const struct ipv6hdr *iph = ipv6_hdr(skb);
@ -895,10 +905,7 @@ void ip6_route_input(struct sk_buff *skb)
.flowi6_proto = iph->nexthdr, .flowi6_proto = iph->nexthdr,
}; };
if (rt6_need_strict(&iph->daddr) && skb->dev->type != ARPHRD_PIMREG) skb_dst_set(skb, ip6_route_input_lookup(net, skb->dev, &fl6, flags));
flags |= RT6_LOOKUP_F_IFACE;
skb_dst_set(skb, fib6_rule_lookup(net, &fl6, flags, ip6_pol_route_input));
} }
static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table, static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table,
@ -2537,7 +2544,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
struct sk_buff *skb; struct sk_buff *skb;
struct rtmsg *rtm; struct rtmsg *rtm;
struct flowi6 fl6; struct flowi6 fl6;
int err, iif = 0; int err, iif = 0, oif = 0;
err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy); err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy);
if (err < 0) if (err < 0)
@ -2564,15 +2571,29 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
iif = nla_get_u32(tb[RTA_IIF]); iif = nla_get_u32(tb[RTA_IIF]);
if (tb[RTA_OIF]) if (tb[RTA_OIF])
fl6.flowi6_oif = nla_get_u32(tb[RTA_OIF]); oif = nla_get_u32(tb[RTA_OIF]);
if (iif) { if (iif) {
struct net_device *dev; struct net_device *dev;
int flags = 0;
dev = __dev_get_by_index(net, iif); dev = __dev_get_by_index(net, iif);
if (!dev) { if (!dev) {
err = -ENODEV; err = -ENODEV;
goto errout; goto errout;
} }
fl6.flowi6_iif = iif;
if (!ipv6_addr_any(&fl6.saddr))
flags |= RT6_LOOKUP_F_HAS_SADDR;
rt = (struct rt6_info *)ip6_route_input_lookup(net, dev, &fl6,
flags);
} else {
fl6.flowi6_oif = oif;
rt = (struct rt6_info *)ip6_route_output(net, NULL, &fl6);
} }
skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
@ -2587,7 +2608,6 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr));
rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl6);
skb_dst_set(skb, &rt->dst); skb_dst_set(skb, &rt->dst);
err = rt6_fill_node(net, skb, rt, &fl6.daddr, &fl6.saddr, iif, err = rt6_fill_node(net, skb, rt, &fl6.daddr, &fl6.saddr, iif,

View File

@ -49,6 +49,8 @@ static void ieee80211_free_tid_rx(struct rcu_head *h)
container_of(h, struct tid_ampdu_rx, rcu_head); container_of(h, struct tid_ampdu_rx, rcu_head);
int i; int i;
del_timer_sync(&tid_rx->reorder_timer);
for (i = 0; i < tid_rx->buf_size; i++) for (i = 0; i < tid_rx->buf_size; i++)
dev_kfree_skb(tid_rx->reorder_buf[i]); dev_kfree_skb(tid_rx->reorder_buf[i]);
kfree(tid_rx->reorder_buf); kfree(tid_rx->reorder_buf);
@ -91,7 +93,6 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
tid, WLAN_BACK_RECIPIENT, reason); tid, WLAN_BACK_RECIPIENT, reason);
del_timer_sync(&tid_rx->session_timer); del_timer_sync(&tid_rx->session_timer);
del_timer_sync(&tid_rx->reorder_timer);
call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx); call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx);
} }

View File

@ -102,9 +102,6 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
might_sleep(); might_sleep();
/* If this off-channel logic ever changes, ieee80211_on_oper_channel
* may need to change as well.
*/
offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
if (local->scan_channel) { if (local->scan_channel) {
chan = local->scan_channel; chan = local->scan_channel;

View File

@ -370,7 +370,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
*/ */
drv_sw_scan_start(local); drv_sw_scan_start(local);
local->leave_oper_channel_time = 0; local->leave_oper_channel_time = jiffies;
local->next_scan_state = SCAN_DECISION; local->next_scan_state = SCAN_DECISION;
local->scan_channel_idx = 0; local->scan_channel_idx = 0;

View File

@ -10,6 +10,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/atomic.h>
#include <linux/netlink.h> #include <linux/netlink.h>
#include <linux/rculist.h> #include <linux/rculist.h>
#include <linux/slab.h> #include <linux/slab.h>
@ -17,7 +18,6 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <net/netlink.h> #include <net/netlink.h>
#include <net/sock.h> #include <net/sock.h>
#include <asm/atomic.h>
#include <linux/netfilter.h> #include <linux/netfilter.h>
#include <linux/netfilter/nfnetlink.h> #include <linux/netfilter/nfnetlink.h>

View File

@ -95,11 +95,11 @@ static int rose_set_mac_address(struct net_device *dev, void *addr)
struct sockaddr *sa = addr; struct sockaddr *sa = addr;
int err; int err;
if (!memcpy(dev->dev_addr, sa->sa_data, dev->addr_len)) if (!memcmp(dev->dev_addr, sa->sa_data, dev->addr_len))
return 0; return 0;
if (dev->flags & IFF_UP) { if (dev->flags & IFF_UP) {
err = rose_add_loopback_node((rose_address *)dev->dev_addr); err = rose_add_loopback_node((rose_address *)sa->sa_data);
if (err) if (err)
return err; return err;

View File

@ -2386,7 +2386,9 @@ nla_put_failure:
} }
static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
int flags, struct net_device *dev, int flags,
struct cfg80211_registered_device *rdev,
struct net_device *dev,
const u8 *mac_addr, struct station_info *sinfo) const u8 *mac_addr, struct station_info *sinfo)
{ {
void *hdr; void *hdr;
@ -2425,12 +2427,18 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
if (sinfo->filled & STATION_INFO_PLINK_STATE) if (sinfo->filled & STATION_INFO_PLINK_STATE)
NLA_PUT_U8(msg, NL80211_STA_INFO_PLINK_STATE, NLA_PUT_U8(msg, NL80211_STA_INFO_PLINK_STATE,
sinfo->plink_state); sinfo->plink_state);
if (sinfo->filled & STATION_INFO_SIGNAL) switch (rdev->wiphy.signal_type) {
NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL, case CFG80211_SIGNAL_TYPE_MBM:
sinfo->signal); if (sinfo->filled & STATION_INFO_SIGNAL)
if (sinfo->filled & STATION_INFO_SIGNAL_AVG) NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL,
NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL_AVG, sinfo->signal);
sinfo->signal_avg); if (sinfo->filled & STATION_INFO_SIGNAL_AVG)
NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL_AVG,
sinfo->signal_avg);
break;
default:
break;
}
if (sinfo->filled & STATION_INFO_TX_BITRATE) { if (sinfo->filled & STATION_INFO_TX_BITRATE) {
if (!nl80211_put_sta_rate(msg, &sinfo->txrate, if (!nl80211_put_sta_rate(msg, &sinfo->txrate,
NL80211_STA_INFO_TX_BITRATE)) NL80211_STA_INFO_TX_BITRATE))
@ -2523,7 +2531,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
if (nl80211_send_station(skb, if (nl80211_send_station(skb,
NETLINK_CB(cb->skb).pid, NETLINK_CB(cb->skb).pid,
cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh->nlmsg_seq, NLM_F_MULTI,
netdev, mac_addr, dev, netdev, mac_addr,
&sinfo) < 0) &sinfo) < 0)
goto out; goto out;
@ -2568,7 +2576,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
return -ENOMEM; return -ENOMEM;
if (nl80211_send_station(msg, info->snd_pid, info->snd_seq, 0, if (nl80211_send_station(msg, info->snd_pid, info->snd_seq, 0,
dev, mac_addr, &sinfo) < 0) { rdev, dev, mac_addr, &sinfo) < 0) {
nlmsg_free(msg); nlmsg_free(msg);
return -ENOBUFS; return -ENOBUFS;
} }
@ -7596,7 +7604,8 @@ void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
if (!msg) if (!msg)
return; return;
if (nl80211_send_station(msg, 0, 0, 0, dev, mac_addr, sinfo) < 0) { if (nl80211_send_station(msg, 0, 0, 0,
rdev, dev, mac_addr, sinfo) < 0) {
nlmsg_free(msg); nlmsg_free(msg);
return; return;
} }