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

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>

authored by

Rasesh Mody and committed by
David S. Miller
ce9b9f38 2c7d3821

+3 -253
+1 -240
drivers/net/bna/bna_ctrl.c
··· 2132 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 2135 int 2167 2136 rxf_process_packet_filter_ucast(struct bna_rxf *rxf) 2168 2137 { ··· 2190 2221 /* Revert VLAN filter */ 2191 2222 __rxf_vlan_filter_set(rxf, rxf->vlan_filter_status); 2192 2223 rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_PROMISCUOUS_SET_REQ, 2193 - BNA_STATUS_T_DISABLED); 2194 - return 1; 2195 - } 2196 - 2197 - return 0; 2198 - } 2199 - 2200 - int 2201 - rxf_process_packet_filter_default(struct bna_rxf *rxf) 2202 - { 2203 - struct bna *bna = rxf->rx->bna; 2204 - 2205 - /* Enable/disable default mode */ 2206 - if (is_default_enable(rxf->rxmode_pending, 2207 - rxf->rxmode_pending_bitmask)) { 2208 - /* move default configuration from pending -> active */ 2209 - default_inactive(rxf->rxmode_pending, 2210 - rxf->rxmode_pending_bitmask); 2211 - rxf->rxmode_active |= BNA_RXMODE_DEFAULT; 2212 - 2213 - /* Disable VLAN filter to allow all VLANs */ 2214 - __rxf_vlan_filter_set(rxf, BNA_STATUS_T_DISABLED); 2215 - /* Redirect all other RxF vlan filtering to this one */ 2216 - __rxf_default_function_config(rxf, BNA_STATUS_T_ENABLED); 2217 - rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_DEFAULT_SET_REQ, 2218 - BNA_STATUS_T_ENABLED); 2219 - return 1; 2220 - } else if (is_default_disable(rxf->rxmode_pending, 2221 - rxf->rxmode_pending_bitmask)) { 2222 - /* move default configuration from pending -> active */ 2223 - default_inactive(rxf->rxmode_pending, 2224 - rxf->rxmode_pending_bitmask); 2225 - rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; 2226 - bna->rxf_default_id = BFI_MAX_RXF; 2227 - 2228 - /* Revert VLAN filter */ 2229 - __rxf_vlan_filter_set(rxf, rxf->vlan_filter_status); 2230 - /* Stop RxF vlan filter table redirection */ 2231 - __rxf_default_function_config(rxf, BNA_STATUS_T_DISABLED); 2232 - rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_DEFAULT_SET_REQ, 2233 2224 BNA_STATUS_T_DISABLED); 2234 2225 return 1; 2235 2226 } ··· 2294 2365 } 2295 2366 2296 2367 int 2297 - rxf_clear_packet_filter_default(struct bna_rxf *rxf) 2298 - { 2299 - struct bna *bna = rxf->rx->bna; 2300 - 2301 - /* 8. Execute pending default mode disable command */ 2302 - if (is_default_disable(rxf->rxmode_pending, 2303 - rxf->rxmode_pending_bitmask)) { 2304 - /* move default configuration from pending -> active */ 2305 - default_inactive(rxf->rxmode_pending, 2306 - rxf->rxmode_pending_bitmask); 2307 - rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; 2308 - bna->rxf_default_id = BFI_MAX_RXF; 2309 - 2310 - /* Revert VLAN filter */ 2311 - __rxf_vlan_filter_set(rxf, rxf->vlan_filter_status); 2312 - /* Stop RxF vlan filter table redirection */ 2313 - __rxf_default_function_config(rxf, BNA_STATUS_T_DISABLED); 2314 - rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_DEFAULT_SET_REQ, 2315 - BNA_STATUS_T_DISABLED); 2316 - return 1; 2317 - } 2318 - 2319 - /* 9. Clear active default mode; move it to pending enable */ 2320 - if (rxf->rxmode_active & BNA_RXMODE_DEFAULT) { 2321 - /* move default configuration from active -> pending */ 2322 - default_enable(rxf->rxmode_pending, 2323 - rxf->rxmode_pending_bitmask); 2324 - rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; 2325 - 2326 - /* Revert VLAN filter */ 2327 - __rxf_vlan_filter_set(rxf, rxf->vlan_filter_status); 2328 - /* Stop RxF vlan filter table redirection */ 2329 - __rxf_default_function_config(rxf, BNA_STATUS_T_DISABLED); 2330 - rxf_fltr_mbox_cmd(rxf, BFI_LL_H2I_RXF_DEFAULT_SET_REQ, 2331 - BNA_STATUS_T_DISABLED); 2332 - return 1; 2333 - } 2334 - 2335 - return 0; 2336 - } 2337 - 2338 - int 2339 2368 rxf_clear_packet_filter_allmulti(struct bna_rxf *rxf) 2340 2369 { 2341 2370 /* 10. Execute pending allmulti mode disable command */ ··· 2365 2478 rxf->rxmode_active &= ~BNA_RXMODE_PROMISC; 2366 2479 } 2367 2480 2368 - } 2369 - 2370 - void 2371 - rxf_reset_packet_filter_default(struct bna_rxf *rxf) 2372 - { 2373 - struct bna *bna = rxf->rx->bna; 2374 - 2375 - /* 8. Clear pending default mode disable */ 2376 - if (is_default_disable(rxf->rxmode_pending, 2377 - rxf->rxmode_pending_bitmask)) { 2378 - default_inactive(rxf->rxmode_pending, 2379 - rxf->rxmode_pending_bitmask); 2380 - rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; 2381 - bna->rxf_default_id = BFI_MAX_RXF; 2382 - } 2383 - 2384 - /* 9. Move default mode config from active -> pending */ 2385 - if (rxf->rxmode_active & BNA_RXMODE_DEFAULT) { 2386 - default_enable(rxf->rxmode_pending, 2387 - rxf->rxmode_pending_bitmask); 2388 - rxf->rxmode_active &= ~BNA_RXMODE_DEFAULT; 2389 - } 2390 2481 } 2391 2482 2392 2483 void ··· 2464 2599 * 1 = need h/w change 2465 2600 */ 2466 2601 static int 2467 - rxf_default_enable(struct bna_rxf *rxf) 2468 - { 2469 - struct bna *bna = rxf->rx->bna; 2470 - int ret = 0; 2471 - 2472 - /* There can not be any pending disable command */ 2473 - 2474 - /* Do nothing if pending enable or already enabled */ 2475 - if (is_default_enable(rxf->rxmode_pending, 2476 - rxf->rxmode_pending_bitmask) || 2477 - (rxf->rxmode_active & BNA_RXMODE_DEFAULT)) { 2478 - /* Schedule enable */ 2479 - } else { 2480 - /* Default mode should not be active in the system */ 2481 - default_enable(rxf->rxmode_pending, 2482 - rxf->rxmode_pending_bitmask); 2483 - bna->rxf_default_id = rxf->rxf_id; 2484 - ret = 1; 2485 - } 2486 - 2487 - return ret; 2488 - } 2489 - 2490 - /** 2491 - * Should only be called by bna_rxf_mode_set. 2492 - * Helps deciding if h/w configuration is needed or not. 2493 - * Returns: 2494 - * 0 = no h/w change 2495 - * 1 = need h/w change 2496 - */ 2497 - static int 2498 - rxf_default_disable(struct bna_rxf *rxf) 2499 - { 2500 - struct bna *bna = rxf->rx->bna; 2501 - int ret = 0; 2502 - 2503 - /* There can not be any pending disable */ 2504 - 2505 - /* Turn off pending enable command , if any */ 2506 - if (is_default_enable(rxf->rxmode_pending, 2507 - rxf->rxmode_pending_bitmask)) { 2508 - /* Promisc mode should not be active */ 2509 - /* system default state should be pending */ 2510 - default_inactive(rxf->rxmode_pending, 2511 - rxf->rxmode_pending_bitmask); 2512 - /* Remove the default state from the system */ 2513 - bna->rxf_default_id = BFI_MAX_RXF; 2514 - 2515 - /* Schedule disable */ 2516 - } else if (rxf->rxmode_active & BNA_RXMODE_DEFAULT) { 2517 - /* Default mode should be active in the system */ 2518 - default_disable(rxf->rxmode_pending, 2519 - rxf->rxmode_pending_bitmask); 2520 - ret = 1; 2521 - 2522 - /* Do nothing if already disabled */ 2523 - } else { 2524 - } 2525 - 2526 - return ret; 2527 - } 2528 - 2529 - /** 2530 - * Should only be called by bna_rxf_mode_set. 2531 - * Helps deciding if h/w configuration is needed or not. 2532 - * Returns: 2533 - * 0 = no h/w change 2534 - * 1 = need h/w change 2535 - */ 2536 - static int 2537 2602 rxf_allmulti_enable(struct bna_rxf *rxf) 2538 2603 { 2539 2604 int ret = 0; ··· 2525 2730 struct bna_rxf *rxf = &rx->rxf; 2526 2731 int need_hw_config = 0; 2527 2732 2528 - /* Error checks */ 2733 + /* Process the commands */ 2529 2734 2530 2735 if (is_promisc_enable(new_mode, bitmask)) { 2531 2736 /* If promisc mode is already enabled elsewhere in the system */ 2532 2737 if ((rx->bna->rxf_promisc_id != BFI_MAX_RXF) && 2533 2738 (rx->bna->rxf_promisc_id != rxf->rxf_id)) 2534 2739 goto err_return; 2535 - 2536 - /* If default mode is already enabled in the system */ 2537 - if (rx->bna->rxf_default_id != BFI_MAX_RXF) 2538 - goto err_return; 2539 - 2540 - /* Trying to enable promiscuous and default mode together */ 2541 - if (is_default_enable(new_mode, bitmask)) 2542 - goto err_return; 2543 - } 2544 - 2545 - if (is_default_enable(new_mode, bitmask)) { 2546 - /* If default mode is already enabled elsewhere in the system */ 2547 - if ((rx->bna->rxf_default_id != BFI_MAX_RXF) && 2548 - (rx->bna->rxf_default_id != rxf->rxf_id)) { 2549 - goto err_return; 2550 - } 2551 - 2552 - /* If promiscuous mode is already enabled in the system */ 2553 - if (rx->bna->rxf_promisc_id != BFI_MAX_RXF) 2554 - goto err_return; 2555 - } 2556 - 2557 - /* Process the commands */ 2558 - 2559 - if (is_promisc_enable(new_mode, bitmask)) { 2560 2740 if (rxf_promisc_enable(rxf)) 2561 2741 need_hw_config = 1; 2562 2742 } else if (is_promisc_disable(new_mode, bitmask)) { 2563 2743 if (rxf_promisc_disable(rxf)) 2564 - need_hw_config = 1; 2565 - } 2566 - 2567 - if (is_default_enable(new_mode, bitmask)) { 2568 - if (rxf_default_enable(rxf)) 2569 - need_hw_config = 1; 2570 - } else if (is_default_disable(new_mode, bitmask)) { 2571 - if (rxf_default_disable(rxf)) 2572 2744 need_hw_config = 1; 2573 2745 } 2574 2746 ··· 2964 3202 2965 3203 bna_mcam_mod_init(&bna->mcam_mod, bna, res_info); 2966 3204 2967 - bna->rxf_default_id = BFI_MAX_RXF; 2968 3205 bna->rxf_promisc_id = BFI_MAX_RXF; 2969 3206 2970 3207 /* Mbox q element for posting stat request to f/w */
+1 -10
drivers/net/bna/bna_txrx.c
··· 1226 1226 /* Apply the VLAN filter */ 1227 1227 if (rxf->rxf_flags & BNA_RXF_FL_VLAN_CONFIG_PENDING) { 1228 1228 rxf->rxf_flags &= ~BNA_RXF_FL_VLAN_CONFIG_PENDING; 1229 - if (!(rxf->rxmode_active & BNA_RXMODE_PROMISC) && 1230 - !(rxf->rxmode_active & BNA_RXMODE_DEFAULT)) 1229 + if (!(rxf->rxmode_active & BNA_RXMODE_PROMISC)) 1231 1230 __rxf_vlan_filter_set(rxf, rxf->vlan_filter_status); 1232 1231 } 1233 1232 ··· 1273 1274 return 1; 1274 1275 1275 1276 if (rxf_process_packet_filter_promisc(rxf)) 1276 - return 1; 1277 - 1278 - if (rxf_process_packet_filter_default(rxf)) 1279 1277 return 1; 1280 1278 1281 1279 if (rxf_process_packet_filter_allmulti(rxf)) ··· 1336 1340 if (rxf_clear_packet_filter_promisc(rxf)) 1337 1341 return 1; 1338 1342 1339 - if (rxf_clear_packet_filter_default(rxf)) 1340 - return 1; 1341 - 1342 1343 if (rxf_clear_packet_filter_allmulti(rxf)) 1343 1344 return 1; 1344 1345 ··· 1381 1388 rxf->ucast_pending_set = 0; 1382 1389 1383 1390 rxf_reset_packet_filter_promisc(rxf); 1384 - 1385 - rxf_reset_packet_filter_default(rxf); 1386 1391 1387 1392 rxf_reset_packet_filter_allmulti(rxf); 1388 1393 }
+1 -3
drivers/net/bna/bna_types.h
··· 165 165 166 166 enum bna_rxmode { 167 167 BNA_RXMODE_PROMISC = 1, 168 - BNA_RXMODE_DEFAULT = 2, 169 - BNA_RXMODE_ALLMULTI = 4 168 + BNA_RXMODE_ALLMULTI = 2 170 169 }; 171 170 172 171 enum bna_rx_event { ··· 1117 1118 1118 1119 struct bna_rit_mod rit_mod; 1119 1120 1120 - int rxf_default_id; 1121 1121 int rxf_promisc_id; 1122 1122 1123 1123 struct bna_mbox_qe mbox_qe;