diff options
author | Rasesh Mody <rmody@brocade.com> | 2010-12-23 16:45:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-25 22:16:02 -0500 |
commit | ce9b9f383775e6de74ca4c93d5c643dc3d76dd3c (patch) | |
tree | 41520eda23c757cf505acbea958797905d3124ef /drivers/net/bna/bna_ctrl.c | |
parent | 2c7d38210ff8e65f8961699bce92c273c77d113c (diff) |
bna: Removed unused code
Change Details:
- Remove unused APIs and code cleanup
Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bna/bna_ctrl.c')
-rw-r--r-- | drivers/net/bna/bna_ctrl.c | 241 |
1 files changed, 1 insertions, 240 deletions
diff --git a/drivers/net/bna/bna_ctrl.c b/drivers/net/bna/bna_ctrl.c index 68e4c5eced53..e1527472b961 100644 --- a/drivers/net/bna/bna_ctrl.c +++ b/drivers/net/bna/bna_ctrl.c | |||
@@ -2132,37 +2132,6 @@ rxf_fltr_mbox_cmd(struct bna_rxf *rxf, u8 cmd, enum bna_status status) | |||
2132 | bna_mbox_send(rxf->rx->bna, &rxf->mbox_qe); | 2132 | bna_mbox_send(rxf->rx->bna, &rxf->mbox_qe); |
2133 | } | 2133 | } |
2134 | 2134 | ||
2135 | static void | ||
2136 | __rxf_default_function_config(struct bna_rxf *rxf, enum bna_status status) | ||
2137 | { | ||
2138 | struct bna_rx_fndb_ram *rx_fndb_ram; | ||
2139 | u32 ctrl_flags; | ||
2140 | int i; | ||
2141 | |||
2142 | rx_fndb_ram = (struct bna_rx_fndb_ram *) | ||
2143 | BNA_GET_MEM_BASE_ADDR(rxf->rx->bna->pcidev.pci_bar_kva, | ||
2144 | RX_FNDB_RAM_BASE_OFFSET); | ||
2145 | |||
2146 | for (i = 0; i < BFI_MAX_RXF; i++) { | ||
2147 | if (status == BNA_STATUS_T_ENABLED) { | ||
2148 | if (i == rxf->rxf_id) | ||
2149 | continue; | ||
2150 | |||
2151 | ctrl_flags = | ||
2152 | readl(&rx_fndb_ram[i].control_flags); | ||
2153 | ctrl_flags |= BNA_RXF_CF_DEFAULT_FUNCTION_ENABLE; | ||
2154 | writel(ctrl_flags, | ||
2155 | &rx_fndb_ram[i].control_flags); | ||
2156 | } else { | ||
2157 | ctrl_flags = | ||
2158 | readl(&rx_fndb_ram[i].control_flags); | ||
2159 | ctrl_flags &= ~BNA_RXF_CF_DEFAULT_FUNCTION_ENABLE; | ||
2160 | writel(ctrl_flags, | ||
2161 | &rx_fndb_ram[i].control_flags); | ||
2162 | } | ||
2163 | } | ||
2164 | } | ||
2165 | |||
2166 | int | 2135 | int |
2167 | rxf_process_packet_filter_ucast(struct bna_rxf *rxf) | 2136 | rxf_process_packet_filter_ucast(struct bna_rxf *rxf) |
2168 | { | 2137 | { |
@@ -2229,46 +2198,6 @@ rxf_process_packet_filter_promisc(struct bna_rxf *rxf) | |||
2229 | } | 2198 | } |
2230 | 2199 | ||
2231 | int | 2200 | int |
2232 | rxf_process_packet_filter_default(struct bna_rxf *rxf) | ||
2233 | { | ||
2234 | struct bna *bna = rxf->rx->bna; | ||
2235 | |||
2236 | /* Enable/disable default mode */ | ||
2237 | if (is_default_enable(rxf->rxmode_pending, | ||
2238 | rxf->rxmode_pending_bitmask)) { | ||
2239 | /* move default configuration from pending -> active */ | ||
2240 | default_inactive(rxf->rxmode_pending, | ||
2241 | rxf->rxmode_pending_bitmask); | ||
2242 | rxf->rxmode_active |= BNA_RXMODE_DEFAULT; | ||
2243 | |||
2244 | /* Disable VLAN filter to allow all VLANs */ | ||
2245 | __rxf_vlan_filter_set(rxf, BNA_STATUS_T_DISABLED); | ||
2246 | /* Redirect all other RxF vlan filtering to this one */ | ||
2247 | __rxf_default_function_config(rxf, BNA_STATUS_T_ENABLED); | ||
2248 | rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_DEFAULT_SET_REQ, | ||
2249 | BNA_STATUS_T_ENABLED); | ||
2250 | return 1; | ||
2251 | } else if (is_default_disable(rxf->rxmode_pending, | ||
2252 | rxf->rxmode_pending_bitmask)) { | ||
2253 | /* move default configuration from pending -> active */ | ||
2254 | default_inactive(rxf->rxmode_pending, | ||
2255 | rxf->rxmode_pending_bitmask); | ||
2256 | rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; | ||
2257 | bna->rxf_default_id = BFI_MAX_RXF; | ||
2258 | |||
2259 | /* Revert VLAN filter */ | ||
2260 | __rxf_vlan_filter_set(rxf, rxf->vlan_filter_status); | ||
2261 | /* Stop RxF vlan filter table redirection */ | ||
2262 | __rxf_default_function_config(rxf, BNA_STATUS_T_DISABLED); | ||
2263 | rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_DEFAULT_SET_REQ, | ||
2264 | BNA_STATUS_T_DISABLED); | ||
2265 | return 1; | ||
2266 | } | ||
2267 | |||
2268 | return 0; | ||
2269 | } | ||
2270 | |||
2271 | int | ||
2272 | rxf_process_packet_filter_allmulti(struct bna_rxf *rxf) | 2201 | rxf_process_packet_filter_allmulti(struct bna_rxf *rxf) |
2273 | { | 2202 | { |
2274 | /* Enable/disable allmulti mode */ | 2203 | /* Enable/disable allmulti mode */ |
@@ -2365,48 +2294,6 @@ rxf_clear_packet_filter_promisc(struct bna_rxf *rxf) | |||
2365 | } | 2294 | } |
2366 | 2295 | ||
2367 | int | 2296 | int |
2368 | rxf_clear_packet_filter_default(struct bna_rxf *rxf) | ||
2369 | { | ||
2370 | struct bna *bna = rxf->rx->bna; | ||
2371 | |||
2372 | /* 8. Execute pending default mode disable command */ | ||
2373 | if (is_default_disable(rxf->rxmode_pending, | ||
2374 | rxf->rxmode_pending_bitmask)) { | ||
2375 | /* move default configuration from pending -> active */ | ||
2376 | default_inactive(rxf->rxmode_pending, | ||
2377 | rxf->rxmode_pending_bitmask); | ||
2378 | rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; | ||
2379 | bna->rxf_default_id = BFI_MAX_RXF; | ||
2380 | |||
2381 | /* Revert VLAN filter */ | ||
2382 | __rxf_vlan_filter_set(rxf, rxf->vlan_filter_status); | ||
2383 | /* Stop RxF vlan filter table redirection */ | ||
2384 | __rxf_default_function_config(rxf, BNA_STATUS_T_DISABLED); | ||
2385 | rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_DEFAULT_SET_REQ, | ||
2386 | BNA_STATUS_T_DISABLED); | ||
2387 | return 1; | ||
2388 | } | ||
2389 | |||
2390 | /* 9. Clear active default mode; move it to pending enable */ | ||
2391 | if (rxf->rxmode_active & BNA_RXMODE_DEFAULT) { | ||
2392 | /* move default configuration from active -> pending */ | ||
2393 | default_enable(rxf->rxmode_pending, | ||
2394 | rxf->rxmode_pending_bitmask); | ||
2395 | rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; | ||
2396 | |||
2397 | /* Revert VLAN filter */ | ||
2398 | __rxf_vlan_filter_set(rxf, rxf->vlan_filter_status); | ||
2399 | /* Stop RxF vlan filter table redirection */ | ||
2400 | __rxf_default_function_config(rxf, BNA_STATUS_T_DISABLED); | ||
2401 | rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_DEFAULT_SET_REQ, | ||
2402 | BNA_STATUS_T_DISABLED); | ||
2403 | return 1; | ||
2404 | } | ||
2405 | |||
2406 | return 0; | ||
2407 | } | ||
2408 | |||
2409 | int | ||
2410 | rxf_clear_packet_filter_allmulti(struct bna_rxf *rxf) | 2297 | rxf_clear_packet_filter_allmulti(struct bna_rxf *rxf) |
2411 | { | 2298 | { |
2412 | /* 10. Execute pending allmulti mode disable command */ | 2299 | /* 10. Execute pending allmulti mode disable command */ |
@@ -2481,28 +2368,6 @@ rxf_reset_packet_filter_promisc(struct bna_rxf *rxf) | |||
2481 | } | 2368 | } |
2482 | 2369 | ||
2483 | void | 2370 | void |
2484 | rxf_reset_packet_filter_default(struct bna_rxf *rxf) | ||
2485 | { | ||
2486 | struct bna *bna = rxf->rx->bna; | ||
2487 | |||
2488 | /* 8. Clear pending default mode disable */ | ||
2489 | if (is_default_disable(rxf->rxmode_pending, | ||
2490 | rxf->rxmode_pending_bitmask)) { | ||
2491 | default_inactive(rxf->rxmode_pending, | ||
2492 | rxf->rxmode_pending_bitmask); | ||
2493 | rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; | ||
2494 | bna->rxf_default_id = BFI_MAX_RXF; | ||
2495 | } | ||
2496 | |||
2497 | /* 9. Move default mode config from active -> pending */ | ||
2498 | if (rxf->rxmode_active & BNA_RXMODE_DEFAULT) { | ||
2499 | default_enable(rxf->rxmode_pending, | ||
2500 | rxf->rxmode_pending_bitmask); | ||
2501 | rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; | ||
2502 | } | ||
2503 | } | ||
2504 | |||
2505 | void | ||
2506 | rxf_reset_packet_filter_allmulti(struct bna_rxf *rxf) | 2371 | rxf_reset_packet_filter_allmulti(struct bna_rxf *rxf) |
2507 | { | 2372 | { |
2508 | /* 10. Clear pending allmulti mode disable */ | 2373 | /* 10. Clear pending allmulti mode disable */ |
@@ -2599,76 +2464,6 @@ rxf_promisc_disable(struct bna_rxf *rxf) | |||
2599 | * 1 = need h/w change | 2464 | * 1 = need h/w change |
2600 | */ | 2465 | */ |
2601 | static int | 2466 | static int |
2602 | rxf_default_enable(struct bna_rxf *rxf) | ||
2603 | { | ||
2604 | struct bna *bna = rxf->rx->bna; | ||
2605 | int ret = 0; | ||
2606 | |||
2607 | /* There can not be any pending disable command */ | ||
2608 | |||
2609 | /* Do nothing if pending enable or already enabled */ | ||
2610 | if (is_default_enable(rxf->rxmode_pending, | ||
2611 | rxf->rxmode_pending_bitmask) || | ||
2612 | (rxf->rxmode_active & BNA_RXMODE_DEFAULT)) { | ||
2613 | /* Schedule enable */ | ||
2614 | } else { | ||
2615 | /* Default mode should not be active in the system */ | ||
2616 | default_enable(rxf->rxmode_pending, | ||
2617 | rxf->rxmode_pending_bitmask); | ||
2618 | bna->rxf_default_id = rxf->rxf_id; | ||
2619 | ret = 1; | ||
2620 | } | ||
2621 | |||
2622 | return ret; | ||
2623 | } | ||
2624 | |||
2625 | /** | ||
2626 | * Should only be called by bna_rxf_mode_set. | ||
2627 | * Helps deciding if h/w configuration is needed or not. | ||
2628 | * Returns: | ||
2629 | * 0 = no h/w change | ||
2630 | * 1 = need h/w change | ||
2631 | */ | ||
2632 | static int | ||
2633 | rxf_default_disable(struct bna_rxf *rxf) | ||
2634 | { | ||
2635 | struct bna *bna = rxf->rx->bna; | ||
2636 | int ret = 0; | ||
2637 | |||
2638 | /* There can not be any pending disable */ | ||
2639 | |||
2640 | /* Turn off pending enable command , if any */ | ||
2641 | if (is_default_enable(rxf->rxmode_pending, | ||
2642 | rxf->rxmode_pending_bitmask)) { | ||
2643 | /* Promisc mode should not be active */ | ||
2644 | /* system default state should be pending */ | ||
2645 | default_inactive(rxf->rxmode_pending, | ||
2646 | rxf->rxmode_pending_bitmask); | ||
2647 | /* Remove the default state from the system */ | ||
2648 | bna->rxf_default_id = BFI_MAX_RXF; | ||
2649 | |||
2650 | /* Schedule disable */ | ||
2651 | } else if (rxf->rxmode_active & BNA_RXMODE_DEFAULT) { | ||
2652 | /* Default mode should be active in the system */ | ||
2653 | default_disable(rxf->rxmode_pending, | ||
2654 | rxf->rxmode_pending_bitmask); | ||
2655 | ret = 1; | ||
2656 | |||
2657 | /* Do nothing if already disabled */ | ||
2658 | } else { | ||
2659 | } | ||
2660 | |||
2661 | return ret; | ||
2662 | } | ||
2663 | |||
2664 | /** | ||
2665 | * Should only be called by bna_rxf_mode_set. | ||
2666 | * Helps deciding if h/w configuration is needed or not. | ||
2667 | * Returns: | ||
2668 | * 0 = no h/w change | ||
2669 | * 1 = need h/w change | ||
2670 | */ | ||
2671 | static int | ||
2672 | rxf_allmulti_enable(struct bna_rxf *rxf) | 2467 | rxf_allmulti_enable(struct bna_rxf *rxf) |
2673 | { | 2468 | { |
2674 | int ret = 0; | 2469 | int ret = 0; |
@@ -2730,38 +2525,13 @@ bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode new_mode, | |||
2730 | struct bna_rxf *rxf = &rx->rxf; | 2525 | struct bna_rxf *rxf = &rx->rxf; |
2731 | int need_hw_config = 0; | 2526 | int need_hw_config = 0; |
2732 | 2527 | ||
2733 | /* Error checks */ | 2528 | /* Process the commands */ |
2734 | 2529 | ||
2735 | if (is_promisc_enable(new_mode, bitmask)) { | 2530 | if (is_promisc_enable(new_mode, bitmask)) { |
2736 | /* If promisc mode is already enabled elsewhere in the system */ | 2531 | /* If promisc mode is already enabled elsewhere in the system */ |
2737 | if ((rx->bna->rxf_promisc_id != BFI_MAX_RXF) && | 2532 | if ((rx->bna->rxf_promisc_id != BFI_MAX_RXF) && |
2738 | (rx->bna->rxf_promisc_id != rxf->rxf_id)) | 2533 | (rx->bna->rxf_promisc_id != rxf->rxf_id)) |
2739 | goto err_return; | 2534 | goto err_return; |
2740 | |||
2741 | /* If default mode is already enabled in the system */ | ||
2742 | if (rx->bna->rxf_default_id != BFI_MAX_RXF) | ||
2743 | goto err_return; | ||
2744 | |||
2745 | /* Trying to enable promiscuous and default mode together */ | ||
2746 | if (is_default_enable(new_mode, bitmask)) | ||
2747 | goto err_return; | ||
2748 | } | ||
2749 | |||
2750 | if (is_default_enable(new_mode, bitmask)) { | ||
2751 | /* If default mode is already enabled elsewhere in the system */ | ||
2752 | if ((rx->bna->rxf_default_id != BFI_MAX_RXF) && | ||
2753 | (rx->bna->rxf_default_id != rxf->rxf_id)) { | ||
2754 | goto err_return; | ||
2755 | } | ||
2756 | |||
2757 | /* If promiscuous mode is already enabled in the system */ | ||
2758 | if (rx->bna->rxf_promisc_id != BFI_MAX_RXF) | ||
2759 | goto err_return; | ||
2760 | } | ||
2761 | |||
2762 | /* Process the commands */ | ||
2763 | |||
2764 | if (is_promisc_enable(new_mode, bitmask)) { | ||
2765 | if (rxf_promisc_enable(rxf)) | 2535 | if (rxf_promisc_enable(rxf)) |
2766 | need_hw_config = 1; | 2536 | need_hw_config = 1; |
2767 | } else if (is_promisc_disable(new_mode, bitmask)) { | 2537 | } else if (is_promisc_disable(new_mode, bitmask)) { |
@@ -2769,14 +2539,6 @@ bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode new_mode, | |||
2769 | need_hw_config = 1; | 2539 | need_hw_config = 1; |
2770 | } | 2540 | } |
2771 | 2541 | ||
2772 | if (is_default_enable(new_mode, bitmask)) { | ||
2773 | if (rxf_default_enable(rxf)) | ||
2774 | need_hw_config = 1; | ||
2775 | } else if (is_default_disable(new_mode, bitmask)) { | ||
2776 | if (rxf_default_disable(rxf)) | ||
2777 | need_hw_config = 1; | ||
2778 | } | ||
2779 | |||
2780 | if (is_allmulti_enable(new_mode, bitmask)) { | 2542 | if (is_allmulti_enable(new_mode, bitmask)) { |
2781 | if (rxf_allmulti_enable(rxf)) | 2543 | if (rxf_allmulti_enable(rxf)) |
2782 | need_hw_config = 1; | 2544 | need_hw_config = 1; |
@@ -3202,7 +2964,6 @@ bna_init(struct bna *bna, struct bnad *bnad, struct bfa_pcidev *pcidev, | |||
3202 | 2964 | ||
3203 | bna_mcam_mod_init(&bna->mcam_mod, bna, res_info); | 2965 | bna_mcam_mod_init(&bna->mcam_mod, bna, res_info); |
3204 | 2966 | ||
3205 | bna->rxf_default_id = BFI_MAX_RXF; | ||
3206 | bna->rxf_promisc_id = BFI_MAX_RXF; | 2967 | bna->rxf_promisc_id = BFI_MAX_RXF; |
3207 | 2968 | ||
3208 | /* Mbox q element for posting stat request to f/w */ | 2969 | /* Mbox q element for posting stat request to f/w */ |