Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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