diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-04-07 18:50:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-08 18:58:28 -0400 |
commit | 1fbe63235893e5dce28fe91d8465dd231b0cb3d9 (patch) | |
tree | 52d88817b8e23c2784c0e2a33a538f4eab2fcb8f /drivers/net/netxen/netxen_nic_init.c | |
parent | 71dcddbdd35487eb931aa8aab28a2df474008754 (diff) |
netxen: annotate register access functions
o remove unnecessary length parameter since register access
width is fixed 4 byte.
o remove superfluous pci_read_normalize and pci_write_normalize
functions.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 974783c45321..83116c2817b0 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -368,8 +368,8 @@ static int rom_lock(struct netxen_adapter *adapter) | |||
368 | 368 | ||
369 | while (!done) { | 369 | while (!done) { |
370 | /* acquire semaphore2 from PCI HW block */ | 370 | /* acquire semaphore2 from PCI HW block */ |
371 | netxen_nic_read_w0(adapter, NETXEN_PCIE_REG(PCIE_SEM2_LOCK), | 371 | done = netxen_nic_read_w0(adapter, |
372 | &done); | 372 | NETXEN_PCIE_REG(PCIE_SEM2_LOCK)); |
373 | if (done == 1) | 373 | if (done == 1) |
374 | break; | 374 | break; |
375 | if (timeout >= rom_lock_timeout) | 375 | if (timeout >= rom_lock_timeout) |
@@ -411,10 +411,8 @@ static int netxen_wait_rom_done(struct netxen_adapter *adapter) | |||
411 | 411 | ||
412 | static void netxen_rom_unlock(struct netxen_adapter *adapter) | 412 | static void netxen_rom_unlock(struct netxen_adapter *adapter) |
413 | { | 413 | { |
414 | u32 val; | ||
415 | |||
416 | /* release semaphore2 */ | 414 | /* release semaphore2 */ |
417 | netxen_nic_read_w0(adapter, NETXEN_PCIE_REG(PCIE_SEM2_UNLOCK), &val); | 415 | netxen_nic_read_w0(adapter, NETXEN_PCIE_REG(PCIE_SEM2_UNLOCK)); |
418 | 416 | ||
419 | } | 417 | } |
420 | 418 | ||
@@ -623,7 +621,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
623 | } | 621 | } |
624 | } | 622 | } |
625 | 623 | ||
626 | adapter->hw_write_wx(adapter, off, &buf[i].data, 4); | 624 | adapter->hw_write_wx(adapter, off, buf[i].data); |
627 | 625 | ||
628 | msleep(init_delay); | 626 | msleep(init_delay); |
629 | } | 627 | } |
@@ -633,8 +631,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
633 | 631 | ||
634 | /* unreset_net_cache */ | 632 | /* unreset_net_cache */ |
635 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { | 633 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
636 | adapter->hw_read_wx(adapter, | 634 | val = adapter->hw_read_wx(adapter, |
637 | NETXEN_ROMUSB_GLB_SW_RESET, &val, 4); | 635 | NETXEN_ROMUSB_GLB_SW_RESET); |
638 | netxen_crb_writelit_adapter(adapter, | 636 | netxen_crb_writelit_adapter(adapter, |
639 | NETXEN_ROMUSB_GLB_SW_RESET, (val & 0xffffff0f)); | 637 | NETXEN_ROMUSB_GLB_SW_RESET, (val & 0xffffff0f)); |
640 | } | 638 | } |
@@ -683,12 +681,12 @@ int netxen_initialize_adapter_offload(struct netxen_adapter *adapter) | |||
683 | hi = (addr >> 32) & 0xffffffff; | 681 | hi = (addr >> 32) & 0xffffffff; |
684 | lo = addr & 0xffffffff; | 682 | lo = addr & 0xffffffff; |
685 | 683 | ||
686 | adapter->pci_write_normalize(adapter, CRB_HOST_DUMMY_BUF_ADDR_HI, hi); | 684 | adapter->hw_write_wx(adapter, CRB_HOST_DUMMY_BUF_ADDR_HI, hi); |
687 | adapter->pci_write_normalize(adapter, CRB_HOST_DUMMY_BUF_ADDR_LO, lo); | 685 | adapter->hw_write_wx(adapter, CRB_HOST_DUMMY_BUF_ADDR_LO, lo); |
688 | 686 | ||
689 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { | 687 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { |
690 | uint32_t temp = 0; | 688 | uint32_t temp = 0; |
691 | adapter->hw_write_wx(adapter, CRB_HOST_DUMMY_BUF, &temp, 4); | 689 | adapter->hw_write_wx(adapter, CRB_HOST_DUMMY_BUF, temp); |
692 | } | 690 | } |
693 | 691 | ||
694 | return 0; | 692 | return 0; |
@@ -730,7 +728,7 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val) | |||
730 | 728 | ||
731 | if (!pegtune_val) { | 729 | if (!pegtune_val) { |
732 | do { | 730 | do { |
733 | val = adapter->pci_read_normalize(adapter, | 731 | val = adapter->hw_read_wx(adapter, |
734 | CRB_CMDPEG_STATE); | 732 | CRB_CMDPEG_STATE); |
735 | 733 | ||
736 | if (val == PHAN_INITIALIZE_COMPLETE || | 734 | if (val == PHAN_INITIALIZE_COMPLETE || |
@@ -742,7 +740,7 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val) | |||
742 | } while (--retries); | 740 | } while (--retries); |
743 | 741 | ||
744 | if (!retries) { | 742 | if (!retries) { |
745 | pegtune_val = adapter->pci_read_normalize(adapter, | 743 | pegtune_val = adapter->hw_read_wx(adapter, |
746 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE); | 744 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE); |
747 | printk(KERN_WARNING "netxen_phantom_init: init failed, " | 745 | printk(KERN_WARNING "netxen_phantom_init: init failed, " |
748 | "pegtune_val=%x\n", pegtune_val); | 746 | "pegtune_val=%x\n", pegtune_val); |
@@ -760,7 +758,7 @@ netxen_receive_peg_ready(struct netxen_adapter *adapter) | |||
760 | int retries = 2000; | 758 | int retries = 2000; |
761 | 759 | ||
762 | do { | 760 | do { |
763 | val = adapter->pci_read_normalize(adapter, CRB_RCVPEG_STATE); | 761 | val = adapter->hw_read_wx(adapter, CRB_RCVPEG_STATE); |
764 | 762 | ||
765 | if (val == PHAN_PEG_RCV_INITIALIZED) | 763 | if (val == PHAN_PEG_RCV_INITIALIZED) |
766 | return 0; | 764 | return 0; |
@@ -786,13 +784,13 @@ int netxen_init_firmware(struct netxen_adapter *adapter) | |||
786 | if (err) | 784 | if (err) |
787 | return err; | 785 | return err; |
788 | 786 | ||
789 | adapter->pci_write_normalize(adapter, | 787 | adapter->hw_write_wx(adapter, |
790 | CRB_NIC_CAPABILITIES_HOST, INTR_SCHEME_PERPORT); | 788 | CRB_NIC_CAPABILITIES_HOST, INTR_SCHEME_PERPORT); |
791 | adapter->pci_write_normalize(adapter, | 789 | adapter->hw_write_wx(adapter, |
792 | CRB_NIC_MSI_MODE_HOST, MSI_MODE_MULTIFUNC); | 790 | CRB_NIC_MSI_MODE_HOST, MSI_MODE_MULTIFUNC); |
793 | adapter->pci_write_normalize(adapter, | 791 | adapter->hw_write_wx(adapter, |
794 | CRB_MPORT_MODE, MPORT_MULTI_FUNCTION_MODE); | 792 | CRB_MPORT_MODE, MPORT_MULTI_FUNCTION_MODE); |
795 | adapter->pci_write_normalize(adapter, | 793 | adapter->hw_write_wx(adapter, |
796 | CRB_CMDPEG_STATE, PHAN_INITIALIZE_ACK); | 794 | CRB_CMDPEG_STATE, PHAN_INITIALIZE_ACK); |
797 | 795 | ||
798 | if (adapter->fw_version >= NETXEN_VERSION_CODE(4, 0, 222)) { | 796 | if (adapter->fw_version >= NETXEN_VERSION_CODE(4, 0, 222)) { |
@@ -1059,7 +1057,7 @@ skip: | |||
1059 | 1057 | ||
1060 | if (count) { | 1058 | if (count) { |
1061 | sds_ring->consumer = consumer; | 1059 | sds_ring->consumer = consumer; |
1062 | adapter->pci_write_normalize(adapter, | 1060 | adapter->hw_write_wx(adapter, |
1063 | sds_ring->crb_sts_consumer, consumer); | 1061 | sds_ring->crb_sts_consumer, consumer); |
1064 | } | 1062 | } |
1065 | 1063 | ||
@@ -1178,7 +1176,7 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid, | |||
1178 | 1176 | ||
1179 | if (count) { | 1177 | if (count) { |
1180 | rds_ring->producer = producer; | 1178 | rds_ring->producer = producer; |
1181 | adapter->pci_write_normalize(adapter, | 1179 | adapter->hw_write_wx(adapter, |
1182 | rds_ring->crb_rcv_producer, | 1180 | rds_ring->crb_rcv_producer, |
1183 | (producer-1) & (rds_ring->num_desc-1)); | 1181 | (producer-1) & (rds_ring->num_desc-1)); |
1184 | 1182 | ||
@@ -1239,7 +1237,7 @@ netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, | |||
1239 | 1237 | ||
1240 | if (count) { | 1238 | if (count) { |
1241 | rds_ring->producer = producer; | 1239 | rds_ring->producer = producer; |
1242 | adapter->pci_write_normalize(adapter, | 1240 | adapter->hw_write_wx(adapter, |
1243 | rds_ring->crb_rcv_producer, | 1241 | rds_ring->crb_rcv_producer, |
1244 | (producer - 1) & (rds_ring->num_desc - 1)); | 1242 | (producer - 1) & (rds_ring->num_desc - 1)); |
1245 | wmb(); | 1243 | wmb(); |