diff options
-rw-r--r-- | drivers/net/ibmlana.c | 20 | ||||
-rw-r--r-- | drivers/net/ibmlana.h | 6 | ||||
-rw-r--r-- | drivers/net/ibmveth.c | 90 | ||||
-rw-r--r-- | drivers/net/ibmveth.h | 4 |
4 files changed, 60 insertions, 60 deletions
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c index 01ad904215a1..51fd51609ea9 100644 --- a/drivers/net/ibmlana.c +++ b/drivers/net/ibmlana.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | net-3-driver for the IBM LAN Adapter/A | 2 | net-3-driver for the IBM LAN Adapter/A |
3 | 3 | ||
4 | This is an extension to the Linux operating system, and is covered by the | 4 | This is an extension to the Linux operating system, and is covered by the |
@@ -11,9 +11,9 @@ This driver is based both on the SK_MCA driver, which is itself based on the | |||
11 | SK_G16 and 3C523 driver. | 11 | SK_G16 and 3C523 driver. |
12 | 12 | ||
13 | paper sources: | 13 | paper sources: |
14 | 'PC Hardware: Aufbau, Funktionsweise, Programmierung' by | 14 | 'PC Hardware: Aufbau, Funktionsweise, Programmierung' by |
15 | Hans-Peter Messmer for the basic Microchannel stuff | 15 | Hans-Peter Messmer for the basic Microchannel stuff |
16 | 16 | ||
17 | 'Linux Geraetetreiber' by Allesandro Rubini, Kalle Dalheimer | 17 | 'Linux Geraetetreiber' by Allesandro Rubini, Kalle Dalheimer |
18 | for help on Ethernet driver programming | 18 | for help on Ethernet driver programming |
19 | 19 | ||
@@ -27,14 +27,14 @@ paper sources: | |||
27 | 27 | ||
28 | special acknowledgements to: | 28 | special acknowledgements to: |
29 | - Bob Eager for helping me out with documentation from IBM | 29 | - Bob Eager for helping me out with documentation from IBM |
30 | - Jim Shorney for his endless patience with me while I was using | 30 | - Jim Shorney for his endless patience with me while I was using |
31 | him as a beta tester to trace down the address filter bug ;-) | 31 | him as a beta tester to trace down the address filter bug ;-) |
32 | 32 | ||
33 | Missing things: | 33 | Missing things: |
34 | 34 | ||
35 | -> set debug level via ioctl instead of compile-time switches | 35 | -> set debug level via ioctl instead of compile-time switches |
36 | -> I didn't follow the development of the 2.1.x kernels, so my | 36 | -> I didn't follow the development of the 2.1.x kernels, so my |
37 | assumptions about which things changed with which kernel version | 37 | assumptions about which things changed with which kernel version |
38 | are probably nonsense | 38 | are probably nonsense |
39 | 39 | ||
40 | History: | 40 | History: |
@@ -275,7 +275,7 @@ static void InitDscrs(struct net_device *dev) | |||
275 | priv->rrastart = raddr = priv->txbufstart + (TXBUFCNT * PKTSIZE); | 275 | priv->rrastart = raddr = priv->txbufstart + (TXBUFCNT * PKTSIZE); |
276 | priv->rdastart = addr = priv->rrastart + (priv->rxbufcnt * sizeof(rra_t)); | 276 | priv->rdastart = addr = priv->rrastart + (priv->rxbufcnt * sizeof(rra_t)); |
277 | priv->rxbufstart = baddr = priv->rdastart + (priv->rxbufcnt * sizeof(rda_t)); | 277 | priv->rxbufstart = baddr = priv->rdastart + (priv->rxbufcnt * sizeof(rda_t)); |
278 | 278 | ||
279 | for (z = 0; z < priv->rxbufcnt; z++) { | 279 | for (z = 0; z < priv->rxbufcnt; z++) { |
280 | rra.startlo = baddr; | 280 | rra.startlo = baddr; |
281 | rra.starthi = 0; | 281 | rra.starthi = 0; |
@@ -570,7 +570,7 @@ static void irqrx_handler(struct net_device *dev) | |||
570 | lrdaaddr = priv->rdastart + (priv->lastrxdescr * sizeof(rda_t)); | 570 | lrdaaddr = priv->rdastart + (priv->lastrxdescr * sizeof(rda_t)); |
571 | memcpy_fromio(&rda, priv->base + rdaaddr, sizeof(rda_t)); | 571 | memcpy_fromio(&rda, priv->base + rdaaddr, sizeof(rda_t)); |
572 | 572 | ||
573 | /* iron out upper word halves of fields we use - SONIC will duplicate | 573 | /* iron out upper word halves of fields we use - SONIC will duplicate |
574 | bits 0..15 to 16..31 */ | 574 | bits 0..15 to 16..31 */ |
575 | 575 | ||
576 | rda.status &= 0xffff; | 576 | rda.status &= 0xffff; |
@@ -836,9 +836,9 @@ static int ibmlana_tx(struct sk_buff *skb, struct net_device *dev) | |||
836 | baddr = priv->txbufstart + (priv->nexttxdescr * PKTSIZE); | 836 | baddr = priv->txbufstart + (priv->nexttxdescr * PKTSIZE); |
837 | memcpy_toio(priv->base + baddr, skb->data, skb->len); | 837 | memcpy_toio(priv->base + baddr, skb->data, skb->len); |
838 | 838 | ||
839 | /* copy filler into RAM - in case we're filling up... | 839 | /* copy filler into RAM - in case we're filling up... |
840 | we're filling a bit more than necessary, but that doesn't harm | 840 | we're filling a bit more than necessary, but that doesn't harm |
841 | since the buffer is far larger... | 841 | since the buffer is far larger... |
842 | Sorry Linus for the filler string but I couldn't resist ;-) */ | 842 | Sorry Linus for the filler string but I couldn't resist ;-) */ |
843 | 843 | ||
844 | if (tmplen > skb->len) { | 844 | if (tmplen > skb->len) { |
@@ -952,7 +952,7 @@ static int ibmlana_probe(struct net_device *dev) | |||
952 | priv->realirq = irq; | 952 | priv->realirq = irq; |
953 | priv->medium = medium; | 953 | priv->medium = medium; |
954 | spin_lock_init(&priv->lock); | 954 | spin_lock_init(&priv->lock); |
955 | 955 | ||
956 | 956 | ||
957 | /* set base + irq for this device (irq not allocated so far) */ | 957 | /* set base + irq for this device (irq not allocated so far) */ |
958 | 958 | ||
diff --git a/drivers/net/ibmlana.h b/drivers/net/ibmlana.h index 458ee226e537..6b58bab9e308 100644 --- a/drivers/net/ibmlana.h +++ b/drivers/net/ibmlana.h | |||
@@ -17,7 +17,7 @@ | |||
17 | /* media enumeration - defined in a way that it fits onto the LAN/A's | 17 | /* media enumeration - defined in a way that it fits onto the LAN/A's |
18 | POS registers... */ | 18 | POS registers... */ |
19 | 19 | ||
20 | typedef enum { | 20 | typedef enum { |
21 | Media_10BaseT, Media_10Base5, | 21 | Media_10BaseT, Media_10Base5, |
22 | Media_Unknown, Media_10Base2, Media_Count | 22 | Media_Unknown, Media_10Base2, Media_Count |
23 | } ibmlana_medium; | 23 | } ibmlana_medium; |
@@ -27,7 +27,7 @@ typedef enum { | |||
27 | typedef struct { | 27 | typedef struct { |
28 | unsigned int slot; /* MCA-Slot-# */ | 28 | unsigned int slot; /* MCA-Slot-# */ |
29 | struct net_device_stats stat; /* packet statistics */ | 29 | struct net_device_stats stat; /* packet statistics */ |
30 | int realirq; /* memorizes actual IRQ, even when | 30 | int realirq; /* memorizes actual IRQ, even when |
31 | currently not allocated */ | 31 | currently not allocated */ |
32 | ibmlana_medium medium; /* physical cannector */ | 32 | ibmlana_medium medium; /* physical cannector */ |
33 | u32 tdastart, txbufstart, /* addresses */ | 33 | u32 tdastart, txbufstart, /* addresses */ |
@@ -41,7 +41,7 @@ typedef struct { | |||
41 | spinlock_t lock; | 41 | spinlock_t lock; |
42 | } ibmlana_priv; | 42 | } ibmlana_priv; |
43 | 43 | ||
44 | /* this card uses quite a lot of I/O ports...luckily the MCA bus decodes | 44 | /* this card uses quite a lot of I/O ports...luckily the MCA bus decodes |
45 | a full 64K I/O range... */ | 45 | a full 64K I/O range... */ |
46 | 46 | ||
47 | #define IBM_LANA_IORANGE 0xa0 | 47 | #define IBM_LANA_IORANGE 0xa0 |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 71c74fb048dd..666346f6469e 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -24,7 +24,7 @@ | |||
24 | /* for use with IBM i/pSeries LPAR Linux. It utilizes the logical LAN */ | 24 | /* for use with IBM i/pSeries LPAR Linux. It utilizes the logical LAN */ |
25 | /* option of the RS/6000 Platform Architechture to interface with virtual */ | 25 | /* option of the RS/6000 Platform Architechture to interface with virtual */ |
26 | /* ethernet NICs that are presented to the partition by the hypervisor. */ | 26 | /* ethernet NICs that are presented to the partition by the hypervisor. */ |
27 | /* */ | 27 | /* */ |
28 | /**************************************************************************/ | 28 | /**************************************************************************/ |
29 | /* | 29 | /* |
30 | TODO: | 30 | TODO: |
@@ -79,7 +79,7 @@ | |||
79 | #else | 79 | #else |
80 | #define ibmveth_debug_printk_no_adapter(fmt, args...) | 80 | #define ibmveth_debug_printk_no_adapter(fmt, args...) |
81 | #define ibmveth_debug_printk(fmt, args...) | 81 | #define ibmveth_debug_printk(fmt, args...) |
82 | #define ibmveth_assert(expr) | 82 | #define ibmveth_assert(expr) |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | static int ibmveth_open(struct net_device *dev); | 85 | static int ibmveth_open(struct net_device *dev); |
@@ -148,13 +148,13 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool) | |||
148 | { | 148 | { |
149 | int i; | 149 | int i; |
150 | 150 | ||
151 | pool->free_map = kmalloc(sizeof(u16) * pool->size, GFP_KERNEL); | 151 | pool->free_map = kmalloc(sizeof(u16) * pool->size, GFP_KERNEL); |
152 | 152 | ||
153 | if(!pool->free_map) { | 153 | if(!pool->free_map) { |
154 | return -1; | 154 | return -1; |
155 | } | 155 | } |
156 | 156 | ||
157 | pool->dma_addr = kmalloc(sizeof(dma_addr_t) * pool->size, GFP_KERNEL); | 157 | pool->dma_addr = kmalloc(sizeof(dma_addr_t) * pool->size, GFP_KERNEL); |
158 | if(!pool->dma_addr) { | 158 | if(!pool->dma_addr) { |
159 | kfree(pool->free_map); | 159 | kfree(pool->free_map); |
160 | pool->free_map = NULL; | 160 | pool->free_map = NULL; |
@@ -215,7 +215,7 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc | |||
215 | 215 | ||
216 | free_index = pool->consumer_index++ % pool->size; | 216 | free_index = pool->consumer_index++ % pool->size; |
217 | index = pool->free_map[free_index]; | 217 | index = pool->free_map[free_index]; |
218 | 218 | ||
219 | ibmveth_assert(index != IBM_VETH_INVALID_MAP); | 219 | ibmveth_assert(index != IBM_VETH_INVALID_MAP); |
220 | ibmveth_assert(pool->skbuff[index] == NULL); | 220 | ibmveth_assert(pool->skbuff[index] == NULL); |
221 | 221 | ||
@@ -232,10 +232,10 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc | |||
232 | desc.desc = 0; | 232 | desc.desc = 0; |
233 | desc.fields.valid = 1; | 233 | desc.fields.valid = 1; |
234 | desc.fields.length = pool->buff_size; | 234 | desc.fields.length = pool->buff_size; |
235 | desc.fields.address = dma_addr; | 235 | desc.fields.address = dma_addr; |
236 | 236 | ||
237 | lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); | 237 | lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); |
238 | 238 | ||
239 | if(lpar_rc != H_SUCCESS) { | 239 | if(lpar_rc != H_SUCCESS) { |
240 | pool->free_map[free_index] = index; | 240 | pool->free_map[free_index] = index; |
241 | pool->skbuff[index] = NULL; | 241 | pool->skbuff[index] = NULL; |
@@ -251,13 +251,13 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc | |||
251 | adapter->replenish_add_buff_success++; | 251 | adapter->replenish_add_buff_success++; |
252 | } | 252 | } |
253 | } | 253 | } |
254 | 254 | ||
255 | mb(); | 255 | mb(); |
256 | atomic_add(buffers_added, &(pool->available)); | 256 | atomic_add(buffers_added, &(pool->available)); |
257 | } | 257 | } |
258 | 258 | ||
259 | /* replenish routine */ | 259 | /* replenish routine */ |
260 | static void ibmveth_replenish_task(struct ibmveth_adapter *adapter) | 260 | static void ibmveth_replenish_task(struct ibmveth_adapter *adapter) |
261 | { | 261 | { |
262 | int i; | 262 | int i; |
263 | 263 | ||
@@ -265,7 +265,7 @@ static void ibmveth_replenish_task(struct ibmveth_adapter *adapter) | |||
265 | 265 | ||
266 | for(i = 0; i < IbmVethNumBufferPools; i++) | 266 | for(i = 0; i < IbmVethNumBufferPools; i++) |
267 | if(adapter->rx_buff_pool[i].active) | 267 | if(adapter->rx_buff_pool[i].active) |
268 | ibmveth_replenish_buffer_pool(adapter, | 268 | ibmveth_replenish_buffer_pool(adapter, |
269 | &adapter->rx_buff_pool[i]); | 269 | &adapter->rx_buff_pool[i]); |
270 | 270 | ||
271 | adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); | 271 | adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); |
@@ -372,7 +372,7 @@ static void ibmveth_rxq_recycle_buffer(struct ibmveth_adapter *adapter) | |||
372 | desc.fields.address = adapter->rx_buff_pool[pool].dma_addr[index]; | 372 | desc.fields.address = adapter->rx_buff_pool[pool].dma_addr[index]; |
373 | 373 | ||
374 | lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); | 374 | lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); |
375 | 375 | ||
376 | if(lpar_rc != H_SUCCESS) { | 376 | if(lpar_rc != H_SUCCESS) { |
377 | ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc); | 377 | ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc); |
378 | ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator); | 378 | ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator); |
@@ -407,7 +407,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter) | |||
407 | } | 407 | } |
408 | free_page((unsigned long)adapter->buffer_list_addr); | 408 | free_page((unsigned long)adapter->buffer_list_addr); |
409 | adapter->buffer_list_addr = NULL; | 409 | adapter->buffer_list_addr = NULL; |
410 | } | 410 | } |
411 | 411 | ||
412 | if(adapter->filter_list_addr != NULL) { | 412 | if(adapter->filter_list_addr != NULL) { |
413 | if(!dma_mapping_error(adapter->filter_list_dma)) { | 413 | if(!dma_mapping_error(adapter->filter_list_dma)) { |
@@ -434,7 +434,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter) | |||
434 | 434 | ||
435 | for(i = 0; i<IbmVethNumBufferPools; i++) | 435 | for(i = 0; i<IbmVethNumBufferPools; i++) |
436 | if (adapter->rx_buff_pool[i].active) | 436 | if (adapter->rx_buff_pool[i].active) |
437 | ibmveth_free_buffer_pool(adapter, | 437 | ibmveth_free_buffer_pool(adapter, |
438 | &adapter->rx_buff_pool[i]); | 438 | &adapter->rx_buff_pool[i]); |
439 | } | 439 | } |
440 | 440 | ||
@@ -452,10 +452,10 @@ static int ibmveth_open(struct net_device *netdev) | |||
452 | 452 | ||
453 | for(i = 0; i<IbmVethNumBufferPools; i++) | 453 | for(i = 0; i<IbmVethNumBufferPools; i++) |
454 | rxq_entries += adapter->rx_buff_pool[i].size; | 454 | rxq_entries += adapter->rx_buff_pool[i].size; |
455 | 455 | ||
456 | adapter->buffer_list_addr = (void*) get_zeroed_page(GFP_KERNEL); | 456 | adapter->buffer_list_addr = (void*) get_zeroed_page(GFP_KERNEL); |
457 | adapter->filter_list_addr = (void*) get_zeroed_page(GFP_KERNEL); | 457 | adapter->filter_list_addr = (void*) get_zeroed_page(GFP_KERNEL); |
458 | 458 | ||
459 | if(!adapter->buffer_list_addr || !adapter->filter_list_addr) { | 459 | if(!adapter->buffer_list_addr || !adapter->filter_list_addr) { |
460 | ibmveth_error_printk("unable to allocate filter or buffer list pages\n"); | 460 | ibmveth_error_printk("unable to allocate filter or buffer list pages\n"); |
461 | ibmveth_cleanup(adapter); | 461 | ibmveth_cleanup(adapter); |
@@ -503,7 +503,7 @@ static int ibmveth_open(struct net_device *netdev) | |||
503 | ibmveth_debug_printk("filter list @ 0x%p\n", adapter->filter_list_addr); | 503 | ibmveth_debug_printk("filter list @ 0x%p\n", adapter->filter_list_addr); |
504 | ibmveth_debug_printk("receive q @ 0x%p\n", adapter->rx_queue.queue_addr); | 504 | ibmveth_debug_printk("receive q @ 0x%p\n", adapter->rx_queue.queue_addr); |
505 | 505 | ||
506 | 506 | ||
507 | lpar_rc = h_register_logical_lan(adapter->vdev->unit_address, | 507 | lpar_rc = h_register_logical_lan(adapter->vdev->unit_address, |
508 | adapter->buffer_list_dma, | 508 | adapter->buffer_list_dma, |
509 | rxq_desc.desc, | 509 | rxq_desc.desc, |
@@ -518,7 +518,7 @@ static int ibmveth_open(struct net_device *netdev) | |||
518 | rxq_desc.desc, | 518 | rxq_desc.desc, |
519 | mac_address); | 519 | mac_address); |
520 | ibmveth_cleanup(adapter); | 520 | ibmveth_cleanup(adapter); |
521 | return -ENONET; | 521 | return -ENONET; |
522 | } | 522 | } |
523 | 523 | ||
524 | for(i = 0; i<IbmVethNumBufferPools; i++) { | 524 | for(i = 0; i<IbmVethNumBufferPools; i++) { |
@@ -557,7 +557,7 @@ static int ibmveth_close(struct net_device *netdev) | |||
557 | { | 557 | { |
558 | struct ibmveth_adapter *adapter = netdev->priv; | 558 | struct ibmveth_adapter *adapter = netdev->priv; |
559 | long lpar_rc; | 559 | long lpar_rc; |
560 | 560 | ||
561 | ibmveth_debug_printk("close starting\n"); | 561 | ibmveth_debug_printk("close starting\n"); |
562 | 562 | ||
563 | if (!adapter->pool_config) | 563 | if (!adapter->pool_config) |
@@ -705,7 +705,7 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
705 | desc[5].desc, | 705 | desc[5].desc, |
706 | correlator); | 706 | correlator); |
707 | } while ((lpar_rc == H_BUSY) && (retry_count--)); | 707 | } while ((lpar_rc == H_BUSY) && (retry_count--)); |
708 | 708 | ||
709 | if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) { | 709 | if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) { |
710 | int i; | 710 | int i; |
711 | ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc); | 711 | ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc); |
@@ -791,7 +791,7 @@ static int ibmveth_poll(struct net_device *netdev, int *budget) | |||
791 | /* more work to do - return that we are not done yet */ | 791 | /* more work to do - return that we are not done yet */ |
792 | netdev->quota -= frames_processed; | 792 | netdev->quota -= frames_processed; |
793 | *budget -= frames_processed; | 793 | *budget -= frames_processed; |
794 | return 1; | 794 | return 1; |
795 | } | 795 | } |
796 | 796 | ||
797 | /* we think we are done - reenable interrupts, then check once more to make sure we are done */ | 797 | /* we think we are done - reenable interrupts, then check once more to make sure we are done */ |
@@ -817,7 +817,7 @@ static int ibmveth_poll(struct net_device *netdev, int *budget) | |||
817 | } | 817 | } |
818 | 818 | ||
819 | static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance, struct pt_regs *regs) | 819 | static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance, struct pt_regs *regs) |
820 | { | 820 | { |
821 | struct net_device *netdev = dev_instance; | 821 | struct net_device *netdev = dev_instance; |
822 | struct ibmveth_adapter *adapter = netdev->priv; | 822 | struct ibmveth_adapter *adapter = netdev->priv; |
823 | unsigned long lpar_rc; | 823 | unsigned long lpar_rc; |
@@ -873,7 +873,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev) | |||
873 | ibmveth_error_printk("h_multicast_ctrl rc=%ld when adding an entry to the filter table\n", lpar_rc); | 873 | ibmveth_error_printk("h_multicast_ctrl rc=%ld when adding an entry to the filter table\n", lpar_rc); |
874 | } | 874 | } |
875 | } | 875 | } |
876 | 876 | ||
877 | /* re-enable filtering */ | 877 | /* re-enable filtering */ |
878 | lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, | 878 | lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, |
879 | IbmVethMcastEnableFiltering, | 879 | IbmVethMcastEnableFiltering, |
@@ -915,7 +915,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
915 | unsigned int *mcastFilterSize_p; | 915 | unsigned int *mcastFilterSize_p; |
916 | 916 | ||
917 | 917 | ||
918 | ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n", | 918 | ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n", |
919 | dev->unit_address); | 919 | dev->unit_address); |
920 | 920 | ||
921 | mac_addr_p = (unsigned char *) vio_get_attribute(dev, VETH_MAC_ADDR, 0); | 921 | mac_addr_p = (unsigned char *) vio_get_attribute(dev, VETH_MAC_ADDR, 0); |
@@ -924,7 +924,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
924 | "attribute\n", __FILE__, __LINE__); | 924 | "attribute\n", __FILE__, __LINE__); |
925 | return 0; | 925 | return 0; |
926 | } | 926 | } |
927 | 927 | ||
928 | mcastFilterSize_p= (unsigned int *) vio_get_attribute(dev, VETH_MCAST_FILTER_SIZE, 0); | 928 | mcastFilterSize_p= (unsigned int *) vio_get_attribute(dev, VETH_MCAST_FILTER_SIZE, 0); |
929 | if(!mcastFilterSize_p) { | 929 | if(!mcastFilterSize_p) { |
930 | printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find " | 930 | printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find " |
@@ -932,7 +932,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
932 | __FILE__, __LINE__); | 932 | __FILE__, __LINE__); |
933 | return 0; | 933 | return 0; |
934 | } | 934 | } |
935 | 935 | ||
936 | netdev = alloc_etherdev(sizeof(struct ibmveth_adapter)); | 936 | netdev = alloc_etherdev(sizeof(struct ibmveth_adapter)); |
937 | 937 | ||
938 | if(!netdev) | 938 | if(!netdev) |
@@ -948,13 +948,13 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
948 | adapter->netdev = netdev; | 948 | adapter->netdev = netdev; |
949 | adapter->mcastFilterSize= *mcastFilterSize_p; | 949 | adapter->mcastFilterSize= *mcastFilterSize_p; |
950 | adapter->pool_config = 0; | 950 | adapter->pool_config = 0; |
951 | 951 | ||
952 | /* Some older boxes running PHYP non-natively have an OF that | 952 | /* Some older boxes running PHYP non-natively have an OF that |
953 | returns a 8-byte local-mac-address field (and the first | 953 | returns a 8-byte local-mac-address field (and the first |
954 | 2 bytes have to be ignored) while newer boxes' OF return | 954 | 2 bytes have to be ignored) while newer boxes' OF return |
955 | a 6-byte field. Note that IEEE 1275 specifies that | 955 | a 6-byte field. Note that IEEE 1275 specifies that |
956 | local-mac-address must be a 6-byte field. | 956 | local-mac-address must be a 6-byte field. |
957 | The RPA doc specifies that the first byte must be 10b, so | 957 | The RPA doc specifies that the first byte must be 10b, so |
958 | we'll just look for it to solve this 8 vs. 6 byte field issue */ | 958 | we'll just look for it to solve this 8 vs. 6 byte field issue */ |
959 | 959 | ||
960 | if ((*mac_addr_p & 0x3) != 0x02) | 960 | if ((*mac_addr_p & 0x3) != 0x02) |
@@ -964,7 +964,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
964 | memcpy(&adapter->mac_addr, mac_addr_p, 6); | 964 | memcpy(&adapter->mac_addr, mac_addr_p, 6); |
965 | 965 | ||
966 | adapter->liobn = dev->iommu_table->it_index; | 966 | adapter->liobn = dev->iommu_table->it_index; |
967 | 967 | ||
968 | netdev->irq = dev->irq; | 968 | netdev->irq = dev->irq; |
969 | netdev->open = ibmveth_open; | 969 | netdev->open = ibmveth_open; |
970 | netdev->poll = ibmveth_poll; | 970 | netdev->poll = ibmveth_poll; |
@@ -977,15 +977,15 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
977 | netdev->ethtool_ops = &netdev_ethtool_ops; | 977 | netdev->ethtool_ops = &netdev_ethtool_ops; |
978 | netdev->change_mtu = ibmveth_change_mtu; | 978 | netdev->change_mtu = ibmveth_change_mtu; |
979 | SET_NETDEV_DEV(netdev, &dev->dev); | 979 | SET_NETDEV_DEV(netdev, &dev->dev); |
980 | netdev->features |= NETIF_F_LLTX; | 980 | netdev->features |= NETIF_F_LLTX; |
981 | spin_lock_init(&adapter->stats_lock); | 981 | spin_lock_init(&adapter->stats_lock); |
982 | 982 | ||
983 | memcpy(&netdev->dev_addr, &adapter->mac_addr, netdev->addr_len); | 983 | memcpy(&netdev->dev_addr, &adapter->mac_addr, netdev->addr_len); |
984 | 984 | ||
985 | for(i = 0; i<IbmVethNumBufferPools; i++) { | 985 | for(i = 0; i<IbmVethNumBufferPools; i++) { |
986 | struct kobject *kobj = &adapter->rx_buff_pool[i].kobj; | 986 | struct kobject *kobj = &adapter->rx_buff_pool[i].kobj; |
987 | ibmveth_init_buffer_pool(&adapter->rx_buff_pool[i], i, | 987 | ibmveth_init_buffer_pool(&adapter->rx_buff_pool[i], i, |
988 | pool_count[i], pool_size[i], | 988 | pool_count[i], pool_size[i], |
989 | pool_active[i]); | 989 | pool_active[i]); |
990 | kobj->parent = &dev->dev.kobj; | 990 | kobj->parent = &dev->dev.kobj; |
991 | sprintf(kobj->name, "pool%d", i); | 991 | sprintf(kobj->name, "pool%d", i); |
@@ -1047,7 +1047,7 @@ static void ibmveth_proc_unregister_driver(void) | |||
1047 | remove_proc_entry(IBMVETH_PROC_DIR, NULL); | 1047 | remove_proc_entry(IBMVETH_PROC_DIR, NULL); |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | static void *ibmveth_seq_start(struct seq_file *seq, loff_t *pos) | 1050 | static void *ibmveth_seq_start(struct seq_file *seq, loff_t *pos) |
1051 | { | 1051 | { |
1052 | if (*pos == 0) { | 1052 | if (*pos == 0) { |
1053 | return (void *)1; | 1053 | return (void *)1; |
@@ -1062,18 +1062,18 @@ static void *ibmveth_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1062 | return NULL; | 1062 | return NULL; |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | static void ibmveth_seq_stop(struct seq_file *seq, void *v) | 1065 | static void ibmveth_seq_stop(struct seq_file *seq, void *v) |
1066 | { | 1066 | { |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | static int ibmveth_seq_show(struct seq_file *seq, void *v) | 1069 | static int ibmveth_seq_show(struct seq_file *seq, void *v) |
1070 | { | 1070 | { |
1071 | struct ibmveth_adapter *adapter = seq->private; | 1071 | struct ibmveth_adapter *adapter = seq->private; |
1072 | char *current_mac = ((char*) &adapter->netdev->dev_addr); | 1072 | char *current_mac = ((char*) &adapter->netdev->dev_addr); |
1073 | char *firmware_mac = ((char*) &adapter->mac_addr) ; | 1073 | char *firmware_mac = ((char*) &adapter->mac_addr) ; |
1074 | 1074 | ||
1075 | seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version); | 1075 | seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version); |
1076 | 1076 | ||
1077 | seq_printf(seq, "Unit Address: 0x%x\n", adapter->vdev->unit_address); | 1077 | seq_printf(seq, "Unit Address: 0x%x\n", adapter->vdev->unit_address); |
1078 | seq_printf(seq, "LIOBN: 0x%lx\n", adapter->liobn); | 1078 | seq_printf(seq, "LIOBN: 0x%lx\n", adapter->liobn); |
1079 | seq_printf(seq, "Current MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", | 1079 | seq_printf(seq, "Current MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", |
@@ -1082,7 +1082,7 @@ static int ibmveth_seq_show(struct seq_file *seq, void *v) | |||
1082 | seq_printf(seq, "Firmware MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", | 1082 | seq_printf(seq, "Firmware MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", |
1083 | firmware_mac[0], firmware_mac[1], firmware_mac[2], | 1083 | firmware_mac[0], firmware_mac[1], firmware_mac[2], |
1084 | firmware_mac[3], firmware_mac[4], firmware_mac[5]); | 1084 | firmware_mac[3], firmware_mac[4], firmware_mac[5]); |
1085 | 1085 | ||
1086 | seq_printf(seq, "\nAdapter Statistics:\n"); | 1086 | seq_printf(seq, "\nAdapter Statistics:\n"); |
1087 | seq_printf(seq, " TX: skbuffs linearized: %ld\n", adapter->tx_linearized); | 1087 | seq_printf(seq, " TX: skbuffs linearized: %ld\n", adapter->tx_linearized); |
1088 | seq_printf(seq, " multi-descriptor sends: %ld\n", adapter->tx_multidesc_send); | 1088 | seq_printf(seq, " multi-descriptor sends: %ld\n", adapter->tx_multidesc_send); |
@@ -1094,7 +1094,7 @@ static int ibmveth_seq_show(struct seq_file *seq, void *v) | |||
1094 | seq_printf(seq, " add buffer failures: %ld\n", adapter->replenish_add_buff_failure); | 1094 | seq_printf(seq, " add buffer failures: %ld\n", adapter->replenish_add_buff_failure); |
1095 | seq_printf(seq, " invalid buffers: %ld\n", adapter->rx_invalid_buffer); | 1095 | seq_printf(seq, " invalid buffers: %ld\n", adapter->rx_invalid_buffer); |
1096 | seq_printf(seq, " no buffers: %ld\n", adapter->rx_no_buffer); | 1096 | seq_printf(seq, " no buffers: %ld\n", adapter->rx_no_buffer); |
1097 | 1097 | ||
1098 | return 0; | 1098 | return 0; |
1099 | } | 1099 | } |
1100 | static struct seq_operations ibmveth_seq_ops = { | 1100 | static struct seq_operations ibmveth_seq_ops = { |
@@ -1152,11 +1152,11 @@ static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter) | |||
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | #else /* CONFIG_PROC_FS */ | 1154 | #else /* CONFIG_PROC_FS */ |
1155 | static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter) | 1155 | static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter) |
1156 | { | 1156 | { |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter) | 1159 | static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter) |
1160 | { | 1160 | { |
1161 | } | 1161 | } |
1162 | static void ibmveth_proc_register_driver(void) | 1162 | static void ibmveth_proc_register_driver(void) |
@@ -1175,7 +1175,7 @@ static struct attribute veth_size_attr; | |||
1175 | static ssize_t veth_pool_show(struct kobject * kobj, | 1175 | static ssize_t veth_pool_show(struct kobject * kobj, |
1176 | struct attribute * attr, char * buf) | 1176 | struct attribute * attr, char * buf) |
1177 | { | 1177 | { |
1178 | struct ibmveth_buff_pool *pool = container_of(kobj, | 1178 | struct ibmveth_buff_pool *pool = container_of(kobj, |
1179 | struct ibmveth_buff_pool, | 1179 | struct ibmveth_buff_pool, |
1180 | kobj); | 1180 | kobj); |
1181 | 1181 | ||
@@ -1191,10 +1191,10 @@ static ssize_t veth_pool_show(struct kobject * kobj, | |||
1191 | static ssize_t veth_pool_store(struct kobject * kobj, struct attribute * attr, | 1191 | static ssize_t veth_pool_store(struct kobject * kobj, struct attribute * attr, |
1192 | const char * buf, size_t count) | 1192 | const char * buf, size_t count) |
1193 | { | 1193 | { |
1194 | struct ibmveth_buff_pool *pool = container_of(kobj, | 1194 | struct ibmveth_buff_pool *pool = container_of(kobj, |
1195 | struct ibmveth_buff_pool, | 1195 | struct ibmveth_buff_pool, |
1196 | kobj); | 1196 | kobj); |
1197 | struct net_device *netdev = | 1197 | struct net_device *netdev = |
1198 | container_of(kobj->parent, struct device, kobj)->driver_data; | 1198 | container_of(kobj->parent, struct device, kobj)->driver_data; |
1199 | struct ibmveth_adapter *adapter = netdev->priv; | 1199 | struct ibmveth_adapter *adapter = netdev->priv; |
1200 | long value = simple_strtol(buf, NULL, 10); | 1200 | long value = simple_strtol(buf, NULL, 10); |
@@ -1323,7 +1323,7 @@ static void __exit ibmveth_module_exit(void) | |||
1323 | { | 1323 | { |
1324 | vio_unregister_driver(&ibmveth_driver); | 1324 | vio_unregister_driver(&ibmveth_driver); |
1325 | ibmveth_proc_unregister_driver(); | 1325 | ibmveth_proc_unregister_driver(); |
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | module_init(ibmveth_module_init); | 1328 | module_init(ibmveth_module_init); |
1329 | module_exit(ibmveth_module_exit); | 1329 | module_exit(ibmveth_module_exit); |
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h index b526dda06900..8385bf836507 100644 --- a/drivers/net/ibmveth.h +++ b/drivers/net/ibmveth.h | |||
@@ -139,7 +139,7 @@ struct ibmveth_adapter { | |||
139 | spinlock_t stats_lock; | 139 | spinlock_t stats_lock; |
140 | }; | 140 | }; |
141 | 141 | ||
142 | struct ibmveth_buf_desc_fields { | 142 | struct ibmveth_buf_desc_fields { |
143 | u32 valid : 1; | 143 | u32 valid : 1; |
144 | u32 toggle : 1; | 144 | u32 toggle : 1; |
145 | u32 reserved : 6; | 145 | u32 reserved : 6; |
@@ -148,7 +148,7 @@ struct ibmveth_buf_desc_fields { | |||
148 | }; | 148 | }; |
149 | 149 | ||
150 | union ibmveth_buf_desc { | 150 | union ibmveth_buf_desc { |
151 | u64 desc; | 151 | u64 desc; |
152 | struct ibmveth_buf_desc_fields fields; | 152 | struct ibmveth_buf_desc_fields fields; |
153 | }; | 153 | }; |
154 | 154 | ||