diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-02 11:13:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-02 11:13:23 -0500 |
commit | 222335b755726f539c4a056ce119e017aa4166c4 (patch) | |
tree | ba97a19081f945d4ffe1f52be22cf03764265a62 | |
parent | 7a1864222425ece571886ec0216b3e7056496514 (diff) | |
parent | a55eb05a57a981f16325d035ee3a3ad10485ea0d (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
spidernet : fix memory leak in spider_net_stop
e100: fix napi ifdefs removing needed code
netxen patches
-rw-r--r-- | drivers/net/e100.c | 7 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 136 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ethtool.c | 22 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 43 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.h | 74 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 15 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_isr.c | 4 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 8 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_niu.c | 106 | ||||
-rw-r--r-- | drivers/net/spider_net.c | 2 |
10 files changed, 199 insertions, 218 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 3208dac29168..0cefef5e3f06 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -2718,14 +2718,12 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2718 | struct net_device *netdev = pci_get_drvdata(pdev); | 2718 | struct net_device *netdev = pci_get_drvdata(pdev); |
2719 | struct nic *nic = netdev_priv(netdev); | 2719 | struct nic *nic = netdev_priv(netdev); |
2720 | 2720 | ||
2721 | #ifdef CONFIG_E100_NAPI | ||
2722 | if (netif_running(netdev)) | 2721 | if (netif_running(netdev)) |
2723 | netif_poll_disable(nic->netdev); | 2722 | netif_poll_disable(nic->netdev); |
2724 | #endif | ||
2725 | del_timer_sync(&nic->watchdog); | 2723 | del_timer_sync(&nic->watchdog); |
2726 | netif_carrier_off(nic->netdev); | 2724 | netif_carrier_off(nic->netdev); |
2727 | |||
2728 | netif_device_detach(netdev); | 2725 | netif_device_detach(netdev); |
2726 | |||
2729 | pci_save_state(pdev); | 2727 | pci_save_state(pdev); |
2730 | 2728 | ||
2731 | if ((nic->flags & wol_magic) | e100_asf(nic)) { | 2729 | if ((nic->flags & wol_magic) | e100_asf(nic)) { |
@@ -2761,16 +2759,13 @@ static int e100_resume(struct pci_dev *pdev) | |||
2761 | } | 2759 | } |
2762 | #endif /* CONFIG_PM */ | 2760 | #endif /* CONFIG_PM */ |
2763 | 2761 | ||
2764 | |||
2765 | static void e100_shutdown(struct pci_dev *pdev) | 2762 | static void e100_shutdown(struct pci_dev *pdev) |
2766 | { | 2763 | { |
2767 | struct net_device *netdev = pci_get_drvdata(pdev); | 2764 | struct net_device *netdev = pci_get_drvdata(pdev); |
2768 | struct nic *nic = netdev_priv(netdev); | 2765 | struct nic *nic = netdev_priv(netdev); |
2769 | 2766 | ||
2770 | #ifdef CONFIG_E100_NAPI | ||
2771 | if (netif_running(netdev)) | 2767 | if (netif_running(netdev)) |
2772 | netif_poll_disable(nic->netdev); | 2768 | netif_poll_disable(nic->netdev); |
2773 | #endif | ||
2774 | del_timer_sync(&nic->watchdog); | 2769 | del_timer_sync(&nic->watchdog); |
2775 | netif_carrier_off(nic->netdev); | 2770 | netif_carrier_off(nic->netdev); |
2776 | 2771 | ||
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 59324b1693d6..e8598b809228 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -239,49 +239,39 @@ extern unsigned long long netxen_dma_mask; | |||
239 | 239 | ||
240 | typedef u32 netxen_ctx_msg; | 240 | typedef u32 netxen_ctx_msg; |
241 | 241 | ||
242 | #define _netxen_set_bits(config_word, start, bits, val) {\ | ||
243 | unsigned long long mask = (((1ULL << (bits)) - 1) << (start)); \ | ||
244 | unsigned long long value = (val); \ | ||
245 | (config_word) &= ~mask; \ | ||
246 | (config_word) |= (((value) << (start)) & mask); \ | ||
247 | } | ||
248 | |||
249 | #define netxen_set_msg_peg_id(config_word, val) \ | 242 | #define netxen_set_msg_peg_id(config_word, val) \ |
250 | _netxen_set_bits(config_word, 0, 2, val) | 243 | ((config_word) &= ~3, (config_word) |= val & 3) |
251 | #define netxen_set_msg_privid(config_word) \ | 244 | #define netxen_set_msg_privid(config_word) \ |
252 | set_bit(2, (unsigned long*)&config_word) | 245 | ((config_word) |= 1 << 2) |
253 | #define netxen_set_msg_count(config_word, val) \ | 246 | #define netxen_set_msg_count(config_word, val) \ |
254 | _netxen_set_bits(config_word, 3, 15, val) | 247 | ((config_word) &= ~(0x7fff<<3), (config_word) |= (val & 0x7fff) << 3) |
255 | #define netxen_set_msg_ctxid(config_word, val) \ | 248 | #define netxen_set_msg_ctxid(config_word, val) \ |
256 | _netxen_set_bits(config_word, 18, 10, val) | 249 | ((config_word) &= ~(0x3ff<<18), (config_word) |= (val & 0x3ff) << 18) |
257 | #define netxen_set_msg_opcode(config_word, val) \ | 250 | #define netxen_set_msg_opcode(config_word, val) \ |
258 | _netxen_set_bits(config_word, 28, 4, val) | 251 | ((config_word) &= ~(0xf<<24), (config_word) |= (val & 0xf) << 24) |
259 | 252 | ||
260 | struct netxen_rcv_context { | 253 | struct netxen_rcv_context { |
261 | u32 rcv_ring_addr_lo; | 254 | __le64 rcv_ring_addr; |
262 | u32 rcv_ring_addr_hi; | 255 | __le32 rcv_ring_size; |
263 | u32 rcv_ring_size; | 256 | __le32 rsrvd; |
264 | u32 rsrvd; | ||
265 | }; | 257 | }; |
266 | 258 | ||
267 | struct netxen_ring_ctx { | 259 | struct netxen_ring_ctx { |
268 | 260 | ||
269 | /* one command ring */ | 261 | /* one command ring */ |
270 | u64 cmd_consumer_offset; | 262 | __le64 cmd_consumer_offset; |
271 | u32 cmd_ring_addr_lo; | 263 | __le64 cmd_ring_addr; |
272 | u32 cmd_ring_addr_hi; | 264 | __le32 cmd_ring_size; |
273 | u32 cmd_ring_size; | 265 | __le32 rsrvd; |
274 | u32 rsrvd; | ||
275 | 266 | ||
276 | /* three receive rings */ | 267 | /* three receive rings */ |
277 | struct netxen_rcv_context rcv_ctx[3]; | 268 | struct netxen_rcv_context rcv_ctx[3]; |
278 | 269 | ||
279 | /* one status ring */ | 270 | /* one status ring */ |
280 | u32 sts_ring_addr_lo; | 271 | __le64 sts_ring_addr; |
281 | u32 sts_ring_addr_hi; | 272 | __le32 sts_ring_size; |
282 | u32 sts_ring_size; | ||
283 | 273 | ||
284 | u32 ctx_id; | 274 | __le32 ctx_id; |
285 | } __attribute__ ((aligned(64))); | 275 | } __attribute__ ((aligned(64))); |
286 | 276 | ||
287 | /* | 277 | /* |
@@ -305,81 +295,85 @@ struct netxen_ring_ctx { | |||
305 | ((cmd_desc)->port_ctxid |= ((var) & 0x0F)) | 295 | ((cmd_desc)->port_ctxid |= ((var) & 0x0F)) |
306 | 296 | ||
307 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ | 297 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ |
308 | _netxen_set_bits((cmd_desc)->flags_opcode, 0, 7, val) | 298 | ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \ |
299 | (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f)) | ||
309 | #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ | 300 | #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ |
310 | _netxen_set_bits((cmd_desc)->flags_opcode, 7, 6, val) | 301 | ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \ |
302 | (cmd_desc)->flags_opcode |= cpu_to_le16((val) & (0x3f<<7))) | ||
311 | 303 | ||
312 | #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ | 304 | #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ |
313 | _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 0, 8, val); | 305 | ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \ |
306 | (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff)) | ||
314 | #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ | 307 | #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ |
315 | _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 8, 24, val); | 308 | ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \ |
309 | (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 24)) | ||
316 | 310 | ||
317 | #define netxen_get_cmd_desc_opcode(cmd_desc) \ | 311 | #define netxen_get_cmd_desc_opcode(cmd_desc) \ |
318 | (((cmd_desc)->flags_opcode >> 7) & 0x003F) | 312 | ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F) |
319 | #define netxen_get_cmd_desc_totallength(cmd_desc) \ | 313 | #define netxen_get_cmd_desc_totallength(cmd_desc) \ |
320 | (((cmd_desc)->num_of_buffers_total_length >> 8) & 0x0FFFFFF) | 314 | (le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) |
321 | 315 | ||
322 | struct cmd_desc_type0 { | 316 | struct cmd_desc_type0 { |
323 | u8 tcp_hdr_offset; /* For LSO only */ | 317 | u8 tcp_hdr_offset; /* For LSO only */ |
324 | u8 ip_hdr_offset; /* For LSO only */ | 318 | u8 ip_hdr_offset; /* For LSO only */ |
325 | /* Bit pattern: 0-6 flags, 7-12 opcode, 13-15 unused */ | 319 | /* Bit pattern: 0-6 flags, 7-12 opcode, 13-15 unused */ |
326 | u16 flags_opcode; | 320 | __le16 flags_opcode; |
327 | /* Bit pattern: 0-7 total number of segments, | 321 | /* Bit pattern: 0-7 total number of segments, |
328 | 8-31 Total size of the packet */ | 322 | 8-31 Total size of the packet */ |
329 | u32 num_of_buffers_total_length; | 323 | __le32 num_of_buffers_total_length; |
330 | union { | 324 | union { |
331 | struct { | 325 | struct { |
332 | u32 addr_low_part2; | 326 | __le32 addr_low_part2; |
333 | u32 addr_high_part2; | 327 | __le32 addr_high_part2; |
334 | }; | 328 | }; |
335 | u64 addr_buffer2; | 329 | __le64 addr_buffer2; |
336 | }; | 330 | }; |
337 | 331 | ||
338 | u16 reference_handle; /* changed to u16 to add mss */ | 332 | __le16 reference_handle; /* changed to u16 to add mss */ |
339 | u16 mss; /* passed by NDIS_PACKET for LSO */ | 333 | __le16 mss; /* passed by NDIS_PACKET for LSO */ |
340 | /* Bit pattern 0-3 port, 0-3 ctx id */ | 334 | /* Bit pattern 0-3 port, 0-3 ctx id */ |
341 | u8 port_ctxid; | 335 | u8 port_ctxid; |
342 | u8 total_hdr_length; /* LSO only : MAC+IP+TCP Hdr size */ | 336 | u8 total_hdr_length; /* LSO only : MAC+IP+TCP Hdr size */ |
343 | u16 conn_id; /* IPSec offoad only */ | 337 | __le16 conn_id; /* IPSec offoad only */ |
344 | 338 | ||
345 | union { | 339 | union { |
346 | struct { | 340 | struct { |
347 | u32 addr_low_part3; | 341 | __le32 addr_low_part3; |
348 | u32 addr_high_part3; | 342 | __le32 addr_high_part3; |
349 | }; | 343 | }; |
350 | u64 addr_buffer3; | 344 | __le64 addr_buffer3; |
351 | }; | 345 | }; |
352 | union { | 346 | union { |
353 | struct { | 347 | struct { |
354 | u32 addr_low_part1; | 348 | __le32 addr_low_part1; |
355 | u32 addr_high_part1; | 349 | __le32 addr_high_part1; |
356 | }; | 350 | }; |
357 | u64 addr_buffer1; | 351 | __le64 addr_buffer1; |
358 | }; | 352 | }; |
359 | 353 | ||
360 | u16 buffer1_length; | 354 | __le16 buffer1_length; |
361 | u16 buffer2_length; | 355 | __le16 buffer2_length; |
362 | u16 buffer3_length; | 356 | __le16 buffer3_length; |
363 | u16 buffer4_length; | 357 | __le16 buffer4_length; |
364 | 358 | ||
365 | union { | 359 | union { |
366 | struct { | 360 | struct { |
367 | u32 addr_low_part4; | 361 | __le32 addr_low_part4; |
368 | u32 addr_high_part4; | 362 | __le32 addr_high_part4; |
369 | }; | 363 | }; |
370 | u64 addr_buffer4; | 364 | __le64 addr_buffer4; |
371 | }; | 365 | }; |
372 | 366 | ||
373 | u64 unused; | 367 | __le64 unused; |
374 | 368 | ||
375 | } __attribute__ ((aligned(64))); | 369 | } __attribute__ ((aligned(64))); |
376 | 370 | ||
377 | /* Note: sizeof(rcv_desc) should always be a mutliple of 2 */ | 371 | /* Note: sizeof(rcv_desc) should always be a mutliple of 2 */ |
378 | struct rcv_desc { | 372 | struct rcv_desc { |
379 | u16 reference_handle; | 373 | __le16 reference_handle; |
380 | u16 reserved; | 374 | __le16 reserved; |
381 | u32 buffer_length; /* allocated buffer length (usually 2K) */ | 375 | __le32 buffer_length; /* allocated buffer length (usually 2K) */ |
382 | u64 addr_buffer; | 376 | __le64 addr_buffer; |
383 | }; | 377 | }; |
384 | 378 | ||
385 | /* opcode field in status_desc */ | 379 | /* opcode field in status_desc */ |
@@ -405,36 +399,36 @@ struct rcv_desc { | |||
405 | (((status_desc)->lro & 0x80) >> 7) | 399 | (((status_desc)->lro & 0x80) >> 7) |
406 | 400 | ||
407 | #define netxen_get_sts_port(status_desc) \ | 401 | #define netxen_get_sts_port(status_desc) \ |
408 | ((status_desc)->status_desc_data & 0x0F) | 402 | (le64_to_cpu((status_desc)->status_desc_data) & 0x0F) |
409 | #define netxen_get_sts_status(status_desc) \ | 403 | #define netxen_get_sts_status(status_desc) \ |
410 | (((status_desc)->status_desc_data >> 4) & 0x0F) | 404 | ((le64_to_cpu((status_desc)->status_desc_data) >> 4) & 0x0F) |
411 | #define netxen_get_sts_type(status_desc) \ | 405 | #define netxen_get_sts_type(status_desc) \ |
412 | (((status_desc)->status_desc_data >> 8) & 0x0F) | 406 | ((le64_to_cpu((status_desc)->status_desc_data) >> 8) & 0x0F) |
413 | #define netxen_get_sts_totallength(status_desc) \ | 407 | #define netxen_get_sts_totallength(status_desc) \ |
414 | (((status_desc)->status_desc_data >> 12) & 0xFFFF) | 408 | ((le64_to_cpu((status_desc)->status_desc_data) >> 12) & 0xFFFF) |
415 | #define netxen_get_sts_refhandle(status_desc) \ | 409 | #define netxen_get_sts_refhandle(status_desc) \ |
416 | (((status_desc)->status_desc_data >> 28) & 0xFFFF) | 410 | ((le64_to_cpu((status_desc)->status_desc_data) >> 28) & 0xFFFF) |
417 | #define netxen_get_sts_prot(status_desc) \ | 411 | #define netxen_get_sts_prot(status_desc) \ |
418 | (((status_desc)->status_desc_data >> 44) & 0x0F) | 412 | ((le64_to_cpu((status_desc)->status_desc_data) >> 44) & 0x0F) |
419 | #define netxen_get_sts_owner(status_desc) \ | 413 | #define netxen_get_sts_owner(status_desc) \ |
420 | (((status_desc)->status_desc_data >> 56) & 0x03) | 414 | ((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03) |
421 | #define netxen_get_sts_opcode(status_desc) \ | 415 | #define netxen_get_sts_opcode(status_desc) \ |
422 | (((status_desc)->status_desc_data >> 58) & 0x03F) | 416 | ((le64_to_cpu((status_desc)->status_desc_data) >> 58) & 0x03F) |
423 | 417 | ||
424 | #define netxen_clear_sts_owner(status_desc) \ | 418 | #define netxen_clear_sts_owner(status_desc) \ |
425 | ((status_desc)->status_desc_data &= \ | 419 | ((status_desc)->status_desc_data &= \ |
426 | ~(((unsigned long long)3) << 56 )) | 420 | ~cpu_to_le64(((unsigned long long)3) << 56 )) |
427 | #define netxen_set_sts_owner(status_desc, val) \ | 421 | #define netxen_set_sts_owner(status_desc, val) \ |
428 | ((status_desc)->status_desc_data |= \ | 422 | ((status_desc)->status_desc_data |= \ |
429 | (((unsigned long long)((val) & 0x3)) << 56 )) | 423 | cpu_to_le64(((unsigned long long)((val) & 0x3)) << 56 )) |
430 | 424 | ||
431 | struct status_desc { | 425 | struct status_desc { |
432 | /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length | 426 | /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length |
433 | 28-43 reference_handle, 44-47 protocol, 48-52 unused | 427 | 28-43 reference_handle, 44-47 protocol, 48-52 unused |
434 | 53-55 desc_cnt, 56-57 owner, 58-63 opcode | 428 | 53-55 desc_cnt, 56-57 owner, 58-63 opcode |
435 | */ | 429 | */ |
436 | u64 status_desc_data; | 430 | __le64 status_desc_data; |
437 | u32 hash_value; | 431 | __le32 hash_value; |
438 | u8 hash_type; | 432 | u8 hash_type; |
439 | u8 msg_type; | 433 | u8 msg_type; |
440 | u8 unused; | 434 | u8 unused; |
@@ -1005,9 +999,9 @@ void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, int port, | |||
1005 | void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port, | 999 | void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port, |
1006 | long enable); | 1000 | long enable); |
1007 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, long reg, | 1001 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, long reg, |
1008 | __le32 * readval); | 1002 | __u32 * readval); |
1009 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long phy, | 1003 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long phy, |
1010 | long reg, __le32 val); | 1004 | long reg, __u32 val); |
1011 | 1005 | ||
1012 | /* Functions available from netxen_nic_hw.c */ | 1006 | /* Functions available from netxen_nic_hw.c */ |
1013 | int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu); | 1007 | int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu); |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 34044616b3c8..c381d77a7336 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -218,7 +218,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
218 | { | 218 | { |
219 | struct netxen_port *port = netdev_priv(dev); | 219 | struct netxen_port *port = netdev_priv(dev); |
220 | struct netxen_adapter *adapter = port->adapter; | 220 | struct netxen_adapter *adapter = port->adapter; |
221 | __le32 status; | 221 | __u32 status; |
222 | 222 | ||
223 | /* read which mode */ | 223 | /* read which mode */ |
224 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 224 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
@@ -226,7 +226,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
226 | if (adapter->phy_write | 226 | if (adapter->phy_write |
227 | && adapter->phy_write(adapter, port->portnum, | 227 | && adapter->phy_write(adapter, port->portnum, |
228 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 228 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
229 | (__le32) ecmd->autoneg) != 0) | 229 | ecmd->autoneg) != 0) |
230 | return -EIO; | 230 | return -EIO; |
231 | else | 231 | else |
232 | port->link_autoneg = ecmd->autoneg; | 232 | port->link_autoneg = ecmd->autoneg; |
@@ -279,7 +279,7 @@ static int netxen_nic_get_regs_len(struct net_device *dev) | |||
279 | } | 279 | } |
280 | 280 | ||
281 | struct netxen_niu_regs { | 281 | struct netxen_niu_regs { |
282 | __le32 reg[NETXEN_NIC_REGS_COUNT]; | 282 | __u32 reg[NETXEN_NIC_REGS_COUNT]; |
283 | }; | 283 | }; |
284 | 284 | ||
285 | static struct netxen_niu_regs niu_registers[] = { | 285 | static struct netxen_niu_regs niu_registers[] = { |
@@ -372,7 +372,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) | |||
372 | { | 372 | { |
373 | struct netxen_port *port = netdev_priv(dev); | 373 | struct netxen_port *port = netdev_priv(dev); |
374 | struct netxen_adapter *adapter = port->adapter; | 374 | struct netxen_adapter *adapter = port->adapter; |
375 | __le32 mode, *regs_buff = p; | 375 | __u32 mode, *regs_buff = p; |
376 | void __iomem *addr; | 376 | void __iomem *addr; |
377 | int i, window; | 377 | int i, window; |
378 | 378 | ||
@@ -415,7 +415,7 @@ static u32 netxen_nic_get_link(struct net_device *dev) | |||
415 | { | 415 | { |
416 | struct netxen_port *port = netdev_priv(dev); | 416 | struct netxen_port *port = netdev_priv(dev); |
417 | struct netxen_adapter *adapter = port->adapter; | 417 | struct netxen_adapter *adapter = port->adapter; |
418 | __le32 status; | 418 | __u32 status; |
419 | 419 | ||
420 | /* read which mode */ | 420 | /* read which mode */ |
421 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 421 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
@@ -482,13 +482,13 @@ netxen_nic_get_pauseparam(struct net_device *dev, | |||
482 | { | 482 | { |
483 | struct netxen_port *port = netdev_priv(dev); | 483 | struct netxen_port *port = netdev_priv(dev); |
484 | struct netxen_adapter *adapter = port->adapter; | 484 | struct netxen_adapter *adapter = port->adapter; |
485 | __le32 val; | 485 | __u32 val; |
486 | 486 | ||
487 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 487 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
488 | /* get flow control settings */ | 488 | /* get flow control settings */ |
489 | netxen_nic_read_w0(adapter, | 489 | netxen_nic_read_w0(adapter, |
490 | NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), | 490 | NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), |
491 | (u32 *) & val); | 491 | &val); |
492 | pause->rx_pause = netxen_gb_get_rx_flowctl(val); | 492 | pause->rx_pause = netxen_gb_get_rx_flowctl(val); |
493 | pause->tx_pause = netxen_gb_get_tx_flowctl(val); | 493 | pause->tx_pause = netxen_gb_get_tx_flowctl(val); |
494 | /* get autoneg settings */ | 494 | /* get autoneg settings */ |
@@ -502,7 +502,7 @@ netxen_nic_set_pauseparam(struct net_device *dev, | |||
502 | { | 502 | { |
503 | struct netxen_port *port = netdev_priv(dev); | 503 | struct netxen_port *port = netdev_priv(dev); |
504 | struct netxen_adapter *adapter = port->adapter; | 504 | struct netxen_adapter *adapter = port->adapter; |
505 | __le32 val; | 505 | __u32 val; |
506 | unsigned int autoneg; | 506 | unsigned int autoneg; |
507 | 507 | ||
508 | /* read mode */ | 508 | /* read mode */ |
@@ -522,13 +522,13 @@ netxen_nic_set_pauseparam(struct net_device *dev, | |||
522 | 522 | ||
523 | netxen_nic_write_w0(adapter, | 523 | netxen_nic_write_w0(adapter, |
524 | NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), | 524 | NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), |
525 | *(u32 *) (&val)); | 525 | *&val); |
526 | /* set autoneg */ | 526 | /* set autoneg */ |
527 | autoneg = pause->autoneg; | 527 | autoneg = pause->autoneg; |
528 | if (adapter->phy_write | 528 | if (adapter->phy_write |
529 | && adapter->phy_write(adapter, port->portnum, | 529 | && adapter->phy_write(adapter, port->portnum, |
530 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 530 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
531 | (__le32) autoneg) != 0) | 531 | autoneg) != 0) |
532 | return -EIO; | 532 | return -EIO; |
533 | else { | 533 | else { |
534 | port->link_autoneg = pause->autoneg; | 534 | port->link_autoneg = pause->autoneg; |
@@ -543,7 +543,7 @@ static int netxen_nic_reg_test(struct net_device *dev) | |||
543 | struct netxen_port *port = netdev_priv(dev); | 543 | struct netxen_port *port = netdev_priv(dev); |
544 | struct netxen_adapter *adapter = port->adapter; | 544 | struct netxen_adapter *adapter = port->adapter; |
545 | u32 data_read, data_written, save; | 545 | u32 data_read, data_written, save; |
546 | __le32 mode; | 546 | __u32 mode; |
547 | 547 | ||
548 | /* | 548 | /* |
549 | * first test the "Read Only" registers by writing which mode | 549 | * first test the "Read Only" registers by writing which mode |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 191e2336e323..f263232f499f 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -95,7 +95,7 @@ void netxen_nic_set_multi(struct net_device *netdev) | |||
95 | struct netxen_port *port = netdev_priv(netdev); | 95 | struct netxen_port *port = netdev_priv(netdev); |
96 | struct netxen_adapter *adapter = port->adapter; | 96 | struct netxen_adapter *adapter = port->adapter; |
97 | struct dev_mc_list *mc_ptr; | 97 | struct dev_mc_list *mc_ptr; |
98 | __le32 netxen_mac_addr_cntl_data = 0; | 98 | __u32 netxen_mac_addr_cntl_data = 0; |
99 | 99 | ||
100 | mc_ptr = netdev->mc_list; | 100 | mc_ptr = netdev->mc_list; |
101 | if (netdev->flags & IFF_PROMISC) { | 101 | if (netdev->flags & IFF_PROMISC) { |
@@ -236,8 +236,9 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
236 | } | 236 | } |
237 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); | 237 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); |
238 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; | 238 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; |
239 | adapter->ctx_desc->cmd_consumer_offset = adapter->ctx_desc_phys_addr | 239 | adapter->ctx_desc->cmd_consumer_offset = |
240 | + sizeof(struct netxen_ring_ctx); | 240 | cpu_to_le64(adapter->ctx_desc_phys_addr + |
241 | sizeof(struct netxen_ring_ctx)); | ||
241 | adapter->cmd_consumer = (uint32_t *) (((char *)addr) + | 242 | adapter->cmd_consumer = (uint32_t *) (((char *)addr) + |
242 | sizeof(struct netxen_ring_ctx)); | 243 | sizeof(struct netxen_ring_ctx)); |
243 | 244 | ||
@@ -253,11 +254,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
253 | return -ENOMEM; | 254 | return -ENOMEM; |
254 | } | 255 | } |
255 | 256 | ||
256 | adapter->ctx_desc->cmd_ring_addr_lo = | 257 | adapter->ctx_desc->cmd_ring_addr = |
257 | hw->cmd_desc_phys_addr & 0xffffffffUL; | 258 | cpu_to_le64(hw->cmd_desc_phys_addr); |
258 | adapter->ctx_desc->cmd_ring_addr_hi = | 259 | adapter->ctx_desc->cmd_ring_size = |
259 | ((u64) hw->cmd_desc_phys_addr >> 32); | 260 | cpu_to_le32(adapter->max_tx_desc_count); |
260 | adapter->ctx_desc->cmd_ring_size = adapter->max_tx_desc_count; | ||
261 | 261 | ||
262 | hw->cmd_desc_head = (struct cmd_desc_type0 *)addr; | 262 | hw->cmd_desc_head = (struct cmd_desc_type0 *)addr; |
263 | 263 | ||
@@ -278,12 +278,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
278 | return err; | 278 | return err; |
279 | } | 279 | } |
280 | rcv_desc->desc_head = (struct rcv_desc *)addr; | 280 | rcv_desc->desc_head = (struct rcv_desc *)addr; |
281 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_lo = | 281 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr = |
282 | rcv_desc->phys_addr & 0xffffffffUL; | 282 | cpu_to_le64(rcv_desc->phys_addr); |
283 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_hi = | ||
284 | ((u64) rcv_desc->phys_addr >> 32); | ||
285 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size = | 283 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size = |
286 | rcv_desc->max_rx_desc_count; | 284 | cpu_to_le32(rcv_desc->max_rx_desc_count); |
287 | } | 285 | } |
288 | 286 | ||
289 | addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, | 287 | addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, |
@@ -297,11 +295,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
297 | return err; | 295 | return err; |
298 | } | 296 | } |
299 | recv_ctx->rcv_status_desc_head = (struct status_desc *)addr; | 297 | recv_ctx->rcv_status_desc_head = (struct status_desc *)addr; |
300 | adapter->ctx_desc->sts_ring_addr_lo = | 298 | adapter->ctx_desc->sts_ring_addr = |
301 | recv_ctx->rcv_status_desc_phys_addr & 0xffffffffUL; | 299 | cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr); |
302 | adapter->ctx_desc->sts_ring_addr_hi = | 300 | adapter->ctx_desc->sts_ring_size = |
303 | ((u64) recv_ctx->rcv_status_desc_phys_addr >> 32); | 301 | cpu_to_le32(adapter->max_rx_desc_count); |
304 | adapter->ctx_desc->sts_ring_size = adapter->max_rx_desc_count; | ||
305 | 302 | ||
306 | } | 303 | } |
307 | /* Window = 1 */ | 304 | /* Window = 1 */ |
@@ -387,10 +384,6 @@ void netxen_tso_check(struct netxen_adapter *adapter, | |||
387 | } | 384 | } |
388 | adapter->stats.xmitcsummed++; | 385 | adapter->stats.xmitcsummed++; |
389 | desc->tcp_hdr_offset = skb->h.raw - skb->data; | 386 | desc->tcp_hdr_offset = skb->h.raw - skb->data; |
390 | netxen_set_cmd_desc_totallength(desc, | ||
391 | cpu_to_le32 | ||
392 | (netxen_get_cmd_desc_totallength | ||
393 | (desc))); | ||
394 | desc->ip_hdr_offset = skb->nh.raw - skb->data; | 387 | desc->ip_hdr_offset = skb->nh.raw - skb->data; |
395 | } | 388 | } |
396 | 389 | ||
@@ -867,9 +860,9 @@ netxen_crb_writelit_adapter(struct netxen_adapter *adapter, unsigned long off, | |||
867 | void netxen_nic_set_link_parameters(struct netxen_port *port) | 860 | void netxen_nic_set_link_parameters(struct netxen_port *port) |
868 | { | 861 | { |
869 | struct netxen_adapter *adapter = port->adapter; | 862 | struct netxen_adapter *adapter = port->adapter; |
870 | __le32 status; | 863 | __u32 status; |
871 | __le32 autoneg; | 864 | __u32 autoneg; |
872 | __le32 mode; | 865 | __u32 mode; |
873 | 866 | ||
874 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); | 867 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); |
875 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ | 868 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ |
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h index 0685633a9c1e..ab1112eb1b0d 100644 --- a/drivers/net/netxen/netxen_nic_hw.h +++ b/drivers/net/netxen/netxen_nic_hw.h | |||
@@ -124,28 +124,28 @@ typedef enum { | |||
124 | */ | 124 | */ |
125 | 125 | ||
126 | #define netxen_gb_enable_tx(config_word) \ | 126 | #define netxen_gb_enable_tx(config_word) \ |
127 | set_bit(0, (unsigned long*)(&config_word)) | 127 | ((config_word) |= 1 << 0) |
128 | #define netxen_gb_enable_rx(config_word) \ | 128 | #define netxen_gb_enable_rx(config_word) \ |
129 | set_bit(2, (unsigned long*)(&config_word)) | 129 | ((config_word) |= 1 << 2) |
130 | #define netxen_gb_tx_flowctl(config_word) \ | 130 | #define netxen_gb_tx_flowctl(config_word) \ |
131 | set_bit(4, (unsigned long*)(&config_word)) | 131 | ((config_word) |= 1 << 4) |
132 | #define netxen_gb_rx_flowctl(config_word) \ | 132 | #define netxen_gb_rx_flowctl(config_word) \ |
133 | set_bit(5, (unsigned long*)(&config_word)) | 133 | ((config_word) |= 1 << 5) |
134 | #define netxen_gb_tx_reset_pb(config_word) \ | 134 | #define netxen_gb_tx_reset_pb(config_word) \ |
135 | set_bit(16, (unsigned long*)(&config_word)) | 135 | ((config_word) |= 1 << 16) |
136 | #define netxen_gb_rx_reset_pb(config_word) \ | 136 | #define netxen_gb_rx_reset_pb(config_word) \ |
137 | set_bit(17, (unsigned long*)(&config_word)) | 137 | ((config_word) |= 1 << 17) |
138 | #define netxen_gb_tx_reset_mac(config_word) \ | 138 | #define netxen_gb_tx_reset_mac(config_word) \ |
139 | set_bit(18, (unsigned long*)(&config_word)) | 139 | ((config_word) |= 1 << 18) |
140 | #define netxen_gb_rx_reset_mac(config_word) \ | 140 | #define netxen_gb_rx_reset_mac(config_word) \ |
141 | set_bit(19, (unsigned long*)(&config_word)) | 141 | ((config_word) |= 1 << 19) |
142 | #define netxen_gb_soft_reset(config_word) \ | 142 | #define netxen_gb_soft_reset(config_word) \ |
143 | set_bit(31, (unsigned long*)(&config_word)) | 143 | ((config_word) |= 1 << 31) |
144 | 144 | ||
145 | #define netxen_gb_unset_tx_flowctl(config_word) \ | 145 | #define netxen_gb_unset_tx_flowctl(config_word) \ |
146 | clear_bit(4, (unsigned long *)(&config_word)) | 146 | ((config_word) &= ~(1 << 4)) |
147 | #define netxen_gb_unset_rx_flowctl(config_word) \ | 147 | #define netxen_gb_unset_rx_flowctl(config_word) \ |
148 | clear_bit(5, (unsigned long*)(&config_word)) | 148 | ((config_word) &= ~(1 << 5)) |
149 | 149 | ||
150 | #define netxen_gb_get_tx_synced(config_word) \ | 150 | #define netxen_gb_get_tx_synced(config_word) \ |
151 | _netxen_crb_get_bit((config_word), 1) | 151 | _netxen_crb_get_bit((config_word), 1) |
@@ -171,15 +171,15 @@ typedef enum { | |||
171 | */ | 171 | */ |
172 | 172 | ||
173 | #define netxen_gb_set_duplex(config_word) \ | 173 | #define netxen_gb_set_duplex(config_word) \ |
174 | set_bit(0, (unsigned long*)&config_word) | 174 | ((config_word) |= 1 << 0) |
175 | #define netxen_gb_set_crc_enable(config_word) \ | 175 | #define netxen_gb_set_crc_enable(config_word) \ |
176 | set_bit(1, (unsigned long*)&config_word) | 176 | ((config_word) |= 1 << 1) |
177 | #define netxen_gb_set_padshort(config_word) \ | 177 | #define netxen_gb_set_padshort(config_word) \ |
178 | set_bit(2, (unsigned long*)&config_word) | 178 | ((config_word) |= 1 << 2) |
179 | #define netxen_gb_set_checklength(config_word) \ | 179 | #define netxen_gb_set_checklength(config_word) \ |
180 | set_bit(4, (unsigned long*)&config_word) | 180 | ((config_word) |= 1 << 4) |
181 | #define netxen_gb_set_hugeframes(config_word) \ | 181 | #define netxen_gb_set_hugeframes(config_word) \ |
182 | set_bit(5, (unsigned long*)&config_word) | 182 | ((config_word) |= 1 << 5) |
183 | #define netxen_gb_set_preamblelen(config_word, val) \ | 183 | #define netxen_gb_set_preamblelen(config_word, val) \ |
184 | ((config_word) |= ((val) << 12) & 0xF000) | 184 | ((config_word) |= ((val) << 12) & 0xF000) |
185 | #define netxen_gb_set_intfmode(config_word, val) \ | 185 | #define netxen_gb_set_intfmode(config_word, val) \ |
@@ -190,9 +190,9 @@ typedef enum { | |||
190 | #define netxen_gb_set_mii_mgmt_clockselect(config_word, val) \ | 190 | #define netxen_gb_set_mii_mgmt_clockselect(config_word, val) \ |
191 | ((config_word) |= ((val) & 0x07)) | 191 | ((config_word) |= ((val) & 0x07)) |
192 | #define netxen_gb_mii_mgmt_reset(config_word) \ | 192 | #define netxen_gb_mii_mgmt_reset(config_word) \ |
193 | set_bit(31, (unsigned long*)&config_word) | 193 | ((config_word) |= 1 << 31) |
194 | #define netxen_gb_mii_mgmt_unset(config_word) \ | 194 | #define netxen_gb_mii_mgmt_unset(config_word) \ |
195 | clear_bit(31, (unsigned long*)&config_word) | 195 | ((config_word) &= ~(1 << 31)) |
196 | 196 | ||
197 | /* | 197 | /* |
198 | * NIU GB MII Mgmt Command Register (applies to GB0, GB1, GB2, GB3) | 198 | * NIU GB MII Mgmt Command Register (applies to GB0, GB1, GB2, GB3) |
@@ -201,7 +201,7 @@ typedef enum { | |||
201 | */ | 201 | */ |
202 | 202 | ||
203 | #define netxen_gb_mii_mgmt_set_read_cycle(config_word) \ | 203 | #define netxen_gb_mii_mgmt_set_read_cycle(config_word) \ |
204 | set_bit(0, (unsigned long*)&config_word) | 204 | ((config_word) |= 1 << 0) |
205 | #define netxen_gb_mii_mgmt_reg_addr(config_word, val) \ | 205 | #define netxen_gb_mii_mgmt_reg_addr(config_word, val) \ |
206 | ((config_word) |= ((val) & 0x1F)) | 206 | ((config_word) |= ((val) & 0x1F)) |
207 | #define netxen_gb_mii_mgmt_phy_addr(config_word, val) \ | 207 | #define netxen_gb_mii_mgmt_phy_addr(config_word, val) \ |
@@ -274,9 +274,9 @@ typedef enum { | |||
274 | #define netxen_set_phy_speed(config_word, val) \ | 274 | #define netxen_set_phy_speed(config_word, val) \ |
275 | ((config_word) |= ((val & 0x03) << 14)) | 275 | ((config_word) |= ((val & 0x03) << 14)) |
276 | #define netxen_set_phy_duplex(config_word) \ | 276 | #define netxen_set_phy_duplex(config_word) \ |
277 | set_bit(13, (unsigned long*)&config_word) | 277 | ((config_word) |= 1 << 13) |
278 | #define netxen_clear_phy_duplex(config_word) \ | 278 | #define netxen_clear_phy_duplex(config_word) \ |
279 | clear_bit(13, (unsigned long*)&config_word) | 279 | ((config_word) &= ~(1 << 13)) |
280 | 280 | ||
281 | #define netxen_get_phy_jabber(config_word) \ | 281 | #define netxen_get_phy_jabber(config_word) \ |
282 | _netxen_crb_get_bit(config_word, 0) | 282 | _netxen_crb_get_bit(config_word, 0) |
@@ -350,11 +350,11 @@ typedef enum { | |||
350 | _netxen_crb_get_bit(config_word, 15) | 350 | _netxen_crb_get_bit(config_word, 15) |
351 | 351 | ||
352 | #define netxen_set_phy_int_link_status_changed(config_word) \ | 352 | #define netxen_set_phy_int_link_status_changed(config_word) \ |
353 | set_bit(10, (unsigned long*)&config_word) | 353 | ((config_word) |= 1 << 10) |
354 | #define netxen_set_phy_int_autoneg_completed(config_word) \ | 354 | #define netxen_set_phy_int_autoneg_completed(config_word) \ |
355 | set_bit(11, (unsigned long*)&config_word) | 355 | ((config_word) |= 1 << 11) |
356 | #define netxen_set_phy_int_speed_changed(config_word) \ | 356 | #define netxen_set_phy_int_speed_changed(config_word) \ |
357 | set_bit(14, (unsigned long*)&config_word) | 357 | ((config_word) |= 1 << 14) |
358 | 358 | ||
359 | /* | 359 | /* |
360 | * NIU Mode Register. | 360 | * NIU Mode Register. |
@@ -382,22 +382,22 @@ typedef enum { | |||
382 | */ | 382 | */ |
383 | 383 | ||
384 | #define netxen_set_gb_drop_gb0(config_word) \ | 384 | #define netxen_set_gb_drop_gb0(config_word) \ |
385 | set_bit(0, (unsigned long*)&config_word) | 385 | ((config_word) |= 1 << 0) |
386 | #define netxen_set_gb_drop_gb1(config_word) \ | 386 | #define netxen_set_gb_drop_gb1(config_word) \ |
387 | set_bit(1, (unsigned long*)&config_word) | 387 | ((config_word) |= 1 << 1) |
388 | #define netxen_set_gb_drop_gb2(config_word) \ | 388 | #define netxen_set_gb_drop_gb2(config_word) \ |
389 | set_bit(2, (unsigned long*)&config_word) | 389 | ((config_word) |= 1 << 2) |
390 | #define netxen_set_gb_drop_gb3(config_word) \ | 390 | #define netxen_set_gb_drop_gb3(config_word) \ |
391 | set_bit(3, (unsigned long*)&config_word) | 391 | ((config_word) |= 1 << 3) |
392 | 392 | ||
393 | #define netxen_clear_gb_drop_gb0(config_word) \ | 393 | #define netxen_clear_gb_drop_gb0(config_word) \ |
394 | clear_bit(0, (unsigned long*)&config_word) | 394 | ((config_word) &= ~(1 << 0)) |
395 | #define netxen_clear_gb_drop_gb1(config_word) \ | 395 | #define netxen_clear_gb_drop_gb1(config_word) \ |
396 | clear_bit(1, (unsigned long*)&config_word) | 396 | ((config_word) &= ~(1 << 1)) |
397 | #define netxen_clear_gb_drop_gb2(config_word) \ | 397 | #define netxen_clear_gb_drop_gb2(config_word) \ |
398 | clear_bit(2, (unsigned long*)&config_word) | 398 | ((config_word) &= ~(1 << 2)) |
399 | #define netxen_clear_gb_drop_gb3(config_word) \ | 399 | #define netxen_clear_gb_drop_gb3(config_word) \ |
400 | clear_bit(3, (unsigned long*)&config_word) | 400 | ((config_word) &= ~(1 << 3)) |
401 | 401 | ||
402 | /* | 402 | /* |
403 | * NIU XG MAC Config Register | 403 | * NIU XG MAC Config Register |
@@ -413,7 +413,7 @@ typedef enum { | |||
413 | */ | 413 | */ |
414 | 414 | ||
415 | #define netxen_xg_soft_reset(config_word) \ | 415 | #define netxen_xg_soft_reset(config_word) \ |
416 | set_bit(4, (unsigned long*)&config_word) | 416 | ((config_word) |= 1 << 4) |
417 | 417 | ||
418 | /* | 418 | /* |
419 | * MAC Control Register | 419 | * MAC Control Register |
@@ -433,19 +433,19 @@ typedef enum { | |||
433 | #define netxen_nic_mcr_set_id_pool0(config, val) \ | 433 | #define netxen_nic_mcr_set_id_pool0(config, val) \ |
434 | ((config) |= ((val) &0x03)) | 434 | ((config) |= ((val) &0x03)) |
435 | #define netxen_nic_mcr_set_enable_xtnd0(config) \ | 435 | #define netxen_nic_mcr_set_enable_xtnd0(config) \ |
436 | (set_bit(3, (unsigned long *)&(config))) | 436 | ((config) |= 1 << 3) |
437 | #define netxen_nic_mcr_set_id_pool1(config, val) \ | 437 | #define netxen_nic_mcr_set_id_pool1(config, val) \ |
438 | ((config) |= (((val) & 0x03) << 4)) | 438 | ((config) |= (((val) & 0x03) << 4)) |
439 | #define netxen_nic_mcr_set_enable_xtnd1(config) \ | 439 | #define netxen_nic_mcr_set_enable_xtnd1(config) \ |
440 | (set_bit(6, (unsigned long *)&(config))) | 440 | ((config) |= 1 << 6) |
441 | #define netxen_nic_mcr_set_id_pool2(config, val) \ | 441 | #define netxen_nic_mcr_set_id_pool2(config, val) \ |
442 | ((config) |= (((val) & 0x03) << 8)) | 442 | ((config) |= (((val) & 0x03) << 8)) |
443 | #define netxen_nic_mcr_set_enable_xtnd2(config) \ | 443 | #define netxen_nic_mcr_set_enable_xtnd2(config) \ |
444 | (set_bit(10, (unsigned long *)&(config))) | 444 | ((config) |= 1 << 10) |
445 | #define netxen_nic_mcr_set_id_pool3(config, val) \ | 445 | #define netxen_nic_mcr_set_id_pool3(config, val) \ |
446 | ((config) |= (((val) & 0x03) << 12)) | 446 | ((config) |= (((val) & 0x03) << 12)) |
447 | #define netxen_nic_mcr_set_enable_xtnd3(config) \ | 447 | #define netxen_nic_mcr_set_enable_xtnd3(config) \ |
448 | (set_bit(14, (unsigned long *)&(config))) | 448 | ((config) |= 1 << 14) |
449 | #define netxen_nic_mcr_set_mode_select(config, val) \ | 449 | #define netxen_nic_mcr_set_mode_select(config, val) \ |
450 | ((config) |= (((val) & 0x03) << 24)) | 450 | ((config) |= (((val) & 0x03) << 24)) |
451 | #define netxen_nic_mcr_set_enable_pool(config, val) \ | 451 | #define netxen_nic_mcr_set_enable_pool(config, val) \ |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index c3e41f368554..973af96337a9 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -690,8 +690,7 @@ int netxen_nic_rx_has_work(struct netxen_adapter *adapter) | |||
690 | desc_head = recv_ctx->rcv_status_desc_head; | 690 | desc_head = recv_ctx->rcv_status_desc_head; |
691 | desc = &desc_head[consumer]; | 691 | desc = &desc_head[consumer]; |
692 | 692 | ||
693 | if (((le16_to_cpu(netxen_get_sts_owner(desc))) | 693 | if (netxen_get_sts_owner(desc) & STATUS_OWNER_HOST) |
694 | & STATUS_OWNER_HOST)) | ||
695 | return 1; | 694 | return 1; |
696 | } | 695 | } |
697 | 696 | ||
@@ -787,11 +786,11 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
787 | struct netxen_port *port = adapter->port[netxen_get_sts_port(desc)]; | 786 | struct netxen_port *port = adapter->port[netxen_get_sts_port(desc)]; |
788 | struct pci_dev *pdev = port->pdev; | 787 | struct pci_dev *pdev = port->pdev; |
789 | struct net_device *netdev = port->netdev; | 788 | struct net_device *netdev = port->netdev; |
790 | int index = le16_to_cpu(netxen_get_sts_refhandle(desc)); | 789 | int index = netxen_get_sts_refhandle(desc); |
791 | struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); | 790 | struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); |
792 | struct netxen_rx_buffer *buffer; | 791 | struct netxen_rx_buffer *buffer; |
793 | struct sk_buff *skb; | 792 | struct sk_buff *skb; |
794 | u32 length = le16_to_cpu(netxen_get_sts_totallength(desc)); | 793 | u32 length = netxen_get_sts_totallength(desc); |
795 | u32 desc_ctx; | 794 | u32 desc_ctx; |
796 | struct netxen_rcv_desc_ctx *rcv_desc; | 795 | struct netxen_rcv_desc_ctx *rcv_desc; |
797 | int ret; | 796 | int ret; |
@@ -918,16 +917,14 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) | |||
918 | */ | 917 | */ |
919 | while (count < max) { | 918 | while (count < max) { |
920 | desc = &desc_head[consumer]; | 919 | desc = &desc_head[consumer]; |
921 | if (! | 920 | if (!(netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)) { |
922 | (le16_to_cpu(netxen_get_sts_owner(desc)) & | ||
923 | STATUS_OWNER_HOST)) { | ||
924 | DPRINTK(ERR, "desc %p ownedby %x\n", desc, | 921 | DPRINTK(ERR, "desc %p ownedby %x\n", desc, |
925 | netxen_get_sts_owner(desc)); | 922 | netxen_get_sts_owner(desc)); |
926 | break; | 923 | break; |
927 | } | 924 | } |
928 | netxen_process_rcv(adapter, ctxid, desc); | 925 | netxen_process_rcv(adapter, ctxid, desc); |
929 | netxen_clear_sts_owner(desc); | 926 | netxen_clear_sts_owner(desc); |
930 | netxen_set_sts_owner(desc, cpu_to_le16(STATUS_OWNER_PHANTOM)); | 927 | netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM); |
931 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); | 928 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); |
932 | count++; | 929 | count++; |
933 | } | 930 | } |
@@ -1232,7 +1229,7 @@ void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ctx, | |||
1232 | 1229 | ||
1233 | /* make a rcv descriptor */ | 1230 | /* make a rcv descriptor */ |
1234 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); | 1231 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); |
1235 | pdesc->buffer_length = cpu_to_le16(rcv_desc->dma_size); | 1232 | pdesc->buffer_length = cpu_to_le32(rcv_desc->dma_size); |
1236 | pdesc->addr_buffer = cpu_to_le64(buffer->dma); | 1233 | pdesc->addr_buffer = cpu_to_le64(buffer->dma); |
1237 | DPRINTK(INFO, "done writing descripter\n"); | 1234 | DPRINTK(INFO, "done writing descripter\n"); |
1238 | producer = | 1235 | producer = |
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c index 06847d4252c3..be366e48007c 100644 --- a/drivers/net/netxen/netxen_nic_isr.c +++ b/drivers/net/netxen/netxen_nic_isr.c | |||
@@ -79,7 +79,7 @@ void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 portno, | |||
79 | void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, | 79 | void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, |
80 | u32 enable) | 80 | u32 enable) |
81 | { | 81 | { |
82 | __le32 int_src; | 82 | __u32 int_src; |
83 | struct netxen_port *port; | 83 | struct netxen_port *port; |
84 | 84 | ||
85 | /* This should clear the interrupt source */ | 85 | /* This should clear the interrupt source */ |
@@ -110,7 +110,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, | |||
110 | /* write it down later.. */ | 110 | /* write it down later.. */ |
111 | if ((netxen_get_phy_int_speed_changed(int_src)) | 111 | if ((netxen_get_phy_int_speed_changed(int_src)) |
112 | || (netxen_get_phy_int_link_status_changed(int_src))) { | 112 | || (netxen_get_phy_int_link_status_changed(int_src))) { |
113 | __le32 status; | 113 | __u32 status; |
114 | 114 | ||
115 | DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); | 115 | DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); |
116 | 116 | ||
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 96e1bee19ba0..69c1b9d23a1a 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -117,7 +117,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
117 | void __iomem *mem_ptr1 = NULL; | 117 | void __iomem *mem_ptr1 = NULL; |
118 | void __iomem *mem_ptr2 = NULL; | 118 | void __iomem *mem_ptr2 = NULL; |
119 | 119 | ||
120 | u8 *db_ptr = NULL; | 120 | u8 __iomem *db_ptr = NULL; |
121 | unsigned long mem_base, mem_len, db_base, db_len; | 121 | unsigned long mem_base, mem_len, db_base, db_len; |
122 | int pci_using_dac, i, err; | 122 | int pci_using_dac, i, err; |
123 | int ring; | 123 | int ring; |
@@ -191,7 +191,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
191 | db_len); | 191 | db_len); |
192 | 192 | ||
193 | db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES); | 193 | db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES); |
194 | if (db_ptr == 0UL) { | 194 | if (!db_ptr) { |
195 | printk(KERN_ERR "%s: Failed to allocate doorbell map.", | 195 | printk(KERN_ERR "%s: Failed to allocate doorbell map.", |
196 | netxen_nic_driver_name); | 196 | netxen_nic_driver_name); |
197 | err = -EIO; | 197 | err = -EIO; |
@@ -818,7 +818,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
818 | /* Take skb->data itself */ | 818 | /* Take skb->data itself */ |
819 | pbuf = &adapter->cmd_buf_arr[producer]; | 819 | pbuf = &adapter->cmd_buf_arr[producer]; |
820 | if ((netdev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size > 0) { | 820 | if ((netdev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size > 0) { |
821 | pbuf->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); | 821 | pbuf->mss = skb_shinfo(skb)->gso_size; |
822 | hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); | 822 | hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); |
823 | } else { | 823 | } else { |
824 | pbuf->mss = 0; | 824 | pbuf->mss = 0; |
@@ -882,7 +882,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
882 | hwdesc->addr_buffer3 = cpu_to_le64(temp_dma); | 882 | hwdesc->addr_buffer3 = cpu_to_le64(temp_dma); |
883 | break; | 883 | break; |
884 | case 3: | 884 | case 3: |
885 | hwdesc->buffer4_length = temp_len; | 885 | hwdesc->buffer4_length = cpu_to_le16(temp_len); |
886 | hwdesc->addr_buffer4 = cpu_to_le64(temp_dma); | 886 | hwdesc->addr_buffer4 = cpu_to_le64(temp_dma); |
887 | break; | 887 | break; |
888 | } | 888 | } |
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index 4987dc765d99..40d7003a371c 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -89,15 +89,15 @@ static inline int phy_unlock(struct netxen_adapter *adapter) | |||
89 | * | 89 | * |
90 | */ | 90 | */ |
91 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, | 91 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, |
92 | long reg, __le32 * readval) | 92 | long reg, __u32 * readval) |
93 | { | 93 | { |
94 | long timeout = 0; | 94 | long timeout = 0; |
95 | long result = 0; | 95 | long result = 0; |
96 | long restore = 0; | 96 | long restore = 0; |
97 | __le32 address; | 97 | __u32 address; |
98 | __le32 command; | 98 | __u32 command; |
99 | __le32 status; | 99 | __u32 status; |
100 | __le32 mac_cfg0; | 100 | __u32 mac_cfg0; |
101 | 101 | ||
102 | if (phy_lock(adapter) != 0) { | 102 | if (phy_lock(adapter) != 0) { |
103 | return -1; | 103 | return -1; |
@@ -112,7 +112,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, | |||
112 | &mac_cfg0, 4)) | 112 | &mac_cfg0, 4)) |
113 | return -EIO; | 113 | return -EIO; |
114 | if (netxen_gb_get_soft_reset(mac_cfg0)) { | 114 | if (netxen_gb_get_soft_reset(mac_cfg0)) { |
115 | __le32 temp; | 115 | __u32 temp; |
116 | temp = 0; | 116 | temp = 0; |
117 | netxen_gb_tx_reset_pb(temp); | 117 | netxen_gb_tx_reset_pb(temp); |
118 | netxen_gb_rx_reset_pb(temp); | 118 | netxen_gb_rx_reset_pb(temp); |
@@ -184,15 +184,15 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, | |||
184 | * | 184 | * |
185 | */ | 185 | */ |
186 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, | 186 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, |
187 | long phy, long reg, __le32 val) | 187 | long phy, long reg, __u32 val) |
188 | { | 188 | { |
189 | long timeout = 0; | 189 | long timeout = 0; |
190 | long result = 0; | 190 | long result = 0; |
191 | long restore = 0; | 191 | long restore = 0; |
192 | __le32 address; | 192 | __u32 address; |
193 | __le32 command; | 193 | __u32 command; |
194 | __le32 status; | 194 | __u32 status; |
195 | __le32 mac_cfg0; | 195 | __u32 mac_cfg0; |
196 | 196 | ||
197 | /* | 197 | /* |
198 | * MII mgmt all goes through port 0 MAC interface, so it | 198 | * MII mgmt all goes through port 0 MAC interface, so it |
@@ -203,7 +203,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, | |||
203 | &mac_cfg0, 4)) | 203 | &mac_cfg0, 4)) |
204 | return -EIO; | 204 | return -EIO; |
205 | if (netxen_gb_get_soft_reset(mac_cfg0)) { | 205 | if (netxen_gb_get_soft_reset(mac_cfg0)) { |
206 | __le32 temp; | 206 | __u32 temp; |
207 | temp = 0; | 207 | temp = 0; |
208 | netxen_gb_tx_reset_pb(temp); | 208 | netxen_gb_tx_reset_pb(temp); |
209 | netxen_gb_rx_reset_pb(temp); | 209 | netxen_gb_rx_reset_pb(temp); |
@@ -269,7 +269,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter, | |||
269 | int port) | 269 | int port) |
270 | { | 270 | { |
271 | int result = 0; | 271 | int result = 0; |
272 | __le32 enable = 0; | 272 | __u32 enable = 0; |
273 | netxen_set_phy_int_link_status_changed(enable); | 273 | netxen_set_phy_int_link_status_changed(enable); |
274 | netxen_set_phy_int_autoneg_completed(enable); | 274 | netxen_set_phy_int_autoneg_completed(enable); |
275 | netxen_set_phy_int_speed_changed(enable); | 275 | netxen_set_phy_int_speed_changed(enable); |
@@ -402,7 +402,7 @@ void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, | |||
402 | int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) | 402 | int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) |
403 | { | 403 | { |
404 | int result = 0; | 404 | int result = 0; |
405 | __le32 status; | 405 | __u32 status; |
406 | if (adapter->disable_phy_interrupts) | 406 | if (adapter->disable_phy_interrupts) |
407 | adapter->disable_phy_interrupts(adapter, port); | 407 | adapter->disable_phy_interrupts(adapter, port); |
408 | mdelay(2); | 408 | mdelay(2); |
@@ -410,7 +410,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) | |||
410 | if (0 == | 410 | if (0 == |
411 | netxen_niu_gbe_phy_read(adapter, port, | 411 | netxen_niu_gbe_phy_read(adapter, port, |
412 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, | 412 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
413 | (__le32 *) & status)) { | 413 | &status)) { |
414 | if (netxen_get_phy_link(status)) { | 414 | if (netxen_get_phy_link(status)) { |
415 | if (netxen_get_phy_speed(status) == 2) { | 415 | if (netxen_get_phy_speed(status) == 2) { |
416 | netxen_niu_gbe_set_gmii_mode(adapter, port, 1); | 416 | netxen_niu_gbe_set_gmii_mode(adapter, port, 1); |
@@ -489,7 +489,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, | |||
489 | int port, long enable) | 489 | int port, long enable) |
490 | { | 490 | { |
491 | int result = 0; | 491 | int result = 0; |
492 | __le32 int_src; | 492 | __u32 int_src; |
493 | 493 | ||
494 | printk(KERN_INFO PFX "NETXEN: Handling PHY interrupt on port %d" | 494 | printk(KERN_INFO PFX "NETXEN: Handling PHY interrupt on port %d" |
495 | " (device enable = %d)\n", (int)port, (int)enable); | 495 | " (device enable = %d)\n", (int)port, (int)enable); |
@@ -530,7 +530,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, | |||
530 | printk(KERN_INFO PFX "autoneg_error "); | 530 | printk(KERN_INFO PFX "autoneg_error "); |
531 | if ((netxen_get_phy_int_speed_changed(int_src)) | 531 | if ((netxen_get_phy_int_speed_changed(int_src)) |
532 | || (netxen_get_phy_int_link_status_changed(int_src))) { | 532 | || (netxen_get_phy_int_link_status_changed(int_src))) { |
533 | __le32 status; | 533 | __u32 status; |
534 | 534 | ||
535 | printk(KERN_INFO PFX | 535 | printk(KERN_INFO PFX |
536 | "speed_changed or link status changed"); | 536 | "speed_changed or link status changed"); |
@@ -583,9 +583,9 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, | |||
583 | int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | 583 | int netxen_niu_macaddr_get(struct netxen_adapter *adapter, |
584 | int phy, netxen_ethernet_macaddr_t * addr) | 584 | int phy, netxen_ethernet_macaddr_t * addr) |
585 | { | 585 | { |
586 | u64 result = 0; | 586 | u32 stationhigh; |
587 | __le32 stationhigh; | 587 | u32 stationlow; |
588 | __le32 stationlow; | 588 | u8 val[8]; |
589 | 589 | ||
590 | if (addr == NULL) | 590 | if (addr == NULL) |
591 | return -EINVAL; | 591 | return -EINVAL; |
@@ -598,10 +598,10 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | |||
598 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), | 598 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), |
599 | &stationlow, 4)) | 599 | &stationlow, 4)) |
600 | return -EIO; | 600 | return -EIO; |
601 | ((__le32 *)val)[1] = cpu_to_le32(stationhigh); | ||
602 | ((__le32 *)val)[0] = cpu_to_le32(stationlow); | ||
601 | 603 | ||
602 | result = (u64) netxen_gb_get_stationaddress_low(stationlow); | 604 | memcpy(addr, val + 2, 6); |
603 | result |= (u64) stationhigh << 16; | ||
604 | memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t)); | ||
605 | 605 | ||
606 | return 0; | 606 | return 0; |
607 | } | 607 | } |
@@ -613,24 +613,25 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | |||
613 | int netxen_niu_macaddr_set(struct netxen_port *port, | 613 | int netxen_niu_macaddr_set(struct netxen_port *port, |
614 | netxen_ethernet_macaddr_t addr) | 614 | netxen_ethernet_macaddr_t addr) |
615 | { | 615 | { |
616 | __le32 temp = 0; | 616 | u8 temp[4]; |
617 | u32 val; | ||
617 | struct netxen_adapter *adapter = port->adapter; | 618 | struct netxen_adapter *adapter = port->adapter; |
618 | int phy = port->portnum; | 619 | int phy = port->portnum; |
619 | unsigned char mac_addr[6]; | 620 | unsigned char mac_addr[6]; |
620 | int i; | 621 | int i; |
621 | 622 | ||
622 | for (i = 0; i < 10; i++) { | 623 | for (i = 0; i < 10; i++) { |
623 | memcpy(&temp, addr, 2); | 624 | temp[0] = temp[1] = 0; |
624 | temp <<= 16; | 625 | memcpy(temp + 2, addr, 2); |
626 | val = le32_to_cpu(*(__le32 *)temp); | ||
625 | if (netxen_nic_hw_write_wx | 627 | if (netxen_nic_hw_write_wx |
626 | (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &temp, 4)) | 628 | (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &val, 4)) |
627 | return -EIO; | 629 | return -EIO; |
628 | 630 | ||
629 | temp = 0; | 631 | memcpy(temp, ((u8 *) addr) + 2, sizeof(__le32)); |
630 | 632 | val = le32_to_cpu(*(__le32 *)temp); | |
631 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); | ||
632 | if (netxen_nic_hw_write_wx | 633 | if (netxen_nic_hw_write_wx |
633 | (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &temp, 4)) | 634 | (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4)) |
634 | return -2; | 635 | return -2; |
635 | 636 | ||
636 | netxen_niu_macaddr_get(adapter, phy, | 637 | netxen_niu_macaddr_get(adapter, phy, |
@@ -659,9 +660,9 @@ int netxen_niu_macaddr_set(struct netxen_port *port, | |||
659 | int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | 660 | int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, |
660 | int port, netxen_niu_gbe_ifmode_t mode) | 661 | int port, netxen_niu_gbe_ifmode_t mode) |
661 | { | 662 | { |
662 | __le32 mac_cfg0; | 663 | __u32 mac_cfg0; |
663 | __le32 mac_cfg1; | 664 | __u32 mac_cfg1; |
664 | __le32 mii_cfg; | 665 | __u32 mii_cfg; |
665 | 666 | ||
666 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 667 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
667 | return -EINVAL; | 668 | return -EINVAL; |
@@ -736,7 +737,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
736 | /* Disable a GbE interface */ | 737 | /* Disable a GbE interface */ |
737 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) | 738 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) |
738 | { | 739 | { |
739 | __le32 mac_cfg0; | 740 | __u32 mac_cfg0; |
740 | 741 | ||
741 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 742 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
742 | return -EINVAL; | 743 | return -EINVAL; |
@@ -752,7 +753,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) | |||
752 | /* Disable an XG interface */ | 753 | /* Disable an XG interface */ |
753 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) | 754 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) |
754 | { | 755 | { |
755 | __le32 mac_cfg; | 756 | __u32 mac_cfg; |
756 | 757 | ||
757 | if (port != 0) | 758 | if (port != 0) |
758 | return -EINVAL; | 759 | return -EINVAL; |
@@ -769,7 +770,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) | |||
769 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, | 770 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, |
770 | netxen_niu_prom_mode_t mode) | 771 | netxen_niu_prom_mode_t mode) |
771 | { | 772 | { |
772 | __le32 reg; | 773 | __u32 reg; |
773 | 774 | ||
774 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 775 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
775 | return -EINVAL; | 776 | return -EINVAL; |
@@ -826,22 +827,21 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, | |||
826 | int netxen_niu_xg_macaddr_set(struct netxen_port *port, | 827 | int netxen_niu_xg_macaddr_set(struct netxen_port *port, |
827 | netxen_ethernet_macaddr_t addr) | 828 | netxen_ethernet_macaddr_t addr) |
828 | { | 829 | { |
829 | __le32 temp = 0; | 830 | u8 temp[4]; |
831 | u32 val; | ||
830 | struct netxen_adapter *adapter = port->adapter; | 832 | struct netxen_adapter *adapter = port->adapter; |
831 | 833 | ||
832 | memcpy(&temp, addr, 2); | 834 | temp[0] = temp[1] = 0; |
833 | temp = cpu_to_le32(temp); | 835 | memcpy(temp + 2, addr, 2); |
834 | temp <<= 16; | 836 | val = le32_to_cpu(*(__le32 *)temp); |
835 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, | 837 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, |
836 | &temp, 4)) | 838 | &val, 4)) |
837 | return -EIO; | 839 | return -EIO; |
838 | 840 | ||
839 | temp = 0; | ||
840 | |||
841 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); | 841 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); |
842 | temp = cpu_to_le32(temp); | 842 | val = le32_to_cpu(*(__le32 *)temp); |
843 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, | 843 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, |
844 | &temp, 4)) | 844 | &val, 4)) |
845 | return -EIO; | 845 | return -EIO; |
846 | 846 | ||
847 | return 0; | 847 | return 0; |
@@ -854,9 +854,9 @@ int netxen_niu_xg_macaddr_set(struct netxen_port *port, | |||
854 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, | 854 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, |
855 | netxen_ethernet_macaddr_t * addr) | 855 | netxen_ethernet_macaddr_t * addr) |
856 | { | 856 | { |
857 | __le32 stationhigh; | 857 | u32 stationhigh; |
858 | __le32 stationlow; | 858 | u32 stationlow; |
859 | u64 result; | 859 | u8 val[8]; |
860 | 860 | ||
861 | if (addr == NULL) | 861 | if (addr == NULL) |
862 | return -EINVAL; | 862 | return -EINVAL; |
@@ -869,10 +869,10 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, | |||
869 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, | 869 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, |
870 | &stationlow, 4)) | 870 | &stationlow, 4)) |
871 | return -EIO; | 871 | return -EIO; |
872 | ((__le32 *)val)[1] = cpu_to_le32(stationhigh); | ||
873 | ((__le32 *)val)[0] = cpu_to_le32(stationlow); | ||
872 | 874 | ||
873 | result = ((u64) stationlow) >> 16; | 875 | memcpy(addr, val + 2, 6); |
874 | result |= (u64) stationhigh << 16; | ||
875 | memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t)); | ||
876 | 876 | ||
877 | return 0; | 877 | return 0; |
878 | } | 878 | } |
@@ -880,7 +880,7 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, | |||
880 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | 880 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, |
881 | int port, netxen_niu_prom_mode_t mode) | 881 | int port, netxen_niu_prom_mode_t mode) |
882 | { | 882 | { |
883 | __le32 reg; | 883 | __u32 reg; |
884 | 884 | ||
885 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 885 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
886 | return -EINVAL; | 886 | return -EINVAL; |
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index ebb6aa39f9c7..8ea2fc1b96cb 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1925,6 +1925,8 @@ spider_net_stop(struct net_device *netdev) | |||
1925 | /* release chains */ | 1925 | /* release chains */ |
1926 | spider_net_release_tx_chain(card, 1); | 1926 | spider_net_release_tx_chain(card, 1); |
1927 | 1927 | ||
1928 | spider_net_free_rx_chain_contents(card); | ||
1929 | |||
1928 | spider_net_free_chain(card, &card->tx_chain); | 1930 | spider_net_free_chain(card, &card->tx_chain); |
1929 | spider_net_free_chain(card, &card->rx_chain); | 1931 | spider_net_free_chain(card, &card->rx_chain); |
1930 | 1932 | ||