netdevice: safe convert to netdev_priv() #part-3
Subsystems (5)
PATCH 3/4 netdevice: safe convert to netdev_priv() #part-3
We have some reasons to kill netdev->priv:
1. netdev->priv is equal to netdev_priv().
2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv.
But we cann't kill netdev->priv, because so many drivers reference to it directly.
This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read.
But it is too big to be sent in one mail.
I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger.
--- drivers/net/sgiseeq.c | 2 +- drivers/net/sis900.c | 64 ++++++++++++++-------------- drivers/net/smc9194.c | 6 +- drivers/net/sonic.h | 20 ++++---- drivers/net/spider_net_ethtool.c | 8 ++-- drivers/net/sun3_82586.c | 38 +++++++++------- drivers/net/sunbmac.c | 14 +++--- drivers/net/sungem.c | 52 +++++++++++----------- drivers/net/sunhme.c | 24 +++++----- drivers/net/sunqe.c | 14 +++--- drivers/net/tehuti.c | 38 ++++++++-------- drivers/net/tokenring/tms380tr.c | 14 ++++-- drivers/net/tulip/de2104x.c | 44 ++++++++++---------- drivers/net/tulip/eeprom.c | 2 +- drivers/net/tulip/uli526x.c | 2 +- drivers/net/typhoon.c | 2 +- drivers/net/usb/mcs7830.c | 4 +- drivers/net/virtio_net.c | 3 +- drivers/net/wan/dlci.c | 36 ++++++++-------- drivers/net/wan/sdla.c | 48 ++++++++++---------- drivers/net/wan/x25_asy.c | 28 ++++++------ drivers/net/wireless/libertas/ethtool.c | 12 +++--- drivers/net/wireless/libertas/persistcfg.c | 16 ++++---- drivers/net/wireless/libertas/scan.c | 4 +- drivers/net/wireless/libertas/tx.c | 2 +- 25 files changed, 253 insertions(+), 244 deletions(-)
drivers/net/sgiseeq.c +1 -1
@@ -656,7 +656,7 @@ static void timeout(struct net_device *dev)static void sgiseeq_set_multicast (struct net_device *dev) { -struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv; +struct sgiseeq_private *sp =netdev_priv (dev);unsigned char oldmode = sp->mode;if (dev->flags &IFF_PROMISC )
drivers/net/sis900.c +32 -32
254 lines not on this page · raw message
drivers/net/smc9194.c +3 -3
@@ -1034,7 +1034,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)printk ("ADDR: %pM\n" , dev->dev_addr);/* set the private data to zero by default */ -memset (dev->priv,0 ,sizeof (struct smc_local )); +memset (netdev_priv (dev),0 ,sizeof (struct smc_local ));/* Grab the IRQ */ retval =request_irq (dev->irq, &smc_interrupt,0 ,DRV_NAME , dev);
@@ -1108,7 +1108,7 @@ static int smc_open(struct net_device *dev)int i;/* used to set hw ethernet address */ /* clear out all the junk that was put here before... */ -memset (dev->priv,0 ,sizeof (struct smc_local )); +memset (netdev_priv (dev),0 ,sizeof (struct smc_local ));/* reset the hardware */
@@ -1164,7 +1164,7 @@ static void smc_timeout(struct net_device *dev)smc_enable ( dev->base_addr ); dev->trans_start = jiffies;/* clear anything saved */ - ((struct smc_local *)dev->priv)->saved_skb =NULL ; + ((struct smc_local *)netdev_priv (dev))->saved_skb =NULL ;netif_wake_queue (dev); }
drivers/net/sonic.h +10 -10
@@ -371,7 +371,7 @@ static inline __u16 sonic_buf_get(void* base, int bitmode,static inline void sonic_cda_put (struct net_device * dev,int entry,int offset,__u16 val) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);sonic_buf_put (lp->cda, lp->dma_bitmode, (entry *SIZEOF_SONIC_CD ) + offset, val); }
@@ -379,27 +379,27 @@ static inline void sonic_cda_put(struct net_device* dev, int entry,static inline __u16 sonic_cda_get (struct net_device * dev,int entry,int offset) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);return sonic_buf_get (lp->cda, lp->dma_bitmode, (entry *SIZEOF_SONIC_CD ) + offset); }static inline void sonic_set_cam_enable (struct net_device * dev,__u16 val) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);sonic_buf_put (lp->cda, lp->dma_bitmode,SONIC_CDA_CAM_ENABLE , val); }static inline __u16 sonic_get_cam_enable (struct net_device * dev) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);return sonic_buf_get (lp->cda, lp->dma_bitmode,SONIC_CDA_CAM_ENABLE ); }static inline void sonic_tda_put (struct net_device * dev,int entry,int offset,__u16 val) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);sonic_buf_put (lp->tda, lp->dma_bitmode, (entry *SIZEOF_SONIC_TD ) + offset, val); }
@@ -407,7 +407,7 @@ static inline void sonic_tda_put(struct net_device* dev, int entry,static inline __u16 sonic_tda_get (struct net_device * dev,int entry,int offset) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);return sonic_buf_get (lp->tda, lp->dma_bitmode, (entry *SIZEOF_SONIC_TD ) + offset); }
@@ -415,7 +415,7 @@ static inline __u16 sonic_tda_get(struct net_device* dev, int entry,static inline void sonic_rda_put (struct net_device * dev,int entry,int offset,__u16 val) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);sonic_buf_put (lp->rda, lp->dma_bitmode, (entry *SIZEOF_SONIC_RD ) + offset, val); }
@@ -423,7 +423,7 @@ static inline void sonic_rda_put(struct net_device* dev, int entry,static inline __u16 sonic_rda_get (struct net_device * dev,int entry,int offset) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);return sonic_buf_get (lp->rda, lp->dma_bitmode, (entry *SIZEOF_SONIC_RD ) + offset); }
@@ -431,7 +431,7 @@ static inline __u16 sonic_rda_get(struct net_device* dev, int entry,static inline void sonic_rra_put (struct net_device * dev,int entry,int offset,__u16 val) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);sonic_buf_put (lp->rra, lp->dma_bitmode, (entry *SIZEOF_SONIC_RR ) + offset, val); }
@@ -439,7 +439,7 @@ static inline void sonic_rra_put(struct net_device* dev, int entry,static inline __u16 sonic_rra_get (struct net_device * dev,int entry,int offset) { -struct sonic_local * lp = (struct sonic_local *) dev->priv; +struct sonic_local *lp =netdev_priv (dev);return sonic_buf_get (lp->rra, lp->dma_bitmode, (entry *SIZEOF_SONIC_RR ) + offset); }
drivers/net/spider_net_ethtool.c +4 -4
@@ -118,7 +118,7 @@ spider_net_ethtool_nway_reset(struct net_device *netdev)static u32 spider_net_ethtool_get_rx_csum (struct net_device *netdev) { -struct spider_net_card *card = netdev->priv; +struct spider_net_card *card =netdev_priv (netdev);return card->options.rx_csum; }
@@ -126,7 +126,7 @@ spider_net_ethtool_get_rx_csum(struct net_device *netdev)static int spider_net_ethtool_set_rx_csum (struct net_device *netdev,u32 n) { -struct spider_net_card *card = netdev->priv; +struct spider_net_card *card =netdev_priv (netdev); card->options.rx_csum = n;return 0 ;
@@ -137,7 +137,7 @@ static void spider_net_ethtool_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ering) { - struct spider_net_card *card = netdev->priv; + struct spider_net_card *card = netdev_priv(netdev); ering->tx_max_pending =SPIDER_NET_TX_DESCRIPTORS_MAX ; ering->tx_pending = card->tx_chain.num_desc;
@@ -158,7 +158,7 @@ static int spider_net_get_sset_count(struct net_device *netdev, int sset)static void spider_net_get_ethtool_stats (struct net_device *netdev,struct ethtool_stats *stats,u64 *data) { -struct spider_net_card *card = netdev->priv; +struct spider_net_card *card =netdev_priv (netdev); data[0 ] = netdev->stats.tx_packets; data[1 ] = netdev->stats.tx_bytes;
drivers/net/sun3_82586.c +21 -17
@@ -247,7 +247,7 @@ static int check586(struct net_device *dev,char *where,unsigned size)*/ static void alloc586 (struct net_device *dev) { -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);sun3_reset586 ();DELAY (1 );
@@ -363,17 +363,21 @@ static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr) goto out; } - ((struct priv *) (dev->priv))->memtop = (char *)dvma_btov (dev->mem_start); - ((struct priv *) (dev->priv))->base = (unsigned long )dvma_btov (0 ); + ((struct priv *)netdev_priv (dev))->memtop = + (char *)dvma_btov (dev->mem_start); + ((struct priv *)netdev_priv (dev))->base = (unsigned long )dvma_btov (0 );alloc586 (dev);/* set number of receive-buffs according to memsize */ if (size ==0x2000 ) - ((struct priv *) dev->priv)->num_recv_buffs =NUM_RECV_BUFFS_8 ; + ((struct priv *)netdev_priv (dev))->num_recv_buffs = +NUM_RECV_BUFFS_8 ;else if (size ==0x4000 ) - ((struct priv *) dev->priv)->num_recv_buffs =NUM_RECV_BUFFS_16 ; + ((struct priv *)netdev_priv (dev))->num_recv_buffs = +NUM_RECV_BUFFS_16 ;else - ((struct priv *) dev->priv)->num_recv_buffs =NUM_RECV_BUFFS_32 ; + ((struct priv *)netdev_priv (dev))->num_recv_buffs = +NUM_RECV_BUFFS_32 ;printk ("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n" ,dev->mem_start,size, dev->irq);
@@ -397,7 +401,7 @@ static int init586(struct net_device *dev) {void *ptr;int i,result=0 ; -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);volatile struct configure_cmd_struct *cfg_cmd;volatile struct iasetup_cmd_struct *ias_cmd;volatile struct tdr_cmd_struct *tdr_cmd;
@@ -631,7 +635,7 @@ static void *alloc_rfa(struct net_device *dev,void *ptr)volatile struct rfd_struct *rfd = (struct rfd_struct *)ptr;volatile struct rbd_struct *rbd;int i; -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);memset ((char *) rfd,0 ,sizeof (struct rfd_struct )*(p->num_recv_buffs+rfdadd)); p->rfd_first = rfd;
@@ -683,7 +687,7 @@ static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id)printk ("sun3_82586-interrupt: irq %d for unknown device.\n" ,irq);return IRQ_NONE ; } - p = (struct priv *) dev->priv; + p =netdev_priv (dev);if (debuglevel >1 )printk ("I" );
@@ -753,7 +757,7 @@ static void sun3_82586_rcv_int(struct net_device *dev)unsigned short totlen;struct sk_buff *skb;struct rbd_struct *rbd; -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);if (debuglevel >0 )printk ("R" );
@@ -871,7 +875,7 @@ static void sun3_82586_rcv_int(struct net_device *dev)static void sun3_82586_rnr_int (struct net_device *dev) { -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev); p->stats.rx_errors++;
@@ -895,7 +899,7 @@ static void sun3_82586_rnr_int(struct net_device *dev)static void sun3_82586_xmt_int (struct net_device *dev) {int status; -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);if (debuglevel >0 )printk ("X" );
@@ -945,7 +949,7 @@ static void sun3_82586_xmt_int(struct net_device *dev)static void startrecv586 (struct net_device *dev) { -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);WAIT_4_SCB_CMD ();WAIT_4_SCB_CMD_RUC ();
@@ -957,7 +961,7 @@ static void startrecv586(struct net_device *dev)static void sun3_82586_timeout (struct net_device *dev) { -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);#ifndef NO_NOPCOMMANDS if (p->scb->cus &CU_ACTIVE )/* COMMAND-UNIT active? */ {
@@ -999,7 +1003,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)#ifndef NO_NOPCOMMANDS int next_nop;#endif -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);if (skb->len >XMIT_BUFF_SIZE ) {
@@ -1108,7 +1112,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)static struct net_device_stats *sun3_82586_get_stats (struct net_device *dev) { -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);unsigned short crc,aln,rsc,ovrn; crc =swab16 (p->scb->crc_errs);/* get error-statistic from the ni82586 */
@@ -1171,7 +1175,7 @@ void cleanup_module(void)*/ void sun3_82586_dump (struct net_device *dev,void *ptr) { -struct priv *p = (struct priv *) dev->priv; +struct priv *p =netdev_priv (dev);struct dump_cmd_struct *dump_cmd = (struct dump_cmd_struct *) ptr;int i;
drivers/net/sunbmac.c +7 -7
@@ -916,7 +916,7 @@ static irqreturn_t bigmac_interrupt(int irq, void *dev_id)static int bigmac_open (struct net_device *dev) { -struct bigmac *bp = (struct bigmac *) dev->priv; +struct bigmac *bp =netdev_priv (dev);int ret; ret =request_irq (dev->irq, &bigmac_interrupt,IRQF_SHARED , dev->name, bp);
@@ -933,7 +933,7 @@ static int bigmac_open(struct net_device *dev)static int bigmac_close (struct net_device *dev) { -struct bigmac *bp = (struct bigmac *) dev->priv; +struct bigmac *bp =netdev_priv (dev);del_timer (&bp->bigmac_timer); bp->timer_state = asleep;
@@ -947,7 +947,7 @@ static int bigmac_close(struct net_device *dev)static void bigmac_tx_timeout (struct net_device *dev) { -struct bigmac *bp = (struct bigmac *) dev->priv; +struct bigmac *bp =netdev_priv (dev);bigmac_init_hw (bp,0 );netif_wake_queue (dev);
@@ -956,7 +956,7 @@ static void bigmac_tx_timeout(struct net_device *dev)/* Put a packet on the wire. */ static int bigmac_start_xmit (struct sk_buff *skb,struct net_device *dev) { -struct bigmac *bp = (struct bigmac *) dev->priv; +struct bigmac *bp =netdev_priv (dev);int len, entry;u32 mapping;
@@ -989,7 +989,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)static struct net_device_stats *bigmac_get_stats (struct net_device *dev) { -struct bigmac *bp = (struct bigmac *) dev->priv; +struct bigmac *bp =netdev_priv (dev);bigmac_get_counters (bp, bp->bregs);return &bp->enet_stats;
@@ -997,7 +997,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev)static void bigmac_set_multicast (struct net_device *dev) { -struct bigmac *bp = (struct bigmac *) dev->priv; +struct bigmac *bp =netdev_priv (dev);void __iomem *bregs = bp->bregs;struct dev_mc_list *dmi = dev->mc_list;char *addrs;
@@ -1060,7 +1060,7 @@ static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *istatic u32 bigmac_get_link (struct net_device *dev) { -struct bigmac *bp = dev->priv; +struct bigmac *bp =netdev_priv (dev);spin_lock_irq (&bp->lock); bp->sw_bmsr =bigmac_tcvr_read (bp, bp->tregs,BIGMAC_BMSR );
drivers/net/sungem.c +26 -26
207 lines not on this page · raw message
drivers/net/sunhme.c +12 -12
@@ -2130,7 +2130,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)for (i =0 ; i <4 ; i++) {struct net_device *dev = qp->happy_meals[i]; -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);u32 happy_status =hme_read32 (hp, hp->gregs +GREG_STAT );HMD (("quattro_interrupt: status=%08x " , happy_status));
@@ -2175,7 +2175,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)static int happy_meal_open (struct net_device *dev) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);int res;HMD (("happy_meal_open: " ));
@@ -2207,7 +2207,7 @@ static int happy_meal_open(struct net_device *dev)static int happy_meal_close (struct net_device *dev) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);spin_lock_irq (&hp->happy_lock);happy_meal_stop (hp, hp->gregs);
@@ -2236,7 +2236,7 @@ static int happy_meal_close(struct net_device *dev)static void happy_meal_tx_timeout (struct net_device *dev) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);printk (KERN_ERR "%s: transmit timed out, resetting\n" , dev->name);tx_dump_log ();
@@ -2254,7 +2254,7 @@ static void happy_meal_tx_timeout(struct net_device *dev)static int happy_meal_start_xmit (struct sk_buff *skb,struct net_device *dev) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);int entry;u32 tx_flags;
@@ -2343,7 +2343,7 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)static struct net_device_stats *happy_meal_get_stats (struct net_device *dev) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);spin_lock_irq (&hp->happy_lock);happy_meal_get_counters (hp, hp->bigmacregs);
@@ -2354,7 +2354,7 @@ static struct net_device_stats *happy_meal_get_stats(struct net_device *dev)static void happy_meal_set_multicast (struct net_device *dev) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);void __iomem *bregs = hp->bigmacregs;struct dev_mc_list *dmi = dev->mc_list;char *addrs;
@@ -2400,7 +2400,7 @@ static void happy_meal_set_multicast(struct net_device *dev)/* Ethtool support... */ static int hme_get_settings (struct net_device *dev,struct ethtool_cmd *cmd) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev); cmd->supported = (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
@@ -2445,7 +2445,7 @@ static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)static int hme_set_settings (struct net_device *dev,struct ethtool_cmd *cmd) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);/* Verify the settings we care about. */ if (cmd->autoneg != AUTONEG_ENABLE &&
@@ -2469,7 +2469,7 @@ static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)static void hme_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);strcpy (info->driver,"sunhme" );strcpy (info->version,"2.02" );
@@ -2491,7 +2491,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *infostatic u32 hme_get_link (struct net_device *dev) { -struct happy_meal *hp = dev->priv; +struct happy_meal *hp =netdev_priv (dev);spin_lock_irq (&hp->happy_lock); hp->sw_bmcr =happy_meal_tcvr_read (hp, hp->tcvregs,MII_BMCR );
@@ -2970,7 +2970,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev, dev->base_addr = (long ) pdev; - hp = (struct happy_meal *)dev->priv; + hp =netdev_priv (dev);memset (hp,0 ,sizeof (*hp)); hp->happy_dev = pdev;
drivers/net/sunqe.c +7 -7
@@ -512,7 +512,7 @@ static irqreturn_t qec_interrupt(int irq, void *dev_id)static int qe_open (struct net_device *dev) { -struct sunqe *qep = (struct sunqe *) dev->priv; +struct sunqe *qep =netdev_priv (dev); qep->mconfig = (MREGS_MCONFIG_TXENAB | MREGS_MCONFIG_RXENAB |
@@ -522,7 +522,7 @@ static int qe_open(struct net_device *dev)static int qe_close (struct net_device *dev) { -struct sunqe *qep = (struct sunqe *) dev->priv; +struct sunqe *qep =netdev_priv (dev);qe_stop (qep);return 0 ;
@@ -548,7 +548,7 @@ static void qe_tx_reclaim(struct sunqe *qep)static void qe_tx_timeout (struct net_device *dev) { -struct sunqe *qep = (struct sunqe *) dev->priv; +struct sunqe *qep =netdev_priv (dev);int tx_full;spin_lock_irq (&qep->lock);
@@ -574,7 +574,7 @@ out:/* Get a packet queued to go onto the wire. */ static int qe_start_xmit (struct sk_buff *skb,struct net_device *dev) { -struct sunqe *qep = (struct sunqe *) dev->priv; +struct sunqe *qep =netdev_priv (dev);struct sunqe_buffers *qbufs = qep->buffers;__u32 txbuf_dvma, qbufs_dvma = qep->buffers_dvma;unsigned char *txbuf;
@@ -626,7 +626,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)static void qe_set_multicast (struct net_device *dev) { -struct sunqe *qep = (struct sunqe *) dev->priv; +struct sunqe *qep =netdev_priv (dev);struct dev_mc_list *dmi = dev->mc_list;u8 new_mconfig = qep->mconfig;char *addrs;
@@ -692,7 +692,7 @@ static void qe_set_multicast(struct net_device *dev)static void qe_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info) {const struct linux_prom_registers *regs; -struct sunqe *qep = dev->priv; +struct sunqe *qep =netdev_priv (dev);struct of_device *op;strcpy (info->driver,"sunqe" );
@@ -707,7 +707,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)static u32 qe_get_link (struct net_device *dev) { -struct sunqe *qep = dev->priv; +struct sunqe *qep =netdev_priv (dev);void __iomem *mregs = qep->mregs;u8 phyconfig;
drivers/net/tehuti.c +19 -19
@@ -251,7 +251,7 @@ static void bdx_isr_extra(struct bdx_priv *priv, u32 isr)static irqreturn_t bdx_isr_napi (int irq,void *dev) {struct net_device *ndev = dev; -struct bdx_priv *priv = ndev->priv; +struct bdx_priv *priv =netdev_priv (ndev);u32 isr;ENTER ;
@@ -559,7 +559,7 @@ static int bdx_close(struct net_device *ndev)struct bdx_priv *priv =NULL ;ENTER ; - priv = ndev->priv; + priv =netdev_priv (ndev);napi_disable (&priv->napi);
@@ -588,7 +588,7 @@ static int bdx_open(struct net_device *ndev)int rc;ENTER ; - priv = ndev->priv; + priv =netdev_priv (ndev);bdx_reset (priv);if (netif_running (ndev))netif_stop_queue (priv->ndev);
@@ -633,7 +633,7 @@ static int bdx_range_check(struct bdx_priv *priv, u32 offset)static int bdx_ioctl_priv (struct net_device *ndev,struct ifreq *ifr,int cmd) { -struct bdx_priv *priv = ndev->priv; +struct bdx_priv *priv =netdev_priv (ndev);u32 data[3 ];int error;
@@ -698,7 +698,7 @@ static int bdx_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)*/ static void __bdx_vlan_rx_vid (struct net_device *ndev,uint16_t vid,int enable) { -struct bdx_priv *priv = ndev->priv; +struct bdx_priv *priv =netdev_priv (ndev);u32 reg, bit, val;ENTER ;
@@ -748,7 +748,7 @@ static void bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid)static void bdx_vlan_rx_register (struct net_device *ndev,struct vlan_group *grp) { -struct bdx_priv *priv = ndev->priv; +struct bdx_priv *priv =netdev_priv (ndev);ENTER ;DBG ("device='%s', group='%p'\n" , ndev->name, grp);
@@ -787,7 +787,7 @@ static int bdx_change_mtu(struct net_device *ndev, int new_mtu)static void bdx_setmulti (struct net_device *ndev) { -struct bdx_priv *priv = ndev->priv; +struct bdx_priv *priv =netdev_priv (ndev);u32 rxf_val =GMAC_RX_FILTER_AM |GMAC_RX_FILTER_AB |GMAC_RX_FILTER_OSEN ;
@@ -847,7 +847,7 @@ static void bdx_setmulti(struct net_device *ndev)static int bdx_set_mac (struct net_device *ndev,void *p) { -struct bdx_priv *priv = ndev->priv; +struct bdx_priv *priv =netdev_priv (ndev);struct sockaddr *addr = p;ENTER ;
@@ -929,7 +929,7 @@ static void bdx_update_stats(struct bdx_priv *priv)static struct net_device_stats *bdx_get_stats (struct net_device *ndev) { -struct bdx_priv *priv = ndev->priv; +struct bdx_priv *priv =netdev_priv (ndev);struct net_device_stats *net_stat = &priv->net_stats;return net_stat; }
@@ -1623,7 +1623,7 @@ static inline int bdx_tx_space(struct bdx_priv *priv)*/ static int bdx_tx_transmit (struct sk_buff *skb,struct net_device *ndev) { -struct bdx_priv *priv = ndev->priv; +struct bdx_priv *priv =netdev_priv (ndev);struct txd_fifo *f = &priv->txd_fifo0;int txd_checksum =7 ;/* full checksum */ int txd_lgsnd =0 ;
@@ -2026,7 +2026,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ndev->features |=NETIF_F_HIGHDMA ;/************** priv ****************/ - priv = nic->priv[port] = ndev->priv; + priv = nic->priv[port] =netdev_priv (ndev);memset (priv,0 ,sizeof (struct bdx_priv )); priv->pBdxRegs = nic->regs + port *0x8000 ;
@@ -2149,7 +2149,7 @@ static int bdx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) {u32 rdintcm;u32 tdintcm; -struct bdx_priv *priv = netdev->priv; +struct bdx_priv *priv =netdev_priv (netdev); rdintcm = priv->rdintcm; tdintcm = priv->tdintcm;
@@ -2180,7 +2180,7 @@ static int bdx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)static void bdx_get_drvinfo (struct net_device *netdev,struct ethtool_drvinfo *drvinfo) { -struct bdx_priv *priv = netdev->priv; +struct bdx_priv *priv =netdev_priv (netdev);strlcat (drvinfo->driver,BDX_DRV_NAME ,sizeof (drvinfo->driver));strlcat (drvinfo->version,BDX_DRV_VERSION ,sizeof (drvinfo->version));
@@ -2222,7 +2222,7 @@ bdx_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal) {u32 rdintcm;u32 tdintcm; -struct bdx_priv *priv = netdev->priv; +struct bdx_priv *priv =netdev_priv (netdev); rdintcm = priv->rdintcm; tdintcm = priv->tdintcm;
@@ -2251,7 +2251,7 @@ bdx_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal) {u32 rdintcm;u32 tdintcm; -struct bdx_priv *priv = netdev->priv; +struct bdx_priv *priv =netdev_priv (netdev);int rx_coal;int tx_coal;int rx_max_coal;
@@ -2309,7 +2309,7 @@ static inline int bdx_tx_fifo_size_to_packets(int tx_size)static void bdx_get_ringparam (struct net_device *netdev,struct ethtool_ringparam *ring) { -struct bdx_priv *priv = netdev->priv; +struct bdx_priv *priv =netdev_priv (netdev);/*max_pending - the maximum-sized FIFO we allow */ ring->rx_max_pending =bdx_rx_fifo_size_to_packets (3 );
@@ -2326,7 +2326,7 @@ bdx_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)static int bdx_set_ringparam (struct net_device *netdev,struct ethtool_ringparam *ring) { -struct bdx_priv *priv = netdev->priv; +struct bdx_priv *priv =netdev_priv (netdev);int rx_size =0 ;int tx_size =0 ;
@@ -2387,7 +2387,7 @@ static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data)*/ static int bdx_get_stats_count (struct net_device *netdev) { -struct bdx_priv *priv = netdev->priv; +struct bdx_priv *priv =netdev_priv (netdev);BDX_ASSERT (ARRAY_SIZE (bdx_stat_names) !=sizeof (struct bdx_stats ) /sizeof (u64));return ((priv->stats_flag) ?ARRAY_SIZE (bdx_stat_names) :0 );
@@ -2402,7 +2402,7 @@ static int bdx_get_stats_count(struct net_device *netdev)static void bdx_get_ethtool_stats (struct net_device *netdev,struct ethtool_stats *stats,u64 *data) { -struct bdx_priv *priv = netdev->priv; +struct bdx_priv *priv =netdev_priv (netdev);if (priv->stats_flag) {
drivers/net/tokenring/tms380tr.c +9 -5
@@ -180,10 +180,14 @@ void tms380tr_wait(unsigned long time);static void tms380tr_write_rpl_status (RPL *rpl,unsigned int Status);static void tms380tr_write_tpl_status (TPL *tpl,unsigned int Status); -#define SIFREADB (reg) (((struct net_local *)dev->priv)->sifreadb(dev, reg)) -#define SIFWRITEB (val, reg) (((struct net_local *)dev->priv)->sifwriteb(dev, val, reg)) -#define SIFREADW (reg) (((struct net_local *)dev->priv)->sifreadw(dev, reg)) -#define SIFWRITEW (val, reg) (((struct net_local *)dev->priv)->sifwritew(dev, val, reg)) +#define SIFREADB (reg) \ + (((struct net_local *)netdev_priv(dev))->sifreadb(dev, reg)) +#define SIFWRITEB (val, reg) \ + (((struct net_local *)netdev_priv(dev))->sifwriteb(dev, val, reg)) +#define SIFREADW (reg) \ + (((struct net_local *)netdev_priv(dev))->sifreadw(dev, reg)) +#define SIFWRITEW (val, reg) \ + (((struct net_local *)netdev_priv(dev))->sifwritew(dev, val, reg))
@@ -2330,7 +2334,7 @@ int tmsdev_init(struct net_device *dev, struct device *pdev) {struct net_local *tms_local; -memset (dev->priv,0 ,sizeof (struct net_local )); +memset (netdev_priv (dev),0 ,sizeof (struct net_local )); tms_local =netdev_priv (dev);init_waitqueue_head (&tms_local->wait_for_tok_int);if (pdev->dma_mask)
drivers/net/tulip/de2104x.c +22 -22
176 lines not on this page · raw message
drivers/net/tulip/eeprom.c +1 -1
@@ -337,7 +337,7 @@ int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_l {int i;unsigned retval =0 ; -struct tulip_private *tp = dev->priv; +struct tulip_private *tp =netdev_priv (dev);void __iomem *ee_addr = tp->base_addr +CSR9 ;int read_cmd = location | (EE_READ_CMD << addr_len);
drivers/net/tulip/uli526x.c +1 -1
@@ -890,7 +890,7 @@ static struct net_device_stats * uli526x_get_stats(struct net_device *dev)static void uli526x_set_filter_mode (struct net_device * dev) { -struct uli526x_board_info *db = dev->priv; +struct uli526x_board_info *db =netdev_priv (dev);unsigned long flags;ULI526X_DBUG (0 ,"uli526x_set_filter_mode()" ,0 );
drivers/net/typhoon.c +1 -1
@@ -1797,7 +1797,7 @@ static irqreturn_t typhoon_interrupt(int irq, void *dev_instance) { struct net_device *dev = dev_instance; -struct typhoon *tp = dev->priv; +struct typhoon *tp =netdev_priv (dev);void __iomem *ioaddr = tp->ioaddr;u32 intr_status;
drivers/net/usb/mcs7830.c +2 -2
@@ -344,14 +344,14 @@ out:static int mcs7830_mdio_read (struct net_device *netdev,int phy_id,int location) { -struct usbnet *dev = netdev->priv; +struct usbnet *dev =netdev_priv (netdev);return mcs7830_read_phy (dev, location); }static void mcs7830_mdio_write (struct net_device *netdev,int phy_id,int location,int val) { -struct usbnet *dev = netdev->priv; +struct usbnet *dev =netdev_priv (netdev);mcs7830_write_phy (dev, location, val); }
drivers/net/virtio_net.c +2 -1
@@ -125,7 +125,8 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,unsigned int i;for (i =0 ; i <skb_shinfo (skb)->nr_frags; i++) -give_a_page (dev->priv,skb_shinfo (skb)->frags[i].page); +give_a_page (netdev_priv (dev), +skb_shinfo (skb)->frags[i].page); skb->data_len =0 ;skb_shinfo (skb)->nr_frags =0 ; }
drivers/net/wan/dlci.c +18 -18
@@ -74,7 +74,7 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev,unsigned int hlen;char *dest; - dlp = dev->priv; + dlp =netdev_priv (dev); hdr.control =FRAD_I_UI ; switch(type)
@@ -110,7 +110,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)struct frhdr *hdr;int process, header; - dlp = dev->priv; + dlp =netdev_priv (dev);if (!pskb_may_pull (skb,sizeof (*hdr))) {printk (KERN_NOTICE "%s: invalid data no header\n" , dev->name);
@@ -196,7 +196,7 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev)if (!skb || !dev)return (0 ); - dlp = dev->priv; + dlp =netdev_priv (dev);netif_stop_queue (dev);
@@ -234,9 +234,9 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, instruct frad_local *flp;int err; - dlp = dev->priv; + dlp =netdev_priv (dev); - flp = dlp->slave->priv; + flp =netdev_priv (dlp->slave);if (!get) {
@@ -268,7 +268,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)if (!capable (CAP_NET_ADMIN ))return (-EPERM ); - dlp = dev->priv; + dlp =netdev_priv (dev);switch (cmd) {
@@ -297,7 +297,7 @@ static int dlci_change_mtu(struct net_device *dev, int new_mtu) {struct dlci_local *dlp; - dlp = dev->priv; + dlp =netdev_priv (dev);return ((*dlp->slave->change_mtu)(dlp->slave, new_mtu)); }
@@ -308,7 +308,7 @@ static int dlci_open(struct net_device *dev)struct frad_local *flp;int err; - dlp = dev->priv; + dlp =netdev_priv (dev);if (!*(short *)(dev->dev_addr))return (-EINVAL );
@@ -316,7 +316,7 @@ static int dlci_open(struct net_device *dev)if (!netif_running (dlp->slave))return (-ENOTCONN ); - flp = dlp->slave->priv; + flp =netdev_priv (dlp->slave); err = (*flp->activate)(dlp->slave, dev);if (err)return (err);
@@ -334,9 +334,9 @@ static int dlci_close(struct net_device *dev)netif_stop_queue (dev); - dlp = dev->priv; + dlp =netdev_priv (dev); - flp = dlp->slave->priv; + flp =netdev_priv (dlp->slave); err = (*flp->deactivate)(dlp->slave, dev);return 0 ;
@@ -346,7 +346,7 @@ static struct net_device_stats *dlci_get_stats(struct net_device *dev) {struct dlci_local *dlp; - dlp = dev->priv; + dlp =netdev_priv (dev);return (&dlp->stats); }
@@ -364,7 +364,7 @@ static int dlci_add(struct dlci_add *dlci)if (!slave)return -ENODEV ; -if (slave->type !=ARPHRD_FRAD || slave->priv ==NULL ) +if (slave->type !=ARPHRD_FRAD ||netdev_priv (slave) ==NULL ) goto err1;/* create device name */
@@ -390,11 +390,11 @@ static int dlci_add(struct dlci_add *dlci) *(short *)(master->dev_addr) = dlci->dlci; - dlp = (struct dlci_local *) master->priv; + dlp =netdev_priv (master); dlp->slave = slave; dlp->master = master; - flp = slave->priv; + flp =netdev_priv (slave); err = (*flp->assoc)(slave, master);if (err <0 ) goto err2;
@@ -434,9 +434,9 @@ static int dlci_del(struct dlci_add *dlci)return (-EBUSY ); } - dlp = master->priv; + dlp =netdev_priv (master); slave = dlp->slave; - flp = slave->priv; + flp =netdev_priv (slave);rtnl_lock (); err = (*flp->deassoc)(slave, master);
@@ -490,7 +490,7 @@ static const struct header_ops dlci_header_ops = {static void dlci_setup (struct net_device *dev) { -struct dlci_local *dlp = dev->priv; +struct dlci_local *dlp =netdev_priv (dev); dev->flags =0 ; dev->open = dlci_open;
drivers/net/wan/sdla.c +24 -24
192 lines not on this page · raw message
drivers/net/wan/x25_asy.c +14 -14
@@ -64,7 +64,7 @@ static struct x25_asy *x25_asy_alloc(void)if (dev ==NULL )break ; - sl = dev->priv; + sl =netdev_priv (dev);/* Not in use ? */ if (!test_and_set_bit (SLF_INUSE , &sl->flags))return sl;
@@ -86,7 +86,7 @@ static struct x25_asy *x25_asy_alloc(void)return NULL ;/* Initialize channel control data */ - sl = dev->priv; + sl =netdev_priv (dev); dev->base_addr = i;/* register device so that it can be ifconfig'ed */
@@ -120,7 +120,7 @@ static void x25_asy_free(struct x25_asy *sl)static int x25_asy_change_mtu (struct net_device *dev,int newmtu) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);unsigned char *xbuff, *rbuff;int len =2 * newmtu;
@@ -279,7 +279,7 @@ static void x25_asy_write_wakeup(struct tty_struct *tty)static void x25_asy_timeout (struct net_device *dev) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);spin_lock (&sl->lock);if (netif_queue_stopped (dev)) {
@@ -300,7 +300,7 @@ static void x25_asy_timeout(struct net_device *dev)static int x25_asy_xmit (struct sk_buff *skb,struct net_device *dev) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);int err;if (!netif_running (sl->dev)) {
@@ -371,7 +371,7 @@ static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb)static void x25_asy_data_transmit (struct net_device *dev,struct sk_buff *skb) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);spin_lock (&sl->lock);if (netif_queue_stopped (sl->dev) || sl->tty ==NULL ) {
@@ -396,7 +396,7 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)static void x25_asy_connected (struct net_device *dev,int reason) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);struct sk_buff *skb;unsigned char *ptr;
@@ -415,7 +415,7 @@ static void x25_asy_connected(struct net_device *dev, int reason)static void x25_asy_disconnected (struct net_device *dev,int reason) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);struct sk_buff *skb;unsigned char *ptr;
@@ -446,7 +446,7 @@ static struct lapb_register_struct x25_asy_callbacks = {/* Open the low-level part of the X.25 channel. Easy! */ static int x25_asy_open (struct net_device *dev) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);unsigned long len;int err;
@@ -495,7 +495,7 @@ norbuff:/* Close the low-level part of the X.25 channel. Easy! */ static int x25_asy_close (struct net_device *dev) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);int err;spin_lock (&sl->lock);
@@ -611,7 +611,7 @@ static void x25_asy_close_tty(struct tty_struct *tty)static struct net_device_stats *x25_asy_get_stats (struct net_device *dev) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);return &sl->stats; }
@@ -713,7 +713,7 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,static int x25_asy_open_dev (struct net_device *dev) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);if (sl->tty ==NULL )return -ENODEV ;return 0 ;
@@ -722,7 +722,7 @@ static int x25_asy_open_dev(struct net_device *dev)/* Initialise the X.25 driver. Called by the device init code */ static void x25_asy_setup (struct net_device *dev) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev); sl->magic =X25_ASY_MAGIC ; sl->dev = dev;
@@ -789,7 +789,7 @@ static void __exit exit_x25_asy(void)for (i =0 ; i < x25_asy_maxdev; i++) { dev = x25_asy_devs[i];if (dev) { -struct x25_asy *sl = dev->priv; +struct x25_asy *sl =netdev_priv (dev);spin_lock_bh (&sl->lock);if (sl->tty)
drivers/net/wireless/libertas/ethtool.c +6 -6
@@ -23,7 +23,7 @@ static const char * mesh_stat_strings[]= {static void lbs_ethtool_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info) { -struct lbs_private *priv = (struct lbs_private *) dev->priv; +struct lbs_private *priv =netdev_priv (dev); snprintf(info->fw_version, 32, "%u.%u.%u.p%u", priv->fwrelease >> 24 & 0xff,
@@ -47,7 +47,7 @@ static int lbs_ethtool_get_eeprom_len(struct net_device *dev)static int lbs_ethtool_get_eeprom (struct net_device *dev,struct ethtool_eeprom *eeprom,u8 * bytes) { -struct lbs_private *priv = (struct lbs_private *) dev->priv; +struct lbs_private *priv =netdev_priv (dev);struct cmd_ds_802_11_eeprom_access cmd;int ret;
@@ -76,7 +76,7 @@ out:static void lbs_ethtool_get_stats (struct net_device *dev,struct ethtool_stats *stats,uint64_t *data) { -struct lbs_private *priv = dev->priv; +struct lbs_private *priv =netdev_priv (dev);struct cmd_ds_mesh_access mesh_access;int ret;
@@ -113,7 +113,7 @@ static void lbs_ethtool_get_stats(struct net_device *dev,static int lbs_ethtool_get_sset_count (struct net_device *dev,int sset) { -struct lbs_private *priv = dev->priv; +struct lbs_private *priv =netdev_priv (dev);if (sset ==ETH_SS_STATS && dev == priv->mesh_dev)return MESH_STATS_NUM ;
@@ -143,7 +143,7 @@ static void lbs_ethtool_get_strings(struct net_device *dev,static void lbs_ethtool_get_wol (struct net_device *dev,struct ethtool_wolinfo *wol) { -struct lbs_private *priv = dev->priv; +struct lbs_private *priv =netdev_priv (dev);if (priv->wol_criteria ==0xffffffff ) {/* Interface driver didn't configure wake */
@@ -166,7 +166,7 @@ static void lbs_ethtool_get_wol(struct net_device *dev,static int lbs_ethtool_set_wol (struct net_device *dev,struct ethtool_wolinfo *wol) { -struct lbs_private *priv = dev->priv; +struct lbs_private *priv =netdev_priv (dev);uint32_t criteria =0 ;if (priv->wol_criteria ==0xffffffff && wol->wolopts)
drivers/net/wireless/libertas/persistcfg.c +8 -8
@@ -18,7 +18,7 @@static int mesh_get_default_parameters (struct device *dev,struct mrvl_mesh_defaults *defs) { -struct lbs_private *priv =to_net_dev (dev)->priv; +struct lbs_private *priv =netdev_priv (to_net_dev (dev));struct cmd_ds_mesh_config cmd;int ret;
@@ -57,7 +57,7 @@ static ssize_t bootflag_get(struct device *dev,static ssize_t bootflag_set (struct device *dev,struct device_attribute *attr,const char *buf,size_t count) { -struct lbs_private *priv =to_net_dev (dev)->priv; +struct lbs_private *priv =netdev_priv (to_net_dev (dev));struct cmd_ds_mesh_config cmd;uint32_t datum;int ret;
@@ -100,7 +100,7 @@ static ssize_t boottime_get(struct device *dev,static ssize_t boottime_set (struct device *dev,struct device_attribute *attr,const char *buf,size_t count) { -struct lbs_private *priv =to_net_dev (dev)->priv; +struct lbs_private *priv =netdev_priv (to_net_dev (dev));struct cmd_ds_mesh_config cmd;uint32_t datum;int ret;
@@ -152,7 +152,7 @@ static ssize_t channel_get(struct device *dev,static ssize_t channel_set (struct device *dev,struct device_attribute *attr,const char *buf,size_t count) { -struct lbs_private *priv =to_net_dev (dev)->priv; +struct lbs_private *priv =netdev_priv (to_net_dev (dev));struct cmd_ds_mesh_config cmd;uint32_t datum;int ret;
@@ -210,7 +210,7 @@ static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr,struct cmd_ds_mesh_config cmd;struct mrvl_mesh_defaults defs;struct mrvl_meshie *ie; -struct lbs_private *priv =to_net_dev (dev)->priv; +struct lbs_private *priv =netdev_priv (to_net_dev (dev));int len;int ret;
@@ -269,7 +269,7 @@ static ssize_t protocol_id_set(struct device *dev,struct cmd_ds_mesh_config cmd;struct mrvl_mesh_defaults defs;struct mrvl_meshie *ie; -struct lbs_private *priv =to_net_dev (dev)->priv; +struct lbs_private *priv =netdev_priv (to_net_dev (dev));uint32_t datum;int ret;
@@ -323,7 +323,7 @@ static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr,struct cmd_ds_mesh_config cmd;struct mrvl_mesh_defaults defs;struct mrvl_meshie *ie; -struct lbs_private *priv =to_net_dev (dev)->priv; +struct lbs_private *priv =netdev_priv (to_net_dev (dev));uint32_t datum;int ret;
@@ -377,7 +377,7 @@ static ssize_t capability_set(struct device *dev, struct device_attribute *attr,struct cmd_ds_mesh_config cmd;struct mrvl_mesh_defaults defs;struct mrvl_meshie *ie; -struct lbs_private *priv =to_net_dev (dev)->priv; +struct lbs_private *priv =netdev_priv (to_net_dev (dev));uint32_t datum;int ret;
drivers/net/wireless/libertas/scan.c +2 -2
@@ -945,7 +945,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) {DECLARE_SSID_BUF (ssid ); -struct lbs_private *priv = dev->priv; +struct lbs_private *priv =netdev_priv (dev);int ret =0 ;lbs_deb_enter (LBS_DEB_WEXT );
@@ -1008,7 +1008,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { #define SCAN_ITEM_SIZE 128 - struct lbs_private *priv = dev->priv; + struct lbs_private *priv = netdev_priv(dev);int err =0 ;char *ev = extra;char *stop = ev + dwrq->length;
drivers/net/wireless/libertas/tx.c +1 -1
@@ -60,7 +60,7 @@ static u32 convert_radiotap_rate_to_mv(u8 rate)int lbs_hard_start_xmit (struct sk_buff *skb,struct net_device *dev) {unsigned long flags; -struct lbs_private *priv = dev->priv; +struct lbs_private *priv =netdev_priv (dev);struct txpd *txpd;char *p802x_hdr;uint16_t pkt_len;
Signature · 1 line
1.5.3.4
From: Wang Chen <[email protected]>
Date: Thu, 13 Nov 2008 10:43:48 +0800
Quoted 7 lines
We have some reasons to kill
netdev->priv:
1.netdev->privis equal tonetdev_priv().
2.netdev_priv()wraps the calculation of netdev->priv's offset, obviouslynetdev_priv()is more flexible thannetdev->priv.
But we cann't killnetdev->priv, because so many drivers reference to it directly.
Quoted 7 lines
This patch is a safe convert for
netdev->privtonetdev_priv(netdev). Since all of thenetdev->privis only for read.
But it is too big to be sent in one mail.
I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger.Signed-off-by Wang Chen <[email protected]>
Applied.