Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/wireless/iwmc3200wifi/netdev.c net/wireless/scan.c
This commit is contained in:
commit
74d154189d
71 changed files with 3569 additions and 206 deletions
2
CREDITS
2
CREDITS
|
@ -1856,7 +1856,7 @@ E: rfkoenig@immd4.informatik.uni-erlangen.de
|
|||
D: The Linux Support Team Erlangen
|
||||
|
||||
N: Andreas Koensgen
|
||||
E: ajk@iehk.rwth-aachen.de
|
||||
E: ajk@comnets.uni-bremen.de
|
||||
D: 6pack driver for AX.25
|
||||
|
||||
N: Harald Koerfgen
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* cn_test.c
|
||||
*
|
||||
* 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
|
||||
* 2004+ Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -197,5 +197,5 @@ module_init(cn_test_init);
|
|||
module_exit(cn_test_fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
|
||||
MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
|
||||
MODULE_DESCRIPTION("Connector's test module");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* ucon.c
|
||||
*
|
||||
* Copyright (c) 2004+ Evgeniy Polyakov <johnpol@2ka.mipt.ru>
|
||||
* Copyright (c) 2004+ Evgeniy Polyakov <zbr@ioremap.net>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
This is the 6pack-mini-HOWTO, written by
|
||||
|
||||
Andreas Könsgen DG3KQ
|
||||
Internet: ajk@iehk.rwth-aachen.de
|
||||
Internet: ajk@comnets.uni-bremen.de
|
||||
AMPR-net: dg3kq@db0pra.ampr.org
|
||||
AX.25: dg3kq@db0ach.#nrw.deu.eu
|
||||
|
||||
|
|
10
MAINTAINERS
10
MAINTAINERS
|
@ -150,7 +150,7 @@ F: drivers/scsi/53c700*
|
|||
|
||||
6PACK NETWORK DRIVER FOR AX.25
|
||||
P: Andreas Koensgen
|
||||
M: ajk@iehk.rwth-aachen.de
|
||||
M: ajk@comnets.uni-bremen.de
|
||||
L: linux-hams@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/hamradio/6pack.c
|
||||
|
@ -1612,6 +1612,13 @@ S: Supported
|
|||
F: fs/configfs/
|
||||
F: include/linux/configfs.h
|
||||
|
||||
CONNECTOR
|
||||
P: Evgeniy Polyakov
|
||||
M: zbr@ioremap.net
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/connector/
|
||||
|
||||
CONTROL GROUPS (CGROUPS)
|
||||
P: Paul Menage
|
||||
M: menage@google.com
|
||||
|
@ -5584,7 +5591,6 @@ S: Odd Fixes
|
|||
F: drivers/net/starfire*
|
||||
|
||||
STARMODE RADIO IP (STRIP) PROTOCOL DRIVER
|
||||
W: http://mosquitonet.Stanford.EDU/strip.html
|
||||
S: Orphan
|
||||
F: drivers/net/wireless/strip.c
|
||||
F: include/linux/if_strip.h
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* cn_queue.c
|
||||
*
|
||||
* 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
|
||||
* 2004+ Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* connector.c
|
||||
*
|
||||
* 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
|
||||
* 2004+ Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -33,7 +33,7 @@
|
|||
#include <net/sock.h>
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
|
||||
MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
|
||||
MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector.");
|
||||
|
||||
static u32 cn_idx = CN_IDX_CONNECTOR;
|
||||
|
|
|
@ -1729,6 +1729,13 @@ config KS8842
|
|||
help
|
||||
This platform driver is for Micrel KSZ8842 chip.
|
||||
|
||||
config KS8851
|
||||
tristate "Micrel KS8851 SPI"
|
||||
depends on SPI
|
||||
select MII
|
||||
help
|
||||
SPI driver for Micrel KS8851 SPI attached network chip.
|
||||
|
||||
config VIA_RHINE
|
||||
tristate "VIA Rhine support"
|
||||
depends on NET_PCI && PCI
|
||||
|
|
|
@ -88,6 +88,7 @@ obj-$(CONFIG_SKGE) += skge.o
|
|||
obj-$(CONFIG_SKY2) += sky2.o
|
||||
obj-$(CONFIG_SKFP) += skfp/
|
||||
obj-$(CONFIG_KS8842) += ks8842.o
|
||||
obj-$(CONFIG_KS8851) += ks8851.o
|
||||
obj-$(CONFIG_VIA_RHINE) += via-rhine.o
|
||||
obj-$(CONFIG_VIA_VELOCITY) += via-velocity.o
|
||||
obj-$(CONFIG_ADAPTEC_STARFIRE) += starfire.o
|
||||
|
|
|
@ -63,3 +63,11 @@ config IXP4XX_ETH
|
|||
help
|
||||
Say Y here if you want to use built-in Ethernet ports
|
||||
on IXP4xx processor.
|
||||
|
||||
config W90P910_ETH
|
||||
tristate "Nuvoton w90p910 Ethernet support"
|
||||
depends on ARM && ARCH_W90X900
|
||||
select PHYLIB
|
||||
help
|
||||
Say Y here if you want to use built-in Ethernet ports
|
||||
on w90p910 processor.
|
||||
|
|
|
@ -11,3 +11,4 @@ obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o
|
|||
obj-$(CONFIG_ARM_KS8695_ETHER) += ks8695net.o
|
||||
obj-$(CONFIG_EP93XX_ETH) += ep93xx_eth.o
|
||||
obj-$(CONFIG_IXP4XX_ETH) += ixp4xx_eth.o
|
||||
obj-$(CONFIG_W90P910_ETH) += w90p910_ether.o
|
||||
|
|
|
@ -1228,7 +1228,6 @@ static int at91ether_resume(struct platform_device *pdev)
|
|||
#endif
|
||||
|
||||
static struct platform_driver at91ether_driver = {
|
||||
.probe = at91ether_probe,
|
||||
.remove = __devexit_p(at91ether_remove),
|
||||
.suspend = at91ether_suspend,
|
||||
.resume = at91ether_resume,
|
||||
|
@ -1240,7 +1239,7 @@ static struct platform_driver at91ether_driver = {
|
|||
|
||||
static int __init at91ether_init(void)
|
||||
{
|
||||
return platform_driver_register(&at91ether_driver);
|
||||
return platform_driver_probe(&at91ether_driver, at91ether_probe);
|
||||
}
|
||||
|
||||
static void __exit at91ether_exit(void)
|
||||
|
|
1105
drivers/net/arm/w90p910_ether.c
Normal file
1105
drivers/net/arm/w90p910_ether.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -667,7 +667,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
|
|||
struct be_queue_info *rxq = &adapter->rx_obj.q;
|
||||
struct be_rx_page_info *page_info;
|
||||
u16 rxq_idx, i, num_rcvd, j;
|
||||
u32 pktsize, hdr_len, curr_frag_len;
|
||||
u32 pktsize, hdr_len, curr_frag_len, size;
|
||||
u8 *start;
|
||||
|
||||
rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
|
||||
|
@ -708,12 +708,13 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
|
|||
}
|
||||
|
||||
/* More frags present for this completion */
|
||||
pktsize -= curr_frag_len; /* account for above copied frag */
|
||||
size = pktsize;
|
||||
for (i = 1, j = 0; i < num_rcvd; i++) {
|
||||
size -= curr_frag_len;
|
||||
index_inc(&rxq_idx, rxq->len);
|
||||
page_info = get_rx_page_info(adapter, rxq_idx);
|
||||
|
||||
curr_frag_len = min(pktsize, rx_frag_size);
|
||||
curr_frag_len = min(size, rx_frag_size);
|
||||
|
||||
/* Coalesce all frags from the same physical page in one slot */
|
||||
if (page_info->page_offset == 0) {
|
||||
|
@ -731,7 +732,6 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
|
|||
skb_shinfo(skb)->frags[j].size += curr_frag_len;
|
||||
skb->len += curr_frag_len;
|
||||
skb->data_len += curr_frag_len;
|
||||
pktsize -= curr_frag_len;
|
||||
|
||||
memset(page_info, 0, sizeof(*page_info));
|
||||
}
|
||||
|
|
|
@ -4916,13 +4916,14 @@ static void bnx2x_turn_off_sf(struct bnx2x *bp, u8 port)
|
|||
u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
|
||||
u8 *version, u16 len)
|
||||
{
|
||||
struct bnx2x *bp = params->bp;
|
||||
struct bnx2x *bp;
|
||||
u32 ext_phy_type = 0;
|
||||
u32 spirom_ver = 0;
|
||||
u8 status = 0 ;
|
||||
|
||||
if (version == NULL || params == NULL)
|
||||
return -EINVAL;
|
||||
bp = params->bp;
|
||||
|
||||
spirom_ver = REG_RD(bp, params->shmem_base +
|
||||
offsetof(struct shmem_region,
|
||||
|
|
|
@ -346,7 +346,7 @@ void can_restart(unsigned long data)
|
|||
skb = dev_alloc_skb(sizeof(struct can_frame));
|
||||
if (skb == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
goto restart;
|
||||
}
|
||||
skb->dev = dev;
|
||||
skb->protocol = htons(ETH_P_CAN);
|
||||
|
@ -361,13 +361,13 @@ void can_restart(unsigned long data)
|
|||
stats->rx_packets++;
|
||||
stats->rx_bytes += cf->can_dlc;
|
||||
|
||||
restart:
|
||||
dev_dbg(dev->dev.parent, "restarted\n");
|
||||
priv->can_stats.restarts++;
|
||||
|
||||
/* Now restart the device */
|
||||
err = priv->do_set_mode(dev, CAN_MODE_START);
|
||||
|
||||
out:
|
||||
netif_carrier_on(dev);
|
||||
if (err)
|
||||
dev_err(dev->dev.parent, "Error %d during restart", err);
|
||||
|
@ -473,6 +473,10 @@ int open_candev(struct net_device *dev)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Switch carrier on if device was stopped while in bus-off state */
|
||||
if (!netif_carrier_ok(dev))
|
||||
netif_carrier_on(dev);
|
||||
|
||||
setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
#include <linux/can.h>
|
||||
#include <linux/can/dev.h>
|
||||
#include <linux/can/error.h>
|
||||
#include <linux/can/dev.h>
|
||||
|
||||
#include "sja1000.h"
|
||||
|
||||
|
|
|
@ -754,17 +754,16 @@ static int fs_init_phy(struct net_device *dev)
|
|||
fep->oldlink = 0;
|
||||
fep->oldspeed = 0;
|
||||
fep->oldduplex = -1;
|
||||
if(fep->fpi->phy_node)
|
||||
phydev = of_phy_connect(dev, fep->fpi->phy_node,
|
||||
&fs_adjust_link, 0,
|
||||
|
||||
phydev = of_phy_connect(dev, fep->fpi->phy_node, &fs_adjust_link, 0,
|
||||
PHY_INTERFACE_MODE_MII);
|
||||
if (!phydev) {
|
||||
phydev = of_phy_connect_fixed_link(dev, &fs_adjust_link,
|
||||
PHY_INTERFACE_MODE_MII);
|
||||
else {
|
||||
printk("No phy bus ID specified in BSP code\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (IS_ERR(phydev)) {
|
||||
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
|
||||
return PTR_ERR(phydev);
|
||||
if (!phydev) {
|
||||
dev_err(&dev->dev, "Could not attach to PHY\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
fep->phydev = phydev;
|
||||
|
@ -1005,6 +1004,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
|
|||
goto out_free_fpi;
|
||||
}
|
||||
|
||||
SET_NETDEV_DEV(ndev, &ofdev->dev);
|
||||
dev_set_drvdata(&ofdev->dev, ndev);
|
||||
|
||||
fep = netdev_priv(ndev);
|
||||
|
|
|
@ -264,15 +264,6 @@ static int gfar_of_init(struct net_device *dev)
|
|||
priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
|
||||
|
||||
priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
|
||||
if (!priv->phy_node) {
|
||||
u32 *fixed_link;
|
||||
|
||||
fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
|
||||
if (!fixed_link) {
|
||||
err = -ENODEV;
|
||||
goto err_out;
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the TBI PHY. If it's not there, we don't support SGMII */
|
||||
priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
|
||||
|
@ -658,14 +649,15 @@ static int init_phy(struct net_device *dev)
|
|||
|
||||
interface = gfar_get_interface(dev);
|
||||
|
||||
if (priv->phy_node) {
|
||||
priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link,
|
||||
0, interface);
|
||||
priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0,
|
||||
interface);
|
||||
if (!priv->phydev)
|
||||
priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link,
|
||||
interface);
|
||||
if (!priv->phydev) {
|
||||
dev_err(&dev->dev, "error: Could not attach to PHY\n");
|
||||
dev_err(&dev->dev, "could not attach to PHY\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
if (interface == PHY_INTERFACE_MODE_SGMII)
|
||||
gfar_configure_serdes(dev);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* devices like TTY. It interfaces between a raw TTY and the
|
||||
* kernel's AX.25 protocol layers.
|
||||
*
|
||||
* Authors: Andreas Könsgen <ajk@iehk.rwth-aachen.de>
|
||||
* Authors: Andreas Könsgen <ajk@comnets.uni-bremen.de>
|
||||
* Ralf Baechle DL5RB <ralf@linux-mips.org>
|
||||
*
|
||||
* Quite a lot of stuff "stolen" by Joerg Reuter from slip.c, written by
|
||||
|
|
|
@ -188,11 +188,12 @@ void rgmii_put_mdio(struct of_device *ofdev, int input)
|
|||
void rgmii_detach(struct of_device *ofdev, int input)
|
||||
{
|
||||
struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev);
|
||||
struct rgmii_regs __iomem *p = dev->base;
|
||||
|
||||
mutex_lock(&dev->lock);
|
||||
struct rgmii_regs __iomem *p;
|
||||
|
||||
BUG_ON(!dev || dev->users == 0);
|
||||
p = dev->base;
|
||||
|
||||
mutex_lock(&dev->lock);
|
||||
|
||||
RGMII_DBG(dev, "detach(%d)" NL, input);
|
||||
|
||||
|
|
|
@ -323,6 +323,7 @@ struct ixgbe_adapter {
|
|||
#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25)
|
||||
#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26)
|
||||
#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27)
|
||||
#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 28)
|
||||
#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29)
|
||||
|
||||
u32 flags2;
|
||||
|
|
|
@ -139,6 +139,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
|
|||
adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
|
||||
}
|
||||
adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
|
||||
#ifdef IXGBE_FCOE
|
||||
/* Turn on FCoE offload */
|
||||
if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) &&
|
||||
(!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) {
|
||||
adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
|
||||
adapter->ring_feature[RING_F_FCOE].indices =
|
||||
IXGBE_FCRETA_SIZE;
|
||||
netdev->features |= NETIF_F_FCOE_CRC;
|
||||
netdev->features |= NETIF_F_FSO;
|
||||
netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
|
||||
}
|
||||
#endif /* IXGBE_FCOE */
|
||||
ixgbe_init_interrupt_scheme(adapter);
|
||||
if (netif_running(netdev))
|
||||
netdev->netdev_ops->ndo_open(netdev);
|
||||
|
@ -156,6 +168,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
|
|||
adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
|
||||
if (adapter->hw.mac.type == ixgbe_mac_82599EB)
|
||||
adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
|
||||
|
||||
#ifdef IXGBE_FCOE
|
||||
/* Turn off FCoE offload */
|
||||
if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE |
|
||||
IXGBE_FLAG_FCOE_ENABLED)) {
|
||||
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
|
||||
adapter->ring_feature[RING_F_FCOE].indices = 0;
|
||||
netdev->features &= ~NETIF_F_FCOE_CRC;
|
||||
netdev->features &= ~NETIF_F_FSO;
|
||||
netdev->fcoe_ddp_xid = 0;
|
||||
}
|
||||
#endif /* IXGBE_FCOE */
|
||||
ixgbe_init_interrupt_scheme(adapter);
|
||||
if (netif_running(netdev))
|
||||
netdev->netdev_ops->ndo_open(netdev);
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <linux/in.h>
|
||||
#include <linux/ip.h>
|
||||
#include <linux/tcp.h>
|
||||
#include <linux/pkt_sched.h>
|
||||
#include <linux/ipv6.h>
|
||||
#include <net/checksum.h>
|
||||
#include <net/ip6_checksum.h>
|
||||
|
@ -3808,8 +3809,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
|
|||
adapter->atr_sample_rate = 20;
|
||||
adapter->fdir_pballoc = 0;
|
||||
#ifdef IXGBE_FCOE
|
||||
adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
|
||||
adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE;
|
||||
adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE;
|
||||
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
|
||||
adapter->ring_feature[RING_F_FCOE].indices = 0;
|
||||
#endif /* IXGBE_FCOE */
|
||||
}
|
||||
|
||||
|
@ -5127,9 +5129,6 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
|||
int count = 0;
|
||||
unsigned int f;
|
||||
|
||||
r_idx = skb->queue_mapping;
|
||||
tx_ring = &adapter->tx_ring[r_idx];
|
||||
|
||||
if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
|
||||
tx_flags |= vlan_tx_tag_get(skb);
|
||||
if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
|
||||
|
@ -5139,10 +5138,18 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
|||
tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
|
||||
tx_flags |= IXGBE_TX_FLAGS_VLAN;
|
||||
} else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
|
||||
if (skb->priority != TC_PRIO_CONTROL) {
|
||||
tx_flags |= (skb->queue_mapping << 13);
|
||||
tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
|
||||
tx_flags |= IXGBE_TX_FLAGS_VLAN;
|
||||
} else {
|
||||
skb->queue_mapping =
|
||||
adapter->ring_feature[RING_F_DCB].indices-1;
|
||||
}
|
||||
}
|
||||
|
||||
r_idx = skb->queue_mapping;
|
||||
tx_ring = &adapter->tx_ring[r_idx];
|
||||
|
||||
if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
|
||||
(skb->protocol == htons(ETH_P_FCOE)))
|
||||
|
@ -5582,16 +5589,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||
#endif
|
||||
|
||||
#ifdef IXGBE_FCOE
|
||||
if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
|
||||
if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) {
|
||||
if (hw->mac.ops.get_device_caps) {
|
||||
hw->mac.ops.get_device_caps(hw, &device_caps);
|
||||
if (!(device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)) {
|
||||
netdev->features |= NETIF_F_FCOE_CRC;
|
||||
netdev->features |= NETIF_F_FSO;
|
||||
netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
|
||||
} else {
|
||||
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
|
||||
}
|
||||
if (device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)
|
||||
adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE;
|
||||
}
|
||||
}
|
||||
#endif /* IXGBE_FCOE */
|
||||
|
@ -5640,7 +5642,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||
adapter->wol = 0;
|
||||
break;
|
||||
}
|
||||
device_init_wakeup(&adapter->pdev->dev, true);
|
||||
device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
|
||||
|
||||
/* pick up the PCI bus settings for reporting later */
|
||||
|
|
|
@ -229,6 +229,7 @@ static int __devinit jazz_sonic_probe(struct platform_device *pdev)
|
|||
lp = netdev_priv(dev);
|
||||
lp->device = &pdev->dev;
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
platform_set_drvdata(pdev, dev);
|
||||
|
||||
netdev_boot_setup_check(dev);
|
||||
|
||||
|
|
1322
drivers/net/ks8851.c
Normal file
1322
drivers/net/ks8851.c
Normal file
File diff suppressed because it is too large
Load diff
296
drivers/net/ks8851.h
Normal file
296
drivers/net/ks8851.h
Normal file
|
@ -0,0 +1,296 @@
|
|||
/* drivers/net/ks8851.h
|
||||
*
|
||||
* Copyright 2009 Simtec Electronics
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* KS8851 register definitions
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#define KS_CCR 0x08
|
||||
#define CCR_EEPROM (1 << 9)
|
||||
#define CCR_SPI (1 << 8)
|
||||
#define CCR_32PIN (1 << 0)
|
||||
|
||||
/* MAC address registers */
|
||||
#define KS_MARL 0x10
|
||||
#define KS_MARM 0x12
|
||||
#define KS_MARH 0x14
|
||||
|
||||
#define KS_OBCR 0x20
|
||||
#define OBCR_ODS_16mA (1 << 6)
|
||||
|
||||
#define KS_EEPCR 0x22
|
||||
#define EEPCR_EESA (1 << 4)
|
||||
#define EEPCR_EESB (1 << 3)
|
||||
#define EEPCR_EEDO (1 << 2)
|
||||
#define EEPCR_EESCK (1 << 1)
|
||||
#define EEPCR_EECS (1 << 0)
|
||||
|
||||
#define KS_MBIR 0x24
|
||||
#define MBIR_TXMBF (1 << 12)
|
||||
#define MBIR_TXMBFA (1 << 11)
|
||||
#define MBIR_RXMBF (1 << 4)
|
||||
#define MBIR_RXMBFA (1 << 3)
|
||||
|
||||
#define KS_GRR 0x26
|
||||
#define GRR_QMU (1 << 1)
|
||||
#define GRR_GSR (1 << 0)
|
||||
|
||||
#define KS_WFCR 0x2A
|
||||
#define WFCR_MPRXE (1 << 7)
|
||||
#define WFCR_WF3E (1 << 3)
|
||||
#define WFCR_WF2E (1 << 2)
|
||||
#define WFCR_WF1E (1 << 1)
|
||||
#define WFCR_WF0E (1 << 0)
|
||||
|
||||
#define KS_WF0CRC0 0x30
|
||||
#define KS_WF0CRC1 0x32
|
||||
#define KS_WF0BM0 0x34
|
||||
#define KS_WF0BM1 0x36
|
||||
#define KS_WF0BM2 0x38
|
||||
#define KS_WF0BM3 0x3A
|
||||
|
||||
#define KS_WF1CRC0 0x40
|
||||
#define KS_WF1CRC1 0x42
|
||||
#define KS_WF1BM0 0x44
|
||||
#define KS_WF1BM1 0x46
|
||||
#define KS_WF1BM2 0x48
|
||||
#define KS_WF1BM3 0x4A
|
||||
|
||||
#define KS_WF2CRC0 0x50
|
||||
#define KS_WF2CRC1 0x52
|
||||
#define KS_WF2BM0 0x54
|
||||
#define KS_WF2BM1 0x56
|
||||
#define KS_WF2BM2 0x58
|
||||
#define KS_WF2BM3 0x5A
|
||||
|
||||
#define KS_WF3CRC0 0x60
|
||||
#define KS_WF3CRC1 0x62
|
||||
#define KS_WF3BM0 0x64
|
||||
#define KS_WF3BM1 0x66
|
||||
#define KS_WF3BM2 0x68
|
||||
#define KS_WF3BM3 0x6A
|
||||
|
||||
#define KS_TXCR 0x70
|
||||
#define TXCR_TCGICMP (1 << 8)
|
||||
#define TXCR_TCGUDP (1 << 7)
|
||||
#define TXCR_TCGTCP (1 << 6)
|
||||
#define TXCR_TCGIP (1 << 5)
|
||||
#define TXCR_FTXQ (1 << 4)
|
||||
#define TXCR_TXFCE (1 << 3)
|
||||
#define TXCR_TXPE (1 << 2)
|
||||
#define TXCR_TXCRC (1 << 1)
|
||||
#define TXCR_TXE (1 << 0)
|
||||
|
||||
#define KS_TXSR 0x72
|
||||
#define TXSR_TXLC (1 << 13)
|
||||
#define TXSR_TXMC (1 << 12)
|
||||
#define TXSR_TXFID_MASK (0x3f << 0)
|
||||
#define TXSR_TXFID_SHIFT (0)
|
||||
#define TXSR_TXFID_GET(_v) (((_v) >> 0) & 0x3f)
|
||||
|
||||
#define KS_RXCR1 0x74
|
||||
#define RXCR1_FRXQ (1 << 15)
|
||||
#define RXCR1_RXUDPFCC (1 << 14)
|
||||
#define RXCR1_RXTCPFCC (1 << 13)
|
||||
#define RXCR1_RXIPFCC (1 << 12)
|
||||
#define RXCR1_RXPAFMA (1 << 11)
|
||||
#define RXCR1_RXFCE (1 << 10)
|
||||
#define RXCR1_RXEFE (1 << 9)
|
||||
#define RXCR1_RXMAFMA (1 << 8)
|
||||
#define RXCR1_RXBE (1 << 7)
|
||||
#define RXCR1_RXME (1 << 6)
|
||||
#define RXCR1_RXUE (1 << 5)
|
||||
#define RXCR1_RXAE (1 << 4)
|
||||
#define RXCR1_RXINVF (1 << 1)
|
||||
#define RXCR1_RXE (1 << 0)
|
||||
|
||||
#define KS_RXCR2 0x76
|
||||
#define RXCR2_SRDBL_MASK (0x7 << 5)
|
||||
#define RXCR2_SRDBL_SHIFT (5)
|
||||
#define RXCR2_SRDBL_4B (0x0 << 5)
|
||||
#define RXCR2_SRDBL_8B (0x1 << 5)
|
||||
#define RXCR2_SRDBL_16B (0x2 << 5)
|
||||
#define RXCR2_SRDBL_32B (0x3 << 5)
|
||||
#define RXCR2_SRDBL_FRAME (0x4 << 5)
|
||||
#define RXCR2_IUFFP (1 << 4)
|
||||
#define RXCR2_RXIUFCEZ (1 << 3)
|
||||
#define RXCR2_UDPLFE (1 << 2)
|
||||
#define RXCR2_RXICMPFCC (1 << 1)
|
||||
#define RXCR2_RXSAF (1 << 0)
|
||||
|
||||
#define KS_TXMIR 0x78
|
||||
|
||||
#define KS_RXFHSR 0x7C
|
||||
#define RXFSHR_RXFV (1 << 15)
|
||||
#define RXFSHR_RXICMPFCS (1 << 13)
|
||||
#define RXFSHR_RXIPFCS (1 << 12)
|
||||
#define RXFSHR_RXTCPFCS (1 << 11)
|
||||
#define RXFSHR_RXUDPFCS (1 << 10)
|
||||
#define RXFSHR_RXBF (1 << 7)
|
||||
#define RXFSHR_RXMF (1 << 6)
|
||||
#define RXFSHR_RXUF (1 << 5)
|
||||
#define RXFSHR_RXMR (1 << 4)
|
||||
#define RXFSHR_RXFT (1 << 3)
|
||||
#define RXFSHR_RXFTL (1 << 2)
|
||||
#define RXFSHR_RXRF (1 << 1)
|
||||
#define RXFSHR_RXCE (1 << 0)
|
||||
|
||||
#define KS_RXFHBCR 0x7E
|
||||
#define KS_TXQCR 0x80
|
||||
#define TXQCR_AETFE (1 << 2)
|
||||
#define TXQCR_TXQMAM (1 << 1)
|
||||
#define TXQCR_METFE (1 << 0)
|
||||
|
||||
#define KS_RXQCR 0x82
|
||||
#define RXQCR_RXDTTS (1 << 12)
|
||||
#define RXQCR_RXDBCTS (1 << 11)
|
||||
#define RXQCR_RXFCTS (1 << 10)
|
||||
#define RXQCR_RXIPHTOE (1 << 9)
|
||||
#define RXQCR_RXDTTE (1 << 7)
|
||||
#define RXQCR_RXDBCTE (1 << 6)
|
||||
#define RXQCR_RXFCTE (1 << 5)
|
||||
#define RXQCR_ADRFE (1 << 4)
|
||||
#define RXQCR_SDA (1 << 3)
|
||||
#define RXQCR_RRXEF (1 << 0)
|
||||
|
||||
#define KS_TXFDPR 0x84
|
||||
#define TXFDPR_TXFPAI (1 << 14)
|
||||
#define TXFDPR_TXFP_MASK (0x7ff << 0)
|
||||
#define TXFDPR_TXFP_SHIFT (0)
|
||||
|
||||
#define KS_RXFDPR 0x86
|
||||
#define RXFDPR_RXFPAI (1 << 14)
|
||||
|
||||
#define KS_RXDTTR 0x8C
|
||||
#define KS_RXDBCTR 0x8E
|
||||
|
||||
#define KS_IER 0x90
|
||||
#define KS_ISR 0x92
|
||||
#define IRQ_LCI (1 << 15)
|
||||
#define IRQ_TXI (1 << 14)
|
||||
#define IRQ_RXI (1 << 13)
|
||||
#define IRQ_RXOI (1 << 11)
|
||||
#define IRQ_TXPSI (1 << 9)
|
||||
#define IRQ_RXPSI (1 << 8)
|
||||
#define IRQ_TXSAI (1 << 6)
|
||||
#define IRQ_RXWFDI (1 << 5)
|
||||
#define IRQ_RXMPDI (1 << 4)
|
||||
#define IRQ_LDI (1 << 3)
|
||||
#define IRQ_EDI (1 << 2)
|
||||
#define IRQ_SPIBEI (1 << 1)
|
||||
#define IRQ_DEDI (1 << 0)
|
||||
|
||||
#define KS_RXFCTR 0x9C
|
||||
#define KS_RXFC 0x9D
|
||||
#define RXFCTR_RXFC_MASK (0xff << 8)
|
||||
#define RXFCTR_RXFC_SHIFT (8)
|
||||
#define RXFCTR_RXFC_GET(_v) (((_v) >> 8) & 0xff)
|
||||
#define RXFCTR_RXFCT_MASK (0xff << 0)
|
||||
#define RXFCTR_RXFCT_SHIFT (0)
|
||||
|
||||
#define KS_TXNTFSR 0x9E
|
||||
|
||||
#define KS_MAHTR0 0xA0
|
||||
#define KS_MAHTR1 0xA2
|
||||
#define KS_MAHTR2 0xA4
|
||||
#define KS_MAHTR3 0xA6
|
||||
|
||||
#define KS_FCLWR 0xB0
|
||||
#define KS_FCHWR 0xB2
|
||||
#define KS_FCOWR 0xB4
|
||||
|
||||
#define KS_CIDER 0xC0
|
||||
#define CIDER_ID 0x8870
|
||||
#define CIDER_REV_MASK (0x7 << 1)
|
||||
#define CIDER_REV_SHIFT (1)
|
||||
#define CIDER_REV_GET(_v) (((_v) >> 1) & 0x7)
|
||||
|
||||
#define KS_CGCR 0xC6
|
||||
|
||||
#define KS_IACR 0xC8
|
||||
#define IACR_RDEN (1 << 12)
|
||||
#define IACR_TSEL_MASK (0x3 << 10)
|
||||
#define IACR_TSEL_SHIFT (10)
|
||||
#define IACR_TSEL_MIB (0x3 << 10)
|
||||
#define IACR_ADDR_MASK (0x1f << 0)
|
||||
#define IACR_ADDR_SHIFT (0)
|
||||
|
||||
#define KS_IADLR 0xD0
|
||||
#define KS_IAHDR 0xD2
|
||||
|
||||
#define KS_PMECR 0xD4
|
||||
#define PMECR_PME_DELAY (1 << 14)
|
||||
#define PMECR_PME_POL (1 << 12)
|
||||
#define PMECR_WOL_WAKEUP (1 << 11)
|
||||
#define PMECR_WOL_MAGICPKT (1 << 10)
|
||||
#define PMECR_WOL_LINKUP (1 << 9)
|
||||
#define PMECR_WOL_ENERGY (1 << 8)
|
||||
#define PMECR_AUTO_WAKE_EN (1 << 7)
|
||||
#define PMECR_WAKEUP_NORMAL (1 << 6)
|
||||
#define PMECR_WKEVT_MASK (0xf << 2)
|
||||
#define PMECR_WKEVT_SHIFT (2)
|
||||
#define PMECR_WKEVT_GET(_v) (((_v) >> 2) & 0xf)
|
||||
#define PMECR_WKEVT_ENERGY (0x1 << 2)
|
||||
#define PMECR_WKEVT_LINK (0x2 << 2)
|
||||
#define PMECR_WKEVT_MAGICPKT (0x4 << 2)
|
||||
#define PMECR_WKEVT_FRAME (0x8 << 2)
|
||||
#define PMECR_PM_MASK (0x3 << 0)
|
||||
#define PMECR_PM_SHIFT (0)
|
||||
#define PMECR_PM_NORMAL (0x0 << 0)
|
||||
#define PMECR_PM_ENERGY (0x1 << 0)
|
||||
#define PMECR_PM_SOFTDOWN (0x2 << 0)
|
||||
#define PMECR_PM_POWERSAVE (0x3 << 0)
|
||||
|
||||
/* Standard MII PHY data */
|
||||
#define KS_P1MBCR 0xE4
|
||||
#define KS_P1MBSR 0xE6
|
||||
#define KS_PHY1ILR 0xE8
|
||||
#define KS_PHY1IHR 0xEA
|
||||
#define KS_P1ANAR 0xEC
|
||||
#define KS_P1ANLPR 0xEE
|
||||
|
||||
#define KS_P1SCLMD 0xF4
|
||||
#define P1SCLMD_LEDOFF (1 << 15)
|
||||
#define P1SCLMD_TXIDS (1 << 14)
|
||||
#define P1SCLMD_RESTARTAN (1 << 13)
|
||||
#define P1SCLMD_DISAUTOMDIX (1 << 10)
|
||||
#define P1SCLMD_FORCEMDIX (1 << 9)
|
||||
#define P1SCLMD_AUTONEGEN (1 << 7)
|
||||
#define P1SCLMD_FORCE100 (1 << 6)
|
||||
#define P1SCLMD_FORCEFDX (1 << 5)
|
||||
#define P1SCLMD_ADV_FLOW (1 << 4)
|
||||
#define P1SCLMD_ADV_100BT_FDX (1 << 3)
|
||||
#define P1SCLMD_ADV_100BT_HDX (1 << 2)
|
||||
#define P1SCLMD_ADV_10BT_FDX (1 << 1)
|
||||
#define P1SCLMD_ADV_10BT_HDX (1 << 0)
|
||||
|
||||
#define KS_P1CR 0xF6
|
||||
#define P1CR_HP_MDIX (1 << 15)
|
||||
#define P1CR_REV_POL (1 << 13)
|
||||
#define P1CR_OP_100M (1 << 10)
|
||||
#define P1CR_OP_FDX (1 << 9)
|
||||
#define P1CR_OP_MDI (1 << 7)
|
||||
#define P1CR_AN_DONE (1 << 6)
|
||||
#define P1CR_LINK_GOOD (1 << 5)
|
||||
#define P1CR_PNTR_FLOW (1 << 4)
|
||||
#define P1CR_PNTR_100BT_FDX (1 << 3)
|
||||
#define P1CR_PNTR_100BT_HDX (1 << 2)
|
||||
#define P1CR_PNTR_10BT_FDX (1 << 1)
|
||||
#define P1CR_PNTR_10BT_HDX (1 << 0)
|
||||
|
||||
/* TX Frame control */
|
||||
|
||||
#define TXFR_TXIC (1 << 15)
|
||||
#define TXFR_TXFID_MASK (0x3f << 0)
|
||||
#define TXFR_TXFID_SHIFT (0)
|
||||
|
||||
/* SPI frame opcodes */
|
||||
#define KS_SPIOP_RD (0x00)
|
||||
#define KS_SPIOP_WR (0x40)
|
||||
#define KS_SPIOP_RXFIFO (0x80)
|
||||
#define KS_SPIOP_TXFIFO (0xC0)
|
|
@ -575,6 +575,7 @@ static int __devinit mac_sonic_probe(struct platform_device *pdev)
|
|||
lp = netdev_priv(dev);
|
||||
lp->device = &pdev->dev;
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
platform_set_drvdata(pdev, dev);
|
||||
|
||||
/* This will catch fatal stuff like -ENOMEM as well as success */
|
||||
err = mac_onboard_sonic_probe(dev);
|
||||
|
|
|
@ -220,7 +220,7 @@ static int mlx4_en_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
{
|
||||
cmd->autoneg = AUTONEG_DISABLE;
|
||||
cmd->supported = SUPPORTED_10000baseT_Full;
|
||||
cmd->advertising = SUPPORTED_10000baseT_Full;
|
||||
cmd->advertising = ADVERTISED_1000baseT_Full;
|
||||
if (netif_carrier_ok(dev)) {
|
||||
cmd->speed = SPEED_10000;
|
||||
cmd->duplex = DUPLEX_FULL;
|
||||
|
|
|
@ -210,6 +210,7 @@
|
|||
#define NETXEN_CTX_SIGNATURE 0xdee0
|
||||
#define NETXEN_CTX_SIGNATURE_V2 0x0002dee0
|
||||
#define NETXEN_CTX_RESET 0xbad0
|
||||
#define NETXEN_CTX_D3_RESET 0xacc0
|
||||
#define NETXEN_RCV_PRODUCER(ringid) (ringid)
|
||||
|
||||
#define PHAN_PEG_RCV_INITIALIZED 0xff01
|
||||
|
@ -773,6 +774,8 @@ struct nx_host_tx_ring {
|
|||
u32 crb_cmd_consumer;
|
||||
u32 num_desc;
|
||||
|
||||
struct netdev_queue *txq;
|
||||
|
||||
struct netxen_cmd_buffer *cmd_buf_arr;
|
||||
struct cmd_desc_type0 *desc_head;
|
||||
dma_addr_t phys_addr;
|
||||
|
|
|
@ -684,10 +684,8 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
|
|||
goto err_out_free;
|
||||
} else {
|
||||
err = netxen_init_old_ctx(adapter);
|
||||
if (err) {
|
||||
netxen_free_hw_resources(adapter);
|
||||
return err;
|
||||
}
|
||||
if (err)
|
||||
goto err_out_free;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -708,15 +706,18 @@ void netxen_free_hw_resources(struct netxen_adapter *adapter)
|
|||
int port = adapter->portnum;
|
||||
|
||||
if (adapter->fw_major >= 4) {
|
||||
nx_fw_cmd_destroy_tx_ctx(adapter);
|
||||
nx_fw_cmd_destroy_rx_ctx(adapter);
|
||||
nx_fw_cmd_destroy_tx_ctx(adapter);
|
||||
} else {
|
||||
netxen_api_lock(adapter);
|
||||
NXWR32(adapter, CRB_CTX_SIGNATURE_REG(port),
|
||||
NETXEN_CTX_RESET | port);
|
||||
NETXEN_CTX_D3_RESET | port);
|
||||
netxen_api_unlock(adapter);
|
||||
}
|
||||
|
||||
/* Allow dma queues to drain after context reset */
|
||||
msleep(20);
|
||||
|
||||
recv_ctx = &adapter->recv_ctx;
|
||||
|
||||
if (recv_ctx->hwctx != NULL) {
|
||||
|
|
|
@ -461,13 +461,14 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
|
|||
i = 0;
|
||||
|
||||
tx_ring = adapter->tx_ring;
|
||||
netif_tx_lock_bh(adapter->netdev);
|
||||
__netif_tx_lock_bh(tx_ring->txq);
|
||||
|
||||
producer = tx_ring->producer;
|
||||
consumer = tx_ring->sw_consumer;
|
||||
|
||||
if (nr_desc >= find_diff_among(producer, consumer, tx_ring->num_desc)) {
|
||||
netif_tx_unlock_bh(adapter->netdev);
|
||||
if (nr_desc >= netxen_tx_avail(tx_ring)) {
|
||||
netif_tx_stop_queue(tx_ring->txq);
|
||||
__netif_tx_unlock_bh(tx_ring->txq);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
@ -490,7 +491,7 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
|
|||
|
||||
netxen_nic_update_cmd_producer(adapter, tx_ring);
|
||||
|
||||
netif_tx_unlock_bh(adapter->netdev);
|
||||
__netif_tx_unlock_bh(tx_ring->txq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -214,6 +214,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
|
|||
adapter->tx_ring = tx_ring;
|
||||
|
||||
tx_ring->num_desc = adapter->num_txd;
|
||||
tx_ring->txq = netdev_get_tx_queue(netdev, 0);
|
||||
|
||||
cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring));
|
||||
if (cmd_buf_arr == NULL) {
|
||||
|
@ -1400,10 +1401,10 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter)
|
|||
smp_mb();
|
||||
|
||||
if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) {
|
||||
netif_tx_lock(netdev);
|
||||
__netif_tx_lock(tx_ring->txq, smp_processor_id());
|
||||
if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH)
|
||||
netif_wake_queue(netdev);
|
||||
netif_tx_unlock(netdev);
|
||||
__netif_tx_unlock(tx_ring->txq);
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
|
|
@ -215,9 +215,9 @@ netxen_napi_disable(struct netxen_adapter *adapter)
|
|||
|
||||
for (ring = 0; ring < adapter->max_sds_rings; ring++) {
|
||||
sds_ring = &recv_ctx->sds_rings[ring];
|
||||
napi_disable(&sds_ring->napi);
|
||||
netxen_nic_disable_int(sds_ring);
|
||||
synchronize_irq(sds_ring->irq);
|
||||
napi_synchronize(&sds_ring->napi);
|
||||
napi_disable(&sds_ring->napi);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -833,11 +833,11 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)
|
|||
|
||||
adapter->ahw.linkup = 0;
|
||||
|
||||
netxen_napi_enable(adapter);
|
||||
|
||||
if (adapter->max_sds_rings > 1)
|
||||
netxen_config_rss(adapter, 1);
|
||||
|
||||
netxen_napi_enable(adapter);
|
||||
|
||||
if (adapter->capabilities & NX_FW_CAPABILITY_LINK_NOTIFICATION)
|
||||
netxen_linkevent_request(adapter, 1);
|
||||
else
|
||||
|
@ -851,8 +851,9 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)
|
|||
static void
|
||||
netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
|
||||
{
|
||||
spin_lock(&adapter->tx_clean_lock);
|
||||
netif_carrier_off(netdev);
|
||||
netif_stop_queue(netdev);
|
||||
netif_tx_disable(netdev);
|
||||
|
||||
if (adapter->stop_port)
|
||||
adapter->stop_port(adapter);
|
||||
|
@ -863,9 +864,10 @@ netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
|
|||
netxen_napi_disable(adapter);
|
||||
|
||||
netxen_release_tx_buffers(adapter);
|
||||
spin_unlock(&adapter->tx_clean_lock);
|
||||
|
||||
FLUSH_SCHEDULED_WORK();
|
||||
del_timer_sync(&adapter->watchdog_timer);
|
||||
FLUSH_SCHEDULED_WORK();
|
||||
}
|
||||
|
||||
|
||||
|
@ -943,8 +945,8 @@ netxen_nic_attach(struct netxen_adapter *adapter)
|
|||
static void
|
||||
netxen_nic_detach(struct netxen_adapter *adapter)
|
||||
{
|
||||
netxen_release_rx_buffers(adapter);
|
||||
netxen_free_hw_resources(adapter);
|
||||
netxen_release_rx_buffers(adapter);
|
||||
netxen_nic_free_irq(adapter);
|
||||
netxen_free_sw_resources(adapter);
|
||||
|
||||
|
@ -1533,10 +1535,12 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
|
|||
printk(KERN_ALERT
|
||||
"%s: Device temperature %d degrees C exceeds"
|
||||
" maximum allowed. Hardware has been shut down.\n",
|
||||
netxen_nic_driver_name, temp_val);
|
||||
netdev->name, temp_val);
|
||||
|
||||
netif_device_detach(netdev);
|
||||
netxen_nic_down(adapter, netdev);
|
||||
netxen_nic_detach(adapter);
|
||||
|
||||
netif_carrier_off(netdev);
|
||||
netif_stop_queue(netdev);
|
||||
rv = 1;
|
||||
} else if (temp_state == NX_TEMP_WARN) {
|
||||
if (adapter->temp == NX_TEMP_NORMAL) {
|
||||
|
@ -1544,13 +1548,13 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
|
|||
"%s: Device temperature %d degrees C "
|
||||
"exceeds operating range."
|
||||
" Immediate action needed.\n",
|
||||
netxen_nic_driver_name, temp_val);
|
||||
netdev->name, temp_val);
|
||||
}
|
||||
} else {
|
||||
if (adapter->temp == NX_TEMP_WARN) {
|
||||
printk(KERN_INFO
|
||||
"%s: Device temperature is now %d degrees C"
|
||||
" in normal range.\n", netxen_nic_driver_name,
|
||||
" in normal range.\n", netdev->name,
|
||||
temp_val);
|
||||
}
|
||||
}
|
||||
|
@ -1623,7 +1627,7 @@ void netxen_watchdog_task(struct work_struct *work)
|
|||
struct netxen_adapter *adapter =
|
||||
container_of(work, struct netxen_adapter, watchdog_task);
|
||||
|
||||
if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter))
|
||||
if (netxen_nic_check_temp(adapter))
|
||||
return;
|
||||
|
||||
if (!adapter->has_link_events)
|
||||
|
@ -1645,6 +1649,9 @@ static void netxen_tx_timeout_task(struct work_struct *work)
|
|||
struct netxen_adapter *adapter =
|
||||
container_of(work, struct netxen_adapter, tx_timeout_task);
|
||||
|
||||
if (!netif_running(adapter->netdev))
|
||||
return;
|
||||
|
||||
printk(KERN_ERR "%s %s: transmit timeout, resetting.\n",
|
||||
netxen_nic_driver_name, adapter->netdev->name);
|
||||
|
||||
|
@ -1757,6 +1764,7 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget)
|
|||
|
||||
if ((work_done < budget) && tx_complete) {
|
||||
napi_complete(&sds_ring->napi);
|
||||
if (netif_running(adapter->netdev))
|
||||
netxen_nic_enable_int(sds_ring);
|
||||
}
|
||||
|
||||
|
|
|
@ -156,6 +156,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev);
|
|||
static int el3_rx(struct net_device *dev);
|
||||
static int el3_close(struct net_device *dev);
|
||||
static void el3_tx_timeout(struct net_device *dev);
|
||||
static void set_rx_mode(struct net_device *dev);
|
||||
static void set_multicast_list(struct net_device *dev);
|
||||
static const struct ethtool_ops netdev_ethtool_ops;
|
||||
|
||||
|
@ -488,8 +489,7 @@ static void tc589_reset(struct net_device *dev)
|
|||
/* Switch to register set 1 for normal use. */
|
||||
EL3WINDOW(1);
|
||||
|
||||
/* Accept b-cast and phys addr only. */
|
||||
outw(SetRxFilter | RxStation | RxBroadcast, ioaddr + EL3_CMD);
|
||||
set_rx_mode(dev);
|
||||
outw(StatsEnable, ioaddr + EL3_CMD); /* Turn on statistics. */
|
||||
outw(RxEnable, ioaddr + EL3_CMD); /* Enable the receiver. */
|
||||
outw(TxEnable, ioaddr + EL3_CMD); /* Enable transmitter. */
|
||||
|
@ -700,7 +700,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
|
|||
if (fifo_diag & 0x2000) {
|
||||
/* Rx underrun */
|
||||
tc589_wait_for_completion(dev, RxReset);
|
||||
set_multicast_list(dev);
|
||||
set_rx_mode(dev);
|
||||
outw(RxEnable, ioaddr + EL3_CMD);
|
||||
}
|
||||
outw(AckIntr | AdapterFailure, ioaddr + EL3_CMD);
|
||||
|
@ -905,14 +905,11 @@ static int el3_rx(struct net_device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void set_multicast_list(struct net_device *dev)
|
||||
static void set_rx_mode(struct net_device *dev)
|
||||
{
|
||||
struct el3_private *lp = netdev_priv(dev);
|
||||
struct pcmcia_device *link = lp->p_dev;
|
||||
unsigned int ioaddr = dev->base_addr;
|
||||
u16 opts = SetRxFilter | RxStation | RxBroadcast;
|
||||
|
||||
if (!pcmcia_dev_present(link)) return;
|
||||
if (dev->flags & IFF_PROMISC)
|
||||
opts |= RxMulticast | RxProm;
|
||||
else if (dev->mc_count || (dev->flags & IFF_ALLMULTI))
|
||||
|
@ -920,6 +917,16 @@ static void set_multicast_list(struct net_device *dev)
|
|||
outw(opts, ioaddr + EL3_CMD);
|
||||
}
|
||||
|
||||
static void set_multicast_list(struct net_device *dev)
|
||||
{
|
||||
struct el3_private *priv = netdev_priv(dev);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
set_rx_mode(dev);
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
}
|
||||
|
||||
static int el3_close(struct net_device *dev)
|
||||
{
|
||||
struct el3_private *lp = netdev_priv(dev);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#ifdef CONFIG_OF_GPIO
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/of_mdio.h>
|
||||
#include <linux/of_platform.h>
|
||||
#endif
|
||||
|
||||
|
@ -81,13 +82,12 @@ static struct mdiobb_ops mdio_gpio_ops = {
|
|||
.get_mdio_data = mdio_get,
|
||||
};
|
||||
|
||||
static int __devinit mdio_gpio_bus_init(struct device *dev,
|
||||
static struct mii_bus * __devinit mdio_gpio_bus_init(struct device *dev,
|
||||
struct mdio_gpio_platform_data *pdata,
|
||||
int bus_id)
|
||||
{
|
||||
struct mii_bus *new_bus;
|
||||
struct mdio_gpio_info *bitbang;
|
||||
int ret = -ENOMEM;
|
||||
int i;
|
||||
|
||||
bitbang = kzalloc(sizeof(*bitbang), GFP_KERNEL);
|
||||
|
@ -104,8 +104,6 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
|
|||
|
||||
new_bus->name = "GPIO Bitbanged MDIO",
|
||||
|
||||
ret = -ENODEV;
|
||||
|
||||
new_bus->phy_mask = pdata->phy_mask;
|
||||
new_bus->irq = pdata->irqs;
|
||||
new_bus->parent = dev;
|
||||
|
@ -129,15 +127,8 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
|
|||
|
||||
dev_set_drvdata(dev, new_bus);
|
||||
|
||||
ret = mdiobus_register(new_bus);
|
||||
if (ret)
|
||||
goto out_free_all;
|
||||
return new_bus;
|
||||
|
||||
return 0;
|
||||
|
||||
out_free_all:
|
||||
dev_set_drvdata(dev, NULL);
|
||||
gpio_free(bitbang->mdio);
|
||||
out_free_mdc:
|
||||
gpio_free(bitbang->mdc);
|
||||
out_free_bus:
|
||||
|
@ -145,30 +136,47 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
|
|||
out_free_bitbang:
|
||||
kfree(bitbang);
|
||||
out:
|
||||
return ret;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void __devinit mdio_gpio_bus_deinit(struct device *dev)
|
||||
{
|
||||
struct mii_bus *bus = dev_get_drvdata(dev);
|
||||
struct mdio_gpio_info *bitbang = bus->priv;
|
||||
|
||||
dev_set_drvdata(dev, NULL);
|
||||
gpio_free(bitbang->mdio);
|
||||
gpio_free(bitbang->mdc);
|
||||
free_mdio_bitbang(bus);
|
||||
kfree(bitbang);
|
||||
}
|
||||
|
||||
static void __devexit mdio_gpio_bus_destroy(struct device *dev)
|
||||
{
|
||||
struct mii_bus *bus = dev_get_drvdata(dev);
|
||||
struct mdio_gpio_info *bitbang = bus->priv;
|
||||
|
||||
mdiobus_unregister(bus);
|
||||
free_mdio_bitbang(bus);
|
||||
dev_set_drvdata(dev, NULL);
|
||||
gpio_free(bitbang->mdc);
|
||||
gpio_free(bitbang->mdio);
|
||||
kfree(bitbang);
|
||||
mdio_gpio_bus_deinit(dev);
|
||||
}
|
||||
|
||||
static int __devinit mdio_gpio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct mdio_gpio_platform_data *pdata = pdev->dev.platform_data;
|
||||
struct mii_bus *new_bus;
|
||||
int ret;
|
||||
|
||||
if (!pdata)
|
||||
return -ENODEV;
|
||||
|
||||
return mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id);
|
||||
new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id);
|
||||
if (!new_bus)
|
||||
return -ENODEV;
|
||||
|
||||
ret = mdiobus_register(new_bus);
|
||||
if (ret)
|
||||
mdio_gpio_bus_deinit(&pdev->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __devexit mdio_gpio_remove(struct platform_device *pdev)
|
||||
|
@ -179,29 +187,12 @@ static int __devexit mdio_gpio_remove(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_OF_GPIO
|
||||
static void __devinit add_phy(struct mdio_gpio_platform_data *pdata,
|
||||
struct device_node *np)
|
||||
{
|
||||
const u32 *data;
|
||||
int len, id, irq;
|
||||
|
||||
data = of_get_property(np, "reg", &len);
|
||||
if (!data || len != 4)
|
||||
return;
|
||||
|
||||
id = *data;
|
||||
pdata->phy_mask &= ~(1 << id);
|
||||
|
||||
irq = of_irq_to_resource(np, 0, NULL);
|
||||
if (irq)
|
||||
pdata->irqs[id] = irq;
|
||||
}
|
||||
|
||||
static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *np = NULL;
|
||||
struct mdio_gpio_platform_data *pdata;
|
||||
struct mii_bus *new_bus;
|
||||
int ret;
|
||||
|
||||
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
|
||||
|
@ -218,11 +209,15 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
|
|||
goto out_free;
|
||||
pdata->mdio = ret;
|
||||
|
||||
while ((np = of_get_next_child(ofdev->node, np)))
|
||||
if (!strcmp(np->type, "ethernet-phy"))
|
||||
add_phy(pdata, np);
|
||||
new_bus = mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc);
|
||||
if (!new_bus)
|
||||
return -ENODEV;
|
||||
|
||||
return mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc);
|
||||
ret = of_mdiobus_register(new_bus, ofdev->node);
|
||||
if (ret)
|
||||
mdio_gpio_bus_deinit(&ofdev->dev);
|
||||
|
||||
return ret;
|
||||
|
||||
out_free:
|
||||
kfree(pdata);
|
||||
|
|
|
@ -1593,6 +1593,7 @@ static int sc92031_resume(struct pci_dev *pdev)
|
|||
static struct pci_device_id sc92031_pci_device_id_table[] __devinitdata = {
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_SILAN, 0x2031) },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_SILAN, 0x8139) },
|
||||
{ PCI_DEVICE(0x1088, 0x2031) },
|
||||
{ 0, }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, sc92031_pci_device_id_table);
|
||||
|
|
|
@ -3854,8 +3854,10 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
|
|||
skge->speed = -1;
|
||||
skge->advertising = skge_supported_modes(hw);
|
||||
|
||||
if (device_may_wakeup(&hw->pdev->dev))
|
||||
if (device_can_wakeup(&hw->pdev->dev)) {
|
||||
skge->wol = wol_supported(hw) & WAKE_MAGIC;
|
||||
device_set_wakeup_enable(&hw->pdev->dev, skge->wol);
|
||||
}
|
||||
|
||||
hw->dev[port] = dev;
|
||||
|
||||
|
|
|
@ -1818,12 +1818,6 @@ static int sky2_down(struct net_device *dev)
|
|||
if (netif_msg_ifdown(sky2))
|
||||
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
|
||||
|
||||
/* Disable port IRQ */
|
||||
imask = sky2_read32(hw, B0_IMSK);
|
||||
imask &= ~portirq_msk[port];
|
||||
sky2_write32(hw, B0_IMSK, imask);
|
||||
sky2_read32(hw, B0_IMSK);
|
||||
|
||||
/* Force flow control off */
|
||||
sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
|
||||
|
||||
|
@ -1863,8 +1857,6 @@ static int sky2_down(struct net_device *dev)
|
|||
|
||||
sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET);
|
||||
|
||||
sky2_rx_stop(sky2);
|
||||
|
||||
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
|
||||
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
|
||||
|
||||
|
@ -1874,6 +1866,14 @@ static int sky2_down(struct net_device *dev)
|
|||
sky2_write32(hw, STAT_ISR_TIMER_CNT, 0);
|
||||
sky2_read8(hw, STAT_ISR_TIMER_CTRL);
|
||||
|
||||
sky2_rx_stop(sky2);
|
||||
|
||||
/* Disable port IRQ */
|
||||
imask = sky2_read32(hw, B0_IMSK);
|
||||
imask &= ~portirq_msk[port];
|
||||
sky2_write32(hw, B0_IMSK, imask);
|
||||
sky2_read32(hw, B0_IMSK);
|
||||
|
||||
synchronize_irq(hw->pdev->irq);
|
||||
napi_synchronize(&hw->napi);
|
||||
|
||||
|
|
|
@ -1591,13 +1591,13 @@ static int init_phy(struct net_device *dev)
|
|||
priv->oldspeed = 0;
|
||||
priv->oldduplex = -1;
|
||||
|
||||
if (!ug_info->phy_node)
|
||||
return 0;
|
||||
|
||||
phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0,
|
||||
priv->phy_interface);
|
||||
if (!phydev)
|
||||
phydev = of_phy_connect_fixed_link(dev, &adjust_link,
|
||||
priv->phy_interface);
|
||||
if (!phydev) {
|
||||
printk("%s: Could not attach to PHY\n", dev->name);
|
||||
dev_err(&dev->dev, "Could not attach to PHY\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
@ -3624,9 +3624,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
|
|||
struct ucc_geth_private *ugeth = NULL;
|
||||
struct ucc_geth_info *ug_info;
|
||||
struct resource res;
|
||||
struct device_node *phy;
|
||||
int err, ucc_num, max_speed = 0;
|
||||
const u32 *fixed_link;
|
||||
const unsigned int *prop;
|
||||
const char *sprop;
|
||||
const void *mac_addr;
|
||||
|
@ -3724,15 +3722,8 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
|
|||
|
||||
ug_info->uf_info.regs = res.start;
|
||||
ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
|
||||
fixed_link = of_get_property(np, "fixed-link", NULL);
|
||||
if (fixed_link) {
|
||||
phy = NULL;
|
||||
} else {
|
||||
phy = of_parse_phandle(np, "phy-handle", 0);
|
||||
if (phy == NULL)
|
||||
return -ENODEV;
|
||||
}
|
||||
ug_info->phy_node = phy;
|
||||
|
||||
ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0);
|
||||
|
||||
/* Find the TBI PHY node. If it's not there, we don't support SGMII */
|
||||
ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
|
||||
|
@ -3741,7 +3732,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
|
|||
prop = of_get_property(np, "phy-connection-type", NULL);
|
||||
if (!prop) {
|
||||
/* handle interface property present in old trees */
|
||||
prop = of_get_property(phy, "interface", NULL);
|
||||
prop = of_get_property(ug_info->phy_node, "interface", NULL);
|
||||
if (prop != NULL) {
|
||||
phy_interface = enet_to_phy_interface[*prop];
|
||||
max_speed = enet_to_speed[*prop];
|
||||
|
|
|
@ -369,4 +369,12 @@ config USB_NET_INT51X1
|
|||
(Powerline Communications) solution with an Intellon
|
||||
INT51x1/INT5200 chip, like the "devolo dLan duo".
|
||||
|
||||
config USB_CDC_PHONET
|
||||
tristate "CDC Phonet support"
|
||||
depends on PHONET
|
||||
help
|
||||
Choose this option to support the Phonet interface to a Nokia
|
||||
cellular modem, as found on most Nokia handsets with the
|
||||
"PC suite" USB profile.
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -21,4 +21,5 @@ obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o
|
|||
obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o
|
||||
obj-$(CONFIG_USB_USBNET) += usbnet.o
|
||||
obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o
|
||||
obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o
|
||||
|
||||
|
|
461
drivers/net/usb/cdc-phonet.c
Normal file
461
drivers/net/usb/cdc-phonet.c
Normal file
|
@ -0,0 +1,461 @@
|
|||
/*
|
||||
* phonet.c -- USB CDC Phonet host driver
|
||||
*
|
||||
* Copyright (C) 2008-2009 Nokia Corporation. All rights reserved.
|
||||
*
|
||||
* Author: Rémi Denis-Courmont
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/usb/cdc.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/if_phonet.h>
|
||||
|
||||
#define PN_MEDIA_USB 0x1B
|
||||
|
||||
static const unsigned rxq_size = 17;
|
||||
|
||||
struct usbpn_dev {
|
||||
struct net_device *dev;
|
||||
|
||||
struct usb_interface *intf, *data_intf;
|
||||
struct usb_device *usb;
|
||||
unsigned int tx_pipe, rx_pipe;
|
||||
u8 active_setting;
|
||||
u8 disconnected;
|
||||
|
||||
unsigned tx_queue;
|
||||
spinlock_t tx_lock;
|
||||
|
||||
spinlock_t rx_lock;
|
||||
struct sk_buff *rx_skb;
|
||||
struct urb *urbs[0];
|
||||
};
|
||||
|
||||
static void tx_complete(struct urb *req);
|
||||
static void rx_complete(struct urb *req);
|
||||
|
||||
/*
|
||||
* Network device callbacks
|
||||
*/
|
||||
static int usbpn_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct usbpn_dev *pnd = netdev_priv(dev);
|
||||
struct urb *req = NULL;
|
||||
unsigned long flags;
|
||||
int err;
|
||||
|
||||
if (skb->protocol != htons(ETH_P_PHONET))
|
||||
goto drop;
|
||||
|
||||
req = usb_alloc_urb(0, GFP_ATOMIC);
|
||||
if (!req)
|
||||
goto drop;
|
||||
usb_fill_bulk_urb(req, pnd->usb, pnd->tx_pipe, skb->data, skb->len,
|
||||
tx_complete, skb);
|
||||
req->transfer_flags = URB_ZERO_PACKET;
|
||||
err = usb_submit_urb(req, GFP_ATOMIC);
|
||||
if (err) {
|
||||
usb_free_urb(req);
|
||||
goto drop;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&pnd->tx_lock, flags);
|
||||
pnd->tx_queue++;
|
||||
if (pnd->tx_queue >= dev->tx_queue_len)
|
||||
netif_stop_queue(dev);
|
||||
spin_unlock_irqrestore(&pnd->tx_lock, flags);
|
||||
return 0;
|
||||
|
||||
drop:
|
||||
dev_kfree_skb(skb);
|
||||
dev->stats.tx_dropped++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tx_complete(struct urb *req)
|
||||
{
|
||||
struct sk_buff *skb = req->context;
|
||||
struct net_device *dev = skb->dev;
|
||||
struct usbpn_dev *pnd = netdev_priv(dev);
|
||||
|
||||
switch (req->status) {
|
||||
case 0:
|
||||
dev->stats.tx_bytes += skb->len;
|
||||
break;
|
||||
|
||||
case -ENOENT:
|
||||
case -ECONNRESET:
|
||||
case -ESHUTDOWN:
|
||||
dev->stats.tx_aborted_errors++;
|
||||
default:
|
||||
dev->stats.tx_errors++;
|
||||
dev_dbg(&dev->dev, "TX error (%d)\n", req->status);
|
||||
}
|
||||
dev->stats.tx_packets++;
|
||||
|
||||
spin_lock(&pnd->tx_lock);
|
||||
pnd->tx_queue--;
|
||||
netif_wake_queue(dev);
|
||||
spin_unlock(&pnd->tx_lock);
|
||||
|
||||
dev_kfree_skb_any(skb);
|
||||
usb_free_urb(req);
|
||||
}
|
||||
|
||||
static int rx_submit(struct usbpn_dev *pnd, struct urb *req, gfp_t gfp_flags)
|
||||
{
|
||||
struct net_device *dev = pnd->dev;
|
||||
struct page *page;
|
||||
int err;
|
||||
|
||||
page = __netdev_alloc_page(dev, gfp_flags);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
usb_fill_bulk_urb(req, pnd->usb, pnd->rx_pipe, page_address(page),
|
||||
PAGE_SIZE, rx_complete, dev);
|
||||
req->transfer_flags = 0;
|
||||
err = usb_submit_urb(req, gfp_flags);
|
||||
if (unlikely(err)) {
|
||||
dev_dbg(&dev->dev, "RX submit error (%d)\n", err);
|
||||
netdev_free_page(dev, page);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static void rx_complete(struct urb *req)
|
||||
{
|
||||
struct net_device *dev = req->context;
|
||||
struct usbpn_dev *pnd = netdev_priv(dev);
|
||||
struct page *page = virt_to_page(req->transfer_buffer);
|
||||
struct sk_buff *skb;
|
||||
unsigned long flags;
|
||||
|
||||
switch (req->status) {
|
||||
case 0:
|
||||
spin_lock_irqsave(&pnd->rx_lock, flags);
|
||||
skb = pnd->rx_skb;
|
||||
if (!skb) {
|
||||
skb = pnd->rx_skb = netdev_alloc_skb(dev, 12);
|
||||
if (likely(skb)) {
|
||||
/* Can't use pskb_pull() on page in IRQ */
|
||||
memcpy(skb_put(skb, 1), page_address(page), 1);
|
||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||
page, 1, req->actual_length);
|
||||
page = NULL;
|
||||
}
|
||||
} else {
|
||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||
page, 0, req->actual_length);
|
||||
page = NULL;
|
||||
}
|
||||
if (req->actual_length < PAGE_SIZE)
|
||||
pnd->rx_skb = NULL; /* Last fragment */
|
||||
else
|
||||
skb = NULL;
|
||||
spin_unlock_irqrestore(&pnd->rx_lock, flags);
|
||||
if (skb) {
|
||||
skb->protocol = htons(ETH_P_PHONET);
|
||||
skb_reset_mac_header(skb);
|
||||
__skb_pull(skb, 1);
|
||||
skb->dev = dev;
|
||||
dev->stats.rx_packets++;
|
||||
dev->stats.rx_bytes += skb->len;
|
||||
|
||||
netif_rx(skb);
|
||||
}
|
||||
goto resubmit;
|
||||
|
||||
case -ENOENT:
|
||||
case -ECONNRESET:
|
||||
case -ESHUTDOWN:
|
||||
req = NULL;
|
||||
break;
|
||||
|
||||
case -EOVERFLOW:
|
||||
dev->stats.rx_over_errors++;
|
||||
dev_dbg(&dev->dev, "RX overflow\n");
|
||||
break;
|
||||
|
||||
case -EILSEQ:
|
||||
dev->stats.rx_crc_errors++;
|
||||
break;
|
||||
}
|
||||
|
||||
dev->stats.rx_errors++;
|
||||
resubmit:
|
||||
if (page)
|
||||
netdev_free_page(dev, page);
|
||||
if (req)
|
||||
rx_submit(pnd, req, GFP_ATOMIC);
|
||||
}
|
||||
|
||||
static int usbpn_close(struct net_device *dev);
|
||||
|
||||
static int usbpn_open(struct net_device *dev)
|
||||
{
|
||||
struct usbpn_dev *pnd = netdev_priv(dev);
|
||||
int err;
|
||||
unsigned i;
|
||||
unsigned num = pnd->data_intf->cur_altsetting->desc.bInterfaceNumber;
|
||||
|
||||
err = usb_set_interface(pnd->usb, num, pnd->active_setting);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
for (i = 0; i < rxq_size; i++) {
|
||||
struct urb *req = usb_alloc_urb(0, GFP_KERNEL);
|
||||
|
||||
if (!req || rx_submit(pnd, req, GFP_KERNEL)) {
|
||||
usbpn_close(dev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
pnd->urbs[i] = req;
|
||||
}
|
||||
|
||||
netif_wake_queue(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int usbpn_close(struct net_device *dev)
|
||||
{
|
||||
struct usbpn_dev *pnd = netdev_priv(dev);
|
||||
unsigned i;
|
||||
unsigned num = pnd->data_intf->cur_altsetting->desc.bInterfaceNumber;
|
||||
|
||||
netif_stop_queue(dev);
|
||||
|
||||
for (i = 0; i < rxq_size; i++) {
|
||||
struct urb *req = pnd->urbs[i];
|
||||
|
||||
if (!req)
|
||||
continue;
|
||||
usb_kill_urb(req);
|
||||
usb_free_urb(req);
|
||||
pnd->urbs[i] = NULL;
|
||||
}
|
||||
|
||||
return usb_set_interface(pnd->usb, num, !pnd->active_setting);
|
||||
}
|
||||
|
||||
static int usbpn_set_mtu(struct net_device *dev, int new_mtu)
|
||||
{
|
||||
if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU))
|
||||
return -EINVAL;
|
||||
|
||||
dev->mtu = new_mtu;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops usbpn_ops = {
|
||||
.ndo_open = usbpn_open,
|
||||
.ndo_stop = usbpn_close,
|
||||
.ndo_start_xmit = usbpn_xmit,
|
||||
.ndo_change_mtu = usbpn_set_mtu,
|
||||
};
|
||||
|
||||
static void usbpn_setup(struct net_device *dev)
|
||||
{
|
||||
dev->features = 0;
|
||||
dev->netdev_ops = &usbpn_ops,
|
||||
dev->header_ops = &phonet_header_ops;
|
||||
dev->type = ARPHRD_PHONET;
|
||||
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
|
||||
dev->mtu = PHONET_MAX_MTU;
|
||||
dev->hard_header_len = 1;
|
||||
dev->dev_addr[0] = PN_MEDIA_USB;
|
||||
dev->addr_len = 1;
|
||||
dev->tx_queue_len = 3;
|
||||
|
||||
dev->destructor = free_netdev;
|
||||
}
|
||||
|
||||
/*
|
||||
* USB driver callbacks
|
||||
*/
|
||||
static struct usb_device_id usbpn_ids[] = {
|
||||
{
|
||||
.match_flags = USB_DEVICE_ID_MATCH_VENDOR
|
||||
| USB_DEVICE_ID_MATCH_INT_CLASS
|
||||
| USB_DEVICE_ID_MATCH_INT_SUBCLASS,
|
||||
.idVendor = 0x0421, /* Nokia */
|
||||
.bInterfaceClass = USB_CLASS_COMM,
|
||||
.bInterfaceSubClass = 0xFE,
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(usb, usbpn_ids);
|
||||
|
||||
static struct usb_driver usbpn_driver;
|
||||
|
||||
int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
{
|
||||
static const char ifname[] = "usbpn%d";
|
||||
const struct usb_cdc_union_desc *union_header = NULL;
|
||||
const struct usb_cdc_header_desc *phonet_header = NULL;
|
||||
const struct usb_host_interface *data_desc;
|
||||
struct usb_interface *data_intf;
|
||||
struct usb_device *usbdev = interface_to_usbdev(intf);
|
||||
struct net_device *dev;
|
||||
struct usbpn_dev *pnd;
|
||||
u8 *data;
|
||||
int len, err;
|
||||
|
||||
data = intf->altsetting->extra;
|
||||
len = intf->altsetting->extralen;
|
||||
while (len >= 3) {
|
||||
u8 dlen = data[0];
|
||||
if (dlen < 3)
|
||||
return -EINVAL;
|
||||
|
||||
/* bDescriptorType */
|
||||
if (data[1] == USB_DT_CS_INTERFACE) {
|
||||
/* bDescriptorSubType */
|
||||
switch (data[2]) {
|
||||
case USB_CDC_UNION_TYPE:
|
||||
if (union_header || dlen < 5)
|
||||
break;
|
||||
union_header =
|
||||
(struct usb_cdc_union_desc *)data;
|
||||
break;
|
||||
case 0xAB:
|
||||
if (phonet_header || dlen < 5)
|
||||
break;
|
||||
phonet_header =
|
||||
(struct usb_cdc_header_desc *)data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
data += dlen;
|
||||
len -= dlen;
|
||||
}
|
||||
|
||||
if (!union_header || !phonet_header)
|
||||
return -EINVAL;
|
||||
|
||||
data_intf = usb_ifnum_to_if(usbdev, union_header->bSlaveInterface0);
|
||||
if (data_intf == NULL)
|
||||
return -ENODEV;
|
||||
/* Data interface has one inactive and one active setting */
|
||||
if (data_intf->num_altsetting != 2)
|
||||
return -EINVAL;
|
||||
if (data_intf->altsetting[0].desc.bNumEndpoints == 0
|
||||
&& data_intf->altsetting[1].desc.bNumEndpoints == 2)
|
||||
data_desc = data_intf->altsetting + 1;
|
||||
else
|
||||
if (data_intf->altsetting[0].desc.bNumEndpoints == 2
|
||||
&& data_intf->altsetting[1].desc.bNumEndpoints == 0)
|
||||
data_desc = data_intf->altsetting;
|
||||
else
|
||||
return -EINVAL;
|
||||
|
||||
dev = alloc_netdev(sizeof(*pnd) + sizeof(pnd->urbs[0]) * rxq_size,
|
||||
ifname, usbpn_setup);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
pnd = netdev_priv(dev);
|
||||
SET_NETDEV_DEV(dev, &intf->dev);
|
||||
netif_stop_queue(dev);
|
||||
|
||||
pnd->dev = dev;
|
||||
pnd->usb = usb_get_dev(usbdev);
|
||||
pnd->intf = intf;
|
||||
pnd->data_intf = data_intf;
|
||||
spin_lock_init(&pnd->tx_lock);
|
||||
spin_lock_init(&pnd->rx_lock);
|
||||
/* Endpoints */
|
||||
if (usb_pipein(data_desc->endpoint[0].desc.bEndpointAddress)) {
|
||||
pnd->rx_pipe = usb_rcvbulkpipe(usbdev,
|
||||
data_desc->endpoint[0].desc.bEndpointAddress);
|
||||
pnd->tx_pipe = usb_sndbulkpipe(usbdev,
|
||||
data_desc->endpoint[1].desc.bEndpointAddress);
|
||||
} else {
|
||||
pnd->rx_pipe = usb_rcvbulkpipe(usbdev,
|
||||
data_desc->endpoint[1].desc.bEndpointAddress);
|
||||
pnd->tx_pipe = usb_sndbulkpipe(usbdev,
|
||||
data_desc->endpoint[0].desc.bEndpointAddress);
|
||||
}
|
||||
pnd->active_setting = data_desc - data_intf->altsetting;
|
||||
|
||||
err = usb_driver_claim_interface(&usbpn_driver, data_intf, pnd);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
/* Force inactive mode until the network device is brought UP */
|
||||
usb_set_interface(usbdev, union_header->bSlaveInterface0,
|
||||
!pnd->active_setting);
|
||||
usb_set_intfdata(intf, pnd);
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err) {
|
||||
usb_driver_release_interface(&usbpn_driver, data_intf);
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev_dbg(&dev->dev, "USB CDC Phonet device found\n");
|
||||
return 0;
|
||||
|
||||
out:
|
||||
usb_set_intfdata(intf, NULL);
|
||||
free_netdev(dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void usbpn_disconnect(struct usb_interface *intf)
|
||||
{
|
||||
struct usbpn_dev *pnd = usb_get_intfdata(intf);
|
||||
struct usb_device *usb = pnd->usb;
|
||||
|
||||
if (pnd->disconnected)
|
||||
return;
|
||||
|
||||
pnd->disconnected = 1;
|
||||
usb_driver_release_interface(&usbpn_driver,
|
||||
(pnd->intf == intf) ? pnd->data_intf : pnd->intf);
|
||||
unregister_netdev(pnd->dev);
|
||||
usb_put_dev(usb);
|
||||
}
|
||||
|
||||
static struct usb_driver usbpn_driver = {
|
||||
.name = "cdc_phonet",
|
||||
.probe = usbpn_probe,
|
||||
.disconnect = usbpn_disconnect,
|
||||
.id_table = usbpn_ids,
|
||||
};
|
||||
|
||||
static int __init usbpn_init(void)
|
||||
{
|
||||
return usb_register(&usbpn_driver);
|
||||
}
|
||||
|
||||
static void __exit usbpn_exit(void)
|
||||
{
|
||||
usb_deregister(&usbpn_driver);
|
||||
}
|
||||
|
||||
module_init(usbpn_init);
|
||||
module_exit(usbpn_exit);
|
||||
|
||||
MODULE_AUTHOR("Remi Denis-Courmont");
|
||||
MODULE_DESCRIPTION("USB CDC Phonet host interface");
|
||||
MODULE_LICENSE("GPL");
|
|
@ -2980,6 +2980,9 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
|||
if (modparam_nohwcrypt)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (sc->opmode == NL80211_IFTYPE_AP)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
switch (key->alg) {
|
||||
case ALG_WEP:
|
||||
case ALG_TKIP:
|
||||
|
|
|
@ -478,6 +478,18 @@ void ath9k_ani_reset(struct ath_hw *ah)
|
|||
"Reset ANI state opmode %u\n", ah->opmode);
|
||||
ah->stats.ast_ani_reset++;
|
||||
|
||||
if (ah->opmode == NL80211_IFTYPE_AP) {
|
||||
/*
|
||||
* ath9k_hw_ani_control() will only process items set on
|
||||
* ah->ani_function
|
||||
*/
|
||||
if (IS_CHAN_2GHZ(chan))
|
||||
ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
|
||||
ATH9K_ANI_FIRSTEP_LEVEL);
|
||||
else
|
||||
ah->ani_function = 0;
|
||||
}
|
||||
|
||||
ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0);
|
||||
ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
|
||||
ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
|
||||
|
|
|
@ -474,6 +474,21 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some users have reported their EEPROM programmed with
|
||||
* 0x8000 set, this is not a supported regulatory domain
|
||||
* but since we have more than one user with it we need
|
||||
* a solution for them. We default to 0x64, which is the
|
||||
* default Atheros world regulatory domain.
|
||||
*/
|
||||
static void ath_regd_sanitize(struct ath_regulatory *reg)
|
||||
{
|
||||
if (reg->current_rd != COUNTRY_ERD_FLAG)
|
||||
return;
|
||||
printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n");
|
||||
reg->current_rd = 0x64;
|
||||
}
|
||||
|
||||
int
|
||||
ath_regd_init(struct ath_regulatory *reg,
|
||||
struct wiphy *wiphy,
|
||||
|
@ -486,6 +501,8 @@ ath_regd_init(struct ath_regulatory *reg,
|
|||
if (!reg)
|
||||
return -EINVAL;
|
||||
|
||||
ath_regd_sanitize(reg);
|
||||
|
||||
printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
|
||||
|
||||
if (!ath_regd_is_eeprom_valid(reg)) {
|
||||
|
|
|
@ -2617,12 +2617,10 @@ static ssize_t show_power_level(struct device *d,
|
|||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct iwl_priv *priv = dev_get_drvdata(d);
|
||||
int mode = priv->power_data.user_power_setting;
|
||||
int level = priv->power_data.power_mode;
|
||||
char *p = buf;
|
||||
|
||||
p += sprintf(p, "INDEX:%d\t", level);
|
||||
p += sprintf(p, "USER:%d\n", mode);
|
||||
p += sprintf(p, "%d\n", level);
|
||||
return p - buf + 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -873,6 +873,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
|
|||
iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len);
|
||||
|
||||
/* Set up entry for this TFD in Tx byte-count array */
|
||||
if (info->flags & IEEE80211_TX_CTL_AMPDU)
|
||||
priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq,
|
||||
le16_to_cpu(tx_cmd->len));
|
||||
|
||||
|
|
|
@ -3573,12 +3573,10 @@ static ssize_t show_power_level(struct device *d,
|
|||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct iwl_priv *priv = dev_get_drvdata(d);
|
||||
int mode = priv->power_data.user_power_setting;
|
||||
int level = priv->power_data.power_mode;
|
||||
char *p = buf;
|
||||
|
||||
p += sprintf(p, "INDEX:%d\t", level);
|
||||
p += sprintf(p, "USER:%d\n", mode);
|
||||
p += sprintf(p, "%d\n", level);
|
||||
return p - buf + 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -156,10 +156,10 @@ void iwm_if_free(struct iwm_priv *iwm)
|
|||
return;
|
||||
|
||||
free_netdev(iwm_to_ndev(iwm));
|
||||
iwm_wdev_free(iwm);
|
||||
iwm_priv_deinit(iwm);
|
||||
kfree(iwm->umac_profile);
|
||||
iwm->umac_profile = NULL;
|
||||
iwm_wdev_free(iwm);
|
||||
}
|
||||
|
||||
int iwm_if_add(struct iwm_priv *iwm)
|
||||
|
|
|
@ -135,7 +135,13 @@ int lbs_update_hw_spec(struct lbs_private *priv)
|
|||
/* Clamp region code to 8-bit since FW spec indicates that it should
|
||||
* only ever be 8-bit, even though the field size is 16-bit. Some firmware
|
||||
* returns non-zero high 8 bits here.
|
||||
*
|
||||
* Firmware version 4.0.102 used in CF8381 has region code shifted. We
|
||||
* need to check for this problem and handle it properly.
|
||||
*/
|
||||
if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V4)
|
||||
priv->regioncode = (le16_to_cpu(cmd.regioncode) >> 8) & 0xFF;
|
||||
else
|
||||
priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF;
|
||||
|
||||
for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
|
||||
|
|
|
@ -234,6 +234,8 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
|
|||
/** Mesh enable bit in FW capability */
|
||||
#define MESH_CAPINFO_ENABLE_MASK (1<<16)
|
||||
|
||||
/** FW definition from Marvell v4 */
|
||||
#define MRVL_FW_V4 (0x04)
|
||||
/** FW definition from Marvell v5 */
|
||||
#define MRVL_FW_V5 (0x05)
|
||||
/** FW definition from Marvell v10 */
|
||||
|
|
|
@ -788,7 +788,7 @@ static const struct ieee80211_ops mac80211_hwsim_ops =
|
|||
static void mac80211_hwsim_free(void)
|
||||
{
|
||||
struct list_head tmplist, *i, *tmp;
|
||||
struct mac80211_hwsim_data *data;
|
||||
struct mac80211_hwsim_data *data, *tmpdata;
|
||||
|
||||
INIT_LIST_HEAD(&tmplist);
|
||||
|
||||
|
@ -797,7 +797,7 @@ static void mac80211_hwsim_free(void)
|
|||
list_move(i, &tmplist);
|
||||
spin_unlock_bh(&hwsim_radio_lock);
|
||||
|
||||
list_for_each_entry(data, &tmplist, list) {
|
||||
list_for_each_entry_safe(data, tmpdata, &tmplist, list) {
|
||||
debugfs_remove(data->debugfs_group);
|
||||
debugfs_remove(data->debugfs_ps);
|
||||
debugfs_remove(data->debugfs);
|
||||
|
@ -1246,8 +1246,8 @@ static void __exit exit_mac80211_hwsim(void)
|
|||
{
|
||||
printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n");
|
||||
|
||||
unregister_netdev(hwsim_mon);
|
||||
mac80211_hwsim_free();
|
||||
unregister_netdev(hwsim_mon);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -600,7 +600,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
|
|||
|
||||
hw = p54_init_common(sizeof(*priv));
|
||||
if (!hw) {
|
||||
dev_err(&priv->spi->dev, "could not alloc ieee80211_hw");
|
||||
dev_err(&spi->dev, "could not alloc ieee80211_hw");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
|
@ -1546,7 +1546,9 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
|
|||
rt2500usb_register_read(rt2x00dev, MAC_CSR0, ®);
|
||||
rt2x00_set_chip(rt2x00dev, RT2570, value, reg);
|
||||
|
||||
if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0)) {
|
||||
if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0) ||
|
||||
rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {
|
||||
|
||||
ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
|
@ -208,11 +208,12 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev)
|
|||
{
|
||||
struct rtl8187_priv *priv = dev->priv;
|
||||
|
||||
rtl8187_unregister_led(&priv->led_tx);
|
||||
/* turn the LED off before exiting */
|
||||
queue_delayed_work(dev->workqueue, &priv->led_off, 0);
|
||||
cancel_delayed_work_sync(&priv->led_off);
|
||||
cancel_delayed_work_sync(&priv->led_on);
|
||||
rtl8187_unregister_led(&priv->led_rx);
|
||||
rtl8187_unregister_led(&priv->led_tx);
|
||||
}
|
||||
#endif /* def CONFIG_RTL8187_LED */
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
* out of the OpenFirmware device tree and using it to populate an mii_bus.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/phy.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_mdio.h>
|
||||
|
@ -137,3 +141,41 @@ struct phy_device *of_phy_connect(struct net_device *dev,
|
|||
return phy_connect_direct(dev, phy, hndlr, flags, iface) ? NULL : phy;
|
||||
}
|
||||
EXPORT_SYMBOL(of_phy_connect);
|
||||
|
||||
/**
|
||||
* of_phy_connect_fixed_link - Parse fixed-link property and return a dummy phy
|
||||
* @dev: pointer to net_device claiming the phy
|
||||
* @hndlr: Link state callback for the network device
|
||||
* @iface: PHY data interface type
|
||||
*
|
||||
* This function is a temporary stop-gap and will be removed soon. It is
|
||||
* only to support the fs_enet, ucc_geth and gianfar Ethernet drivers. Do
|
||||
* not call this function from new drivers.
|
||||
*/
|
||||
struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
|
||||
void (*hndlr)(struct net_device *),
|
||||
phy_interface_t iface)
|
||||
{
|
||||
struct device_node *net_np;
|
||||
char bus_id[MII_BUS_ID_SIZE + 3];
|
||||
struct phy_device *phy;
|
||||
const u32 *phy_id;
|
||||
int sz;
|
||||
|
||||
if (!dev->dev.parent)
|
||||
return NULL;
|
||||
|
||||
net_np = dev_archdata_get_node(&dev->dev.parent->archdata);
|
||||
if (!net_np)
|
||||
return NULL;
|
||||
|
||||
phy_id = of_get_property(net_np, "fixed-link", &sz);
|
||||
if (!phy_id || sz < sizeof(*phy_id))
|
||||
return NULL;
|
||||
|
||||
sprintf(bus_id, PHY_ID_FMT, "0", phy_id[0]);
|
||||
|
||||
phy = phy_connect(dev, bus_id, hndlr, 0, iface);
|
||||
return IS_ERR(phy) ? NULL : phy;
|
||||
}
|
||||
EXPORT_SYMBOL(of_phy_connect_fixed_link);
|
||||
|
|
|
@ -973,7 +973,7 @@ static int acer_rfkill_set(void *data, bool blocked)
|
|||
{
|
||||
acpi_status status;
|
||||
u32 cap = (unsigned long)data;
|
||||
status = set_u32(!!blocked, cap);
|
||||
status = set_u32(!blocked, cap);
|
||||
if (ACPI_FAILURE(status))
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
|
|
@ -18,5 +18,8 @@ extern struct phy_device *of_phy_connect(struct net_device *dev,
|
|||
struct device_node *phy_np,
|
||||
void (*hndlr)(struct net_device *),
|
||||
u32 flags, phy_interface_t iface);
|
||||
extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
|
||||
void (*hndlr)(struct net_device *),
|
||||
phy_interface_t iface);
|
||||
|
||||
#endif /* __LINUX_OF_MDIO_H */
|
||||
|
|
|
@ -238,7 +238,7 @@ void rfkill_destroy(struct rfkill *rfkill);
|
|||
* should be blocked) so that drivers need not keep track of the soft
|
||||
* block state -- which they might not be able to.
|
||||
*/
|
||||
bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked);
|
||||
bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked);
|
||||
|
||||
/**
|
||||
* rfkill_set_sw_state - Set the internal rfkill software block state
|
||||
|
|
|
@ -1425,6 +1425,11 @@ struct tcp_request_sock_ops {
|
|||
#ifdef CONFIG_TCP_MD5SIG
|
||||
struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk,
|
||||
struct request_sock *req);
|
||||
int (*calc_md5_hash) (char *location,
|
||||
struct tcp_md5sig_key *md5,
|
||||
struct sock *sk,
|
||||
struct request_sock *req,
|
||||
struct sk_buff *skb);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -631,7 +631,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
|
|||
|
||||
case SO_TIMESTAMPING:
|
||||
if (val & ~SOF_TIMESTAMPING_MASK) {
|
||||
ret = EINVAL;
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
sock_valbool_flag(sk, SOCK_TIMESTAMPING_TX_HARDWARE,
|
||||
|
|
|
@ -1160,6 +1160,7 @@ struct request_sock_ops tcp_request_sock_ops __read_mostly = {
|
|||
#ifdef CONFIG_TCP_MD5SIG
|
||||
static struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
|
||||
.md5_lookup = tcp_v4_reqsk_md5_lookup,
|
||||
.calc_md5_hash = tcp_v4_md5_hash_skb,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -1373,7 +1374,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
|
|||
*/
|
||||
char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC);
|
||||
if (newkey != NULL)
|
||||
tcp_v4_md5_do_add(newsk, inet_sk(sk)->daddr,
|
||||
tcp_v4_md5_do_add(newsk, newinet->daddr,
|
||||
newkey, key->keylen);
|
||||
newsk->sk_route_caps &= ~NETIF_F_GSO_MASK;
|
||||
}
|
||||
|
|
|
@ -2294,7 +2294,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
|
|||
#ifdef CONFIG_TCP_MD5SIG
|
||||
/* Okay, we have all we need - do the md5 hash if needed */
|
||||
if (md5) {
|
||||
tp->af_specific->calc_md5_hash(md5_hash_location,
|
||||
tcp_rsk(req)->af_specific->calc_md5_hash(md5_hash_location,
|
||||
md5, NULL, req, skb);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -896,6 +896,7 @@ struct request_sock_ops tcp6_request_sock_ops __read_mostly = {
|
|||
#ifdef CONFIG_TCP_MD5SIG
|
||||
static struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
|
||||
.md5_lookup = tcp_v6_reqsk_md5_lookup,
|
||||
.calc_md5_hash = tcp_v6_md5_hash_skb,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -1441,7 +1442,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
|
|||
*/
|
||||
char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC);
|
||||
if (newkey != NULL)
|
||||
tcp_v6_md5_do_add(newsk, &inet6_sk(sk)->daddr,
|
||||
tcp_v6_md5_do_add(newsk, &newnp->daddr,
|
||||
newkey, key->keylen);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -67,6 +67,7 @@ endmenu
|
|||
config MAC80211_MESH
|
||||
bool "Enable mac80211 mesh networking (pre-802.11s) support"
|
||||
depends on MAC80211 && EXPERIMENTAL
|
||||
depends on BROKEN
|
||||
---help---
|
||||
This options enables support of Draft 802.11s mesh networking.
|
||||
The implementation is based on Draft 1.08 of the Mesh Networking
|
||||
|
|
|
@ -175,6 +175,8 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
|
|||
int err = 0;
|
||||
u32 hash_idx;
|
||||
|
||||
might_sleep();
|
||||
|
||||
if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
|
||||
/* never add ourselves as neighbours */
|
||||
return -ENOTSUPP;
|
||||
|
@ -265,6 +267,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
|
|||
int err = 0;
|
||||
u32 hash_idx;
|
||||
|
||||
might_sleep();
|
||||
|
||||
if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
|
||||
/* never add ourselves as neighbours */
|
||||
|
@ -491,8 +494,10 @@ void mesh_path_tx_pending(struct mesh_path *mpath)
|
|||
* @skb: frame to discard
|
||||
* @sdata: network subif the frame was to be sent through
|
||||
*
|
||||
* If the frame was beign forwarded from another MP, a PERR frame will be sent
|
||||
* to the precursor.
|
||||
* If the frame was being forwarded from another MP, a PERR frame will be sent
|
||||
* to the precursor. The precursor's address (i.e. the previous hop) was saved
|
||||
* in addr1 of the frame-to-be-forwarded, and would only be overwritten once
|
||||
* the destination is successfully resolved.
|
||||
*
|
||||
* Locking: the function must me called within a rcu_read_lock region
|
||||
*/
|
||||
|
@ -507,7 +512,7 @@ void mesh_path_discard_frame(struct sk_buff *skb,
|
|||
u8 *ra, *da;
|
||||
|
||||
da = hdr->addr3;
|
||||
ra = hdr->addr2;
|
||||
ra = hdr->addr1;
|
||||
mpath = mesh_path_lookup(da, sdata);
|
||||
if (mpath)
|
||||
dsn = ++mpath->dsn;
|
||||
|
|
|
@ -1455,7 +1455,7 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
monitor_iface = UNKNOWN_ADDRESS;
|
||||
|
||||
len_rthdr = ieee80211_get_radiotap_len(skb->data);
|
||||
hdr = (struct ieee80211_hdr *)skb->data + len_rthdr;
|
||||
hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr);
|
||||
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
||||
|
||||
/* check the header is complete in the frame */
|
||||
|
|
|
@ -549,6 +549,10 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
|
|||
swprev = !!(rfkill->state & RFKILL_BLOCK_SW);
|
||||
hwprev = !!(rfkill->state & RFKILL_BLOCK_HW);
|
||||
__rfkill_set_sw_state(rfkill, sw);
|
||||
if (hw)
|
||||
rfkill->state |= RFKILL_BLOCK_HW;
|
||||
else
|
||||
rfkill->state &= ~RFKILL_BLOCK_HW;
|
||||
|
||||
spin_unlock_irqrestore(&rfkill->lock, flags);
|
||||
|
||||
|
@ -648,15 +652,26 @@ static ssize_t rfkill_state_store(struct device *dev,
|
|||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
/*
|
||||
* The intention was that userspace can only take control over
|
||||
* a given device when/if rfkill-input doesn't control it due
|
||||
* to user_claim. Since user_claim is currently unsupported,
|
||||
* we never support changing the state from userspace -- this
|
||||
* can be implemented again later.
|
||||
*/
|
||||
struct rfkill *rfkill = to_rfkill(dev);
|
||||
unsigned long state;
|
||||
int err;
|
||||
|
||||
if (!capable(CAP_NET_ADMIN))
|
||||
return -EPERM;
|
||||
|
||||
err = strict_strtoul(buf, 0, &state);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (state != RFKILL_USER_STATE_SOFT_BLOCKED &&
|
||||
state != RFKILL_USER_STATE_UNBLOCKED)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&rfkill_global_mutex);
|
||||
rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED);
|
||||
mutex_unlock(&rfkill_global_mutex);
|
||||
|
||||
return err ?: count;
|
||||
}
|
||||
|
||||
static ssize_t rfkill_claim_show(struct device *dev,
|
||||
|
|
|
@ -1010,7 +1010,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
|
|||
|
||||
if (IS_ERR(hdr)) {
|
||||
err = PTR_ERR(hdr);
|
||||
goto out;
|
||||
goto free_msg;
|
||||
}
|
||||
|
||||
cookie.msg = msg;
|
||||
|
@ -1024,7 +1024,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
|
|||
&cookie, get_key_callback);
|
||||
|
||||
if (err)
|
||||
goto out;
|
||||
goto free_msg;
|
||||
|
||||
if (cookie.error)
|
||||
goto nla_put_failure;
|
||||
|
@ -1035,6 +1035,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
|
|||
|
||||
nla_put_failure:
|
||||
err = -ENOBUFS;
|
||||
free_msg:
|
||||
nlmsg_free(msg);
|
||||
out:
|
||||
cfg80211_unlock_rdev(rdev);
|
||||
|
|
|
@ -48,8 +48,6 @@ void __cfg80211_scan_done(struct work_struct *wk)
|
|||
else
|
||||
nl80211_send_scan_done(wiphy_to_dev(request->wiphy), dev);
|
||||
|
||||
wiphy_to_dev(request->wiphy)->scan_req = NULL;
|
||||
|
||||
#ifdef CONFIG_WIRELESS_EXT
|
||||
if (!request->aborted) {
|
||||
memset(&wrqu, 0, sizeof(wrqu));
|
||||
|
@ -62,6 +60,7 @@ void __cfg80211_scan_done(struct work_struct *wk)
|
|||
|
||||
out:
|
||||
cfg80211_unlock_rdev(rdev);
|
||||
wiphy_to_dev(request->wiphy)->scan_req = NULL;
|
||||
kfree(request);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue