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

cxgb3: function namespace cleanup

Make local functions static. Remove functions that are
defined and never used. Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

stephen hemminger and committed by
David S. Miller
a5190b4e cc4ce020

+18 -289
-3
drivers/net/cxgb3/adapter.h
··· 336 336 int irq_vec_idx, const struct qset_params *p, 337 337 int ntxq, struct net_device *dev, 338 338 struct netdev_queue *netdevq); 339 - int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx, 340 - unsigned char *data); 341 - irqreturn_t t3_sge_intr_msix(int irq, void *cookie); 342 339 extern struct workqueue_struct *cxgb3_wq; 343 340 344 341 int t3_get_edc_fw(struct cphy *phy, int edc_idx, int size);
-18
drivers/net/cxgb3/common.h
··· 673 673 void t3_xgm_intr_disable(struct adapter *adapter, int idx); 674 674 void t3_port_intr_enable(struct adapter *adapter, int idx); 675 675 void t3_port_intr_disable(struct adapter *adapter, int idx); 676 - void t3_port_intr_clear(struct adapter *adapter, int idx); 677 676 int t3_slow_intr_handler(struct adapter *adapter); 678 677 int t3_phy_intr_handler(struct adapter *adapter); 679 678 ··· 688 689 int t3_check_tpsram(struct adapter *adapter, const u8 *tp_ram, 689 690 unsigned int size); 690 691 int t3_set_proto_sram(struct adapter *adap, const u8 *data); 691 - int t3_read_flash(struct adapter *adapter, unsigned int addr, 692 - unsigned int nwords, u32 *data, int byte_oriented); 693 692 int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size); 694 693 int t3_get_fw_version(struct adapter *adapter, u32 *vers); 695 694 int t3_check_fw_version(struct adapter *adapter); 696 695 int t3_init_hw(struct adapter *adapter, u32 fw_params); 697 - void mac_prep(struct cmac *mac, struct adapter *adapter, int index); 698 - void early_hw_init(struct adapter *adapter, const struct adapter_info *ai); 699 696 int t3_reset_adapter(struct adapter *adapter); 700 697 int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai, 701 698 int reset); ··· 701 706 void t3_set_vlan_accel(struct adapter *adapter, unsigned int ports, int on); 702 707 void t3_config_rss(struct adapter *adapter, unsigned int rss_config, 703 708 const u8 * cpus, const u16 *rspq); 704 - int t3_read_rss(struct adapter *adapter, u8 * lkup, u16 *map); 705 - int t3_mps_set_active_ports(struct adapter *adap, unsigned int port_mask); 706 709 int t3_cim_ctl_blk_read(struct adapter *adap, unsigned int addr, 707 710 unsigned int n, unsigned int *valp); 708 711 int t3_mc7_bd_read(struct mc7 *mc7, unsigned int start, unsigned int n, ··· 724 731 int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, 725 732 unsigned int nroutes); 726 733 void t3_mc5_intr_handler(struct mc5 *mc5); 727 - int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, unsigned int n, 728 - u32 *buf); 729 734 730 - int t3_tp_set_coalescing_size(struct adapter *adap, unsigned int size, int psh); 731 - void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size); 732 735 void t3_tp_set_offload_mode(struct adapter *adap, int enable); 733 736 void t3_tp_get_mib_stats(struct adapter *adap, struct tp_mib_stats *tps); 734 737 void t3_load_mtus(struct adapter *adap, unsigned short mtus[NMTUS], 735 738 unsigned short alpha[NCCTRL_WIN], 736 739 unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap); 737 - void t3_read_hw_mtus(struct adapter *adap, unsigned short mtus[NMTUS]); 738 - void t3_get_cong_cntl_tab(struct adapter *adap, 739 - unsigned short incr[NMTUS][NCCTRL_WIN]); 740 740 void t3_config_trace_filter(struct adapter *adapter, 741 741 const struct trace_params *tp, int filter_index, 742 742 int invert, int enable); ··· 755 769 int t3_sge_disable_fl(struct adapter *adapter, unsigned int id); 756 770 int t3_sge_disable_rspcntxt(struct adapter *adapter, unsigned int id); 757 771 int t3_sge_disable_cqcntxt(struct adapter *adapter, unsigned int id); 758 - int t3_sge_read_ecntxt(struct adapter *adapter, unsigned int id, u32 data[4]); 759 - int t3_sge_read_fl(struct adapter *adapter, unsigned int id, u32 data[4]); 760 - int t3_sge_read_cq(struct adapter *adapter, unsigned int id, u32 data[4]); 761 - int t3_sge_read_rspq(struct adapter *adapter, unsigned int id, u32 data[4]); 762 772 int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op, 763 773 unsigned int credits); 764 774
-3
drivers/net/cxgb3/cxgb3_defs.h
··· 43 43 44 44 void *cxgb_alloc_mem(unsigned long size); 45 45 void cxgb_free_mem(void *addr); 46 - void cxgb_neigh_update(struct neighbour *neigh); 47 - void cxgb_redirect(struct dst_entry *old, struct dst_entry *new); 48 46 49 47 /* 50 48 * Map an ATID or STID to their entries in the corresponding TID tables. ··· 109 111 return &e->t3c_tid; 110 112 } 111 113 112 - int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n); 113 114 int attach_t3cdev(struct t3cdev *dev); 114 115 void detach_t3cdev(struct t3cdev *dev); 115 116 #endif
+6 -3
drivers/net/cxgb3/cxgb3_offload.c
··· 60 60 static const unsigned int MAX_ATIDS = 64 * 1024; 61 61 static const unsigned int ATID_BASE = 0x10000; 62 62 63 + static void cxgb_neigh_update(struct neighbour *neigh); 64 + static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new); 65 + 63 66 static inline int offload_activated(struct t3cdev *tdev) 64 67 { 65 68 const struct adapter *adapter = tdev2adap(tdev); ··· 1018 1015 /* 1019 1016 * T3CDEV's receive method. 1020 1017 */ 1021 - int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n) 1018 + static int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n) 1022 1019 { 1023 1020 while (n--) { 1024 1021 struct sk_buff *skb = *skbs++; ··· 1073 1070 return 0; 1074 1071 } 1075 1072 1076 - void cxgb_neigh_update(struct neighbour *neigh) 1073 + static void cxgb_neigh_update(struct neighbour *neigh) 1077 1074 { 1078 1075 struct net_device *dev = neigh->dev; 1079 1076 ··· 1107 1104 tdev->send(tdev, skb); 1108 1105 } 1109 1106 1110 - void cxgb_redirect(struct dst_entry *old, struct dst_entry *new) 1107 + static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new) 1111 1108 { 1112 1109 struct net_device *olddev, *newdev; 1113 1110 struct tid_info *ti;
-38
drivers/net/cxgb3/mc5.c
··· 374 374 return err; 375 375 } 376 376 377 - /* 378 - * read_mc5_range - dump a part of the memory managed by MC5 379 - * @mc5: the MC5 handle 380 - * @start: the start address for the dump 381 - * @n: number of 72-bit words to read 382 - * @buf: result buffer 383 - * 384 - * Read n 72-bit words from MC5 memory from the given start location. 385 - */ 386 - int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, 387 - unsigned int n, u32 *buf) 388 - { 389 - u32 read_cmd; 390 - int err = 0; 391 - struct adapter *adap = mc5->adapter; 392 - 393 - if (mc5->part_type == IDT75P52100) 394 - read_cmd = IDT_CMD_READ; 395 - else if (mc5->part_type == IDT75N43102) 396 - read_cmd = IDT4_CMD_READ; 397 - else 398 - return -EINVAL; 399 - 400 - mc5_dbgi_mode_enable(mc5); 401 - 402 - while (n--) { 403 - t3_write_reg(adap, A_MC5_DB_DBGI_REQ_ADDR0, start++); 404 - if (mc5_cmd_write(adap, read_cmd)) { 405 - err = -EIO; 406 - break; 407 - } 408 - dbgi_rd_rsp3(adap, buf + 2, buf + 1, buf); 409 - buf += 3; 410 - } 411 - 412 - mc5_dbgi_mode_disable(mc5); 413 - return 0; 414 - } 415 377 416 378 #define MC5_INT_FATAL (F_PARITYERR | F_REQQPARERR | F_DISPQPARERR) 417 379
+1 -38
drivers/net/cxgb3/sge.c
··· 2554 2554 * The MSI-X interrupt handler for an SGE response queue for the non-NAPI case 2555 2555 * (i.e., response queue serviced in hard interrupt). 2556 2556 */ 2557 - irqreturn_t t3_sge_intr_msix(int irq, void *cookie) 2557 + static irqreturn_t t3_sge_intr_msix(int irq, void *cookie) 2558 2558 { 2559 2559 struct sge_qset *qs = cookie; 2560 2560 struct adapter *adap = qs->adap; ··· 3319 3319 } 3320 3320 3321 3321 spin_lock_init(&adap->sge.reg_lock); 3322 - } 3323 - 3324 - /** 3325 - * t3_get_desc - dump an SGE descriptor for debugging purposes 3326 - * @qs: the queue set 3327 - * @qnum: identifies the specific queue (0..2: Tx, 3:response, 4..5: Rx) 3328 - * @idx: the descriptor index in the queue 3329 - * @data: where to dump the descriptor contents 3330 - * 3331 - * Dumps the contents of a HW descriptor of an SGE queue. Returns the 3332 - * size of the descriptor. 3333 - */ 3334 - int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx, 3335 - unsigned char *data) 3336 - { 3337 - if (qnum >= 6) 3338 - return -EINVAL; 3339 - 3340 - if (qnum < 3) { 3341 - if (!qs->txq[qnum].desc || idx >= qs->txq[qnum].size) 3342 - return -EINVAL; 3343 - memcpy(data, &qs->txq[qnum].desc[idx], sizeof(struct tx_desc)); 3344 - return sizeof(struct tx_desc); 3345 - } 3346 - 3347 - if (qnum == 3) { 3348 - if (!qs->rspq.desc || idx >= qs->rspq.size) 3349 - return -EINVAL; 3350 - memcpy(data, &qs->rspq.desc[idx], sizeof(struct rsp_desc)); 3351 - return sizeof(struct rsp_desc); 3352 - } 3353 - 3354 - qnum -= 4; 3355 - if (!qs->fl[qnum].desc || idx >= qs->fl[qnum].size) 3356 - return -EINVAL; 3357 - memcpy(data, &qs->fl[qnum].desc[idx], sizeof(struct rx_desc)); 3358 - return sizeof(struct rx_desc); 3359 3322 }
+11 -186
drivers/net/cxgb3/t3_hw.c
··· 34 34 #include "sge_defs.h" 35 35 #include "firmware_exports.h" 36 36 37 + static void t3_port_intr_clear(struct adapter *adapter, int idx); 38 + 37 39 /** 38 40 * t3_wait_op_done_val - wait until an operation is completed 39 41 * @adapter: the adapter performing the operation ··· 842 840 * (i.e., big-endian), otherwise as 32-bit words in the platform's 843 841 * natural endianess. 844 842 */ 845 - int t3_read_flash(struct adapter *adapter, unsigned int addr, 846 - unsigned int nwords, u32 *data, int byte_oriented) 843 + static int t3_read_flash(struct adapter *adapter, unsigned int addr, 844 + unsigned int nwords, u32 *data, int byte_oriented) 847 845 { 848 846 int ret; 849 847 ··· 2113 2111 * Clear port-specific (i.e., MAC and PHY) interrupts for the given 2114 2112 * adapter port. 2115 2113 */ 2116 - void t3_port_intr_clear(struct adapter *adapter, int idx) 2114 + static void t3_port_intr_clear(struct adapter *adapter, int idx) 2117 2115 { 2118 2116 struct cphy *phy = &adap2pinfo(adapter, idx)->phy; 2119 2117 ··· 2486 2484 } 2487 2485 2488 2486 /** 2489 - * t3_sge_read_context - read an SGE context 2490 - * @type: the context type 2491 - * @adapter: the adapter 2492 - * @id: the context id 2493 - * @data: holds the retrieved context 2494 - * 2495 - * Read an SGE egress context. The caller is responsible for ensuring 2496 - * only one context operation occurs at a time. 2497 - */ 2498 - static int t3_sge_read_context(unsigned int type, struct adapter *adapter, 2499 - unsigned int id, u32 data[4]) 2500 - { 2501 - if (t3_read_reg(adapter, A_SG_CONTEXT_CMD) & F_CONTEXT_CMD_BUSY) 2502 - return -EBUSY; 2503 - 2504 - t3_write_reg(adapter, A_SG_CONTEXT_CMD, 2505 - V_CONTEXT_CMD_OPCODE(0) | type | V_CONTEXT(id)); 2506 - if (t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY, 0, 2507 - SG_CONTEXT_CMD_ATTEMPTS, 1)) 2508 - return -EIO; 2509 - data[0] = t3_read_reg(adapter, A_SG_CONTEXT_DATA0); 2510 - data[1] = t3_read_reg(adapter, A_SG_CONTEXT_DATA1); 2511 - data[2] = t3_read_reg(adapter, A_SG_CONTEXT_DATA2); 2512 - data[3] = t3_read_reg(adapter, A_SG_CONTEXT_DATA3); 2513 - return 0; 2514 - } 2515 - 2516 - /** 2517 - * t3_sge_read_ecntxt - read an SGE egress context 2518 - * @adapter: the adapter 2519 - * @id: the context id 2520 - * @data: holds the retrieved context 2521 - * 2522 - * Read an SGE egress context. The caller is responsible for ensuring 2523 - * only one context operation occurs at a time. 2524 - */ 2525 - int t3_sge_read_ecntxt(struct adapter *adapter, unsigned int id, u32 data[4]) 2526 - { 2527 - if (id >= 65536) 2528 - return -EINVAL; 2529 - return t3_sge_read_context(F_EGRESS, adapter, id, data); 2530 - } 2531 - 2532 - /** 2533 - * t3_sge_read_cq - read an SGE CQ context 2534 - * @adapter: the adapter 2535 - * @id: the context id 2536 - * @data: holds the retrieved context 2537 - * 2538 - * Read an SGE CQ context. The caller is responsible for ensuring 2539 - * only one context operation occurs at a time. 2540 - */ 2541 - int t3_sge_read_cq(struct adapter *adapter, unsigned int id, u32 data[4]) 2542 - { 2543 - if (id >= 65536) 2544 - return -EINVAL; 2545 - return t3_sge_read_context(F_CQ, adapter, id, data); 2546 - } 2547 - 2548 - /** 2549 - * t3_sge_read_fl - read an SGE free-list context 2550 - * @adapter: the adapter 2551 - * @id: the context id 2552 - * @data: holds the retrieved context 2553 - * 2554 - * Read an SGE free-list context. The caller is responsible for ensuring 2555 - * only one context operation occurs at a time. 2556 - */ 2557 - int t3_sge_read_fl(struct adapter *adapter, unsigned int id, u32 data[4]) 2558 - { 2559 - if (id >= SGE_QSETS * 2) 2560 - return -EINVAL; 2561 - return t3_sge_read_context(F_FREELIST, adapter, id, data); 2562 - } 2563 - 2564 - /** 2565 - * t3_sge_read_rspq - read an SGE response queue context 2566 - * @adapter: the adapter 2567 - * @id: the context id 2568 - * @data: holds the retrieved context 2569 - * 2570 - * Read an SGE response queue context. The caller is responsible for 2571 - * ensuring only one context operation occurs at a time. 2572 - */ 2573 - int t3_sge_read_rspq(struct adapter *adapter, unsigned int id, u32 data[4]) 2574 - { 2575 - if (id >= SGE_QSETS) 2576 - return -EINVAL; 2577 - return t3_sge_read_context(F_RESPONSEQ, adapter, id, data); 2578 - } 2579 - 2580 - /** 2581 2487 * t3_config_rss - configure Rx packet steering 2582 2488 * @adapter: the adapter 2583 2489 * @rss_config: RSS settings (written to TP_RSS_CONFIG) ··· 2523 2613 } 2524 2614 2525 2615 t3_write_reg(adapter, A_TP_RSS_CONFIG, rss_config); 2526 - } 2527 - 2528 - /** 2529 - * t3_read_rss - read the contents of the RSS tables 2530 - * @adapter: the adapter 2531 - * @lkup: holds the contents of the RSS lookup table 2532 - * @map: holds the contents of the RSS map table 2533 - * 2534 - * Reads the contents of the receive packet steering tables. 2535 - */ 2536 - int t3_read_rss(struct adapter *adapter, u8 * lkup, u16 *map) 2537 - { 2538 - int i; 2539 - u32 val; 2540 - 2541 - if (lkup) 2542 - for (i = 0; i < RSS_TABLE_SIZE; ++i) { 2543 - t3_write_reg(adapter, A_TP_RSS_LKP_TABLE, 2544 - 0xffff0000 | i); 2545 - val = t3_read_reg(adapter, A_TP_RSS_LKP_TABLE); 2546 - if (!(val & 0x80000000)) 2547 - return -EAGAIN; 2548 - *lkup++ = val; 2549 - *lkup++ = (val >> 8); 2550 - } 2551 - 2552 - if (map) 2553 - for (i = 0; i < RSS_TABLE_SIZE; ++i) { 2554 - t3_write_reg(adapter, A_TP_RSS_MAP_TABLE, 2555 - 0xffff0000 | i); 2556 - val = t3_read_reg(adapter, A_TP_RSS_MAP_TABLE); 2557 - if (!(val & 0x80000000)) 2558 - return -EAGAIN; 2559 - *map++ = val; 2560 - } 2561 - return 0; 2562 2616 } 2563 2617 2564 2618 /** ··· 2742 2868 * 2743 2869 * Set the receive coalescing size and PSH bit handling. 2744 2870 */ 2745 - int t3_tp_set_coalescing_size(struct adapter *adap, unsigned int size, int psh) 2871 + static int t3_tp_set_coalescing_size(struct adapter *adap, 2872 + unsigned int size, int psh) 2746 2873 { 2747 2874 u32 val; 2748 2875 ··· 2773 2898 * Set TP's max receive size. This is the limit that applies when 2774 2899 * receive coalescing is disabled. 2775 2900 */ 2776 - void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size) 2901 + static void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size) 2777 2902 { 2778 2903 t3_write_reg(adap, A_TP_PARA_REG7, 2779 2904 V_PMMAXXFERLEN0(size) | V_PMMAXXFERLEN1(size)); ··· 2890 3015 (w << 16) | (beta[w] << 13) | inc); 2891 3016 } 2892 3017 } 2893 - } 2894 - 2895 - /** 2896 - * t3_read_hw_mtus - returns the values in the HW MTU table 2897 - * @adap: the adapter 2898 - * @mtus: where to store the HW MTU values 2899 - * 2900 - * Reads the HW MTU table. 2901 - */ 2902 - void t3_read_hw_mtus(struct adapter *adap, unsigned short mtus[NMTUS]) 2903 - { 2904 - int i; 2905 - 2906 - for (i = 0; i < NMTUS; ++i) { 2907 - unsigned int val; 2908 - 2909 - t3_write_reg(adap, A_TP_MTU_TABLE, 0xff000000 | i); 2910 - val = t3_read_reg(adap, A_TP_MTU_TABLE); 2911 - mtus[i] = val & 0x3fff; 2912 - } 2913 - } 2914 - 2915 - /** 2916 - * t3_get_cong_cntl_tab - reads the congestion control table 2917 - * @adap: the adapter 2918 - * @incr: where to store the alpha values 2919 - * 2920 - * Reads the additive increments programmed into the HW congestion 2921 - * control table. 2922 - */ 2923 - void t3_get_cong_cntl_tab(struct adapter *adap, 2924 - unsigned short incr[NMTUS][NCCTRL_WIN]) 2925 - { 2926 - unsigned int mtu, w; 2927 - 2928 - for (mtu = 0; mtu < NMTUS; ++mtu) 2929 - for (w = 0; w < NCCTRL_WIN; ++w) { 2930 - t3_write_reg(adap, A_TP_CCTRL_TABLE, 2931 - 0xffff0000 | (mtu << 5) | w); 2932 - incr[mtu][w] = t3_read_reg(adap, A_TP_CCTRL_TABLE) & 2933 - 0x1fff; 2934 - } 2935 3018 } 2936 3019 2937 3020 /** ··· 3054 3221 if (!busy) 3055 3222 t3_write_reg(adap, A_TP_RESET, F_TPRESET); 3056 3223 return busy; 3057 - } 3058 - 3059 - int t3_mps_set_active_ports(struct adapter *adap, unsigned int port_mask) 3060 - { 3061 - if (port_mask & ~((1 << adap->params.nports) - 1)) 3062 - return -EINVAL; 3063 - t3_set_reg_field(adap, A_MPS_CFG, F_PORT1ACTIVE | F_PORT0ACTIVE, 3064 - port_mask << S_PORT0ACTIVE); 3065 - return 0; 3066 3224 } 3067 3225 3068 3226 /* ··· 3511 3687 mc7->width = G_WIDTH(cfg); 3512 3688 } 3513 3689 3514 - void mac_prep(struct cmac *mac, struct adapter *adapter, int index) 3690 + static void mac_prep(struct cmac *mac, struct adapter *adapter, int index) 3515 3691 { 3516 3692 u16 devid; 3517 3693 ··· 3531 3707 } 3532 3708 } 3533 3709 3534 - void early_hw_init(struct adapter *adapter, const struct adapter_info *ai) 3710 + static void early_hw_init(struct adapter *adapter, 3711 + const struct adapter_info *ai) 3535 3712 { 3536 3713 u32 val = V_PORTSPEED(is_10G(adapter) ? 3 : 2); 3537 3714