diff options
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 59 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 4 |
3 files changed, 22 insertions, 42 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 2aa658db103f..7e208b31a27e 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1359,7 +1359,6 @@ unsigned long netxen_nic_pci_set_window_2M(struct netxen_adapter *adapter, | |||
1359 | void netxen_free_adapter_offload(struct netxen_adapter *adapter); | 1359 | void netxen_free_adapter_offload(struct netxen_adapter *adapter); |
1360 | int netxen_initialize_adapter_offload(struct netxen_adapter *adapter); | 1360 | int netxen_initialize_adapter_offload(struct netxen_adapter *adapter); |
1361 | int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val); | 1361 | int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val); |
1362 | int netxen_receive_peg_ready(struct netxen_adapter *adapter); | ||
1363 | int netxen_load_firmware(struct netxen_adapter *adapter); | 1362 | int netxen_load_firmware(struct netxen_adapter *adapter); |
1364 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); | 1363 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); |
1365 | 1364 | ||
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 8e45dcc27c7f..9991951e6e05 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -108,42 +108,6 @@ static void crb_addr_transform_setup(void) | |||
108 | crb_addr_transform(I2C0); | 108 | crb_addr_transform(I2C0); |
109 | } | 109 | } |
110 | 110 | ||
111 | int netxen_init_firmware(struct netxen_adapter *adapter) | ||
112 | { | ||
113 | u32 state = 0, loops = 0, err = 0; | ||
114 | |||
115 | /* Window 1 call */ | ||
116 | state = adapter->pci_read_normalize(adapter, CRB_CMDPEG_STATE); | ||
117 | |||
118 | if (state == PHAN_INITIALIZE_ACK) | ||
119 | return 0; | ||
120 | |||
121 | while (state != PHAN_INITIALIZE_COMPLETE && loops < 2000) { | ||
122 | msleep(1); | ||
123 | /* Window 1 call */ | ||
124 | state = adapter->pci_read_normalize(adapter, CRB_CMDPEG_STATE); | ||
125 | |||
126 | loops++; | ||
127 | } | ||
128 | if (loops >= 2000) { | ||
129 | printk(KERN_ERR "Cmd Peg initialization not complete:%x.\n", | ||
130 | state); | ||
131 | err = -EIO; | ||
132 | return err; | ||
133 | } | ||
134 | /* Window 1 call */ | ||
135 | adapter->pci_write_normalize(adapter, | ||
136 | CRB_NIC_CAPABILITIES_HOST, INTR_SCHEME_PERPORT); | ||
137 | adapter->pci_write_normalize(adapter, | ||
138 | CRB_NIC_MSI_MODE_HOST, MSI_MODE_MULTIFUNC); | ||
139 | adapter->pci_write_normalize(adapter, | ||
140 | CRB_MPORT_MODE, MPORT_MULTI_FUNCTION_MODE); | ||
141 | adapter->pci_write_normalize(adapter, | ||
142 | CRB_CMDPEG_STATE, PHAN_INITIALIZE_ACK); | ||
143 | |||
144 | return err; | ||
145 | } | ||
146 | |||
147 | void netxen_release_rx_buffers(struct netxen_adapter *adapter) | 111 | void netxen_release_rx_buffers(struct netxen_adapter *adapter) |
148 | { | 112 | { |
149 | struct netxen_recv_context *recv_ctx; | 113 | struct netxen_recv_context *recv_ctx; |
@@ -789,7 +753,8 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val) | |||
789 | return 0; | 753 | return 0; |
790 | } | 754 | } |
791 | 755 | ||
792 | int netxen_receive_peg_ready(struct netxen_adapter *adapter) | 756 | static int |
757 | netxen_receive_peg_ready(struct netxen_adapter *adapter) | ||
793 | { | 758 | { |
794 | u32 val = 0; | 759 | u32 val = 0; |
795 | int retries = 2000; | 760 | int retries = 2000; |
@@ -813,6 +778,26 @@ int netxen_receive_peg_ready(struct netxen_adapter *adapter) | |||
813 | return 0; | 778 | return 0; |
814 | } | 779 | } |
815 | 780 | ||
781 | int netxen_init_firmware(struct netxen_adapter *adapter) | ||
782 | { | ||
783 | int err; | ||
784 | |||
785 | err = netxen_receive_peg_ready(adapter); | ||
786 | if (err) | ||
787 | return err; | ||
788 | |||
789 | adapter->pci_write_normalize(adapter, | ||
790 | CRB_NIC_CAPABILITIES_HOST, INTR_SCHEME_PERPORT); | ||
791 | adapter->pci_write_normalize(adapter, | ||
792 | CRB_NIC_MSI_MODE_HOST, MSI_MODE_MULTIFUNC); | ||
793 | adapter->pci_write_normalize(adapter, | ||
794 | CRB_MPORT_MODE, MPORT_MULTI_FUNCTION_MODE); | ||
795 | adapter->pci_write_normalize(adapter, | ||
796 | CRB_CMDPEG_STATE, PHAN_INITIALIZE_ACK); | ||
797 | |||
798 | return err; | ||
799 | } | ||
800 | |||
816 | static int | 801 | static int |
817 | netxen_alloc_rx_skb(struct netxen_adapter *adapter, | 802 | netxen_alloc_rx_skb(struct netxen_adapter *adapter, |
818 | struct nx_host_rds_ring *rds_ring, | 803 | struct nx_host_rds_ring *rds_ring, |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 22b2d491c782..665fce561d4a 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -1027,10 +1027,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1027 | 1027 | ||
1028 | netxen_napi_add(adapter, netdev); | 1028 | netxen_napi_add(adapter, netdev); |
1029 | 1029 | ||
1030 | err = netxen_receive_peg_ready(adapter); | ||
1031 | if (err) | ||
1032 | goto err_out_disable_msi; | ||
1033 | |||
1034 | init_timer(&adapter->watchdog_timer); | 1030 | init_timer(&adapter->watchdog_timer); |
1035 | adapter->watchdog_timer.function = &netxen_watchdog; | 1031 | adapter->watchdog_timer.function = &netxen_watchdog; |
1036 | adapter->watchdog_timer.data = (unsigned long)adapter; | 1032 | adapter->watchdog_timer.data = (unsigned long)adapter; |