Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122097
b: refs/heads/master
c: c46920d
h: refs/heads/master
i:
  122095: b8f31df
v: v3
  • Loading branch information
David S. Miller committed Nov 22, 2008
1 parent ad872cf commit 23c8474
Show file tree
Hide file tree
Showing 39 changed files with 555 additions and 324 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6476a907b57d9229de7807aeea534ad45e19a4ce
refs/heads/master: c46920dadba65856eb1a1f1ffa1b350875db1228
5 changes: 5 additions & 0 deletions trunk/drivers/net/8390.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ extern void ei_poll(struct net_device *dev);
extern void eip_poll(struct net_device *dev);
#endif

extern void ei_tx_timeout(struct net_device *dev);
extern int ei_start_xmit(struct sk_buff *skb, struct net_device *dev);
extern void ei_set_multicast_list(struct net_device *dev);
extern struct net_device_stats *ei_get_stats(struct net_device *dev);

/* Without I/O delay - non ISA or later chips */
extern void NS8390_init(struct net_device *dev, int startp);
extern int ei_open(struct net_device *dev);
Expand Down
36 changes: 20 additions & 16 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -7707,6 +7707,25 @@ bnx2_init_napi(struct bnx2 *bp)
}
}

static const struct net_device_ops bnx2_netdev_ops = {
.ndo_open = bnx2_open,
.ndo_start_xmit = bnx2_start_xmit,
.ndo_stop = bnx2_close,
.ndo_get_stats = bnx2_get_stats,
.ndo_set_rx_mode = bnx2_set_rx_mode,
.ndo_do_ioctl = bnx2_ioctl,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = bnx2_change_mac_addr,
.ndo_change_mtu = bnx2_change_mtu,
.ndo_tx_timeout = bnx2_tx_timeout,
#ifdef BCM_VLAN
.ndo_vlan_rx_register = bnx2_vlan_rx_register,
#endif
#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
.ndo_poll_controller = poll_bnx2,
#endif
};

static int __devinit
bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
Expand All @@ -7731,28 +7750,13 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return rc;
}

dev->open = bnx2_open;
dev->hard_start_xmit = bnx2_start_xmit;
dev->stop = bnx2_close;
dev->get_stats = bnx2_get_stats;
dev->set_rx_mode = bnx2_set_rx_mode;
dev->do_ioctl = bnx2_ioctl;
dev->set_mac_address = bnx2_change_mac_addr;
dev->change_mtu = bnx2_change_mtu;
dev->tx_timeout = bnx2_tx_timeout;
dev->netdev_ops = &bnx2_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
#ifdef BCM_VLAN
dev->vlan_rx_register = bnx2_vlan_rx_register;
#endif
dev->ethtool_ops = &bnx2_ethtool_ops;

bp = netdev_priv(dev);
bnx2_init_napi(bp);

#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
dev->poll_controller = poll_bnx2;
#endif

pci_set_drvdata(pdev, dev);

memcpy(dev->dev_addr, bp->mac_addr, 6);
Expand Down
34 changes: 20 additions & 14 deletions trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10002,6 +10002,25 @@ static void poll_bnx2x(struct net_device *dev)
}
#endif

static const struct net_device_ops bnx2x_netdev_ops = {
.ndo_open = bnx2x_open,
.ndo_stop = bnx2x_close,
.ndo_start_xmit = bnx2x_start_xmit,
.ndo_set_multicast_list = bnx2x_set_rx_mode,
.ndo_set_mac_address = bnx2x_change_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_do_ioctl = bnx2x_ioctl,
.ndo_change_mtu = bnx2x_change_mtu,
.ndo_tx_timeout = bnx2x_tx_timeout,
#ifdef BCM_VLAN
.ndo_vlan_rx_register = bnx2x_vlan_rx_register,
#endif
#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
.ndo_poll_controller = poll_bnx2x,
#endif
};


