diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-04-07 18:50:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-08 18:58:26 -0400 |
commit | 56a007871a6689db80e19f63fe6dc3692daa2a6f (patch) | |
tree | 5dcab9ec860910a7518f582403a128908ee6e8fb /drivers/net/netxen/netxen_nic_init.c | |
parent | d877f1e344f5515988d9dcd6db5d4285911778a3 (diff) |
netxen: defer firmware handshake
Removed duplicate firmware handshake, defer it until first
port (interface) is brought up.
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 | 59 |
1 files changed, 22 insertions, 37 deletions
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, |