aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-22 14:44:00 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:10:31 -0500
commitf305f789bb96ee6e35e71f58324b72abb7bd0b13 (patch)
tree980647f9eff15b56ef120904d62c1cff1644eb40 /drivers/net
parent66341fffd4e5e546906ebcfeb6f5cce8df802c17 (diff)
annotate netxen
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/netxen/netxen_nic.h4
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c26
-rw-r--r--drivers/net/netxen/netxen_nic_init.c7
-rw-r--r--drivers/net/netxen/netxen_nic_main.c2
4 files changed, 20 insertions, 19 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 724f75560ddb..2bc5eaae141f 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -898,7 +898,7 @@ struct netxen_adapter {
898 u32 curr_window; 898 u32 curr_window;
899 899
900 u32 cmd_producer; 900 u32 cmd_producer;
901 u32 *cmd_consumer; 901 __le32 *cmd_consumer;
902 902
903 u32 last_cmd_consumer; 903 u32 last_cmd_consumer;
904 u32 max_tx_desc_count; 904 u32 max_tx_desc_count;
@@ -1195,7 +1195,7 @@ dma_watchdog_wakeup(struct netxen_adapter *adapter)
1195 1195
1196 1196
1197int netxen_is_flash_supported(struct netxen_adapter *adapter); 1197int netxen_is_flash_supported(struct netxen_adapter *adapter);
1198int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]); 1198int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 mac[]);
1199extern void netxen_change_ringparam(struct netxen_adapter *adapter); 1199extern void netxen_change_ringparam(struct netxen_adapter *adapter);
1200extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, 1200extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr,
1201 int *valp); 1201 int *valp);
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index a88c51f0879b..01355701bf8e 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -419,7 +419,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
419 adapter->ctx_desc->cmd_consumer_offset = 419 adapter->ctx_desc->cmd_consumer_offset =
420 cpu_to_le64(adapter->ctx_desc_phys_addr + 420 cpu_to_le64(adapter->ctx_desc_phys_addr +
421 sizeof(struct netxen_ring_ctx)); 421 sizeof(struct netxen_ring_ctx));
422 adapter->cmd_consumer = (uint32_t *) (((char *)addr) + 422 adapter->cmd_consumer = (__le32 *) (((char *)addr) +
423 sizeof(struct netxen_ring_ctx)); 423 sizeof(struct netxen_ring_ctx));
424 424
425 addr = netxen_alloc(adapter->ahw.pdev, 425 addr = netxen_alloc(adapter->ahw.pdev,
@@ -586,35 +586,35 @@ int netxen_is_flash_supported(struct netxen_adapter *adapter)
586} 586}
587 587
588static int netxen_get_flash_block(struct netxen_adapter *adapter, int base, 588static int netxen_get_flash_block(struct netxen_adapter *adapter, int base,
589 int size, u32 * buf) 589 int size, __le32 * buf)
590{ 590{
591 int i, addr; 591 int i, addr;
592 u32 *ptr32; 592 __le32 *ptr32;
593 u32 v;
593 594
594 addr = base; 595 addr = base;
595 ptr32 = buf; 596 ptr32 = buf;
596 for (i = 0; i < size / sizeof(u32); i++) { 597 for (i = 0; i < size / sizeof(u32); i++) {
597 if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) 598 if (netxen_rom_fast_read(adapter, addr, &v) == -1)
598 return -1; 599 return -1;
599 *ptr32 = cpu_to_le32(*ptr32); 600 *ptr32 = cpu_to_le32(v);
600 ptr32++; 601 ptr32++;
601 addr += sizeof(u32); 602 addr += sizeof(u32);
602 } 603 }
603 if ((char *)buf + size > (char *)ptr32) { 604 if ((char *)buf + size > (char *)ptr32) {
604 u32 local; 605 __le32 local;
605 606 if (netxen_rom_fast_read(adapter, addr, &v) == -1)
606 if (netxen_rom_fast_read(adapter, addr, &local) == -1)
607 return -1; 607 return -1;
608 local = cpu_to_le32(local); 608 local = cpu_to_le32(v);
609 memcpy(ptr32, &local, (char *)buf + size - (char *)ptr32); 609 memcpy(ptr32, &local, (char *)buf + size - (char *)ptr32);
610 } 610 }
611 611
612 return 0; 612 return 0;
613} 613}
614 614
615int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]) 615int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 mac[])
616{ 616{
617 u32 *pmac = (u32 *) & mac[0]; 617 __le32 *pmac = (__le32 *) & mac[0];
618 618
619 if (netxen_get_flash_block(adapter, 619 if (netxen_get_flash_block(adapter,
620 NETXEN_USER_START + 620 NETXEN_USER_START +
@@ -623,7 +623,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
623 FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) { 623 FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) {
624 return -1; 624 return -1;
625 } 625 }
626 if (*mac == ~0ULL) { 626 if (*mac == cpu_to_le64(~0ULL)) {
627 if (netxen_get_flash_block(adapter, 627 if (netxen_get_flash_block(adapter,
628 NETXEN_USER_START_OLD + 628 NETXEN_USER_START_OLD +
629 offsetof(struct netxen_user_old_info, 629 offsetof(struct netxen_user_old_info,
@@ -631,7 +631,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
631 FLASH_NUM_PORTS * sizeof(u64), 631 FLASH_NUM_PORTS * sizeof(u64),
632 pmac) == -1) 632 pmac) == -1)
633 return -1; 633 return -1;
634 if (*mac == ~0ULL) 634 if (*mac == cpu_to_le64(~0ULL))
635 return -1; 635 return -1;
636 } 636 }
637 return 0; 637 return 0;
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 74685a1a0b71..9e38bcb3fba9 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -438,10 +438,11 @@ static int do_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
438 int ret = 0; 438 int ret = 0;
439 439
440 for (addridx = addr; addridx < (addr + size); addridx += 4) { 440 for (addridx = addr; addridx < (addr + size); addridx += 4) {
441 ret = do_rom_fast_read(adapter, addridx, (int *)bytes); 441 int v;
442 ret = do_rom_fast_read(adapter, addridx, &v);
442 if (ret != 0) 443 if (ret != 0)
443 break; 444 break;
444 *(int *)bytes = cpu_to_le32(*(int *)bytes); 445 *(__le32 *)bytes = cpu_to_le32(v);
445 bytes += 4; 446 bytes += 4;
446 } 447 }
447 448
@@ -501,7 +502,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter,
501 int timeout = 0; 502 int timeout = 0;
502 int data; 503 int data;
503 504
504 data = le32_to_cpu((*(u32*)bytes)); 505 data = le32_to_cpu((*(__le32*)bytes));
505 ret = do_rom_fast_write(adapter, addridx, data); 506 ret = do_rom_fast_write(adapter, addridx, data);
506 if (ret < 0) 507 if (ret < 0)
507 return ret; 508 return ret;
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 2341b89abc4d..9737eae5ef11 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -277,7 +277,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
277 struct netxen_recv_context *recv_ctx = NULL; 277 struct netxen_recv_context *recv_ctx = NULL;
278 struct netxen_rcv_desc_ctx *rcv_desc = NULL; 278 struct netxen_rcv_desc_ctx *rcv_desc = NULL;
279 struct netxen_cmd_buffer *cmd_buf_arr = NULL; 279 struct netxen_cmd_buffer *cmd_buf_arr = NULL;
280 u64 mac_addr[FLASH_NUM_PORTS + 1]; 280 __le64 mac_addr[FLASH_NUM_PORTS + 1];
281 int valid_mac = 0; 281 int valid_mac = 0;
282 u32 val; 282 u32 val;
283 int pci_func_id = PCI_FUNC(pdev->devfn); 283 int pci_func_id = PCI_FUNC(pdev->devfn);