Lines Matching refs:mac

72 	fcoe_mac_t	*mac;
85 for (mac = list_head(&fcoe_global_ss->ss_mac_list); mac;
86 mac = list_next(&fcoe_global_ss->ss_mac_list, mac)) {
87 if (client->ect_channelid == mac->fm_linkid) {
92 if (mac == NULL) {
97 if (mac->fm_flags & FCOE_MAC_FLAG_BOUND) {
102 atomic_or_32(&mac->fm_flags, FCOE_MAC_FLAG_BOUND);
103 bcopy(client, &mac->fm_client, sizeof (fcoe_client_t));
108 eport = &mac->fm_eport;
110 eport->eport_fcoe_private = mac;
136 fcoe_mac_t *mac = EPORT2MAC(eport);
144 while (mac->fm_frm_cnt > 0) {
149 atomic_and_32(&mac->fm_eport.eport_flags, ~EPORT_FLAG_MAC_IN_USE);
151 (void) fcoe_close_mac(mac);
152 fcoe_destroy_mac(mac);
160 fcoe_mac_t *mac = EPORT2MAC(eport);
168 if (fcoe_enable_callback(mac) == FCOE_FAILURE) {
171 mac->fm_state = FCOE_MAC_STATE_ONLINE;
172 if (mac->fm_link_state == FCOE_MAC_LINK_STATE_UP)
175 fcoe_mac_notify_link_up, mac, DDI_SLEEP);
178 if (fcoe_disable_callback(mac) == FCOE_FAILURE) {
181 mac->fm_state = FCOE_MAC_STATE_OFFLINE;
183 mutex_enter(&mac->fm_mutex);
184 cv_broadcast(&mac->fm_tx_cv);
185 mutex_exit(&mac->fm_mutex);
202 fcoe_mac_t *mac = FRM2MAC(frm);
209 ret_cookie = mac_tx(mac->fm_cli_handle, FRM2MBLK(frm), 0,
212 mutex_enter(&mac->fm_mutex);
213 (void) cv_reltimedwait(&mac->fm_tx_cv, &mac->fm_mutex,
215 mutex_exit(&mac->fm_mutex);
217 if (mac->fm_state == FCOE_MAC_STATE_OFFLINE) {
235 mac->fm_frm_cnt ++;
411 fcoe_mac_t *mac = (fcoe_mac_t *)arg;
413 ASSERT(mac->fm_flags & FCOE_MAC_FLAG_BOUND);
415 mac->fm_client.ect_port_event(&mac->fm_eport,
421 fcoe_mac_t *mac = (fcoe_mac_t *)arg;
423 if (mac->fm_flags & FCOE_MAC_FLAG_BOUND) {
424 mac->fm_client.ect_port_event(&mac->fm_eport,
430 fcoe_create_port(dev_info_t *parent, fcoe_mac_t *mac, int is_target)
443 "mac_id", mac->fm_linkid) != DDI_PROP_SUCCESS) {
445 "fcoe%d: prop_update port mac id failed for mac %d",
446 ddi_get_instance(parent), mac->fm_linkid);
453 FCOE_LOG("fcoe", "fcoe%d: online_driver failed for mac %d",
454 ddi_get_instance(parent), mac->fm_linkid);
457 mac->fm_client_dev = child;
467 fcoe_mac_t *mac;
469 mac = fcoe_lookup_mac_by_id(linkid);
470 if (mac == NULL) {
475 *is_target = EPORT_CLT_TYPE(&mac->fm_eport);
476 if ((mac->fm_flags & FCOE_MAC_FLAG_ENABLED) != FCOE_MAC_FLAG_ENABLED) {
481 if (!(mac->fm_flags & FCOE_MAC_FLAG_BOUND)) {
489 atomic_and_32(&mac->fm_eport.eport_flags, ~EPORT_FLAG_MAC_IN_USE);
490 mac->fm_flags |= FCOE_MAC_FLAG_USER_DEL;
491 rval = ndi_devi_offline(mac->fm_client_dev, NDI_DEVI_REMOVE);
495 ddi_get_name(mac->fm_client_dev));
496 atomic_or_32(&mac->fm_eport.eport_flags,
504 (void) fcoe_close_mac(mac);
505 fcoe_destroy_mac(mac);