diff options
author | Adrian Bunk <bunk@kernel.org> | 2007-11-05 12:07:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:45 -0500 |
commit | 993fb90c5b1727342362c43ed4e29c26682f54f7 (patch) | |
tree | c151fa32d24fd1725d425561874b12e9b701421e | |
parent | 3957d63da0067ad6a7dc8261b7eeb824f9dc42b4 (diff) |
drivers/net/netxen/: cleanups
This patch contains the following cleanups:
- static functions in .c files shouldn't be marked inline
- make needlessly global code static
- #if 0 unused code
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 14 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 19 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.h | 8 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 70 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_isr.c | 7 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 9 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_niu.c | 26 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_phan_reg.h | 7 |
8 files changed, 76 insertions, 84 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index a8f63c47b3cd..b9d2191e03c9 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1018,14 +1018,8 @@ int netxen_niu_xgbe_enable_phy_interrupts(struct netxen_adapter *adapter); | |||
1018 | int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter); | 1018 | int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter); |
1019 | int netxen_niu_xgbe_disable_phy_interrupts(struct netxen_adapter *adapter); | 1019 | int netxen_niu_xgbe_disable_phy_interrupts(struct netxen_adapter *adapter); |
1020 | int netxen_niu_gbe_disable_phy_interrupts(struct netxen_adapter *adapter); | 1020 | int netxen_niu_gbe_disable_phy_interrupts(struct netxen_adapter *adapter); |
1021 | int netxen_niu_xgbe_clear_phy_interrupts(struct netxen_adapter *adapter); | ||
1022 | int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter); | ||
1023 | void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter); | 1021 | void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter); |
1024 | void netxen_nic_gbe_handle_phy_intr(struct netxen_adapter *adapter); | 1022 | void netxen_nic_gbe_handle_phy_intr(struct netxen_adapter *adapter); |
1025 | void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, int port, | ||
1026 | long enable); | ||
1027 | void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port, | ||
1028 | long enable); | ||
1029 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, | 1023 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, |
1030 | __u32 * readval); | 1024 | __u32 * readval); |
1031 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, | 1025 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, |
@@ -1048,7 +1042,6 @@ int netxen_nic_hw_write_wx(struct netxen_adapter *adapter, u64 off, void *data, | |||
1048 | int len); | 1042 | int len); |
1049 | void netxen_crb_writelit_adapter(struct netxen_adapter *adapter, | 1043 | void netxen_crb_writelit_adapter(struct netxen_adapter *adapter, |
1050 | unsigned long off, int data); | 1044 | unsigned long off, int data); |
1051 | int netxen_nic_erase_pxe(struct netxen_adapter *adapter); | ||
1052 | 1045 | ||
1053 | /* Functions from netxen_nic_init.c */ | 1046 | /* Functions from netxen_nic_init.c */ |
1054 | void netxen_free_adapter_offload(struct netxen_adapter *adapter); | 1047 | void netxen_free_adapter_offload(struct netxen_adapter *adapter); |
@@ -1067,15 +1060,10 @@ int netxen_flash_erase_secondary(struct netxen_adapter *adapter); | |||
1067 | int netxen_flash_erase_primary(struct netxen_adapter *adapter); | 1060 | int netxen_flash_erase_primary(struct netxen_adapter *adapter); |
1068 | void netxen_halt_pegs(struct netxen_adapter *adapter); | 1061 | void netxen_halt_pegs(struct netxen_adapter *adapter); |
1069 | 1062 | ||
1070 | int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data); | ||
1071 | int netxen_rom_se(struct netxen_adapter *adapter, int addr); | 1063 | int netxen_rom_se(struct netxen_adapter *adapter, int addr); |
1072 | int netxen_do_rom_se(struct netxen_adapter *adapter, int addr); | ||
1073 | 1064 | ||
1074 | /* Functions from netxen_nic_isr.c */ | 1065 | /* Functions from netxen_nic_isr.c */ |
1075 | int netxen_nic_link_ok(struct netxen_adapter *adapter); | 1066 | int netxen_nic_link_ok(struct netxen_adapter *adapter); |
1076 | void netxen_nic_isr_other(struct netxen_adapter *adapter); | ||
1077 | void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link); | ||
1078 | void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable); | ||
1079 | void netxen_initialize_adapter_sw(struct netxen_adapter *adapter); | 1067 | void netxen_initialize_adapter_sw(struct netxen_adapter *adapter); |
1080 | void netxen_initialize_adapter_hw(struct netxen_adapter *adapter); | 1068 | void netxen_initialize_adapter_hw(struct netxen_adapter *adapter); |
1081 | void *netxen_alloc(struct pci_dev *pdev, size_t sz, dma_addr_t * ptr, | 1069 | void *netxen_alloc(struct pci_dev *pdev, size_t sz, dma_addr_t * ptr, |
@@ -1092,8 +1080,6 @@ int netxen_nic_tx_has_work(struct netxen_adapter *adapter); | |||
1092 | void netxen_watchdog_task(struct work_struct *work); | 1080 | void netxen_watchdog_task(struct work_struct *work); |
1093 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, | 1081 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, |
1094 | u32 ringid); | 1082 | u32 ringid); |
1095 | void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, u32 ctx, | ||
1096 | u32 ringid); | ||
1097 | int netxen_process_cmd_ring(unsigned long data); | 1083 | int netxen_process_cmd_ring(unsigned long data); |
1098 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); | 1084 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); |
1099 | void netxen_nic_set_multi(struct net_device *netdev); | 1085 | void netxen_nic_set_multi(struct net_device *netdev); |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 2c19b8df98fa..b2c78612beed 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include "netxen_nic.h" | 34 | #include "netxen_nic.h" |
35 | #include "netxen_nic_hw.h" | 35 | #include "netxen_nic_hw.h" |
36 | #define DEFINE_GLOBAL_RECV_CRB | ||
37 | #include "netxen_nic_phan_reg.h" | 36 | #include "netxen_nic_phan_reg.h" |
38 | 37 | ||
39 | 38 | ||
@@ -244,12 +243,15 @@ struct netxen_recv_crb recv_crb_registers[] = { | |||
244 | }, | 243 | }, |
245 | }; | 244 | }; |
246 | 245 | ||
247 | u64 ctx_addr_sig_regs[][3] = { | 246 | static u64 ctx_addr_sig_regs[][3] = { |
248 | {NETXEN_NIC_REG(0x188), NETXEN_NIC_REG(0x18c), NETXEN_NIC_REG(0x1c0)}, | 247 | {NETXEN_NIC_REG(0x188), NETXEN_NIC_REG(0x18c), NETXEN_NIC_REG(0x1c0)}, |
249 | {NETXEN_NIC_REG(0x190), NETXEN_NIC_REG(0x194), NETXEN_NIC_REG(0x1c4)}, | 248 | {NETXEN_NIC_REG(0x190), NETXEN_NIC_REG(0x194), NETXEN_NIC_REG(0x1c4)}, |
250 | {NETXEN_NIC_REG(0x198), NETXEN_NIC_REG(0x19c), NETXEN_NIC_REG(0x1c8)}, | 249 | {NETXEN_NIC_REG(0x198), NETXEN_NIC_REG(0x19c), NETXEN_NIC_REG(0x1c8)}, |
251 | {NETXEN_NIC_REG(0x1a0), NETXEN_NIC_REG(0x1a4), NETXEN_NIC_REG(0x1cc)} | 250 | {NETXEN_NIC_REG(0x1a0), NETXEN_NIC_REG(0x1a4), NETXEN_NIC_REG(0x1cc)} |
252 | }; | 251 | }; |
252 | #define CRB_CTX_ADDR_REG_LO(FUNC_ID) (ctx_addr_sig_regs[FUNC_ID][0]) | ||
253 | #define CRB_CTX_ADDR_REG_HI(FUNC_ID) (ctx_addr_sig_regs[FUNC_ID][2]) | ||
254 | #define CRB_CTX_SIGNATURE_REG(FUNC_ID) (ctx_addr_sig_regs[FUNC_ID][1]) | ||
253 | 255 | ||
254 | 256 | ||
255 | /* PCI Windowing for DDR regions. */ | 257 | /* PCI Windowing for DDR regions. */ |
@@ -279,8 +281,8 @@ u64 ctx_addr_sig_regs[][3] = { | |||
279 | 281 | ||
280 | #define NETXEN_NIC_WINDOW_MARGIN 0x100000 | 282 | #define NETXEN_NIC_WINDOW_MARGIN 0x100000 |
281 | 283 | ||
282 | unsigned long netxen_nic_pci_set_window(struct netxen_adapter *adapter, | 284 | static unsigned long netxen_nic_pci_set_window(struct netxen_adapter *adapter, |
283 | unsigned long long addr); | 285 | unsigned long long addr); |
284 | void netxen_free_hw_resources(struct netxen_adapter *adapter); | 286 | void netxen_free_hw_resources(struct netxen_adapter *adapter); |
285 | 287 | ||
286 | int netxen_nic_set_mac(struct net_device *netdev, void *p) | 288 | int netxen_nic_set_mac(struct net_device *netdev, void *p) |
@@ -886,11 +888,10 @@ void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 * value) | |||
886 | netxen_nic_pci_change_crbwindow(adapter, 1); | 888 | netxen_nic_pci_change_crbwindow(adapter, 1); |
887 | } | 889 | } |
888 | 890 | ||
889 | int netxen_pci_set_window_warning_count = 0; | 891 | static int netxen_pci_set_window_warning_count = 0; |
890 | 892 | ||
891 | unsigned long | 893 | static unsigned long netxen_nic_pci_set_window(struct netxen_adapter *adapter, |
892 | netxen_nic_pci_set_window(struct netxen_adapter *adapter, | 894 | unsigned long long addr) |
893 | unsigned long long addr) | ||
894 | { | 895 | { |
895 | static int ddr_mn_window = -1; | 896 | static int ddr_mn_window = -1; |
896 | static int qdr_sn_window = -1; | 897 | static int qdr_sn_window = -1; |
@@ -952,6 +953,7 @@ netxen_nic_pci_set_window(struct netxen_adapter *adapter, | |||
952 | return addr; | 953 | return addr; |
953 | } | 954 | } |
954 | 955 | ||
956 | #if 0 | ||
955 | int | 957 | int |
956 | netxen_nic_erase_pxe(struct netxen_adapter *adapter) | 958 | netxen_nic_erase_pxe(struct netxen_adapter *adapter) |
957 | { | 959 | { |
@@ -962,6 +964,7 @@ netxen_nic_erase_pxe(struct netxen_adapter *adapter) | |||
962 | } | 964 | } |
963 | return 0; | 965 | return 0; |
964 | } | 966 | } |
967 | #endif /* 0 */ | ||
965 | 968 | ||
966 | int netxen_nic_get_board_info(struct netxen_adapter *adapter) | 969 | int netxen_nic_get_board_info(struct netxen_adapter *adapter) |
967 | { | 970 | { |
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h index 245bf13c7ba2..197e1fc7333d 100644 --- a/drivers/net/netxen/netxen_nic_hw.h +++ b/drivers/net/netxen/netxen_nic_hw.h | |||
@@ -520,15 +520,11 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
520 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | 520 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, |
521 | netxen_niu_prom_mode_t mode); | 521 | netxen_niu_prom_mode_t mode); |
522 | 522 | ||
523 | /* get/set the MAC address for a given MAC */ | 523 | /* set the MAC address for a given MAC */ |
524 | int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | ||
525 | netxen_ethernet_macaddr_t * addr); | ||
526 | int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | 524 | int netxen_niu_macaddr_set(struct netxen_adapter *adapter, |
527 | netxen_ethernet_macaddr_t addr); | 525 | netxen_ethernet_macaddr_t addr); |
528 | 526 | ||
529 | /* XG versons */ | 527 | /* XG version */ |
530 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, | ||
531 | netxen_ethernet_macaddr_t * addr); | ||
532 | int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | 528 | int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, |
533 | netxen_ethernet_macaddr_t addr); | 529 | netxen_ethernet_macaddr_t addr); |
534 | 530 | ||
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 485ff9398910..68c985f3e0b7 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -54,13 +54,17 @@ static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM]; | |||
54 | 54 | ||
55 | #define NETXEN_NIC_XDMA_RESET 0x8000ff | 55 | #define NETXEN_NIC_XDMA_RESET 0x8000ff |
56 | 56 | ||
57 | static inline void | 57 | static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, |
58 | netxen_nic_locked_write_reg(struct netxen_adapter *adapter, | 58 | uint32_t ctx, uint32_t ringid); |
59 | unsigned long off, int *data) | 59 | |
60 | #if 0 | ||
61 | static void netxen_nic_locked_write_reg(struct netxen_adapter *adapter, | ||
62 | unsigned long off, int *data) | ||
60 | { | 63 | { |
61 | void __iomem *addr = pci_base_offset(adapter, off); | 64 | void __iomem *addr = pci_base_offset(adapter, off); |
62 | writel(*data, addr); | 65 | writel(*data, addr); |
63 | } | 66 | } |
67 | #endif /* 0 */ | ||
64 | 68 | ||
65 | static void crb_addr_transform_setup(void) | 69 | static void crb_addr_transform_setup(void) |
66 | { | 70 | { |
@@ -255,7 +259,7 @@ void netxen_initialize_adapter_ops(struct netxen_adapter *adapter) | |||
255 | * netxen_decode_crb_addr(0 - utility to translate from internal Phantom CRB | 259 | * netxen_decode_crb_addr(0 - utility to translate from internal Phantom CRB |
256 | * address to external PCI CRB address. | 260 | * address to external PCI CRB address. |
257 | */ | 261 | */ |
258 | u32 netxen_decode_crb_addr(u32 addr) | 262 | static u32 netxen_decode_crb_addr(u32 addr) |
259 | { | 263 | { |
260 | int i; | 264 | int i; |
261 | u32 base_addr, offset, pci_base; | 265 | u32 base_addr, offset, pci_base; |
@@ -282,7 +286,7 @@ static long rom_max_timeout = 100; | |||
282 | static long rom_lock_timeout = 10000; | 286 | static long rom_lock_timeout = 10000; |
283 | static long rom_write_timeout = 700; | 287 | static long rom_write_timeout = 700; |
284 | 288 | ||
285 | static inline int rom_lock(struct netxen_adapter *adapter) | 289 | static int rom_lock(struct netxen_adapter *adapter) |
286 | { | 290 | { |
287 | int iter; | 291 | int iter; |
288 | u32 done = 0; | 292 | u32 done = 0; |
@@ -312,7 +316,7 @@ static inline int rom_lock(struct netxen_adapter *adapter) | |||
312 | return 0; | 316 | return 0; |
313 | } | 317 | } |
314 | 318 | ||
315 | int netxen_wait_rom_done(struct netxen_adapter *adapter) | 319 | static int netxen_wait_rom_done(struct netxen_adapter *adapter) |
316 | { | 320 | { |
317 | long timeout = 0; | 321 | long timeout = 0; |
318 | long done = 0; | 322 | long done = 0; |
@@ -329,7 +333,7 @@ int netxen_wait_rom_done(struct netxen_adapter *adapter) | |||
329 | return 0; | 333 | return 0; |
330 | } | 334 | } |
331 | 335 | ||
332 | static inline int netxen_rom_wren(struct netxen_adapter *adapter) | 336 | static int netxen_rom_wren(struct netxen_adapter *adapter) |
333 | { | 337 | { |
334 | /* Set write enable latch in ROM status register */ | 338 | /* Set write enable latch in ROM status register */ |
335 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); | 339 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); |
@@ -341,15 +345,15 @@ static inline int netxen_rom_wren(struct netxen_adapter *adapter) | |||
341 | return 0; | 345 | return 0; |
342 | } | 346 | } |
343 | 347 | ||
344 | static inline unsigned int netxen_rdcrbreg(struct netxen_adapter *adapter, | 348 | static unsigned int netxen_rdcrbreg(struct netxen_adapter *adapter, |
345 | unsigned int addr) | 349 | unsigned int addr) |
346 | { | 350 | { |
347 | unsigned int data = 0xdeaddead; | 351 | unsigned int data = 0xdeaddead; |
348 | data = netxen_nic_reg_read(adapter, addr); | 352 | data = netxen_nic_reg_read(adapter, addr); |
349 | return data; | 353 | return data; |
350 | } | 354 | } |
351 | 355 | ||
352 | static inline int netxen_do_rom_rdsr(struct netxen_adapter *adapter) | 356 | static int netxen_do_rom_rdsr(struct netxen_adapter *adapter) |
353 | { | 357 | { |
354 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, | 358 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, |
355 | M25P_INSTR_RDSR); | 359 | M25P_INSTR_RDSR); |
@@ -359,7 +363,7 @@ static inline int netxen_do_rom_rdsr(struct netxen_adapter *adapter) | |||
359 | return netxen_rdcrbreg(adapter, NETXEN_ROMUSB_ROM_RDATA); | 363 | return netxen_rdcrbreg(adapter, NETXEN_ROMUSB_ROM_RDATA); |
360 | } | 364 | } |
361 | 365 | ||
362 | static inline void netxen_rom_unlock(struct netxen_adapter *adapter) | 366 | static void netxen_rom_unlock(struct netxen_adapter *adapter) |
363 | { | 367 | { |
364 | u32 val; | 368 | u32 val; |
365 | 369 | ||
@@ -368,7 +372,7 @@ static inline void netxen_rom_unlock(struct netxen_adapter *adapter) | |||
368 | 372 | ||
369 | } | 373 | } |
370 | 374 | ||
371 | int netxen_rom_wip_poll(struct netxen_adapter *adapter) | 375 | static int netxen_rom_wip_poll(struct netxen_adapter *adapter) |
372 | { | 376 | { |
373 | long timeout = 0; | 377 | long timeout = 0; |
374 | long wip = 1; | 378 | long wip = 1; |
@@ -385,8 +389,8 @@ int netxen_rom_wip_poll(struct netxen_adapter *adapter) | |||
385 | return 0; | 389 | return 0; |
386 | } | 390 | } |
387 | 391 | ||
388 | static inline int do_rom_fast_write(struct netxen_adapter *adapter, int addr, | 392 | static int do_rom_fast_write(struct netxen_adapter *adapter, int addr, |
389 | int data) | 393 | int data) |
390 | { | 394 | { |
391 | if (netxen_rom_wren(adapter)) { | 395 | if (netxen_rom_wren(adapter)) { |
392 | return -1; | 396 | return -1; |
@@ -404,8 +408,8 @@ static inline int do_rom_fast_write(struct netxen_adapter *adapter, int addr, | |||
404 | return netxen_rom_wip_poll(adapter); | 408 | return netxen_rom_wip_poll(adapter); |
405 | } | 409 | } |
406 | 410 | ||
407 | static inline int | 411 | static int do_rom_fast_read(struct netxen_adapter *adapter, |
408 | do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | 412 | int addr, int *valp) |
409 | { | 413 | { |
410 | cond_resched(); | 414 | cond_resched(); |
411 | 415 | ||
@@ -427,9 +431,8 @@ do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | |||
427 | return 0; | 431 | return 0; |
428 | } | 432 | } |
429 | 433 | ||
430 | static inline int | 434 | static int do_rom_fast_read_words(struct netxen_adapter *adapter, int addr, |
431 | do_rom_fast_read_words(struct netxen_adapter *adapter, int addr, | 435 | u8 *bytes, size_t size) |
432 | u8 *bytes, size_t size) | ||
433 | { | 436 | { |
434 | int addridx; | 437 | int addridx; |
435 | int ret = 0; | 438 | int ret = 0; |
@@ -473,6 +476,7 @@ int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | |||
473 | return ret; | 476 | return ret; |
474 | } | 477 | } |
475 | 478 | ||
479 | #if 0 | ||
476 | int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data) | 480 | int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data) |
477 | { | 481 | { |
478 | int ret = 0; | 482 | int ret = 0; |
@@ -484,9 +488,10 @@ int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data) | |||
484 | netxen_rom_unlock(adapter); | 488 | netxen_rom_unlock(adapter); |
485 | return ret; | 489 | return ret; |
486 | } | 490 | } |
491 | #endif /* 0 */ | ||
487 | 492 | ||
488 | static inline int do_rom_fast_write_words(struct netxen_adapter *adapter, | 493 | static int do_rom_fast_write_words(struct netxen_adapter *adapter, |
489 | int addr, u8 *bytes, size_t size) | 494 | int addr, u8 *bytes, size_t size) |
490 | { | 495 | { |
491 | int addridx = addr; | 496 | int addridx = addr; |
492 | int ret = 0; | 497 | int ret = 0; |
@@ -548,7 +553,7 @@ int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, | |||
548 | return ret; | 553 | return ret; |
549 | } | 554 | } |
550 | 555 | ||
551 | int netxen_rom_wrsr(struct netxen_adapter *adapter, int data) | 556 | static int netxen_rom_wrsr(struct netxen_adapter *adapter, int data) |
552 | { | 557 | { |
553 | int ret; | 558 | int ret; |
554 | 559 | ||
@@ -567,7 +572,7 @@ int netxen_rom_wrsr(struct netxen_adapter *adapter, int data) | |||
567 | return netxen_rom_wip_poll(adapter); | 572 | return netxen_rom_wip_poll(adapter); |
568 | } | 573 | } |
569 | 574 | ||
570 | int netxen_rom_rdsr(struct netxen_adapter *adapter) | 575 | static int netxen_rom_rdsr(struct netxen_adapter *adapter) |
571 | { | 576 | { |
572 | int ret; | 577 | int ret; |
573 | 578 | ||
@@ -632,7 +637,7 @@ out_kfree: | |||
632 | return ret; | 637 | return ret; |
633 | } | 638 | } |
634 | 639 | ||
635 | int netxen_do_rom_se(struct netxen_adapter *adapter, int addr) | 640 | static int netxen_do_rom_se(struct netxen_adapter *adapter, int addr) |
636 | { | 641 | { |
637 | netxen_rom_wren(adapter); | 642 | netxen_rom_wren(adapter); |
638 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); | 643 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); |
@@ -646,7 +651,7 @@ int netxen_do_rom_se(struct netxen_adapter *adapter, int addr) | |||
646 | return netxen_rom_wip_poll(adapter); | 651 | return netxen_rom_wip_poll(adapter); |
647 | } | 652 | } |
648 | 653 | ||
649 | void check_erased_flash(struct netxen_adapter *adapter, int addr) | 654 | static void check_erased_flash(struct netxen_adapter *adapter, int addr) |
650 | { | 655 | { |
651 | int i; | 656 | int i; |
652 | int val; | 657 | int val; |
@@ -682,8 +687,8 @@ int netxen_rom_se(struct netxen_adapter *adapter, int addr) | |||
682 | return ret; | 687 | return ret; |
683 | } | 688 | } |
684 | 689 | ||
685 | int | 690 | static int netxen_flash_erase_sections(struct netxen_adapter *adapter, |
686 | netxen_flash_erase_sections(struct netxen_adapter *adapter, int start, int end) | 691 | int start, int end) |
687 | { | 692 | { |
688 | int ret = FLASH_SUCCESS; | 693 | int ret = FLASH_SUCCESS; |
689 | int i; | 694 | int i; |
@@ -990,7 +995,7 @@ int netxen_nic_rx_has_work(struct netxen_adapter *adapter) | |||
990 | return 0; | 995 | return 0; |
991 | } | 996 | } |
992 | 997 | ||
993 | static inline int netxen_nic_check_temp(struct netxen_adapter *adapter) | 998 | static int netxen_nic_check_temp(struct netxen_adapter *adapter) |
994 | { | 999 | { |
995 | struct net_device *netdev = adapter->netdev; | 1000 | struct net_device *netdev = adapter->netdev; |
996 | uint32_t temp, temp_state, temp_val; | 1001 | uint32_t temp, temp_state, temp_val; |
@@ -1064,9 +1069,8 @@ void netxen_watchdog_task(struct work_struct *work) | |||
1064 | * and if the number of receives exceeds RX_BUFFERS_REFILL, then we | 1069 | * and if the number of receives exceeds RX_BUFFERS_REFILL, then we |
1065 | * invoke the routine to send more rx buffers to the Phantom... | 1070 | * invoke the routine to send more rx buffers to the Phantom... |
1066 | */ | 1071 | */ |
1067 | void | 1072 | static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, |
1068 | netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | 1073 | struct status_desc *desc) |
1069 | struct status_desc *desc) | ||
1070 | { | 1074 | { |
1071 | struct pci_dev *pdev = adapter->pdev; | 1075 | struct pci_dev *pdev = adapter->pdev; |
1072 | struct net_device *netdev = adapter->netdev; | 1076 | struct net_device *netdev = adapter->netdev; |
@@ -1458,8 +1462,8 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1458 | } | 1462 | } |
1459 | } | 1463 | } |
1460 | 1464 | ||
1461 | void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ctx, | 1465 | static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, |
1462 | uint32_t ringid) | 1466 | uint32_t ctx, uint32_t ringid) |
1463 | { | 1467 | { |
1464 | struct pci_dev *pdev = adapter->ahw.pdev; | 1468 | struct pci_dev *pdev = adapter->ahw.pdev; |
1465 | struct sk_buff *skb; | 1469 | struct sk_buff *skb; |
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c index b2de6b6c2a7f..0a261de0a953 100644 --- a/drivers/net/netxen/netxen_nic_isr.c +++ b/drivers/net/netxen/netxen_nic_isr.c | |||
@@ -66,7 +66,8 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev) | |||
66 | return stats; | 66 | return stats; |
67 | } | 67 | } |
68 | 68 | ||
69 | void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link) | 69 | static void netxen_indicate_link_status(struct netxen_adapter *adapter, |
70 | u32 link) | ||
70 | { | 71 | { |
71 | struct net_device *netdev = adapter->netdev; | 72 | struct net_device *netdev = adapter->netdev; |
72 | 73 | ||
@@ -76,6 +77,7 @@ void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link) | |||
76 | netif_carrier_off(netdev); | 77 | netif_carrier_off(netdev); |
77 | } | 78 | } |
78 | 79 | ||
80 | #if 0 | ||
79 | void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) | 81 | void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) |
80 | { | 82 | { |
81 | __u32 int_src; | 83 | __u32 int_src; |
@@ -134,8 +136,9 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) | |||
134 | if (adapter->enable_phy_interrupts) | 136 | if (adapter->enable_phy_interrupts) |
135 | adapter->enable_phy_interrupts(adapter); | 137 | adapter->enable_phy_interrupts(adapter); |
136 | } | 138 | } |
139 | #endif /* 0 */ | ||
137 | 140 | ||
138 | void netxen_nic_isr_other(struct netxen_adapter *adapter) | 141 | static void netxen_nic_isr_other(struct netxen_adapter *adapter) |
139 | { | 142 | { |
140 | int portno = adapter->portnum; | 143 | int portno = adapter->portnum; |
141 | u32 val, linkup, qg_linksup; | 144 | u32 val, linkup, qg_linksup; |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 263b55e36c7a..8e7736987b94 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -89,8 +89,8 @@ MODULE_DEVICE_TABLE(pci, netxen_pci_tbl); | |||
89 | struct workqueue_struct *netxen_workq; | 89 | struct workqueue_struct *netxen_workq; |
90 | static void netxen_watchdog(unsigned long); | 90 | static void netxen_watchdog(unsigned long); |
91 | 91 | ||
92 | static inline void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter, | 92 | static void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter, |
93 | uint32_t crb_producer) | 93 | uint32_t crb_producer) |
94 | { | 94 | { |
95 | switch (adapter->portnum) { | 95 | switch (adapter->portnum) { |
96 | case 0: | 96 | case 0: |
@@ -118,8 +118,8 @@ static inline void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter | |||
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | static inline void netxen_nic_update_cmd_consumer(struct netxen_adapter *adapter, | 121 | static void netxen_nic_update_cmd_consumer(struct netxen_adapter *adapter, |
122 | u32 crb_consumer) | 122 | u32 crb_consumer) |
123 | { | 123 | { |
124 | switch (adapter->portnum) { | 124 | switch (adapter->portnum) { |
125 | case 0: | 125 | case 0: |
@@ -148,7 +148,6 @@ static inline void netxen_nic_update_cmd_consumer(struct netxen_adapter *adapter | |||
148 | } | 148 | } |
149 | 149 | ||
150 | #define ADAPTER_LIST_SIZE 12 | 150 | #define ADAPTER_LIST_SIZE 12 |
151 | int netxen_cards_found; | ||
152 | 151 | ||
153 | static void netxen_nic_disable_int(struct netxen_adapter *adapter) | 152 | static void netxen_nic_disable_int(struct netxen_adapter *adapter) |
154 | { | 153 | { |
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index d04ecb77d08c..e1086efd53c5 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | static long phy_lock_timeout = 100000000; | 41 | static long phy_lock_timeout = 100000000; |
42 | 42 | ||
43 | static inline int phy_lock(struct netxen_adapter *adapter) | 43 | static int phy_lock(struct netxen_adapter *adapter) |
44 | { | 44 | { |
45 | int i; | 45 | int i; |
46 | int done = 0, timeout = 0; | 46 | int done = 0, timeout = 0; |
@@ -68,7 +68,7 @@ static inline int phy_lock(struct netxen_adapter *adapter) | |||
68 | return 0; | 68 | return 0; |
69 | } | 69 | } |
70 | 70 | ||
71 | static inline int phy_unlock(struct netxen_adapter *adapter) | 71 | static int phy_unlock(struct netxen_adapter *adapter) |
72 | { | 72 | { |
73 | readl(pci_base_offset(adapter, NETXEN_PCIE_REG(PCIE_SEM3_UNLOCK))); | 73 | readl(pci_base_offset(adapter, NETXEN_PCIE_REG(PCIE_SEM3_UNLOCK))); |
74 | 74 | ||
@@ -300,13 +300,15 @@ int netxen_niu_gbe_disable_phy_interrupts(struct netxen_adapter *adapter) | |||
300 | return result; | 300 | return result; |
301 | } | 301 | } |
302 | 302 | ||
303 | #if 0 | ||
303 | int netxen_niu_xgbe_clear_phy_interrupts(struct netxen_adapter *adapter) | 304 | int netxen_niu_xgbe_clear_phy_interrupts(struct netxen_adapter *adapter) |
304 | { | 305 | { |
305 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_ACTIVE_INT, -1); | 306 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_ACTIVE_INT, -1); |
306 | return 0; | 307 | return 0; |
307 | } | 308 | } |
309 | #endif /* 0 */ | ||
308 | 310 | ||
309 | int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter) | 311 | static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter) |
310 | { | 312 | { |
311 | int result = 0; | 313 | int result = 0; |
312 | if (0 != | 314 | if (0 != |
@@ -322,8 +324,8 @@ int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter) | |||
322 | * netxen_niu_gbe_set_mii_mode- Set 10/100 Mbit Mode for GbE MAC | 324 | * netxen_niu_gbe_set_mii_mode- Set 10/100 Mbit Mode for GbE MAC |
323 | * | 325 | * |
324 | */ | 326 | */ |
325 | void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, | 327 | static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, |
326 | int port, long enable) | 328 | int port, long enable) |
327 | { | 329 | { |
328 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_MODE, 0x2); | 330 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_MODE, 0x2); |
329 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), | 331 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
@@ -360,8 +362,8 @@ void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, | |||
360 | /* | 362 | /* |
361 | * netxen_niu_gbe_set_gmii_mode- Set GbE Mode for GbE MAC | 363 | * netxen_niu_gbe_set_gmii_mode- Set GbE Mode for GbE MAC |
362 | */ | 364 | */ |
363 | void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, | 365 | static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, |
364 | int port, long enable) | 366 | int port, long enable) |
365 | { | 367 | { |
366 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_MODE, 0x2); | 368 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_MODE, 0x2); |
367 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), | 369 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
@@ -464,6 +466,7 @@ int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) | |||
464 | return 0; | 466 | return 0; |
465 | } | 467 | } |
466 | 468 | ||
469 | #if 0 | ||
467 | /* | 470 | /* |
468 | * netxen_niu_gbe_handle_phy_interrupt - Handles GbE PHY interrupts | 471 | * netxen_niu_gbe_handle_phy_interrupt - Handles GbE PHY interrupts |
469 | * @param enable 0 means don't enable the port | 472 | * @param enable 0 means don't enable the port |
@@ -559,13 +562,14 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, | |||
559 | } | 562 | } |
560 | return result; | 563 | return result; |
561 | } | 564 | } |
565 | #endif /* 0 */ | ||
562 | 566 | ||
563 | /* | 567 | /* |
564 | * Return the current station MAC address. | 568 | * Return the current station MAC address. |
565 | * Note that the passed-in value must already be in network byte order. | 569 | * Note that the passed-in value must already be in network byte order. |
566 | */ | 570 | */ |
567 | int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | 571 | static int netxen_niu_macaddr_get(struct netxen_adapter *adapter, |
568 | netxen_ethernet_macaddr_t * addr) | 572 | netxen_ethernet_macaddr_t * addr) |
569 | { | 573 | { |
570 | u32 stationhigh; | 574 | u32 stationhigh; |
571 | u32 stationlow; | 575 | u32 stationlow; |
@@ -636,6 +640,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | |||
636 | return 0; | 640 | return 0; |
637 | } | 641 | } |
638 | 642 | ||
643 | #if 0 | ||
639 | /* Enable a GbE interface */ | 644 | /* Enable a GbE interface */ |
640 | int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | 645 | int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, |
641 | int port, netxen_niu_gbe_ifmode_t mode) | 646 | int port, netxen_niu_gbe_ifmode_t mode) |
@@ -713,6 +718,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
713 | return -EIO; | 718 | return -EIO; |
714 | return 0; | 719 | return 0; |
715 | } | 720 | } |
721 | #endif /* 0 */ | ||
716 | 722 | ||
717 | /* Disable a GbE interface */ | 723 | /* Disable a GbE interface */ |
718 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) | 724 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) |
@@ -853,6 +859,7 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | |||
853 | return 0; | 859 | return 0; |
854 | } | 860 | } |
855 | 861 | ||
862 | #if 0 | ||
856 | /* | 863 | /* |
857 | * Return the current station MAC address. | 864 | * Return the current station MAC address. |
858 | * Note that the passed-in value must already be in network byte order. | 865 | * Note that the passed-in value must already be in network byte order. |
@@ -883,6 +890,7 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, | |||
883 | 890 | ||
884 | return 0; | 891 | return 0; |
885 | } | 892 | } |
893 | #endif /* 0 */ | ||
886 | 894 | ||
887 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | 895 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, |
888 | netxen_niu_prom_mode_t mode) | 896 | netxen_niu_prom_mode_t mode) |
diff --git a/drivers/net/netxen/netxen_nic_phan_reg.h b/drivers/net/netxen/netxen_nic_phan_reg.h index 10fe6fafa6f6..a6c28de1dbc5 100644 --- a/drivers/net/netxen/netxen_nic_phan_reg.h +++ b/drivers/net/netxen/netxen_nic_phan_reg.h | |||
@@ -165,14 +165,7 @@ struct netxen_recv_crb { | |||
165 | u32 crb_status_ring_size; | 165 | u32 crb_status_ring_size; |
166 | }; | 166 | }; |
167 | 167 | ||
168 | #if defined(DEFINE_GLOBAL_RECV_CRB) | ||
169 | #else | ||
170 | extern struct netxen_recv_crb recv_crb_registers[]; | 168 | extern struct netxen_recv_crb recv_crb_registers[]; |
171 | extern u64 ctx_addr_sig_regs[][3]; | ||
172 | #endif /* DEFINE_GLOBAL_RECEIVE_CRB */ | ||
173 | #define CRB_CTX_ADDR_REG_LO(FUNC_ID) (ctx_addr_sig_regs[FUNC_ID][0]) | ||
174 | #define CRB_CTX_ADDR_REG_HI(FUNC_ID) (ctx_addr_sig_regs[FUNC_ID][2]) | ||
175 | #define CRB_CTX_SIGNATURE_REG(FUNC_ID) (ctx_addr_sig_regs[FUNC_ID][1]) | ||
176 | 169 | ||
177 | /* | 170 | /* |
178 | * Temperature control. | 171 | * Temperature control. |