aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-20 07:25:06 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 07:25:06 -0500
commit826dd0e1e3c83ce0cd8c295cd0f6e72b8b527809 (patch)
tree1ac31b784b97a7b5649f3aaaa823915bc5628c18
parentc8019bf3aff653cceb64f66489fc299ee5957b57 (diff)
netdevice ni65: Convert directly reference of netdev->priv
This patch is to kill directly reference of netdev->priv too. Because the private data needs special memory: lower 16MB DMA. alloc_etherdev() can not do this work. So we can't use netdev->priv to point to netdev's private data. Use netdev->ml_priv instead. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ni65.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/ni65.c b/drivers/net/ni65.c
index 24e393b3e0b7..1142c770eab9 100644
--- a/drivers/net/ni65.c
+++ b/drivers/net/ni65.c
@@ -295,7 +295,7 @@ static void ni65_set_performance(struct priv *p)
295 */ 295 */
296static int ni65_open(struct net_device *dev) 296static int ni65_open(struct net_device *dev)
297{ 297{
298 struct priv *p = (struct priv *) dev->priv; 298 struct priv *p = dev->ml_priv;
299 int irqval = request_irq(dev->irq, &ni65_interrupt,0, 299 int irqval = request_irq(dev->irq, &ni65_interrupt,0,
300 cards[p->cardno].cardname,dev); 300 cards[p->cardno].cardname,dev);
301 if (irqval) { 301 if (irqval) {
@@ -321,7 +321,7 @@ static int ni65_open(struct net_device *dev)
321 */ 321 */
322static int ni65_close(struct net_device *dev) 322static int ni65_close(struct net_device *dev)
323{ 323{
324 struct priv *p = (struct priv *) dev->priv; 324 struct priv *p = dev->ml_priv;
325 325
326 netif_stop_queue(dev); 326 netif_stop_queue(dev);
327 327
@@ -345,7 +345,7 @@ static int ni65_close(struct net_device *dev)
345 345
346static void cleanup_card(struct net_device *dev) 346static void cleanup_card(struct net_device *dev)
347{ 347{
348 struct priv *p = (struct priv *) dev->priv; 348 struct priv *p = dev->ml_priv;
349 disable_dma(dev->dma); 349 disable_dma(dev->dma);
350 free_dma(dev->dma); 350 free_dma(dev->dma);
351 release_region(dev->base_addr, cards[p->cardno].total_size); 351 release_region(dev->base_addr, cards[p->cardno].total_size);
@@ -444,7 +444,7 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr)
444 release_region(ioaddr, cards[i].total_size); 444 release_region(ioaddr, cards[i].total_size);
445 return j; 445 return j;
446 } 446 }
447 p = (struct priv *) dev->priv; 447 p = dev->ml_priv;
448 p->cmdr_addr = ioaddr + cards[i].cmd_offset; 448 p->cmdr_addr = ioaddr + cards[i].cmd_offset;
449 p->cardno = i; 449 p->cardno = i;
450 spin_lock_init(&p->ring_lock); 450 spin_lock_init(&p->ring_lock);
@@ -647,8 +647,8 @@ static int ni65_alloc_buffer(struct net_device *dev)
647 if(!ptr) 647 if(!ptr)
648 return -ENOMEM; 648 return -ENOMEM;
649 649
650 p = dev->priv = (struct priv *) (((unsigned long) ptr + 7) & ~0x7); 650 p = dev->ml_priv = (struct priv *) (((unsigned long) ptr + 7) & ~0x7);
651 memset((char *) dev->priv,0,sizeof(struct priv)); 651 memset((char *)p, 0, sizeof(struct priv));
652 p->self = ptr; 652 p->self = ptr;
653 653
654 for(i=0;i<TMDNUM;i++) 654 for(i=0;i<TMDNUM;i++)
@@ -790,7 +790,7 @@ static void ni65_stop_start(struct net_device *dev,struct priv *p)
790static int ni65_lance_reinit(struct net_device *dev) 790static int ni65_lance_reinit(struct net_device *dev)
791{ 791{
792 int i; 792 int i;
793 struct priv *p = (struct priv *) dev->priv; 793 struct priv *p = dev->ml_priv;
794 unsigned long flags; 794 unsigned long flags;
795 795
796 p->lock = 0; 796 p->lock = 0;
@@ -876,7 +876,7 @@ static irqreturn_t ni65_interrupt(int irq, void * dev_id)
876 struct priv *p; 876 struct priv *p;
877 int bcnt = 32; 877 int bcnt = 32;
878 878
879 p = (struct priv *) dev->priv; 879 p = dev->ml_priv;
880 880
881 spin_lock(&p->ring_lock); 881 spin_lock(&p->ring_lock);
882 882
@@ -899,7 +899,7 @@ static irqreturn_t ni65_interrupt(int irq, void * dev_id)
899 899
900 if(csr0 & CSR0_ERR) 900 if(csr0 & CSR0_ERR)
901 { 901 {
902 struct priv *p = (struct priv *) dev->priv; 902 struct priv *p = dev->ml_priv;
903 if(debuglevel > 1) 903 if(debuglevel > 1)
904 printk(KERN_ERR "%s: general error: %04x.\n",dev->name,csr0); 904 printk(KERN_ERR "%s: general error: %04x.\n",dev->name,csr0);
905 if(csr0 & CSR0_BABL) 905 if(csr0 & CSR0_BABL)
@@ -924,7 +924,7 @@ static irqreturn_t ni65_interrupt(int irq, void * dev_id)
924 int j; 924 int j;
925 for(j=0;j<RMDNUM;j++) 925 for(j=0;j<RMDNUM;j++)
926 { 926 {
927 struct priv *p = (struct priv *) dev->priv; 927 struct priv *p = dev->ml_priv;
928 int i,k,num1,num2; 928 int i,k,num1,num2;
929 for(i=RMDNUM-1;i>0;i--) { 929 for(i=RMDNUM-1;i>0;i--) {
930 num2 = (p->rmdnum + i) & (RMDNUM-1); 930 num2 = (p->rmdnum + i) & (RMDNUM-1);
@@ -982,7 +982,7 @@ static irqreturn_t ni65_interrupt(int irq, void * dev_id)
982 */ 982 */
983static void ni65_xmit_intr(struct net_device *dev,int csr0) 983static void ni65_xmit_intr(struct net_device *dev,int csr0)
984{ 984{
985 struct priv *p = (struct priv *) dev->priv; 985 struct priv *p = dev->ml_priv;
986 986
987 while(p->xmit_queued) 987 while(p->xmit_queued)
988 { 988 {
@@ -1049,7 +1049,7 @@ static void ni65_recv_intr(struct net_device *dev,int csr0)
1049 struct rmd *rmdp; 1049 struct rmd *rmdp;
1050 int rmdstat,len; 1050 int rmdstat,len;
1051 int cnt=0; 1051 int cnt=0;
1052 struct priv *p = (struct priv *) dev->priv; 1052 struct priv *p = dev->ml_priv;
1053 1053
1054 rmdp = p->rmdhead + p->rmdnum; 1054 rmdp = p->rmdhead + p->rmdnum;
1055 while(!( (rmdstat = rmdp->u.s.status) & RCV_OWN)) 1055 while(!( (rmdstat = rmdp->u.s.status) & RCV_OWN))
@@ -1139,7 +1139,7 @@ static void ni65_recv_intr(struct net_device *dev,int csr0)
1139static void ni65_timeout(struct net_device *dev) 1139static void ni65_timeout(struct net_device *dev)
1140{ 1140{
1141 int i; 1141 int i;
1142 struct priv *p = (struct priv *) dev->priv; 1142 struct priv *p = dev->ml_priv;
1143 1143
1144 printk(KERN_ERR "%s: xmitter timed out, try to restart!\n",dev->name); 1144 printk(KERN_ERR "%s: xmitter timed out, try to restart!\n",dev->name);
1145 for(i=0;i<TMDNUM;i++) 1145 for(i=0;i<TMDNUM;i++)
@@ -1156,7 +1156,7 @@ static void ni65_timeout(struct net_device *dev)
1156 1156
1157static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev) 1157static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev)
1158{ 1158{
1159 struct priv *p = (struct priv *) dev->priv; 1159 struct priv *p = dev->ml_priv;
1160 1160
1161 netif_stop_queue(dev); 1161 netif_stop_queue(dev);
1162 1162
@@ -1221,7 +1221,7 @@ static struct net_device_stats *ni65_get_stats(struct net_device *dev)
1221 1221
1222#if 0 1222#if 0
1223 int i; 1223 int i;
1224 struct priv *p = (struct priv *) dev->priv; 1224 struct priv *p = dev->ml_priv;
1225 for(i=0;i<RMDNUM;i++) 1225 for(i=0;i<RMDNUM;i++)
1226 { 1226 {
1227 struct rmd *rmdp = p->rmdhead + ((p->rmdnum + i) & (RMDNUM-1)); 1227 struct rmd *rmdp = p->rmdhead + ((p->rmdnum + i) & (RMDNUM-1));
@@ -1230,7 +1230,7 @@ static struct net_device_stats *ni65_get_stats(struct net_device *dev)
1230 printk("\n"); 1230 printk("\n");
1231#endif 1231#endif
1232 1232
1233 return &((struct priv *) dev->priv)->stats; 1233 return &((struct priv *)dev->ml_priv)->stats;
1234} 1234}
1235 1235
1236static void set_multicast_list(struct net_device *dev) 1236static void set_multicast_list(struct net_device *dev)