static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
struct net_device *dev)
{
Expand Down Expand Up @@ -10112,23 +10131,10 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
REG_WR(bp, PXP2_REG_PGL_ADDR_90_F0 + BP_PORT(bp)*16, 0);
REG_WR(bp, PXP2_REG_PGL_ADDR_94_F0 + BP_PORT(bp)*16, 0);

dev->hard_start_xmit = bnx2x_start_xmit;
dev->watchdog_timeo = TX_TIMEOUT;

dev->netdev_ops = &bnx2x_netdev_ops;
dev->ethtool_ops = &bnx2x_ethtool_ops;
dev->open = bnx2x_open;
dev->stop = bnx2x_close;
dev->set_multicast_list = bnx2x_set_rx_mode;
dev->set_mac_address = bnx2x_change_mac_addr;
dev->do_ioctl = bnx2x_ioctl;
dev->change_mtu = bnx2x_change_mtu;
dev->tx_timeout = bnx2x_tx_timeout;
#ifdef BCM_VLAN
dev->vlan_rx_register = bnx2x_vlan_rx_register;
#endif
#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
dev->poll_controller = poll_bnx2x;
#endif
dev->features |= NETIF_F_SG;
dev->features |= NETIF_F_HW_CSUM;
if (bp->flags & USING_DAC_FLAG)
Expand Down
22 changes: 14 additions & 8 deletions trunk/drivers/net/dl2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ static int mii_write (struct net_device *dev, int phy_addr, int reg_num,

static const struct ethtool_ops ethtool_ops;

static const struct net_device_ops netdev_ops = {
.ndo_open = rio_open,
.ndo_start_xmit = start_xmit,
.ndo_stop = rio_close,
.ndo_get_stats = get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_set_multicast_list = set_multicast,
.ndo_do_ioctl = rio_ioctl,
.ndo_tx_timeout = rio_tx_timeout,
.ndo_change_mtu = change_mtu,
};

static int __devinit
rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
{
Expand Down Expand Up @@ -197,15 +210,8 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
else if (tx_coalesce > TX_RING_SIZE-1)
tx_coalesce = TX_RING_SIZE - 1;
}
dev->open = &rio_open;
dev->hard_start_xmit = &start_xmit;
dev->stop = &rio_close;
dev->get_stats = &get_stats;
dev->set_multicast_list = &set_multicast;
dev->do_ioctl = &rio_ioctl;
dev->tx_timeout = &rio_tx_timeout;
dev->netdev_ops = &netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
dev->change_mtu = &change_mtu;
SET_ETHTOOL_OPS(dev, &ethtool_ops);
#if 0
dev->features = NETIF_F_IP_CSUM;
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/net/enic/cq_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ struct cq_desc {
u8 type_color;
};

#define CQ_DESC_TYPE_BITS 7
#define CQ_DESC_TYPE_BITS 4
#define CQ_DESC_TYPE_MASK ((1 << CQ_DESC_TYPE_BITS) - 1)
#define CQ_DESC_COLOR_MASK 1
#define CQ_DESC_COLOR_SHIFT 7
#define CQ_DESC_Q_NUM_BITS 10
#define CQ_DESC_Q_NUM_MASK ((1 << CQ_DESC_Q_NUM_BITS) - 1)
#define CQ_DESC_COMP_NDX_BITS 12
Expand All @@ -58,7 +59,7 @@ static inline void cq_desc_dec(const struct cq_desc *desc_arg,
const struct cq_desc *desc = desc_arg;
const u8 type_color = desc->type_color;

*color = (type_color >> CQ_DESC_TYPE_BITS) & CQ_DESC_COLOR_MASK;
*color = (type_color >> CQ_DESC_COLOR_SHIFT) & CQ_DESC_COLOR_MASK;

/*
* Make sure color bit is read from desc *before* other fields
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/enic/enic.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco 10G Ethernet Driver"
#define DRV_VERSION "0.0.1-18163.472-k1"
#define DRV_VERSION "1.0.0.648"
#define DRV_COPYRIGHT "Copyright 2008 Cisco Systems, Inc"
#define PFX DRV_NAME ": "

Expand Down
42 changes: 23 additions & 19 deletions trunk/drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ static struct ethtool_ops enic_ethtool_ops = {
.set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = enic_set_tso,
.get_flags = ethtool_op_get_flags,
.set_flags = ethtool_op_set_flags,
};

static void enic_free_wq_buf(struct vnic_wq *wq, struct vnic_wq_buf *buf)
Expand Down Expand Up @@ -895,6 +897,7 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,
int skipped, void *opaque)
{
struct enic *enic = vnic_dev_priv(rq->vdev);
struct net_device *netdev = enic->netdev;
struct sk_buff *skb;

u8 type, color, eop, sop, ingress_port, vlan_stripped;
Expand Down Expand Up @@ -929,7 +932,7 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,
if (net_ratelimit())
printk(KERN_ERR PFX
"%s: packet error: bad FCS\n",
enic->netdev->name);
netdev->name);
}

dev_kfree_skb_any(skb);
Expand All @@ -943,18 +946,18 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,
*/

skb_put(skb, bytes_written);
skb->protocol = eth_type_trans(skb, enic->netdev);
skb->protocol = eth_type_trans(skb, netdev);

if (enic->csum_rx_enabled && !csum_not_calc) {
skb->csum = htons(checksum);
skb->ip_summed = CHECKSUM_COMPLETE;
}

skb->dev = enic->netdev;
skb->dev = netdev;

if (enic->vlan_group && vlan_stripped) {

if (ENIC_SETTING(enic, LRO) && ipv4)
if ((netdev->features & NETIF_F_LRO) && ipv4)
lro_vlan_hwaccel_receive_skb(&enic->lro_mgr,
skb, enic->vlan_group,
vlan, cq_desc);
Expand All @@ -964,7 +967,7 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,

} else {

if (ENIC_SETTING(enic, LRO) && ipv4)
if ((netdev->features & NETIF_F_LRO) && ipv4)
lro_receive_skb(&enic->lro_mgr, skb, cq_desc);
else
netif_receive_skb(skb);
Expand Down Expand Up @@ -1062,7 +1065,7 @@ static int enic_poll(struct napi_struct *napi, int budget)
/* If no work done, flush all LROs and exit polling
*/

if (ENIC_SETTING(enic, LRO))
if (netdev->features & NETIF_F_LRO)
lro_flush_all(&enic->lro_mgr);

netif_rx_complete(netdev, napi);
Expand Down Expand Up @@ -1106,7 +1109,7 @@ static int enic_poll_msix(struct napi_struct *napi, int budget)
/* If no work done, flush all LROs and exit polling
*/

if (ENIC_SETTING(enic, LRO))
if (netdev->features & NETIF_F_LRO)
lro_flush_all(&enic->lro_mgr);

netif_rx_complete(netdev, napi);
Expand Down Expand Up @@ -1762,13 +1765,13 @@ static int __devinit enic_probe(struct pci_dev *pdev,
}

/* Get available resource counts
*/
*/

enic_get_res_counts(enic);

/* Set interrupt mode based on resource counts and system
* capabilities
*/
*/

err = enic_set_intr_mode(enic);
if (err) {
Expand Down Expand Up @@ -1849,22 +1852,23 @@ static int __devinit enic_probe(struct pci_dev *pdev,
if (ENIC_SETTING(enic, TSO))
netdev->features |= NETIF_F_TSO |
NETIF_F_TSO6 | NETIF_F_TSO_ECN;
if (ENIC_SETTING(enic, LRO))
netdev->features |= NETIF_F_LRO;
if (using_dac)
netdev->features |= NETIF_F_HIGHDMA;


enic->csum_rx_enabled = ENIC_SETTING(enic, RXCSUM);

if (ENIC_SETTING(enic, LRO)) {
enic->lro_mgr.max_aggr = ENIC_LRO_MAX_AGGR;
enic->lro_mgr.max_desc = ENIC_LRO_MAX_DESC;
enic->lro_mgr.lro_arr = enic->lro_desc;
enic->lro_mgr.get_skb_header = enic_get_skb_header;
enic->lro_mgr.features = LRO_F_NAPI | LRO_F_EXTRACT_VLAN_ID;
enic->lro_mgr.dev = netdev;
enic->lro_mgr.ip_summed = CHECKSUM_COMPLETE;
enic->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY;
}
enic->lro_mgr.max_aggr = ENIC_LRO_MAX_AGGR;
enic->lro_mgr.max_desc = ENIC_LRO_MAX_DESC;
enic->lro_mgr.lro_arr = enic->lro_desc;
enic->lro_mgr.get_skb_header = enic_get_skb_header;
enic->lro_mgr.features = LRO_F_NAPI | LRO_F_EXTRACT_VLAN_ID;
enic->lro_mgr.dev = netdev;
enic->lro_mgr.ip_summed = CHECKSUM_COMPLETE;
enic->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY;


err = register_netdev(netdev);
if (err) {
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/enic/enic_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ static inline void enic_queue_wq_desc_ex(struct vnic_wq *wq,
(u16)vlan_tag,
0 /* loopback */);

wmb();

vnic_wq_post(wq, os_buf, dma_addr, len, sop, eop);
}

Expand Down Expand Up @@ -127,8 +125,6 @@ static inline void enic_queue_rq_desc(struct vnic_rq *rq,
(u64)dma_addr | VNIC_PADDR_TARGET,
type, (u16)len);

wmb();

vnic_rq_post(rq, os_buf, os_buf_index, dma_addr, len);
}

Expand Down
Loading

0 comments on commit 23c8474

Please sign in to comment.