Lines Matching refs:mac

74 	fcoe_mac_t	*mac;  in fcoe_register_client()  local
87 for (mac = list_head(&fcoe_global_ss->ss_mac_list); mac; in fcoe_register_client()
88 mac = list_next(&fcoe_global_ss->ss_mac_list, mac)) { in fcoe_register_client()
89 if (client->ect_channelid == mac->fm_linkid) { in fcoe_register_client()
94 if (mac == NULL) { in fcoe_register_client()
99 if (mac->fm_flags & FCOE_MAC_FLAG_BOUND) { in fcoe_register_client()
104 atomic_or_32(&mac->fm_flags, FCOE_MAC_FLAG_BOUND); in fcoe_register_client()
105 bcopy(client, &mac->fm_client, sizeof (fcoe_client_t)); in fcoe_register_client()
110 eport = &mac->fm_eport; in fcoe_register_client()
112 eport->eport_fcoe_private = mac; in fcoe_register_client()
138 fcoe_mac_t *mac = EPORT2MAC(eport); in fcoe_deregister_client() local
146 while (mac->fm_frm_cnt > 0) { in fcoe_deregister_client()
151 atomic_and_32(&mac->fm_eport.eport_flags, ~EPORT_FLAG_MAC_IN_USE); in fcoe_deregister_client()
153 (void) fcoe_close_mac(mac); in fcoe_deregister_client()
154 fcoe_destroy_mac(mac); in fcoe_deregister_client()
162 fcoe_mac_t *mac = EPORT2MAC(eport); in fcoe_ctl() local
170 if (fcoe_enable_callback(mac) == FCOE_FAILURE) { in fcoe_ctl()
173 mac->fm_state = FCOE_MAC_STATE_ONLINE; in fcoe_ctl()
174 if (mac->fm_link_state == FCOE_MAC_LINK_STATE_UP) in fcoe_ctl()
177 fcoe_mac_notify_link_up, mac, DDI_SLEEP); in fcoe_ctl()
180 if (fcoe_disable_callback(mac) == FCOE_FAILURE) { in fcoe_ctl()
183 mac->fm_state = FCOE_MAC_STATE_OFFLINE; in fcoe_ctl()
185 mutex_enter(&mac->fm_mutex); in fcoe_ctl()
186 cv_broadcast(&mac->fm_tx_cv); in fcoe_ctl()
187 mutex_exit(&mac->fm_mutex); in fcoe_ctl()
204 fcoe_mac_t *mac = FRM2MAC(frm); in fcoe_tx_frame() local
211 ret_cookie = mac_tx(mac->fm_cli_handle, FRM2MBLK(frm), 0, in fcoe_tx_frame()
215 mutex_enter(&mac->fm_mutex); in fcoe_tx_frame()
216 (void) cv_reltimedwait(&mac->fm_tx_cv, &mac->fm_mutex, in fcoe_tx_frame()
218 mutex_exit(&mac->fm_mutex); in fcoe_tx_frame()
220 if (mac->fm_state == FCOE_MAC_STATE_OFFLINE) { in fcoe_tx_frame()
238 mac->fm_frm_cnt ++; in fcoe_tx_frame()
414 fcoe_mac_t *mac = (fcoe_mac_t *)arg; in fcoe_mac_notify_link_up() local
416 ASSERT(mac->fm_flags & FCOE_MAC_FLAG_BOUND); in fcoe_mac_notify_link_up()
418 mac->fm_client.ect_port_event(&mac->fm_eport, in fcoe_mac_notify_link_up()
424 fcoe_mac_t *mac = (fcoe_mac_t *)arg; in fcoe_mac_notify_link_down() local
426 if (mac->fm_flags & FCOE_MAC_FLAG_BOUND) { in fcoe_mac_notify_link_down()
427 mac->fm_client.ect_port_event(&mac->fm_eport, in fcoe_mac_notify_link_down()
433 fcoe_create_port(dev_info_t *parent, fcoe_mac_t *mac, int is_target) in fcoe_create_port() argument
446 "mac_id", mac->fm_linkid) != DDI_PROP_SUCCESS) { in fcoe_create_port()
449 ddi_get_instance(parent), mac->fm_linkid); in fcoe_create_port()
457 ddi_get_instance(parent), mac->fm_linkid); in fcoe_create_port()
460 mac->fm_client_dev = child; in fcoe_create_port()
470 fcoe_mac_t *mac; in fcoe_delete_port() local
472 mac = fcoe_lookup_mac_by_id(linkid); in fcoe_delete_port()
473 if (mac == NULL) { in fcoe_delete_port()
478 *is_target = EPORT_CLT_TYPE(&mac->fm_eport); in fcoe_delete_port()
479 if ((mac->fm_flags & FCOE_MAC_FLAG_ENABLED) != FCOE_MAC_FLAG_ENABLED) { in fcoe_delete_port()
484 if (!(mac->fm_flags & FCOE_MAC_FLAG_BOUND)) { in fcoe_delete_port()
492 atomic_and_32(&mac->fm_eport.eport_flags, ~EPORT_FLAG_MAC_IN_USE); in fcoe_delete_port()
493 mac->fm_flags |= FCOE_MAC_FLAG_USER_DEL; in fcoe_delete_port()
494 rval = ndi_devi_offline(mac->fm_client_dev, NDI_DEVI_REMOVE); in fcoe_delete_port()
498 ddi_get_name(mac->fm_client_dev)); in fcoe_delete_port()
499 atomic_or_32(&mac->fm_eport.eport_flags, in fcoe_delete_port()
507 (void) fcoe_close_mac(mac); in fcoe_delete_port()
508 fcoe_destroy_mac(mac); in fcoe_delete_port()