mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (84 commits) wimax: fix kernel-doc for debufs_dentry member of struct wimax_dev net: convert pegasus driver to net_device_ops bnx2x: Prevent eeprom set when driver is down net: switch kaweth driver to netdevops pcnet32: round off carrier watch timer i2400m/usb: wrap USB power saving in #ifdef CONFIG_PM wimax: testing for rfkill support should also test for CONFIG_RFKILL_MODULE wimax: fix kconfig interactions with rfkill and input layers wimax: fix '#ifndef CONFIG_BUG' layout to avoid warning r6040: bump release number to 0.20 r6040: warn about MAC address being unset r6040: check PHY status when bringing interface up r6040: make printks consistent with DRV_NAME gianfar: Fixup use of BUS_ID_SIZE mlx4_en: Returning real Max in get_ringparam mlx4_en: Consider inline packets on completion netdev: bfin_mac: enable bfin_mac net dev driver for BF51x qeth: convert to net_device_ops vlan: add neigh_setup dm9601: warn on invalid mac address ...
This commit is contained in:
commit
5fbbf5f648
123 changed files with 1826 additions and 10910 deletions
|
|
@ -830,7 +830,7 @@ config ULTRA32
|
|||
|
||||
config BFIN_MAC
|
||||
tristate "Blackfin on-chip MAC support"
|
||||
depends on NET_ETHERNET && (BF526 || BF527 || BF536 || BF537)
|
||||
depends on NET_ETHERNET && (BF516 || BF518 || BF526 || BF527 || BF536 || BF537)
|
||||
select CRC32
|
||||
select MII
|
||||
select PHYLIB
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1813,6 +1813,25 @@ static void __devinit amd8111e_probe_ext_phy(struct net_device* dev)
|
|||
lp->ext_phy_addr = 1;
|
||||
}
|
||||
|
||||
static const struct net_device_ops amd8111e_netdev_ops = {
|
||||
.ndo_open = amd8111e_open,
|
||||
.ndo_stop = amd8111e_close,
|
||||
.ndo_start_xmit = amd8111e_start_xmit,
|
||||
.ndo_tx_timeout = amd8111e_tx_timeout,
|
||||
.ndo_get_stats = amd8111e_get_stats,
|
||||
.ndo_set_multicast_list = amd8111e_set_multicast_list,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_set_mac_address = amd8111e_set_mac_address,
|
||||
.ndo_do_ioctl = amd8111e_ioctl,
|
||||
.ndo_change_mtu = amd8111e_change_mtu,
|
||||
#if AMD8111E_VLAN_TAG_USED
|
||||
.ndo_vlan_rx_register = amd8111e_vlan_rx_register,
|
||||
#endif
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = amd8111e_poll,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -1872,7 +1891,6 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
|
|||
|
||||
#if AMD8111E_VLAN_TAG_USED
|
||||
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ;
|
||||
dev->vlan_rx_register =amd8111e_vlan_rx_register;
|
||||
#endif
|
||||
|
||||
lp = netdev_priv(dev);
|
||||
|
|
@ -1901,27 +1919,16 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
|
|||
if(dynamic_ipg[card_idx++])
|
||||
lp->options |= OPTION_DYN_IPG_ENABLE;
|
||||
|
||||
|
||||
/* Initialize driver entry points */
|
||||
dev->open = amd8111e_open;
|
||||
dev->hard_start_xmit = amd8111e_start_xmit;
|
||||
dev->stop = amd8111e_close;
|
||||
dev->get_stats = amd8111e_get_stats;
|
||||
dev->set_multicast_list = amd8111e_set_multicast_list;
|
||||
dev->set_mac_address = amd8111e_set_mac_address;
|
||||
dev->do_ioctl = amd8111e_ioctl;
|
||||
dev->change_mtu = amd8111e_change_mtu;
|
||||
dev->netdev_ops = &amd8111e_netdev_ops;
|
||||
SET_ETHTOOL_OPS(dev, &ops);
|
||||
dev->irq =pdev->irq;
|
||||
dev->tx_timeout = amd8111e_tx_timeout;
|
||||
dev->watchdog_timeo = AMD8111E_TX_TIMEOUT;
|
||||
netif_napi_add(dev, &lp->napi, amd8111e_rx_poll, 32);
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = amd8111e_poll;
|
||||
#endif
|
||||
|
||||
#if AMD8111E_VLAN_TAG_USED
|
||||
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
|
||||
dev->vlan_rx_register =amd8111e_vlan_rx_register;
|
||||
#endif
|
||||
/* Probe the external PHY */
|
||||
amd8111e_probe_ext_phy(dev);
|
||||
|
|
|
|||
|
|
@ -48,12 +48,18 @@ static int ipddp_mode = IPDDP_DECAP;
|
|||
|
||||
/* Index to functions, as function prototypes. */
|
||||
static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
static struct net_device_stats *ipddp_get_stats(struct net_device *dev);
|
||||
static int ipddp_create(struct ipddp_route *new_rt);
|
||||
static int ipddp_delete(struct ipddp_route *rt);
|
||||
static struct ipddp_route* ipddp_find_route(struct ipddp_route *rt);
|
||||
static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
|
||||
|
||||
static const struct net_device_ops ipddp_netdev_ops = {
|
||||
.ndo_start_xmit = ipddp_xmit,
|
||||
.ndo_do_ioctl = ipddp_ioctl,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static struct net_device * __init ipddp_init(void)
|
||||
{
|
||||
|
|
@ -61,7 +67,7 @@ static struct net_device * __init ipddp_init(void)
|
|||
struct net_device *dev;
|
||||
int err;
|
||||
|
||||
dev = alloc_etherdev(sizeof(struct net_device_stats));
|
||||
dev = alloc_etherdev(0);
|
||||
if (!dev)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -71,9 +77,7 @@ static struct net_device * __init ipddp_init(void)
|
|||
printk(version);
|
||||
|
||||
/* Initalize the device structure. */
|
||||
dev->hard_start_xmit = ipddp_xmit;
|
||||
dev->get_stats = ipddp_get_stats;
|
||||
dev->do_ioctl = ipddp_ioctl;
|
||||
dev->netdev_ops = &ipddp_netdev_ops;
|
||||
|
||||
dev->type = ARPHRD_IPDDP; /* IP over DDP tunnel */
|
||||
dev->mtu = 585;
|
||||
|
|
@ -103,13 +107,6 @@ static struct net_device * __init ipddp_init(void)
|
|||
return dev;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the current statistics. This may be called with the card open or closed.
|
||||
*/
|
||||
static struct net_device_stats *ipddp_get_stats(struct net_device *dev)
|
||||
{
|
||||
return netdev_priv(dev);
|
||||
}
|
||||
|
||||
/*
|
||||
* Transmit LLAP/ELAP frame using aarp_send_ddp.
|
||||
|
|
@ -170,8 +167,8 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
|
||||
skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */
|
||||
|
||||
((struct net_device_stats *) netdev_priv(dev))->tx_packets++;
|
||||
((struct net_device_stats *) netdev_priv(dev))->tx_bytes += skb->len;
|
||||
dev->stats.tx_packets++;
|
||||
dev->stats.tx_bytes += skb->len;
|
||||
|
||||
if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0)
|
||||
dev_kfree_skb(skb);
|
||||
|
|
|
|||
|
|
@ -204,8 +204,7 @@ static irqreturn_t atp_interrupt(int irq, void *dev_id);
|
|||
static void net_rx(struct net_device *dev);
|
||||
static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode);
|
||||
static int net_close(struct net_device *dev);
|
||||
static void set_rx_mode_8002(struct net_device *dev);
|
||||
static void set_rx_mode_8012(struct net_device *dev);
|
||||
static void set_rx_mode(struct net_device *dev);
|
||||
static void tx_timeout(struct net_device *dev);
|
||||
|
||||
|
||||
|
|
@ -242,6 +241,17 @@ static int __init atp_init(void)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
static const struct net_device_ops atp_netdev_ops = {
|
||||
.ndo_open = net_open,
|
||||
.ndo_stop = net_close,
|
||||
.ndo_start_xmit = atp_send_packet,
|
||||
.ndo_set_multicast_list = set_rx_mode,
|
||||
.ndo_tx_timeout = tx_timeout,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __init atp_probe1(long ioaddr)
|
||||
{
|
||||
struct net_device *dev = NULL;
|
||||
|
|
@ -342,12 +352,7 @@ static int __init atp_probe1(long ioaddr)
|
|||
if (dev->mem_end & 0xf)
|
||||
net_debug = dev->mem_end & 7;
|
||||
|
||||
dev->open = net_open;
|
||||
dev->stop = net_close;
|
||||
dev->hard_start_xmit = atp_send_packet;
|
||||
dev->set_multicast_list =
|
||||
lp->chip_type == RTL8002 ? &set_rx_mode_8002 : &set_rx_mode_8012;
|
||||
dev->tx_timeout = tx_timeout;
|
||||
dev->netdev_ops = &atp_netdev_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
|
||||
res = register_netdev(dev);
|
||||
|
|
@ -903,6 +908,17 @@ static void set_rx_mode_8012(struct net_device *dev)
|
|||
write_reg(ioaddr, CMR2, CMR2_IRQOUT); /* Switch back to page 0 */
|
||||
}
|
||||
|
||||
static void set_rx_mode(struct net_device *dev)
|
||||
{
|
||||
struct net_local *lp = netdev_priv(dev);
|
||||
|
||||
if (lp->chip_type == RTL8002)
|
||||
return set_rx_mode_8002(dev);
|
||||
else
|
||||
return set_rx_mode_8012(dev);
|
||||
}
|
||||
|
||||
|
||||
static int __init atp_init_module(void) {
|
||||
if (debug) /* Emit version even if no cards detected. */
|
||||
printk(KERN_INFO "%s", version);
|
||||
|
|
|
|||
|
|
@ -2108,6 +2108,22 @@ static int __devinit b44_get_invariants(struct b44 *bp)
|
|||
return err;
|
||||
}
|
||||
|
||||
static const struct net_device_ops b44_netdev_ops = {
|
||||
.ndo_open = b44_open,
|
||||
.ndo_stop = b44_close,
|
||||
.ndo_start_xmit = b44_start_xmit,
|
||||
.ndo_get_stats = b44_get_stats,
|
||||
.ndo_set_multicast_list = b44_set_rx_mode,
|
||||
.ndo_set_mac_address = b44_set_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_do_ioctl = b44_ioctl,
|
||||
.ndo_tx_timeout = b44_tx_timeout,
|
||||
.ndo_change_mtu = b44_change_mtu,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = b44_poll_controller,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __devinit b44_init_one(struct ssb_device *sdev,
|
||||
const struct ssb_device_id *ent)
|
||||
{
|
||||
|
|
@ -2145,20 +2161,9 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
|
|||
bp->rx_pending = B44_DEF_RX_RING_PENDING;
|
||||
bp->tx_pending = B44_DEF_TX_RING_PENDING;
|
||||
|
||||
dev->open = b44_open;
|
||||
dev->stop = b44_close;
|
||||
dev->hard_start_xmit = b44_start_xmit;
|
||||
dev->get_stats = b44_get_stats;
|
||||
dev->set_multicast_list = b44_set_rx_mode;
|
||||
dev->set_mac_address = b44_set_mac_addr;
|
||||
dev->do_ioctl = b44_ioctl;
|
||||
dev->tx_timeout = b44_tx_timeout;
|
||||
dev->netdev_ops = &b44_netdev_ops;
|
||||
netif_napi_add(dev, &bp->napi, b44_poll, 64);
|
||||
dev->watchdog_timeo = B44_TX_TIMEOUT;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = b44_poll_controller;
|
||||
#endif
|
||||
dev->change_mtu = b44_change_mtu;
|
||||
dev->irq = sdev->irq;
|
||||
SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);
|
||||
|
||||
|
|
|
|||
|
|
@ -8243,6 +8243,9 @@ static int bnx2x_set_eeprom(struct net_device *dev,
|
|||
struct bnx2x *bp = netdev_priv(dev);
|
||||
int rc;
|
||||
|
||||
if (!netif_running(dev))
|
||||
return -EAGAIN;
|
||||
|
||||
DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
|
||||
DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n",
|
||||
eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset,
|
||||
|
|
|
|||
|
|
@ -4148,7 +4148,7 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
|
|||
|
||||
bond_for_each_slave(bond, slave, i) {
|
||||
pr_debug("s %p s->p %p c_m %p\n", slave,
|
||||
slave->prev, slave->dev->change_mtu);
|
||||
slave->prev, slave->dev->netdev_ops->ndo_change_mtu);
|
||||
|
||||
res = dev_set_mtu(slave->dev, new_mtu);
|
||||
|
||||
|
|
|
|||
|
|
@ -4977,6 +4977,22 @@ static void __devinit cas_program_bridge(struct pci_dev *cas_pdev)
|
|||
pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xff);
|
||||
}
|
||||
|
||||
static const struct net_device_ops cas_netdev_ops = {
|
||||
.ndo_open = cas_open,
|
||||
.ndo_stop = cas_close,
|
||||
.ndo_start_xmit = cas_start_xmit,
|
||||
.ndo_get_stats = cas_get_stats,
|
||||
.ndo_set_multicast_list = cas_set_multicast,
|
||||
.ndo_do_ioctl = cas_ioctl,
|
||||
.ndo_tx_timeout = cas_tx_timeout,
|
||||
.ndo_change_mtu = cas_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = cas_netpoll,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __devinit cas_init_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -5166,21 +5182,12 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
|
|||
for (i = 0; i < N_RX_FLOWS; i++)
|
||||
skb_queue_head_init(&cp->rx_flows[i]);
|
||||
|
||||
dev->open = cas_open;
|
||||
dev->stop = cas_close;
|
||||
dev->hard_start_xmit = cas_start_xmit;
|
||||
dev->get_stats = cas_get_stats;
|
||||
dev->set_multicast_list = cas_set_multicast;
|
||||
dev->do_ioctl = cas_ioctl;
|
||||
dev->netdev_ops = &cas_netdev_ops;
|
||||
dev->ethtool_ops = &cas_ethtool_ops;
|
||||
dev->tx_timeout = cas_tx_timeout;
|
||||
dev->watchdog_timeo = CAS_TX_TIMEOUT;
|
||||
dev->change_mtu = cas_change_mtu;
|
||||
|
||||
#ifdef USE_NAPI
|
||||
netif_napi_add(dev, &cp->napi, cas_poll, 64);
|
||||
#endif
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = cas_netpoll;
|
||||
#endif
|
||||
dev->irq = pdev->irq;
|
||||
dev->dma = 0;
|
||||
|
|
|
|||
|
|
@ -378,6 +378,16 @@ static void de600_rx_intr(struct net_device *dev)
|
|||
*/
|
||||
}
|
||||
|
||||
static const struct net_device_ops de600_netdev_ops = {
|
||||
.ndo_open = de600_open,
|
||||
.ndo_stop = de600_close,
|
||||
.ndo_start_xmit = de600_start_xmit,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
|
||||
static struct net_device * __init de600_probe(void)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -439,9 +449,7 @@ static struct net_device * __init de600_probe(void)
|
|||
|
||||
printk(", Ethernet Address: %pM\n", dev->dev_addr);
|
||||
|
||||
dev->open = de600_open;
|
||||
dev->stop = de600_close;
|
||||
dev->hard_start_xmit = &de600_start_xmit;
|
||||
dev->netdev_ops = &de600_netdev_ops;
|
||||
|
||||
dev->flags&=~IFF_MULTICAST;
|
||||
|
||||
|
|
|
|||
|
|
@ -784,6 +784,17 @@ static int adapter_init(struct net_device *dev)
|
|||
return 0; /* all ok */
|
||||
}
|
||||
|
||||
static const struct net_device_ops de620_netdev_ops = {
|
||||
.ndo_open = de620_open,
|
||||
.ndo_stop = de620_close,
|
||||
.ndo_start_xmit = de620_start_xmit,
|
||||
.ndo_tx_timeout = de620_timeout,
|
||||
.ndo_set_multicast_list = de620_set_multicast_list,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Only start-up code below
|
||||
|
|
@ -861,12 +872,8 @@ struct net_device * __init de620_probe(int unit)
|
|||
else
|
||||
printk(" UTP)\n");
|
||||
|
||||
dev->open = de620_open;
|
||||
dev->stop = de620_close;
|
||||
dev->hard_start_xmit = de620_start_xmit;
|
||||
dev->tx_timeout = de620_timeout;
|
||||
dev->netdev_ops = &de620_netdev_ops;
|
||||
dev->watchdog_timeo = HZ*2;
|
||||
dev->set_multicast_list = de620_set_multicast_list;
|
||||
|
||||
/* base_addr and irq are already set, see above! */
|
||||
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@
|
|||
#include <linux/skbuff.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
|
||||
|
|
@ -174,10 +175,17 @@
|
|||
#define E100_WATCHDOG_PERIOD (2 * HZ)
|
||||
#define E100_NAPI_WEIGHT 16
|
||||
|
||||
#define FIRMWARE_D101M "e100/d101m_ucode.bin"
|
||||
#define FIRMWARE_D101S "e100/d101s_ucode.bin"
|
||||
#define FIRMWARE_D102E "e100/d102e_ucode.bin"
|
||||
|
||||
MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
||||
MODULE_AUTHOR(DRV_COPYRIGHT);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_VERSION);
|
||||
MODULE_FIRMWARE(FIRMWARE_D101M);
|
||||
MODULE_FIRMWARE(FIRMWARE_D101S);
|
||||
MODULE_FIRMWARE(FIRMWARE_D102E);
|
||||
|
||||
static int debug = 3;
|
||||
static int eeprom_bad_csum_allow = 0;
|
||||
|
|
@ -1049,178 +1057,6 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
|||
c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]);
|
||||
}
|
||||
|
||||
/********************************************************/
|
||||
/* Micro code for 8086:1229 Rev 8 */
|
||||
/********************************************************/
|
||||
|
||||
/* Parameter values for the D101M B-step */
|
||||
#define D101M_CPUSAVER_TIMER_DWORD 78
|
||||
#define D101M_CPUSAVER_BUNDLE_DWORD 65
|
||||
#define D101M_CPUSAVER_MIN_SIZE_DWORD 126
|
||||
|
||||
#define D101M_B_RCVBUNDLE_UCODE \
|
||||
{\
|
||||
0x00550215, 0xFFFF0437, 0xFFFFFFFF, 0x06A70789, 0xFFFFFFFF, 0x0558FFFF, \
|
||||
0x000C0001, 0x00101312, 0x000C0008, 0x00380216, \
|
||||
0x0010009C, 0x00204056, 0x002380CC, 0x00380056, \
|
||||
0x0010009C, 0x00244C0B, 0x00000800, 0x00124818, \
|
||||
0x00380438, 0x00000000, 0x00140000, 0x00380555, \
|
||||
0x00308000, 0x00100662, 0x00100561, 0x000E0408, \
|
||||
0x00134861, 0x000C0002, 0x00103093, 0x00308000, \
|
||||
0x00100624, 0x00100561, 0x000E0408, 0x00100861, \
|
||||
0x000C007E, 0x00222C21, 0x000C0002, 0x00103093, \
|
||||
0x00380C7A, 0x00080000, 0x00103090, 0x00380C7A, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x0010009C, 0x00244C2D, 0x00010004, 0x00041000, \
|
||||
0x003A0437, 0x00044010, 0x0038078A, 0x00000000, \
|
||||
0x00100099, 0x00206C7A, 0x0010009C, 0x00244C48, \
|
||||
0x00130824, 0x000C0001, 0x00101213, 0x00260C75, \
|
||||
0x00041000, 0x00010004, 0x00130826, 0x000C0006, \
|
||||
0x002206A8, 0x0013C926, 0x00101313, 0x003806A8, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00080600, 0x00101B10, 0x00050004, 0x00100826, \
|
||||
0x00101210, 0x00380C34, 0x00000000, 0x00000000, \
|
||||
0x0021155B, 0x00100099, 0x00206559, 0x0010009C, \
|
||||
0x00244559, 0x00130836, 0x000C0000, 0x00220C62, \
|
||||
0x000C0001, 0x00101B13, 0x00229C0E, 0x00210C0E, \
|
||||
0x00226C0E, 0x00216C0E, 0x0022FC0E, 0x00215C0E, \
|
||||
0x00214C0E, 0x00380555, 0x00010004, 0x00041000, \
|
||||
0x00278C67, 0x00040800, 0x00018100, 0x003A0437, \
|
||||
0x00130826, 0x000C0001, 0x00220559, 0x00101313, \
|
||||
0x00380559, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00130831, 0x0010090B, 0x00124813, \
|
||||
0x000CFF80, 0x002606AB, 0x00041000, 0x00010004, \
|
||||
0x003806A8, 0x00000000, 0x00000000, 0x00000000, \
|
||||
}
|
||||
|
||||
/********************************************************/
|
||||
/* Micro code for 8086:1229 Rev 9 */
|
||||
/********************************************************/
|
||||
|
||||
/* Parameter values for the D101S */
|
||||
#define D101S_CPUSAVER_TIMER_DWORD 78
|
||||
#define D101S_CPUSAVER_BUNDLE_DWORD 67
|
||||
#define D101S_CPUSAVER_MIN_SIZE_DWORD 128
|
||||
|
||||
#define D101S_RCVBUNDLE_UCODE \
|
||||
{\
|
||||
0x00550242, 0xFFFF047E, 0xFFFFFFFF, 0x06FF0818, 0xFFFFFFFF, 0x05A6FFFF, \
|
||||
0x000C0001, 0x00101312, 0x000C0008, 0x00380243, \
|
||||
0x0010009C, 0x00204056, 0x002380D0, 0x00380056, \
|
||||
0x0010009C, 0x00244F8B, 0x00000800, 0x00124818, \
|
||||
0x0038047F, 0x00000000, 0x00140000, 0x003805A3, \
|
||||
0x00308000, 0x00100610, 0x00100561, 0x000E0408, \
|
||||
0x00134861, 0x000C0002, 0x00103093, 0x00308000, \
|
||||
0x00100624, 0x00100561, 0x000E0408, 0x00100861, \
|
||||
0x000C007E, 0x00222FA1, 0x000C0002, 0x00103093, \
|
||||
0x00380F90, 0x00080000, 0x00103090, 0x00380F90, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x0010009C, 0x00244FAD, 0x00010004, 0x00041000, \
|
||||
0x003A047E, 0x00044010, 0x00380819, 0x00000000, \
|
||||
0x00100099, 0x00206FFD, 0x0010009A, 0x0020AFFD, \
|
||||
0x0010009C, 0x00244FC8, 0x00130824, 0x000C0001, \
|
||||
0x00101213, 0x00260FF7, 0x00041000, 0x00010004, \
|
||||
0x00130826, 0x000C0006, 0x00220700, 0x0013C926, \
|
||||
0x00101313, 0x00380700, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00080600, 0x00101B10, 0x00050004, 0x00100826, \
|
||||
0x00101210, 0x00380FB6, 0x00000000, 0x00000000, \
|
||||
0x002115A9, 0x00100099, 0x002065A7, 0x0010009A, \
|
||||
0x0020A5A7, 0x0010009C, 0x002445A7, 0x00130836, \
|
||||
0x000C0000, 0x00220FE4, 0x000C0001, 0x00101B13, \
|
||||
0x00229F8E, 0x00210F8E, 0x00226F8E, 0x00216F8E, \
|
||||
0x0022FF8E, 0x00215F8E, 0x00214F8E, 0x003805A3, \
|
||||
0x00010004, 0x00041000, 0x00278FE9, 0x00040800, \
|
||||
0x00018100, 0x003A047E, 0x00130826, 0x000C0001, \
|
||||
0x002205A7, 0x00101313, 0x003805A7, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00130831, \
|
||||
0x0010090B, 0x00124813, 0x000CFF80, 0x00260703, \
|
||||
0x00041000, 0x00010004, 0x00380700 \
|
||||
}
|
||||
|
||||
/********************************************************/
|
||||
/* Micro code for the 8086:1229 Rev F/10 */
|
||||
/********************************************************/
|
||||
|
||||
/* Parameter values for the D102 E-step */
|
||||
#define D102_E_CPUSAVER_TIMER_DWORD 42
|
||||
#define D102_E_CPUSAVER_BUNDLE_DWORD 54
|
||||
#define D102_E_CPUSAVER_MIN_SIZE_DWORD 46
|
||||
|
||||
#define D102_E_RCVBUNDLE_UCODE \
|
||||
{\
|
||||
0x007D028F, 0x0E4204F9, 0x14ED0C85, 0x14FA14E9, 0x0EF70E36, 0x1FFF1FFF, \
|
||||
0x00E014B9, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00E014BD, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00E014D5, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00E014C1, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00E014C8, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00200600, 0x00E014EE, 0x00000000, 0x00000000, \
|
||||
0x0030FF80, 0x00940E46, 0x00038200, 0x00102000, \
|
||||
0x00E00E43, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00300006, 0x00E014FB, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00906E41, 0x00800E3C, 0x00E00E39, 0x00000000, \
|
||||
0x00906EFD, 0x00900EFD, 0x00E00EF8, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
}
|
||||
|
||||
static void e100_setup_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static struct {
|
||||
u32 ucode[UCODE_SIZE + 1];
|
||||
u8 mac;
|
||||
u8 timer_dword;
|
||||
u8 bundle_dword;
|
||||
u8 min_size_dword;
|
||||
} ucode_opts[] = {
|
||||
{ D101M_B_RCVBUNDLE_UCODE,
|
||||
mac_82559_D101M,
|
||||
D101M_CPUSAVER_TIMER_DWORD,
|
||||
D101M_CPUSAVER_BUNDLE_DWORD,
|
||||
D101M_CPUSAVER_MIN_SIZE_DWORD },
|
||||
{ D101S_RCVBUNDLE_UCODE,
|
||||
mac_82559_D101S,
|
||||
D101S_CPUSAVER_TIMER_DWORD,
|
||||
D101S_CPUSAVER_BUNDLE_DWORD,
|
||||
D101S_CPUSAVER_MIN_SIZE_DWORD },
|
||||
{ D102_E_RCVBUNDLE_UCODE,
|
||||
mac_82551_F,
|
||||
D102_E_CPUSAVER_TIMER_DWORD,
|
||||
D102_E_CPUSAVER_BUNDLE_DWORD,
|
||||
D102_E_CPUSAVER_MIN_SIZE_DWORD },
|
||||
{ D102_E_RCVBUNDLE_UCODE,
|
||||
mac_82551_10,
|
||||
D102_E_CPUSAVER_TIMER_DWORD,
|
||||
D102_E_CPUSAVER_BUNDLE_DWORD,
|
||||
D102_E_CPUSAVER_MIN_SIZE_DWORD },
|
||||
{ {0}, 0, 0, 0, 0}
|
||||
}, *opts;
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/*************************************************************************
|
||||
* CPUSaver parameters
|
||||
*
|
||||
|
|
@ -1280,42 +1116,101 @@ static void e100_setup_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb
|
|||
#define BUNDLEMAX (u16)6
|
||||
#define INTDELAY (u16)1536 /* 0x600 */
|
||||
|
||||
/* Initialize firmware */
|
||||
static const struct firmware *e100_request_firmware(struct nic *nic)
|
||||
{
|
||||
const char *fw_name;
|
||||
const struct firmware *fw;
|
||||
u8 timer, bundle, min_size;
|
||||
int err;
|
||||
|
||||
/* do not load u-code for ICH devices */
|
||||
if (nic->flags & ich)
|
||||
goto noloaducode;
|
||||
return NULL;
|
||||
|
||||
/* Search for ucode match against h/w revision */
|
||||
for (opts = ucode_opts; opts->mac; opts++) {
|
||||
int i;
|
||||
u32 *ucode = opts->ucode;
|
||||
if (nic->mac != opts->mac)
|
||||
continue;
|
||||
if (nic->mac == mac_82559_D101M)
|
||||
fw_name = FIRMWARE_D101M;
|
||||
else if (nic->mac == mac_82559_D101S)
|
||||
fw_name = FIRMWARE_D101S;
|
||||
else if (nic->mac == mac_82551_F || nic->mac == mac_82551_10)
|
||||
fw_name = FIRMWARE_D102E;
|
||||
else /* No ucode on other devices */
|
||||
return NULL;
|
||||
|
||||
/* Insert user-tunable settings */
|
||||
ucode[opts->timer_dword] &= 0xFFFF0000;
|
||||
ucode[opts->timer_dword] |= INTDELAY;
|
||||
ucode[opts->bundle_dword] &= 0xFFFF0000;
|
||||
ucode[opts->bundle_dword] |= BUNDLEMAX;
|
||||
ucode[opts->min_size_dword] &= 0xFFFF0000;
|
||||
ucode[opts->min_size_dword] |= (BUNDLESMALL) ? 0xFFFF : 0xFF80;
|
||||
|
||||
for (i = 0; i < UCODE_SIZE; i++)
|
||||
cb->u.ucode[i] = cpu_to_le32(ucode[i]);
|
||||
cb->command = cpu_to_le16(cb_ucode | cb_el);
|
||||
return;
|
||||
err = request_firmware(&fw, fw_name, &nic->pdev->dev);
|
||||
if (err) {
|
||||
DPRINTK(PROBE, ERR, "Failed to load firmware \"%s\": %d\n",
|
||||
fw_name, err);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
/* Firmware should be precisely UCODE_SIZE (words) plus three bytes
|
||||
indicating the offsets for BUNDLESMALL, BUNDLEMAX, INTDELAY */
|
||||
if (fw->size != UCODE_SIZE * 4 + 3) {
|
||||
DPRINTK(PROBE, ERR, "Firmware \"%s\" has wrong size %zu\n",
|
||||
fw_name, fw->size);
|
||||
release_firmware(fw);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
noloaducode:
|
||||
cb->command = cpu_to_le16(cb_nop | cb_el);
|
||||
/* Read timer, bundle and min_size from end of firmware blob */
|
||||
timer = fw->data[UCODE_SIZE * 4];
|
||||
bundle = fw->data[UCODE_SIZE * 4 + 1];
|
||||
min_size = fw->data[UCODE_SIZE * 4 + 2];
|
||||
|
||||
if (timer >= UCODE_SIZE || bundle >= UCODE_SIZE ||
|
||||
min_size >= UCODE_SIZE) {
|
||||
DPRINTK(PROBE, ERR,
|
||||
"\"%s\" has bogus offset values (0x%x,0x%x,0x%x)\n",
|
||||
fw_name, timer, bundle, min_size);
|
||||
release_firmware(fw);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
/* OK, firmware is validated and ready to use... */
|
||||
return fw;
|
||||
}
|
||||
|
||||
static inline int e100_exec_cb_wait(struct nic *nic, struct sk_buff *skb,
|
||||
void (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *))
|
||||
static void e100_setup_ucode(struct nic *nic, struct cb *cb,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
const struct firmware *fw = (void *)skb;
|
||||
u8 timer, bundle, min_size;
|
||||
|
||||
/* It's not a real skb; we just abused the fact that e100_exec_cb
|
||||
will pass it through to here... */
|
||||
cb->skb = NULL;
|
||||
|
||||
/* firmware is stored as little endian already */
|
||||
memcpy(cb->u.ucode, fw->data, UCODE_SIZE * 4);
|
||||
|
||||
/* Read timer, bundle and min_size from end of firmware blob */
|
||||
timer = fw->data[UCODE_SIZE * 4];
|
||||
bundle = fw->data[UCODE_SIZE * 4 + 1];
|
||||
min_size = fw->data[UCODE_SIZE * 4 + 2];
|
||||
|
||||
/* Insert user-tunable settings in cb->u.ucode */
|
||||
cb->u.ucode[timer] &= cpu_to_le32(0xFFFF0000);
|
||||
cb->u.ucode[timer] |= cpu_to_le32(INTDELAY);
|
||||
cb->u.ucode[bundle] &= cpu_to_le32(0xFFFF0000);
|
||||
cb->u.ucode[bundle] |= cpu_to_le32(BUNDLEMAX);
|
||||
cb->u.ucode[min_size] &= cpu_to_le32(0xFFFF0000);
|
||||
cb->u.ucode[min_size] |= cpu_to_le32((BUNDLESMALL) ? 0xFFFF : 0xFF80);
|
||||
|
||||
cb->command = cpu_to_le16(cb_ucode | cb_el);
|
||||
}
|
||||
|
||||
static inline int e100_load_ucode_wait(struct nic *nic)
|
||||
{
|
||||
const struct firmware *fw;
|
||||
int err = 0, counter = 50;
|
||||
struct cb *cb = nic->cb_to_clean;
|
||||
|
||||
if ((err = e100_exec_cb(nic, NULL, e100_setup_ucode)))
|
||||
fw = e100_request_firmware(nic);
|
||||
/* If it's NULL, then no ucode is required */
|
||||
if (!fw || IS_ERR(fw))
|
||||
return PTR_ERR(fw);
|
||||
|
||||
if ((err = e100_exec_cb(nic, (void *)fw, e100_setup_ucode)))
|
||||
DPRINTK(PROBE,ERR, "ucode cmd failed with error %d\n", err);
|
||||
|
||||
/* must restart cuc */
|
||||
|
|
@ -1435,7 +1330,7 @@ static int e100_hw_init(struct nic *nic)
|
|||
return err;
|
||||
if ((err = e100_exec_cmd(nic, ruc_load_base, 0)))
|
||||
return err;
|
||||
if ((err = e100_exec_cb_wait(nic, NULL, e100_setup_ucode)))
|
||||
if ((err = e100_load_ucode_wait(nic)))
|
||||
return err;
|
||||
if ((err = e100_exec_cb(nic, NULL, e100_configure)))
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ u64 ehea_h_alloc_resource_qp(const u64 adapter_handle,
|
|||
u64 *qp_handle, struct h_epas *h_epas)
|
||||
{
|
||||
u64 hret;
|
||||
u64 outs[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
|
||||
|
||||
u64 allocate_controls =
|
||||
EHEA_BMASK_SET(H_ALL_RES_QP_EQPO, init_attr->low_lat_rq1 ? 1 : 0)
|
||||
|
|
@ -312,7 +312,7 @@ u64 ehea_h_alloc_resource_cq(const u64 adapter_handle,
|
|||
u64 *cq_handle, struct h_epas *epas)
|
||||
{
|
||||
u64 hret;
|
||||
u64 outs[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
|
||||
|
||||
hret = ehea_plpar_hcall9(H_ALLOC_HEA_RESOURCE,
|
||||
outs,
|
||||
|
|
@ -374,7 +374,7 @@ u64 ehea_h_alloc_resource_eq(const u64 adapter_handle,
|
|||
struct ehea_eq_attr *eq_attr, u64 *eq_handle)
|
||||
{
|
||||
u64 hret, allocate_controls;
|
||||
u64 outs[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
|
||||
|
||||
/* resource type */
|
||||
allocate_controls =
|
||||
|
|
@ -407,7 +407,7 @@ u64 ehea_h_modify_ehea_qp(const u64 adapter_handle, const u8 cat,
|
|||
u16 *out_swr, u16 *out_rwr)
|
||||
{
|
||||
u64 hret;
|
||||
u64 outs[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
|
||||
|
||||
hret = ehea_plpar_hcall9(H_MODIFY_HEA_QP,
|
||||
outs,
|
||||
|
|
@ -449,7 +449,7 @@ u64 ehea_h_register_smr(const u64 adapter_handle, const u64 orig_mr_handle,
|
|||
struct ehea_mr *mr)
|
||||
{
|
||||
u64 hret;
|
||||
u64 outs[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
|
||||
|
||||
hret = ehea_plpar_hcall9(H_REGISTER_SMR,
|
||||
outs,
|
||||
|
|
@ -468,7 +468,7 @@ u64 ehea_h_register_smr(const u64 adapter_handle, const u64 orig_mr_handle,
|
|||
|
||||
u64 ehea_h_disable_and_get_hea(const u64 adapter_handle, const u64 qp_handle)
|
||||
{
|
||||
u64 outs[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
|
||||
|
||||
return ehea_plpar_hcall9(H_DISABLE_AND_GET_HEA,
|
||||
outs,
|
||||
|
|
@ -493,7 +493,7 @@ u64 ehea_h_alloc_resource_mr(const u64 adapter_handle, const u64 vaddr,
|
|||
const u32 pd, u64 *mr_handle, u32 *lkey)
|
||||
{
|
||||
u64 hret;
|
||||
u64 outs[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
|
||||
|
||||
hret = ehea_plpar_hcall9(H_ALLOC_HEA_RESOURCE,
|
||||
outs,
|
||||
|
|
@ -564,7 +564,7 @@ u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num,
|
|||
const u8 cb_cat, const u64 select_mask,
|
||||
void *cb_addr)
|
||||
{
|
||||
u64 outs[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long outs[PLPAR_HCALL9_BUFSIZE];
|
||||
u64 port_info;
|
||||
u64 arr_index = 0;
|
||||
u64 cb_logaddr = virt_to_abs(cb_addr);
|
||||
|
|
|
|||
|
|
@ -1531,6 +1531,17 @@ static int enc28j60_chipset_init(struct net_device *dev)
|
|||
return enc28j60_hw_init(priv);
|
||||
}
|
||||
|
||||
static const struct net_device_ops enc28j60_netdev_ops = {
|
||||
.ndo_open = enc28j60_net_open,
|
||||
.ndo_stop = enc28j60_net_close,
|
||||
.ndo_start_xmit = enc28j60_send_packet,
|
||||
.ndo_set_multicast_list = enc28j60_set_multicast_list,
|
||||
.ndo_set_mac_address = enc28j60_set_mac_address,
|
||||
.ndo_tx_timeout = enc28j60_tx_timeout,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit enc28j60_probe(struct spi_device *spi)
|
||||
{
|
||||
struct net_device *dev;
|
||||
|
|
@ -1585,12 +1596,7 @@ static int __devinit enc28j60_probe(struct spi_device *spi)
|
|||
|
||||
dev->if_port = IF_PORT_10BASET;
|
||||
dev->irq = spi->irq;
|
||||
dev->open = enc28j60_net_open;
|
||||
dev->stop = enc28j60_net_close;
|
||||
dev->hard_start_xmit = enc28j60_send_packet;
|
||||
dev->set_multicast_list = &enc28j60_set_multicast_list;
|
||||
dev->set_mac_address = enc28j60_set_mac_address;
|
||||
dev->tx_timeout = &enc28j60_tx_timeout;
|
||||
dev->netdev_ops = &enc28j60_netdev_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
SET_ETHTOOL_OPS(dev, &enc28j60_ethtool_ops);
|
||||
|
||||
|
|
|
|||
|
|
@ -308,7 +308,18 @@ static int epic_close(struct net_device *dev);
|
|||
static struct net_device_stats *epic_get_stats(struct net_device *dev);
|
||||
static void set_rx_mode(struct net_device *dev);
|
||||
|
||||
|
||||
static const struct net_device_ops epic_netdev_ops = {
|
||||
.ndo_open = epic_open,
|
||||
.ndo_stop = epic_close,
|
||||
.ndo_start_xmit = epic_start_xmit,
|
||||
.ndo_tx_timeout = epic_tx_timeout,
|
||||
.ndo_get_stats = epic_get_stats,
|
||||
.ndo_set_multicast_list = set_rx_mode,
|
||||
.ndo_do_ioctl = netdev_ioctl,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit epic_init_one (struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
|
|
@ -483,15 +494,9 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
|
|||
dev->if_port = ep->default_port = option;
|
||||
|
||||
/* The Epic-specific entries in the device structure. */
|
||||
dev->open = &epic_open;
|
||||
dev->hard_start_xmit = &epic_start_xmit;
|
||||
dev->stop = &epic_close;
|
||||
dev->get_stats = &epic_get_stats;
|
||||
dev->set_multicast_list = &set_rx_mode;
|
||||
dev->do_ioctl = &netdev_ioctl;
|
||||
dev->netdev_ops = &epic_netdev_ops;
|
||||
dev->ethtool_ops = &netdev_ethtool_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
dev->tx_timeout = &epic_tx_timeout;
|
||||
netif_napi_add(dev, &ep->napi, epic_poll, 64);
|
||||
|
||||
ret = register_netdev(dev);
|
||||
|
|
|
|||
|
|
@ -467,6 +467,18 @@ static void stop_nic_rxtx(void __iomem *ioaddr, long crvalue)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct net_device_ops netdev_ops = {
|
||||
.ndo_open = netdev_open,
|
||||
.ndo_stop = netdev_close,
|
||||
.ndo_start_xmit = start_tx,
|
||||
.ndo_get_stats = get_stats,
|
||||
.ndo_set_multicast_list = set_rx_mode,
|
||||
.ndo_do_ioctl = mii_ioctl,
|
||||
.ndo_tx_timeout = fealnx_tx_timeout,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit fealnx_init_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
|
|
@ -649,15 +661,8 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
|
|||
np->mii.force_media = 1;
|
||||
}
|
||||
|
||||
/* The chip-specific entries in the device structure. */
|
||||
dev->open = &netdev_open;
|
||||
dev->hard_start_xmit = &start_tx;
|
||||
dev->stop = &netdev_close;
|
||||
dev->get_stats = &get_stats;
|
||||
dev->set_multicast_list = &set_rx_mode;
|
||||
dev->do_ioctl = &mii_ioctl;
|
||||
dev->netdev_ops = &netdev_ops;
|
||||
dev->ethtool_ops = &netdev_ethtool_ops;
|
||||
dev->tx_timeout = &fealnx_tx_timeout;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
|
||||
err = register_netdev(dev);
|
||||
|
|
|
|||
|
|
@ -238,8 +238,8 @@ static int gfar_of_init(struct net_device *dev)
|
|||
goto err_out;
|
||||
}
|
||||
|
||||
snprintf(priv->phy_bus_id, BUS_ID_SIZE, PHY_ID_FMT, "0",
|
||||
fixed_link[0]);
|
||||
snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id),
|
||||
PHY_ID_FMT, "0", fixed_link[0]);
|
||||
} else {
|
||||
phy = of_find_node_by_phandle(*ph);
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ static int gfar_of_init(struct net_device *dev)
|
|||
of_node_put(mdio);
|
||||
|
||||
gfar_mdio_bus_name(bus_name, mdio);
|
||||
snprintf(priv->phy_bus_id, BUS_ID_SIZE, "%s:%02x",
|
||||
snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x",
|
||||
bus_name, *id);
|
||||
}
|
||||
|
||||
|
|
@ -1973,6 +1973,8 @@ static void adjust_link(struct net_device *dev)
|
|||
case 1000:
|
||||
tempval =
|
||||
((tempval & ~(MACCFG2_IF)) | MACCFG2_GMII);
|
||||
|
||||
ecntrl &= ~(ECNTRL_R100);
|
||||
break;
|
||||
case 100:
|
||||
case 10:
|
||||
|
|
|
|||
|
|
@ -425,6 +425,28 @@ struct net_device * __init hp100_probe(int unit)
|
|||
}
|
||||
#endif /* !MODULE && CONFIG_ISA */
|
||||
|
||||
static const struct net_device_ops hp100_bm_netdev_ops = {
|
||||
.ndo_open = hp100_open,
|
||||
.ndo_stop = hp100_close,
|
||||
.ndo_start_xmit = hp100_start_xmit_bm,
|
||||
.ndo_get_stats = hp100_get_stats,
|
||||
.ndo_set_multicast_list = hp100_set_multicast_list,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static const struct net_device_ops hp100_netdev_ops = {
|
||||
.ndo_open = hp100_open,
|
||||
.ndo_stop = hp100_close,
|
||||
.ndo_start_xmit = hp100_start_xmit,
|
||||
.ndo_get_stats = hp100_get_stats,
|
||||
.ndo_set_multicast_list = hp100_set_multicast_list,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
|
||||
u_char bus, struct pci_dev *pci_dev)
|
||||
{
|
||||
|
|
@ -657,16 +679,10 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
|
|||
lp->virt_memory_size = virt_memory_size;
|
||||
lp->rx_ratio = hp100_rx_ratio; /* can be conf'd with insmod */
|
||||
|
||||
dev->open = hp100_open;
|
||||
dev->stop = hp100_close;
|
||||
|
||||
if (lp->mode == 1) /* busmaster */
|
||||
dev->hard_start_xmit = hp100_start_xmit_bm;
|
||||
dev->netdev_ops = &hp100_bm_netdev_ops;
|
||||
else
|
||||
dev->hard_start_xmit = hp100_start_xmit;
|
||||
|
||||
dev->get_stats = hp100_get_stats;
|
||||
dev->set_multicast_list = &hp100_set_multicast_list;
|
||||
dev->netdev_ops = &hp100_netdev_ops;
|
||||
|
||||
/* Ask the card for which IRQ line it is configured */
|
||||
if (bus == HP100_BUS_PCI) {
|
||||
|
|
|
|||
|
|
@ -754,7 +754,7 @@ static int ibmveth_set_csum_offload(struct net_device *dev, u32 data,
|
|||
void (*done) (struct net_device *, u32))
|
||||
{
|
||||
struct ibmveth_adapter *adapter = netdev_priv(dev);
|
||||
u64 set_attr, clr_attr, ret_attr;
|
||||
unsigned long set_attr, clr_attr, ret_attr;
|
||||
long ret;
|
||||
int rc1 = 0, rc2 = 0;
|
||||
int restart = 0;
|
||||
|
|
@ -1209,7 +1209,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
|
|||
long ret;
|
||||
struct net_device *netdev;
|
||||
struct ibmveth_adapter *adapter;
|
||||
u64 set_attr, ret_attr;
|
||||
unsigned long set_attr, ret_attr;
|
||||
|
||||
unsigned char *mac_addr_p;
|
||||
unsigned int *mcastFilterSize_p;
|
||||
|
|
|
|||
|
|
@ -39,11 +39,11 @@
|
|||
#define IbmVethMcastRemoveFilter 0x2UL
|
||||
#define IbmVethMcastClearFilterTable 0x3UL
|
||||
|
||||
#define IBMVETH_ILLAN_PADDED_PKT_CSUM 0x0000000000002000ULL
|
||||
#define IBMVETH_ILLAN_TRUNK_PRI_MASK 0x0000000000000F00ULL
|
||||
#define IBMVETH_ILLAN_IPV6_TCP_CSUM 0x0000000000000004ULL
|
||||
#define IBMVETH_ILLAN_IPV4_TCP_CSUM 0x0000000000000002ULL
|
||||
#define IBMVETH_ILLAN_ACTIVE_TRUNK 0x0000000000000001ULL
|
||||
#define IBMVETH_ILLAN_PADDED_PKT_CSUM 0x0000000000002000UL
|
||||
#define IBMVETH_ILLAN_TRUNK_PRI_MASK 0x0000000000000F00UL
|
||||
#define IBMVETH_ILLAN_IPV6_TCP_CSUM 0x0000000000000004UL
|
||||
#define IBMVETH_ILLAN_IPV4_TCP_CSUM 0x0000000000000002UL
|
||||
#define IBMVETH_ILLAN_ACTIVE_TRUNK 0x0000000000000001UL
|
||||
|
||||
/* hcall macros */
|
||||
#define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \
|
||||
|
|
|
|||
|
|
@ -2210,6 +2210,19 @@ static void __devexit ipg_remove(struct pci_dev *pdev)
|
|||
pci_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static const struct net_device_ops ipg_netdev_ops = {
|
||||
.ndo_open = ipg_nic_open,
|
||||
.ndo_stop = ipg_nic_stop,
|
||||
.ndo_start_xmit = ipg_nic_hard_start_xmit,
|
||||
.ndo_get_stats = ipg_nic_get_stats,
|
||||
.ndo_set_multicast_list = ipg_nic_set_multicast_list,
|
||||
.ndo_do_ioctl = ipg_ioctl,
|
||||
.ndo_tx_timeout = ipg_tx_timeout,
|
||||
.ndo_change_mtu = ipg_nic_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit ipg_probe(struct pci_dev *pdev,
|
||||
const struct pci_device_id *id)
|
||||
{
|
||||
|
|
@ -2258,15 +2271,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
|
|||
|
||||
/* Declare IPG NIC functions for Ethernet device methods.
|
||||
*/
|
||||
dev->open = &ipg_nic_open;
|
||||
dev->stop = &ipg_nic_stop;
|
||||
dev->hard_start_xmit = &ipg_nic_hard_start_xmit;
|
||||
dev->get_stats = &ipg_nic_get_stats;
|
||||
dev->set_multicast_list = &ipg_nic_set_multicast_list;
|
||||
dev->do_ioctl = ipg_ioctl;
|
||||
dev->tx_timeout = ipg_tx_timeout;
|
||||
dev->change_mtu = &ipg_nic_change_mtu;
|
||||
|
||||
dev->netdev_ops = &ipg_netdev_ops;
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
SET_ETHTOOL_OPS(dev, &ipg_ethtool_ops);
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ static int ali_ircc_net_open(struct net_device *dev);
|
|||
static int ali_ircc_net_close(struct net_device *dev);
|
||||
static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud);
|
||||
static struct net_device_stats *ali_ircc_net_get_stats(struct net_device *dev);
|
||||
|
||||
/* SIR function */
|
||||
static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
|
|
@ -366,7 +365,6 @@ static int ali_ircc_open(int i, chipio_t *info)
|
|||
dev->open = ali_ircc_net_open;
|
||||
dev->stop = ali_ircc_net_close;
|
||||
dev->do_ioctl = ali_ircc_net_ioctl;
|
||||
dev->get_stats = ali_ircc_net_get_stats;
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err) {
|
||||
|
|
@ -876,7 +874,7 @@ static void ali_ircc_sir_receive(struct ali_ircc_cb *self)
|
|||
* async_unwrap_char will deliver all found frames
|
||||
*/
|
||||
do {
|
||||
async_unwrap_char(self->netdev, &self->stats, &self->rx_buff,
|
||||
async_unwrap_char(self->netdev, &self->netdev->stats, &self->rx_buff,
|
||||
inb(iobase+UART_RX));
|
||||
|
||||
/* Make sure we don't stay here too long */
|
||||
|
|
@ -943,7 +941,7 @@ static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self)
|
|||
netif_wake_queue(self->netdev);
|
||||
}
|
||||
|
||||
self->stats.tx_packets++;
|
||||
self->netdev->stats.tx_packets++;
|
||||
|
||||
/* Turn on receive interrupts */
|
||||
outb(UART_IER_RDI, iobase+UART_IER);
|
||||
|
|
@ -1467,7 +1465,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
self->tx_fifo.queue[self->tx_fifo.free].len = skb->len;
|
||||
self->tx_fifo.tail += skb->len;
|
||||
|
||||
self->stats.tx_bytes += skb->len;
|
||||
dev->stats.tx_bytes += skb->len;
|
||||
|
||||
skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start,
|
||||
skb->len);
|
||||
|
|
@ -1661,12 +1659,12 @@ static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self)
|
|||
|
||||
{
|
||||
IRDA_ERROR("%s(), ********* LSR_FRAME_ABORT *********\n", __func__);
|
||||
self->stats.tx_errors++;
|
||||
self->stats.tx_fifo_errors++;
|
||||
self->netdev->stats.tx_errors++;
|
||||
self->netdev->stats.tx_fifo_errors++;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->stats.tx_packets++;
|
||||
self->netdev->stats.tx_packets++;
|
||||
}
|
||||
|
||||
/* Check if we need to change the speed */
|
||||
|
|
@ -1831,35 +1829,35 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
|
|||
IRDA_DEBUG(0,"%s(), ************* RX Errors ************ \n", __func__ );
|
||||
|
||||
/* Skip frame */
|
||||
self->stats.rx_errors++;
|
||||
self->netdev->stats.rx_errors++;
|
||||
|
||||
self->rx_buff.data += len;
|
||||
|
||||
if (status & LSR_FIFO_UR)
|
||||
{
|
||||
self->stats.rx_frame_errors++;
|
||||
self->netdev->stats.rx_frame_errors++;
|
||||
IRDA_DEBUG(0,"%s(), ************* FIFO Errors ************ \n", __func__ );
|
||||
}
|
||||
if (status & LSR_FRAME_ERROR)
|
||||
{
|
||||
self->stats.rx_frame_errors++;
|
||||
self->netdev->stats.rx_frame_errors++;
|
||||
IRDA_DEBUG(0,"%s(), ************* FRAME Errors ************ \n", __func__ );
|
||||
}
|
||||
|
||||
if (status & LSR_CRC_ERROR)
|
||||
{
|
||||
self->stats.rx_crc_errors++;
|
||||
self->netdev->stats.rx_crc_errors++;
|
||||
IRDA_DEBUG(0,"%s(), ************* CRC Errors ************ \n", __func__ );
|
||||
}
|
||||
|
||||
if(self->rcvFramesOverflow)
|
||||
{
|
||||
self->stats.rx_frame_errors++;
|
||||
self->netdev->stats.rx_frame_errors++;
|
||||
IRDA_DEBUG(0,"%s(), ************* Overran DMA buffer ************ \n", __func__ );
|
||||
}
|
||||
if(len == 0)
|
||||
{
|
||||
self->stats.rx_frame_errors++;
|
||||
self->netdev->stats.rx_frame_errors++;
|
||||
IRDA_DEBUG(0,"%s(), ********** Receive Frame Size = 0 ********* \n", __func__ );
|
||||
}
|
||||
}
|
||||
|
|
@ -1910,7 +1908,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
|
|||
IRDA_WARNING("%s(), memory squeeze, "
|
||||
"dropping frame.\n",
|
||||
__func__);
|
||||
self->stats.rx_dropped++;
|
||||
self->netdev->stats.rx_dropped++;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1924,8 +1922,8 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
|
|||
|
||||
/* Move to next frame */
|
||||
self->rx_buff.data += len;
|
||||
self->stats.rx_bytes += len;
|
||||
self->stats.rx_packets++;
|
||||
self->netdev->stats.rx_bytes += len;
|
||||
self->netdev->stats.rx_packets++;
|
||||
|
||||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
|
|
@ -1994,7 +1992,7 @@ static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
self->tx_buff.len = async_wrap_skb(skb, self->tx_buff.data,
|
||||
self->tx_buff.truesize);
|
||||
|
||||
self->stats.tx_bytes += self->tx_buff.len;
|
||||
self->netdev->stats.tx_bytes += self->tx_buff.len;
|
||||
|
||||
/* Turn on transmit finished interrupt. Will fire immediately! */
|
||||
outb(UART_IER_THRI, iobase+UART_IER);
|
||||
|
|
@ -2111,17 +2109,6 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self)
|
|||
return status;
|
||||
}
|
||||
|
||||
static struct net_device_stats *ali_ircc_net_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct ali_ircc_cb *self = netdev_priv(dev);
|
||||
|
||||
IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
|
||||
|
||||
IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ );
|
||||
|
||||
return &self->stats;
|
||||
}
|
||||
|
||||
static int ali_ircc_suspend(struct platform_device *dev, pm_message_t state)
|
||||
{
|
||||
struct ali_ircc_cb *self = platform_get_drvdata(dev);
|
||||
|
|
|
|||
|
|
@ -191,7 +191,6 @@ struct ali_ircc_cb {
|
|||
struct tx_fifo tx_fifo; /* Info about frames to be transmitted */
|
||||
|
||||
struct net_device *netdev; /* Yes! we are some kind of netdevice */
|
||||
struct net_device_stats stats;
|
||||
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct qos_info qos; /* QoS capabilities for this device */
|
||||
|
|
|
|||
|
|
@ -107,7 +107,6 @@ struct au1k_private {
|
|||
iobuff_t rx_buff;
|
||||
|
||||
struct net_device *netdev;
|
||||
struct net_device_stats stats;
|
||||
|
||||
struct timeval stamp;
|
||||
struct timeval now;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ static int au1k_irda_hard_xmit(struct sk_buff *, struct net_device *);
|
|||
static int au1k_irda_rx(struct net_device *);
|
||||
static void au1k_irda_interrupt(int, void *);
|
||||
static void au1k_tx_timeout(struct net_device *);
|
||||
static struct net_device_stats *au1k_irda_stats(struct net_device *);
|
||||
static int au1k_irda_ioctl(struct net_device *, struct ifreq *, int);
|
||||
static int au1k_irda_set_speed(struct net_device *dev, int speed);
|
||||
|
||||
|
|
@ -213,7 +212,6 @@ static int au1k_irda_net_init(struct net_device *dev)
|
|||
dev->open = au1k_irda_start;
|
||||
dev->hard_start_xmit = au1k_irda_hard_xmit;
|
||||
dev->stop = au1k_irda_stop;
|
||||
dev->get_stats = au1k_irda_stats;
|
||||
dev->do_ioctl = au1k_irda_ioctl;
|
||||
dev->tx_timeout = au1k_tx_timeout;
|
||||
|
||||
|
|
@ -832,13 +830,6 @@ au1k_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static struct net_device_stats *au1k_irda_stats(struct net_device *dev)
|
||||
{
|
||||
struct au1k_private *aup = netdev_priv(dev);
|
||||
return &aup->stats;
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Pete Popov <[email protected]>");
|
||||
MODULE_DESCRIPTION("Au1000 IrDA Device Driver");
|
||||
|
||||
|
|
|
|||
|
|
@ -308,7 +308,6 @@ struct OboeRing
|
|||
struct toshoboe_cb
|
||||
{
|
||||
struct net_device *netdev; /* Yes! we are some kind of netdevice */
|
||||
struct net_device_stats stats;
|
||||
struct tty_driver ttydev;
|
||||
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ static int irda_usb_net_open(struct net_device *dev);
|
|||
static int irda_usb_net_close(struct net_device *dev);
|
||||
static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
static void irda_usb_net_timeout(struct net_device *dev);
|
||||
static struct net_device_stats *irda_usb_net_get_stats(struct net_device *dev);
|
||||
|
||||
/************************ TRANSMIT ROUTINES ************************/
|
||||
/*
|
||||
|
|
@ -525,13 +524,13 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
|
|||
/* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */
|
||||
if ((res = usb_submit_urb(urb, GFP_ATOMIC))) {
|
||||
IRDA_WARNING("%s(), failed Tx URB\n", __func__);
|
||||
self->stats.tx_errors++;
|
||||
netdev->stats.tx_errors++;
|
||||
/* Let USB recover : We will catch that in the watchdog */
|
||||
/*netif_start_queue(netdev);*/
|
||||
} else {
|
||||
/* Increment packet stats */
|
||||
self->stats.tx_packets++;
|
||||
self->stats.tx_bytes += skb->len;
|
||||
netdev->stats.tx_packets++;
|
||||
netdev->stats.tx_bytes += skb->len;
|
||||
|
||||
netdev->trans_start = jiffies;
|
||||
}
|
||||
|
|
@ -677,7 +676,7 @@ static void irda_usb_net_timeout(struct net_device *netdev)
|
|||
IRDA_DEBUG(0, "%s: Tx timed out, urb->status=%d, urb->transfer_flags=0x%04X\n", netdev->name, urb->status, urb->transfer_flags);
|
||||
|
||||
/* Increase error count */
|
||||
self->stats.tx_errors++;
|
||||
netdev->stats.tx_errors++;
|
||||
|
||||
#ifdef IU_BUG_KICK_TIMEOUT
|
||||
/* Can't be a bad idea to reset the speed ;-) - Jean II */
|
||||
|
|
@ -826,7 +825,7 @@ static void irda_usb_receive(struct urb *urb)
|
|||
if (urb->status != 0) {
|
||||
switch (urb->status) {
|
||||
case -EILSEQ:
|
||||
self->stats.rx_crc_errors++;
|
||||
self->netdev->stats.rx_crc_errors++;
|
||||
/* Also precursor to a hot-unplug on UHCI. */
|
||||
/* Fallthrough... */
|
||||
case -ECONNRESET:
|
||||
|
|
@ -839,7 +838,7 @@ static void irda_usb_receive(struct urb *urb)
|
|||
case -ETIME:
|
||||
/* Usually precursor to a hot-unplug on OHCI. */
|
||||
default:
|
||||
self->stats.rx_errors++;
|
||||
self->netdev->stats.rx_errors++;
|
||||
IRDA_DEBUG(0, "%s(), RX status %d, transfer_flags 0x%04X \n", __func__, urb->status, urb->transfer_flags);
|
||||
break;
|
||||
}
|
||||
|
|
@ -890,7 +889,7 @@ static void irda_usb_receive(struct urb *urb)
|
|||
IRDA_SKB_MAX_MTU);
|
||||
|
||||
if (!newskb) {
|
||||
self->stats.rx_dropped++;
|
||||
self->netdev->stats.rx_dropped++;
|
||||
/* We could deliver the current skb, but this would stall
|
||||
* the Rx path. Better drop the packet... Jean II */
|
||||
goto done;
|
||||
|
|
@ -927,8 +926,8 @@ static void irda_usb_receive(struct urb *urb)
|
|||
netif_rx(dataskb);
|
||||
|
||||
/* Keep stats up to date */
|
||||
self->stats.rx_bytes += len;
|
||||
self->stats.rx_packets++;
|
||||
self->netdev->stats.rx_bytes += len;
|
||||
self->netdev->stats.rx_packets++;
|
||||
|
||||
done:
|
||||
/* Note : at this point, the URB we've just received (urb)
|
||||
|
|
@ -1342,14 +1341,6 @@ static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
|||
}
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/*
|
||||
* Get device stats (for /proc/net/dev and ifconfig)
|
||||
*/
|
||||
static struct net_device_stats *irda_usb_net_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct irda_usb_cb *self = netdev_priv(dev);
|
||||
return &self->stats;
|
||||
}
|
||||
|
||||
/********************* IRDA CONFIG SUBROUTINES *********************/
|
||||
/*
|
||||
|
|
@ -1428,7 +1419,6 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
|
|||
netdev->watchdog_timeo = 250*HZ/1000; /* 250 ms > USB timeout */
|
||||
netdev->open = irda_usb_net_open;
|
||||
netdev->stop = irda_usb_net_close;
|
||||
netdev->get_stats = irda_usb_net_get_stats;
|
||||
netdev->do_ioctl = irda_usb_net_ioctl;
|
||||
|
||||
return register_netdev(netdev);
|
||||
|
|
|
|||
|
|
@ -152,7 +152,6 @@ struct irda_usb_cb {
|
|||
struct urb *speed_urb; /* URB used to send speed commands */
|
||||
|
||||
struct net_device *netdev; /* Yes! we are some kind of netdev. */
|
||||
struct net_device_stats stats;
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct qos_info qos;
|
||||
char *speed_buff; /* Buffer for speed changes */
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ struct kingsun_cb {
|
|||
struct usb_device *usbdev; /* init: probe_irda */
|
||||
struct net_device *netdev; /* network layer */
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct net_device_stats stats; /* network statistics */
|
||||
|
||||
struct qos_info qos;
|
||||
|
||||
__u8 *in_buf; /* receive buffer */
|
||||
|
|
@ -186,12 +186,12 @@ static int kingsun_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
|
|||
case -EPIPE:
|
||||
break;
|
||||
default:
|
||||
kingsun->stats.tx_errors++;
|
||||
netdev->stats.tx_errors++;
|
||||
netif_start_queue(netdev);
|
||||
}
|
||||
} else {
|
||||
kingsun->stats.tx_packets++;
|
||||
kingsun->stats.tx_bytes += skb->len;
|
||||
netdev->stats.tx_packets++;
|
||||
netdev->stats.tx_bytes += skb->len;
|
||||
}
|
||||
|
||||
dev_kfree_skb(skb);
|
||||
|
|
@ -232,7 +232,7 @@ static void kingsun_rcv_irq(struct urb *urb)
|
|||
if (bytes[0] >= 1 && bytes[0] < kingsun->max_rx) {
|
||||
for (i = 1; i <= bytes[0]; i++) {
|
||||
async_unwrap_char(kingsun->netdev,
|
||||
&kingsun->stats,
|
||||
&kingsun->netdev->stats,
|
||||
&kingsun->rx_buff, bytes[i]);
|
||||
}
|
||||
do_gettimeofday(&kingsun->rx_time);
|
||||
|
|
@ -418,15 +418,6 @@ static int kingsun_net_ioctl(struct net_device *netdev, struct ifreq *rq,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get device stats (for /proc/net/dev and ifconfig)
|
||||
*/
|
||||
static struct net_device_stats *
|
||||
kingsun_net_get_stats(struct net_device *netdev)
|
||||
{
|
||||
struct kingsun_cb *kingsun = netdev_priv(netdev);
|
||||
return &kingsun->stats;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine is called by the USB subsystem for each new device
|
||||
|
|
@ -532,7 +523,6 @@ static int kingsun_probe(struct usb_interface *intf,
|
|||
net->hard_start_xmit = kingsun_hard_xmit;
|
||||
net->open = kingsun_net_open;
|
||||
net->stop = kingsun_net_close;
|
||||
net->get_stats = kingsun_net_get_stats;
|
||||
net->do_ioctl = kingsun_net_ioctl;
|
||||
|
||||
ret = register_netdev(net);
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ struct ks959_cb {
|
|||
struct usb_device *usbdev; /* init: probe_irda */
|
||||
struct net_device *netdev; /* network layer */
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct net_device_stats stats; /* network statistics */
|
||||
|
||||
struct qos_info qos;
|
||||
|
||||
struct usb_ctrlrequest *tx_setuprequest;
|
||||
|
|
@ -366,7 +366,7 @@ static void ks959_send_irq(struct urb *urb)
|
|||
case -EPIPE:
|
||||
break;
|
||||
default:
|
||||
kingsun->stats.tx_errors++;
|
||||
netdev->stats.tx_errors++;
|
||||
netif_start_queue(netdev);
|
||||
}
|
||||
}
|
||||
|
|
@ -416,12 +416,12 @@ static int ks959_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
|
|||
case -EPIPE:
|
||||
break;
|
||||
default:
|
||||
kingsun->stats.tx_errors++;
|
||||
netdev->stats.tx_errors++;
|
||||
netif_start_queue(netdev);
|
||||
}
|
||||
} else {
|
||||
kingsun->stats.tx_packets++;
|
||||
kingsun->stats.tx_bytes += skb->len;
|
||||
netdev->stats.tx_packets++;
|
||||
netdev->stats.tx_bytes += skb->len;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -469,7 +469,7 @@ static void ks959_rcv_irq(struct urb *urb)
|
|||
*/
|
||||
if (kingsun->rx_variable_xormask != 0) {
|
||||
async_unwrap_char(kingsun->netdev,
|
||||
&kingsun->stats,
|
||||
&kingsun->netdev->stats,
|
||||
&kingsun->rx_unwrap_buff,
|
||||
bytes[i]);
|
||||
}
|
||||
|
|
@ -668,15 +668,6 @@ static int ks959_net_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get device stats (for /proc/net/dev and ifconfig)
|
||||
*/
|
||||
static struct net_device_stats *ks959_net_get_stats(struct net_device *netdev)
|
||||
{
|
||||
struct ks959_cb *kingsun = netdev_priv(netdev);
|
||||
return &kingsun->stats;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine is called by the USB subsystem for each new device
|
||||
* in the system. We need to check if the device is ours, and in
|
||||
|
|
@ -792,7 +783,6 @@ static int ks959_probe(struct usb_interface *intf,
|
|||
net->hard_start_xmit = ks959_hard_xmit;
|
||||
net->open = ks959_net_open;
|
||||
net->stop = ks959_net_close;
|
||||
net->get_stats = ks959_net_get_stats;
|
||||
net->do_ioctl = ks959_net_ioctl;
|
||||
|
||||
ret = register_netdev(net);
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ struct ksdazzle_cb {
|
|||
struct usb_device *usbdev; /* init: probe_irda */
|
||||
struct net_device *netdev; /* network layer */
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct net_device_stats stats; /* network statistics */
|
||||
|
||||
struct qos_info qos;
|
||||
|
||||
struct urb *tx_urb;
|
||||
|
|
@ -278,7 +278,7 @@ static void ksdazzle_send_irq(struct urb *urb)
|
|||
case -EPIPE:
|
||||
break;
|
||||
default:
|
||||
kingsun->stats.tx_errors++;
|
||||
netdev->stats.tx_errors++;
|
||||
netif_start_queue(netdev);
|
||||
}
|
||||
}
|
||||
|
|
@ -329,12 +329,12 @@ static int ksdazzle_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
|
|||
case -EPIPE:
|
||||
break;
|
||||
default:
|
||||
kingsun->stats.tx_errors++;
|
||||
netdev->stats.tx_errors++;
|
||||
netif_start_queue(netdev);
|
||||
}
|
||||
} else {
|
||||
kingsun->stats.tx_packets++;
|
||||
kingsun->stats.tx_bytes += skb->len;
|
||||
netdev->stats.tx_packets++;
|
||||
netdev->stats.tx_bytes += skb->len;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -348,9 +348,10 @@ static int ksdazzle_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
|
|||
static void ksdazzle_rcv_irq(struct urb *urb)
|
||||
{
|
||||
struct ksdazzle_cb *kingsun = urb->context;
|
||||
struct net_device *netdev = kingsun->netdev;
|
||||
|
||||
/* in process of stopping, just drop data */
|
||||
if (!netif_running(kingsun->netdev)) {
|
||||
if (!netif_running(netdev)) {
|
||||
kingsun->receiving = 0;
|
||||
return;
|
||||
}
|
||||
|
|
@ -368,7 +369,7 @@ static void ksdazzle_rcv_irq(struct urb *urb)
|
|||
unsigned int i;
|
||||
|
||||
for (i = 0; i < urb->actual_length; i++) {
|
||||
async_unwrap_char(kingsun->netdev, &kingsun->stats,
|
||||
async_unwrap_char(netdev, &netdev->stats,
|
||||
&kingsun->rx_unwrap_buff, bytes[i]);
|
||||
}
|
||||
kingsun->receiving =
|
||||
|
|
@ -561,16 +562,6 @@ static int ksdazzle_net_ioctl(struct net_device *netdev, struct ifreq *rq,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get device stats (for /proc/net/dev and ifconfig)
|
||||
*/
|
||||
static struct net_device_stats *ksdazzle_net_get_stats(struct net_device
|
||||
*netdev)
|
||||
{
|
||||
struct ksdazzle_cb *kingsun = netdev_priv(netdev);
|
||||
return &kingsun->stats;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine is called by the USB subsystem for each new device
|
||||
* in the system. We need to check if the device is ours, and in
|
||||
|
|
@ -696,7 +687,6 @@ static int ksdazzle_probe(struct usb_interface *intf,
|
|||
net->hard_start_xmit = ksdazzle_hard_xmit;
|
||||
net->open = ksdazzle_net_open;
|
||||
net->stop = ksdazzle_net_close;
|
||||
net->get_stats = ksdazzle_net_get_stats;
|
||||
net->do_ioctl = ksdazzle_net_ioctl;
|
||||
|
||||
ret = register_netdev(net);
|
||||
|
|
|
|||
|
|
@ -403,8 +403,8 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
|
|||
if(unlikely(new_len <= 0)) {
|
||||
IRDA_ERROR("%s short frame length %d\n",
|
||||
mcs->netdev->name, new_len);
|
||||
++mcs->stats.rx_errors;
|
||||
++mcs->stats.rx_length_errors;
|
||||
++mcs->netdev->stats.rx_errors;
|
||||
++mcs->netdev->stats.rx_length_errors;
|
||||
return;
|
||||
}
|
||||
fcs = 0;
|
||||
|
|
@ -413,14 +413,14 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
|
|||
if(fcs != GOOD_FCS) {
|
||||
IRDA_ERROR("crc error calc 0x%x len %d\n",
|
||||
fcs, new_len);
|
||||
mcs->stats.rx_errors++;
|
||||
mcs->stats.rx_crc_errors++;
|
||||
mcs->netdev->stats.rx_errors++;
|
||||
mcs->netdev->stats.rx_crc_errors++;
|
||||
return;
|
||||
}
|
||||
|
||||
skb = dev_alloc_skb(new_len + 1);
|
||||
if(unlikely(!skb)) {
|
||||
++mcs->stats.rx_dropped;
|
||||
++mcs->netdev->stats.rx_dropped;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -433,8 +433,8 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
|
|||
|
||||
netif_rx(skb);
|
||||
|
||||
mcs->stats.rx_packets++;
|
||||
mcs->stats.rx_bytes += new_len;
|
||||
mcs->netdev->stats.rx_packets++;
|
||||
mcs->netdev->stats.rx_bytes += new_len;
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -458,22 +458,22 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
|
|||
if(unlikely(new_len <= 0)) {
|
||||
IRDA_ERROR("%s short frame length %d\n",
|
||||
mcs->netdev->name, new_len);
|
||||
++mcs->stats.rx_errors;
|
||||
++mcs->stats.rx_length_errors;
|
||||
++mcs->netdev->stats.rx_errors;
|
||||
++mcs->netdev->stats.rx_length_errors;
|
||||
return;
|
||||
}
|
||||
|
||||
fcs = ~(crc32_le(~0, buf, new_len));
|
||||
if(fcs != get_unaligned_le32(buf + new_len)) {
|
||||
IRDA_ERROR("crc error calc 0x%x len %d\n", fcs, new_len);
|
||||
mcs->stats.rx_errors++;
|
||||
mcs->stats.rx_crc_errors++;
|
||||
mcs->netdev->stats.rx_errors++;
|
||||
mcs->netdev->stats.rx_crc_errors++;
|
||||
return;
|
||||
}
|
||||
|
||||
skb = dev_alloc_skb(new_len + 1);
|
||||
if(unlikely(!skb)) {
|
||||
++mcs->stats.rx_dropped;
|
||||
++mcs->netdev->stats.rx_dropped;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -486,8 +486,8 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
|
|||
|
||||
netif_rx(skb);
|
||||
|
||||
mcs->stats.rx_packets++;
|
||||
mcs->stats.rx_bytes += new_len;
|
||||
mcs->netdev->stats.rx_packets++;
|
||||
mcs->netdev->stats.rx_bytes += new_len;
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -756,14 +756,6 @@ static int mcs_net_open(struct net_device *netdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Get device stats for /proc/net/dev and ifconfig */
|
||||
static struct net_device_stats *mcs_net_get_stats(struct net_device *netdev)
|
||||
{
|
||||
struct mcs_cb *mcs = netdev_priv(netdev);
|
||||
return &mcs->stats;
|
||||
}
|
||||
|
||||
/* Receive callback function. */
|
||||
static void mcs_receive_irq(struct urb *urb)
|
||||
{
|
||||
|
|
@ -786,14 +778,14 @@ static void mcs_receive_irq(struct urb *urb)
|
|||
*/
|
||||
/* SIR speed */
|
||||
if(mcs->speed < 576000) {
|
||||
async_unwrap_char(mcs->netdev, &mcs->stats,
|
||||
async_unwrap_char(mcs->netdev, &mcs->netdev->stats,
|
||||
&mcs->rx_buff, 0xc0);
|
||||
|
||||
for (i = 0; i < urb->actual_length; i++)
|
||||
async_unwrap_char(mcs->netdev, &mcs->stats,
|
||||
async_unwrap_char(mcs->netdev, &mcs->netdev->stats,
|
||||
&mcs->rx_buff, bytes[i]);
|
||||
|
||||
async_unwrap_char(mcs->netdev, &mcs->stats,
|
||||
async_unwrap_char(mcs->netdev, &mcs->netdev->stats,
|
||||
&mcs->rx_buff, 0xc1);
|
||||
}
|
||||
/* MIR speed */
|
||||
|
|
@ -868,12 +860,12 @@ static int mcs_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|||
case -EPIPE:
|
||||
break;
|
||||
default:
|
||||
mcs->stats.tx_errors++;
|
||||
mcs->netdev->stats.tx_errors++;
|
||||
netif_start_queue(ndev);
|
||||
}
|
||||
} else {
|
||||
mcs->stats.tx_packets++;
|
||||
mcs->stats.tx_bytes += skb->len;
|
||||
mcs->netdev->stats.tx_packets++;
|
||||
mcs->netdev->stats.tx_bytes += skb->len;
|
||||
}
|
||||
|
||||
dev_kfree_skb(skb);
|
||||
|
|
@ -931,7 +923,6 @@ static int mcs_probe(struct usb_interface *intf,
|
|||
ndev->hard_start_xmit = mcs_hard_xmit;
|
||||
ndev->open = mcs_net_open;
|
||||
ndev->stop = mcs_net_close;
|
||||
ndev->get_stats = mcs_net_get_stats;
|
||||
ndev->do_ioctl = mcs_net_ioctl;
|
||||
|
||||
if (!intf->cur_altsetting)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ struct mcs_cb {
|
|||
struct usb_device *usbdev; /* init: probe_irda */
|
||||
struct net_device *netdev; /* network layer */
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct net_device_stats stats; /* network statistics */
|
||||
struct qos_info qos;
|
||||
unsigned int speed; /* Current speed */
|
||||
unsigned int new_speed; /* new speed */
|
||||
|
|
@ -154,7 +153,6 @@ static int mcs_speed_change(struct mcs_cb *mcs);
|
|||
static int mcs_net_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd);
|
||||
static int mcs_net_close(struct net_device *netdev);
|
||||
static int mcs_net_open(struct net_device *netdev);
|
||||
static struct net_device_stats *mcs_net_get_stats(struct net_device *netdev);
|
||||
|
||||
static void mcs_receive_irq(struct urb *urb);
|
||||
static void mcs_send_irq(struct urb *urb);
|
||||
|
|
|
|||
|
|
@ -185,7 +185,6 @@ static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id);
|
|||
static int nsc_ircc_net_open(struct net_device *dev);
|
||||
static int nsc_ircc_net_close(struct net_device *dev);
|
||||
static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
static struct net_device_stats *nsc_ircc_net_get_stats(struct net_device *dev);
|
||||
|
||||
/* Globals */
|
||||
static int pnp_registered;
|
||||
|
|
@ -446,7 +445,6 @@ static int __init nsc_ircc_open(chipio_t *info)
|
|||
dev->open = nsc_ircc_net_open;
|
||||
dev->stop = nsc_ircc_net_close;
|
||||
dev->do_ioctl = nsc_ircc_net_ioctl;
|
||||
dev->get_stats = nsc_ircc_net_get_stats;
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err) {
|
||||
|
|
@ -1401,7 +1399,7 @@ static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
|
|||
self->tx_buff.len = async_wrap_skb(skb, self->tx_buff.data,
|
||||
self->tx_buff.truesize);
|
||||
|
||||
self->stats.tx_bytes += self->tx_buff.len;
|
||||
dev->stats.tx_bytes += self->tx_buff.len;
|
||||
|
||||
/* Add interrupt on tx low level (will fire immediately) */
|
||||
switch_bank(iobase, BANK0);
|
||||
|
|
@ -1473,7 +1471,7 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
|
|||
self->tx_fifo.queue[self->tx_fifo.free].len = skb->len;
|
||||
self->tx_fifo.tail += skb->len;
|
||||
|
||||
self->stats.tx_bytes += skb->len;
|
||||
dev->stats.tx_bytes += skb->len;
|
||||
|
||||
skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start,
|
||||
skb->len);
|
||||
|
|
@ -1652,13 +1650,13 @@ static int nsc_ircc_dma_xmit_complete(struct nsc_ircc_cb *self)
|
|||
|
||||
/* Check for underrrun! */
|
||||
if (inb(iobase+ASCR) & ASCR_TXUR) {
|
||||
self->stats.tx_errors++;
|
||||
self->stats.tx_fifo_errors++;
|
||||
self->netdev->stats.tx_errors++;
|
||||
self->netdev->stats.tx_fifo_errors++;
|
||||
|
||||
/* Clear bit, by writing 1 into it */
|
||||
outb(ASCR_TXUR, iobase+ASCR);
|
||||
} else {
|
||||
self->stats.tx_packets++;
|
||||
self->netdev->stats.tx_packets++;
|
||||
}
|
||||
|
||||
/* Finished with this frame, so prepare for next */
|
||||
|
|
@ -1793,28 +1791,28 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
|
|||
if (status & FRM_ST_ERR_MSK) {
|
||||
if (status & FRM_ST_LOST_FR) {
|
||||
/* Add number of lost frames to stats */
|
||||
self->stats.rx_errors += len;
|
||||
self->netdev->stats.rx_errors += len;
|
||||
} else {
|
||||
/* Skip frame */
|
||||
self->stats.rx_errors++;
|
||||
self->netdev->stats.rx_errors++;
|
||||
|
||||
self->rx_buff.data += len;
|
||||
|
||||
if (status & FRM_ST_MAX_LEN)
|
||||
self->stats.rx_length_errors++;
|
||||
self->netdev->stats.rx_length_errors++;
|
||||
|
||||
if (status & FRM_ST_PHY_ERR)
|
||||
self->stats.rx_frame_errors++;
|
||||
self->netdev->stats.rx_frame_errors++;
|
||||
|
||||
if (status & FRM_ST_BAD_CRC)
|
||||
self->stats.rx_crc_errors++;
|
||||
self->netdev->stats.rx_crc_errors++;
|
||||
}
|
||||
/* The errors below can be reported in both cases */
|
||||
if (status & FRM_ST_OVR1)
|
||||
self->stats.rx_fifo_errors++;
|
||||
self->netdev->stats.rx_fifo_errors++;
|
||||
|
||||
if (status & FRM_ST_OVR2)
|
||||
self->stats.rx_fifo_errors++;
|
||||
self->netdev->stats.rx_fifo_errors++;
|
||||
} else {
|
||||
/*
|
||||
* First we must make sure that the frame we
|
||||
|
|
@ -1863,7 +1861,7 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
|
|||
IRDA_WARNING("%s(), memory squeeze, "
|
||||
"dropping frame.\n",
|
||||
__func__);
|
||||
self->stats.rx_dropped++;
|
||||
self->netdev->stats.rx_dropped++;
|
||||
|
||||
/* Restore bank register */
|
||||
outb(bank, iobase+BSR);
|
||||
|
|
@ -1889,8 +1887,8 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
|
|||
|
||||
/* Move to next frame */
|
||||
self->rx_buff.data += len;
|
||||
self->stats.rx_bytes += len;
|
||||
self->stats.rx_packets++;
|
||||
self->netdev->stats.rx_bytes += len;
|
||||
self->netdev->stats.rx_packets++;
|
||||
|
||||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
|
|
@ -1920,8 +1918,8 @@ static void nsc_ircc_pio_receive(struct nsc_ircc_cb *self)
|
|||
/* Receive all characters in Rx FIFO */
|
||||
do {
|
||||
byte = inb(iobase+RXD);
|
||||
async_unwrap_char(self->netdev, &self->stats, &self->rx_buff,
|
||||
byte);
|
||||
async_unwrap_char(self->netdev, &self->netdev->stats,
|
||||
&self->rx_buff, byte);
|
||||
} while (inb(iobase+LSR) & LSR_RXDA); /* Data available */
|
||||
}
|
||||
|
||||
|
|
@ -1952,7 +1950,7 @@ static void nsc_ircc_sir_interrupt(struct nsc_ircc_cb *self, int eir)
|
|||
self->ier = IER_TXLDL_IE;
|
||||
else {
|
||||
|
||||
self->stats.tx_packets++;
|
||||
self->netdev->stats.tx_packets++;
|
||||
netif_wake_queue(self->netdev);
|
||||
self->ier = IER_TXEMP_IE;
|
||||
}
|
||||
|
|
@ -2307,13 +2305,6 @@ static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct net_device_stats *nsc_ircc_net_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct nsc_ircc_cb *self = netdev_priv(dev);
|
||||
|
||||
return &self->stats;
|
||||
}
|
||||
|
||||
static int nsc_ircc_suspend(struct platform_device *dev, pm_message_t state)
|
||||
{
|
||||
struct nsc_ircc_cb *self = platform_get_drvdata(dev);
|
||||
|
|
|
|||
|
|
@ -251,7 +251,6 @@ struct nsc_ircc_cb {
|
|||
struct tx_fifo tx_fifo; /* Info about frames to be transmitted */
|
||||
|
||||
struct net_device *netdev; /* Yes! we are some kind of netdevice */
|
||||
struct net_device_stats stats;
|
||||
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct qos_info qos; /* QoS capabilities for this device */
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ struct pxa_irda {
|
|||
int txdma;
|
||||
int rxdma;
|
||||
|
||||
struct net_device_stats stats;
|
||||
struct irlap_cb *irlap;
|
||||
struct qos_info qos;
|
||||
|
||||
|
|
@ -258,14 +257,15 @@ static irqreturn_t pxa_irda_sir_irq(int irq, void *dev_id)
|
|||
data = STRBR;
|
||||
if (lsr & (LSR_OE | LSR_PE | LSR_FE | LSR_BI)) {
|
||||
printk(KERN_DEBUG "pxa_ir: sir receiving error\n");
|
||||
si->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
if (lsr & LSR_FE)
|
||||
si->stats.rx_frame_errors++;
|
||||
dev->stats.rx_frame_errors++;
|
||||
if (lsr & LSR_OE)
|
||||
si->stats.rx_fifo_errors++;
|
||||
dev->stats.rx_fifo_errors++;
|
||||
} else {
|
||||
si->stats.rx_bytes++;
|
||||
async_unwrap_char(dev, &si->stats, &si->rx_buff, data);
|
||||
dev->stats.rx_bytes++;
|
||||
async_unwrap_char(dev, &dev->stats,
|
||||
&si->rx_buff, data);
|
||||
}
|
||||
lsr = STLSR;
|
||||
}
|
||||
|
|
@ -277,8 +277,8 @@ static irqreturn_t pxa_irda_sir_irq(int irq, void *dev_id)
|
|||
|
||||
case 0x0C: /* Character Timeout Indication */
|
||||
do {
|
||||
si->stats.rx_bytes++;
|
||||
async_unwrap_char(dev, &si->stats, &si->rx_buff, STRBR);
|
||||
dev->stats.rx_bytes++;
|
||||
async_unwrap_char(dev, &dev->stats, &si->rx_buff, STRBR);
|
||||
} while (STLSR & LSR_DR);
|
||||
si->last_oscr = OSCR;
|
||||
break;
|
||||
|
|
@ -290,9 +290,8 @@ static irqreturn_t pxa_irda_sir_irq(int irq, void *dev_id)
|
|||
}
|
||||
|
||||
if (si->tx_buff.len == 0) {
|
||||
si->stats.tx_packets++;
|
||||
si->stats.tx_bytes += si->tx_buff.data -
|
||||
si->tx_buff.head;
|
||||
dev->stats.tx_packets++;
|
||||
dev->stats.tx_bytes += si->tx_buff.data - si->tx_buff.head;
|
||||
|
||||
/* We need to ensure that the transmitter has finished. */
|
||||
while ((STLSR & LSR_TEMT) == 0)
|
||||
|
|
@ -343,10 +342,10 @@ static void pxa_irda_fir_dma_tx_irq(int channel, void *data)
|
|||
DCSR(channel) = dcsr & ~DCSR_RUN;
|
||||
|
||||
if (dcsr & DCSR_ENDINTR) {
|
||||
si->stats.tx_packets++;
|
||||
si->stats.tx_bytes += si->dma_tx_buff_len;
|
||||
dev->stats.tx_packets++;
|
||||
dev->stats.tx_bytes += si->dma_tx_buff_len;
|
||||
} else {
|
||||
si->stats.tx_errors++;
|
||||
dev->stats.tx_errors++;
|
||||
}
|
||||
|
||||
while (ICSR1 & ICSR1_TBY)
|
||||
|
|
@ -392,14 +391,14 @@ static void pxa_irda_fir_irq_eif(struct pxa_irda *si, struct net_device *dev, in
|
|||
data = ICDR;
|
||||
|
||||
if (stat & (ICSR1_CRE | ICSR1_ROR)) {
|
||||
si->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
if (stat & ICSR1_CRE) {
|
||||
printk(KERN_DEBUG "pxa_ir: fir receive CRC error\n");
|
||||
si->stats.rx_crc_errors++;
|
||||
dev->stats.rx_crc_errors++;
|
||||
}
|
||||
if (stat & ICSR1_ROR) {
|
||||
printk(KERN_DEBUG "pxa_ir: fir receive overrun\n");
|
||||
si->stats.rx_over_errors++;
|
||||
dev->stats.rx_over_errors++;
|
||||
}
|
||||
} else {
|
||||
si->dma_rx_buff[len++] = data;
|
||||
|
|
@ -415,14 +414,14 @@ static void pxa_irda_fir_irq_eif(struct pxa_irda *si, struct net_device *dev, in
|
|||
|
||||
if (icsr0 & ICSR0_FRE) {
|
||||
printk(KERN_ERR "pxa_ir: dropping erroneous frame\n");
|
||||
si->stats.rx_dropped++;
|
||||
dev->stats.rx_dropped++;
|
||||
return;
|
||||
}
|
||||
|
||||
skb = alloc_skb(len+1,GFP_ATOMIC);
|
||||
if (!skb) {
|
||||
printk(KERN_ERR "pxa_ir: fir out of memory for receive skb\n");
|
||||
si->stats.rx_dropped++;
|
||||
dev->stats.rx_dropped++;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -437,8 +436,8 @@ static void pxa_irda_fir_irq_eif(struct pxa_irda *si, struct net_device *dev, in
|
|||
skb->protocol = htons(ETH_P_IRDA);
|
||||
netif_rx(skb);
|
||||
|
||||
si->stats.rx_packets++;
|
||||
si->stats.rx_bytes += len;
|
||||
dev->stats.rx_packets++;
|
||||
dev->stats.rx_bytes += len;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -457,10 +456,10 @@ static irqreturn_t pxa_irda_fir_irq(int irq, void *dev_id)
|
|||
if (icsr0 & (ICSR0_FRE | ICSR0_RAB)) {
|
||||
if (icsr0 & ICSR0_FRE) {
|
||||
printk(KERN_DEBUG "pxa_ir: fir receive frame error\n");
|
||||
si->stats.rx_frame_errors++;
|
||||
dev->stats.rx_frame_errors++;
|
||||
} else {
|
||||
printk(KERN_DEBUG "pxa_ir: fir receive abort\n");
|
||||
si->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
}
|
||||
ICSR0 = icsr0 & (ICSR0_FRE | ICSR0_RAB);
|
||||
}
|
||||
|
|
@ -589,12 +588,6 @@ static int pxa_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct net_device_stats *pxa_irda_stats(struct net_device *dev)
|
||||
{
|
||||
struct pxa_irda *si = netdev_priv(dev);
|
||||
return &si->stats;
|
||||
}
|
||||
|
||||
static void pxa_irda_startup(struct pxa_irda *si)
|
||||
{
|
||||
/* Disable STUART interrupts */
|
||||
|
|
@ -857,7 +850,6 @@ static int pxa_irda_probe(struct platform_device *pdev)
|
|||
dev->open = pxa_irda_start;
|
||||
dev->stop = pxa_irda_stop;
|
||||
dev->do_ioctl = pxa_irda_ioctl;
|
||||
dev->get_stats = pxa_irda_stats;
|
||||
|
||||
irda_init_max_qos_capabilies(&si->qos);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ struct sa1100_irda {
|
|||
dma_regs_t *txdma;
|
||||
dma_regs_t *rxdma;
|
||||
|
||||
struct net_device_stats stats;
|
||||
struct device *dev;
|
||||
struct irda_platform_data *pdata;
|
||||
struct irlap_cb *irlap;
|
||||
|
|
@ -375,13 +374,13 @@ static void sa1100_irda_hpsir_irq(struct net_device *dev)
|
|||
data = Ser2UTDR;
|
||||
|
||||
if (stat & (UTSR1_FRE | UTSR1_ROR)) {
|
||||
si->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
if (stat & UTSR1_FRE)
|
||||
si->stats.rx_frame_errors++;
|
||||
dev->stats.rx_frame_errors++;
|
||||
if (stat & UTSR1_ROR)
|
||||
si->stats.rx_fifo_errors++;
|
||||
dev->stats.rx_fifo_errors++;
|
||||
} else
|
||||
async_unwrap_char(dev, &si->stats, &si->rx_buff, data);
|
||||
async_unwrap_char(dev, &dev->stats, &si->rx_buff, data);
|
||||
|
||||
status = Ser2UTSR0;
|
||||
}
|
||||
|
|
@ -396,9 +395,9 @@ static void sa1100_irda_hpsir_irq(struct net_device *dev)
|
|||
* There are at least 4 bytes in the FIFO. Read 3 bytes
|
||||
* and leave the rest to the block below.
|
||||
*/
|
||||
async_unwrap_char(dev, &si->stats, &si->rx_buff, Ser2UTDR);
|
||||
async_unwrap_char(dev, &si->stats, &si->rx_buff, Ser2UTDR);
|
||||
async_unwrap_char(dev, &si->stats, &si->rx_buff, Ser2UTDR);
|
||||
async_unwrap_char(dev, &dev->stats, &si->rx_buff, Ser2UTDR);
|
||||
async_unwrap_char(dev, &dev->stats, &si->rx_buff, Ser2UTDR);
|
||||
async_unwrap_char(dev, &dev->stats, &si->rx_buff, Ser2UTDR);
|
||||
}
|
||||
|
||||
if (status & (UTSR0_RFS | UTSR0_RID)) {
|
||||
|
|
@ -406,7 +405,7 @@ static void sa1100_irda_hpsir_irq(struct net_device *dev)
|
|||
* Fifo contains more than 1 character.
|
||||
*/
|
||||
do {
|
||||
async_unwrap_char(dev, &si->stats, &si->rx_buff,
|
||||
async_unwrap_char(dev, &dev->stats, &si->rx_buff,
|
||||
Ser2UTDR);
|
||||
} while (Ser2UTSR1 & UTSR1_RNE);
|
||||
|
||||
|
|
@ -422,8 +421,8 @@ static void sa1100_irda_hpsir_irq(struct net_device *dev)
|
|||
} while (Ser2UTSR1 & UTSR1_TNF && si->tx_buff.len);
|
||||
|
||||
if (si->tx_buff.len == 0) {
|
||||
si->stats.tx_packets++;
|
||||
si->stats.tx_bytes += si->tx_buff.data -
|
||||
dev->stats.tx_packets++;
|
||||
dev->stats.tx_bytes += si->tx_buff.data -
|
||||
si->tx_buff.head;
|
||||
|
||||
/*
|
||||
|
|
@ -482,11 +481,11 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
|
|||
data = Ser2HSDR;
|
||||
|
||||
if (stat & (HSSR1_CRE | HSSR1_ROR)) {
|
||||
si->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
if (stat & HSSR1_CRE)
|
||||
si->stats.rx_crc_errors++;
|
||||
dev->stats.rx_crc_errors++;
|
||||
if (stat & HSSR1_ROR)
|
||||
si->stats.rx_frame_errors++;
|
||||
dev->stats.rx_frame_errors++;
|
||||
} else
|
||||
skb->data[len++] = data;
|
||||
|
||||
|
|
@ -505,8 +504,8 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
|
|||
skb->dev = dev;
|
||||
skb_reset_mac_header(skb);
|
||||
skb->protocol = htons(ETH_P_IRDA);
|
||||
si->stats.rx_packets++;
|
||||
si->stats.rx_bytes += len;
|
||||
dev->stats.rx_packets++;
|
||||
dev->stats.rx_bytes += len;
|
||||
|
||||
/*
|
||||
* Before we pass the buffer up, allocate a new one.
|
||||
|
|
@ -545,10 +544,10 @@ static void sa1100_irda_fir_irq(struct net_device *dev)
|
|||
* from the fifo.
|
||||
*/
|
||||
if (Ser2HSSR0 & (HSSR0_FRE | HSSR0_RAB)) {
|
||||
si->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
|
||||
if (Ser2HSSR0 & HSSR0_FRE)
|
||||
si->stats.rx_frame_errors++;
|
||||
dev->stats.rx_frame_errors++;
|
||||
|
||||
/*
|
||||
* Clear out the DMA...
|
||||
|
|
@ -633,8 +632,8 @@ static void sa1100_irda_txdma_irq(void *id)
|
|||
*/
|
||||
if (skb) {
|
||||
dma_unmap_single(si->dev, si->txbuf_dma, skb->len, DMA_TO_DEVICE);
|
||||
si->stats.tx_packets ++;
|
||||
si->stats.tx_bytes += skb->len;
|
||||
dev->stats.tx_packets ++;
|
||||
dev->stats.tx_bytes += skb->len;
|
||||
dev_kfree_skb_irq(skb);
|
||||
}
|
||||
|
||||
|
|
@ -762,12 +761,6 @@ sa1100_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct net_device_stats *sa1100_irda_stats(struct net_device *dev)
|
||||
{
|
||||
struct sa1100_irda *si = netdev_priv(dev);
|
||||
return &si->stats;
|
||||
}
|
||||
|
||||
static int sa1100_irda_start(struct net_device *dev)
|
||||
{
|
||||
struct sa1100_irda *si = netdev_priv(dev);
|
||||
|
|
@ -924,7 +917,6 @@ static int sa1100_irda_probe(struct platform_device *pdev)
|
|||
dev->open = sa1100_irda_start;
|
||||
dev->stop = sa1100_irda_stop;
|
||||
dev->do_ioctl = sa1100_irda_ioctl;
|
||||
dev->get_stats = sa1100_irda_stats;
|
||||
dev->irq = IRQ_Ser2ICP;
|
||||
|
||||
irda_init_max_qos_capabilies(&si->qos);
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ static inline int sirdev_schedule_mode(struct sir_dev *dev, int mode)
|
|||
|
||||
struct sir_dev {
|
||||
struct net_device *netdev;
|
||||
struct net_device_stats stats;
|
||||
|
||||
struct irlap_cb *irlap;
|
||||
|
||||
|
|
|
|||
|
|
@ -455,8 +455,8 @@ void sirdev_write_complete(struct sir_dev *dev)
|
|||
if ((skb=dev->tx_skb) != NULL) {
|
||||
dev->tx_skb = NULL;
|
||||
dev_kfree_skb_any(skb);
|
||||
dev->stats.tx_errors++;
|
||||
dev->stats.tx_dropped++;
|
||||
dev->netdev->stats.tx_errors++;
|
||||
dev->netdev->stats.tx_dropped++;
|
||||
}
|
||||
dev->tx_buff.len = 0;
|
||||
}
|
||||
|
|
@ -493,8 +493,8 @@ void sirdev_write_complete(struct sir_dev *dev)
|
|||
|
||||
if ((skb=dev->tx_skb) != NULL) {
|
||||
dev->tx_skb = NULL;
|
||||
dev->stats.tx_packets++;
|
||||
dev->stats.tx_bytes += skb->len;
|
||||
dev->netdev->stats.tx_packets++;
|
||||
dev->netdev->stats.tx_bytes += skb->len;
|
||||
dev_kfree_skb_any(skb);
|
||||
}
|
||||
|
||||
|
|
@ -548,7 +548,7 @@ int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count)
|
|||
* just update stats and set media busy
|
||||
*/
|
||||
irda_device_set_media_busy(dev->netdev, TRUE);
|
||||
dev->stats.rx_dropped++;
|
||||
dev->netdev->stats.rx_dropped++;
|
||||
IRDA_DEBUG(0, "%s; rx-drop: %zd\n", __func__, count);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -557,7 +557,7 @@ int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count)
|
|||
if (likely(atomic_read(&dev->enable_rx))) {
|
||||
while (count--)
|
||||
/* Unwrap and destuff one byte */
|
||||
async_unwrap_char(dev->netdev, &dev->stats,
|
||||
async_unwrap_char(dev->netdev, &dev->netdev->stats,
|
||||
&dev->rx_buff, *cp++);
|
||||
} else {
|
||||
while (count--) {
|
||||
|
|
@ -582,13 +582,6 @@ EXPORT_SYMBOL(sirdev_receive);
|
|||
|
||||
/* callbacks from network layer */
|
||||
|
||||
static struct net_device_stats *sirdev_get_stats(struct net_device *ndev)
|
||||
{
|
||||
struct sir_dev *dev = netdev_priv(ndev);
|
||||
|
||||
return (dev) ? &dev->stats : NULL;
|
||||
}
|
||||
|
||||
static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||
{
|
||||
struct sir_dev *dev = netdev_priv(ndev);
|
||||
|
|
@ -654,7 +647,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|||
*/
|
||||
atomic_set(&dev->enable_rx, 0);
|
||||
if (unlikely(sirdev_is_receiving(dev)))
|
||||
dev->stats.collisions++;
|
||||
dev->netdev->stats.collisions++;
|
||||
|
||||
actual = dev->drv->do_write(dev, dev->tx_buff.data, dev->tx_buff.len);
|
||||
|
||||
|
|
@ -669,8 +662,8 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|||
IRDA_ERROR("%s: drv->do_write failed (%d)\n",
|
||||
__func__, actual);
|
||||
dev_kfree_skb_any(skb);
|
||||
dev->stats.tx_errors++;
|
||||
dev->stats.tx_dropped++;
|
||||
dev->netdev->stats.tx_errors++;
|
||||
dev->netdev->stats.tx_dropped++;
|
||||
netif_wake_queue(ndev);
|
||||
}
|
||||
spin_unlock_irqrestore(&dev->tx_lock, flags);
|
||||
|
|
@ -918,7 +911,6 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
|
|||
ndev->hard_start_xmit = sirdev_hard_xmit;
|
||||
ndev->open = sirdev_open;
|
||||
ndev->stop = sirdev_close;
|
||||
ndev->get_stats = sirdev_get_stats;
|
||||
ndev->do_ioctl = sirdev_ioctl;
|
||||
|
||||
if (register_netdev(ndev)) {
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@ struct smsc_chip_address {
|
|||
/* Private data for each instance */
|
||||
struct smsc_ircc_cb {
|
||||
struct net_device *netdev; /* Yes! we are some kind of netdevice */
|
||||
struct net_device_stats stats;
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
|
||||
chipio_t io; /* IrDA controller information */
|
||||
|
|
@ -215,7 +214,6 @@ static int smsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cm
|
|||
#if SMSC_IRCC2_C_NET_TIMEOUT
|
||||
static void smsc_ircc_timeout(struct net_device *dev);
|
||||
#endif
|
||||
static struct net_device_stats *smsc_ircc_net_get_stats(struct net_device *dev);
|
||||
static int smsc_ircc_is_receiving(struct smsc_ircc_cb *self);
|
||||
static void smsc_ircc_probe_transceiver(struct smsc_ircc_cb *self);
|
||||
static void smsc_ircc_set_transceiver_for_speed(struct smsc_ircc_cb *self, u32 speed);
|
||||
|
|
@ -529,7 +527,6 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
|
|||
dev->open = smsc_ircc_net_open;
|
||||
dev->stop = smsc_ircc_net_close;
|
||||
dev->do_ioctl = smsc_ircc_net_ioctl;
|
||||
dev->get_stats = smsc_ircc_net_get_stats;
|
||||
|
||||
self = netdev_priv(dev);
|
||||
self->netdev = dev;
|
||||
|
|
@ -834,13 +831,6 @@ static int smsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct net_device_stats *smsc_ircc_net_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct smsc_ircc_cb *self = netdev_priv(dev);
|
||||
|
||||
return &self->stats;
|
||||
}
|
||||
|
||||
#if SMSC_IRCC2_C_NET_TIMEOUT
|
||||
/*
|
||||
* Function smsc_ircc_timeout (struct net_device *dev)
|
||||
|
|
@ -920,7 +910,7 @@ static int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
|
|||
self->tx_buff.len = async_wrap_skb(skb, self->tx_buff.data,
|
||||
self->tx_buff.truesize);
|
||||
|
||||
self->stats.tx_bytes += self->tx_buff.len;
|
||||
dev->stats.tx_bytes += self->tx_buff.len;
|
||||
|
||||
/* Turn on transmit finished interrupt. Will fire immediately! */
|
||||
outb(UART_IER_THRI, self->io.sir_base + UART_IER);
|
||||
|
|
@ -1320,16 +1310,16 @@ static void smsc_ircc_dma_xmit_complete(struct smsc_ircc_cb *self)
|
|||
/* Check for underrun! */
|
||||
register_bank(iobase, 0);
|
||||
if (inb(iobase + IRCC_LSR) & IRCC_LSR_UNDERRUN) {
|
||||
self->stats.tx_errors++;
|
||||
self->stats.tx_fifo_errors++;
|
||||
self->netdev->stats.tx_errors++;
|
||||
self->netdev->stats.tx_fifo_errors++;
|
||||
|
||||
/* Reset error condition */
|
||||
register_bank(iobase, 0);
|
||||
outb(IRCC_MASTER_ERROR_RESET, iobase + IRCC_MASTER);
|
||||
outb(0x00, iobase + IRCC_MASTER);
|
||||
} else {
|
||||
self->stats.tx_packets++;
|
||||
self->stats.tx_bytes += self->tx_buff.len;
|
||||
self->netdev->stats.tx_packets++;
|
||||
self->netdev->stats.tx_bytes += self->tx_buff.len;
|
||||
}
|
||||
|
||||
/* Check if it's time to change the speed */
|
||||
|
|
@ -1429,15 +1419,15 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self)
|
|||
|
||||
/* Look for errors */
|
||||
if (lsr & (IRCC_LSR_FRAME_ERROR | IRCC_LSR_CRC_ERROR | IRCC_LSR_SIZE_ERROR)) {
|
||||
self->stats.rx_errors++;
|
||||
self->netdev->stats.rx_errors++;
|
||||
if (lsr & IRCC_LSR_FRAME_ERROR)
|
||||
self->stats.rx_frame_errors++;
|
||||
self->netdev->stats.rx_frame_errors++;
|
||||
if (lsr & IRCC_LSR_CRC_ERROR)
|
||||
self->stats.rx_crc_errors++;
|
||||
self->netdev->stats.rx_crc_errors++;
|
||||
if (lsr & IRCC_LSR_SIZE_ERROR)
|
||||
self->stats.rx_length_errors++;
|
||||
self->netdev->stats.rx_length_errors++;
|
||||
if (lsr & (IRCC_LSR_UNDERRUN | IRCC_LSR_OVERRUN))
|
||||
self->stats.rx_length_errors++;
|
||||
self->netdev->stats.rx_length_errors++;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1460,8 +1450,8 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self)
|
|||
skb_reserve(skb, 1);
|
||||
|
||||
memcpy(skb_put(skb, len), self->rx_buff.data, len);
|
||||
self->stats.rx_packets++;
|
||||
self->stats.rx_bytes += len;
|
||||
self->netdev->stats.rx_packets++;
|
||||
self->netdev->stats.rx_bytes += len;
|
||||
|
||||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
|
|
@ -1489,7 +1479,7 @@ static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self)
|
|||
* async_unwrap_char will deliver all found frames
|
||||
*/
|
||||
do {
|
||||
async_unwrap_char(self->netdev, &self->stats, &self->rx_buff,
|
||||
async_unwrap_char(self->netdev, &self->netdev->stats, &self->rx_buff,
|
||||
inb(iobase + UART_RX));
|
||||
|
||||
/* Make sure we don't stay here to long */
|
||||
|
|
@ -1992,7 +1982,7 @@ static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self)
|
|||
/* Tell network layer that we want more frames */
|
||||
netif_wake_queue(self->netdev);
|
||||
}
|
||||
self->stats.tx_packets++;
|
||||
self->netdev->stats.tx_packets++;
|
||||
|
||||
if (self->io.speed <= 115200) {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ struct stir_cb {
|
|||
struct usb_device *usbdev; /* init: probe_irda */
|
||||
struct net_device *netdev; /* network layer */
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct net_device_stats stats; /* network statistics */
|
||||
|
||||
struct qos_info qos;
|
||||
unsigned speed; /* Current speed */
|
||||
|
||||
|
|
@ -323,16 +323,16 @@ static void fir_eof(struct stir_cb *stir)
|
|||
pr_debug("%s: short frame len %d\n",
|
||||
stir->netdev->name, len);
|
||||
|
||||
++stir->stats.rx_errors;
|
||||
++stir->stats.rx_length_errors;
|
||||
++stir->netdev->stats.rx_errors;
|
||||
++stir->netdev->stats.rx_length_errors;
|
||||
return;
|
||||
}
|
||||
|
||||
fcs = ~(crc32_le(~0, rx_buff->data, len));
|
||||
if (fcs != get_unaligned_le32(rx_buff->data + len)) {
|
||||
pr_debug("crc error calc 0x%x len %d\n", fcs, len);
|
||||
stir->stats.rx_errors++;
|
||||
stir->stats.rx_crc_errors++;
|
||||
stir->netdev->stats.rx_errors++;
|
||||
stir->netdev->stats.rx_crc_errors++;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -340,7 +340,7 @@ static void fir_eof(struct stir_cb *stir)
|
|||
if (len < IRDA_RX_COPY_THRESHOLD) {
|
||||
nskb = dev_alloc_skb(len + 1);
|
||||
if (unlikely(!nskb)) {
|
||||
++stir->stats.rx_dropped;
|
||||
++stir->netdev->stats.rx_dropped;
|
||||
return;
|
||||
}
|
||||
skb_reserve(nskb, 1);
|
||||
|
|
@ -349,7 +349,7 @@ static void fir_eof(struct stir_cb *stir)
|
|||
} else {
|
||||
nskb = dev_alloc_skb(rx_buff->truesize);
|
||||
if (unlikely(!nskb)) {
|
||||
++stir->stats.rx_dropped;
|
||||
++stir->netdev->stats.rx_dropped;
|
||||
return;
|
||||
}
|
||||
skb_reserve(nskb, 1);
|
||||
|
|
@ -366,8 +366,8 @@ static void fir_eof(struct stir_cb *stir)
|
|||
|
||||
netif_rx(skb);
|
||||
|
||||
stir->stats.rx_packets++;
|
||||
stir->stats.rx_bytes += len;
|
||||
stir->netdev->stats.rx_packets++;
|
||||
stir->netdev->stats.rx_bytes += len;
|
||||
|
||||
rx_buff->data = rx_buff->head;
|
||||
rx_buff->len = 0;
|
||||
|
|
@ -437,7 +437,7 @@ static void stir_fir_chars(struct stir_cb *stir,
|
|||
if (unlikely(rx_buff->len >= rx_buff->truesize)) {
|
||||
pr_debug("%s: fir frame exceeds %d\n",
|
||||
stir->netdev->name, rx_buff->truesize);
|
||||
++stir->stats.rx_over_errors;
|
||||
++stir->netdev->stats.rx_over_errors;
|
||||
goto error_recovery;
|
||||
}
|
||||
|
||||
|
|
@ -445,10 +445,10 @@ static void stir_fir_chars(struct stir_cb *stir,
|
|||
continue;
|
||||
|
||||
frame_error:
|
||||
++stir->stats.rx_frame_errors;
|
||||
++stir->netdev->stats.rx_frame_errors;
|
||||
|
||||
error_recovery:
|
||||
++stir->stats.rx_errors;
|
||||
++stir->netdev->stats.rx_errors;
|
||||
rx_buff->state = OUTSIDE_FRAME;
|
||||
rx_buff->in_frame = FALSE;
|
||||
}
|
||||
|
|
@ -461,7 +461,7 @@ static void stir_sir_chars(struct stir_cb *stir,
|
|||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
async_unwrap_char(stir->netdev, &stir->stats,
|
||||
async_unwrap_char(stir->netdev, &stir->netdev->stats,
|
||||
&stir->rx_buff, bytes[i]);
|
||||
}
|
||||
|
||||
|
|
@ -692,7 +692,7 @@ static void receive_stop(struct stir_cb *stir)
|
|||
usb_kill_urb(stir->rx_urb);
|
||||
|
||||
if (stir->rx_buff.in_frame)
|
||||
stir->stats.collisions++;
|
||||
stir->netdev->stats.collisions++;
|
||||
}
|
||||
/*
|
||||
* Wrap data in socket buffer and send it.
|
||||
|
|
@ -718,15 +718,15 @@ static void stir_send(struct stir_cb *stir, struct sk_buff *skb)
|
|||
if (!first_frame)
|
||||
fifo_txwait(stir, wraplen);
|
||||
|
||||
stir->stats.tx_packets++;
|
||||
stir->stats.tx_bytes += skb->len;
|
||||
stir->netdev->stats.tx_packets++;
|
||||
stir->netdev->stats.tx_bytes += skb->len;
|
||||
stir->netdev->trans_start = jiffies;
|
||||
pr_debug("send %d (%d)\n", skb->len, wraplen);
|
||||
|
||||
if (usb_bulk_msg(stir->usbdev, usb_sndbulkpipe(stir->usbdev, 1),
|
||||
stir->io_buf, wraplen,
|
||||
NULL, TRANSMIT_TIMEOUT))
|
||||
stir->stats.tx_errors++;
|
||||
stir->netdev->stats.tx_errors++;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1007,15 +1007,6 @@ static int stir_net_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get device stats (for /proc/net/dev and ifconfig)
|
||||
*/
|
||||
static struct net_device_stats *stir_net_get_stats(struct net_device *netdev)
|
||||
{
|
||||
struct stir_cb *stir = netdev_priv(netdev);
|
||||
return &stir->stats;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine is called by the USB subsystem for each new device
|
||||
* in the system. We need to check if the device is ours, and in
|
||||
|
|
@ -1066,7 +1057,6 @@ static int stir_probe(struct usb_interface *intf,
|
|||
net->hard_start_xmit = stir_hard_xmit;
|
||||
net->open = stir_net_open;
|
||||
net->stop = stir_net_close;
|
||||
net->get_stats = stir_net_get_stats;
|
||||
net->do_ioctl = stir_net_ioctl;
|
||||
|
||||
ret = register_netdev(net);
|
||||
|
|
|
|||
|
|
@ -101,8 +101,6 @@ static int via_ircc_net_open(struct net_device *dev);
|
|||
static int via_ircc_net_close(struct net_device *dev);
|
||||
static int via_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq,
|
||||
int cmd);
|
||||
static struct net_device_stats *via_ircc_net_get_stats(struct net_device
|
||||
*dev);
|
||||
static void via_ircc_change_dongle_speed(int iobase, int speed,
|
||||
int dongle_id);
|
||||
static int RxTimerHandler(struct via_ircc_cb *self, int iobase);
|
||||
|
|
@ -434,7 +432,6 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
|
|||
dev->open = via_ircc_net_open;
|
||||
dev->stop = via_ircc_net_close;
|
||||
dev->do_ioctl = via_ircc_net_ioctl;
|
||||
dev->get_stats = via_ircc_net_get_stats;
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err)
|
||||
|
|
@ -855,7 +852,7 @@ static int via_ircc_hard_xmit_sir(struct sk_buff *skb,
|
|||
async_wrap_skb(skb, self->tx_buff.data,
|
||||
self->tx_buff.truesize);
|
||||
|
||||
self->stats.tx_bytes += self->tx_buff.len;
|
||||
dev->stats.tx_bytes += self->tx_buff.len;
|
||||
/* Send this frame with old speed */
|
||||
SetBaudRate(iobase, self->io.speed);
|
||||
SetPulseWidth(iobase, 12);
|
||||
|
|
@ -921,7 +918,7 @@ static int via_ircc_hard_xmit_fir(struct sk_buff *skb,
|
|||
self->tx_fifo.queue[self->tx_fifo.free].len = skb->len;
|
||||
|
||||
self->tx_fifo.tail += skb->len;
|
||||
self->stats.tx_bytes += skb->len;
|
||||
dev->stats.tx_bytes += skb->len;
|
||||
skb_copy_from_linear_data(skb,
|
||||
self->tx_fifo.queue[self->tx_fifo.free].start, skb->len);
|
||||
self->tx_fifo.len++;
|
||||
|
|
@ -990,12 +987,12 @@ static int via_ircc_dma_xmit_complete(struct via_ircc_cb *self)
|
|||
/* Clear bit, by writing 1 into it */
|
||||
Tx_status = GetTXStatus(iobase);
|
||||
if (Tx_status & 0x08) {
|
||||
self->stats.tx_errors++;
|
||||
self->stats.tx_fifo_errors++;
|
||||
self->netdev->stats.tx_errors++;
|
||||
self->netdev->stats.tx_fifo_errors++;
|
||||
hwreset(self);
|
||||
// how to clear underrrun ?
|
||||
} else {
|
||||
self->stats.tx_packets++;
|
||||
self->netdev->stats.tx_packets++;
|
||||
ResetChip(iobase, 3);
|
||||
ResetChip(iobase, 4);
|
||||
}
|
||||
|
|
@ -1119,8 +1116,8 @@ static int via_ircc_dma_receive_complete(struct via_ircc_cb *self,
|
|||
}
|
||||
// Move to next frame
|
||||
self->rx_buff.data += len;
|
||||
self->stats.rx_bytes += len;
|
||||
self->stats.rx_packets++;
|
||||
self->netdev->stats.rx_bytes += len;
|
||||
self->netdev->stats.rx_packets++;
|
||||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
skb->protocol = htons(ETH_P_IRDA);
|
||||
|
|
@ -1180,7 +1177,7 @@ F01_E */
|
|||
*/
|
||||
if ((skb == NULL) || (skb->data == NULL)
|
||||
|| (self->rx_buff.data == NULL) || (len < 6)) {
|
||||
self->stats.rx_dropped++;
|
||||
self->netdev->stats.rx_dropped++;
|
||||
return TRUE;
|
||||
}
|
||||
skb_reserve(skb, 1);
|
||||
|
|
@ -1192,8 +1189,8 @@ F01_E */
|
|||
|
||||
// Move to next frame
|
||||
self->rx_buff.data += len;
|
||||
self->stats.rx_bytes += len;
|
||||
self->stats.rx_packets++;
|
||||
self->netdev->stats.rx_bytes += len;
|
||||
self->netdev->stats.rx_packets++;
|
||||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
skb->protocol = htons(ETH_P_IRDA);
|
||||
|
|
@ -1220,13 +1217,13 @@ static int upload_rxdata(struct via_ircc_cb *self, int iobase)
|
|||
IRDA_DEBUG(2, "%s(): len=%x\n", __func__, len);
|
||||
|
||||
if ((len - 4) < 2) {
|
||||
self->stats.rx_dropped++;
|
||||
self->netdev->stats.rx_dropped++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
skb = dev_alloc_skb(len + 1);
|
||||
if (skb == NULL) {
|
||||
self->stats.rx_dropped++;
|
||||
self->netdev->stats.rx_dropped++;
|
||||
return FALSE;
|
||||
}
|
||||
skb_reserve(skb, 1);
|
||||
|
|
@ -1238,8 +1235,8 @@ static int upload_rxdata(struct via_ircc_cb *self, int iobase)
|
|||
st_fifo->tail = 0;
|
||||
// Move to next frame
|
||||
self->rx_buff.data += len;
|
||||
self->stats.rx_bytes += len;
|
||||
self->stats.rx_packets++;
|
||||
self->netdev->stats.rx_bytes += len;
|
||||
self->netdev->stats.rx_packets++;
|
||||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
skb->protocol = htons(ETH_P_IRDA);
|
||||
|
|
@ -1295,7 +1292,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
|
|||
*/
|
||||
if ((skb == NULL) || (skb->data == NULL)
|
||||
|| (self->rx_buff.data == NULL) || (len < 6)) {
|
||||
self->stats.rx_dropped++;
|
||||
self->netdev->stats.rx_dropped++;
|
||||
continue;
|
||||
}
|
||||
skb_reserve(skb, 1);
|
||||
|
|
@ -1307,8 +1304,8 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
|
|||
|
||||
// Move to next frame
|
||||
self->rx_buff.data += len;
|
||||
self->stats.rx_bytes += len;
|
||||
self->stats.rx_packets++;
|
||||
self->netdev->stats.rx_bytes += len;
|
||||
self->netdev->stats.rx_packets++;
|
||||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
skb->protocol = htons(ETH_P_IRDA);
|
||||
|
|
@ -1523,7 +1520,7 @@ static int via_ircc_net_open(struct net_device *dev)
|
|||
|
||||
IRDA_ASSERT(dev != NULL, return -1;);
|
||||
self = netdev_priv(dev);
|
||||
self->stats.rx_packets = 0;
|
||||
dev->stats.rx_packets = 0;
|
||||
IRDA_ASSERT(self != NULL, return 0;);
|
||||
iobase = self->io.fir_base;
|
||||
if (request_irq(self->io.irq, via_ircc_interrupt, 0, dev->name, dev)) {
|
||||
|
|
@ -1660,14 +1657,6 @@ static int via_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct net_device_stats *via_ircc_net_get_stats(struct net_device
|
||||
*dev)
|
||||
{
|
||||
struct via_ircc_cb *self = netdev_priv(dev);
|
||||
|
||||
return &self->stats;
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("VIA Technologies,inc");
|
||||
MODULE_DESCRIPTION("VIA IrDA Device Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@ struct via_ircc_cb {
|
|||
struct tx_fifo tx_fifo; /* Info about frames to be transmitted */
|
||||
|
||||
struct net_device *netdev; /* Yes! we are some kind of netdevice */
|
||||
struct net_device_stats stats;
|
||||
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct qos_info qos; /* QoS capabilities for this device */
|
||||
|
|
|
|||
|
|
@ -291,14 +291,14 @@ static void vlsi_proc_ndev(struct seq_file *seq, struct net_device *ndev)
|
|||
now.tv_sec - idev->last_rx.tv_sec - delta1, delta2);
|
||||
|
||||
seq_printf(seq, "RX: packets=%lu / bytes=%lu / errors=%lu / dropped=%lu",
|
||||
idev->stats.rx_packets, idev->stats.rx_bytes, idev->stats.rx_errors,
|
||||
idev->stats.rx_dropped);
|
||||
ndev->stats.rx_packets, ndev->stats.rx_bytes, ndev->stats.rx_errors,
|
||||
ndev->stats.rx_dropped);
|
||||
seq_printf(seq, " / overrun=%lu / length=%lu / frame=%lu / crc=%lu\n",
|
||||
idev->stats.rx_over_errors, idev->stats.rx_length_errors,
|
||||
idev->stats.rx_frame_errors, idev->stats.rx_crc_errors);
|
||||
ndev->stats.rx_over_errors, ndev->stats.rx_length_errors,
|
||||
ndev->stats.rx_frame_errors, ndev->stats.rx_crc_errors);
|
||||
seq_printf(seq, "TX: packets=%lu / bytes=%lu / errors=%lu / dropped=%lu / fifo=%lu\n",
|
||||
idev->stats.tx_packets, idev->stats.tx_bytes, idev->stats.tx_errors,
|
||||
idev->stats.tx_dropped, idev->stats.tx_fifo_errors);
|
||||
ndev->stats.tx_packets, ndev->stats.tx_bytes, ndev->stats.tx_errors,
|
||||
ndev->stats.tx_dropped, ndev->stats.tx_fifo_errors);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -651,21 +651,21 @@ static void vlsi_rx_interrupt(struct net_device *ndev)
|
|||
|
||||
if (ret < 0) {
|
||||
ret = -ret;
|
||||
idev->stats.rx_errors++;
|
||||
ndev->stats.rx_errors++;
|
||||
if (ret & VLSI_RX_DROP)
|
||||
idev->stats.rx_dropped++;
|
||||
ndev->stats.rx_dropped++;
|
||||
if (ret & VLSI_RX_OVER)
|
||||
idev->stats.rx_over_errors++;
|
||||
ndev->stats.rx_over_errors++;
|
||||
if (ret & VLSI_RX_LENGTH)
|
||||
idev->stats.rx_length_errors++;
|
||||
ndev->stats.rx_length_errors++;
|
||||
if (ret & VLSI_RX_FRAME)
|
||||
idev->stats.rx_frame_errors++;
|
||||
ndev->stats.rx_frame_errors++;
|
||||
if (ret & VLSI_RX_CRC)
|
||||
idev->stats.rx_crc_errors++;
|
||||
ndev->stats.rx_crc_errors++;
|
||||
}
|
||||
else if (ret > 0) {
|
||||
idev->stats.rx_packets++;
|
||||
idev->stats.rx_bytes += ret;
|
||||
ndev->stats.rx_packets++;
|
||||
ndev->stats.rx_bytes += ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -686,6 +686,7 @@ static void vlsi_rx_interrupt(struct net_device *ndev)
|
|||
|
||||
static void vlsi_unarm_rx(vlsi_irda_dev_t *idev)
|
||||
{
|
||||
struct net_device *ndev = pci_get_drvdata(idev->pdev);
|
||||
struct vlsi_ring *r = idev->rx_ring;
|
||||
struct ring_descr *rd;
|
||||
int ret;
|
||||
|
|
@ -711,21 +712,21 @@ static void vlsi_unarm_rx(vlsi_irda_dev_t *idev)
|
|||
|
||||
if (ret < 0) {
|
||||
ret = -ret;
|
||||
idev->stats.rx_errors++;
|
||||
ndev->stats.rx_errors++;
|
||||
if (ret & VLSI_RX_DROP)
|
||||
idev->stats.rx_dropped++;
|
||||
ndev->stats.rx_dropped++;
|
||||
if (ret & VLSI_RX_OVER)
|
||||
idev->stats.rx_over_errors++;
|
||||
ndev->stats.rx_over_errors++;
|
||||
if (ret & VLSI_RX_LENGTH)
|
||||
idev->stats.rx_length_errors++;
|
||||
ndev->stats.rx_length_errors++;
|
||||
if (ret & VLSI_RX_FRAME)
|
||||
idev->stats.rx_frame_errors++;
|
||||
ndev->stats.rx_frame_errors++;
|
||||
if (ret & VLSI_RX_CRC)
|
||||
idev->stats.rx_crc_errors++;
|
||||
ndev->stats.rx_crc_errors++;
|
||||
}
|
||||
else if (ret > 0) {
|
||||
idev->stats.rx_packets++;
|
||||
idev->stats.rx_bytes += ret;
|
||||
ndev->stats.rx_packets++;
|
||||
ndev->stats.rx_bytes += ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1050,8 +1051,8 @@ drop_unlock:
|
|||
drop:
|
||||
IRDA_WARNING("%s: dropping packet - %s\n", __func__, msg);
|
||||
dev_kfree_skb_any(skb);
|
||||
idev->stats.tx_errors++;
|
||||
idev->stats.tx_dropped++;
|
||||
ndev->stats.tx_errors++;
|
||||
ndev->stats.tx_dropped++;
|
||||
/* Don't even think about returning NET_XMIT_DROP (=1) here!
|
||||
* In fact any retval!=0 causes the packet scheduler to requeue the
|
||||
* packet for later retry of transmission - which isn't exactly
|
||||
|
|
@ -1078,15 +1079,15 @@ static void vlsi_tx_interrupt(struct net_device *ndev)
|
|||
|
||||
if (ret < 0) {
|
||||
ret = -ret;
|
||||
idev->stats.tx_errors++;
|
||||
ndev->stats.tx_errors++;
|
||||
if (ret & VLSI_TX_DROP)
|
||||
idev->stats.tx_dropped++;
|
||||
ndev->stats.tx_dropped++;
|
||||
if (ret & VLSI_TX_FIFO)
|
||||
idev->stats.tx_fifo_errors++;
|
||||
ndev->stats.tx_fifo_errors++;
|
||||
}
|
||||
else if (ret > 0){
|
||||
idev->stats.tx_packets++;
|
||||
idev->stats.tx_bytes += ret;
|
||||
ndev->stats.tx_packets++;
|
||||
ndev->stats.tx_bytes += ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1122,6 +1123,7 @@ static void vlsi_tx_interrupt(struct net_device *ndev)
|
|||
|
||||
static void vlsi_unarm_tx(vlsi_irda_dev_t *idev)
|
||||
{
|
||||
struct net_device *ndev = pci_get_drvdata(idev->pdev);
|
||||
struct vlsi_ring *r = idev->tx_ring;
|
||||
struct ring_descr *rd;
|
||||
int ret;
|
||||
|
|
@ -1145,15 +1147,15 @@ static void vlsi_unarm_tx(vlsi_irda_dev_t *idev)
|
|||
|
||||
if (ret < 0) {
|
||||
ret = -ret;
|
||||
idev->stats.tx_errors++;
|
||||
ndev->stats.tx_errors++;
|
||||
if (ret & VLSI_TX_DROP)
|
||||
idev->stats.tx_dropped++;
|
||||
ndev->stats.tx_dropped++;
|
||||
if (ret & VLSI_TX_FIFO)
|
||||
idev->stats.tx_fifo_errors++;
|
||||
ndev->stats.tx_fifo_errors++;
|
||||
}
|
||||
else if (ret > 0){
|
||||
idev->stats.tx_packets++;
|
||||
idev->stats.tx_bytes += ret;
|
||||
ndev->stats.tx_packets++;
|
||||
ndev->stats.tx_bytes += ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1373,13 +1375,6 @@ static int vlsi_stop_hw(vlsi_irda_dev_t *idev)
|
|||
|
||||
/**************************************************************/
|
||||
|
||||
static struct net_device_stats * vlsi_get_stats(struct net_device *ndev)
|
||||
{
|
||||
vlsi_irda_dev_t *idev = netdev_priv(ndev);
|
||||
|
||||
return &idev->stats;
|
||||
}
|
||||
|
||||
static void vlsi_tx_timeout(struct net_device *ndev)
|
||||
{
|
||||
vlsi_irda_dev_t *idev = netdev_priv(ndev);
|
||||
|
|
@ -1615,7 +1610,6 @@ static int vlsi_irda_init(struct net_device *ndev)
|
|||
|
||||
ndev->open = vlsi_open;
|
||||
ndev->stop = vlsi_close;
|
||||
ndev->get_stats = vlsi_get_stats;
|
||||
ndev->hard_start_xmit = vlsi_hard_start_xmit;
|
||||
ndev->do_ioctl = vlsi_ioctl;
|
||||
ndev->tx_timeout = vlsi_tx_timeout;
|
||||
|
|
|
|||
|
|
@ -712,7 +712,6 @@ static inline struct ring_descr *ring_get(struct vlsi_ring *r)
|
|||
|
||||
typedef struct vlsi_irda_dev {
|
||||
struct pci_dev *pdev;
|
||||
struct net_device_stats stats;
|
||||
|
||||
struct irlap_cb *irlap;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ static int w83977af_is_receiving(struct w83977af_ir *self);
|
|||
static int w83977af_net_open(struct net_device *dev);
|
||||
static int w83977af_net_close(struct net_device *dev);
|
||||
static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
static struct net_device_stats *w83977af_net_get_stats(struct net_device *dev);
|
||||
|
||||
/*
|
||||
* Function w83977af_init ()
|
||||
|
|
@ -237,7 +236,6 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq,
|
|||
dev->open = w83977af_net_open;
|
||||
dev->stop = w83977af_net_close;
|
||||
dev->do_ioctl = w83977af_net_ioctl;
|
||||
dev->get_stats = w83977af_net_get_stats;
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err) {
|
||||
|
|
@ -702,13 +700,13 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self)
|
|||
if (inb(iobase+AUDR) & AUDR_UNDR) {
|
||||
IRDA_DEBUG(0, "%s(), Transmit underrun!\n", __func__ );
|
||||
|
||||
self->stats.tx_errors++;
|
||||
self->stats.tx_fifo_errors++;
|
||||
self->netdev->stats.tx_errors++;
|
||||
self->netdev->stats.tx_fifo_errors++;
|
||||
|
||||
/* Clear bit, by writing 1 to it */
|
||||
outb(AUDR_UNDR, iobase+AUDR);
|
||||
} else
|
||||
self->stats.tx_packets++;
|
||||
self->netdev->stats.tx_packets++;
|
||||
|
||||
|
||||
if (self->new_speed) {
|
||||
|
|
@ -846,28 +844,28 @@ static int w83977af_dma_receive_complete(struct w83977af_ir *self)
|
|||
if (status & FS_FO_ERR_MSK) {
|
||||
if (status & FS_FO_LST_FR) {
|
||||
/* Add number of lost frames to stats */
|
||||
self->stats.rx_errors += len;
|
||||
self->netdev->stats.rx_errors += len;
|
||||
} else {
|
||||
/* Skip frame */
|
||||
self->stats.rx_errors++;
|
||||
self->netdev->stats.rx_errors++;
|
||||
|
||||
self->rx_buff.data += len;
|
||||
|
||||
if (status & FS_FO_MX_LEX)
|
||||
self->stats.rx_length_errors++;
|
||||
self->netdev->stats.rx_length_errors++;
|
||||
|
||||
if (status & FS_FO_PHY_ERR)
|
||||
self->stats.rx_frame_errors++;
|
||||
self->netdev->stats.rx_frame_errors++;
|
||||
|
||||
if (status & FS_FO_CRC_ERR)
|
||||
self->stats.rx_crc_errors++;
|
||||
self->netdev->stats.rx_crc_errors++;
|
||||
}
|
||||
/* The errors below can be reported in both cases */
|
||||
if (status & FS_FO_RX_OV)
|
||||
self->stats.rx_fifo_errors++;
|
||||
self->netdev->stats.rx_fifo_errors++;
|
||||
|
||||
if (status & FS_FO_FSF_OV)
|
||||
self->stats.rx_fifo_errors++;
|
||||
self->netdev->stats.rx_fifo_errors++;
|
||||
|
||||
} else {
|
||||
/* Check if we have transferred all data to memory */
|
||||
|
|
@ -917,7 +915,7 @@ static int w83977af_dma_receive_complete(struct w83977af_ir *self)
|
|||
|
||||
/* Move to next frame */
|
||||
self->rx_buff.data += len;
|
||||
self->stats.rx_packets++;
|
||||
self->netdev->stats.rx_packets++;
|
||||
|
||||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
|
|
@ -951,7 +949,7 @@ static void w83977af_pio_receive(struct w83977af_ir *self)
|
|||
/* Receive all characters in Rx FIFO */
|
||||
do {
|
||||
byte = inb(iobase+RBR);
|
||||
async_unwrap_char(self->netdev, &self->stats, &self->rx_buff,
|
||||
async_unwrap_char(self->netdev, &self->netdev->stats, &self->rx_buff,
|
||||
byte);
|
||||
} while (inb(iobase+USR) & USR_RDR); /* Data available */
|
||||
}
|
||||
|
|
@ -994,7 +992,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr)
|
|||
outb(AUDR_SFEND, iobase+AUDR);
|
||||
outb(set, iobase+SSR);
|
||||
|
||||
self->stats.tx_packets++;
|
||||
self->netdev->stats.tx_packets++;
|
||||
|
||||
/* Feed me more packets */
|
||||
netif_wake_queue(self->netdev);
|
||||
|
|
@ -1336,13 +1334,6 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct net_device_stats *w83977af_net_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct w83977af_ir *self = netdev_priv(dev);
|
||||
|
||||
return &self->stats;
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Dag Brattli <[email protected]>");
|
||||
MODULE_DESCRIPTION("Winbond W83977AF IrDA Device Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
|
|
@ -172,7 +172,6 @@ struct w83977af_ir {
|
|||
int tx_len; /* Number of frames in tx_buff */
|
||||
|
||||
struct net_device *netdev; /* Yes! we are some kind of netdevice */
|
||||
struct net_device_stats stats;
|
||||
|
||||
struct irlap_cb *irlap; /* The link layer we are binded to */
|
||||
struct qos_info qos; /* QoS capabilities for this device */
|
||||
|
|
|
|||
|
|
@ -399,8 +399,10 @@ static int mlx4_en_set_ringparam(struct net_device *dev,
|
|||
|
||||
rx_size = roundup_pow_of_two(param->rx_pending);
|
||||
rx_size = max_t(u32, rx_size, MLX4_EN_MIN_RX_SIZE);
|
||||
rx_size = min_t(u32, rx_size, MLX4_EN_MAX_RX_SIZE);
|
||||
tx_size = roundup_pow_of_two(param->tx_pending);
|
||||
tx_size = max_t(u32, tx_size, MLX4_EN_MIN_TX_SIZE);
|
||||
tx_size = min_t(u32, tx_size, MLX4_EN_MAX_TX_SIZE);
|
||||
|
||||
if (rx_size == priv->prof->rx_ring_size &&
|
||||
tx_size == priv->prof->tx_ring_size)
|
||||
|
|
@ -440,8 +442,8 @@ static void mlx4_en_get_ringparam(struct net_device *dev,
|
|||
struct mlx4_en_dev *mdev = priv->mdev;
|
||||
|
||||
memset(param, 0, sizeof(*param));
|
||||
param->rx_max_pending = mdev->dev->caps.max_rq_sg;
|
||||
param->tx_max_pending = mdev->dev->caps.max_sq_sg;
|
||||
param->rx_max_pending = MLX4_EN_MAX_RX_SIZE;
|
||||
param->tx_max_pending = MLX4_EN_MAX_TX_SIZE;
|
||||
param->rx_pending = mdev->profile.prof[priv->port].rx_ring_size;
|
||||
param->tx_pending = mdev->profile.prof[priv->port].tx_ring_size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,19 +203,21 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
|
|||
|
||||
/* Optimize the common case when there are no wraparounds */
|
||||
if (likely((void *) tx_desc + tx_info->nr_txbb * TXBB_SIZE <= end)) {
|
||||
if (tx_info->linear) {
|
||||
pci_unmap_single(mdev->pdev,
|
||||
(dma_addr_t) be64_to_cpu(data->addr),
|
||||
if (!tx_info->inl) {
|
||||
if (tx_info->linear) {
|
||||
pci_unmap_single(mdev->pdev,
|
||||
(dma_addr_t) be64_to_cpu(data->addr),
|
||||
be32_to_cpu(data->byte_count),
|
||||
PCI_DMA_TODEVICE);
|
||||
++data;
|
||||
}
|
||||
++data;
|
||||
}
|
||||
|
||||
for (i = 0; i < frags; i++) {
|
||||
frag = &skb_shinfo(skb)->frags[i];
|
||||
pci_unmap_page(mdev->pdev,
|
||||
(dma_addr_t) be64_to_cpu(data[i].addr),
|
||||
frag->size, PCI_DMA_TODEVICE);
|
||||
for (i = 0; i < frags; i++) {
|
||||
frag = &skb_shinfo(skb)->frags[i];
|
||||
pci_unmap_page(mdev->pdev,
|
||||
(dma_addr_t) be64_to_cpu(data[i].addr),
|
||||
frag->size, PCI_DMA_TODEVICE);
|
||||
}
|
||||
}
|
||||
/* Stamp the freed descriptor */
|
||||
for (i = 0; i < tx_info->nr_txbb * TXBB_SIZE; i += STAMP_STRIDE) {
|
||||
|
|
@ -224,27 +226,29 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
|
|||
}
|
||||
|
||||
} else {
|
||||
if ((void *) data >= end) {
|
||||
data = (struct mlx4_wqe_data_seg *)
|
||||
(ring->buf + ((void *) data - end));
|
||||
}
|
||||
if (!tx_info->inl) {
|
||||
if ((void *) data >= end) {
|
||||
data = (struct mlx4_wqe_data_seg *)
|
||||
(ring->buf + ((void *) data - end));
|
||||
}
|
||||
|
||||
if (tx_info->linear) {
|
||||
pci_unmap_single(mdev->pdev,
|
||||
(dma_addr_t) be64_to_cpu(data->addr),
|
||||
if (tx_info->linear) {
|
||||
pci_unmap_single(mdev->pdev,
|
||||
(dma_addr_t) be64_to_cpu(data->addr),
|
||||
be32_to_cpu(data->byte_count),
|
||||
PCI_DMA_TODEVICE);
|
||||
++data;
|
||||
}
|
||||
++data;
|
||||
}
|
||||
|
||||
for (i = 0; i < frags; i++) {
|
||||
/* Check for wraparound before unmapping */
|
||||
if ((void *) data >= end)
|
||||
data = (struct mlx4_wqe_data_seg *) ring->buf;
|
||||
frag = &skb_shinfo(skb)->frags[i];
|
||||
pci_unmap_page(mdev->pdev,
|
||||
for (i = 0; i < frags; i++) {
|
||||
/* Check for wraparound before unmapping */
|
||||
if ((void *) data >= end)
|
||||
data = (struct mlx4_wqe_data_seg *) ring->buf;
|
||||
frag = &skb_shinfo(skb)->frags[i];
|
||||
pci_unmap_page(mdev->pdev,
|
||||
(dma_addr_t) be64_to_cpu(data->addr),
|
||||
frag->size, PCI_DMA_TODEVICE);
|
||||
}
|
||||
}
|
||||
/* Stamp the freed descriptor */
|
||||
for (i = 0; i < tx_info->nr_txbb * TXBB_SIZE; i += STAMP_STRIDE) {
|
||||
|
|
@ -790,8 +794,11 @@ int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
wmb();
|
||||
data->byte_count = cpu_to_be32(skb_headlen(skb) - lso_header_size);
|
||||
}
|
||||
} else
|
||||
tx_info->inl = 0;
|
||||
} else {
|
||||
build_inline_wqe(tx_desc, skb, real_size, &vlan_tag, tx_ind, fragptr);
|
||||
tx_info->inl = 1;
|
||||
}
|
||||
|
||||
ring->prod += nr_txbb;
|
||||
|
||||
|
|
|
|||
|
|
@ -115,6 +115,10 @@ enum {
|
|||
};
|
||||
#define MLX4_EN_MAX_RX_FRAGS 4
|
||||
|
||||
/* Maximum ring sizes */
|
||||
#define MLX4_EN_MAX_TX_SIZE 8192
|
||||
#define MLX4_EN_MAX_RX_SIZE 8192
|
||||
|
||||
/* Minimum ring size for our page-allocation sceme to work */
|
||||
#define MLX4_EN_MIN_RX_SIZE (MLX4_EN_ALLOC_SIZE / SMP_CACHE_BYTES)
|
||||
#define MLX4_EN_MIN_TX_SIZE (4096 / TXBB_SIZE)
|
||||
|
|
@ -202,6 +206,7 @@ struct mlx4_en_tx_info {
|
|||
u32 nr_txbb;
|
||||
u8 linear;
|
||||
u8 data_offset;
|
||||
u8 inl;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -779,6 +779,22 @@ static void __devinit natsemi_init_media (struct net_device *dev)
|
|||
|
||||
}
|
||||
|
||||
static const struct net_device_ops natsemi_netdev_ops = {
|
||||
.ndo_open = netdev_open,
|
||||
.ndo_stop = netdev_close,
|
||||
.ndo_start_xmit = start_tx,
|
||||
.ndo_get_stats = get_stats,
|
||||
.ndo_set_multicast_list = set_rx_mode,
|
||||
.ndo_change_mtu = natsemi_change_mtu,
|
||||
.ndo_do_ioctl = netdev_ioctl,
|
||||
.ndo_tx_timeout = ns_tx_timeout,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = natsemi_poll_controller,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __devinit natsemi_probe1 (struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -911,20 +927,9 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
|
|||
if (find_cnt < MAX_UNITS && full_duplex[find_cnt])
|
||||
np->full_duplex = 1;
|
||||
|
||||
/* The chip-specific entries in the device structure. */
|
||||
dev->open = &netdev_open;
|
||||
dev->hard_start_xmit = &start_tx;
|
||||
dev->stop = &netdev_close;
|
||||
dev->get_stats = &get_stats;
|
||||
dev->set_multicast_list = &set_rx_mode;
|
||||
dev->change_mtu = &natsemi_change_mtu;
|
||||
dev->do_ioctl = &netdev_ioctl;
|
||||
dev->tx_timeout = &ns_tx_timeout;
|
||||
dev->netdev_ops = &natsemi_netdev_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = &natsemi_poll_controller;
|
||||
#endif
|
||||
SET_ETHTOOL_OPS(dev, ðtool_ops);
|
||||
|
||||
if (mtu)
|
||||
|
|
|
|||
|
|
@ -1957,6 +1957,9 @@ static const struct net_device_ops netdev_ops = {
|
|||
.ndo_set_multicast_list = ns83820_set_multicast,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_tx_timeout = ns83820_tx_timeout,
|
||||
#ifdef NS83820_VLAN_ACCEL_SUPPORT
|
||||
.ndo_vlan_rx_register = ns83820_vlan_rx_register,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
|
||||
|
|
@ -2216,7 +2219,6 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
|
|||
#ifdef NS83820_VLAN_ACCEL_SUPPORT
|
||||
/* We also support hardware vlan acceleration */
|
||||
ndev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
|
||||
ndev->vlan_rx_register = ns83820_vlan_rx_register;
|
||||
#endif
|
||||
|
||||
if (using_dac) {
|
||||
|
|
|
|||
|
|
@ -1568,6 +1568,22 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
return err;
|
||||
}
|
||||
|
||||
static const struct net_device_ops pcnet32_netdev_ops = {
|
||||
.ndo_open = pcnet32_open,
|
||||
.ndo_stop = pcnet32_close,
|
||||
.ndo_start_xmit = pcnet32_start_xmit,
|
||||
.ndo_tx_timeout = pcnet32_tx_timeout,
|
||||
.ndo_get_stats = pcnet32_get_stats,
|
||||
.ndo_set_multicast_list = pcnet32_set_multicast_list,
|
||||
.ndo_do_ioctl = pcnet32_ioctl,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = pcnet32_poll_controller,
|
||||
#endif
|
||||
};
|
||||
|
||||
/* pcnet32_probe1
|
||||
* Called from both pcnet32_probe_vlbus and pcnet_probe_pci.
|
||||
* pdev will be NULL when called from pcnet32_probe_vlbus.
|
||||
|
|
@ -1934,20 +1950,10 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
|
|||
lp->watchdog_timer.function = (void *)&pcnet32_watchdog;
|
||||
|
||||
/* The PCNET32-specific entries in the device structure. */
|
||||
dev->open = &pcnet32_open;
|
||||
dev->hard_start_xmit = &pcnet32_start_xmit;
|
||||
dev->stop = &pcnet32_close;
|
||||
dev->get_stats = &pcnet32_get_stats;
|
||||
dev->set_multicast_list = &pcnet32_set_multicast_list;
|
||||
dev->do_ioctl = &pcnet32_ioctl;
|
||||
dev->netdev_ops = &pcnet32_netdev_ops;
|
||||
dev->ethtool_ops = &pcnet32_ethtool_ops;
|
||||
dev->tx_timeout = pcnet32_tx_timeout;
|
||||
dev->watchdog_timeo = (5 * HZ);
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = pcnet32_poll_controller;
|
||||
#endif
|
||||
|
||||
/* Fill in the generic fields of the device structure. */
|
||||
if (register_netdev(dev))
|
||||
goto err_free_ring;
|
||||
|
|
@ -2276,7 +2282,7 @@ static int pcnet32_open(struct net_device *dev)
|
|||
if (lp->chip_version >= PCNET32_79C970A) {
|
||||
/* Print the link status and start the watchdog */
|
||||
pcnet32_check_media(dev, 1);
|
||||
mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
|
||||
mod_timer(&lp->watchdog_timer, PCNET32_WATCHDOG_TIMEOUT);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
|
|
@ -2911,7 +2917,7 @@ static void pcnet32_watchdog(struct net_device *dev)
|
|||
pcnet32_check_media(dev, 0);
|
||||
spin_unlock_irqrestore(&lp->lock, flags);
|
||||
|
||||
mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
|
||||
mod_timer(&lp->watchdog_timer, round_jiffies(PCNET32_WATCHDOG_TIMEOUT));
|
||||
}
|
||||
|
||||
static int pcnet32_pm_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||
|
|
|
|||
|
|
@ -265,6 +265,13 @@ static const struct header_ops plip_header_ops = {
|
|||
.cache = plip_hard_header_cache,
|
||||
};
|
||||
|
||||
static const struct net_device_ops plip_netdev_ops = {
|
||||
.ndo_open = plip_open,
|
||||
.ndo_stop = plip_close,
|
||||
.ndo_start_xmit = plip_tx_packet,
|
||||
.ndo_do_ioctl = plip_ioctl,
|
||||
};
|
||||
|
||||
/* Entry point of PLIP driver.
|
||||
Probe the hardware, and register/initialize the driver.
|
||||
|
||||
|
|
@ -280,15 +287,11 @@ plip_init_netdev(struct net_device *dev)
|
|||
struct net_local *nl = netdev_priv(dev);
|
||||
|
||||
/* Then, override parts of it */
|
||||
dev->hard_start_xmit = plip_tx_packet;
|
||||
dev->open = plip_open;
|
||||
dev->stop = plip_close;
|
||||
dev->do_ioctl = plip_ioctl;
|
||||
|
||||
dev->tx_queue_len = 10;
|
||||
dev->flags = IFF_POINTOPOINT|IFF_NOARP;
|
||||
memset(dev->dev_addr, 0xfc, ETH_ALEN);
|
||||
|
||||
dev->netdev_ops = &plip_netdev_ops;
|
||||
dev->header_ops = &plip_header_ops;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@
|
|||
#include <asm/processor.h>
|
||||
|
||||
#define DRV_NAME "r6040"
|
||||
#define DRV_VERSION "0.19"
|
||||
#define DRV_RELDATE "18Dec2008"
|
||||
#define DRV_VERSION "0.20"
|
||||
#define DRV_RELDATE "07Jan2009"
|
||||
|
||||
/* PHY CHIP Address */
|
||||
#define PHY1_ADDR 1 /* For MAC1 */
|
||||
|
|
@ -200,7 +200,7 @@ struct r6040_private {
|
|||
|
||||
static char version[] __devinitdata = KERN_INFO DRV_NAME
|
||||
": RDC R6040 NAPI net driver,"
|
||||
"version "DRV_VERSION " (" DRV_RELDATE ")\n";
|
||||
"version "DRV_VERSION " (" DRV_RELDATE ")";
|
||||
|
||||
static int phy_table[] = { PHY1_ADDR, PHY2_ADDR };
|
||||
|
||||
|
|
@ -330,7 +330,7 @@ static int r6040_alloc_rxbufs(struct net_device *dev)
|
|||
do {
|
||||
skb = netdev_alloc_skb(dev, MAX_BUF_SIZE);
|
||||
if (!skb) {
|
||||
printk(KERN_ERR "%s: failed to alloc skb for rx\n", dev->name);
|
||||
printk(KERN_ERR DRV_NAME "%s: failed to alloc skb for rx\n", dev->name);
|
||||
rc = -ENOMEM;
|
||||
goto err_exit;
|
||||
}
|
||||
|
|
@ -1077,20 +1077,20 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
|
|||
/* this should always be supported */
|
||||
err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
|
||||
if (err) {
|
||||
printk(KERN_ERR DRV_NAME "32-bit PCI DMA addresses"
|
||||
printk(KERN_ERR DRV_NAME ": 32-bit PCI DMA addresses"
|
||||
"not supported by the card\n");
|
||||
goto err_out;
|
||||
}
|
||||
err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
|
||||
if (err) {
|
||||
printk(KERN_ERR DRV_NAME "32-bit PCI DMA addresses"
|
||||
printk(KERN_ERR DRV_NAME ": 32-bit PCI DMA addresses"
|
||||
"not supported by the card\n");
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
/* IO Size check */
|
||||
if (pci_resource_len(pdev, 0) < io_size) {
|
||||
printk(KERN_ERR DRV_NAME "Insufficient PCI resources, aborting\n");
|
||||
printk(KERN_ERR DRV_NAME ": Insufficient PCI resources, aborting\n");
|
||||
err = -EIO;
|
||||
goto err_out;
|
||||
}
|
||||
|
|
@ -1100,7 +1100,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
|
|||
|
||||
dev = alloc_etherdev(sizeof(struct r6040_private));
|
||||
if (!dev) {
|
||||
printk(KERN_ERR DRV_NAME "Failed to allocate etherdev\n");
|
||||
printk(KERN_ERR DRV_NAME ": Failed to allocate etherdev\n");
|
||||
err = -ENOMEM;
|
||||
goto err_out;
|
||||
}
|
||||
|
|
@ -1116,11 +1116,15 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
|
|||
|
||||
ioaddr = pci_iomap(pdev, bar, io_size);
|
||||
if (!ioaddr) {
|
||||
printk(KERN_ERR "ioremap failed for device %s\n",
|
||||
printk(KERN_ERR DRV_NAME ": ioremap failed for device %s\n",
|
||||
pci_name(pdev));
|
||||
err = -EIO;
|
||||
goto err_out_free_res;
|
||||
}
|
||||
/* If PHY status change register is still set to zero it means the
|
||||
* bootloader didn't initialize it */
|
||||
if (ioread16(ioaddr + PHY_CC) == 0)
|
||||
iowrite16(0x9f07, ioaddr + PHY_CC);
|
||||
|
||||
/* Init system & device */
|
||||
lp->base = ioaddr;
|
||||
|
|
@ -1137,6 +1141,11 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
|
|||
adrp[1] = ioread16(ioaddr + MID_0M);
|
||||
adrp[2] = ioread16(ioaddr + MID_0H);
|
||||
|
||||
/* Some bootloader/BIOSes do not initialize
|
||||
* MAC address, warn about that */
|
||||
if (!(adrp[0] || adrp[1] || adrp[2]))
|
||||
printk(KERN_WARNING DRV_NAME ": MAC address not initialized\n");
|
||||
|
||||
/* Link new device into r6040_root_dev */
|
||||
lp->pdev = pdev;
|
||||
lp->dev = dev;
|
||||
|
|
|
|||
|
|
@ -134,6 +134,16 @@ static const struct pnp_device_id sb1000_pnp_ids[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(pnp, sb1000_pnp_ids);
|
||||
|
||||
static const struct net_device_ops sb1000_netdev_ops = {
|
||||
.ndo_open = sb1000_open,
|
||||
.ndo_start_xmit = sb1000_start_xmit,
|
||||
.ndo_do_ioctl = sb1000_dev_ioctl,
|
||||
.ndo_stop = sb1000_close,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int
|
||||
sb1000_probe_one(struct pnp_dev *pdev, const struct pnp_device_id *id)
|
||||
{
|
||||
|
|
@ -192,11 +202,7 @@ sb1000_probe_one(struct pnp_dev *pdev, const struct pnp_device_id *id)
|
|||
if (sb1000_debug > 0)
|
||||
printk(KERN_NOTICE "%s", version);
|
||||
|
||||
/* The SB1000-specific entries in the device structure. */
|
||||
dev->open = sb1000_open;
|
||||
dev->do_ioctl = sb1000_dev_ioctl;
|
||||
dev->hard_start_xmit = sb1000_start_xmit;
|
||||
dev->stop = sb1000_close;
|
||||
dev->netdev_ops = &sb1000_netdev_ops;
|
||||
|
||||
/* hardware address is 0:0:serial_number */
|
||||
dev->dev_addr[2] = serial_number >> 24 & 0xff;
|
||||
|
|
|
|||
|
|
@ -1782,6 +1782,21 @@ static int sis190_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
|||
generic_mii_ioctl(&tp->mii_if, if_mii(ifr), cmd, NULL);
|
||||
}
|
||||
|
||||
static const struct net_device_ops sis190_netdev_ops = {
|
||||
.ndo_open = sis190_open,
|
||||
.ndo_stop = sis190_close,
|
||||
.ndo_do_ioctl = sis190_ioctl,
|
||||
.ndo_start_xmit = sis190_start_xmit,
|
||||
.ndo_tx_timeout = sis190_tx_timeout,
|
||||
.ndo_set_multicast_list = sis190_set_rx_mode,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = sis190_netpoll,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __devinit sis190_init_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -1815,19 +1830,12 @@ static int __devinit sis190_init_one(struct pci_dev *pdev,
|
|||
|
||||
INIT_WORK(&tp->phy_task, sis190_phy_task);
|
||||
|
||||
dev->open = sis190_open;
|
||||
dev->stop = sis190_close;
|
||||
dev->do_ioctl = sis190_ioctl;
|
||||
dev->tx_timeout = sis190_tx_timeout;
|
||||
dev->watchdog_timeo = SIS190_TX_TIMEOUT;
|
||||
dev->hard_start_xmit = sis190_start_xmit;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = sis190_netpoll;
|
||||
#endif
|
||||
dev->set_multicast_list = sis190_set_rx_mode;
|
||||
dev->netdev_ops = &sis190_netdev_ops;
|
||||
|
||||
SET_ETHTOOL_OPS(dev, &sis190_ethtool_ops);
|
||||
dev->irq = pdev->irq;
|
||||
dev->base_addr = (unsigned long) 0xdead;
|
||||
dev->watchdog_timeo = SIS190_TX_TIMEOUT;
|
||||
|
||||
spin_lock_init(&tp->lock);
|
||||
|
||||
|
|
|
|||
|
|
@ -603,7 +603,6 @@ static int sl_init(struct net_device *dev)
|
|||
dev->mtu = sl->mtu;
|
||||
dev->type = ARPHRD_SLIP + sl->mode;
|
||||
#ifdef SL_CHECK_TRANSMIT
|
||||
dev->tx_timeout = sl_tx_timeout;
|
||||
dev->watchdog_timeo = 20*HZ;
|
||||
#endif
|
||||
return 0;
|
||||
|
|
@ -617,19 +616,26 @@ static void sl_uninit(struct net_device *dev)
|
|||
sl_free_bufs(sl);
|
||||
}
|
||||
|
||||
static const struct net_device_ops sl_netdev_ops = {
|
||||
.ndo_init = sl_init,
|
||||
.ndo_uninit = sl_uninit,
|
||||
.ndo_open = sl_open,
|
||||
.ndo_stop = sl_close,
|
||||
.ndo_start_xmit = sl_xmit,
|
||||
.ndo_get_stats = sl_get_stats,
|
||||
.ndo_change_mtu = sl_change_mtu,
|
||||
.ndo_tx_timeout = sl_tx_timeout,
|
||||
#ifdef CONFIG_SLIP_SMART
|
||||
.ndo_do_ioctl = sl_ioctl,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
static void sl_setup(struct net_device *dev)
|
||||
{
|
||||
dev->init = sl_init;
|
||||
dev->uninit = sl_uninit;
|
||||
dev->open = sl_open;
|
||||
dev->netdev_ops = &sl_netdev_ops;
|
||||
dev->destructor = free_netdev;
|
||||
dev->stop = sl_close;
|
||||
dev->get_stats = sl_get_stats;
|
||||
dev->change_mtu = sl_change_mtu;
|
||||
dev->hard_start_xmit = sl_xmit;
|
||||
#ifdef CONFIG_SLIP_SMART
|
||||
dev->do_ioctl = sl_ioctl;
|
||||
#endif
|
||||
|
||||
dev->hard_header_len = 0;
|
||||
dev->addr_len = 0;
|
||||
dev->tx_queue_len = 10;
|
||||
|
|
|
|||
|
|
@ -648,6 +648,24 @@ static void netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
|
|||
#endif /* VLAN_SUPPORT */
|
||||
|
||||
|
||||
static const struct net_device_ops netdev_ops = {
|
||||
.ndo_open = netdev_open,
|
||||
.ndo_stop = netdev_close,
|
||||
.ndo_start_xmit = start_tx,
|
||||
.ndo_tx_timeout = tx_timeout,
|
||||
.ndo_get_stats = get_stats,
|
||||
.ndo_set_multicast_list = &set_rx_mode,
|
||||
.ndo_do_ioctl = netdev_ioctl,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef VLAN_SUPPORT
|
||||
.ndo_vlan_rx_register = netdev_vlan_rx_register,
|
||||
.ndo_vlan_rx_add_vid = netdev_vlan_rx_add_vid,
|
||||
.ndo_vlan_rx_kill_vid = netdev_vlan_rx_kill_vid,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __devinit starfire_init_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -710,11 +728,9 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
|
|||
if (enable_hw_cksum)
|
||||
dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
|
||||
#endif /* ZEROCOPY */
|
||||
|
||||
#ifdef VLAN_SUPPORT
|
||||
dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
|
||||
dev->vlan_rx_register = netdev_vlan_rx_register;
|
||||
dev->vlan_rx_add_vid = netdev_vlan_rx_add_vid;
|
||||
dev->vlan_rx_kill_vid = netdev_vlan_rx_kill_vid;
|
||||
#endif /* VLAN_RX_KILL_VID */
|
||||
#ifdef ADDR_64BITS
|
||||
dev->features |= NETIF_F_HIGHDMA;
|
||||
|
|
@ -810,18 +826,12 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
|
|||
}
|
||||
}
|
||||
|
||||
/* The chip-specific entries in the device structure. */
|
||||
dev->open = &netdev_open;
|
||||
dev->hard_start_xmit = &start_tx;
|
||||
dev->tx_timeout = tx_timeout;
|
||||
dev->netdev_ops = &netdev_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
netif_napi_add(dev, &np->napi, netdev_poll, max_interrupt_work);
|
||||
dev->stop = &netdev_close;
|
||||
dev->get_stats = &get_stats;
|
||||
dev->set_multicast_list = &set_rx_mode;
|
||||
dev->do_ioctl = &netdev_ioctl;
|
||||
SET_ETHTOOL_OPS(dev, ðtool_ops);
|
||||
|
||||
netif_napi_add(dev, &np->napi, netdev_poll, max_interrupt_work);
|
||||
|
||||
if (mtu)
|
||||
dev->mtu = mtu;
|
||||
|
||||
|
|
|
|||
|
|
@ -449,6 +449,19 @@ static void sundance_reset(struct net_device *dev, unsigned long reset_cmd)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct net_device_ops netdev_ops = {
|
||||
.ndo_open = netdev_open,
|
||||
.ndo_stop = netdev_close,
|
||||
.ndo_start_xmit = start_tx,
|
||||
.ndo_get_stats = get_stats,
|
||||
.ndo_set_multicast_list = set_rx_mode,
|
||||
.ndo_do_ioctl = netdev_ioctl,
|
||||
.ndo_tx_timeout = tx_timeout,
|
||||
.ndo_change_mtu = change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit sundance_probe1 (struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -530,16 +543,10 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
|
|||
np->mii_if.reg_num_mask = 0x1f;
|
||||
|
||||
/* The chip-specific entries in the device structure. */
|
||||
dev->open = &netdev_open;
|
||||
dev->hard_start_xmit = &start_tx;
|
||||
dev->stop = &netdev_close;
|
||||
dev->get_stats = &get_stats;
|
||||
dev->set_multicast_list = &set_rx_mode;
|
||||
dev->do_ioctl = &netdev_ioctl;
|
||||
dev->netdev_ops = &netdev_ops;
|
||||
SET_ETHTOOL_OPS(dev, ðtool_ops);
|
||||
dev->tx_timeout = &tx_timeout;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
dev->change_mtu = &change_mtu;
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
|
||||
i = register_netdev(dev);
|
||||
|
|
|
|||
|
|
@ -2989,6 +2989,19 @@ static void gem_remove_one(struct pci_dev *pdev)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct net_device_ops gem_netdev_ops = {
|
||||
.ndo_open = gem_open,
|
||||
.ndo_stop = gem_close,
|
||||
.ndo_start_xmit = gem_start_xmit,
|
||||
.ndo_get_stats = gem_get_stats,
|
||||
.ndo_set_multicast_list = gem_set_multicast,
|
||||
.ndo_do_ioctl = gem_ioctl,
|
||||
.ndo_tx_timeout = gem_tx_timeout,
|
||||
.ndo_change_mtu = gem_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit gem_init_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -3142,17 +3155,10 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
|
|||
if (gem_get_device_address(gp))
|
||||
goto err_out_free_consistent;
|
||||
|
||||
dev->open = gem_open;
|
||||
dev->stop = gem_close;
|
||||
dev->hard_start_xmit = gem_start_xmit;
|
||||
dev->get_stats = gem_get_stats;
|
||||
dev->set_multicast_list = gem_set_multicast;
|
||||
dev->do_ioctl = gem_ioctl;
|
||||
dev->netdev_ops = &gem_netdev_ops;
|
||||
netif_napi_add(dev, &gp->napi, gem_poll, 64);
|
||||
dev->ethtool_ops = &gem_ethtool_ops;
|
||||
dev->tx_timeout = gem_tx_timeout;
|
||||
dev->watchdog_timeo = 5 * HZ;
|
||||
dev->change_mtu = gem_change_mtu;
|
||||
dev->irq = pdev->irq;
|
||||
dev->dma = 0;
|
||||
dev->set_mac_address = gem_set_mac_address;
|
||||
|
|
|
|||
|
|
@ -2607,6 +2607,18 @@ static struct quattro * __devinit quattro_pci_find(struct pci_dev *pdev)
|
|||
}
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
static const struct net_device_ops hme_netdev_ops = {
|
||||
.ndo_open = happy_meal_open,
|
||||
.ndo_stop = happy_meal_close,
|
||||
.ndo_start_xmit = happy_meal_start_xmit,
|
||||
.ndo_tx_timeout = happy_meal_tx_timeout,
|
||||
.ndo_get_stats = happy_meal_get_stats,
|
||||
.ndo_set_multicast_list = happy_meal_set_multicast,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SBUS
|
||||
static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
|
||||
{
|
||||
|
|
@ -2750,12 +2762,7 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
|
|||
init_timer(&hp->happy_timer);
|
||||
|
||||
hp->dev = dev;
|
||||
dev->open = &happy_meal_open;
|
||||
dev->stop = &happy_meal_close;
|
||||
dev->hard_start_xmit = &happy_meal_start_xmit;
|
||||
dev->get_stats = &happy_meal_get_stats;
|
||||
dev->set_multicast_list = &happy_meal_set_multicast;
|
||||
dev->tx_timeout = &happy_meal_tx_timeout;
|
||||
dev->netdev_ops = &hme_netdev_ops;
|
||||
dev->watchdog_timeo = 5*HZ;
|
||||
dev->ethtool_ops = &hme_ethtool_ops;
|
||||
|
||||
|
|
@ -3076,12 +3083,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
|
|||
init_timer(&hp->happy_timer);
|
||||
|
||||
hp->dev = dev;
|
||||
dev->open = &happy_meal_open;
|
||||
dev->stop = &happy_meal_close;
|
||||
dev->hard_start_xmit = &happy_meal_start_xmit;
|
||||
dev->get_stats = &happy_meal_get_stats;
|
||||
dev->set_multicast_list = &happy_meal_set_multicast;
|
||||
dev->tx_timeout = &happy_meal_tx_timeout;
|
||||
dev->netdev_ops = &hme_netdev_ops;
|
||||
dev->watchdog_timeo = 5*HZ;
|
||||
dev->ethtool_ops = &hme_ethtool_ops;
|
||||
dev->irq = pdev->irq;
|
||||
|
|
|
|||
|
|
@ -831,6 +831,21 @@ static void TLan_Poll(struct net_device *dev)
|
|||
}
|
||||
#endif
|
||||
|
||||
static const struct net_device_ops TLan_netdev_ops = {
|
||||
.ndo_open = TLan_Open,
|
||||
.ndo_stop = TLan_Close,
|
||||
.ndo_start_xmit = TLan_StartTx,
|
||||
.ndo_tx_timeout = TLan_tx_timeout,
|
||||
.ndo_get_stats = TLan_GetStats,
|
||||
.ndo_set_multicast_list = TLan_SetMulticastList,
|
||||
.ndo_do_ioctl = TLan_ioctl,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = TLan_Poll,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -892,16 +907,7 @@ static int TLan_Init( struct net_device *dev )
|
|||
netif_carrier_off(dev);
|
||||
|
||||
/* Device methods */
|
||||
dev->open = &TLan_Open;
|
||||
dev->hard_start_xmit = &TLan_StartTx;
|
||||
dev->stop = &TLan_Close;
|
||||
dev->get_stats = &TLan_GetStats;
|
||||
dev->set_multicast_list = &TLan_SetMulticastList;
|
||||
dev->do_ioctl = &TLan_ioctl;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = &TLan_Poll;
|
||||
#endif
|
||||
dev->tx_timeout = &TLan_tx_timeout;
|
||||
dev->netdev_ops = &TLan_netdev_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1922,6 +1922,18 @@ bad_srom:
|
|||
goto fill_defaults;
|
||||
}
|
||||
|
||||
static const struct net_device_ops de_netdev_ops = {
|
||||
.ndo_open = de_open,
|
||||
.ndo_stop = de_close,
|
||||
.ndo_set_multicast_list = de_set_rx_mode,
|
||||
.ndo_start_xmit = de_start_xmit,
|
||||
.ndo_get_stats = de_get_stats,
|
||||
.ndo_tx_timeout = de_tx_timeout,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit de_init_one (struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -1944,14 +1956,9 @@ static int __devinit de_init_one (struct pci_dev *pdev,
|
|||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
dev->netdev_ops = &de_netdev_ops;
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
dev->open = de_open;
|
||||
dev->stop = de_close;
|
||||
dev->set_multicast_list = de_set_rx_mode;
|
||||
dev->hard_start_xmit = de_start_xmit;
|
||||
dev->get_stats = de_get_stats;
|
||||
dev->ethtool_ops = &de_ethtool_ops;
|
||||
dev->tx_timeout = de_tx_timeout;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
|
||||
de = netdev_priv(dev);
|
||||
|
|
|
|||
|
|
@ -1077,6 +1077,18 @@ static int (*dc_infoblock[])(struct net_device *dev, u_char, u_char *) = {
|
|||
mdelay(2); /* Wait for 2ms */\
|
||||
}
|
||||
|
||||
static const struct net_device_ops de4x5_netdev_ops = {
|
||||
.ndo_open = de4x5_open,
|
||||
.ndo_stop = de4x5_close,
|
||||
.ndo_start_xmit = de4x5_queue_pkt,
|
||||
.ndo_get_stats = de4x5_get_stats,
|
||||
.ndo_set_multicast_list = set_multicast_list,
|
||||
.ndo_do_ioctl = de4x5_ioctl,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address= eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
|
||||
static int __devinit
|
||||
de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
|
||||
|
|
@ -1258,13 +1270,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
|
|||
|
||||
/* The DE4X5-specific entries in the device structure. */
|
||||
SET_NETDEV_DEV(dev, gendev);
|
||||
dev->open = &de4x5_open;
|
||||
dev->hard_start_xmit = &de4x5_queue_pkt;
|
||||
dev->stop = &de4x5_close;
|
||||
dev->get_stats = &de4x5_get_stats;
|
||||
dev->set_multicast_list = &set_multicast_list;
|
||||
dev->do_ioctl = &de4x5_ioctl;
|
||||
|
||||
dev->netdev_ops = &de4x5_netdev_ops;
|
||||
dev->mem_start = 0;
|
||||
|
||||
/* Fill in the generic fields of the device structure. */
|
||||
|
|
|
|||
|
|
@ -257,9 +257,6 @@ struct dmfe_board_info {
|
|||
u8 wol_mode; /* user WOL settings */
|
||||
struct timer_list timer;
|
||||
|
||||
/* System defined statistic counter */
|
||||
struct net_device_stats stats;
|
||||
|
||||
/* Driver defined statistic counter */
|
||||
unsigned long tx_fifo_underrun;
|
||||
unsigned long tx_loss_carrier;
|
||||
|
|
@ -316,7 +313,6 @@ static u8 SF_mode; /* Special Function: 1:VLAN, 2:RX Flow Control
|
|||
static int dmfe_open(struct DEVICE *);
|
||||
static int dmfe_start_xmit(struct sk_buff *, struct DEVICE *);
|
||||
static int dmfe_stop(struct DEVICE *);
|
||||
static struct net_device_stats * dmfe_get_stats(struct DEVICE *);
|
||||
static void dmfe_set_filter_mode(struct DEVICE *);
|
||||
static const struct ethtool_ops netdev_ethtool_ops;
|
||||
static u16 read_srom_word(long ,int);
|
||||
|
|
@ -351,6 +347,19 @@ static void dmfe_set_phyxcer(struct dmfe_board_info *);
|
|||
|
||||
/* DM910X network board routine ---------------------------- */
|
||||
|
||||
static const struct net_device_ops netdev_ops = {
|
||||
.ndo_open = dmfe_open,
|
||||
.ndo_stop = dmfe_stop,
|
||||
.ndo_start_xmit = dmfe_start_xmit,
|
||||
.ndo_set_multicast_list = dmfe_set_filter_mode,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = poll_dmfe,
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* Search DM910X board ,allocate space and register it
|
||||
*/
|
||||
|
|
@ -442,14 +451,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
|
|||
dev->base_addr = db->ioaddr;
|
||||
dev->irq = pdev->irq;
|
||||
pci_set_drvdata(pdev, dev);
|
||||
dev->open = &dmfe_open;
|
||||
dev->hard_start_xmit = &dmfe_start_xmit;
|
||||
dev->stop = &dmfe_stop;
|
||||
dev->get_stats = &dmfe_get_stats;
|
||||
dev->set_multicast_list = &dmfe_set_filter_mode;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = &poll_dmfe;
|
||||
#endif
|
||||
dev->netdev_ops = &netdev_ops;
|
||||
dev->ethtool_ops = &netdev_ethtool_ops;
|
||||
netif_carrier_off(dev);
|
||||
spin_lock_init(&db->lock);
|
||||
|
|
@ -867,15 +869,15 @@ static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db)
|
|||
|
||||
/* A packet sent completed */
|
||||
db->tx_packet_cnt--;
|
||||
db->stats.tx_packets++;
|
||||
dev->stats.tx_packets++;
|
||||
|
||||
/* Transmit statistic counter */
|
||||
if ( tdes0 != 0x7fffffff ) {
|
||||
/* printk(DRV_NAME ": tdes0=%x\n", tdes0); */
|
||||
db->stats.collisions += (tdes0 >> 3) & 0xf;
|
||||
db->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff;
|
||||
dev->stats.collisions += (tdes0 >> 3) & 0xf;
|
||||
dev->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff;
|
||||
if (tdes0 & TDES0_ERR_MASK) {
|
||||
db->stats.tx_errors++;
|
||||
dev->stats.tx_errors++;
|
||||
|
||||
if (tdes0 & 0x0002) { /* UnderRun */
|
||||
db->tx_fifo_underrun++;
|
||||
|
|
@ -969,13 +971,13 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
|
|||
if (rdes0 & 0x8000) {
|
||||
/* This is a error packet */
|
||||
//printk(DRV_NAME ": rdes0: %lx\n", rdes0);
|
||||
db->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
if (rdes0 & 1)
|
||||
db->stats.rx_fifo_errors++;
|
||||
dev->stats.rx_fifo_errors++;
|
||||
if (rdes0 & 2)
|
||||
db->stats.rx_crc_errors++;
|
||||
dev->stats.rx_crc_errors++;
|
||||
if (rdes0 & 0x80)
|
||||
db->stats.rx_length_errors++;
|
||||
dev->stats.rx_length_errors++;
|
||||
}
|
||||
|
||||
if ( !(rdes0 & 0x8000) ||
|
||||
|
|
@ -1008,8 +1010,8 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
|
|||
|
||||
skb->protocol = eth_type_trans(skb, dev);
|
||||
netif_rx(skb);
|
||||
db->stats.rx_packets++;
|
||||
db->stats.rx_bytes += rxlen;
|
||||
dev->stats.rx_packets++;
|
||||
dev->stats.rx_bytes += rxlen;
|
||||
}
|
||||
} else {
|
||||
/* Reuse SKB buffer when the packet is error */
|
||||
|
|
@ -1024,20 +1026,6 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
|
|||
db->rx_ready_ptr = rxptr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get statistics from driver.
|
||||
*/
|
||||
|
||||
static struct net_device_stats * dmfe_get_stats(struct DEVICE *dev)
|
||||
{
|
||||
struct dmfe_board_info *db = netdev_priv(dev);
|
||||
|
||||
DMFE_DBUG(0, "dmfe_get_stats", 0);
|
||||
return &db->stats;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set DM910X multicast address
|
||||
*/
|
||||
|
|
@ -1161,7 +1149,7 @@ static void dmfe_timer(unsigned long data)
|
|||
|
||||
/* Operating Mode Check */
|
||||
if ( (db->dm910x_chk_mode & 0x1) &&
|
||||
(db->stats.rx_packets > MAX_CHECK_PACKET) )
|
||||
(dev->stats.rx_packets > MAX_CHECK_PACKET) )
|
||||
db->dm910x_chk_mode = 0x4;
|
||||
|
||||
/* Dynamic reset DM910X : system error or transmit time-out */
|
||||
|
|
|
|||
|
|
@ -1225,6 +1225,22 @@ static int tulip_uli_dm_quirk(struct pci_dev *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops tulip_netdev_ops = {
|
||||
.ndo_open = tulip_open,
|
||||
.ndo_start_xmit = tulip_start_xmit,
|
||||
.ndo_tx_timeout = tulip_tx_timeout,
|
||||
.ndo_stop = tulip_close,
|
||||
.ndo_get_stats = tulip_get_stats,
|
||||
.ndo_do_ioctl = private_ioctl,
|
||||
.ndo_set_multicast_list = set_rx_mode,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = poll_tulip,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __devinit tulip_init_one (struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -1601,19 +1617,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
|
|||
}
|
||||
|
||||
/* The Tulip-specific entries in the device structure. */
|
||||
dev->open = tulip_open;
|
||||
dev->hard_start_xmit = tulip_start_xmit;
|
||||
dev->tx_timeout = tulip_tx_timeout;
|
||||
dev->netdev_ops = &tulip_netdev_ops;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
#ifdef CONFIG_TULIP_NAPI
|
||||
netif_napi_add(dev, &tp->napi, tulip_poll, 16);
|
||||
#endif
|
||||
dev->stop = tulip_close;
|
||||
dev->get_stats = tulip_get_stats;
|
||||
dev->do_ioctl = private_ioctl;
|
||||
dev->set_multicast_list = set_rx_mode;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = &poll_tulip;
|
||||
#endif
|
||||
SET_ETHTOOL_OPS(dev, &ops);
|
||||
|
||||
|
|
|
|||
|
|
@ -168,9 +168,6 @@ struct uli526x_board_info {
|
|||
u8 wait_reset; /* Hardware failed, need to reset */
|
||||
struct timer_list timer;
|
||||
|
||||
/* System defined statistic counter */
|
||||
struct net_device_stats stats;
|
||||
|
||||
/* Driver defined statistic counter */
|
||||
unsigned long tx_fifo_underrun;
|
||||
unsigned long tx_loss_carrier;
|
||||
|
|
@ -220,7 +217,6 @@ static int mode = 8;
|
|||
static int uli526x_open(struct net_device *);
|
||||
static int uli526x_start_xmit(struct sk_buff *, struct net_device *);
|
||||
static int uli526x_stop(struct net_device *);
|
||||
static struct net_device_stats * uli526x_get_stats(struct net_device *);
|
||||
static void uli526x_set_filter_mode(struct net_device *);
|
||||
static const struct ethtool_ops netdev_ethtool_ops;
|
||||
static u16 read_srom_word(long, int);
|
||||
|
|
@ -251,6 +247,19 @@ static void uli526x_set_phyxcer(struct uli526x_board_info *);
|
|||
|
||||
/* ULI526X network board routine ---------------------------- */
|
||||
|
||||
static const struct net_device_ops netdev_ops = {
|
||||
.ndo_open = uli526x_open,
|
||||
.ndo_stop = uli526x_stop,
|
||||
.ndo_start_xmit = uli526x_start_xmit,
|
||||
.ndo_set_multicast_list = uli526x_set_filter_mode,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = uli526x_poll,
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* Search ULI526X board, allocate space and register it
|
||||
*/
|
||||
|
|
@ -335,15 +344,9 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev,
|
|||
pci_set_drvdata(pdev, dev);
|
||||
|
||||
/* Register some necessary functions */
|
||||
dev->open = &uli526x_open;
|
||||
dev->hard_start_xmit = &uli526x_start_xmit;
|
||||
dev->stop = &uli526x_stop;
|
||||
dev->get_stats = &uli526x_get_stats;
|
||||
dev->set_multicast_list = &uli526x_set_filter_mode;
|
||||
dev->netdev_ops = &netdev_ops;
|
||||
dev->ethtool_ops = &netdev_ethtool_ops;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = &uli526x_poll;
|
||||
#endif
|
||||
|
||||
spin_lock_init(&db->lock);
|
||||
|
||||
|
||||
|
|
@ -733,7 +736,8 @@ static void uli526x_poll(struct net_device *dev)
|
|||
* Free TX resource after TX complete
|
||||
*/
|
||||
|
||||
static void uli526x_free_tx_pkt(struct net_device *dev, struct uli526x_board_info * db)
|
||||
static void uli526x_free_tx_pkt(struct net_device *dev,
|
||||
struct uli526x_board_info * db)
|
||||
{
|
||||
struct tx_desc *txptr;
|
||||
u32 tdes0;
|
||||
|
|
@ -747,15 +751,15 @@ static void uli526x_free_tx_pkt(struct net_device *dev, struct uli526x_board_inf
|
|||
|
||||
/* A packet sent completed */
|
||||
db->tx_packet_cnt--;
|
||||
db->stats.tx_packets++;
|
||||
dev->stats.tx_packets++;
|
||||
|
||||
/* Transmit statistic counter */
|
||||
if ( tdes0 != 0x7fffffff ) {
|
||||
/* printk(DRV_NAME ": tdes0=%x\n", tdes0); */
|
||||
db->stats.collisions += (tdes0 >> 3) & 0xf;
|
||||
db->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff;
|
||||
dev->stats.collisions += (tdes0 >> 3) & 0xf;
|
||||
dev->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff;
|
||||
if (tdes0 & TDES0_ERR_MASK) {
|
||||
db->stats.tx_errors++;
|
||||
dev->stats.tx_errors++;
|
||||
if (tdes0 & 0x0002) { /* UnderRun */
|
||||
db->tx_fifo_underrun++;
|
||||
if ( !(db->cr6_data & CR6_SFT) ) {
|
||||
|
|
@ -825,13 +829,13 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info
|
|||
if (rdes0 & 0x8000) {
|
||||
/* This is a error packet */
|
||||
//printk(DRV_NAME ": rdes0: %lx\n", rdes0);
|
||||
db->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
if (rdes0 & 1)
|
||||
db->stats.rx_fifo_errors++;
|
||||
dev->stats.rx_fifo_errors++;
|
||||
if (rdes0 & 2)
|
||||
db->stats.rx_crc_errors++;
|
||||
dev->stats.rx_crc_errors++;
|
||||
if (rdes0 & 0x80)
|
||||
db->stats.rx_length_errors++;
|
||||
dev->stats.rx_length_errors++;
|
||||
}
|
||||
|
||||
if ( !(rdes0 & 0x8000) ||
|
||||
|
|
@ -854,8 +858,8 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info
|
|||
|
||||
skb->protocol = eth_type_trans(skb, dev);
|
||||
netif_rx(skb);
|
||||
db->stats.rx_packets++;
|
||||
db->stats.rx_bytes += rxlen;
|
||||
dev->stats.rx_packets++;
|
||||
dev->stats.rx_bytes += rxlen;
|
||||
|
||||
} else {
|
||||
/* Reuse SKB buffer when the packet is error */
|
||||
|
|
@ -871,19 +875,6 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get statistics from driver.
|
||||
*/
|
||||
|
||||
static struct net_device_stats * uli526x_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct uli526x_board_info *db = netdev_priv(dev);
|
||||
|
||||
ULI526X_DBUG(0, "uli526x_get_stats", 0);
|
||||
return &db->stats;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set ULI526X multicast address
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -343,7 +343,18 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
|||
static const struct ethtool_ops netdev_ethtool_ops;
|
||||
static int netdev_close(struct net_device *dev);
|
||||
|
||||
|
||||
static const struct net_device_ops netdev_ops = {
|
||||
.ndo_open = netdev_open,
|
||||
.ndo_stop = netdev_close,
|
||||
.ndo_start_xmit = start_tx,
|
||||
.ndo_get_stats = get_stats,
|
||||
.ndo_set_multicast_list = set_rx_mode,
|
||||
.ndo_do_ioctl = netdev_ioctl,
|
||||
.ndo_tx_timeout = tx_timeout,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static int __devinit w840_probe1 (struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
|
|
@ -420,14 +431,8 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
|
|||
np->mii_if.force_media = 1;
|
||||
|
||||
/* The chip-specific entries in the device structure. */
|
||||
dev->open = &netdev_open;
|
||||
dev->hard_start_xmit = &start_tx;
|
||||
dev->stop = &netdev_close;
|
||||
dev->get_stats = &get_stats;
|
||||
dev->set_multicast_list = &set_rx_mode;
|
||||
dev->do_ioctl = &netdev_ioctl;
|
||||
dev->netdev_ops = &netdev_ops;
|
||||
dev->ethtool_ops = &netdev_ethtool_ops;
|
||||
dev->tx_timeout = &tx_timeout;
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
|
||||
i = register_netdev(dev);
|
||||
|
|
@ -1555,7 +1560,7 @@ static void __devexit w840_remove1 (struct pci_dev *pdev)
|
|||
* rtnl_lock, & netif_device_detach after the rtnl_unlock.
|
||||
* - get_stats:
|
||||
* spin_lock_irq(np->lock), doesn't touch hw if not present
|
||||
* - hard_start_xmit:
|
||||
* - start_xmit:
|
||||
* synchronize_irq + netif_tx_disable;
|
||||
* - tx_timeout:
|
||||
* netif_device_detach + netif_tx_disable;
|
||||
|
|
|
|||
|
|
@ -104,10 +104,8 @@ struct xircom_private {
|
|||
*/
|
||||
spinlock_t lock;
|
||||
|
||||
|
||||
struct pci_dev *pdev;
|
||||
struct net_device *dev;
|
||||
struct net_device_stats stats;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -119,7 +117,6 @@ static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev);
|
|||
static int xircom_open(struct net_device *dev);
|
||||
static int xircom_close(struct net_device *dev);
|
||||
static void xircom_up(struct xircom_private *card);
|
||||
static struct net_device_stats *xircom_get_stats(struct net_device *dev);
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static void xircom_poll_controller(struct net_device *dev);
|
||||
#endif
|
||||
|
|
@ -194,6 +191,18 @@ static const struct ethtool_ops netdev_ethtool_ops = {
|
|||
.get_drvinfo = netdev_get_drvinfo,
|
||||
};
|
||||
|
||||
static const struct net_device_ops netdev_ops = {
|
||||
.ndo_open = xircom_open,
|
||||
.ndo_stop = xircom_close,
|
||||
.ndo_start_xmit = xircom_start_xmit,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = xircom_poll_controller,
|
||||
#endif
|
||||
};
|
||||
|
||||
/* xircom_probe is the code that gets called on device insertion.
|
||||
it sets up the hardware and registers the device to the networklayer.
|
||||
|
||||
|
|
@ -266,13 +275,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
|
|||
read_mac_address(private);
|
||||
setup_descriptors(private);
|
||||
|
||||
dev->open = &xircom_open;
|
||||
dev->hard_start_xmit = &xircom_start_xmit;
|
||||
dev->stop = &xircom_close;
|
||||
dev->get_stats = &xircom_get_stats;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = &xircom_poll_controller;
|
||||
#endif
|
||||
dev->netdev_ops = &netdev_ops;
|
||||
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
||||
pci_set_drvdata(pdev, dev);
|
||||
|
||||
|
|
@ -497,14 +500,6 @@ static int xircom_close(struct net_device *dev)
|
|||
}
|
||||
|
||||
|
||||
|
||||
static struct net_device_stats *xircom_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct xircom_private *card = netdev_priv(dev);
|
||||
return &card->stats;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static void xircom_poll_controller(struct net_device *dev)
|
||||
{
|
||||
|
|
@ -1193,7 +1188,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri
|
|||
|
||||
skb = dev_alloc_skb(pkt_len + 2);
|
||||
if (skb == NULL) {
|
||||
card->stats.rx_dropped++;
|
||||
dev->stats.rx_dropped++;
|
||||
goto out;
|
||||
}
|
||||
skb_reserve(skb, 2);
|
||||
|
|
@ -1201,8 +1196,8 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri
|
|||
skb_put(skb, pkt_len);
|
||||
skb->protocol = eth_type_trans(skb, dev);
|
||||
netif_rx(skb);
|
||||
card->stats.rx_packets++;
|
||||
card->stats.rx_bytes += pkt_len;
|
||||
dev->stats.rx_packets++;
|
||||
dev->stats.rx_bytes += pkt_len;
|
||||
|
||||
out:
|
||||
/* give the buffer back to the card */
|
||||
|
|
@ -1232,16 +1227,16 @@ static void investigate_write_descriptor(struct net_device *dev, struct xircom_p
|
|||
#endif
|
||||
if (status > 0) { /* bit 31 is 0 when done */
|
||||
if (card->tx_skb[descnr]!=NULL) {
|
||||
card->stats.tx_bytes += card->tx_skb[descnr]->len;
|
||||
dev->stats.tx_bytes += card->tx_skb[descnr]->len;
|
||||
dev_kfree_skb_irq(card->tx_skb[descnr]);
|
||||
}
|
||||
card->tx_skb[descnr] = NULL;
|
||||
/* Bit 8 in the status field is 1 if there was a collision */
|
||||
if (status&(1<<8))
|
||||
card->stats.collisions++;
|
||||
dev->stats.collisions++;
|
||||
card->tx_buffer[4*descnr] = 0; /* descriptor is free again */
|
||||
netif_wake_queue (dev);
|
||||
card->stats.tx_packets++;
|
||||
dev->stats.tx_packets++;
|
||||
}
|
||||
|
||||
leave("investigate_write_descriptor");
|
||||
|
|
|
|||
|
|
@ -2296,6 +2296,19 @@ out:
|
|||
return mode;
|
||||
}
|
||||
|
||||
static const struct net_device_ops typhoon_netdev_ops = {
|
||||
.ndo_open = typhoon_open,
|
||||
.ndo_stop = typhoon_close,
|
||||
.ndo_start_xmit = typhoon_start_tx,
|
||||
.ndo_set_multicast_list = typhoon_set_rx_mode,
|
||||
.ndo_tx_timeout = typhoon_tx_timeout,
|
||||
.ndo_get_stats = typhoon_get_stats,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_set_mac_address = typhoon_set_mac_address,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_vlan_rx_register = typhoon_vlan_rx_register,
|
||||
};
|
||||
|
||||
static int __devinit
|
||||
typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
{
|
||||
|
|
@ -2495,16 +2508,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
}
|
||||
|
||||
/* The chip-specific entries in the device structure. */
|
||||
dev->open = typhoon_open;
|
||||
dev->hard_start_xmit = typhoon_start_tx;
|
||||
dev->stop = typhoon_close;
|
||||
dev->set_multicast_list = typhoon_set_rx_mode;
|
||||
dev->tx_timeout = typhoon_tx_timeout;
|
||||
dev->netdev_ops = &typhoon_netdev_ops;
|
||||
netif_napi_add(dev, &tp->napi, typhoon_poll, 16);
|
||||
dev->watchdog_timeo = TX_TIMEOUT;
|
||||
dev->get_stats = typhoon_get_stats;
|
||||
dev->set_mac_address = typhoon_set_mac_address;
|
||||
dev->vlan_rx_register = typhoon_vlan_rx_register;
|
||||
|
||||
SET_ETHTOOL_OPS(dev, &typhoon_ethtool_ops);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include <linux/usb/usbnet.h>
|
||||
|
||||
/* datasheet:
|
||||
http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf
|
||||
http://ptm2.cc.utu.fi/ftp/network/cards/DM9601/From_NET/DM9601-DS-P01-930914.pdf
|
||||
*/
|
||||
|
||||
/* control requests */
|
||||
|
|
@ -397,16 +397,24 @@ static void dm9601_set_multicast(struct net_device *net)
|
|||
dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl);
|
||||
}
|
||||
|
||||
static void __dm9601_set_mac_address(struct usbnet *dev)
|
||||
{
|
||||
dm_write_async(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr);
|
||||
}
|
||||
|
||||
static int dm9601_set_mac_address(struct net_device *net, void *p)
|
||||
{
|
||||
struct sockaddr *addr = p;
|
||||
struct usbnet *dev = netdev_priv(net);
|
||||
|
||||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
if (!is_valid_ether_addr(addr->sa_data)) {
|
||||
dev_err(&net->dev, "not setting invalid mac address %pM\n",
|
||||
addr->sa_data);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memcpy(net->dev_addr, addr->sa_data, net->addr_len);
|
||||
dm_write_async(dev, DM_PHY_ADDR, net->addr_len, net->dev_addr);
|
||||
__dm9601_set_mac_address(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -414,6 +422,7 @@ static int dm9601_set_mac_address(struct net_device *net, void *p)
|
|||
static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
{
|
||||
int ret;
|
||||
u8 mac[ETH_ALEN];
|
||||
|
||||
ret = usbnet_get_endpoints(dev, intf);
|
||||
if (ret)
|
||||
|
|
@ -438,12 +447,24 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
|
|||
udelay(20);
|
||||
|
||||
/* read MAC */
|
||||
if (dm_read(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr) < 0) {
|
||||
if (dm_read(dev, DM_PHY_ADDR, ETH_ALEN, mac) < 0) {
|
||||
printk(KERN_ERR "Error reading MAC address\n");
|
||||
ret = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Overwrite the auto-generated address only with good ones.
|
||||
*/
|
||||
if (is_valid_ether_addr(mac))
|
||||
memcpy(dev->net->dev_addr, mac, ETH_ALEN);
|
||||
else {
|
||||
printk(KERN_WARNING
|
||||
"dm9601: No valid MAC address in EEPROM, using %pM\n",
|
||||
dev->net->dev_addr);
|
||||
__dm9601_set_mac_address(dev);
|
||||
}
|
||||
|
||||
/* power up phy */
|
||||
dm_write_reg(dev, DM_GPR_CTRL, 1);
|
||||
dm_write_reg(dev, DM_GPR_DATA, 0);
|
||||
|
|
|
|||
|
|
@ -251,7 +251,6 @@ struct kaweth_device
|
|||
struct net_device_stats stats;
|
||||
};
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* kaweth_control
|
||||
****************************************************************/
|
||||
|
|
@ -975,6 +974,17 @@ static int kaweth_resume(struct usb_interface *intf)
|
|||
/****************************************************************
|
||||
* kaweth_probe
|
||||
****************************************************************/
|
||||
|
||||
|
||||
static const struct net_device_ops kaweth_netdev_ops = {
|
||||
.ndo_open = kaweth_open,
|
||||
.ndo_stop = kaweth_close,
|
||||
.ndo_start_xmit = kaweth_start_xmit,
|
||||
.ndo_tx_timeout = kaweth_tx_timeout,
|
||||
.ndo_set_multicast_list = kaweth_set_rx_mode,
|
||||
.ndo_get_stats = kaweth_netdev_stats,
|
||||
};
|
||||
|
||||
static int kaweth_probe(
|
||||
struct usb_interface *intf,
|
||||
const struct usb_device_id *id /* from id_table */
|
||||
|
|
@ -1147,22 +1157,13 @@ err_fw:
|
|||
memcpy(netdev->dev_addr, &kaweth->configuration.hw_addr,
|
||||
sizeof(kaweth->configuration.hw_addr));
|
||||
|
||||
netdev->open = kaweth_open;
|
||||
netdev->stop = kaweth_close;
|
||||
|
||||
netdev->netdev_ops = &kaweth_netdev_ops;
|
||||
netdev->watchdog_timeo = KAWETH_TX_TIMEOUT;
|
||||
netdev->tx_timeout = kaweth_tx_timeout;
|
||||
|
||||
netdev->hard_start_xmit = kaweth_start_xmit;
|
||||
netdev->set_multicast_list = kaweth_set_rx_mode;
|
||||
netdev->get_stats = kaweth_netdev_stats;
|
||||
netdev->mtu = le16_to_cpu(kaweth->configuration.segment_size);
|
||||
SET_ETHTOOL_OPS(netdev, &ops);
|
||||
|
||||
/* kaweth is zeroed as part of alloc_netdev */
|
||||
|
||||
INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl);
|
||||
|
||||
usb_set_intfdata(intf, kaweth);
|
||||
|
||||
#if 0
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ module_param (msg_level, int, 0);
|
|||
MODULE_PARM_DESC (msg_level, "Override default message level");
|
||||
|
||||
MODULE_DEVICE_TABLE(usb, pegasus_ids);
|
||||
static const struct net_device_ops pegasus_netdev_ops;
|
||||
|
||||
static int update_eth_regs_async(pegasus_t *);
|
||||
/* Aargh!!! I _really_ hate such tweaks */
|
||||
|
|
@ -1360,14 +1361,10 @@ static int pegasus_probe(struct usb_interface *intf,
|
|||
pegasus->intf = intf;
|
||||
pegasus->usb = dev;
|
||||
pegasus->net = net;
|
||||
net->open = pegasus_open;
|
||||
net->stop = pegasus_close;
|
||||
|
||||
|
||||
net->watchdog_timeo = PEGASUS_TX_TIMEOUT;
|
||||
net->tx_timeout = pegasus_tx_timeout;
|
||||
net->do_ioctl = pegasus_ioctl;
|
||||
net->hard_start_xmit = pegasus_start_xmit;
|
||||
net->set_multicast_list = pegasus_set_multicast;
|
||||
net->get_stats = pegasus_netdev_stats;
|
||||
net->netdev_ops = &pegasus_netdev_ops;
|
||||
SET_ETHTOOL_OPS(net, &ops);
|
||||
pegasus->mii.dev = net;
|
||||
pegasus->mii.mdio_read = mdio_read;
|
||||
|
|
@ -1482,6 +1479,16 @@ static int pegasus_resume (struct usb_interface *intf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops pegasus_netdev_ops = {
|
||||
.ndo_open = pegasus_open,
|
||||
.ndo_stop = pegasus_close,
|
||||
.ndo_do_ioctl = pegasus_ioctl,
|
||||
.ndo_start_xmit = pegasus_start_xmit,
|
||||
.ndo_set_multicast_list = pegasus_set_multicast,
|
||||
.ndo_get_stats = pegasus_netdev_stats,
|
||||
.ndo_tx_timeout = pegasus_tx_timeout,
|
||||
};
|
||||
|
||||
static struct usb_driver pegasus_driver = {
|
||||
.name = driver_name,
|
||||
.probe = pegasus_probe,
|
||||
|
|
|
|||
|
|
@ -624,6 +624,18 @@ static int virtnet_change_mtu(struct net_device *dev, int new_mtu)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops virtnet_netdev = {
|
||||
.ndo_open = virtnet_open,
|
||||
.ndo_stop = virtnet_close,
|
||||
.ndo_start_xmit = start_xmit,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_change_mtu = virtnet_change_mtu,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = virtnet_netpoll,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int virtnet_probe(struct virtio_device *vdev)
|
||||
{
|
||||
int err;
|
||||
|
|
@ -636,14 +648,8 @@ static int virtnet_probe(struct virtio_device *vdev)
|
|||
return -ENOMEM;
|
||||
|
||||
/* Set up network device as normal. */
|
||||
dev->open = virtnet_open;
|
||||
dev->stop = virtnet_close;
|
||||
dev->hard_start_xmit = start_xmit;
|
||||
dev->change_mtu = virtnet_change_mtu;
|
||||
dev->netdev_ops = &virtnet_netdev;
|
||||
dev->features = NETIF_F_HIGHDMA;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
dev->poll_controller = virtnet_netpoll;
|
||||
#endif
|
||||
SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops);
|
||||
SET_NETDEV_DEV(dev, &vdev->dev);
|
||||
|
||||
|
|
|
|||
|
|
@ -397,11 +397,13 @@ int i2400mu_probe(struct usb_interface *iface,
|
|||
i2400m->bus_fw_name = I2400MU_FW_FILE_NAME;
|
||||
i2400m->bus_bm_mac_addr_impaired = 0;
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
iface->needs_remote_wakeup = 1; /* autosuspend (15s delay) */
|
||||
device_init_wakeup(dev, 1);
|
||||
usb_autopm_enable(i2400mu->usb_iface);
|
||||
usb_dev->autosuspend_delay = 15 * HZ;
|
||||
usb_dev->autosuspend_disabled = 0;
|
||||
#endif
|
||||
|
||||
result = i2400m_setup(i2400m, I2400M_BRI_MAC_REINIT);
|
||||
if (result < 0) {
|
||||
|
|
@ -493,7 +495,9 @@ int i2400mu_suspend(struct usb_interface *iface, pm_message_t pm_msg)
|
|||
int result = 0;
|
||||
struct device *dev = &iface->dev;
|
||||
struct i2400mu *i2400mu = usb_get_intfdata(iface);
|
||||
#ifdef CONFIG_PM
|
||||
struct usb_device *usb_dev = i2400mu->usb_dev;
|
||||
#endif
|
||||
struct i2400m *i2400m = &i2400mu->i2400m;
|
||||
|
||||
d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event);
|
||||
|
|
@ -503,11 +507,13 @@ int i2400mu_suspend(struct usb_interface *iface, pm_message_t pm_msg)
|
|||
atomic_dec(&i2400mu->do_autopm);
|
||||
result = i2400m_cmd_enter_powersave(i2400m);
|
||||
atomic_inc(&i2400mu->do_autopm);
|
||||
#ifdef CONFIG_PM
|
||||
if (result < 0 && usb_dev->auto_pm == 0) {
|
||||
/* System suspend, can't fail */
|
||||
dev_err(dev, "failed to suspend, will reset on resume\n");
|
||||
result = 0;
|
||||
}
|
||||
#endif
|
||||
if (result < 0)
|
||||
goto error_enter_powersave;
|
||||
i2400mu_notification_release(i2400mu);
|
||||
|
|
|
|||
|
|
@ -1105,6 +1105,16 @@ static void xennet_uninit(struct net_device *dev)
|
|||
gnttab_free_grant_references(np->gref_rx_head);
|
||||
}
|
||||
|
||||
static const struct net_device_ops xennet_netdev_ops = {
|
||||
.ndo_open = xennet_open,
|
||||
.ndo_uninit = xennet_uninit,
|
||||
.ndo_stop = xennet_close,
|
||||
.ndo_start_xmit = xennet_start_xmit,
|
||||
.ndo_change_mtu = xennet_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
};
|
||||
|
||||
static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev)
|
||||
{
|
||||
int i, err;
|
||||
|
|
@ -1161,12 +1171,9 @@ static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev
|
|||
goto exit_free_tx;
|
||||
}
|
||||
|
||||
netdev->open = xennet_open;
|
||||
netdev->hard_start_xmit = xennet_start_xmit;
|
||||
netdev->stop = xennet_close;
|
||||
netdev->netdev_ops = &xennet_netdev_ops;
|
||||
|
||||
netif_napi_add(netdev, &np->napi, xennet_poll, 64);
|
||||
netdev->uninit = xennet_uninit;
|
||||
netdev->change_mtu = xennet_change_mtu;
|
||||
netdev->features = NETIF_F_IP_CSUM;
|
||||
|
||||
SET_ETHTOOL_OPS(netdev, &xennet_ethtool_ops);
|
||||
|
|
|
|||
Loading…
Reference in a new issue