aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_init.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2007-11-05 12:07:31 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:03:45 -0500
commit993fb90c5b1727342362c43ed4e29c26682f54f7 (patch)
treec151fa32d24fd1725d425561874b12e9b701421e /drivers/net/netxen/netxen_nic_init.c
parent3957d63da0067ad6a7dc8261b7eeb824f9dc42b4 (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>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r--drivers/net/netxen/netxen_nic_init.c70
1 files changed, 37 insertions, 33 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 485ff939891..68c985f3e0b 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
57static inline void 57static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter,
58netxen_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
61static 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
65static void crb_addr_transform_setup(void) 69static 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 */
258u32 netxen_decode_crb_addr(u32 addr) 262static 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;
282static long rom_lock_timeout = 10000; 286static long rom_lock_timeout = 10000;
283static long rom_write_timeout = 700; 287static long rom_write_timeout = 700;
284 288
285static inline int rom_lock(struct netxen_adapter *adapter) 289static 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
315int netxen_wait_rom_done(struct netxen_adapter *adapter) 319static 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
332static inline int netxen_rom_wren(struct netxen_adapter *adapter) 336static 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
344static inline unsigned int netxen_rdcrbreg(struct netxen_adapter *adapter, 348static 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
352static inline int netxen_do_rom_rdsr(struct netxen_adapter *adapter) 356static 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
362static inline void netxen_rom_unlock(struct netxen_adapter *adapter) 366static 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
371int netxen_rom_wip_poll(struct netxen_adapter *adapter) 375static 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
388static inline int do_rom_fast_write(struct netxen_adapter *adapter, int addr, 392static 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
407static inline int 411static int do_rom_fast_read(struct netxen_adapter *adapter,
408do_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
430static inline int 434static int do_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
431do_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
476int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data) 480int 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
488static inline int do_rom_fast_write_words(struct netxen_adapter *adapter, 493static 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
551int netxen_rom_wrsr(struct netxen_adapter *adapter, int data) 556static 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
570int netxen_rom_rdsr(struct netxen_adapter *adapter) 575static 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
635int netxen_do_rom_se(struct netxen_adapter *adapter, int addr) 640static 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
649void check_erased_flash(struct netxen_adapter *adapter, int addr) 654static 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
685int 690static int netxen_flash_erase_sections(struct netxen_adapter *adapter,
686netxen_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
993static inline int netxen_nic_check_temp(struct netxen_adapter *adapter) 998static 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 */
1067void 1072static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid,
1068netxen_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
1461void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ctx, 1465static 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;