• Home
  • Raw
  • Download

Lines Matching refs:ethport

21 ethport_can_be_up(struct bna_ethport *ethport)  in ethport_can_be_up()  argument
24 if (ethport->bna->enet.type == BNA_ENET_T_REGULAR) in ethport_can_be_up()
25 ready = ((ethport->flags & BNA_ETHPORT_F_ADMIN_UP) && in ethport_can_be_up()
26 (ethport->flags & BNA_ETHPORT_F_RX_STARTED) && in ethport_can_be_up()
27 (ethport->flags & BNA_ETHPORT_F_PORT_ENABLED)); in ethport_can_be_up()
29 ready = ((ethport->flags & BNA_ETHPORT_F_ADMIN_UP) && in ethport_can_be_up()
30 (ethport->flags & BNA_ETHPORT_F_RX_STARTED) && in ethport_can_be_up()
31 !(ethport->flags & BNA_ETHPORT_F_PORT_ENABLED)); in ethport_can_be_up()
83 bna_bfi_ethport_enable_aen(struct bna_ethport *ethport, in bna_bfi_ethport_enable_aen() argument
86 ethport->flags |= BNA_ETHPORT_F_PORT_ENABLED; in bna_bfi_ethport_enable_aen()
88 if (ethport_can_be_up(ethport)) in bna_bfi_ethport_enable_aen()
89 bfa_fsm_send_event(ethport, ETHPORT_E_UP); in bna_bfi_ethport_enable_aen()
93 bna_bfi_ethport_disable_aen(struct bna_ethport *ethport, in bna_bfi_ethport_disable_aen() argument
96 int ethport_up = ethport_is_up(ethport); in bna_bfi_ethport_disable_aen()
98 ethport->flags &= ~BNA_ETHPORT_F_PORT_ENABLED; in bna_bfi_ethport_disable_aen()
101 bfa_fsm_send_event(ethport, ETHPORT_E_DOWN); in bna_bfi_ethport_disable_aen()
105 bna_bfi_ethport_admin_rsp(struct bna_ethport *ethport, in bna_bfi_ethport_admin_rsp() argument
109 &ethport->bfi_enet_cmd.admin_req; in bna_bfi_ethport_admin_rsp()
116 bfa_fsm_send_event(ethport, ETHPORT_E_FWRESP_UP_OK); in bna_bfi_ethport_admin_rsp()
118 ethport->flags &= ~BNA_ETHPORT_F_PORT_ENABLED; in bna_bfi_ethport_admin_rsp()
119 bfa_fsm_send_event(ethport, ETHPORT_E_FWRESP_UP_FAIL); in bna_bfi_ethport_admin_rsp()
124 bfa_fsm_send_event(ethport, ETHPORT_E_FWRESP_DOWN); in bna_bfi_ethport_admin_rsp()
125 ethport->link_status = BNA_LINK_DOWN; in bna_bfi_ethport_admin_rsp()
126 ethport->link_cbfn(ethport->bna->bnad, BNA_LINK_DOWN); in bna_bfi_ethport_admin_rsp()
132 bna_bfi_ethport_lpbk_rsp(struct bna_ethport *ethport, in bna_bfi_ethport_lpbk_rsp() argument
136 &ethport->bfi_enet_cmd.lpbk_req; in bna_bfi_ethport_lpbk_rsp()
143 bfa_fsm_send_event(ethport, ETHPORT_E_FWRESP_UP_OK); in bna_bfi_ethport_lpbk_rsp()
145 ethport->flags &= ~BNA_ETHPORT_F_ADMIN_UP; in bna_bfi_ethport_lpbk_rsp()
146 bfa_fsm_send_event(ethport, ETHPORT_E_FWRESP_UP_FAIL); in bna_bfi_ethport_lpbk_rsp()
151 bfa_fsm_send_event(ethport, ETHPORT_E_FWRESP_DOWN); in bna_bfi_ethport_lpbk_rsp()
240 bna_bfi_ethport_linkup_aen(struct bna_ethport *ethport, in bna_bfi_ethport_linkup_aen() argument
243 ethport->link_status = BNA_LINK_UP; in bna_bfi_ethport_linkup_aen()
246 ethport->link_cbfn(ethport->bna->bnad, ethport->link_status); in bna_bfi_ethport_linkup_aen()
250 bna_bfi_ethport_linkdown_aen(struct bna_ethport *ethport, in bna_bfi_ethport_linkdown_aen() argument
253 ethport->link_status = BNA_LINK_DOWN; in bna_bfi_ethport_linkdown_aen()
256 ethport->link_cbfn(ethport->bna->bnad, BNA_LINK_DOWN); in bna_bfi_ethport_linkdown_aen()
341 bna_bfi_ethport_admin_rsp(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
345 bna_bfi_ethport_lpbk_rsp(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
365 bna_bfi_ethport_linkup_aen(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
369 bna_bfi_ethport_linkdown_aen(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
373 bna_bfi_ethport_enable_aen(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
377 bna_bfi_ethport_disable_aen(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
401 #define call_ethport_adminup_cbfn(ethport, status) \ argument
403 if ((ethport)->adminup_cbfn) { \
405 cbfn = (ethport)->adminup_cbfn; \
406 (ethport)->adminup_cbfn = NULL; \
407 cbfn((ethport)->bna->bnad, status); \
412 bna_bfi_ethport_admin_up(struct bna_ethport *ethport) in bna_bfi_ethport_admin_up() argument
415 &ethport->bfi_enet_cmd.admin_req; in bna_bfi_ethport_admin_up()
423 bfa_msgq_cmd_set(&ethport->msgq_cmd, NULL, NULL, in bna_bfi_ethport_admin_up()
425 bfa_msgq_cmd_post(&ethport->bna->msgq, &ethport->msgq_cmd); in bna_bfi_ethport_admin_up()
429 bna_bfi_ethport_admin_down(struct bna_ethport *ethport) in bna_bfi_ethport_admin_down() argument
432 &ethport->bfi_enet_cmd.admin_req; in bna_bfi_ethport_admin_down()
440 bfa_msgq_cmd_set(&ethport->msgq_cmd, NULL, NULL, in bna_bfi_ethport_admin_down()
442 bfa_msgq_cmd_post(&ethport->bna->msgq, &ethport->msgq_cmd); in bna_bfi_ethport_admin_down()
446 bna_bfi_ethport_lpbk_up(struct bna_ethport *ethport) in bna_bfi_ethport_lpbk_up() argument
449 &ethport->bfi_enet_cmd.lpbk_req; in bna_bfi_ethport_lpbk_up()
455 lpbk_up_req->mode = (ethport->bna->enet.type == in bna_bfi_ethport_lpbk_up()
461 bfa_msgq_cmd_set(&ethport->msgq_cmd, NULL, NULL, in bna_bfi_ethport_lpbk_up()
463 bfa_msgq_cmd_post(&ethport->bna->msgq, &ethport->msgq_cmd); in bna_bfi_ethport_lpbk_up()
467 bna_bfi_ethport_lpbk_down(struct bna_ethport *ethport) in bna_bfi_ethport_lpbk_down() argument
470 &ethport->bfi_enet_cmd.lpbk_req; in bna_bfi_ethport_lpbk_down()
478 bfa_msgq_cmd_set(&ethport->msgq_cmd, NULL, NULL, in bna_bfi_ethport_lpbk_down()
480 bfa_msgq_cmd_post(&ethport->bna->msgq, &ethport->msgq_cmd); in bna_bfi_ethport_lpbk_down()
484 bna_bfi_ethport_up(struct bna_ethport *ethport) in bna_bfi_ethport_up() argument
486 if (ethport->bna->enet.type == BNA_ENET_T_REGULAR) in bna_bfi_ethport_up()
487 bna_bfi_ethport_admin_up(ethport); in bna_bfi_ethport_up()
489 bna_bfi_ethport_lpbk_up(ethport); in bna_bfi_ethport_up()
493 bna_bfi_ethport_down(struct bna_ethport *ethport) in bna_bfi_ethport_down() argument
495 if (ethport->bna->enet.type == BNA_ENET_T_REGULAR) in bna_bfi_ethport_down()
496 bna_bfi_ethport_admin_down(ethport); in bna_bfi_ethport_down()
498 bna_bfi_ethport_lpbk_down(ethport); in bna_bfi_ethport_down()
515 bna_ethport_sm_stopped_entry(struct bna_ethport *ethport) in bna_ethport_sm_stopped_entry() argument
517 call_ethport_stop_cbfn(ethport); in bna_ethport_sm_stopped_entry()
521 bna_ethport_sm_stopped(struct bna_ethport *ethport, in bna_ethport_sm_stopped() argument
526 bfa_fsm_set_state(ethport, bna_ethport_sm_down); in bna_ethport_sm_stopped()
530 call_ethport_stop_cbfn(ethport); in bna_ethport_sm_stopped()
548 bna_ethport_sm_down_entry(struct bna_ethport *ethport) in bna_ethport_sm_down_entry() argument
553 bna_ethport_sm_down(struct bna_ethport *ethport, in bna_ethport_sm_down() argument
558 bfa_fsm_set_state(ethport, bna_ethport_sm_stopped); in bna_ethport_sm_down()
562 bfa_fsm_set_state(ethport, bna_ethport_sm_stopped); in bna_ethport_sm_down()
566 bfa_fsm_set_state(ethport, bna_ethport_sm_up_resp_wait); in bna_ethport_sm_down()
567 bna_bfi_ethport_up(ethport); in bna_ethport_sm_down()
576 bna_ethport_sm_up_resp_wait_entry(struct bna_ethport *ethport) in bna_ethport_sm_up_resp_wait_entry() argument
581 bna_ethport_sm_up_resp_wait(struct bna_ethport *ethport, in bna_ethport_sm_up_resp_wait() argument
586 bfa_fsm_set_state(ethport, bna_ethport_sm_last_resp_wait); in bna_ethport_sm_up_resp_wait()
590 call_ethport_adminup_cbfn(ethport, BNA_CB_FAIL); in bna_ethport_sm_up_resp_wait()
591 bfa_fsm_set_state(ethport, bna_ethport_sm_stopped); in bna_ethport_sm_up_resp_wait()
595 call_ethport_adminup_cbfn(ethport, BNA_CB_INTERRUPT); in bna_ethport_sm_up_resp_wait()
596 bfa_fsm_set_state(ethport, bna_ethport_sm_down_resp_wait); in bna_ethport_sm_up_resp_wait()
600 call_ethport_adminup_cbfn(ethport, BNA_CB_SUCCESS); in bna_ethport_sm_up_resp_wait()
601 bfa_fsm_set_state(ethport, bna_ethport_sm_up); in bna_ethport_sm_up_resp_wait()
605 call_ethport_adminup_cbfn(ethport, BNA_CB_FAIL); in bna_ethport_sm_up_resp_wait()
606 bfa_fsm_set_state(ethport, bna_ethport_sm_down); in bna_ethport_sm_up_resp_wait()
611 bna_bfi_ethport_up(ethport); in bna_ethport_sm_up_resp_wait()
620 bna_ethport_sm_down_resp_wait_entry(struct bna_ethport *ethport) in bna_ethport_sm_down_resp_wait_entry() argument
630 bna_ethport_sm_down_resp_wait(struct bna_ethport *ethport, in bna_ethport_sm_down_resp_wait() argument
635 bfa_fsm_set_state(ethport, bna_ethport_sm_last_resp_wait); in bna_ethport_sm_down_resp_wait()
639 bfa_fsm_set_state(ethport, bna_ethport_sm_stopped); in bna_ethport_sm_down_resp_wait()
643 bfa_fsm_set_state(ethport, bna_ethport_sm_up_resp_wait); in bna_ethport_sm_down_resp_wait()
648 bna_bfi_ethport_down(ethport); in bna_ethport_sm_down_resp_wait()
653 bfa_fsm_set_state(ethport, bna_ethport_sm_down); in bna_ethport_sm_down_resp_wait()
662 bna_ethport_sm_up_entry(struct bna_ethport *ethport) in bna_ethport_sm_up_entry() argument
667 bna_ethport_sm_up(struct bna_ethport *ethport, in bna_ethport_sm_up() argument
672 bfa_fsm_set_state(ethport, bna_ethport_sm_last_resp_wait); in bna_ethport_sm_up()
673 bna_bfi_ethport_down(ethport); in bna_ethport_sm_up()
677 bfa_fsm_set_state(ethport, bna_ethport_sm_stopped); in bna_ethport_sm_up()
681 bfa_fsm_set_state(ethport, bna_ethport_sm_down_resp_wait); in bna_ethport_sm_up()
682 bna_bfi_ethport_down(ethport); in bna_ethport_sm_up()
691 bna_ethport_sm_last_resp_wait_entry(struct bna_ethport *ethport) in bna_ethport_sm_last_resp_wait_entry() argument
696 bna_ethport_sm_last_resp_wait(struct bna_ethport *ethport, in bna_ethport_sm_last_resp_wait() argument
701 bfa_fsm_set_state(ethport, bna_ethport_sm_stopped); in bna_ethport_sm_last_resp_wait()
714 bna_bfi_ethport_down(ethport); in bna_ethport_sm_last_resp_wait()
719 bfa_fsm_set_state(ethport, bna_ethport_sm_stopped); in bna_ethport_sm_last_resp_wait()
728 bna_ethport_init(struct bna_ethport *ethport, struct bna *bna) in bna_ethport_init() argument
730 ethport->flags |= (BNA_ETHPORT_F_ADMIN_UP | BNA_ETHPORT_F_PORT_ENABLED); in bna_ethport_init()
731 ethport->bna = bna; in bna_ethport_init()
733 ethport->link_status = BNA_LINK_DOWN; in bna_ethport_init()
734 ethport->link_cbfn = bnad_cb_ethport_link_status; in bna_ethport_init()
736 ethport->rx_started_count = 0; in bna_ethport_init()
738 ethport->stop_cbfn = NULL; in bna_ethport_init()
739 ethport->adminup_cbfn = NULL; in bna_ethport_init()
741 bfa_fsm_set_state(ethport, bna_ethport_sm_stopped); in bna_ethport_init()
745 bna_ethport_uninit(struct bna_ethport *ethport) in bna_ethport_uninit() argument
747 ethport->flags &= ~BNA_ETHPORT_F_ADMIN_UP; in bna_ethport_uninit()
748 ethport->flags &= ~BNA_ETHPORT_F_PORT_ENABLED; in bna_ethport_uninit()
750 ethport->bna = NULL; in bna_ethport_uninit()
754 bna_ethport_start(struct bna_ethport *ethport) in bna_ethport_start() argument
756 bfa_fsm_send_event(ethport, ETHPORT_E_START); in bna_ethport_start()
766 bna_ethport_stop(struct bna_ethport *ethport) in bna_ethport_stop() argument
768 ethport->stop_cbfn = bna_enet_cb_ethport_stopped; in bna_ethport_stop()
769 bfa_fsm_send_event(ethport, ETHPORT_E_STOP); in bna_ethport_stop()
773 bna_ethport_fail(struct bna_ethport *ethport) in bna_ethport_fail() argument
776 ethport->flags |= BNA_ETHPORT_F_PORT_ENABLED; in bna_ethport_fail()
778 if (ethport->link_status != BNA_LINK_DOWN) { in bna_ethport_fail()
779 ethport->link_status = BNA_LINK_DOWN; in bna_ethport_fail()
780 ethport->link_cbfn(ethport->bna->bnad, BNA_LINK_DOWN); in bna_ethport_fail()
782 bfa_fsm_send_event(ethport, ETHPORT_E_FAIL); in bna_ethport_fail()
787 bna_ethport_cb_rx_started(struct bna_ethport *ethport) in bna_ethport_cb_rx_started() argument
789 ethport->rx_started_count++; in bna_ethport_cb_rx_started()
791 if (ethport->rx_started_count == 1) { in bna_ethport_cb_rx_started()
792 ethport->flags |= BNA_ETHPORT_F_RX_STARTED; in bna_ethport_cb_rx_started()
794 if (ethport_can_be_up(ethport)) in bna_ethport_cb_rx_started()
795 bfa_fsm_send_event(ethport, ETHPORT_E_UP); in bna_ethport_cb_rx_started()
800 bna_ethport_cb_rx_stopped(struct bna_ethport *ethport) in bna_ethport_cb_rx_stopped() argument
802 int ethport_up = ethport_is_up(ethport); in bna_ethport_cb_rx_stopped()
804 ethport->rx_started_count--; in bna_ethport_cb_rx_stopped()
806 if (ethport->rx_started_count == 0) { in bna_ethport_cb_rx_stopped()
807 ethport->flags &= ~BNA_ETHPORT_F_RX_STARTED; in bna_ethport_cb_rx_stopped()
810 bfa_fsm_send_event(ethport, ETHPORT_E_DOWN); in bna_ethport_cb_rx_stopped()
824 bna_ethport_start(&(enet)->bna->ethport); \
839 bna_ethport_stop(&(enet)->bna->ethport); \
849 bna_ethport_fail(&(enet)->bna->ethport); \
2043 bna_ethport_init(&bna->ethport, bna); in bna_init()
2075 bna_ethport_uninit(&bna->ethport); in bna_uninit()