diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 115 |
1 files changed, 108 insertions, 7 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 5ed8c60c906f..74517b640c2b 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -143,8 +143,105 @@ struct netxen_recv_crb recv_crb_registers[] = { | |||
143 | NETXEN_NIC_REG(0x180), | 143 | NETXEN_NIC_REG(0x180), |
144 | /* crb_status_ring_size */ | 144 | /* crb_status_ring_size */ |
145 | NETXEN_NIC_REG(0x184), | 145 | NETXEN_NIC_REG(0x184), |
146 | |||
147 | }, | 146 | }, |
147 | /* | ||
148 | * Instance 3, | ||
149 | */ | ||
150 | { | ||
151 | { | ||
152 | { | ||
153 | /* crb_rcv_producer_offset: */ | ||
154 | NETXEN_NIC_REG(0x1d8), | ||
155 | /* crb_rcv_consumer_offset: */ | ||
156 | NETXEN_NIC_REG(0x1dc), | ||
157 | /* crb_gloablrcv_ring: */ | ||
158 | NETXEN_NIC_REG(0x1f0), | ||
159 | /* crb_rcv_ring_size */ | ||
160 | NETXEN_NIC_REG(0x1f4), | ||
161 | }, | ||
162 | /* Jumbo frames */ | ||
163 | { | ||
164 | /* crb_rcv_producer_offset: */ | ||
165 | NETXEN_NIC_REG(0x1f8), | ||
166 | /* crb_rcv_consumer_offset: */ | ||
167 | NETXEN_NIC_REG(0x1fc), | ||
168 | /* crb_gloablrcv_ring: */ | ||
169 | NETXEN_NIC_REG(0x200), | ||
170 | /* crb_rcv_ring_size */ | ||
171 | NETXEN_NIC_REG(0x204), | ||
172 | }, | ||
173 | /* LRO */ | ||
174 | { | ||
175 | /* crb_rcv_producer_offset: */ | ||
176 | NETXEN_NIC_REG(0x208), | ||
177 | /* crb_rcv_consumer_offset: */ | ||
178 | NETXEN_NIC_REG(0x20c), | ||
179 | /* crb_gloablrcv_ring: */ | ||
180 | NETXEN_NIC_REG(0x210), | ||
181 | /* crb_rcv_ring_size */ | ||
182 | NETXEN_NIC_REG(0x214), | ||
183 | } | ||
184 | }, | ||
185 | /* crb_rcvstatus_ring: */ | ||
186 | NETXEN_NIC_REG(0x218), | ||
187 | /* crb_rcv_status_producer: */ | ||
188 | NETXEN_NIC_REG(0x21c), | ||
189 | /* crb_rcv_status_consumer: */ | ||
190 | NETXEN_NIC_REG(0x220), | ||
191 | /* crb_rcvpeg_state: */ | ||
192 | NETXEN_NIC_REG(0x224), | ||
193 | /* crb_status_ring_size */ | ||
194 | NETXEN_NIC_REG(0x228), | ||
195 | }, | ||
196 | /* | ||
197 | * Instance 4, | ||
198 | */ | ||
199 | { | ||
200 | { | ||
201 | { | ||
202 | /* crb_rcv_producer_offset: */ | ||
203 | NETXEN_NIC_REG(0x22c), | ||
204 | /* crb_rcv_consumer_offset: */ | ||
205 | NETXEN_NIC_REG(0x230), | ||
206 | /* crb_gloablrcv_ring: */ | ||
207 | NETXEN_NIC_REG(0x234), | ||
208 | /* crb_rcv_ring_size */ | ||
209 | NETXEN_NIC_REG(0x238), | ||
210 | }, | ||
211 | /* Jumbo frames */ | ||
212 | { | ||
213 | /* crb_rcv_producer_offset: */ | ||
214 | NETXEN_NIC_REG(0x23c), | ||
215 | /* crb_rcv_consumer_offset: */ | ||
216 | NETXEN_NIC_REG(0x240), | ||
217 | /* crb_gloablrcv_ring: */ | ||
218 | NETXEN_NIC_REG(0x244), | ||
219 | /* crb_rcv_ring_size */ | ||
220 | NETXEN_NIC_REG(0x248), | ||
221 | }, | ||
222 | /* LRO */ | ||
223 | { | ||
224 | /* crb_rcv_producer_offset: */ | ||
225 | NETXEN_NIC_REG(0x24c), | ||
226 | /* crb_rcv_consumer_offset: */ | ||
227 | NETXEN_NIC_REG(0x250), | ||
228 | /* crb_gloablrcv_ring: */ | ||
229 | NETXEN_NIC_REG(0x254), | ||
230 | /* crb_rcv_ring_size */ | ||
231 | NETXEN_NIC_REG(0x258), | ||
232 | } | ||
233 | }, | ||
234 | /* crb_rcvstatus_ring: */ | ||
235 | NETXEN_NIC_REG(0x25c), | ||
236 | /* crb_rcv_status_producer: */ | ||
237 | NETXEN_NIC_REG(0x260), | ||
238 | /* crb_rcv_status_consumer: */ | ||
239 | NETXEN_NIC_REG(0x264), | ||
240 | /* crb_rcvpeg_state: */ | ||
241 | NETXEN_NIC_REG(0x268), | ||
242 | /* crb_status_ring_size */ | ||
243 | NETXEN_NIC_REG(0x26c), | ||
244 | }, | ||
148 | }; | 245 | }; |
149 | 246 | ||
150 | u64 ctx_addr_sig_regs[][3] = { | 247 | u64 ctx_addr_sig_regs[][3] = { |
@@ -296,6 +393,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
296 | u32 card_cmdring = 0; | 393 | u32 card_cmdring = 0; |
297 | struct netxen_recv_context *recv_ctx; | 394 | struct netxen_recv_context *recv_ctx; |
298 | struct netxen_rcv_desc_ctx *rcv_desc; | 395 | struct netxen_rcv_desc_ctx *rcv_desc; |
396 | int func_id = adapter->portnum; | ||
299 | 397 | ||
300 | DPRINTK(INFO, "crb_base: %lx %x", NETXEN_PCI_CRBSPACE, | 398 | DPRINTK(INFO, "crb_base: %lx %x", NETXEN_PCI_CRBSPACE, |
301 | PCI_OFFSET_SECOND_RANGE(adapter, NETXEN_PCI_CRBSPACE)); | 399 | PCI_OFFSET_SECOND_RANGE(adapter, NETXEN_PCI_CRBSPACE)); |
@@ -351,6 +449,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
351 | } | 449 | } |
352 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); | 450 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); |
353 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; | 451 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; |
452 | adapter->ctx_desc->ctx_id = adapter->portnum; | ||
354 | adapter->ctx_desc->cmd_consumer_offset = | 453 | adapter->ctx_desc->cmd_consumer_offset = |
355 | cpu_to_le64(adapter->ctx_desc_phys_addr + | 454 | cpu_to_le64(adapter->ctx_desc_phys_addr + |
356 | sizeof(struct netxen_ring_ctx)); | 455 | sizeof(struct netxen_ring_ctx)); |
@@ -421,11 +520,11 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
421 | /* Window = 1 */ | 520 | /* Window = 1 */ |
422 | 521 | ||
423 | writel(lower32(adapter->ctx_desc_phys_addr), | 522 | writel(lower32(adapter->ctx_desc_phys_addr), |
424 | NETXEN_CRB_NORMALIZE(adapter, CRB_CTX_ADDR_REG_LO)); | 523 | NETXEN_CRB_NORMALIZE(adapter, CRB_CTX_ADDR_REG_LO(func_id))); |
425 | writel(upper32(adapter->ctx_desc_phys_addr), | 524 | writel(upper32(adapter->ctx_desc_phys_addr), |
426 | NETXEN_CRB_NORMALIZE(adapter, CRB_CTX_ADDR_REG_HI)); | 525 | NETXEN_CRB_NORMALIZE(adapter, CRB_CTX_ADDR_REG_HI(func_id))); |
427 | writel(NETXEN_CTX_SIGNATURE, | 526 | writel(NETXEN_CTX_SIGNATURE | func_id, |
428 | NETXEN_CRB_NORMALIZE(adapter, CRB_CTX_SIGNATURE_REG)); | 527 | NETXEN_CRB_NORMALIZE(adapter, CRB_CTX_SIGNATURE_REG(func_id))); |
429 | return err; | 528 | return err; |
430 | } | 529 | } |
431 | 530 | ||
@@ -965,9 +1064,11 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) | |||
965 | { | 1064 | { |
966 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; | 1065 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; |
967 | if (adapter->portnum == 0) | 1066 | if (adapter->portnum == 0) |
968 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, new_mtu); | 1067 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, |
1068 | new_mtu); | ||
969 | else if (adapter->portnum == 1) | 1069 | else if (adapter->portnum == 1) |
970 | netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, new_mtu); | 1070 | netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, |
1071 | new_mtu); | ||
971 | return 0; | 1072 | return 0; |
972 | } | 1073 | } |
973 | 1074 | ||