8,9c8,9
< * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
< * or http://www.opensolaris.org/os/licensing.
---
> * You can obtain a copy of the license at
> * http://www.opensource.org/licenses/cddl1.txt.
23c23
< * Copyright 2010 Emulex. All rights reserved.
---
> * Copyright (c) 2004-2012 Emulex. All rights reserved.
27d26
<
59,60c58,59
< * - All other calls touching fctab, fcfi, vfi, vpi, rpi objects must hold
< * the EMLXS_FCF_LOCK to protect these objects.
---
> * - All other calls touching fcftab, fcfi, vfi, vpi, rpi objects
> * must hold the EMLXS_FCF_LOCK to protect these objects.
62a62,81
> /*
> * DEBUG MESSAGE TERMINATION RULES:
> *
> * - A message should end in ">" if a thread operating outside the
> * XXXX state machine enters the XXXX state machine with a call to
> * emlxs_XXXX_event() or emlxs_XXXX_state(). This includes calls made
> * from emlxs_..._notify(), emlxs_..._mbcmpl() and emlxs_..._timer()
> * routines since they represent the beginnning of new threads.
> *
> * - A message should end in "<" if the thread is about exit
> * an emlxs_XXXX_..._action() without previously calling the
> * next emlxs_XXXX_state(). This includes the emlxs_XXXX_action()
> * and emlxs_XXXX_state() routines themselves since errors
> * in these routines represent the termination of state change
> * thread.
> *
> * - A message should end in "." if none of the previous
> * conditions apply.
> */
>
95a115
> * FCF_EVENT_RPI_TIMEOUT RPIobj_t*
101c121
< {FCF_EVENT_STATE_ENTER, "STATE_ENTER"},
---
> {FCF_EVENT_STATE_ENTER, "E_ENTER"},
103,110c123,130
< {FCF_EVENT_SHUTDOWN, "SHUTDOWN"},
< {FCF_EVENT_LINKUP, "LINK_UP"},
< {FCF_EVENT_LINKDOWN, "LINK_DOWN"},
< {FCF_EVENT_CVL, "CVL_RECD"},
< {FCF_EVENT_FCFTAB_FULL, "TABLE_FULL"},
< {FCF_EVENT_FCF_FOUND, "FCF_FOUND"},
< {FCF_EVENT_FCF_LOST, "FCF_LOST"},
< {FCF_EVENT_FCF_CHANGED, "FCF_CHANGED"},
---
> {FCF_EVENT_SHUTDOWN, "E_SHUTDOWN"},
> {FCF_EVENT_LINKUP, "E_LINKUP"},
> {FCF_EVENT_LINKDOWN, "E_LINKDOWN"},
> {FCF_EVENT_CVL, "E_CVL"},
> {FCF_EVENT_FCFTAB_FULL, "E_TABLE_FULL"},
> {FCF_EVENT_FCF_FOUND, "E_FCF_FOUND"},
> {FCF_EVENT_FCF_LOST, "E_FCF_LOST"},
> {FCF_EVENT_FCF_CHANGED, "E_FCF_CHANGED"},
112,114c132,134
< {FCF_EVENT_FCFI_ONLINE, "FCFI_ONLINE"},
< {FCF_EVENT_FCFI_OFFLINE, "FCFI_OFFLINE"},
< {FCF_EVENT_FCFI_PAUSE, "FCFI_PAUSE"},
---
> {FCF_EVENT_FCFI_ONLINE, "E_FCFI_ONLINE"},
> {FCF_EVENT_FCFI_OFFLINE, "E_FCFI_OFFLINE"},
> {FCF_EVENT_FCFI_PAUSE, "E_FCFI_PAUSE"},
116,118c136,138
< {FCF_EVENT_VFI_ONLINE, "VFI_ONLINE"},
< {FCF_EVENT_VFI_OFFLINE, "VFI_OFFLINE"},
< {FCF_EVENT_VFI_PAUSE, "VFI_PAUSE"},
---
> {FCF_EVENT_VFI_ONLINE, "E_VFI_ONLINE"},
> {FCF_EVENT_VFI_OFFLINE, "E_VFI_OFFLINE"},
> {FCF_EVENT_VFI_PAUSE, "E_VFI_PAUSE"},
120,122c140,142
< {FCF_EVENT_VPI_ONLINE, "VPI_ONLINE"},
< {FCF_EVENT_VPI_OFFLINE, "VPI_OFFLINE"},
< {FCF_EVENT_VPI_PAUSE, "VPI_PAUSE"},
---
> {FCF_EVENT_VPI_ONLINE, "E_VPI_ONLINE"},
> {FCF_EVENT_VPI_OFFLINE, "E_VPI_OFFLINE"},
> {FCF_EVENT_VPI_PAUSE, "E_VPI_PAUSE"},
124,127c144,147
< {FCF_EVENT_RPI_ONLINE, "RPI_ONLINE"},
< {FCF_EVENT_RPI_OFFLINE, "RPI_OFFLINE"},
< {FCF_EVENT_RPI_PAUSE, "RPI_PAUSE"},
< {FCF_EVENT_RPI_RESUME, "RPI_RESUME"},
---
> {FCF_EVENT_RPI_ONLINE, "E_RPI_ONLINE"},
> {FCF_EVENT_RPI_OFFLINE, "E_RPI_OFFLINE"},
> {FCF_EVENT_RPI_PAUSE, "E_RPI_PAUSE"},
> {FCF_EVENT_RPI_RESUME, "E_RPI_RESUME"},
135,150c155,173
< {FCF_REASON_NONE, "REASON_NONE"},
< {FCF_REASON_REENTER, "REASON_REENTER"},
< {FCF_REASON_EVENT, "REASON_EVENT"},
< {FCF_REASON_REQUESTED, "REASON_REQUESTED"},
< {FCF_REASON_NO_MBOX, "REASON_NO_MBOX"},
< {FCF_REASON_NO_BUFFER, "REASON_NO_BUFFER"},
< {FCF_REASON_SEND_FAILED, "REASON_SEND_FAILED"},
< {FCF_REASON_MBOX_FAILED, "REASON_MBOX_FAILED"},
< {FCF_REASON_NO_FCFI, "REASON_NO_FCFI"},
< {FCF_REASON_NO_VFI, "REASON_NO_VFI"},
< {FCF_REASON_ONLINE_FAILED, "REASON_ONLINE_FAILED"},
< {FCF_REASON_OFFLINE_FAILED, "REASON_OFFLINE_FAILED"},
< {FCF_REASON_OP_FAILED, "REASON_OP_FAILED"},
< {FCF_REASON_NO_PKT, "FCF_REASON_NO_PKT"},
< {FCF_REASON_NO_NODE, "FCF_REASON_NO_NODE"},
< {FCF_REASON_NOT_ALLOWED, "FCF_REASON_NOT_ALLOWED"},
---
> {FCF_REASON_NONE, "R_NONE"},
> {FCF_REASON_REENTER, "R_REENTER"},
> {FCF_REASON_EVENT, "R_EVENT"},
> {FCF_REASON_REQUESTED, "R_REQUESTED"},
> {FCF_REASON_NO_MBOX, "R_NO_MBOX"},
> {FCF_REASON_NO_BUFFER, "R_NO_BUFFER"},
> {FCF_REASON_SEND_FAILED, "R_SEND_FAILED"},
> {FCF_REASON_MBOX_FAILED, "R_MBOX_FAILED"},
> {FCF_REASON_MBOX_BUSY, "R_MBOX_BUSY"},
> {FCF_REASON_NO_FCFI, "R_NO_FCFI"},
> {FCF_REASON_NO_VFI, "R_NO_VFI"},
> {FCF_REASON_ONLINE_FAILED, "R_ONLINE_FAILED"},
> {FCF_REASON_OFFLINE_FAILED, "R_OFFLINE_FAILED"},
> {FCF_REASON_OP_FAILED, "R_OP_FAILED"},
> {FCF_REASON_NO_PKT, "R_NO_PKT"},
> {FCF_REASON_NO_NODE, "R_NO_NODE"},
> {FCF_REASON_NOT_ALLOWED, "R_NOT_ALLOWED"},
> {FCF_REASON_UNUSED, "R_UNUSED"},
> {FCF_REASON_INVALID, "R_INVALID"},
156c179
< /* FCFTAB */
---
> /* FCFTAB Generic */
157a181,186
> static char *emlxs_fcftab_state_xlate(emlxs_port_t *port,
> uint32_t state);
> static uint32_t emlxs_fcftab_event(emlxs_port_t *port, uint32_t evt,
> void *arg1);
> static uint32_t emlxs_fcftab_shutdown_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
158a188,191
> /* ********************************************************************** */
> /* FC FCFTAB */
> /* ********************************************************************** */
>
160c193
< emlxs_table_t emlxs_fcftab_state_table[] =
---
> emlxs_table_t emlxs_fc_fcftab_state_table[] =
162,163c195,196
< {FCFTAB_STATE_SHUTDOWN, "FCFTAB_STATE_SHUTDOWN"},
< {FCFTAB_STATE_OFFLINE, "FCFTAB_STATE_OFFLINE"},
---
> {FC_FCFTAB_STATE_SHUTDOWN, "FCFTAB_SHUTDOWN"},
> {FC_FCFTAB_STATE_OFFLINE, "FCFTAB_OFFLINE"},
165,167c198,200
< {FCFTAB_STATE_SOLICIT, "FCFTAB_STATE_SOLICIT"},
< {FCFTAB_STATE_SOLICIT_FAILED, "FCFTAB_STATE_SOLICIT_FAILED"},
< {FCFTAB_STATE_SOLICIT_CMPL, "FCFTAB_STATE_SOLICIT_CMPL"},
---
> {FC_FCFTAB_STATE_TOPO, "FCFTAB_TOPO"},
> {FC_FCFTAB_STATE_TOPO_FAILED, "FCFTAB_TOPO_FAILED"},
> {FC_FCFTAB_STATE_TOPO_CMPL, "FCFTAB_TOPO_CMPL"},
169,171c202,204
< {FCFTAB_STATE_READ, "FCFTAB_STATE_READ"},
< {FCFTAB_STATE_READ_FAILED, "FCFTAB_STATE_READ_FAILED"},
< {FCFTAB_STATE_READ_CMPL, "FCFTAB_STATE_READ_CMPL"},
---
> {FC_FCFTAB_STATE_CFGLINK, "FCFTAB_CFGLINK"},
> {FC_FCFTAB_STATE_CFGLINK_FAILED, "FCFTAB_CFGLINK_FAILED"},
> {FC_FCFTAB_STATE_CFGLINK_CMPL, "FCFTAB_CFGLINK_CMPL"},
173,174c206,208
< {FCFTAB_STATE_FCFI_OFFLINE, "FCFTAB_STATE_FCFI_OFFLINE"},
< {FCFTAB_STATE_FCFI_OFFLINE_CMPL, "FCFTAB_STATE_FCFI_OFFLINE_CMPL"},
---
> {FC_FCFTAB_STATE_SPARM, "FCFTAB_SPARM"},
> {FC_FCFTAB_STATE_SPARM_FAILED, "FCFTAB_SPARM_FAILED"},
> {FC_FCFTAB_STATE_SPARM_CMPL, "FCFTAB_SPARM_CMPL"},
176,177c210,212
< {FCFTAB_STATE_FCFI_ONLINE, "FCFTAB_STATE_FCFI_ONLINE"},
< {FCFTAB_STATE_FCFI_ONLINE_CMPL, "FCFTAB_STATE_FCFI_ONLINE_CMPL"},
---
> {FC_FCFTAB_STATE_FCFI_OFFLINE_CMPL,
> "FCFTAB_FCFI_OFFLINE_CMPL"},
> {FC_FCFTAB_STATE_FCFI_OFFLINE, "FCFTAB_FCFI_OFFLINE"},
179c214,215
< {FCFTAB_STATE_ONLINE, "FCFTAB_STATE_ONLINE"},
---
> {FC_FCFTAB_STATE_FCFI_ONLINE, "FCFTAB_FCFI_ONLINE"},
> {FC_FCFTAB_STATE_FCFI_ONLINE_CMPL, "FCFTAB_FCFI_ONLINE_CMPL"},
181c217
< }; /* emlxs_fcftab_state_table */
---
> {FC_FCFTAB_STATE_ONLINE, "FCFTAB_ONLINE"},
182a219
> }; /* emlxs_fc_fcftab_state_table */
184c221,223
< static uint32_t emlxs_fcftab_sol_cmpl_action(emlxs_port_t *port,
---
> static void emlxs_fc_fcftab_online_timer(emlxs_hba_t *hba);
>
> static uint32_t emlxs_fc_fcftab_offline_action(emlxs_port_t *port,
186c225
< static uint32_t emlxs_fcftab_sol_failed_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_online_action(emlxs_port_t *port,
188c227,228
< static uint32_t emlxs_fcftab_sol_action(emlxs_port_t *port,
---
>
> static uint32_t emlxs_fc_fcftab_topo_cmpl_action(emlxs_port_t *port,
190c230
< static uint32_t emlxs_fcftab_shutdown_evt_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_topo_failed_action(emlxs_port_t *port,
192c232
< static uint32_t emlxs_fcftab_linkdown_evt_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_topo_action(emlxs_port_t *port,
194c234,235
< static uint32_t emlxs_fcftab_read_action(emlxs_port_t *port,
---
>
> static uint32_t emlxs_fc_fcftab_cfglink_cmpl_action(emlxs_port_t *port,
196c237
< static uint32_t emlxs_fcftab_read_failed_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_cfglink_failed_action(emlxs_port_t *port,
198c239
< static uint32_t emlxs_fcftab_read_cmpl_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_cfglink_action(emlxs_port_t *port,
200c241,242
< static uint32_t emlxs_fcftab_fcfi_online_action(emlxs_port_t *port,
---
>
> static uint32_t emlxs_fc_fcftab_sparm_cmpl_action(emlxs_port_t *port,
202c244
< static uint32_t emlxs_fcftab_fcfi_online_cmpl_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_sparm_failed_action(emlxs_port_t *port,
204c246
< static uint32_t emlxs_fcftab_fcfi_offline_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_sparm_action(emlxs_port_t *port,
206c248,249
< static uint32_t emlxs_fcftab_fcfi_offline_cmpl_action(emlxs_port_t *port,
---
>
> static uint32_t emlxs_fc_fcftab_linkup_evt_action(emlxs_port_t *port,
208c251
< static uint32_t emlxs_fcftab_found_evt_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_linkdown_evt_action(emlxs_port_t *port,
210c253,254
< static uint32_t emlxs_fcftab_lost_evt_action(emlxs_port_t *port,
---
>
> static uint32_t emlxs_fc_fcftab_fcfi_online_evt_action(emlxs_port_t *port,
212c256
< static uint32_t emlxs_fcftab_changed_evt_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_fcfi_offline_evt_action(emlxs_port_t *port,
214c258,259
< static uint32_t emlxs_fcftab_full_evt_action(emlxs_port_t *port,
---
>
> static uint32_t emlxs_fc_fcftab_shutdown_evt_action(emlxs_port_t *port,
216c261
< static uint32_t emlxs_fcftab_linkup_evt_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_fcfi_offline_action(emlxs_port_t *port,
218c263
< static uint32_t emlxs_fcftab_cvl_evt_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_fcfi_offline_cmpl_action(emlxs_port_t *port,
220c265
< static uint32_t emlxs_fcftab_online_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_fcfi_online_action(emlxs_port_t *port,
222c267
< static uint32_t emlxs_fcftab_offline_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_fcfi_online_cmpl_action(emlxs_port_t *port,
224c269,271
< static uint32_t emlxs_fcftab_fcfi_offline_evt_action(emlxs_port_t *port,
---
>
> static char *emlxs_fc_fcftab_state_xlate(uint32_t state);
> static uint32_t emlxs_fc_fcftab_event(emlxs_port_t *port,
226c273,480
< static uint32_t emlxs_fcftab_fcfi_online_evt_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fc_fcftab_req_handler(emlxs_port_t *port, void *arg1);
>
> /*
> * - Online sequencing can start from FC_FCFTAB_STATE_OFFLINE state
> *
> * - Offline sequencing can interrupt the online sequencing at the
> * entry of the next wait state.
> *
> * NORMAL ONLINE SEQ
> * ---------------------------
> * LINK_UP event <-- Adapter
> * FC_FCFTAB_STATE_OFFLINE
> * FC_FCFTAB_STATE_TOPO
> * FC_FCFTAB_STATE_TOPO_CMPL
> * FC_FCFTAB_STATE_CFGLINK
> * FC_FCFTAB_STATE_CFGLINK_CMPL
> * FC_FCFTAB_STATE_SPARM
> * FC_FCFTAB_STATE_SPARM_CMPL
> * FC_FCFTAB_STATE_FCFI_ONLINE
> * FC_FCFTAB_STATE_FCFI_ONLINE_CMPL
> * FC_FCFTAB_STATE_ONLINE
> *
> *
> * NORMAL OFFLINE SEQ
> * ---------------------------
> * LINK_DOWN event <-- Adapter
> * FC_FCFTAB_STATE_ONLINE
> * FC_FCFTAB_STATE_FCFI_OFFLINE
> * FC_FCFTAB_STATE_FCFI_OFFLINE_CMPL
> * FC_FCFTAB_STATE_OFFLINE
> *
> */
> /* Order does matter */
> static void *emlxs_fc_fcftab_action_table[] =
> {
> /* Action routine Event */
> /* FC_FCFTAB_STATE_SHUTDOWN 0 (Requires adapter reset) */
> (void *) emlxs_fcftab_shutdown_action, /* STATE_ENTER */
> (void *) NULL, /* SHUTDOWN */
> (void *) NULL, /* LINK_UP */
> (void *) NULL, /* LINK_DOWN */
> (void *) NULL, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_OFFLINE 1 (Wait for LINK_UP event) */
> (void *) emlxs_fc_fcftab_offline_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
>
> /* FC_FCFTAB_STATE_TOPO 2 (Wait for topo mbcmpl) */
> (void *) emlxs_fc_fcftab_topo_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_TOPO_FAILED 3 (Transitional) */
> (void *) emlxs_fc_fcftab_topo_failed_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_TOPO_CMPL 4 (Transitional) */
> (void *) emlxs_fc_fcftab_topo_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
>
> /* FC_FCFTAB_STATE_CFGLINK 5 (Wait for cfglink mbcmpl) */
> (void *) emlxs_fc_fcftab_cfglink_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_CFGLINK_FAILED 6 (Transitional) */
> (void *) emlxs_fc_fcftab_cfglink_failed_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_CFGLINK_CMPL 7 (Transitional) */
> (void *) emlxs_fc_fcftab_cfglink_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
>
> /* FC_FCFTAB_STATE_SPARM 8 (Wait for sparm mbcmpl) */
> (void *) emlxs_fc_fcftab_sparm_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_SPARM_FAILED 9 (Transitional) */
> (void *) emlxs_fc_fcftab_sparm_failed_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_SPARM_CMPL 10 (Transitional) */
> (void *) emlxs_fc_fcftab_sparm_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
>
> /* FC_FCFTAB_STATE_FCFI_OFFLINE_CMPL 11 (Transitional) */
> (void *) emlxs_fc_fcftab_fcfi_offline_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_FCFI_OFFLINE 12 (Wait for FCFI_OFFLINE event) */
> (void *) emlxs_fc_fcftab_fcfi_offline_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
>
> /* FC_FCFTAB_STATE_FCFI_ONLINE 13 (Wait for FCFI_ONLINE event) */
> (void *) emlxs_fc_fcftab_fcfi_online_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> /* FC_FCFTAB_STATE_FCFI_ONLINE_CMPL 14 (Transitional) */
> (void *) emlxs_fc_fcftab_fcfi_online_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
>
> /* FC_FCFTAB_STATE_ONLINE 15 (Wait for LINK_DOWN evt) */
> (void *) emlxs_fc_fcftab_online_action, /* STATE_ENTER */
> (void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
>
> }; /* emlxs_fc_fcftab_action_table[] */
> #define FC_FCFTAB_ACTION_EVENTS 6
> #define FC_FCFTAB_ACTION_STATES \
> (sizeof (emlxs_fc_fcftab_action_table)/ \
> (FC_FCFTAB_ACTION_EVENTS * sizeof (void *)))
>
>
> /* ********************************************************************** */
> /* FCOE FCFTAB */
> /* ********************************************************************** */
>
> /* Order does not matter */
> emlxs_table_t emlxs_fcoe_fcftab_state_table[] =
> {
> {FCOE_FCFTAB_STATE_SHUTDOWN, "FCFTAB_SHUTDOWN"},
> {FCOE_FCFTAB_STATE_OFFLINE, "FCFTAB_OFFLINE"},
>
> {FCOE_FCFTAB_STATE_SOLICIT, "FCFTAB_SOLICIT"},
> {FCOE_FCFTAB_STATE_SOLICIT_FAILED, "FCFTAB_SOLICIT_FAILED"},
> {FCOE_FCFTAB_STATE_SOLICIT_CMPL, "FCFTAB_SOLICIT_CMPL"},
>
> {FCOE_FCFTAB_STATE_READ, "FCFTAB_READ"},
> {FCOE_FCFTAB_STATE_READ_FAILED, "FCFTAB_READ_FAILED"},
> {FCOE_FCFTAB_STATE_READ_CMPL, "FCFTAB_READ_CMPL"},
>
> {FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL,
> "FCFTAB_FCFI_OFFLINE_CMPL"},
> {FCOE_FCFTAB_STATE_FCFI_OFFLINE, "FCFTAB_FCFI_OFFLINE"},
>
> {FCOE_FCFTAB_STATE_FCFI_ONLINE, "FCFTAB_FCFI_ONLINE"},
> {FCOE_FCFTAB_STATE_FCFI_ONLINE_CMPL,
> "FCFTAB_FCFI_ONLINE_CMPL"},
>
> {FCOE_FCFTAB_STATE_ONLINE, "FCFTAB_ONLINE"},
>
> }; /* emlxs_fcoe_fcftab_state_table */
>
> static uint32_t emlxs_fcoe_fcftab_sol_cmpl_action(emlxs_port_t *port,
228c482
< static uint32_t emlxs_fcftab_shutdown_action(emlxs_port_t *port,
---
> static uint32_t emlxs_fcoe_fcftab_sol_failed_action(emlxs_port_t *port,
229a484,523
> static uint32_t emlxs_fcoe_fcftab_sol_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_shutdown_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_linkdown_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_read_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_read_failed_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_read_cmpl_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_fcfi_online_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_fcfi_online_cmpl_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_fcfi_offline_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_fcfi_offline_cmpl_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_found_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_lost_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_changed_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_full_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_linkup_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_cvl_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_online_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_offline_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_fcfi_offline_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
> static uint32_t emlxs_fcoe_fcftab_fcfi_online_evt_action(emlxs_port_t *port,
> uint32_t evt, void *arg1);
231,235c525,529
< static void emlxs_fcftab_read_timer(emlxs_hba_t *hba);
< static void emlxs_fcftab_sol_timer(emlxs_hba_t *hba);
< static void emlxs_fcftab_offline_timer(emlxs_hba_t *hba);
< static char *emlxs_fcftab_state_xlate(uint32_t state);
< static uint32_t emlxs_fcftab_event(emlxs_port_t *port,
---
> static void emlxs_fcoe_fcftab_read_timer(emlxs_hba_t *hba);
> static void emlxs_fcoe_fcftab_sol_timer(emlxs_hba_t *hba);
> static void emlxs_fcoe_fcftab_offline_timer(emlxs_hba_t *hba);
> static char *emlxs_fcoe_fcftab_state_xlate(uint32_t state);
> static uint32_t emlxs_fcoe_fcftab_event(emlxs_port_t *port,
236a531,532
> static uint32_t emlxs_fcoe_fcftab_state(emlxs_port_t *port, uint16_t state,
> uint16_t reason, uint32_t explain, void *arg1);
239c535
< * - Online sequencing can start from FCFI_STATE_OFFLINE state
---
> * - Online sequencing can start from FCOE_FCFTAB_STATE_OFFLINE state
247,256c543,552
< * FCFTAB_STATE_OFFLINE
< * FCFTAB_STATE_SOLICIT
< * FCFTAB_STATE_SOLICIT_CMPL
< * FCFTAB_STATE_READ
< * FCFTAB_STATE_READ_CMPL
< * FCFTAB_STATE_FCFI_OFFLINE
< * FCFTAB_STATE_FCFI_OFFLINE_CMPL
< * FCFTAB_STATE_FCFI_ONLINE
< * FCFTAB_STATE_FCFI_ONLINE_CMPL
< * FCFTAB_STATE_ONLINE
---
> * FCOE_FCFTAB_STATE_OFFLINE
> * FCOE_FCFTAB_STATE_SOLICIT
> * FCOE_FCFTAB_STATE_SOLICIT_CMPL
> * FCOE_FCFTAB_STATE_READ
> * FCOE_FCFTAB_STATE_READ_CMPL
> * FCOE_FCFTAB_STATE_FCFI_OFFLINE
> * FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL
> * FCOE_FCFTAB_STATE_FCFI_ONLINE
> * FCOE_FCFTAB_STATE_FCFI_ONLINE_CMPL
> * FCOE_FCFTAB_STATE_ONLINE
262,265c558,561
< * FCFTAB_STATE_ONLINE
< * FCFTAB_STATE_FCFI_OFFLINE
< * FCFTAB_STATE_FCFI_OFFLINE_CMPL
< * FCFTAB_STATE_OFFLINE
---
> * FCOE_FCFTAB_STATE_ONLINE
> * FCOE_FCFTAB_STATE_FCFI_OFFLINE
> * FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL
> * FCOE_FCFTAB_STATE_OFFLINE
269c565
< static void *emlxs_fcftab_action_table[] =
---
> static void *emlxs_fcoe_fcftab_action_table[] =
272c568
< /* FCFTAB_STATE_SHUTDOWN 0 (Requires adapter reset) */
---
> /* FCOE_FCFTAB_STATE_SHUTDOWN 0 (Requires adapter reset) */
283c579
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
285,296c581,592
< /* FCFTAB_STATE_OFFLINE 1 (Wait for LINK_UP event) */
< (void *) emlxs_fcftab_offline_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_OFFLINE 1 (Wait for LINK_UP event) */
> (void *) emlxs_fcoe_fcftab_offline_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
299,310c595,606
< /* FCFTAB_STATE_SOLICIT 2 (Wait on fcf_solicit cmpl) */
< (void *) emlxs_fcftab_sol_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_SOLICIT 2 (Wait on fcf_solicit cmpl) */
> (void *) emlxs_fcoe_fcftab_sol_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
312,323c608,619
< /* FCFTAB_STATE_SOLICIT_FAILED 3 (Transitional) */
< (void *) emlxs_fcftab_sol_failed_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_SOLICIT_FAILED 3 (Transitional) */
> (void *) emlxs_fcoe_fcftab_sol_failed_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
325,336c621,632
< /* FCFTAB_STATE_SOLICIT_CMPL 4 (Wait on fcf timer cmpl) */
< (void *) emlxs_fcftab_sol_cmpl_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_SOLICIT_CMPL 4 (Wait on fcf timer cmpl) */
> (void *) emlxs_fcoe_fcftab_sol_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
339,350c635,646
< /* FCFTAB_STATE_READ 5 (Wait on fcf_read cmpl) */
< (void *) emlxs_fcftab_read_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_READ 5 (Wait on fcf_read cmpl) */
> (void *) emlxs_fcoe_fcftab_read_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
352,363c648,659
< /* FCFTAB_STATE_READ_FAILED 6 (Transitional) */
< (void *) emlxs_fcftab_read_failed_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_READ_FAILED 6 (Transitional) */
> (void *) emlxs_fcoe_fcftab_read_failed_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
365,376c661,672
< /* FCFTAB_STATE_READ_CMPL 7 (Transitional) */
< (void *) emlxs_fcftab_read_cmpl_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_READ_CMPL 7 (Transitional) */
> (void *) emlxs_fcoe_fcftab_read_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
379,390c675,686
< /* FCFTAB_STATE_FCFI_OFFLINE_CMPL 8 (Transitional) */
< (void *) emlxs_fcftab_fcfi_offline_cmpl_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL 8 (Transitional) */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
392,403c688,699
< /* FCFTAB_STATE_FCFI_OFFLINE 9 (Wait for FCFI_OFFLINE event) */
< (void *) emlxs_fcftab_fcfi_offline_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_FCFI_OFFLINE 9 (Wait for FCFI_OFFLINE event) */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
406,417c702,713
< /* FCFTAB_STATE_FCFI_ONLINE 10 (Wait on FCFI_ONLINE event) */
< (void *) emlxs_fcftab_fcfi_online_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_FCFI_ONLINE 10 (Wait on FCFI_ONLINE event) */
> (void *) emlxs_fcoe_fcftab_fcfi_online_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
419,430c715,726
< /* FCFTAB_STATE_FCFI_ONLINE_CMPL 11 (Transitional) */
< (void *) emlxs_fcftab_fcfi_online_cmpl_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_FCFI_ONLINE_CMPL 11 (Transitional) */
> (void *) emlxs_fcoe_fcftab_fcfi_online_cmpl_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
433,444c729,740
< /* FCFTAB_STATE_ONLINE 12 (Wait for LINK_DOWN event) */
< (void *) emlxs_fcftab_online_action, /* STATE_ENTER */
< (void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
< (void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
< (void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
< (void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
< (void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
< (void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
< (void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
< (void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
< (void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
< (void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
---
> /* FCOE_FCFTAB_STATE_ONLINE 12 (Wait for LINK_DOWN event) */
> (void *) emlxs_fcoe_fcftab_online_action, /* STATE_ENTER */
> (void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
> (void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
> (void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
> (void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
> (void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
> (void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
> (void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
> (void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
> (void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
> (void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
446,450c742,746
< }; /* emlxs_fcftab_action_table[] */
< #define FCFTAB_ACTION_EVENTS 11
< #define FCFTAB_ACTION_STATES \
< (sizeof (emlxs_fcftab_action_table)/ \
< (FCFTAB_ACTION_EVENTS * sizeof (void *)))
---
> }; /* emlxs_fcoe_fcftab_action_table[] */
> #define FCOE_FCFTAB_ACTION_EVENTS 11
> #define FCOE_FCFTAB_ACTION_STATES \
> (sizeof (emlxs_fcoe_fcftab_action_table)/ \
> (FCOE_FCFTAB_ACTION_EVENTS * sizeof (void *)))
453,455d748
< /* ********************************************************************** */
< /* VFTAB - This will be needed for multi-virtual fabric environments */
< /* ********************************************************************** */
457,460d749
< /* Order does not matter */
< emlxs_table_t emlxs_vftab_state_table[] =
< {
< {VFTAB_STATE_DISABLED, "VFTAB_STATE_DISABLED"},
462,465d750
< }; /* emlxs_vftab_state_table */
<
<
<
473c758
< {FCFI_STATE_FREE, "FCFI_STATE_FREE"},
---
> {FCFI_STATE_FREE, "FCFI_FREE"},
475c760
< {FCFI_STATE_OFFLINE, "FCFI_STATE_OFFLINE"},
---
> {FCFI_STATE_OFFLINE, "FCFI_OFFLINE"},
477,479c762,764
< {FCFI_STATE_UNREG_CMPL, "FCFI_STATE_UNREG_CMPL"},
< {FCFI_STATE_UNREG_FAILED, "FCFI_STATE_UNREG_FAILED"},
< {FCFI_STATE_UNREG, "FCFI_STATE_UNREG"},
---
> {FCFI_STATE_UNREG_CMPL, "FCFI_UNREG_CMPL"},
> {FCFI_STATE_UNREG_FAILED, "FCFI_UNREG_FAILED"},
> {FCFI_STATE_UNREG, "FCFI_UNREG"},
481,483c766,768
< {FCFI_STATE_REG, "FCFI_STATE_REG"},
< {FCFI_STATE_REG_FAILED, "FCFI_STATE_REG_FAILED"},
< {FCFI_STATE_REG_CMPL, "FCFI_STATE_REG_CMPL"},
---
> {FCFI_STATE_REG, "FCFI_REG"},
> {FCFI_STATE_REG_FAILED, "FCFI_REG_FAILED"},
> {FCFI_STATE_REG_CMPL, "FCFI_REG_CMPL"},
485,486c770,771
< {FCFI_STATE_VFI_OFFLINE_CMPL, "FCFI_STATE_VFI_OFFLINE_CMPL"},
< {FCFI_STATE_VFI_OFFLINE, "FCFI_STATE_VFI_OFFLINE"},
---
> {FCFI_STATE_VFI_OFFLINE_CMPL, "FCFI_VFI_OFFLINE_CMPL"},
> {FCFI_STATE_VFI_OFFLINE, "FCFI_VFI_OFFLINE"},
488,489c773,774
< {FCFI_STATE_VFI_ONLINE, "FCFI_STATE_VFI_ONLINE"},
< {FCFI_STATE_VFI_ONLINE_CMPL, "FCFI_STATE_VFI_ONLINE_CMPL"},
---
> {FCFI_STATE_VFI_ONLINE, "FCFI_VFI_ONLINE"},
> {FCFI_STATE_VFI_ONLINE_CMPL, "FCFI_VFI_ONLINE_CMPL"},
491,492c776,777
< {FCFI_STATE_PAUSED, "FCFI_STATE_PAUSED"},
< {FCFI_STATE_ONLINE, "FCFI_STATE_ONLINE"},
---
> {FCFI_STATE_PAUSED, "FCFI_PAUSED"},
> {FCFI_STATE_ONLINE, "FCFI_ONLINE"},
715c1000
< {VFI_STATE_OFFLINE, "VFI_STATE_OFFLINE"},
---
> {VFI_STATE_OFFLINE, "VFI_OFFLINE"},
717,719c1002,1004
< {VFI_STATE_INIT, "VFI_STATE_INIT"},
< {VFI_STATE_INIT_FAILED, "VFI_STATE_INIT_FAILED"},
< {VFI_STATE_INIT_CMPL, "VFI_STATE_INIT_CMPL"},
---
> {VFI_STATE_INIT, "VFI_INIT"},
> {VFI_STATE_INIT_FAILED, "VFI_INIT_FAILED"},
> {VFI_STATE_INIT_CMPL, "VFI_INIT_CMPL"},
721,722c1006,1007
< {VFI_STATE_VPI_OFFLINE_CMPL, "VFI_STATE_VPI_OFFLINE_CMPL"},
< {VFI_STATE_VPI_OFFLINE, "VFI_STATE_VPI_OFFLINE"},
---
> {VFI_STATE_VPI_OFFLINE_CMPL, "VFI_VPI_OFFLINE_CMPL"},
> {VFI_STATE_VPI_OFFLINE, "VFI_VPI_OFFLINE"},
724,725c1009,1010
< {VFI_STATE_VPI_ONLINE, "VFI_STATE_VPI_ONLINE"},
< {VFI_STATE_VPI_ONLINE_CMPL, "VFI_STATE_VPI_ONLINE_CMPL"},
---
> {VFI_STATE_VPI_ONLINE, "VFI_VPI_ONLINE"},
> {VFI_STATE_VPI_ONLINE_CMPL, "VFI_VPI_ONLINE_CMPL"},
727,729c1012,1014
< {VFI_STATE_UNREG_CMPL, "VFI_STATE_UNREG_CMPL"},
< {VFI_STATE_UNREG_FAILED, "VFI_STATE_UNREG_FAILED"},
< {VFI_STATE_UNREG, "VFI_STATE_UNREG"},
---
> {VFI_STATE_UNREG_CMPL, "VFI_UNREG_CMPL"},
> {VFI_STATE_UNREG_FAILED, "VFI_UNREG_FAILED"},
> {VFI_STATE_UNREG, "VFI_UNREG"},
731,733c1016,1018
< {VFI_STATE_REG, "VFI_STATE_REG"},
< {VFI_STATE_REG_FAILED, "VFI_STATE_REG_FAILED"},
< {VFI_STATE_REG_CMPL, "VFI_STATE_REG_CMPL"},
---
> {VFI_STATE_REG, "VFI_REG"},
> {VFI_STATE_REG_FAILED, "VFI_REG_FAILED"},
> {VFI_STATE_REG_CMPL, "VFI_REG_CMPL"},
735,736c1020,1021
< {VFI_STATE_PAUSED, "VFI_STATE_PAUSED"},
< {VFI_STATE_ONLINE, "VFI_STATE_ONLINE"},
---
> {VFI_STATE_PAUSED, "VFI_PAUSED"},
> {VFI_STATE_ONLINE, "VFI_ONLINE"},
980c1265
< {VPI_STATE_OFFLINE, "VPI_STATE_OFFLINE"},
---
> {VPI_STATE_OFFLINE, "VPI_OFFLINE"},
982,984c1267,1269
< {VPI_STATE_INIT, "VPI_STATE_INIT"},
< {VPI_STATE_INIT_FAILED, "VPI_STATE_INIT_FAILED"},
< {VPI_STATE_INIT_CMPL, "VPI_STATE_INIT_CMPL"},
---
> {VPI_STATE_INIT, "VPI_INIT"},
> {VPI_STATE_INIT_FAILED, "VPI_INIT_FAILED"},
> {VPI_STATE_INIT_CMPL, "VPI_INIT_CMPL"},
986,988c1271,1273
< {VPI_STATE_UNREG_CMPL, "VPI_STATE_UNREG_CMPL"},
< {VPI_STATE_UNREG_FAILED, "VPI_STATE_UNREG_FAILED"},
< {VPI_STATE_UNREG, "VPI_STATE_UNREG"},
---
> {VPI_STATE_UNREG_CMPL, "VPI_UNREG_CMPL"},
> {VPI_STATE_UNREG_FAILED, "VPI_UNREG_FAILED"},
> {VPI_STATE_UNREG, "VPI_UNREG"},
990,992c1275,1277
< {VPI_STATE_LOGO_CMPL, "VPI_STATE_LOGO_CMPL"},
< {VPI_STATE_LOGO_FAILED, "VPI_STATE_LOGO_FAILED"},
< {VPI_STATE_LOGO, "VPI_STATE_LOGO"},
---
> {VPI_STATE_LOGO_CMPL, "VPI_LOGO_CMPL"},
> {VPI_STATE_LOGO_FAILED, "VPI_LOGO_FAILED"},
> {VPI_STATE_LOGO, "VPI_LOGO"},
994,995c1279,1280
< {VPI_STATE_PORT_OFFLINE, "VPI_STATE_PORT_OFFLINE"},
< {VPI_STATE_PORT_ONLINE, "VPI_STATE_PORT_ONLINE"},
---
> {VPI_STATE_PORT_OFFLINE, "VPI_PORT_OFFLINE"},
> {VPI_STATE_PORT_ONLINE, "VPI_PORT_ONLINE"},
997,999c1282,1284
< {VPI_STATE_LOGI, "VPI_STATE_LOGI"},
< {VPI_STATE_LOGI_FAILED, "VPI_STATE_LOGI_FAILED"},
< {VPI_STATE_LOGI_CMPL, "VPI_STATE_LOGI_CMPL"},
---
> {VPI_STATE_LOGI, "VPI_LOGI"},
> {VPI_STATE_LOGI_FAILED, "VPI_LOGI_FAILED"},
> {VPI_STATE_LOGI_CMPL, "VPI_LOGI_CMPL"},
1001,1003c1286,1288
< {VPI_STATE_REG, "VPI_STATE_REG"},
< {VPI_STATE_REG_FAILED, "VPI_STATE_REG_FAILED"},
< {VPI_STATE_REG_CMPL, "VPI_STATE_REG_CMPL"},
---
> {VPI_STATE_REG, "VPI_REG"},
> {VPI_STATE_REG_FAILED, "VPI_REG_FAILED"},
> {VPI_STATE_REG_CMPL, "VPI_REG_CMPL"},
1005,1006c1290,1291
< {VPI_STATE_PAUSED, "VPI_STATE_PAUSED"},
< {VPI_STATE_ONLINE, "VPI_STATE_ONLINE"},
---
> {VPI_STATE_PAUSED, "VPI_PAUSED"},
> {VPI_STATE_ONLINE, "VPI_ONLINE"},
1073,1074c1358,1361
< static void emlxs_vpi_flogi_cmpl(emlxs_port_t *port, VPIobj_t *vpip,
< uint32_t status);
---
> static uint32_t emlxs_vpi_logi_cmpl_notify(emlxs_port_t *port,
> RPIobj_t *rpip);
> static void emlxs_vpi_logo_handler(emlxs_port_t *port,
> VPIobj_t *vpip);
1324c1611
< {RPI_STATE_FREE, "RPI_STATE_FREE"},
---
> {RPI_STATE_FREE, "RPI_FREE"},
1326c1613,1614
< {RPI_STATE_OFFLINE, "RPI_STATE_OFFLINE"},
---
> {RPI_STATE_RESERVED, "RPI_RESERVED"},
> {RPI_STATE_OFFLINE, "RPI_OFFLINE"},
1328,1330c1616,1618
< {RPI_STATE_UNREG_CMPL, "RPI_STATE_UNREG_CMPL"},
< {RPI_STATE_UNREG_FAILED, "RPI_STATE_UNREG_FAILED"},
< {RPI_STATE_UNREG, "RPI_STATE_UNREG"},
---
> {RPI_STATE_UNREG_CMPL, "RPI_UNREG_CMPL"},
> {RPI_STATE_UNREG_FAILED, "RPI_UNREG_FAILED"},
> {RPI_STATE_UNREG, "RPI_UNREG"},
1332,1334c1620,1622
< {RPI_STATE_REG, "RPI_STATE_REG"},
< {RPI_STATE_REG_FAILED, "RPI_STATE_REG_FAILED"},
< {RPI_STATE_REG_CMPL, "RPI_STATE_REG_CMPL"},
---
> {RPI_STATE_REG, "RPI_REG"},
> {RPI_STATE_REG_FAILED, "RPI_REG_FAILED"},
> {RPI_STATE_REG_CMPL, "RPI_REG_CMPL"},
1336c1624
< {RPI_STATE_PAUSED, "RPI_STATE_PAUSED"},
---
> {RPI_STATE_PAUSED, "RPI_PAUSED"},
1338,1340c1626,1628
< {RPI_STATE_RESUME, "RPI_STATE_RESUME"},
< {RPI_STATE_RESUME_FAILED, "RPI_STATE_RESUME_FAILED"},
< {RPI_STATE_RESUME_CMPL, "RPI_STATE_RESUME_CMPL"},
---
> {RPI_STATE_RESUME, "RPI_RESUME"},
> {RPI_STATE_RESUME_FAILED, "RPI_RESUME_FAILED"},
> {RPI_STATE_RESUME_CMPL, "RPI_RESUME_CMPL"},
1342c1630
< {RPI_STATE_ONLINE, "RPI_STATE_ONLINE"},
---
> {RPI_STATE_ONLINE, "RPI_ONLINE"},
1377a1666,1667
> static uint32_t emlxs_rpi_reserved_action(emlxs_port_t *port,
> RPIobj_t *rpip, uint32_t evt, void *arg1);
1397a1688,1699
>
> static void emlxs_rpi_idle_timer(emlxs_hba_t *hba);
>
> static uint32_t emlxs_rpi_state(emlxs_port_t *port, RPIobj_t *rpip,
> uint16_t state, uint16_t reason, uint32_t explain,
> void *arg1);
>
> static void emlxs_rpi_alloc_fabric_rpi(emlxs_port_t *port);
>
> static void emlxs_rpi_deferred_cmpl(emlxs_port_t *port, RPIobj_t *rpip,
> uint32_t status);
>
1399c1701
< * - Online sequencing can start from RPI_STATE_OFFLINE state or
---
> * - Online sequencing can start from RPI_STATE_RESERVED state or
1408c1710
< * RPI_STATE_OFFLINE
---
> * RPI_STATE_RESERVED
1443c1745,1752
< /* RPI_STATE_OFFLINE 1 (Wait for RPI_ONLINE event) */
---
> /* RPI_STATE_RESERVED 1 (Wait for RPI_ONLINE event) */
> (void *) emlxs_rpi_reserved_action, /* STATE_ENTER */
> (void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
> (void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
> (void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
> (void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
>
> /* RPI_STATE_OFFLINE 2 (Transitional) */
1450c1759
< /* RPI_STATE_UNREG_CMPL 2 (Transitional) */
---
> /* RPI_STATE_UNREG_CMPL 3 (Transitional) */
1457c1766
< /* RPI_STATE_UNREG_FAILED 3 (Transitional) */
---
> /* RPI_STATE_UNREG_FAILED 4 (Transitional) */
1464c1773
< /* RPI_STATE_UNREG 4 (Wait for unreg_rpi cmpl) */
---
> /* RPI_STATE_UNREG 5 (Wait for unreg_rpi cmpl) */
1472c1781
< /* RPI_STATE_REG 5 (Wait for reg_rpi cmpl) */
---
> /* RPI_STATE_REG 6 (Wait for reg_rpi cmpl) */
1479c1788
< /* RPI_STATE_REG_FAILED 6 (Transitional) */
---
> /* RPI_STATE_REG_FAILED 7 (Transitional) */
1486c1795
< /* RPI_STATE_REG_CMPL 7 (Transitional) */
---
> /* RPI_STATE_REG_CMPL 8 (Transitional) */
1494c1803
< /* RPI_STATE_PAUSED 8 (Wait for RPI_ONLINE) */
---
> /* RPI_STATE_PAUSED 9 (Wait for RPI_ONLINE) */
1502c1811
< /* RPI_STATE_RESUME 9 (Wait for resume_rpi mbcmpl) */
---
> /* RPI_STATE_RESUME 10 (Wait for resume_rpi mbcmpl) */
1509c1818
< /* RPI_STATE_RESUME_FAILED 10 (Transitional) */
---
> /* RPI_STATE_RESUME_FAILED 11 (Transitional) */
1516c1825
< /* RPI_STATE_RESUME_CMPL 11 (Transitional) */
---
> /* RPI_STATE_RESUME_CMPL 12 (Transitional) */
1524c1833
< /* RPI_STATE_ONLINE 12 (Wait for RPI_OFFLINE event) */
---
> /* RPI_STATE_ONLINE 13 (Wait for RPI_OFFLINE event) */
1540a1850,1853
> static void
> emlxs_fcf_linkdown(emlxs_port_t *port)
> {
> emlxs_hba_t *hba = HBA;
1541a1855,1917
> if (hba->state <= FC_LINK_DOWN) {
> return;
> }
>
> mutex_enter(&EMLXS_PORT_LOCK);
>
> if (hba->state <= FC_LINK_DOWN) {
> mutex_exit(&EMLXS_PORT_LOCK);
> return;
> }
>
> HBASTATS.LinkDown++;
> EMLXS_STATE_CHANGE_LOCKED(hba, FC_LINK_DOWN);
>
> hba->flag &= FC_LINKDOWN_MASK;
> hba->discovery_timer = 0;
> hba->linkup_timer = 0;
>
> mutex_exit(&EMLXS_PORT_LOCK);
>
> emlxs_log_link_event(port);
>
> return;
>
> } /* emlxs_fcf_linkdown() */
>
>
> static void
> emlxs_fcf_linkup(emlxs_port_t *port)
> {
> emlxs_hba_t *hba = HBA;
> emlxs_config_t *cfg = &CFG;
>
> if (hba->state >= FC_LINK_UP) {
> return;
> }
>
> mutex_enter(&EMLXS_PORT_LOCK);
>
> if (hba->state >= FC_LINK_UP) {
> mutex_exit(&EMLXS_PORT_LOCK);
> return;
> }
>
> /* Check for any mode changes */
> emlxs_mode_set(hba);
>
> HBASTATS.LinkUp++;
> EMLXS_STATE_CHANGE_LOCKED(hba, FC_LINK_UP);
>
> hba->discovery_timer = hba->timer_tics +
> cfg[CFG_LINKUP_TIMEOUT].current +
> cfg[CFG_DISC_TIMEOUT].current;
>
> mutex_exit(&EMLXS_PORT_LOCK);
>
> emlxs_log_link_event(port);
>
> return;
>
> } /* emlxs_fcf_linkup() */
>
>
1551c1927
< if (!fcftab->table) {
---
> if (!(hba->sli.sli4.flag & EMLXS_SLI4_FCF_INIT)) {
1556,1557c1932,1933
< "emlxs_fcf_fini: %s flag=%x fcfi_online=%d.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcf_fini: %s flag=%x fcfi_online=%d.",
> emlxs_fcftab_state_xlate(port, fcftab->state),
1560c1936
< if (fcftab->state != FCFTAB_STATE_SHUTDOWN) {
---
> if (!(fcftab->flag & EMLXS_FCFTAB_SHUTDOWN)) {
1564a1941
> hba->sli.sli4.flag &= ~EMLXS_SLI4_FCF_INIT;
1586c1963
< rpip = &vport->VPIobj.fcf_rpi;
---
> rpip = vport->vpip->fabric_rpip;
1613d1989
<
1628a2005
> VPIobj_t *vpip;
1631d2007
< char buf[64];
1633d2008
< uint16_t index;
1635c2010
< if (fcftab->table) {
---
> if (hba->sli.sli4.flag & EMLXS_SLI4_FCF_INIT) {
1638a2014,2016
> mutex_init(&EMLXS_FCF_LOCK, NULL, MUTEX_DRIVER, NULL);
> mutex_enter(&EMLXS_FCF_LOCK);
>
1642,1646d2019
<
< (void) sprintf(buf, "%s_fcf_lock mutex", DRIVER_NAME);
< mutex_init(&EMLXS_FCF_LOCK, buf, MUTEX_DRIVER, NULL);
< mutex_enter(&EMLXS_FCF_LOCK);
<
1668,1670c2041,2042
< index = hba->sli.sli4.VFIBase;
< for (i = 0; i < hba->sli.sli4.VFICount; i++, vfip++, index++) {
< vfip->VFI = index;
---
> for (i = 0; i < hba->sli.sli4.VFICount; i++, vfip++) {
> vfip->VFI = emlxs_sli4_index_to_vfi(hba, i);
1672c2044
< vfip->state = VPI_STATE_OFFLINE;
---
> vfip->state = VFI_STATE_OFFLINE;
1679c2051
< bzero(&vport->VPIobj, sizeof (VPIobj_t));
---
> vpip = &vport->VPIobj;
1681,1684c2053,2058
< vport->VPIobj.index = i;
< vport->VPIobj.VPI = i + hba->sli.sli4.VPIBase;
< vport->VPIobj.port = vport;
< vport->VPIobj.state = VPI_STATE_OFFLINE;
---
> bzero(vpip, sizeof (VPIobj_t));
> vpip->index = i;
> vpip->VPI = emlxs_sli4_index_to_vpi(hba, i);
> vpip->port = vport;
> vpip->state = VPI_STATE_OFFLINE;
> vport->vpip = vpip;
1687c2061
< rpip = &vport->VPIobj.fcf_rpi;
---
> rpip = &vpip->fabric_rpi;
1689d2062
< rpip->RPI = 0xffff;
1690a2064
> rpip->RPI = FABRIC_RPI;
1692,1693c2066,2067
< rpip->vpip = &vport->VPIobj;
< vport->VPIobj.rpip = rpip;
---
> rpip->vpip = vpip;
> vpip->fabric_rpip = rpip;
1702,1703c2076
< index = hba->sli.sli4.RPIBase;
< for (i = 0; i < hba->sli.sli4.RPICount; i++, rpip++, index++) {
---
> for (i = 0; i < hba->sli.sli4.RPICount; i++, rpip++) {
1705c2078
< rpip->RPI = index;
---
> rpip->RPI = emlxs_sli4_index_to_rpi(hba, i);
1710,1711c2083,2084
< "emlxs_fcf_init: %s flag=%x fcfi=%d vfi=%d vpi=%d rpi=%d",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcf_init: %s flag=%x fcfi=%d vfi=%d vpi=%d rpi=%d.",
> emlxs_fcftab_state_xlate(port, fcftab->state),
1717a2091
> hba->sli.sli4.flag |= EMLXS_SLI4_FCF_INIT;
1739c2113
< (void) sprintf(buffer, "event=0x%x", state);
---
> (void) snprintf(buffer, sizeof (buffer), "event=0x%x", state);
1759c2133
< (void) sprintf(buffer, "reason=0x%x", reason);
---
> (void) snprintf(buffer, sizeof (buffer), "reason=0x%x", reason);
1780c2154,2155
< emlxs_fcftab_sol_timer(hba);
---
> if (SLI4_FCOE_MODE) {
> emlxs_fcoe_fcftab_sol_timer(hba);
1782c2157
< emlxs_fcftab_read_timer(hba);
---
> emlxs_fcoe_fcftab_read_timer(hba);
1784c2159,2162
< emlxs_fcftab_offline_timer(hba);
---
> emlxs_fcoe_fcftab_offline_timer(hba);
> } else {
> emlxs_fc_fcftab_online_timer(hba);
> }
1785a2164,2165
> emlxs_rpi_idle_timer(hba);
>
1799c2179
< uint32_t rval;
---
> uint32_t rval = 0;
1806c2186,2187
< if (!(pport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
1809a2191,2194
> if (fcftab->flag & EMLXS_FCFTAB_SHUTDOWN) {
> return (0);
> }
>
1811a2197,2202
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcf_shutdown_notify: %s flag=%x "
> "fcfi_online=%d. Shutting down FCFTAB. >",
> emlxs_fcftab_state_xlate(port, fcftab->state),
> fcftab->flag, fcftab->fcfi_online);
>
1815c2206
< /* Wait for FCF table to shutdown */
---
> /* Wait for shutdown flag */
1817,1821c2208
< while (i++ < 120) {
< if (fcftab->flag & EMLXS_FCFTAB_SHUTDOWN) {
< break;
< }
<
---
> while (!(fcftab->flag & EMLXS_FCFTAB_SHUTDOWN) && (i++ < 120)) {
1823c2210
< DELAYMS(1000);
---
> BUSYWAIT_MS(1000);
1827c2214
< if (i >= 120) {
---
> if (!(fcftab->flag & EMLXS_FCFTAB_SHUTDOWN)) {
1829,1831c2216,2218
< "fcf_shutdown_notify: %s flag=%x fcfi_online=%d. "
< "Shutdown timeout.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcf_shutdown_notify: %s flag=%x "
> "fcfi_online=%d. Shutdown timeout.",
> emlxs_fcftab_state_xlate(port, fcftab->state),
1832a2220
> rval = 1;
1848c2236,2237
< uint32_t rval;
---
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
1854c2243,2244
< if (!(pport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
1859a2250,2255
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcf_linkup_notify: %s flag=%x "
> "fcfi_online=%d. FCFTAB Link up. >",
> emlxs_fcftab_state_xlate(port, fcftab->state),
> fcftab->flag, fcftab->fcfi_online);
>
1874c2270,2271
< uint32_t rval;
---
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
1880c2277,2278
< if (!(pport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
1885a2284,2289
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcf_linkdown_notify: %s flag=%x "
> "fcfi_online=%d. FCFTAB Link down. >",
> emlxs_fcftab_state_xlate(port, fcftab->state),
> fcftab->flag, fcftab->fcfi_online);
>
1900c2304,2305
< uint32_t rval;
---
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
1906c2311,2312
< if (!(pport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
1911a2318,2323
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcf_cvl_notify: %s flag=%x "
> "fcfi_online=%d. FCFTAB FCF CVL. >",
> emlxs_fcftab_state_xlate(port, fcftab->state),
> fcftab->flag, fcftab->fcfi_online);
>
1913c2325
< (void *)((uintptr_t)vpi));
---
> (void *)((unsigned long)vpi));
1927c2339,2340
< uint32_t rval;
---
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
1933c2346,2347
< if (!(pport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
1938a2353,2358
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcf_full_notify: %s flag=%x "
> "fcfi_online=%d. FCFTAB FCF full. >",
> emlxs_fcftab_state_xlate(port, fcftab->state),
> fcftab->flag, fcftab->fcfi_online);
>
1953c2373,2374
< uint32_t rval;
---
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
1959c2380,2381
< if (!(pport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
1964a2387,2392
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcf_found_notify: %s flag=%x "
> "fcfi_online=%d. FCFTAB FCF found. >",
> emlxs_fcftab_state_xlate(port, fcftab->state),
> fcftab->flag, fcftab->fcfi_online);
>
1966c2394
< (void *)((uintptr_t)fcf_index));
---
> (void *)((unsigned long)fcf_index));
1980c2408,2409
< uint32_t rval;
---
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
1986c2415,2416
< if (!(pport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
1991a2422,2427
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcf_changes_notify: %s flag=%x "
> "fcfi_online=%d. FCFTAB FCF changed. >",
> emlxs_fcftab_state_xlate(port, fcftab->state),
> fcftab->flag, fcftab->fcfi_online);
>
1993c2429
< (void *)((uintptr_t)fcf_index));
---
> (void *)((unsigned long)fcf_index));
2007c2443,2444
< uint32_t rval;
---
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
2013c2450,2451
< if (!(pport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
2018a2457,2462
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcf_lost_notify: %s flag=%x "
> "fcfi_online=%d. FCFTAB FCF lost. >",
> emlxs_fcftab_state_xlate(port, fcftab->state),
> fcftab->flag, fcftab->fcfi_online);
>
2020c2464
< (void *)((uintptr_t)fcf_index));
---
> (void *)((unsigned long)fcf_index));
2028a2473,2475
> /* ************************************************************************** */
> /* FCFTAB Generic */
> /* ************************************************************************** */
2029a2477,2616
> static char *
> emlxs_fcftab_state_xlate(emlxs_port_t *port, uint32_t state)
> {
> emlxs_hba_t *hba = HBA;
>
> if (SLI4_FCOE_MODE) {
> return (emlxs_fcoe_fcftab_state_xlate(state));
> } else {
> return (emlxs_fc_fcftab_state_xlate(state));
> }
>
> } /* emlxs_fcftab_state_xlate() */
>
> static uint32_t
> emlxs_fcftab_event(emlxs_port_t *port, uint32_t evt, void *arg1)
> {
> emlxs_hba_t *hba = HBA;
>
> if (SLI4_FCOE_MODE) {
> return (emlxs_fcoe_fcftab_event(port, evt, arg1));
> } else {
> return (emlxs_fc_fcftab_event(port, evt, arg1));
> }
>
> } /* emlxs_fcftab_event() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fcftab_shutdown_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> FCFIobj_t *fcfp;
> uint32_t i;
> uint32_t online;
>
> if (fcftab->state != FCFTAB_STATE_SHUTDOWN) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fcftab_shutdown_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcftab_state_xlate(port, fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
>
> if (fcftab->prev_state != FCFTAB_STATE_SHUTDOWN) {
> /* Offline all FCF's */
> online = 0;
> fcfp = fcftab->table;
> for (i = 0; i < fcftab->table_count; i++, fcfp++) {
>
> if (fcfp->state <= FCFI_STATE_OFFLINE) {
> continue;
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcftab_shutdown_action:%x fcfi_online=%d. "
> "Offlining FCFI:%d. >",
> fcftab->TID,
> fcftab->fcfi_online,
> fcfp->fcf_index);
>
> (void) emlxs_fcfi_event(port, FCF_EVENT_FCFI_OFFLINE,
> fcfp);
>
> online++;
> }
>
> if (!online) {
> goto done;
> }
>
> return (0);
> }
>
> /* Check FCF states */
> online = 0;
> fcfp = fcftab->table;
> for (i = 0; i < fcftab->table_count; i++, fcfp++) {
>
> if (fcfp->state <= FCFI_STATE_OFFLINE) {
> continue;
> }
>
> online++;
> }
>
> if (online) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcftab_shutdown_action:%x %s:%s arg=%p. "
> "fcfi_online=%d,%d <",
> fcftab->TID,
> emlxs_fcftab_state_xlate(port, fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> online, fcftab->fcfi_online);
>
> return (0);
> }
>
> done:
> /* Free FCF table */
> fcfp = fcftab->table;
> for (i = 0; i < fcftab->table_count; i++, fcfp++) {
>
> if (fcfp->state == FCFI_STATE_FREE) {
> continue;
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcftab_shutdown_action:%x. Freeing FCFI:%d. >",
> fcftab->TID,
> fcfp->fcf_index);
>
> (void) emlxs_fcfi_free(port, fcfp);
> }
>
> /* Clean the selection table */
> bzero(fcftab->fcfi, sizeof (fcftab->fcfi));
> fcftab->fcfi_count = 0;
>
> fcftab->flag |= EMLXS_FCFTAB_SHUTDOWN;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcftab_shutdown_action:%x %s:%s arg=%p flag=%x fcfi_online=%d. "
> "Shutdown. <",
> fcftab->TID,
> emlxs_fcftab_state_xlate(port, fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag, fcftab->fcfi_online);
>
> return (0);
>
> } /* emlxs_fcftab_shutdown_action() */
>
>
2031c2618
< /* FCFTAB */
---
> /* FC FCFTAB */
2035c2622
< emlxs_fcftab_state_xlate(uint32_t state)
---
> emlxs_fc_fcftab_state_xlate(uint32_t state)
2041c2628
< count = sizeof (emlxs_fcftab_state_table) / sizeof (emlxs_table_t);
---
> count = sizeof (emlxs_fc_fcftab_state_table) / sizeof (emlxs_table_t);
2043,2044c2630,2631
< if (state == emlxs_fcftab_state_table[i].code) {
< return (emlxs_fcftab_state_table[i].string);
---
> if (state == emlxs_fc_fcftab_state_table[i].code) {
> return (emlxs_fc_fcftab_state_table[i].string);
2048c2635
< (void) sprintf(buffer, "state=0x%x", state);
---
> (void) snprintf(buffer, sizeof (buffer), "state=0x%x", state);
2051c2638
< } /* emlxs_fcftab_state_xlate() */
---
> } /* emlxs_fc_fcftab_state_xlate() */
2055c2642
< emlxs_fcftab_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fc_fcftab_action(emlxs_port_t *port, uint32_t evt,
2060c2647
< uint32_t rval;
---
> uint32_t rval = 0;
2079a2667,4642
> case FCF_EVENT_FCFI_ONLINE:
> index = 4;
> break;
> case FCF_EVENT_FCFI_OFFLINE:
> index = 5;
> break;
> default:
> return (1);
> }
>
> events = FC_FCFTAB_ACTION_EVENTS;
> state = fcftab->state;
>
> index += (state * events);
> func = (uint32_t(*) (emlxs_port_t *, uint32_t, void *))
> emlxs_fc_fcftab_action_table[index];
>
> if (!func) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_event_msg,
> "fc_fcftab_action:%x %s:%s arg=%p. No action. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
>
> return (1);
> }
>
> rval = (func)(port, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_action() */
>
>
> static uint32_t
> emlxs_fc_fcftab_event(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> /* Filter events */
> switch (evt) {
> case FCF_EVENT_SHUTDOWN:
> case FCF_EVENT_LINKUP:
> case FCF_EVENT_LINKDOWN:
> case FCF_EVENT_FCFI_ONLINE:
> case FCF_EVENT_FCFI_OFFLINE:
> break;
>
> default:
> return (1);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_event_msg,
> "fc_fcftab_event:%x %s:%s arg=%p.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
>
> rval = emlxs_fc_fcftab_action(port, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_event() */
>
>
> /* EMLXS_FCF_LOCK must be held to enter */
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_state(emlxs_port_t *port, uint16_t state, uint16_t reason,
> uint32_t explain, void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (state >= FC_FCFTAB_ACTION_STATES) {
> return (1);
> }
>
> if ((fcftab->state == state) &&
> (reason != FCF_REASON_REENTER)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fcftab_state:%x %s:%s:0x%x arg=%p. "
> "State not changed. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(state),
> emlxs_fcf_reason_xlate(reason),
> explain, arg1);
> return (1);
> }
>
> if (!reason) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_state_msg,
> "fcftab_state:%x %s-->%s arg=%p",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fc_fcftab_state_xlate(state), arg1);
> } else if (reason == FCF_REASON_EVENT) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_state_msg,
> "fcftab_state:%x %s-->%s:%s:%s arg=%p",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fc_fcftab_state_xlate(state),
> emlxs_fcf_reason_xlate(reason),
> emlxs_fcf_event_xlate(explain), arg1);
> } else if (explain) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_state_msg,
> "fcftab_state:%x %s-->%s:%s:0x%x arg=%p",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fc_fcftab_state_xlate(state),
> emlxs_fcf_reason_xlate(reason),
> explain, arg1);
> } else {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_state_msg,
> "fcftab_state:%x %s-->%s:%s arg=%p",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fc_fcftab_state_xlate(state),
> emlxs_fcf_reason_xlate(reason), arg1);
> }
>
> fcftab->prev_state = fcftab->state;
> fcftab->prev_reason = fcftab->reason;
> fcftab->state = state;
> fcftab->reason = reason;
>
> rval = emlxs_fc_fcftab_action(port, FCF_EVENT_STATE_ENTER, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_state() */
>
>
> static void
> emlxs_fc_fcftab_online_timer(emlxs_hba_t *hba)
> {
> emlxs_port_t *port = &PPORT;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
>
> /* Check FCF timer */
> if (!fcftab->online_timer ||
> (hba->timer_tics < fcftab->online_timer)) {
> return;
> }
> fcftab->online_timer = 0;
>
> switch (fcftab->state) {
> case FC_FCFTAB_STATE_ONLINE:
> emlxs_fcf_linkup(port);
>
> fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
> fcftab->flag |= EMLXS_FC_FCFTAB_TOPO_REQ;
> fcftab->generation++;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_online_timer:%x %s gen=%x. Read topology. >",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> fcftab->generation);
>
> (void) emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO,
> FCF_REASON_EVENT, 0, 0);
> break;
>
> default:
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_online_timer:%x %s",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state));
> break;
> }
>
> return;
>
> } /* emlxs_fc_fcftab_online_timer() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_offline_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (fcftab->state != FC_FCFTAB_STATE_OFFLINE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_offline_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> fcftab->flag &= ~EMLXS_FC_FCFTAB_OFFLINE_REQ;
>
> if (fcftab->flag & EMLXS_FCFTAB_REQ_MASK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_offline_action:%x %s:%s arg=%p flag=%x. "
> "Handling request.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
>
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
> return (rval);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_offline_action:%x %s:%s arg=%p fcfi_online=%d. "
> "Offline. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->fcfi_online);
>
> return (0);
>
> } /* emlxs_fc_fcftab_offline_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_online_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> emlxs_port_t *pport = &PPORT;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (fcftab->state != FC_FCFTAB_STATE_ONLINE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_online_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> if (fcftab->flag & EMLXS_FCFTAB_REQ_MASK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_online_action:%x flag=%x. "
> "Handling requested.",
> fcftab->TID,
> fcftab->flag);
>
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
> return (rval);
> }
>
> if (fcftab->fcfi_online == 0) {
> if (!(pport->flag & EMLXS_PORT_BOUND) ||
> (pport->vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_online_action:%x %s:%s "
> "fcfi_online=0. Pport not bound. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt));
> } else {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_online_action:%x %s:%s "
> "fcfi_online=0. Starting online timer. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt));
>
> /* Start the online timer */
> fcftab->online_timer = hba->timer_tics + 1;
> }
>
> emlxs_fcf_linkdown(port);
>
> return (0);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_online_action:%x flag=%x fcfi_online=%d. "
> "Online. <",
> fcftab->TID,
> fcftab->flag,
> fcftab->fcfi_online);
>
> emlxs_fcf_linkup(port);
>
> return (0);
>
> } /* emlxs_fc_fcftab_online_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_topo_mbcmpl(emlxs_hba_t *hba, MAILBOXQ *mbq)
> {
> emlxs_port_t *port = (emlxs_port_t *)mbq->port;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> MAILBOX4 *mb4 = (MAILBOX4 *)mbq;
> MATCHMAP *mp;
> uint8_t *alpa_map;
> uint32_t j;
> uint16_t TID;
>
> mutex_enter(&EMLXS_FCF_LOCK);
> TID = (uint16_t)((unsigned long)mbq->context);
>
> if (fcftab->state != FC_FCFTAB_STATE_TOPO) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_mbcmpl:%x state=%s.",
> TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state));
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> if (TID != fcftab->generation) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_mbcmpl:%x %s. "
> "Incorrect generation %x. Dropping.",
> TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> fcftab->generation);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> if (mb4->mbxStatus) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_mbcmpl:%x failed. %s. >",
> fcftab->TID,
> emlxs_mb_xlate_status(mb4->mbxStatus));
>
> if (mb4->mbxStatus == MBXERR_NO_RESOURCES) {
> (void) emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_TOPO_FAILED,
> FCF_REASON_MBOX_BUSY, mb4->mbxStatus, 0);
> } else {
> (void) emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_TOPO_FAILED,
> FCF_REASON_MBOX_FAILED, mb4->mbxStatus, 0);
> }
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> if (mb4->un.varReadLA.attType == AT_LINK_DOWN) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_mbcmpl:%x Linkdown attention. "
> "Offline requested.",
> fcftab->TID);
>
> fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
> fcftab->flag |= EMLXS_FC_FCFTAB_OFFLINE_REQ;
> (void) emlxs_fc_fcftab_req_handler(port, 0);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> if (hba->link_event_tag != mb4->un.varReadLA.eventTag) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_mbcmpl:%x Event tag invalid. %x != %x",
> fcftab->TID,
> hba->link_event_tag, mb4->un.varReadLA.eventTag);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_mbcmpl:%x state=%s type=%s iotag=%d "
> "alpa=%x. >",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> (mb4->un.varReadLA.attType == AT_LINK_UP)?"linkup":"linkdown",
> hba->link_event_tag,
> (uint32_t)mb4->un.varReadLA.granted_AL_PA);
>
> /* Link is up */
>
> /* Save the linkspeed & topology */
> hba->linkspeed = mb4->un.varReadLA.UlnkSpeed;
> hba->topology = mb4->un.varReadLA.topology;
>
> if (hba->topology != TOPOLOGY_LOOP) {
> port->did = 0;
> port->lip_type = 0;
> hba->flag &= ~FC_BYPASSED_MODE;
> bzero((caddr_t)port->alpa_map, 128);
>
> goto done;
> }
>
> /* TOPOLOGY_LOOP */
>
> port->lip_type = mb4->un.varReadLA.lipType;
>
> if (mb4->un.varReadLA.pb) {
> hba->flag |= FC_BYPASSED_MODE;
> } else {
> hba->flag &= ~FC_BYPASSED_MODE;
> }
>
> /* Save the granted_alpa and alpa_map */
>
> port->granted_alpa = mb4->un.varReadLA.granted_AL_PA;
> mp = (MATCHMAP *)mbq->bp;
> alpa_map = (uint8_t *)port->alpa_map;
>
> bcopy((caddr_t)mp->virt, (caddr_t)alpa_map, 128);
>
> /* Check number of devices in map */
> if (alpa_map[0] > 127) {
> alpa_map[0] = 127;
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT,
> &emlxs_link_atten_msg,
> "alpa_map: %d device(s): "
> "%02x %02x %02x %02x %02x %02x %02x %02x",
> alpa_map[0], alpa_map[1],
> alpa_map[2], alpa_map[3],
> alpa_map[4], alpa_map[5],
> alpa_map[6], alpa_map[7],
> alpa_map[8]);
>
> for (j = 9; j <= alpa_map[0]; j += 8) {
> EMLXS_MSGF(EMLXS_CONTEXT,
> &emlxs_link_atten_msg,
> "alpa_map: "
> "%02x %02x %02x %02x %02x %02x %02x %02x",
> alpa_map[j],
> alpa_map[j + 1],
> alpa_map[j + 2],
> alpa_map[j + 3],
> alpa_map[j + 4],
> alpa_map[j + 5],
> alpa_map[j + 6],
> alpa_map[j + 7]);
> }
>
> done:
>
> (void) emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO_CMPL,
> 0, 0, 0);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
>
> } /* emlxs_fc_fcftab_topo_mbcmpl() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_topo_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> MAILBOXQ *mbq;
> MAILBOX4 *mb4;
> uint32_t rval = 0;
> MATCHMAP *mp;
>
> if (fcftab->state != FC_FCFTAB_STATE_TOPO) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_topo_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> if ((fcftab->prev_state != FC_FCFTAB_STATE_TOPO_FAILED) ||
> (fcftab->flag & EMLXS_FC_FCFTAB_TOPO_REQ)) {
> fcftab->flag &= ~EMLXS_FC_FCFTAB_TOPO_REQ;
> fcftab->attempts = 0;
> }
>
> if (fcftab->flag & EMLXS_FCFTAB_REQ_MASK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
> "Handling request.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->generation,
> fcftab->flag);
>
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
> return (rval);
> }
>
> if (fcftab->attempts == 0) {
> fcftab->TID = fcftab->generation;
> }
>
> if (hba->topology != TOPOLOGY_LOOP) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
> "Fabric Topology. Skipping READ_TOPO.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->generation,
> fcftab->flag);
>
> port->did = 0;
> port->lip_type = 0;
> hba->flag &= ~FC_BYPASSED_MODE;
> bzero((caddr_t)port->alpa_map, 128);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_CFGLINK,
> FCF_REASON_EVENT, evt, arg1);
> return (rval);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
> "Sending READ_TOPO. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->generation,
> fcftab->flag);
>
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO_FAILED,
> FCF_REASON_NO_MBOX, 0, arg1);
> return (rval);
> }
> mb4 = (MAILBOX4*)mbq;
> bzero((void *) mb4, MAILBOX_CMD_SLI4_BSIZE);
>
> if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF)) == 0) {
> emlxs_mem_put(hba, MEM_MBOX, (void *)mbq);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO_FAILED,
> FCF_REASON_NO_BUFFER, 0, arg1);
> return (rval);
> }
> bzero(mp->virt, mp->size);
>
> mbq->nonembed = NULL;
> mbq->bp = (void *)mp;
> mbq->mbox_cmpl = emlxs_fc_fcftab_topo_mbcmpl;
> mbq->context = (void *)((unsigned long)fcftab->TID);
> mbq->port = (void *)port;
>
> mb4->un.varSLIConfig.be.embedded = 0;
> mb4->mbxCommand = MBX_READ_TOPOLOGY;
> mb4->mbxOwner = OWN_HOST;
>
> mb4->un.varReadLA.un.lilpBde64.tus.f.bdeSize = 128;
> mb4->un.varReadLA.un.lilpBde64.addrHigh = PADDR_HI(mp->phys);
> mb4->un.varReadLA.un.lilpBde64.addrLow = PADDR_LO(mp->phys);
>
> rval = EMLXS_SLI_ISSUE_MBOX_CMD(hba, mbq, MBX_NOWAIT, 0);
> if ((rval != MBX_BUSY) && (rval != MBX_SUCCESS)) {
> emlxs_mem_put(hba, MEM_BUF, (void *)mp);
> emlxs_mem_put(hba, MEM_MBOX, (void *)mbq);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO_FAILED,
> FCF_REASON_SEND_FAILED, rval, arg1);
>
> return (rval);
> }
>
> return (0);
>
> } /* emlxs_fc_fcftab_topo_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_topo_failed_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> fcftab->attempts++;
>
> if (fcftab->state != FC_FCFTAB_STATE_TOPO_FAILED) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_topo_failed_action:%x %s:%s arg=%p "
> "attempt=%d. Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt),
> arg1, fcftab->attempts);
> return (1);
> }
>
> if ((fcftab->reason == FCF_REASON_MBOX_FAILED) ||
> (fcftab->reason == FCF_REASON_SEND_FAILED) ||
> (fcftab->attempts >= 3)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Giving up.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO_CMPL,
> FCF_REASON_OP_FAILED, fcftab->attempts, arg1);
>
> } else {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Retrying.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO,
> FCF_REASON_OP_FAILED, fcftab->attempts, arg1);
> }
>
> return (rval);
>
> } /* emlxs_fc_fcftab_topo_failed_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_topo_cmpl_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (fcftab->state != FC_FCFTAB_STATE_TOPO_CMPL) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_topo_cmpl_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_topo_cmpl_action:%x attempts=%d. "
> "Config link.",
> fcftab->TID,
> fcftab->attempts);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_CFGLINK,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_topo_cmpl_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_cfglink_mbcmpl(emlxs_hba_t *hba, MAILBOXQ *mbq)
> {
> emlxs_port_t *port = (emlxs_port_t *)mbq->port;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> MAILBOX4 *mb4 = (MAILBOX4 *)mbq;
> uint16_t TID;
>
> mutex_enter(&EMLXS_FCF_LOCK);
> TID = (uint16_t)((unsigned long)mbq->context);
>
> if (fcftab->state != FC_FCFTAB_STATE_CFGLINK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_cfglink_mbcmpl:%x state=%s.",
> TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state));
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> if (TID != fcftab->generation) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_cfglink_mbcmpl:%x %s. "
> "Incorrect generation %x. Dropping.",
> TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> fcftab->generation);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> if (mb4->mbxStatus) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_cfglink_mbcmpl:%x failed. %s. >",
> fcftab->TID,
> emlxs_mb_xlate_status(mb4->mbxStatus));
>
> if (mb4->mbxStatus == MBXERR_NO_RESOURCES) {
> (void) emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_CFGLINK_FAILED,
> FCF_REASON_MBOX_BUSY, mb4->mbxStatus, 0);
> } else {
> (void) emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_CFGLINK_FAILED,
> FCF_REASON_MBOX_FAILED, mb4->mbxStatus, 0);
> }
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_sli_detail_msg,
> "fc_fcftab_cfglink_mbcmpl:%x. >",
> fcftab->TID);
>
> (void) emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_CFGLINK_CMPL,
> 0, 0, 0);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
>
> } /* emlxs_fc_fcftab_cfglink_mbcmpl() */
>
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_cfglink_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> emlxs_config_t *cfg = &CFG;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> MAILBOXQ *mbq;
> MAILBOX4 *mb4;
> uint32_t rval = 0;
>
> if (fcftab->state != FC_FCFTAB_STATE_CFGLINK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_cfglink_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> if ((fcftab->prev_state != FC_FCFTAB_STATE_CFGLINK_FAILED) ||
> (fcftab->flag & EMLXS_FC_FCFTAB_CFGLINK_REQ)) {
> fcftab->flag &= ~EMLXS_FC_FCFTAB_CFGLINK_REQ;
> fcftab->attempts = 0;
> }
>
> if (fcftab->flag & EMLXS_FCFTAB_REQ_MASK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
> "Handling request.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->generation,
> fcftab->flag);
>
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
> return (rval);
> }
>
> if (fcftab->attempts == 0) {
> fcftab->TID = fcftab->generation;
> }
>
> if (hba->topology != TOPOLOGY_LOOP) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
> "Fabric Topology. Skipping CONFIG_LINK.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->generation,
> fcftab->flag);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_SPARM,
> FCF_REASON_EVENT, evt, arg1);
> return (rval);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
> "Sending CONFIG_LINK. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->generation,
> fcftab->flag);
>
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
> rval = emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_CFGLINK_FAILED,
> FCF_REASON_NO_MBOX, 0, arg1);
> return (rval);
> }
> mb4 = (MAILBOX4*)mbq;
> bzero((void *) mb4, MAILBOX_CMD_SLI4_BSIZE);
>
> mbq->nonembed = NULL;
> mbq->mbox_cmpl = emlxs_fc_fcftab_cfglink_mbcmpl;
> mbq->context = (void *)((unsigned long)fcftab->TID);
> mbq->port = (void *)port;
>
> mb4->un.varSLIConfig.be.embedded = 0;
> mb4->mbxCommand = MBX_CONFIG_LINK;
> mb4->mbxOwner = OWN_HOST;
>
> if (cfg[CFG_CR_DELAY].current) {
> mb4->un.varCfgLnk.cr = 1;
> mb4->un.varCfgLnk.ci = 1;
> mb4->un.varCfgLnk.cr_delay = cfg[CFG_CR_DELAY].current;
> mb4->un.varCfgLnk.cr_count = cfg[CFG_CR_COUNT].current;
> }
>
> if (cfg[CFG_ACK0].current) {
> mb4->un.varCfgLnk.ack0_enable = 1;
> }
>
> mb4->un.varCfgLnk.myId = port->did;
> mb4->un.varCfgLnk.edtov = hba->fc_edtov;
> mb4->un.varCfgLnk.arbtov = hba->fc_arbtov;
> mb4->un.varCfgLnk.ratov = hba->fc_ratov;
> mb4->un.varCfgLnk.rttov = hba->fc_rttov;
> mb4->un.varCfgLnk.altov = hba->fc_altov;
> mb4->un.varCfgLnk.crtov = hba->fc_crtov;
> mb4->un.varCfgLnk.citov = hba->fc_citov;
>
> rval = EMLXS_SLI_ISSUE_MBOX_CMD(hba, mbq, MBX_NOWAIT, 0);
> if ((rval != MBX_BUSY) && (rval != MBX_SUCCESS)) {
> emlxs_mem_put(hba, MEM_MBOX, (void *)mbq);
>
> rval = emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_CFGLINK_FAILED,
> FCF_REASON_SEND_FAILED, rval, arg1);
>
> return (rval);
> }
>
> return (0);
>
> } /* emlxs_fc_fcftab_cfglink_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_cfglink_failed_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> fcftab->attempts++;
>
> if (fcftab->state != FC_FCFTAB_STATE_CFGLINK_FAILED) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_cfglink_failed_action:%x %s:%s arg=%p "
> "attempt=%d. Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt),
> arg1, fcftab->attempts);
> return (1);
> }
>
> if ((fcftab->reason == FCF_REASON_MBOX_FAILED) ||
> (fcftab->reason == FCF_REASON_SEND_FAILED) ||
> (fcftab->attempts >= 3)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_cfglink_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Giving up.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_CFGLINK_CMPL,
> FCF_REASON_OP_FAILED, fcftab->attempts, arg1);
>
> } else {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_cfglink_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Retrying.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_CFGLINK,
> FCF_REASON_OP_FAILED, fcftab->attempts, arg1);
> }
>
> return (rval);
>
> } /* emlxs_fc_fcftab_cfglink_failed_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_cfglink_cmpl_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (fcftab->state != FC_FCFTAB_STATE_CFGLINK_CMPL) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_cfglink_cmpl_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_cfglink_cmpl_action:%x attempts=%d. "
> "Read SPARM.",
> fcftab->TID,
> fcftab->attempts);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_SPARM,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_cfglink_cmpl_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_sparm_mbcmpl(emlxs_hba_t *hba, MAILBOXQ *mbq)
> {
> emlxs_port_t *port = (emlxs_port_t *)mbq->port;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> MAILBOX4 *mb4 = (MAILBOX4 *)mbq;
> MATCHMAP *mp;
> emlxs_port_t *vport;
> VPIobj_t *vpip;
> int32_t i;
> uint8_t null_wwn[8];
> uint16_t TID;
>
> mutex_enter(&EMLXS_FCF_LOCK);
> TID = (uint16_t)((unsigned long)mbq->context);
>
> if (fcftab->state != FC_FCFTAB_STATE_SPARM) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sparm_mbcmpl:%x state=%s.",
> TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state));
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> if (TID != fcftab->generation) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sparm_mbcmpl:%x %s. "
> "Incorrect generation %x. Dropping.",
> TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> fcftab->generation);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> if (mb4->mbxStatus) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sparm_mbcmpl:%x failed. %s. >",
> fcftab->TID,
> emlxs_mb_xlate_status(mb4->mbxStatus));
>
> if (mb4->mbxStatus == MBXERR_NO_RESOURCES) {
> (void) emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_SPARM_FAILED,
> FCF_REASON_MBOX_BUSY, mb4->mbxStatus, 0);
> } else {
> (void) emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_SPARM_FAILED,
> FCF_REASON_MBOX_FAILED, mb4->mbxStatus, 0);
> }
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> /* Save the parameters */
> mp = (MATCHMAP *)mbq->bp;
> bcopy((caddr_t)mp->virt, (caddr_t)&hba->sparam, sizeof (SERV_PARM));
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_sli_detail_msg,
> "fc_fcftab_sparm_mbcmpl:%x edtov=%x,%x bbc=%x. >",
> fcftab->TID,
> hba->fc_edtov, hba->sparam.cmn.e_d_tov,
> hba->sparam.cmn.bbCreditlsb);
>
> /* Initialize the node name and port name only once */
> bzero(null_wwn, 8);
> if ((bcmp((caddr_t)&hba->wwnn, (caddr_t)null_wwn, 8) == 0) &&
> (bcmp((caddr_t)&hba->wwpn, (caddr_t)null_wwn, 8) == 0)) {
> bcopy((caddr_t)&hba->sparam.nodeName,
> (caddr_t)&hba->wwnn, sizeof (NAME_TYPE));
>
> bcopy((caddr_t)&hba->sparam.portName,
> (caddr_t)&hba->wwpn, sizeof (NAME_TYPE));
> } else {
> bcopy((caddr_t)&hba->wwnn,
> (caddr_t)&hba->sparam.nodeName, sizeof (NAME_TYPE));
>
> bcopy((caddr_t)&hba->wwpn,
> (caddr_t)&hba->sparam.portName, sizeof (NAME_TYPE));
> }
>
> /* Update all bound ports */
> for (i = 0; i < MAX_VPORTS; i++) {
> vport = &VPORT(i);
> vpip = vport->vpip;
>
> if (!(vport->flag & EMLXS_PORT_BOUND) ||
> (vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
> continue;
> }
>
> bcopy((caddr_t)&hba->sparam,
> (caddr_t)&vport->sparam,
> sizeof (SERV_PARM));
>
> bcopy((caddr_t)&vport->wwnn,
> (caddr_t)&vport->sparam.nodeName,
> sizeof (NAME_TYPE));
>
> bcopy((caddr_t)&vport->wwpn,
> (caddr_t)&vport->sparam.portName,
> sizeof (NAME_TYPE));
> }
>
> (void) emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_SPARM_CMPL,
> 0, 0, 0);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
>
> } /* emlxs_fc_fcftab_sparm_mbcmpl() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_sparm_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> MAILBOXQ *mbq;
> MAILBOX4 *mb4;
> uint32_t rval = 0;
> MATCHMAP *mp;
>
> if (fcftab->state != FC_FCFTAB_STATE_SPARM) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_sparm_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> if ((fcftab->prev_state != FC_FCFTAB_STATE_SPARM_FAILED) ||
> (fcftab->flag & EMLXS_FC_FCFTAB_SPARM_REQ)) {
> fcftab->flag &= ~EMLXS_FC_FCFTAB_SPARM_REQ;
> fcftab->attempts = 0;
> }
>
> if (fcftab->flag & EMLXS_FCFTAB_REQ_MASK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_read_action:%x %s:%s arg=%p flag=%x. "
> "Handling request.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
>
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
> return (rval);
> }
>
> if (fcftab->attempts == 0) {
> fcftab->TID = fcftab->generation;
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_read_action:%x %s:%s arg=%p attempts=%d. "
> "Reading SPARM. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts);
>
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
> rval = emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_SPARM_FAILED,
> FCF_REASON_NO_MBOX, 0, arg1);
> return (rval);
> }
> mb4 = (MAILBOX4*)mbq;
> bzero((void *) mb4, MAILBOX_CMD_SLI4_BSIZE);
>
> if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF)) == 0) {
> emlxs_mem_put(hba, MEM_MBOX, (void *)mbq);
>
> rval = emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_SPARM_FAILED,
> FCF_REASON_NO_BUFFER, 0, arg1);
> return (rval);
> }
> bzero(mp->virt, mp->size);
>
> mbq->nonembed = NULL;
> mbq->bp = (void *)mp;
> mbq->mbox_cmpl = emlxs_fc_fcftab_sparm_mbcmpl;
> mbq->context = (void *)((unsigned long)fcftab->TID);
> mbq->port = (void *)port;
>
> mb4->un.varSLIConfig.be.embedded = 0;
> mb4->mbxCommand = MBX_READ_SPARM64;
> mb4->mbxOwner = OWN_HOST;
>
> mb4->un.varRdSparm.un.sp64.tus.f.bdeSize = sizeof (SERV_PARM);
> mb4->un.varRdSparm.un.sp64.addrHigh = PADDR_HI(mp->phys);
> mb4->un.varRdSparm.un.sp64.addrLow = PADDR_LO(mp->phys);
>
> rval = EMLXS_SLI_ISSUE_MBOX_CMD(hba, mbq, MBX_NOWAIT, 0);
> if ((rval != MBX_BUSY) && (rval != MBX_SUCCESS)) {
> emlxs_mem_put(hba, MEM_BUF, (void *)mp);
> emlxs_mem_put(hba, MEM_MBOX, (void *)mbq);
>
> rval = emlxs_fc_fcftab_state(port,
> FC_FCFTAB_STATE_SPARM_FAILED,
> FCF_REASON_SEND_FAILED, rval, arg1);
>
> return (rval);
> }
>
> return (0);
>
> } /* emlxs_fc_fcftab_sparm_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_sparm_failed_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> fcftab->attempts++;
>
> if (fcftab->state != FC_FCFTAB_STATE_SPARM_FAILED) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_sparm_failed_action:%x %s:%s arg=%p "
> "attempt=%d. Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt),
> arg1, fcftab->attempts);
> return (1);
> }
>
> if ((fcftab->reason == FCF_REASON_MBOX_FAILED) ||
> (fcftab->reason == FCF_REASON_SEND_FAILED) ||
> (fcftab->attempts >= 3)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_read_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Giving up.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_SPARM_CMPL,
> FCF_REASON_OP_FAILED, fcftab->attempts, arg1);
> } else {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_read_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Retrying.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_SPARM,
> FCF_REASON_OP_FAILED, fcftab->attempts, arg1);
> }
>
> return (rval);
>
> } /* emlxs_fc_fcftab_sparm_failed_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_sparm_cmpl_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (fcftab->state != FC_FCFTAB_STATE_SPARM_CMPL) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_sparm_cmpl_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_sparm_cmpl_action:%x attempts=%d. "
> "Bring FCFTAB online.",
> fcftab->TID,
> fcftab->attempts);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_FCFI_ONLINE,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_sparm_cmpl_action() */
>
>
> /*ARGSUSED*/
> static void
> emlxs_fc_fcftab_process(emlxs_port_t *port)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> FCFIobj_t *fcfp;
> FCF_RECORD_t fcf_record;
> FCF_RECORD_t *fcf_rec;
> uint8_t bitmap[512];
> uint16_t i;
>
> /* Get the FCFI */
> fcfp = fcftab->fcfi[0];
>
> if (!fcfp) {
> /* Allocate an fcfi */
> fcfp = emlxs_fcfi_alloc(port);
> }
>
> if (!fcfp) {
> fcftab->fcfi_count = 0;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_process:%x No FCF available.",
> fcftab->TID);
> return;
> }
>
> if (fcfp->flag & EMLXS_FCFI_SELECTED) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_process:%x fcfi=%d %s. "
> "FCF still selected.",
> fcftab->TID,
> fcfp->fcf_index,
> emlxs_fcfi_state_xlate(fcfp->state));
> } else {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_process:%x fcfi=%d %s. "
> "New FCF selected.",
> fcftab->TID,
> fcfp->fcf_index,
> emlxs_fcfi_state_xlate(fcfp->state));
> }
>
> /* Initalize an fcf_rec */
> fcf_rec = &fcf_record;
> bzero(fcf_rec, sizeof (FCF_RECORD_t));
>
> fcf_rec->max_recv_size = EMLXS_FCOE_MAX_RCV_SZ;
> fcf_rec->fka_adv_period = 0;
> fcf_rec->fip_priority = 128;
>
> #ifdef EMLXS_BIG_ENDIAN
> fcf_rec->fcf_mac_address_hi[0] = FCOE_FCF_MAC3;
> fcf_rec->fcf_mac_address_hi[1] = FCOE_FCF_MAC2;
> fcf_rec->fcf_mac_address_hi[2] = FCOE_FCF_MAC1;
> fcf_rec->fcf_mac_address_hi[3] = FCOE_FCF_MAC0;
> fcf_rec->fcf_mac_address_low[0] = FCOE_FCF_MAC5;
> fcf_rec->fcf_mac_address_low[1] = FCOE_FCF_MAC4;
> fcf_rec->fc_map[0] = hba->sli.sli4.cfgFCOE.FCMap[2];
> fcf_rec->fc_map[1] = hba->sli.sli4.cfgFCOE.FCMap[1];
> fcf_rec->fc_map[2] = hba->sli.sli4.cfgFCOE.FCMap[0];
> #endif /* EMLXS_BIG_ENDIAN */
> #ifdef EMLXS_LITTLE_ENDIAN
> fcf_rec->fcf_mac_address_hi[0] = FCOE_FCF_MAC0;
> fcf_rec->fcf_mac_address_hi[1] = FCOE_FCF_MAC1;
> fcf_rec->fcf_mac_address_hi[2] = FCOE_FCF_MAC2;
> fcf_rec->fcf_mac_address_hi[3] = FCOE_FCF_MAC3;
> fcf_rec->fcf_mac_address_low[0] = FCOE_FCF_MAC4;
> fcf_rec->fcf_mac_address_low[1] = FCOE_FCF_MAC5;
> fcf_rec->fc_map[0] = hba->sli.sli4.cfgFCOE.FCMap[0];
> fcf_rec->fc_map[1] = hba->sli.sli4.cfgFCOE.FCMap[1];
> fcf_rec->fc_map[2] = hba->sli.sli4.cfgFCOE.FCMap[2];
> #endif /* EMLXS_LITTLE_ENDIAN */
>
> if (hba->sli.sli4.cfgFCOE.fip_flags & TLV_FCOE_VLAN) {
> bzero((void *) bitmap, 512);
> i = hba->sli.sli4.cfgFCOE.VLanId;
> bitmap[i / 8] = (1 << (i % 8));
> BE_SWAP32_BCOPY(bitmap, fcf_rec->vlan_bitmap, 512);
> } else {
> bzero((void *) bitmap, 512);
> bitmap[0] = 1; /* represents bit 0 */
> BE_SWAP32_BCOPY(bitmap, fcf_rec->vlan_bitmap, 512);
> }
>
> fcf_rec->fcf_valid = 1;
> fcf_rec->fcf_available = 1;
>
> /* Update the FCFI */
> emlxs_fcfi_update(port, fcfp, fcf_rec, hba->link_event_tag);
>
> /* Select the FCFI */
> fcfp->flag &= ~EMLXS_FCFI_FAILED;
> fcfp->flag |= EMLXS_FCFI_SELECTED;
> fcftab->fcfi[0] = fcfp;
> fcftab->fcfi_count = 1;
>
> return;
>
> } /* emlxs_fc_fcftab_process() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_fcfi_online_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
> FCFIobj_t *fcfp;
>
> if (fcftab->state != FC_FCFTAB_STATE_FCFI_ONLINE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_fcfi_online_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> if (fcftab->flag & EMLXS_FCFTAB_REQ_MASK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_online_action:%x flag=%x. "
> "Handling request.",
> fcftab->TID,
> fcftab->flag);
>
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
> return (rval);
> }
>
> emlxs_fc_fcftab_process(port);
>
> fcfp = fcftab->fcfi[0];
> if (!fcfp) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_online_action:%x. "
> "No FCF available. Offlining.",
> fcftab->TID);
>
> fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
> fcftab->flag |= EMLXS_FC_FCFTAB_OFFLINE_REQ;
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (rval);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_online_action:%x fcfi_count=%d. "
> "Onlining FCFI:%d. >",
> fcftab->TID,
> fcftab->fcfi_count,
> fcfp->fcf_index);
>
> (void) emlxs_fcfi_event(port, FCF_EVENT_FCFI_ONLINE, fcfp);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_FCFI_ONLINE_CMPL,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_fcfi_online_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_fcfi_online_cmpl_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (fcftab->state != FC_FCFTAB_STATE_FCFI_ONLINE_CMPL) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> if (fcftab->flag & EMLXS_FCFTAB_REQ_MASK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p "
> "flag=%x. Handling request.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
>
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
> return (rval);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p. "
> "Going online.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_ONLINE,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_fcfi_online_cmpl_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_fcfi_offline_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
> FCFIobj_t *fcfp;
>
> if (fcftab->state != FC_FCFTAB_STATE_FCFI_OFFLINE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_fcftab_offline_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> if (fcftab->fcfi_online) {
> fcfp = fcftab->fcfi[0];
>
> if (!(fcfp->flag & EMLXS_FCFI_OFFLINE_REQ)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_action:%d. "
> "Offlining FCFI:%d. >",
> fcftab->TID,
> fcfp->fcf_index);
>
> rval = emlxs_fcfi_event(port,
> FCF_EVENT_FCFI_OFFLINE, fcfp);
>
> return (rval);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_action:%x fcfi_online=%d. "
> "Waiting on FCF. <",
> fcftab->TID,
> fcftab->fcfi_online);
>
> return (0);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_action:%x %s:%s arg=%p.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_FCFI_OFFLINE_CMPL,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_fcfi_offline_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_fcfi_offline_cmpl_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (fcftab->state != FC_FCFTAB_STATE_FCFI_OFFLINE_CMPL) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_fcftab_offline_cmpl_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
> if (fcftab->flag & EMLXS_FCFTAB_REQ_MASK) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_cmpl_action:%x %s:%s arg=%p. "
> "Handling request.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
>
> rval = emlxs_fc_fcftab_req_handler(port, arg1);
> return (rval);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcftab_offline_cmpl_action:%x %s:%s arg=%p. "
> "Returning FCF(s) online.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_FCFI_ONLINE,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_fcfi_offline_cmpl_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_linkup_evt_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (evt != FCF_EVENT_LINKUP) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_linkup_evt_action:%x %s:%s arg=%p flag=%x. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
> return (1);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_linkup_evt_action:%x %s:%s arg=%p gen=%x. Link up.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->generation);
>
> emlxs_fcf_linkup(port);
>
> fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
> fcftab->flag |= EMLXS_FC_FCFTAB_TOPO_REQ;
> fcftab->generation++;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_linkup_evt_action:%x %s gen=%x. "
> "Read topology.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> fcftab->generation);
>
> switch (fcftab->state) {
> case FC_FCFTAB_STATE_TOPO:
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO,
> FCF_REASON_REENTER, evt, arg1);
> break;
>
> default:
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO,
> FCF_REASON_EVENT, evt, arg1);
> break;
> }
>
> return (rval);
>
> } /* emlxs_fc_fcftab_linkup_evt_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_linkdown_evt_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
> uint32_t i;
> FCFIobj_t *fcfp;
>
> if (evt != FCF_EVENT_LINKDOWN) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_linkdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
> return (1);
> }
>
> fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
> fcftab->flag |= EMLXS_FC_FCFTAB_OFFLINE_REQ;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_linkdown_evt_action:%x %s:%s arg=%p flag=%x. Linkdown.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
>
> emlxs_fcf_linkdown(port);
>
> /* Pause all active FCFI's */
> for (i = 0; i < fcftab->fcfi_count; i++) {
> fcfp = fcftab->fcfi[i];
>
> if ((fcfp->state == FCFI_STATE_OFFLINE) ||
> (fcfp->state == FCFI_STATE_PAUSED)) {
> break;
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_linkdown_evt_action:%x. "
> "Pausing FCFI:%d. >",
> fcftab->TID,
> fcfp->fcf_index);
>
> (void) emlxs_fcfi_event(port, FCF_EVENT_FCFI_PAUSE, fcfp);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_linkdown_evt_action:%x "
> "Going offline.",
> fcftab->TID);
>
> switch (fcftab->state) {
> case FC_FCFTAB_STATE_OFFLINE:
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_OFFLINE,
> FCF_REASON_REENTER, evt, arg1);
> break;
>
> default:
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_OFFLINE,
> FCF_REASON_EVENT, evt, arg1);
> break;
> }
>
> return (rval);
>
> } /* emlxs_fc_fcftab_linkdown_evt_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_fcfi_offline_evt_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
> FCFIobj_t *fcfp;
>
> if (evt != FCF_EVENT_FCFI_OFFLINE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_fcftab_offline_evt_action:%x %s:%s arg=%p "
> "flag=%x. Invalid event type. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
> return (1);
> }
>
> fcfp = (FCFIobj_t *)arg1;
>
> switch (fcftab->state) {
> case FC_FCFTAB_STATE_SHUTDOWN:
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
> "Shutting down.",
> fcftab->TID,
> fcfp->fcf_index);
>
> /* This will trigger final shutdown */
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_SHUTDOWN,
> FCF_REASON_REENTER, evt, arg1);
> break;
>
> case FC_FCFTAB_STATE_FCFI_OFFLINE:
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_evt_action:%x fcfi:%d. Offlining.",
> fcftab->TID,
> fcfp->fcf_index);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_FCFI_OFFLINE,
> FCF_REASON_REENTER, evt, arg1);
> break;
>
> case FC_FCFTAB_STATE_FCFI_ONLINE:
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
> "Retrying FCF.",
> fcftab->TID,
> fcfp->fcf_index);
>
> fcfp->flag |= EMLXS_FCFI_FAILED;
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_FCFI_ONLINE,
> FCF_REASON_REENTER, evt, arg1);
> break;
>
> case FC_FCFTAB_STATE_ONLINE:
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_evt_action:%x fcfi:%d.",
> fcftab->TID,
> fcfp->fcf_index);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_ONLINE,
> FCF_REASON_REENTER, evt, arg1);
> break;
>
> default:
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_offline_evt_action:%x %s fcfi:%d.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> fcfp->fcf_index);
> break;
> }
>
> return (rval);
>
> } /* emlxs_fc_fcftab_fcfi_offline_evt_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_fcfi_online_evt_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
> FCFIobj_t *fcfp;
>
> if (evt != FCF_EVENT_FCFI_ONLINE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_fcftab_online_evt_action:%x %s:%s arg=%p "
> "flag=%x. Invalid event type. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
> return (1);
> }
>
> fcfp = (FCFIobj_t *)arg1;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_fcfi_online_evt_action:%d fcfi:%d. <",
> fcftab->TID,
> fcfp->fcf_index);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_fcfi_online_evt_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_fc_fcftab_shutdown_evt_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (evt != FCF_EVENT_SHUTDOWN) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "fc_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
> return (1);
> }
>
> if (fcftab->flag & EMLXS_FCFTAB_SHUTDOWN) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Already shut down. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
> return (1);
> }
>
> if (fcftab->state == FC_FCFTAB_STATE_SHUTDOWN) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Already shutting down. <",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
> return (1);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fc_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Shutting down.",
> fcftab->TID,
> emlxs_fc_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->flag);
>
> emlxs_fcf_linkdown(port);
>
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_SHUTDOWN,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
>
> } /* emlxs_fc_fcftab_shutdown_evt_action() */
>
>
> static uint32_t
> emlxs_fc_fcftab_req_handler(emlxs_port_t *port, void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
>
> if (!(fcftab->flag & EMLXS_FCFTAB_REQ_MASK)) {
> return (1);
> }
>
> if (fcftab->flag & EMLXS_FC_FCFTAB_OFFLINE_REQ) {
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_OFFLINE,
> FCF_REASON_REQUESTED, 0, arg1);
> }
>
> else if (fcftab->flag & EMLXS_FC_FCFTAB_TOPO_REQ) {
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_TOPO,
> FCF_REASON_REQUESTED, 0, arg1);
> }
>
> else if (fcftab->flag & EMLXS_FC_FCFTAB_CFGLINK_REQ) {
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_CFGLINK,
> FCF_REASON_REQUESTED, 0, arg1);
> }
>
> else if (fcftab->flag & EMLXS_FC_FCFTAB_SPARM_REQ) {
> rval = emlxs_fc_fcftab_state(port, FC_FCFTAB_STATE_SPARM,
> FCF_REASON_REQUESTED, 0, arg1);
> }
>
> return (rval);
>
> } /* emlxs_fc_fcftab_req_handler() */
>
>
>
> /* ************************************************************************** */
> /* FCOE FCFTAB */
> /* ************************************************************************** */
>
> static char *
> emlxs_fcoe_fcftab_state_xlate(uint32_t state)
> {
> static char buffer[32];
> uint32_t i;
> uint32_t count;
>
> count = sizeof (emlxs_fcoe_fcftab_state_table) / sizeof (emlxs_table_t);
> for (i = 0; i < count; i++) {
> if (state == emlxs_fcoe_fcftab_state_table[i].code) {
> return (emlxs_fcoe_fcftab_state_table[i].string);
> }
> }
>
> (void) snprintf(buffer, sizeof (buffer), "state=0x%x", state);
> return (buffer);
>
> } /* emlxs_fcoe_fcftab_state_xlate() */
>
>
> static uint32_t
> emlxs_fcoe_fcftab_action(emlxs_port_t *port, uint32_t evt,
> void *arg1)
> {
> emlxs_hba_t *hba = HBA;
> FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
> uint32_t rval = 0;
> uint32_t(*func) (emlxs_port_t *, uint32_t, void *);
> uint32_t index;
> uint32_t events;
> uint16_t state;
>
> /* Convert event to action table index */
> switch (evt) {
> case FCF_EVENT_STATE_ENTER:
> index = 0;
> break;
> case FCF_EVENT_SHUTDOWN:
> index = 1;
> break;
> case FCF_EVENT_LINKUP:
> index = 2;
> break;
> case FCF_EVENT_LINKDOWN:
> index = 3;
> break;
2105c4668
< events = FCFTAB_ACTION_EVENTS;
---
> events = FCOE_FCFTAB_ACTION_EVENTS;
2110c4673
< emlxs_fcftab_action_table[index];
---
> emlxs_fcoe_fcftab_action_table[index];
2114,2115c4677,4679
< "fcftab: %s:%s arg=%p. No action. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_action:%x %s:%s arg=%p. No action. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2125c4689
< } /* emlxs_fcftab_action() */
---
> } /* emlxs_fcoe_fcftab_action() */
2129c4693
< emlxs_fcftab_event(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_event(emlxs_port_t *port, uint32_t evt,
2134c4698
< uint32_t rval;
---
> uint32_t rval = 0;
2155,2156c4719,4721
< "fcftab: %s:%s arg=%p.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_event:%x %s:%s arg=%p.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2159c4724
< rval = emlxs_fcftab_action(port, evt, arg1);
---
> rval = emlxs_fcoe_fcftab_action(port, evt, arg1);
2163c4728
< } /* emlxs_fcftab_event() */
---
> } /* emlxs_fcoe_fcftab_event() */
2169c4734
< emlxs_fcftab_state(emlxs_port_t *port, uint16_t state, uint16_t reason,
---
> emlxs_fcoe_fcftab_state(emlxs_port_t *port, uint16_t state, uint16_t reason,
2176c4741
< if (state >= FCFTAB_ACTION_STATES) {
---
> if (state >= FCOE_FCFTAB_ACTION_STATES) {
2183,2185c4748,4751
< "fcftab_state: %s:%s:0x%x arg=%p. "
< "State not changed. Terminated.",
< emlxs_fcftab_state_xlate(state),
---
> "fcftab_state:%x %s:%s:0x%x arg=%p. "
> "State not changed. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(state),
2188d4753
<
2194,2196c4759,4762
< "fcftab:%s-->%s arg=%p",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcftab_state_xlate(state), arg1);
---
> "fcftab_state:%x %s-->%s arg=%p",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcoe_fcftab_state_xlate(state), arg1);
2199,2201c4765,4768
< "fcftab:%s-->%s:%s:%s arg=%p",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcftab_state_xlate(state),
---
> "fcftab_state:%x %s-->%s:%s:%s arg=%p",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcoe_fcftab_state_xlate(state),
2206,2208c4773,4776
< "fcftab:%s-->%s:%s:0x%x arg=%p",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcftab_state_xlate(state),
---
> "fcftab_state:%x %s-->%s:%s:0x%x arg=%p",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcoe_fcftab_state_xlate(state),
2213,2215c4781,4784
< "fcftab:%s-->%s:%s arg=%p",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcftab_state_xlate(state),
---
> "fcftab_state:%x %s-->%s:%s arg=%p",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcoe_fcftab_state_xlate(state),
2224c4793
< rval = emlxs_fcftab_action(port, FCF_EVENT_STATE_ENTER, arg1);
---
> rval = emlxs_fcoe_fcftab_action(port, FCF_EVENT_STATE_ENTER, arg1);
2228c4797
< } /* emlxs_fcftab_state() */
---
> } /* emlxs_fcoe_fcftab_state() */
2233c4802
< emlxs_fcftab_fcfi_offline_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_fcfi_offline_evt_action(emlxs_port_t *port, uint32_t evt,
2243,2245c4812,4815
< "fcftab_fcfi_offline_evt_action: %s:%s arg=%p flag=%x. "
< "Invalid event type. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_offline_evt_action:%x %s:%s arg=%p "
> "flag=%x. Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2254c4824
< case FCFTAB_STATE_SHUTDOWN:
---
> case FCOE_FCFTAB_STATE_SHUTDOWN:
2256c4826,4828
< "fcftab_fcfi_offline_evt_action:%d. Shutting down.",
---
> "fcoe_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
> "Shutting down.",
> fcftab->TID,
2259c4831,4832
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SHUTDOWN,
---
> /* This will trigger final shutdown */
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SHUTDOWN,
2263c4836
< case FCFTAB_STATE_FCFI_OFFLINE:
---
> case FCOE_FCFTAB_STATE_FCFI_OFFLINE:
2265c4838,4840
< "fcftab_fcfi_offline_evt_action:%d. Offlining.",
---
> "fcoe_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
> "Offlining.",
> fcftab->TID,
2268c4843,4844
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_FCFI_OFFLINE,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_FCFI_OFFLINE,
2272c4848
< case FCFTAB_STATE_FCFI_ONLINE:
---
> case FCOE_FCFTAB_STATE_FCFI_ONLINE:
2274c4850,4852
< "fcftab_fcfi_offline_evt_action:%d. Attempting failover.",
---
> "fcoe_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
> "Attempting failover.",
> fcftab->TID,
2279c4857,4858
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_FCFI_ONLINE,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_FCFI_ONLINE,
2283c4862
< case FCFTAB_STATE_ONLINE:
---
> case FCOE_FCFTAB_STATE_ONLINE:
2285c4864,4865
< "fcftab_fcfi_offline_evt_action:%d.",
---
> "fcoe_fcftab_fcfi_offline_evt_action:%x fcfi:%d.",
> fcftab->TID,
2288c4868
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_ONLINE,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_ONLINE,
2294,2296c4874,4877
< "fcftab_fcfi_offline_evt_action:%d %s. Terminated.",
< fcfp->fcf_index,
< emlxs_fcftab_state_xlate(fcftab->state));
---
> "fcoe_fcftab_fcfi_offline_evt_action:%x %s fcfi:%d.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> fcfp->fcf_index);
2302c4883
< } /* emlxs_fcftab_fcfi_offline_evt_action() */
---
> } /* emlxs_fcoe_fcftab_fcfi_offline_evt_action() */
2307c4888
< emlxs_fcftab_fcfi_online_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_fcfi_online_evt_action(emlxs_port_t *port, uint32_t evt,
2317,2319c4898,4901
< "fcftab_fcfi_online_evt_action: %s:%s arg=%p flag=%x. "
< "Invalid event type. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_online_evt_action:%x %s:%s arg=%p "
> "flag=%x. Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2328c4910,4911
< "fcftab_fcfi_online_evt_action:%d. Terminated.",
---
> "fcoe_fcftab_fcfi_online_evt_action:%x fcfi:%d. <",
> fcftab->TID,
2333c4916
< } /* emlxs_fcftab_fcfi_online_evt_action() */
---
> } /* emlxs_fcoe_fcftab_fcfi_online_evt_action() */
2338c4921
< emlxs_fcftab_cvl_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_cvl_evt_action(emlxs_port_t *port, uint32_t evt,
2343c4926
< uint32_t rval;
---
> uint32_t rval = 0;
2350,2352c4933,4936
< "fcftab_cvl_evt_action: %s:%s arg=%p flag=%x. "
< "Invalid event type. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_cvl_evt_action:%x %s:%s arg=%p flag=%x. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2359c4943
< vpi = (uint32_t)((uintptr_t)arg1);
---
> vpi = (uint32_t)((unsigned long)arg1);
2361c4945
< vpip = &vport->VPIobj;
---
> vpip = vport->vpip;
2364,2365c4948,4950
< "fcftab_cvl_evt_action: %s gen=%x. Pausing VPI:%d.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_cvl_evt_action:%x %s gen=%x. Pausing VPI:%d. >",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2372c4957
< case FCFTAB_STATE_SOLICIT:
---
> case FCOE_FCFTAB_STATE_SOLICIT:
2374,2376c4959,4962
< "fcftab_cvl_evt_action: %s gen=%x. "
< "Already soliciting. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_cvl_evt_action:%x %s gen=%x. "
> "Already soliciting. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2382c4968
< fcftab->flag |= EMLXS_FCFTAB_SOL_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_SOL_REQ;
2386,2387c4972,4974
< "fcftab_cvl_evt_action: %s gen=%x. Soliciting.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_cvl_evt_action:%x %s gen=%x. Soliciting.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2390c4977
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SOLICIT,
2397c4984
< } /* emlxs_fcftab_cvl_evt_action() */
---
> } /* emlxs_fcoe_fcftab_cvl_evt_action() */
2402c4989
< emlxs_fcftab_linkup_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_linkup_evt_action(emlxs_port_t *port, uint32_t evt,
2408d4994
< emlxs_config_t *cfg = &CFG;
2412,2414c4998,5001
< "fcftab_linkup_evt_action: %s:%s arg=%p flag=%x. "
< "Invalid event type. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_linkup_evt_action:%x %s:%s arg=%p flag=%x. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2421,2422c5008,5010
< "fcftab_linkup_evt_action: %s:%s arg=%p gen=%x. Link up.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_linkup_evt_action:%x %s:%s arg=%p gen=%x. Link up.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2426,2434c5014
< mutex_enter(&EMLXS_PORT_LOCK);
< if (hba->state < FC_LINK_UP) {
< HBASTATS.LinkUp++;
< EMLXS_STATE_CHANGE_LOCKED(hba, FC_LINK_UP);
< }
< hba->discovery_timer =
< hba->timer_tics + cfg[CFG_LINKUP_TIMEOUT].current +
< cfg[CFG_DISC_TIMEOUT].current;
< mutex_exit(&EMLXS_PORT_LOCK);
---
> emlxs_fcf_linkup(port);
2436,2437d5015
< emlxs_log_link_event(port);
<
2439c5017
< case FCFTAB_STATE_SOLICIT:
---
> case FCOE_FCFTAB_STATE_SOLICIT:
2441,2443c5019,5022
< "fcftab_linkup_evt_action: %s gen=%x. "
< "Already soliciting. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_linkup_evt_action:%x %s gen=%x. "
> "Already soliciting. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2449c5028
< fcftab->flag |= EMLXS_FCFTAB_SOL_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_SOL_REQ;
2453,2454c5032,5034
< "fcftab_linkup_evt_action: %s gen=%x. Soliciting.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_linkup_evt_action:%x %s gen=%x. Soliciting.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2457c5037
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SOLICIT,
2464c5044
< } /* emlxs_fcftab_linkup_evt_action() */
---
> } /* emlxs_fcoe_fcftab_linkup_evt_action() */
2469c5049
< emlxs_fcftab_linkdown_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_linkdown_evt_action(emlxs_port_t *port, uint32_t evt,
2480,2482c5060,5063
< "fcftab_linkdown_evt_action: %s:%s arg=%p flag=%x. "
< "Invalid event type. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_linkdown_evt_action:%x %s:%s arg=%p "
> "flag=%x. Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2489c5070
< fcftab->flag |= EMLXS_FCFTAB_OFFLINE_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_OFFLINE_REQ;
2492,2493c5073,5076
< "fcftab_linkdown_evt_action: %s:%s arg=%p flag=%x. Linkdown.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_linkdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Linkdown.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2497,2504c5080
< mutex_enter(&EMLXS_PORT_LOCK);
< if (hba->state > FC_LINK_DOWN) {
< HBASTATS.LinkDown++;
< EMLXS_STATE_CHANGE_LOCKED(hba, FC_LINK_DOWN);
< }
< hba->flag &= FC_LINKDOWN_MASK;
< hba->discovery_timer = 0;
< mutex_exit(&EMLXS_PORT_LOCK);
---
> emlxs_fcf_linkdown(port);
2506,2507d5081
< emlxs_log_link_event(port);
<
2518c5092,5093
< "fcftab_linkdown_evt_action: Pausing FCFI:%d.",
---
> "fcoe_fcftab_linkdown_evt_action:%x Pausing FCFI:%d. >",
> fcftab->TID,
2525c5100,5102
< "fcftab_linkdown_evt_action: Going offline.");
---
> "fcoe_fcftab_linkdown_evt_action:%x "
> "Going offline.",
> fcftab->TID);
2528,2529c5105,5106
< case FCFTAB_STATE_OFFLINE:
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_OFFLINE,
---
> case FCOE_FCFTAB_STATE_OFFLINE:
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_OFFLINE,
2534c5111
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_OFFLINE,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_OFFLINE,
2541c5118
< } /* emlxs_fcftab_linkdown_evt_action() */
---
> } /* emlxs_fcoe_fcftab_linkdown_evt_action() */
2546c5123
< emlxs_fcftab_shutdown_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_shutdown_evt_action(emlxs_port_t *port, uint32_t evt,
2555,2557c5132,5135
< "fcftab_shutdown_evt_action: %s:%s arg=%p flag=%x. "
< "Invalid event type. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2565,2567c5143,5146
< "fcftab_shutdown_evt_action: %s:%s arg=%p flag=%x. "
< "Already shut down. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Already shut down. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2573c5152
< if (fcftab->state == FCFTAB_STATE_SHUTDOWN) {
---
> if (fcftab->state == FCOE_FCFTAB_STATE_SHUTDOWN) {
2575,2577c5154,5157
< "fcftab_shutdown_evt_action: %s:%s arg=%p flag=%x. "
< "Already shutting down. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
> "Already shutting down. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2584c5164
< "fcftab_shutdown_evt_action: %s:%s arg=%p flag=%x. "
---
> "fcoe_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
2586c5166,5167
< emlxs_fcftab_state_xlate(fcftab->state),
---
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2590,2598c5171
< if (hba->state > FC_LINK_DOWN) {
< mutex_enter(&EMLXS_PORT_LOCK);
< if (hba->state > FC_LINK_DOWN) {
< HBASTATS.LinkDown++;
< EMLXS_STATE_CHANGE_LOCKED(hba, FC_LINK_DOWN);
< }
< hba->flag &= FC_LINKDOWN_MASK;
< hba->discovery_timer = 0;
< mutex_exit(&EMLXS_PORT_LOCK);
---
> emlxs_fcf_linkdown(port);
2600,2603c5173
< emlxs_log_link_event(port);
< }
<
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SHUTDOWN,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SHUTDOWN,
2608c5178
< } /* emlxs_fcftab_shutdown_evt_action() */
---
> } /* emlxs_fcoe_fcftab_shutdown_evt_action() */
2612c5182
< emlxs_fcftab_req_handler(emlxs_port_t *port, void *arg1)
---
> emlxs_fcoe_fcftab_req_handler(emlxs_port_t *port, void *arg1)
2622,2623c5192,5193
< if (fcftab->flag & EMLXS_FCFTAB_OFFLINE_REQ) {
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_OFFLINE,
---
> if (fcftab->flag & EMLXS_FCOE_FCFTAB_OFFLINE_REQ) {
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_OFFLINE,
2627,2628c5197,5198
< else if (fcftab->flag & EMLXS_FCFTAB_SOL_REQ) {
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT,
---
> else if (fcftab->flag & EMLXS_FCOE_FCFTAB_SOL_REQ) {
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SOLICIT,
2632,2633c5202,5203
< else if (fcftab->flag & EMLXS_FCFTAB_READ_REQ) {
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_READ,
---
> else if (fcftab->flag & EMLXS_FCOE_FCFTAB_READ_REQ) {
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_READ,
2639c5209
< } /* emlxs_fcftab_req_handler() */
---
> } /* emlxs_fcoe_fcftab_req_handler() */
2643c5213
< emlxs_fcftab_read_timer(emlxs_hba_t *hba)
---
> emlxs_fcoe_fcftab_read_timer(emlxs_hba_t *hba)
2650c5220
< (hba->timer_tics <= fcftab->read_timer)) {
---
> (hba->timer_tics < fcftab->read_timer)) {
2654c5224
< fcftab->flag |= EMLXS_FCFTAB_READ_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_READ_REQ;
2657c5227
< case FCFTAB_STATE_SOLICIT_CMPL:
---
> case FCOE_FCFTAB_STATE_SOLICIT_CMPL:
2659,2660c5229,5231
< "fcftab_timer: %s",
< emlxs_fcftab_state_xlate(fcftab->state));
---
> "fcoe_fcftab_timer:%x %s >",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state));
2662,2663c5233,5234
< (void) emlxs_fcftab_state(port, FCFTAB_STATE_READ, 0, 0,
< FCFTAB_READ_ALL);
---
> (void) emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_READ,
> 0, 0, FCFTAB_READ_ALL);
2668,2669c5239,5241
< "fcftab_timer: %s Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state));
---
> "fcoe_fcftab_timer:%x %s",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state));
2675c5247
< } /* emlxs_fcftab_read_timer() */
---
> } /* emlxs_fcoe_fcftab_read_timer() */
2679c5251
< emlxs_fcftab_sol_timer(emlxs_hba_t *hba)
---
> emlxs_fcoe_fcftab_sol_timer(emlxs_hba_t *hba)
2686c5258
< (hba->timer_tics <= fcftab->sol_timer)) {
---
> (hba->timer_tics < fcftab->sol_timer)) {
2692c5264
< case FCFTAB_STATE_ONLINE:
---
> case FCOE_FCFTAB_STATE_ONLINE:
2694c5266
< fcftab->flag |= EMLXS_FCFTAB_SOL_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_SOL_REQ;
2698,2699c5270,5272
< "fcftab_sol_timer: %s gen=%x. Soliciting.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_sol_timer:%x %s gen=%x. Soliciting. >",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2702c5275
< (void) emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT,
---
> (void) emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SOLICIT,
2708,2709c5281,5283
< "fcftab_sol_timer: %s Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state));
---
> "fcoe_fcftab_sol_timer:%x %s",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state));
2715c5289
< } /* emlxs_fcftab_sol_timer() */
---
> } /* emlxs_fcoe_fcftab_sol_timer() */
2719c5293
< emlxs_fcftab_offline_timer(emlxs_hba_t *hba)
---
> emlxs_fcoe_fcftab_offline_timer(emlxs_hba_t *hba)
2731c5305
< (hba->timer_tics <= fcfp->offline_timer)) {
---
> (hba->timer_tics < fcfp->offline_timer)) {
2737,2739c5311,5313
< "fcftab_offline_timer:%d %s. Offlining.",
< fcfp->fcf_index,
< emlxs_fcfi_state_xlate(fcfp->state));
---
> "fcoe_fcftab_offline_timer:%x. Offlining FCFI:%d. >",
> fcftab->TID,
> fcfp->fcf_index);
2746c5320
< } /* emlxs_fcftab_offline_timer() */
---
> } /* emlxs_fcoe_fcftab_offline_timer() */
2751c5325
< emlxs_fcftab_sol_failed_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_sol_failed_action(emlxs_port_t *port, uint32_t evt,
2756c5330
< uint32_t rval;
---
> uint32_t rval = 0;
2760c5334
< if (fcftab->state != FCFTAB_STATE_SOLICIT_FAILED) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_SOLICIT_FAILED) {
2762,2764c5336,5339
< "fcftab_sol_failed_action: %s:%s arg=%p attempt=%d. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_sol_failed_action:%x %s:%s arg=%p "
> "attempt=%d. Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2770,2777c5345,5346
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "fcftab_sol_failed_action: %s:%s arg=%p attempt=%d reason=%x",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt), arg1,
< fcftab->attempts,
< fcftab->reason);
<
< if ((fcftab->reason == FCF_REASON_SEND_FAILED) ||
---
> if ((fcftab->reason == FCF_REASON_MBOX_FAILED) ||
> (fcftab->reason == FCF_REASON_SEND_FAILED) ||
2779c5348,5358
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT_CMPL,
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_sol_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Giving up.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_SOLICIT_CMPL,
2782c5361,5371
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT,
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_sol_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Retrying.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_SOLICIT,
2788c5377
< } /* emlxs_fcftab_sol_failed_action() */
---
> } /* emlxs_fcoe_fcftab_sol_failed_action() */
2793c5382
< emlxs_fcftab_sol_mbcmpl(emlxs_hba_t *hba, MAILBOXQ *mbq)
---
> emlxs_fcoe_fcftab_sol_mbcmpl(emlxs_hba_t *hba, MAILBOXQ *mbq)
2798c5387
< uint32_t generation;
---
> uint16_t TID;
2805a5395
> TID = (uint16_t)((unsigned long)mbq->context);
2820c5410
< if (fcftab->state != FCFTAB_STATE_SOLICIT) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_SOLICIT) {
2822,2823c5412,5414
< "fcftab_sol_mbcmpl: %s. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state));
---
> "fcoe_fcftab_sol_mbcmpl:%x %s.",
> TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state));
2829,2830c5420
< generation = (uint32_t)((uintptr_t)mbq->context);
< if (generation != fcftab->generation) {
---
> if (TID != fcftab->generation) {
2832,2835c5422,5426
< "fcftab_sol_mbcmpl: %s gen=%x,%x. "
< "Incorrect generation. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
< generation, fcftab->generation);
---
> "fcoe_fcftab_sol_mbcmpl:%x %s. "
> "Incorrect generation %x. Dropping.",
> TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> fcftab->generation);
2844,2845c5435,5437
< "fcftab_sol_mbcmpl:failed. status=%x",
< mb4->mbxStatus);
---
> "fcoe_fcftab_sol_mbcmpl:%x failed. %s. >",
> fcftab->TID,
> emlxs_mb_xlate_status(mb4->mbxStatus));
2847,2848c5439,5440
< (void) emlxs_fcftab_state(port,
< FCFTAB_STATE_SOLICIT_FAILED,
---
> (void) emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_SOLICIT_FAILED,
2856,2858c5448,5451
< "fcftab_sol_mbcmpl:failed. status=%x,%x,%x",
< mb4->mbxStatus, status,
< xstatus);
---
> "fcoe_fcftab_sol_mbcmpl:%x failed. %s %x,%x. >",
> fcftab->TID,
> emlxs_mb_xlate_status(mb4->mbxStatus),
> status, xstatus);
2860,2861c5453,5454
< (void) emlxs_fcftab_state(port,
< FCFTAB_STATE_SOLICIT_FAILED,
---
> (void) emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_SOLICIT_FAILED,
2870,2871c5463,5465
< "fcftab_sol_mbcmpl: %s gen=%x",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_sol_mbcmpl:%x %s gen=%x. Solicit complete. >",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2874c5468
< (void) emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT_CMPL,
---
> (void) emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SOLICIT_CMPL,
2880c5474
< } /* emlxs_fcftab_sol_mbcmpl() */
---
> } /* emlxs_fcoe_fcftab_sol_mbcmpl() */
2885c5479
< emlxs_fcftab_sol_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_sol_action(emlxs_port_t *port, uint32_t evt,
2893c5487
< uint32_t rval;
---
> uint32_t rval = 0;
2895c5489
< if (fcftab->state != FCFTAB_STATE_SOLICIT) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_SOLICIT) {
2897,2899c5491,5494
< "fcftab_sol_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_sol_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2904,2906c5499,5501
< if ((fcftab->prev_state != FCFTAB_STATE_SOLICIT_FAILED) ||
< (fcftab->flag & EMLXS_FCFTAB_SOL_REQ)) {
< fcftab->flag &= ~EMLXS_FCFTAB_SOL_REQ;
---
> if ((fcftab->prev_state != FCOE_FCFTAB_STATE_SOLICIT_FAILED) ||
> (fcftab->flag & EMLXS_FCOE_FCFTAB_SOL_REQ)) {
> fcftab->flag &= ~EMLXS_FCOE_FCFTAB_SOL_REQ;
2912c5507
< "fcftab_sol_action: %s:%s arg=%p gen=%d flag=%x. "
---
> "fcoe_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
2914c5509,5510
< emlxs_fcftab_state_xlate(fcftab->state),
---
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2919c5515
< rval = emlxs_fcftab_req_handler(port, arg1);
---
> rval = emlxs_fcoe_fcftab_req_handler(port, arg1);
2922a5519,5522
> if (fcftab->attempts == 0) {
> fcftab->TID = fcftab->generation;
> }
>
2924,2926c5524,5527
< "fcftab_sol_action: %s:%s arg = %p gen=%x fip=%x. "
< "Requesting solicit.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_sol_action:%x %s:%s arg=%p gen=%x fip=%x. "
> "Requesting solicit. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
2931,2932c5532,5534
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT_FAILED,
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_SOLICIT_FAILED,
2944,2945c5546,5547
< mbq->mbox_cmpl = emlxs_fcftab_sol_mbcmpl;
< mbq->context = (void *)((uintptr_t)fcftab->generation);
---
> mbq->mbox_cmpl = emlxs_fcoe_fcftab_sol_mbcmpl;
> mbq->context = (void *)((unsigned long)fcftab->TID);
2977c5579
< if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF, 1)) == 0) {
---
> if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF)) == 0) {
2980,2981c5582,5583
< rval = emlxs_fcftab_state(port,
< FCFTAB_STATE_SOLICIT_FAILED,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_SOLICIT_FAILED,
2988,2989c5590,5591
< mbq->mbox_cmpl = emlxs_fcftab_sol_mbcmpl;
< mbq->context = (void *)((uintptr_t)fcftab->generation);
---
> mbq->mbox_cmpl = emlxs_fcoe_fcftab_sol_mbcmpl;
> mbq->context = (void *)((unsigned long)fcftab->generation);
3055c5657,5658
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT_FAILED,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_SOLICIT_FAILED,
3062a5666
> } /* emlxs_fcoe_fcftab_sol_action() */
3064d5667
< } /* emlxs_fcftab_sol_action() */
3066d5668
<
3069c5671
< emlxs_fcftab_sol_cmpl_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_sol_cmpl_action(emlxs_port_t *port, uint32_t evt,
3074c5676
< uint32_t rval;
---
> uint32_t rval = 0;
3077c5679
< if (fcftab->state != FCFTAB_STATE_SOLICIT_CMPL) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_SOLICIT_CMPL) {
3079,3081c5681,5684
< "fcftab_sol_cmpl_action: %s:%s arg=%p "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_sol_cmpl_action:%x %s:%s arg=%p "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3086,3088d5688
< /* Increment the generation counter */
< fcftab->generation++;
<
3091,3093c5691,5694
< "fcftab_sol_cmpl_action: %s:%s arg=%p gen=%d flag=%x. "
< "Handling request.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_sol_cmpl_action:%x %s:%s arg=%p gen=%d "
> "flag=%x. Handling request.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3098c5699
< rval = emlxs_fcftab_req_handler(port, arg1);
---
> rval = emlxs_fcoe_fcftab_req_handler(port, arg1);
3103c5704
< "fcftab_sol_cmpl_action: %s:%s arg=%p gen=%d. "
---
> "fcoe_fcftab_sol_cmpl_action:%x %s:%s arg=%p gen=%d. "
3105c5706,5707
< emlxs_fcftab_state_xlate(fcftab->state),
---
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3116c5718
< } /* emlxs_fcftab_sol_cmpl_action() */
---
> } /* emlxs_fcoe_fcftab_sol_cmpl_action() */
3121c5723
< emlxs_fcftab_read_mbcmpl(emlxs_hba_t *hba, MAILBOXQ *mbq)
---
> emlxs_fcoe_fcftab_read_mbcmpl(emlxs_hba_t *hba, MAILBOXQ *mbq)
3131c5733,5735
< uint32_t index;
---
> uint32_t context;
> uint16_t index;
> uint16_t TID;
3134a5739,5741
> context = (uint32_t)((unsigned long)mbq->context);
> TID = (uint16_t)(context >> 16);
> index = (uint16_t)(context & 0xFFFF);
3136c5743
< if (fcftab->state != FCFTAB_STATE_READ) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_READ) {
3138,3139c5745,5747
< "fcftab_read_mbcmpl: state=%s. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state));
---
> "fcoe_fcftab_read_mbcmpl:%x index=%d %s.",
> TID, index,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state));
3145c5753,5764
< index = (uint32_t)((uintptr_t)mbq->context);
---
> if (TID != fcftab->generation) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_read_mbcmpl:%x index=%d %s. "
> "Incorrect generation %x. Dropping.",
> TID, index,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> fcftab->generation);
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
3151,3153c5770,5773
< "fcftab_read_mbcmpl:%d failed. status=%x,%x,%x",
< index, mb4->mbxStatus, hdr_rsp->status,
< hdr_rsp->extra_status);
---
> "fcoe_fcftab_read_mbcmpl:%x index=%d failed. %s %x,%x. >",
> fcftab->TID, index,
> emlxs_mb_xlate_status(mb4->mbxStatus),
> hdr_rsp->status, hdr_rsp->extra_status);
3155,3156c5775,5778
< (void) emlxs_fcftab_state(port, FCFTAB_STATE_READ_FAILED,
< FCF_REASON_MBOX_FAILED, mb4->mbxStatus, 0);
---
> (void) emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ_FAILED,
> FCF_REASON_MBOX_FAILED, mb4->mbxStatus,
> (void*)((unsigned long)index));
3163,3164c5785,5787
< "fcftab_read_mbcmpl: state=%s",
< emlxs_fcftab_state_xlate(fcftab->state));
---
> "fcoe_fcftab_read_mbcmpl:%x index=%d %s",
> fcftab->TID, index,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state));
3208,3209c5831,5833
< "fcftab_read_mbcmpl:%d failed. Unable to allocate fcfi.",
< index);
---
> "fcoe_fcftab_read_mbcmpl:%x index=%d failed. "
> "Unable to allocate fcfi. >",
> fcftab->TID, index);
3211,3212c5835,5838
< (void) emlxs_fcftab_state(port, FCFTAB_STATE_READ_FAILED,
< FCF_REASON_NO_FCFI, 0, 0);
---
> (void) emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ_FAILED,
> FCF_REASON_NO_FCFI, 0,
> (void*)((unsigned long)index));
3223c5849,5851
< fcftab->index = fcf->params.response.next_valid_fcf_index;
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_read_mbcmpl:%x. Read next. >",
> fcftab->TID);
3225c5853
< (void) emlxs_fcftab_state(port, FCFTAB_STATE_READ,
---
> (void) emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_READ,
3227c5855
< (void *)((uintptr_t)fcf->params.response.
---
> (void *)((unsigned long)fcf->params.response.
3230,3231c5858,5864
< (void) emlxs_fcftab_state(port, FCFTAB_STATE_READ_CMPL,
< 0, 0, 0);
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_read_mbcmpl:%x. Read complete. >",
> fcftab->TID);
>
> (void) emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ_CMPL,
> 0, 0, (void*)((unsigned long)index));
3237c5870
< } /* emlxs_fcftab_read_mbcmpl() */
---
> } /* emlxs_fcoe_fcftab_read_mbcmpl() */
3242c5875
< emlxs_fcftab_read_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_read_action(emlxs_port_t *port, uint32_t evt,
3250c5883
< uint32_t rval;
---
> uint32_t rval = 0;
3253c5886,5887
< uint16_t index;
---
> uint16_t index = (uint16_t)((unsigned long)arg1);
> uint32_t context;
3255c5889
< if (fcftab->state != FCFTAB_STATE_READ) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_READ) {
3257,3259c5891,5894
< "fcftab_read_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_read_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3264,3266c5899,5901
< fcftab->flag &= ~EMLXS_FCFTAB_READ_REQ;
<
< if (fcftab->prev_state != FCFTAB_STATE_READ_FAILED) {
---
> if ((fcftab->prev_state != FCOE_FCFTAB_STATE_READ_FAILED) ||
> (fcftab->flag & EMLXS_FCOE_FCFTAB_READ_REQ)) {
> fcftab->flag &= ~EMLXS_FCOE_FCFTAB_READ_REQ;
3272c5907
< "fcftab_read_action: %s:%s arg=%p flag=%x. "
---
> "fcoe_fcftab_read_action:%x %s:%s arg=%p flag=%x. "
3274c5909,5910
< emlxs_fcftab_state_xlate(fcftab->state),
---
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3278c5914
< rval = emlxs_fcftab_req_handler(port, arg1);
---
> rval = emlxs_fcoe_fcftab_req_handler(port, arg1);
3282c5918,5920
< index = (uint16_t)((uintptr_t)arg1);
---
> if (fcftab->attempts == 0) {
> fcftab->TID = fcftab->generation;
> }
3285,3286c5923,5926
< "fcftab_read_action: %s:%s arg=%p attempts=%d. Reading FCF.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_read_action:%x %s:%s arg=%p attempts=%d. "
> "Reading FCF. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3290,3291c5930,5932
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_READ_FAILED,
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ_FAILED,
3298c5939
< if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF, 1)) == 0) {
---
> if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF)) == 0) {
3301c5942,5943
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_READ_FAILED,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ_FAILED,
3308,3309c5950,5953
< mbq->mbox_cmpl = emlxs_fcftab_read_mbcmpl;
< mbq->context = (void *)((uintptr_t)index);
---
> mbq->mbox_cmpl = emlxs_fcoe_fcftab_read_mbcmpl;
>
> context = ((uint32_t)fcftab->TID << 16) | (uint32_t)index;
> mbq->context = (void *)((unsigned long)context);
3330c5974,5975
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_READ_FAILED,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ_FAILED,
3338c5983
< } /* emlxs_fcftab_read_action() */
---
> } /* emlxs_fcoe_fcftab_read_action() */
3343c5988
< emlxs_fcftab_read_failed_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_read_failed_action(emlxs_port_t *port, uint32_t evt,
3348c5993
< uint32_t rval;
---
> uint32_t rval = 0;
3352c5997
< if (fcftab->state != FCFTAB_STATE_READ_FAILED) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_READ_FAILED) {
3354,3356c5999,6002
< "fcftab_read_failed_action: %s:%s arg=%p attempt=%d. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_read_failed_action:%x %s:%s arg=%p "
> "attempt=%d. Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3359d6004
<
3363,3370c6008,6009
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "fcftab_read_failed_action: %s:%s arg=%p attempt=%d reason=%x",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt), arg1,
< fcftab->attempts,
< fcftab->reason);
<
< if ((fcftab->reason == FCF_REASON_SEND_FAILED) ||
---
> if ((fcftab->reason == FCF_REASON_MBOX_FAILED) ||
> (fcftab->reason == FCF_REASON_SEND_FAILED) ||
3372c6011,6021
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_READ_CMPL,
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_read_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Giving up.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ_CMPL,
3375c6024,6033
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_READ,
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_read_failed_action:%x %s:%s arg=%p "
> "attempt=%d reason=%x. Retrying.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt), arg1,
> fcftab->attempts,
> fcftab->reason);
>
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_READ,
3381c6039
< } /* emlxs_fcftab_read_failed_action() */
---
> } /* emlxs_fcoe_fcftab_read_failed_action() */
3386c6044
< emlxs_fcftab_read_cmpl_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_read_cmpl_action(emlxs_port_t *port, uint32_t evt,
3391c6049
< uint32_t rval;
---
> uint32_t rval = 0;
3395c6053
< if (fcftab->state != FCFTAB_STATE_READ_CMPL) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_READ_CMPL) {
3397,3399c6055,6058
< "fcftab_read_cmpl_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_read_cmpl_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3405c6064
< "fcftab_read_cmpl_action: %s:%s arg=%p attempts=%d. "
---
> "fcoe_fcftab_read_cmpl_action:%x %s:%s arg=%p attempts=%d. "
3407c6066,6067
< emlxs_fcftab_state_xlate(fcftab->state),
---
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3432,3435c6092,6095
< "fcftab_read_cmpl_action:%d %s. "
< "FCF stale. Freeing FCF.",
< fcfp->fcf_index,
< emlxs_fcfi_state_xlate(fcfp->state));
---
> "fcoe_fcftab_read_cmpl_action:%x. FCF stale. "
> "Freeing FCFI:%d. >",
> fcftab->TID,
> fcfp->fcf_index);
3442c6102
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_FCFI_ONLINE,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_FCFI_ONLINE,
3447c6107
< } /* emlxs_fcftab_read_cmpl_action() */
---
> } /* emlxs_fcoe_fcftab_read_cmpl_action() */
3451c6111
< emlxs_fcftab_fcfi_select(emlxs_port_t *port, char *fabric_wwn)
---
> emlxs_fcoe_fcftab_fcfi_select(emlxs_port_t *port, char *fabric_wwn)
3556c6216
< } /* emlxs_fcftab_fcfi_select() */
---
> } /* emlxs_fcoe_fcftab_fcfi_select() */
3561c6221
< emlxs_fcftab_process(emlxs_port_t *port)
---
> emlxs_fcoe_fcftab_process(emlxs_port_t *port)
3594c6254
< "fcftab_process:%d fcfi=%d %s. "
---
> "fcoe_fcftab_process:%x %d fcfi=%d %s. "
3595a6256
> fcftab->TID,
3613c6274
< "fcftab_process:%d fcfi=%d %s. "
---
> "fcoe_fcftab_process:%x %d fcfi=%d %s. "
3615a6277
> fcftab->TID,
3628,3631c6290,6293
< "fcftab_process:%d fcfi=%d %s. "
< "No longer viable. Freeing FCF.",
< i, fcfp->fcf_index,
< emlxs_fcfi_state_xlate(fcfp->state));
---
> "fcoe_fcftab_process:%x %d. "
> "No longer viable. Freeing FCFI:%d. >",
> fcftab->TID,
> i, fcfp->fcf_index);
3636c6298
< "fcftab_process:%d fcfi=%d %s. "
---
> "fcoe_fcftab_process:%x %d fcfi=%d %s. "
3637a6300
> fcftab->TID,
3651c6314
< fcfp = emlxs_fcftab_fcfi_select(port, 0);
---
> fcfp = emlxs_fcoe_fcftab_fcfi_select(port, 0);
3658c6321
< "fcftab_process:%d fcfi=%d %s. "
---
> "fcoe_fcftab_process:%x %d fcfi=%d %s. "
3659a6323
> fcftab->TID,
3664c6328,6330
< "fcftab_process:%d. No FCF available.",
---
> "fcoe_fcftab_process:%x %d. "
> "No FCF available.",
> fcftab->TID,
3676c6342
< "fcftab_process:%d fcfi=%d %s. "
---
> "fcoe_fcftab_process:%x %d fcfi=%d %s. "
3677a6344
> fcftab->TID,
3686c6353
< fcfp = emlxs_fcftab_fcfi_select(port,
---
> fcfp = emlxs_fcoe_fcftab_fcfi_select(port,
3694c6361
< "fcftab_process:%d fcfi=%d %s. "
---
> "fcoe_fcftab_process:%x %d fcfi=%d %s. "
3695a6363
> fcftab->TID,
3702c6370
< fcfp = emlxs_fcftab_fcfi_select(port, 0);
---
> fcfp = emlxs_fcoe_fcftab_fcfi_select(port, 0);
3709c6377
< "fcftab_process:%d fcfi=%d %s. "
---
> "fcoe_fcftab_process:%x %d fcfi=%d %s. "
3710a6379
> fcftab->TID,
3717c6386,6387
< "fcftab_process:%d. No FCF available.",
---
> "fcoe_fcftab_process:%x %d. No FCF available.",
> fcftab->TID,
3748c6418
< } /* emlxs_fcftab_process() */
---
> } /* emlxs_fcoe_fcftab_process() */
3751d6420
<
3754c6423
< emlxs_fcftab_fcfi_online_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_fcfi_online_action(emlxs_port_t *port, uint32_t evt,
3765c6434
< if (fcftab->state != FCFTAB_STATE_FCFI_ONLINE) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_FCFI_ONLINE) {
3767,3769c6436,6439
< "fcftab_fcfi_online_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_online_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3776c6446
< "fcftab_fcfi_online_action: %s:%s arg=%p flag=%x. "
---
> "fcoe_fcftab_fcfi_online_action:%x flag=%x. "
3778,3779c6448
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt), arg1,
---
> fcftab->TID,
3782c6451
< rval = emlxs_fcftab_req_handler(port, arg1);
---
> rval = emlxs_fcoe_fcftab_req_handler(port, arg1);
3786c6455
< emlxs_fcftab_process(port);
---
> emlxs_fcoe_fcftab_process(port);
3795,3796c6464,6466
< "fcftab_fcfi_online_action: fcfi_count=%d. "
< "Onlining FCF:%d.",
---
> "fcoe_fcftab_fcfi_online_action:%x fcfi_count=%d. "
> "Onlining FCFI:%d. >",
> fcftab->TID,
3806,3807c6476,6478
< "fcftab_fcfi_online_action: fcfi_count=%d. "
< "Offlining FCF:%d.",
---
> "fcoe_fcftab_fcfi_online_action:%x fcfi_count=%d. "
> "Offlining fcfi:%d.",
> fcftab->TID,
3815c6486,6487
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_FCFI_OFFLINE,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_FCFI_OFFLINE,
3819c6491
< emlxs_fcftab_offline_timer(hba);
---
> emlxs_fcoe_fcftab_offline_timer(hba);
3826c6498,6499
< "fcftab_fcfi_online_action: fcfi_count=%d.",
---
> "fcoe_fcftab_fcfi_online_action:%x fcfi_count=%d.",
> fcftab->TID,
3830c6503,6504
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_FCFI_ONLINE_CMPL,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_FCFI_ONLINE_CMPL,
3835c6509
< } /* emlxs_fcftab_fcfi_online_action() */
---
> } /* emlxs_fcoe_fcftab_fcfi_online_action() */
3840c6514
< emlxs_fcftab_fcfi_online_cmpl_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_fcfi_online_cmpl_action(emlxs_port_t *port, uint32_t evt,
3845c6519
< uint32_t rval;
---
> uint32_t rval = 0;
3847c6521
< if (fcftab->state != FCFTAB_STATE_FCFI_ONLINE_CMPL) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_FCFI_ONLINE_CMPL) {
3849,3851c6523,6526
< "fcftab_fcfi_online_cmpl_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3858,3860c6533,6536
< "fcftab_fcfi_online_cmpl_action: %s:%s arg=%p flag=%x. "
< "Handling request.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_online_cmpl_action:%x %s:%s "
> "arg=%p flag=%x. Handling request.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3864c6540
< rval = emlxs_fcftab_req_handler(port, arg1);
---
> rval = emlxs_fcoe_fcftab_req_handler(port, arg1);
3869,3870c6545,6548
< "fcftab_fcfi_online_cmpl_action: %s:%s arg=%p",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p. "
> "Going online.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3873c6551
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_ONLINE,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_ONLINE,
3878c6556
< } /* emlxs_fcftab_fcfi_online_cmpl_action() */
---
> } /* emlxs_fcoe_fcftab_fcfi_online_cmpl_action() */
3883c6561
< emlxs_fcftab_fcfi_offline_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_fcfi_offline_action(emlxs_port_t *port, uint32_t evt,
3889c6567
< uint32_t rval;
---
> uint32_t rval = 0;
3893c6571
< if (fcftab->state != FCFTAB_STATE_FCFI_OFFLINE) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_FCFI_OFFLINE) {
3895,3897c6573,6576
< "fcftab_fcfi_offline_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_offline_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3919,3921c6598,6601
< "fcftab_fcfi_offline_action: %s:%s arg=%p "
< "fcfi_offline=%d. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_offline_action:%x %s:%s arg=%p "
> "fcfi_offline=%d. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3929,3930c6609,6611
< "fcftab_fcfi_offline_action: %s:%s arg=%p.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_offline_action:%x %s:%s arg=%p.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3933c6614,6615
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_FCFI_OFFLINE_CMPL,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL,
3934a6617
>
3937c6620
< } /* emlxs_fcftab_fcfi_offline_action() */
---
> } /* emlxs_fcoe_fcftab_fcfi_offline_action() */
3942c6625
< emlxs_fcftab_fcfi_offline_cmpl_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_fcfi_offline_cmpl_action(emlxs_port_t *port, uint32_t evt,
3947c6630
< uint32_t rval;
---
> uint32_t rval = 0;
3949c6632
< if (fcftab->state != FCFTAB_STATE_FCFI_OFFLINE_CMPL) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL) {
3951,3953c6634,6637
< "fcftab_fcfi_offline_cmpl_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_offline_cmpl_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3959,3960c6643,6644
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
< "fcftab_fcfi_offline_cmpl_action: %s:%s arg=%p. "
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_fcfi_offline_cmpl_action:%x %s:%s arg=%p. "
3962c6646,6647
< emlxs_fcftab_state_xlate(fcftab->state),
---
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3965c6650
< rval = emlxs_fcftab_req_handler(port, arg1);
---
> rval = emlxs_fcoe_fcftab_req_handler(port, arg1);
3970,3971c6655,6658
< "fcftab_fcfi_offline_cmpl_action: %s:%s arg=%p.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_fcfi_offline_cmpl_action:%x %s:%s arg=%p. "
> "Returning FCF(s) online.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
3974c6661
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_FCFI_ONLINE,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_FCFI_ONLINE,
3979c6666
< } /* emlxs_fcftab_fcfi_offline_cmpl_action() */
---
> } /* emlxs_fcoe_fcftab_fcfi_offline_cmpl_action() */
3984c6671
< emlxs_fcftab_found_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_found_evt_action(emlxs_port_t *port, uint32_t evt,
3989c6676
< uint32_t fcf_index = (uint32_t)((uintptr_t)arg1);
---
> uint32_t fcf_index = (uint32_t)((unsigned long)arg1);
3995,3997c6682,6685
< "fcftab_found_evt_action: %s:%s fcf_index=%d. "
< "Invalid event type. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_found_evt_action:%x %s:%s fcf_index=%d. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4005,4007c6693,6695
< case FCFTAB_STATE_SOLICIT:
< case FCFTAB_STATE_SOLICIT_CMPL:
< case FCFTAB_STATE_READ:
---
> case FCOE_FCFTAB_STATE_SOLICIT:
> case FCOE_FCFTAB_STATE_SOLICIT_CMPL:
> case FCOE_FCFTAB_STATE_READ:
4009,4011c6697,6700
< "fcftab_found_evt_action: %s:%s fcf_index=%d gen=%x. "
< "Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_found_evt_action:%x %s:%s "
> "fcf_index=%d gen=%x. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4016c6705
< /* case FCFTAB_STATE_FCFI_OFFLINE: */
---
> /* case FCOE_FCFTAB_STATE_FCFI_OFFLINE: */
4026c6715
< fcftab->flag |= EMLXS_FCFTAB_READ_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_READ_REQ;
4030,4032c6719,6722
< "fcftab_found_evt_action: %s:%s fcf_index=%d "
< "gen=%x. Read FCF table.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_found_evt_action:%x %s:%s "
> "fcf_index=%d gen=%x. Read FCF table.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4036c6726,6727
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_READ,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ,
4047c6738
< fcftab->flag |= EMLXS_FCFTAB_READ_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_READ_REQ;
4051,4053c6742,6746
< "fcftab_found_evt_action: %s:%s fcf_index=%d "
< "gen=%x fcfi_online=%d. Read FCF table.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_found_evt_action:%x %s:%s "
> "fcf_index=%d gen=%x fcfi_online=%d. "
> "Read FCF table.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4058c6751,6752
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_READ,
---
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ,
4065,4067c6759,6762
< "fcftab_found_evt_action: %s:%s fcfi=%d. "
< "FCF not needed. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_found_evt_action:%x %s:%s fcfi=%d. "
> "FCF not needed. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4076c6771
< } /* emlxs_fcftab_found_evt_action() */
---
> } /* emlxs_fcoe_fcftab_found_evt_action() */
4081c6776
< emlxs_fcftab_lost_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_lost_evt_action(emlxs_port_t *port, uint32_t evt,
4087c6782
< uint32_t fcf_index = (uint32_t)((uintptr_t)arg1);
---
> uint32_t fcf_index = (uint32_t)((unsigned long)arg1);
4091c6786
< uint32_t rval;
---
> uint32_t rval = 0;
4095,4097c6790,6793
< "fcftab_lost_evt_action: %s:%s fcf_index=%d. "
< "Invalid event type. Terminated",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_lost_evt_action:%x %s:%s fcf_index=%d. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4109,4111c6805,6808
< "fcftab_lost_evt_action: %s:%s fcf_index=%d. "
< "FCF not found. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_lost_evt_action:%x %s:%s fcf_index=%d. "
> "FCF not found. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4120,4122c6817,6820
< "fcftab_changed_evt_action: %s:%s fcf_index=%d. "
< "FCF not selected. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_changed_evt_action:%x %s:%s fcf_index=%d. "
> "FCF not selected. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4132c6830
< vpip = &vport->VPIobj;
---
> vpip = vport->vpip;
4140,4142c6838
< vpip->flag &= ~EMLXS_VPI_LOGI;
< if (vpip->flag & EMLXS_VPI_VFI_LOGI) {
< vpip->flag &= ~EMLXS_VPI_VFI_LOGI;
---
> emlxs_vpi_logo_handler(port, vpip);
4144,4148d6839
< if (vpip->vfip->logi_count > 0) {
< vpip->vfip->logi_count--;
< }
< }
<
4150,4152c6841,6844
< "fcftab_lost_evt_action: %s:%s fcf_index=%d gen=%x. "
< "Offlining VPI:%d.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_lost_evt_action:%x %s:%s fcf_index=%d gen=%x. "
> "Offlining VPI:%d. >",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4161c6853
< case FCFTAB_STATE_SOLICIT:
---
> case FCOE_FCFTAB_STATE_SOLICIT:
4163,4165c6855,6858
< "fcftab_lost_evt_action: %s gen=%x. "
< "Already soliciting. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_lost_evt_action:%x %s gen=%x. "
> "Already soliciting. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4171c6864
< fcftab->flag |= EMLXS_FCFTAB_SOL_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_SOL_REQ;
4175,4176c6868,6870
< "fcftab_lost_evt_action: %s gen=%x. Soliciting.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_lost_evt_action:%x %s gen=%x. Soliciting.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4179c6873
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SOLICIT,
4186c6880
< } /* emlxs_fcftab_lost_evt_action() */
---
> } /* emlxs_fcoe_fcftab_lost_evt_action() */
4191c6885
< emlxs_fcftab_changed_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_changed_evt_action(emlxs_port_t *port, uint32_t evt,
4197,4198c6891,6892
< uint32_t fcf_index = (uint32_t)((uintptr_t)arg1);
< uint32_t rval;
---
> uint32_t fcf_index = (uint32_t)((unsigned long)arg1);
> uint32_t rval = 0;
4202,4204c6896,6899
< "fcftab_changed_evt_action: %s:%s fcf_index=%d. "
< "Invalid event type. Terminated",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_changed_evt_action:%x %s:%s fcf_index=%d. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4211,4214c6906,6909
< /* Scan for matching fcf index in table */
< fcfp = emlxs_fcfi_find(port, 0, &fcf_index);
<
< if (!fcfp) {
---
> switch (fcftab->state) {
> case FCOE_FCFTAB_STATE_SOLICIT:
> case FCOE_FCFTAB_STATE_SOLICIT_CMPL:
> case FCOE_FCFTAB_STATE_READ:
4216,4218c6911,6914
< "fcftab_changed_evt_action: %s:%s fcf_index=%d. "
< "FCFI not found. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_changed_evt_action:%x %s:%s "
> "fcf_index=%d gen=%x. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4220c6916,6917
< fcf_index);
---
> fcf_index, fcftab->generation);
> break;
4222,4223c6919,6920
< return (1);
< }
---
> /* case FCOE_FCFTAB_STATE_FCFI_OFFLINE: */
> default:
4225,4231c6922,6923
< if (!(fcfp->flag & EMLXS_FCFI_SELECTED)) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "fcftab_changed_evt_action: %s:%s fcf_index=%d. "
< "FCFI not selected. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt),
< fcf_index);
---
> /* Scan for matching fcf index in table */
> fcfp = emlxs_fcfi_find(port, 0, &fcf_index);
4233,4234c6925
< return (1);
< }
---
> if (fcfp && (fcfp->flag & EMLXS_FCFI_SELECTED)) {
4236,4243c6927,6930
< switch (fcftab->state) {
< case FCFTAB_STATE_SOLICIT:
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "fcftab_changed_evt_action: %s gen=%x. "
< "Already soliciting. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
< fcftab->generation);
< break;
---
> /* Trigger table read */
> fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
> fcftab->flag |= EMLXS_FCOE_FCFTAB_READ_REQ;
> fcftab->generation++;
4245,4248c6932,6938
< default:
< fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
< fcftab->flag |= EMLXS_FCFTAB_SOL_REQ;
< fcftab->generation++;
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_changed_evt_action:%x %s:%s "
> "fcf_index=%d gen=%x. Read FCF table.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt),
> fcf_index, fcftab->generation);
4249a6940,6971
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ,
> FCF_REASON_EVENT, evt, arg1);
>
> break;
> }
>
> /* Check if we need more FCF's */
> if (fcftab->fcfi_online < FCFTAB_MAX_FCFI_COUNT) {
>
> /* Trigger table read */
> fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
> fcftab->flag |= EMLXS_FCOE_FCFTAB_READ_REQ;
> fcftab->generation++;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcoe_fcftab_changed_evt_action:%x %s:%s "
> "fcf_index=%d gen=%x fcfi_online=%d. "
> "Read FCF table.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt),
> fcf_index, fcftab->generation,
> fcftab->fcfi_online);
>
> rval = emlxs_fcoe_fcftab_state(port,
> FCOE_FCFTAB_STATE_READ,
> FCF_REASON_EVENT, evt, arg1);
>
> break;
> }
>
4251,4253c6973,6978
< "fcftab_changed_evt_action: %s gen=%x. Soliciting.",
< emlxs_fcftab_state_xlate(fcftab->state),
< fcftab->generation);
---
> "fcoe_fcftab_changed_evt_action:%x %s:%s fcfi=%d. "
> "FCF not needed. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
> emlxs_fcf_event_xlate(evt),
> fcf_index);
4255,4256d6979
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT,
< FCF_REASON_EVENT, evt, arg1);
4262c6985
< } /* emlxs_fcftab_changed_evt_action() */
---
> } /* emlxs_fcoe_fcftab_changed_evt_action() */
4267c6990
< emlxs_fcftab_fcf_delete(emlxs_port_t *port, uint32_t fcf_index)
---
> emlxs_fcoe_fcftab_fcf_delete(emlxs_port_t *port, uint32_t fcf_index)
4274c6997
< uint32_t rval;
---
> uint32_t rval = 0;
4281c7004,7006
< "fcftab_fcf_delete:%d failed. Out of range.",
---
> "fcoe_fcftab_fcf_delete:%x fcfi:%d failed. "
> "Out of range.",
> fcftab->TID,
4287c7012
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
4289c7014,7016
< "fcftab_fcf_delete:%d failed. Unable to allocate mailbox.",
---
> "fcoe_fcftab_fcf_delete:%x fcfi:%d failed. "
> "Unable to allocate mailbox.",
> fcftab->TID,
4298c7025
< if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF, 1)) == 0) {
---
> if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF)) == 0) {
4300c7027,7029
< "fcftab_fcf_delete:%d failed. Unable to allocate buffer.",
---
> "fcoe_fcftab_fcf_delete:%x fcfi:%d failed. "
> "Unable to allocate buffer.",
> fcftab->TID,
4310c7039
< mbq->context = (void *)((uintptr_t)fcf_index);
---
> mbq->context = (void *)((unsigned long)fcf_index);
4328c7057,7058
< "fcftab_fcf_delete:%d.",
---
> "fcoe_fcftab_fcf_delete:%x fcfi:%d. <",
> fcftab->TID,
4334c7064,7066
< "fcftab_fcf_delete:%d failed. Unable to send request.",
---
> "fcoe_fcftab_fcf_delete:%x fcfi:%d failed. "
> "Unable to send request.",
> fcftab->TID,
4348c7080
< } /* emlxs_fcftab_fcf_delete() */
---
> } /* emlxs_fcoe_fcftab_fcf_delete() */
4353c7085
< emlxs_fcftab_full_evt_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_full_evt_action(emlxs_port_t *port, uint32_t evt,
4359c7091
< uint32_t rval;
---
> uint32_t rval = 0;
4367,4369c7099,7102
< "fcftab_full_evt_action: %s:%s arg=%p. "
< "Invalid event type. Terminated",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_full_evt_action:%x %s:%s arg=%p. "
> "Invalid event type. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4377,4379c7110,7113
< "fcftab_full_evt_action: %s:%s arg=%p fcfi_online=%d. "
< "Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_full_evt_action:%x %s:%s arg=%p "
> "fcfi_online=%d. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4387c7121
< "fcftab_full_evt_action: %s:%s arg=%p fcfi_online=%d. "
---
> "fcoe_fcftab_full_evt_action:%x %s:%s arg=%p fcfi_online=%d. "
4389c7123,7124
< emlxs_fcftab_state_xlate(fcftab->state),
---
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4414,4415c7149,7151
< "fcftab_full_evt_action: fcfi=%d %s flag=%x. "
< "Deleting FCF.",
---
> "fcoe_fcftab_full_evt_action:%x. "
> "Deleting FCFI:%d %x. >",
> fcftab->TID,
4417d7152
< emlxs_fcfi_state_xlate(fcfp->state),
4422c7157
< (void) emlxs_fcftab_fcf_delete(port, fcfp->fcf_index);
---
> (void) emlxs_fcoe_fcftab_fcf_delete(port, fcfp->fcf_index);
4429,4431c7164,7167
< "fcftab_full_evt_action: %s:%s arg=%p. "
< "All FCF's are viable. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_full_evt_action:%x %s:%s arg=%p. "
> "All FCF's are viable. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4438c7174
< case FCFTAB_STATE_SOLICIT:
---
> case FCOE_FCFTAB_STATE_SOLICIT:
4440,4442c7176,7179
< "fcftab_full_evt_action: %s gen=%x. "
< "Already soliciting. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_full_evt_action:%x %s gen=%x. "
> "Already soliciting. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4448c7185
< fcftab->flag |= EMLXS_FCFTAB_SOL_REQ;
---
> fcftab->flag |= EMLXS_FCOE_FCFTAB_SOL_REQ;
4452,4453c7189,7191
< "fcftab_full_evt_action: %s gen=%x. Soliciting.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_full_evt_action:%x %s gen=%x. Soliciting.",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4456c7194
< rval = emlxs_fcftab_state(port, FCFTAB_STATE_SOLICIT,
---
> rval = emlxs_fcoe_fcftab_state(port, FCOE_FCFTAB_STATE_SOLICIT,
4463c7201
< } /* emlxs_fcftab_full_evt_action() */
---
> } /* emlxs_fcoe_fcftab_full_evt_action() */
4468c7206
< emlxs_fcftab_online_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_online_action(emlxs_port_t *port, uint32_t evt,
4475c7213
< uint32_t rval;
---
> uint32_t rval = 0;
4481c7219
< if (fcftab->state != FCFTAB_STATE_ONLINE) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_ONLINE) {
4483,4485c7221,7224
< "fcftab_online_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_online_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4492c7231
< "fcftab_online_action: %s:%s arg=%p flag=%x. "
---
> "fcoe_fcftab_online_action:%x flag=%x. "
4494,4495c7233
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt), arg1,
---
> fcftab->TID,
4498c7236
< rval = emlxs_fcftab_req_handler(port, arg1);
---
> rval = emlxs_fcoe_fcftab_req_handler(port, arg1);
4523,4525c7261,7264
< "fcftab_online_action: %s:%s "
< "fcfi_online=0,%d,%d. Starting solicit timer.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_online_action:%x %s:%s "
> "fcfi_online=0,%d,%d. Starting resolicit timer. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4534,4536c7273,7276
< "fcftab_online_action: %s:%s "
< "fcfi_online=0,%d,0. Wait for FCF event.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_online_action:%x %s:%s "
> "fcfi_online=0,%d,0. Wait for FCF event. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4541,4549c7281
< if (hba->state > FC_LINK_DOWN) {
< mutex_enter(&EMLXS_PORT_LOCK);
< if (hba->state > FC_LINK_DOWN) {
< HBASTATS.LinkDown++;
< EMLXS_STATE_CHANGE_LOCKED(hba, FC_LINK_DOWN);
< }
< hba->flag &= FC_LINKDOWN_MASK;
< hba->discovery_timer = 0;
< mutex_exit(&EMLXS_PORT_LOCK);
---
> emlxs_fcf_linkdown(port);
4551,4553d7282
< emlxs_log_link_event(port);
< }
<
4557,4570d7285
< if (hba->state < FC_LINK_UP) {
< mutex_enter(&EMLXS_PORT_LOCK);
< if (hba->state < FC_LINK_UP) {
< HBASTATS.LinkUp++;
< EMLXS_STATE_CHANGE_LOCKED(hba, FC_LINK_UP);
< }
< hba->discovery_timer =
< hba->timer_tics + cfg[CFG_LINKUP_TIMEOUT].current +
< cfg[CFG_DISC_TIMEOUT].current;
< mutex_exit(&EMLXS_PORT_LOCK);
<
< emlxs_log_link_event(port);
< }
<
4572,4574c7287,7290
< "fcftab_online_action: %s:%s arg=%p fcfi_online=%d. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt), arg1,
---
> "fcoe_fcftab_online_action:%x flag=%x fcfi_online=%d. "
> "Online. <",
> fcftab->TID,
> fcftab->flag,
4577c7293
< return (0);
---
> emlxs_fcf_linkup(port);
4579c7295
< } /* emlxs_fcftab_online_action() */
---
> return (rval);
4580a7297
> } /* emlxs_fcoe_fcftab_online_action() */
4581a7299
>
4584c7302
< emlxs_fcftab_offline_action(emlxs_port_t *port, uint32_t evt,
---
> emlxs_fcoe_fcftab_offline_action(emlxs_port_t *port, uint32_t evt,
4589c7307
< uint32_t rval;
---
> uint32_t rval = 0;
4591c7309
< if (fcftab->state != FCFTAB_STATE_OFFLINE) {
---
> if (fcftab->state != FCOE_FCFTAB_STATE_OFFLINE) {
4593,4595c7311,7314
< "fcftab_offline_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_offline_action:%x %s:%s arg=%p. "
> "Invalid state. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4600d7318
< fcftab->flag &= ~EMLXS_FCFTAB_OFFLINE_REQ;
4601a7320,7321
> fcftab->flag &= ~EMLXS_FCOE_FCFTAB_OFFLINE_REQ;
>
4604c7324
< "fcftab_offline_action: %s:%s arg=%p flag=%x. "
---
> "fcoe_fcftab_offline_action:%x %s:%s arg=%p flag=%x. "
4606c7326,7327
< emlxs_fcftab_state_xlate(fcftab->state),
---
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4610c7331
< rval = emlxs_fcftab_req_handler(port, arg1);
---
> rval = emlxs_fcoe_fcftab_req_handler(port, arg1);
4615,4616c7336,7339
< "fcftab_offline_action: %s:%s arg=%p fcfi_online=%d. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
---
> "fcoe_fcftab_offline_action:%x %s:%s arg=%p fcfi_online=%d. "
> "Offline. <",
> fcftab->TID,
> emlxs_fcoe_fcftab_state_xlate(fcftab->state),
4620c7343
< return (0);
---
> return (rval);
4622c7345
< } /* emlxs_fcftab_offline_action() */
---
> } /* emlxs_fcoe_fcftab_offline_action() */
4625,4722d7347
< /*ARGSUSED*/
< static uint32_t
< emlxs_fcftab_shutdown_action(emlxs_port_t *port, uint32_t evt,
< void *arg1)
< {
< emlxs_hba_t *hba = HBA;
< FCFTable_t *fcftab = &hba->sli.sli4.fcftab;
< FCFIobj_t *fcfp;
< uint32_t i;
< uint32_t online;
<
< if (fcftab->state != FCFTAB_STATE_SHUTDOWN) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
< "fcftab_shutdown_action: %s:%s arg=%p. "
< "Invalid state. Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt), arg1);
< return (1);
< }
<
< fcftab->flag &= ~EMLXS_FCFTAB_REQ_MASK;
<
< if (fcftab->prev_state != FCFTAB_STATE_SHUTDOWN) {
< /* Offline all FCF's */
< fcfp = fcftab->table;
< for (i = 0; i < fcftab->table_count; i++, fcfp++) {
<
< if (fcfp->state <= FCFI_STATE_OFFLINE) {
< continue;
< }
<
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "fcftab_shutdown_action: fcfi=%d %s "
< "fcfi_online=%d. Offlining FCF.",
< fcfp->fcf_index,
< emlxs_fcfi_state_xlate(fcfp->state),
< fcftab->fcfi_online);
<
< (void) emlxs_fcfi_event(port, FCF_EVENT_FCFI_OFFLINE,
< fcfp);
< }
<
< return (0);
< }
<
< /* Check FCF state */
< online = 0;
< fcfp = fcftab->table;
< for (i = 0; i < fcftab->table_count; i++, fcfp++) {
<
< if (fcfp->state <= FCFI_STATE_OFFLINE) {
< continue;
< }
<
< online++;
< }
<
< if (online) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "fcftab_shutdown_action: %s:%s arg=%p. "
< "fcfi_online=%d,%d Terminated.",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt), arg1,
< online, fcftab->fcfi_online);
<
< return (0);
< }
<
< /* Free FCF table */
< fcfp = fcftab->table;
< for (i = 0; i < fcftab->table_count; i++, fcfp++) {
<
< if (fcfp->state == FCFI_STATE_FREE) {
< continue;
< }
<
< (void) emlxs_fcfi_free(port, fcfp);
< }
<
< /* Clean the selection table */
< bzero(fcftab->fcfi, sizeof (fcftab->fcfi));
< fcftab->fcfi_count = 0;
<
< fcftab->flag |= EMLXS_FCFTAB_SHUTDOWN;
<
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "fcftab_shutdown_action: %s:%s arg=%p flag=%x fcfi_online=%d. "
< "Shutdown.",
< emlxs_fcftab_state_xlate(fcftab->state),
< emlxs_fcf_event_xlate(evt), arg1,
< fcftab->flag, fcftab->fcfi_online);
<
< return (0);
<
< } /* emlxs_fcftab_shutdown_action() */
<
<
<
4741c7366
< (void) sprintf(buffer, "state=0x%x", state);
---
> (void) snprintf(buffer, sizeof (buffer), "state=0x%x", state);
4751c7376
< uint32_t rval;
---
> uint32_t rval = 0;
4790c7415
< "fcfi:%d %s:%s arg=%p. No action. Terminated.",
---
> "fcfi_action:%d %s:%s arg=%p. No action. <",
4811c7436
< uint32_t rval;
---
> uint32_t rval = 0;
4821c7446
< "fcfi: %s arg=%p. Null VFI found. Terminated.",
---
> "fcfi_event: %s arg=%p. Null VFI found. <",
4830c7455
< "fcfi: %s arg=%p. FCF not found. Terminated.",
---
> "fcfi_event: %s arg=%p. FCF not found. <",
4843c7468
< "fcfi: %s arg=%p. Null FCFI found. Terminated.",
---
> "fcfi_event: %s arg=%p. Null FCFI found. <",
4855c7480
< "fcfi:%d %s:%s arg=%p",
---
> "fcfi_event:%d %s:%s arg=%p",
4883c7508
< "State not changed. Terminated.",
---
> "State not changed. <",
4888d7512
<
4894c7518
< "fcfi:%d %s-->%s arg=%p",
---
> "fcfi_state:%d %s-->%s arg=%p",
4900c7524
< "fcfi:%d %s-->%s:%s:%s arg=%p",
---
> "fcfi_state:%d %s-->%s:%s:%s arg=%p",
4908c7532
< "fcfi:%d %s-->%s:%s:0x%x arg=%p",
---
> "fcfi_state:%d %s-->%s:%s:0x%x arg=%p",
4916c7540
< "fcfi:%d %s-->%s:%s arg=%p",
---
> "fcfi_state:%d %s-->%s:%s arg=%p",
4950a7575,7578
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcfi_alloc:%d. Allocating FCFI. >",
> fcfp->index);
>
4956a7585,7588
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "fcfi_alloc: Out of FCFI objects.",
> fcfp->index);
>
4965c7597
< uint32_t rval;
---
> uint32_t rval = 0;
5032c7664
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5048c7680
< "fcfi_free_action:%d flag=%x. FCF freed.",
---
> "fcfi_free_action:%d flag=%x. FCF freed. <",
5066c7698
< uint32_t rval;
---
> uint32_t rval = 0;
5071c7703
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5082c7714
< "fcfi_offline_action:%d fcfi_online=%d. Terminated.",
---
> "fcfi_offline_action:%d fcfi_online=%d. <",
5120c7752
< "FCFI offline. Notifying fcftab.",
---
> "FCFI offline. Notifying fcftab. >",
5137c7769
< uint32_t rval;
---
> uint32_t rval = 0;
5142c7774
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
5177,5178c7809
< "fcfi_vfi_online_evt_action:%d flag=%x vfi_online=%d. "
< "Terminated.",
---
> "fcfi_vfi_online_evt_action:%d flag=%x vfi_online=%d. <",
5194c7825
< uint32_t rval;
---
> uint32_t rval = 0;
5200c7831
< if (fcfp->vfi_online != 0) {
---
> if (fcfp->vfi_online) {
5229c7860
< uint32_t rval;
---
> uint32_t rval = 0;
5235c7866
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
5263c7894
< "vfi_online=%d. Terminated.",
---
> "vfi_online=%d. <",
5271,5272c7902
< "fcfi_vfi_offline_evt_action:%d flag=%x vfi_online=%d. "
< "Terminated.",
---
> "fcfi_vfi_offline_evt_action:%d flag=%x vfi_online=%d. <",
5301c7931
< "vfi_online=%d. Offline requested.",
---
> "vfi_online=%d. Offline requested. <",
5310c7940
< "vfi_online=%d. Terminated.",
---
> "vfi_online=%d. <",
5332c7962
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
5342c7972
< "Online already requested. Terminated.",
---
> "Online already requested. <",
5384c8014
< "fcfi_online_evt_action:%d flag=%x. Terminated.",
---
> "fcfi_online_evt_action:%d flag=%x. <",
5402c8032
< uint32_t rval;
---
> uint32_t rval = 0;
5408c8038
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5462c8092
< "fcfi_vfi_online_action:%d vfi_online=%d. Onlining VFI:%d.",
---
> "fcfi_vfi_online_action:%d vfi_online=%d. Onlining VFI:%d. >",
5481c8111
< uint32_t rval;
---
> uint32_t rval = 0;
5486c8116
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5512c8142
< uint32_t rval;
---
> uint32_t rval = 0;
5518c8148
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5561c8191
< "fcfi_vfi_offline_action:%d. Offlining VFI:%d",
---
> "fcfi_vfi_offline_action:%d. Offlining VFI:%d >",
5587c8217
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5608c8238
< "fcfi_paused_action:%d vfi_online=%d. Pausing VFI:%d.",
---
> "fcfi_paused_action:%d vfi_online=%d. Pausing VFI:%d. >",
5617c8247
< "fcfi_paused_action:%d vfi_online=%d. FCFI paused.",
---
> "fcfi_paused_action:%d vfi_online=%d. FCFI paused. <",
5636c8266
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5655,5656c8285
< "fcfi_vfi_offline_cmpl_action:%d vfi_online=%d. "
< "Terminated.",
---
> "fcfi_vfi_offline_cmpl_action:%d vfi_online=%d. <",
5671c8300
< uint32_t rval;
---
> uint32_t rval = 0;
5676c8305
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
5686,5687c8315
< "fcfi_offline_evt_action:%d. Offline already requested. "
< "Terminated.",
---
> "fcfi_offline_evt_action:%d. Offline already requested. <",
5695,5696c8323
< "fcfi_offline_evt_action:%d flag=%x. Already offline. "
< "Terminated.",
---
> "fcfi_offline_evt_action:%d flag=%x. Already offline. <",
5726c8353
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5741c8368
< uint32_t rval;
---
> uint32_t rval = 0;
5746c8373
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
5755,5756c8382
< "fcfi_pause_evt_action:%d. Pause already requested. "
< "Terminated.",
---
> "fcfi_pause_evt_action:%d. Pause already requested. <",
5763,5764c8389
< "fcfi_pause_evt_action:%d. Offline already requested. "
< "Terminated.",
---
> "fcfi_pause_evt_action:%d. Offline already requested. <",
5772,5773c8397
< "fcfi_pause_evt_action:%d flag=%x. Already offline. "
< "Terminated.",
---
> "fcfi_pause_evt_action:%d flag=%x. Already offline. <",
5780,5781c8404
< "fcfi_pause_evt_action:%d flag=%x. Already paused. "
< "Terminated.",
---
> "fcfi_pause_evt_action:%d flag=%x. Already paused. <",
5810c8433
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5825c8448
< uint32_t rval;
---
> uint32_t rval = 0;
5832c8455
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5837d8459
<
5874c8496
< uint32_t rval;
---
> uint32_t rval = 0;
5881c8503
< "Invalid state. Terminated.",
---
> "Invalid state. <",
5886d8507
<
5898d8518
< fcfp->flag &= ~EMLXS_FCFI_REG;
5934c8554
< "fcfi_reg_mbcmpl:%d state=%s. Terminated.",
---
> "fcfi_reg_mbcmpl:%d state=%s.",
5944c8564
< "fcfi_reg_mbcmpl:%d failed. status=%x",
---
> "fcfi_reg_mbcmpl:%d failed. %s. >",
5946c8566
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
5958c8578
< "fcfi_reg_mbcmpl:%d Registered. FCFI=%d",
---
> "fcfi_reg_mbcmpl:%d FCFI=%d. Reg complete. >",
5981c8601
< uint32_t rval;
---
> uint32_t rval = 0;
5986c8606
< "Invalid state. Terminated.",
---
> "Invalid state. <",
6014c8634,8635
< "fcfi_reg_action:%d. Already registered. Skipping reg.",
---
> "fcfi_reg_action:%d. Already registered. "
> "Skipping REG_FCFI update.",
6023c8644
< "fcfi_reg_action:%d attempts=%d. Sending FCFI_REG.",
---
> "fcfi_reg_action:%d attempts=%d. Sending REG_FCFI. <",
6027c8648
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
6083c8704
< uint32_t rval;
---
> uint32_t rval = 0;
6088c8709
< "Invalid state. Terminated.",
---
> "Invalid state. <",
6132c8753
< "fcfi_unreg_mbcmpl:%d state=%s. Terminated.",
---
> "fcfi_unreg_mbcmpl:%d state=%s.",
6142c8763
< "fcfi_unreg_mbcmpl:%d failed. status=%x",
---
> "fcfi_unreg_mbcmpl:%d failed. %s. >",
6144c8765
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
6154c8775
< "fcfi_unreg_mbcmpl:%d Unregistered.",
---
> "fcfi_unreg_mbcmpl:%d. Unreg complete. >",
6175c8796
< uint32_t rval;
---
> uint32_t rval = 0;
6180c8801
< "Invalid state. Terminated.",
---
> "Invalid state. <",
6184d8804
<
6190c8810,8811
< "fcfi_unreg_action:%d. Not registered. Skipping unreg.",
---
> "fcfi_unreg_action:%d. Not registered. "
> "Skipping UNREG_FCFI.",
6203c8824
< "fcfi_unreg_action:%d attempts=%d. Sending FCFI_UNREG.",
---
> "fcfi_unreg_action:%d attempts=%d. Sending UNREG_FCFI. <",
6207c8828
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
6243c8864
< uint32_t rval;
---
> uint32_t rval = 0;
6248c8869
< "Invalid state. Terminated.",
---
> "Invalid state. <",
6276c8897
< uint32_t rval;
---
> uint32_t rval = 0;
6283c8904
< "Invalid state. Terminated.",
---
> "Invalid state. <",
6299c8920
< return (1);
---
> return (rval);
6310c8931
< "fcfi_online_action:%d vfi_online=%d. Onlining VFI:%d.",
---
> "fcfi_online_action:%d vfi_online=%d. Onlining VFI:%d. >",
6335c8956
< "FCFI online. Notifying fcftab.",
---
> "FCFI online. Notifying fcftab. >",
6495c9116
< if (fcf_rec->fcf_valid) {
---
> if (fcf_rec->fcf_valid && !fcf_rec->fcf_sol) {
6520c9141
< "fcfi:%d gen=%x tag=%x flag=%x avl=%x val=%x state=%x "
---
> "fcfi:%d gen=%x iotag=%d flag=%x sol=%x avl=%x val=%x state=%x "
6525a9147
> fcf_rec->fcf_sol,
6586c9208
< (void) sprintf(buffer, "state=0x%x", state);
---
> (void) snprintf(buffer, sizeof (buffer), "state=0x%x", state);
6596c9218
< uint32_t rval;
---
> uint32_t rval = 0;
6635c9257
< "vfi:%d %s:%s arg=%p. No action. Terminated.",
---
> "vfi_action:%d %s:%s arg=%p. No action. <",
6666c9288
< "vfi: %s arg=%p. Null VPI found. Terminated.",
---
> "vfi_event: %s arg=%p. Null VPI found. <",
6676c9298
< "vfi: %s arg=%p. VFI not found. Terminated.",
---
> "vfi_event: %s arg=%p. VFI not found. <",
6690c9312
< "vfi: %s arg=%p. VFI not found. Terminated.",
---
> "vfi_event: %s arg=%p. VFI not found. <",
6702c9324
< "vfi:%d %s:%s arg=%p",
---
> "vfi_event:%d %s:%s arg=%p",
6719c9341
< uint32_t rval;
---
> uint32_t rval = 0;
6724c9346
< "Invalid state. Terminated.",
---
> "Invalid state. <",
6727d9348
<
6735c9356
< "State not changed. Terminated.",
---
> "State not changed. <",
6746c9367
< "vfi:%d %s-->%s arg=%p",
---
> "vfi_state:%d %s-->%s arg=%p",
6752c9373
< "vfi:%d %s-->%s:%s:%s arg=%p",
---
> "vfi_state:%d %s-->%s:%s:%s arg=%p",
6760c9381
< "vfi:%d %s-->%s:%s:0x%x arg=%p",
---
> "vfi_state:%d %s-->%s:%s:0x%x arg=%p",
6768c9389
< "vfi:%d %s-->%s:%s arg=%p",
---
> "vfi_state:%d %s-->%s:%s arg=%p",
6792c9413
< uint32_t rval;
---
> uint32_t rval = 0;
6797c9418
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
6802d9422
<
6833,6834c9453
< "vfi_vpi_online_evt_action:%d flag=%x vpi_online=%d. "
< "Terminated.",
---
> "vfi_vpi_online_evt_action:%d flag=%x vpi_online=%d. <",
6851c9470
< uint32_t rval;
---
> uint32_t rval = 0;
6857c9476
< if (vfip->vpi_online > 0) {
---
> if (vfip->vpi_online) {
6890c9509
< uint32_t rval;
---
> uint32_t rval = 0;
6896c9515
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
6924c9543
< "vpi_online=%d. Terminated.",
---
> "vpi_online=%d. <",
6931,6933c9550,9551
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
< "vfi_vpi_offline_evt_action:%d flag=%x vpi_online=%d. "
< "Terminated.",
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vfi_vpi_offline_evt_action:%d flag=%x vpi_online=%d. <",
6961,6962c9579,9580
< "vfi_vpi_offline_evt_action:%d flag=%x "\
< "vpi_online=%d. Requesting offline.",
---
> "vfi_vpi_offline_evt_action:%d flag=%x "
> "vpi_online=%d. Requesting offline. <",
6970,6971c9588,9589
< "vfi_vpi_offline_evt_action:%d flag=%x "\
< "vpi_online=%d. Terminated.",
---
> "vfi_vpi_offline_evt_action:%d flag=%x "
> "vpi_online=%d. <",
6997c9615
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
7008c9626
< "Online already requested. Terminated.",
---
> "Online already requested. <",
7015d9632
< vfip->flag |= EMLXS_VFI_ONLINE_REQ;
7018a9636
> vfip->flag |= EMLXS_VFI_ONLINE_REQ;
7029a9648
> vfip->flag |= EMLXS_VFI_ONLINE_REQ;
7043c9662
< vpip = &vport->VPIobj;
---
> vpip = vport->vpip;
7045c9664,9665
< if (!(vport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(vport->flag & EMLXS_PORT_BOUND) ||
> (vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
7054c9674
< "vfi_online_evt_action:%d. Onlining VPI:%d",
---
> "vfi_online_evt_action:%d. Onlining VPI:%d >",
7063a9684
> vfip->flag |= EMLXS_VFI_ONLINE_REQ;
7065c9686
< "vfi_online_evt_action:%d flag=%x. Terminated.",
---
> "vfi_online_evt_action:%d flag=%x. <",
7086c9707
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
7098c9719
< "Offline already requested. Terminated.",
---
> "Offline already requested. <",
7108c9729
< "Already offline. Terminated.",
---
> "Already offline. <",
7138c9759
< "vfi_offline_evt_action:%d flag=%x. Terminated.",
---
> "vfi_offline_evt_action:%d flag=%x. <",
7159c9780
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
7170c9791
< "Pause already requested. Terminated.",
---
> "Pause already requested. <",
7179c9800
< "Offline already requested. Terminated.",
---
> "Offline already requested. <",
7189c9810
< "Already offline. Terminated.",
---
> "Already offline. <",
7197c9818
< "Already paused. Terminated.",
---
> "Already paused. <",
7225c9846
< "vfi_pause_evt_action:%d flag=%x. Terminated.",
---
> "vfi_pause_evt_action:%d flag=%x. <",
7241c9862
< uint32_t rval;
---
> uint32_t rval = 0;
7246c9867
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7256c9877
< "Null fcfp found. Terminated.",
---
> "Null fcfp found. <",
7268c9889
< "vfi_offline_action:%d vfi_online=%d. Terminated.",
---
> "vfi_offline_action:%d vfi_online=%d. <",
7304c9925
< "VFI offline. Notifying FCFI:%d",
---
> "VFI offline. Notifying FCFI:%d >",
7332c9953
< "vfi_init_mbcmpl:%d %s. Terminated.",
---
> "vfi_init_mbcmpl:%d %s.",
7342c9963
< "vfi_init_mbcmpl:%d failed. status=%x",
---
> "vfi_init_mbcmpl:%d failed. %s. >",
7344c9965
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
7354c9975
< "vfi_init_mbcmpl:%d Initialized.",
---
> "vfi_init_mbcmpl:%d. Init complete. >",
7375c9996
< uint32_t rval;
---
> uint32_t rval = 0;
7380c10001
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7409c10030
< "Already init'd. Skipping init.",
---
> "Already init'd. Skipping INIT_VFI.",
7417c10038,10039
< if (vfip->fcfp->vfi_online == 1) {
---
> if (((hba->sli_intf & SLI_INTF_IF_TYPE_MASK) ==
> SLI_INTF_IF_TYPE_0) && (vfip->fcfp->vfi_online == 1)) {
7419,7421c10041,10042
< "vfi_init_action:%d vfi_online=%d. Skipping init.",
< vfip->VFI,
< vfip->fcfp->vfi_online);
---
> "vfi_init_action:%d. First VFI. Skipping INIT_VFI.",
> vfip->VFI);
7429c10050
< "vfi_init_action:%d vfi_online=%d attempts=%d",
---
> "vfi_init_action:%d vfi_online=%d attempts=%d. Sending INIT_VFI. <",
7434c10055
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
7474c10095
< uint32_t rval;
---
> uint32_t rval = 0;
7481c10102
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7486d10106
<
7524c10144
< uint32_t rval;
---
> uint32_t rval = 0;
7529c10149
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7555c10175
< uint32_t rval;
---
> uint32_t rval = 0;
7563c10183
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7579c10199
< if (vfip->logi_count > 0) {
---
> if (vfip->logi_count) {
7588,7589c10208,10209
< if (vfip->vpi_online > 0) {
< /* Waking up out after being paused */
---
> if (vfip->vpi_online) {
> /* Waking up after being paused */
7594c10214
< vpip = &vport->VPIobj;
---
> vpip = vport->vpip;
7596c10216,10217
< if (!(vport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(vport->flag & EMLXS_PORT_BOUND) ||
> (vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
7610c10231
< vpip = &vport->VPIobj;
---
> vpip = vport->vpip;
7612c10233,10234
< if (!(vport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(vport->flag & EMLXS_PORT_BOUND) ||
> (vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
7624c10246
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
7639c10261
< "Onlining VPI:%d",
---
> "Onlining VPI:%d >",
7659c10281,10282
< uint32_t rval;
---
> uint32_t rval = 0;
> VPIobj_t *vpip = (VPIobj_t *)arg1;
7664c10287
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7671,7672c10294
< if (vfip->vpi_online > 1) {
< /* Waking up after pause */
---
> if (vpip == vfip->flogi_vpip) {
7675c10297
< "logi_count=%d. Going online.",
---
> "logi_count=%d. flogi_vpi. Registering.",
7681c10303
< rval = emlxs_vfi_state(port, vfip, VFI_STATE_ONLINE,
---
> rval = emlxs_vfi_state(port, vfip, VFI_STATE_REG,
7683a10306
> /* Waking up after pause */
7686c10309
< "logi_count=%d. Registering.",
---
> "logi_count=%d. Going online.",
7692c10315
< rval = emlxs_vfi_state(port, vfip, VFI_STATE_REG,
---
> rval = emlxs_vfi_state(port, vfip, VFI_STATE_ONLINE,
7711c10334
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7730c10353
< "vfi_vpi_offline_cmpl_action:%d vpi_online=%d. Terminated.",
---
> "vfi_vpi_offline_cmpl_action:%d vpi_online=%d. <",
7747c10370
< uint32_t rval;
---
> uint32_t rval = 0;
7754c10377
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7776c10399
< "VPI already offline. Skipping offline.",
---
> "VPI already offline. Skipping VPI offline.",
7789c10412
< vpip = &vport->VPIobj;
---
> vpip = vport->vpip;
7797c10420
< "vfi_vpi_offline_action:%d. Offlining VPI:%d.",
---
> "vfi_vpi_offline_action:%d. Offlining VPI:%d. >",
7824c10447
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7836c10459
< vpip = &vport->VPIobj;
---
> vpip = vport->vpip;
7844c10467
< "vfi_paused_action:%d vpi_online=%d. Pausing VPI:%d.",
---
> "vfi_paused_action:%d vpi_online=%d. Pausing VPI:%d. >",
7853c10476
< "vfi_paused_action:%d vpi_online=%d. VFI paused.",
---
> "vfi_paused_action:%d vpi_online=%d. VFI paused. <",
7867c10490
< uint32_t rval;
---
> uint32_t rval = 0;
7874c10497
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7879d10501
<
7923c10545
< "vfi_unreg_mbcmpl:%d state=%s. Terminated.",
---
> "vfi_unreg_mbcmpl:%d state=%s.",
7933c10555
< "vfi_unreg_mbcmpl:%d failed. status=%x",
---
> "vfi_unreg_mbcmpl:%d failed. %s. >",
7935c10557
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
7945c10567
< "vfi_unreg_mbcmpl:%d Unregistered.",
---
> "vfi_unreg_mbcmpl:%d. Unreg complete. >",
7966c10588
< uint32_t rval;
---
> uint32_t rval = 0;
7971c10593
< "Invalid state. Terminated.",
---
> "Invalid state. <",
7975d10596
<
7981c10602
< "vfi_unreg_action:%d. Not registered. Skipping unreg.",
---
> "vfi_unreg_action:%d. Not registered. Skipping UNREG_VFI.",
7994c10615
< "vfi_unreg_action:%d attempts=%d. Sending UNREG_VFI.",
---
> "vfi_unreg_action:%d attempts=%d. Sending UNREG_VFI. <",
7998c10619
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
8036c10657
< uint32_t rval;
---
> uint32_t rval = 0;
8041c10662
< "Invalid state. Terminated.",
---
> "Invalid state. <",
8066c10687
< uint32_t rval;
---
> uint32_t rval = 0;
8073c10694
< "Invalid state. Terminated.",
---
> "Invalid state. <",
8078d10698
<
8090,8091d10709
< vfip->flag &= ~(EMLXS_VFI_REG | EMLXS_VFI_INIT);
<
8117a10736
> MATCHMAP *mp;
8126c10745
< "vfi_reg_mbcmpl:%d state=%s. Terminated.",
---
> "vfi_reg_mbcmpl:%d state=%s.",
8136c10755
< "vfi_reg_mbcmpl:%d failed. status=%x",
---
> "vfi_reg_mbcmpl:%d failed. %s. >",
8138c10757
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
8147,8149c10766,10769
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "vfi_reg_mbcmpl:%d Registered.",
< vfip->VFI);
---
> /* Archive a copy of the sparams in case we need them later */
> mp = (MATCHMAP *)mbq->bp;
> bcopy((uint32_t *)mp->virt, (uint32_t *)&vfip->sparam,
> sizeof (SERV_PARM));
8151,8152c10771,10775
< if (vfip->vpi_online == 1) {
< port->VPIobj.flag |= EMLXS_VPI_REG;
---
> if (vfip->flogi_vpip) {
> if (mb4->un.varRegVFI4.vp == 1) {
> vfip->flogi_vpip->flag |= EMLXS_VPI_REG;
> }
> vfip->flogi_vpip = NULL;
8156a10780,10783
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vfi_reg_mbcmpl:%d. Reg complete. >",
> vfip->VFI);
>
8171d10797
< FCFIobj_t *fcfp;
8175c10801
< uint32_t rval;
---
> uint32_t rval = 0;
8177a10804,10805
> SERV_PARM *flogi_sparam;
> uint32_t *wwpn;
8182c10810
< "Invalid state. Terminated.",
---
> "Invalid state. <",
8186d10813
<
8204c10831
< if (vfip->flag & EMLXS_VFI_REG) {
---
> if (!vfip->flogi_vpip) {
8205a10833,10846
> "vfi_reg_action:%d %attempts=%d. No flogi_vpi found.",
> vfip->VFI,
> vfip->attempts);
>
> vfip->flag &= ~EMLXS_VFI_REQ_MASK;
> vfip->flag |= EMLXS_VFI_OFFLINE_REQ;
>
> rval = emlxs_vfi_offline_handler(port, vfip, arg1);
> return (rval);
> }
>
> if ((hba->model_info.chip & EMLXS_BE_CHIPS) &&
> (vfip->flag & EMLXS_VFI_REG)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
8207c10848
< "Already registered. Skipping reg.",
---
> "Already registered. Skipping REG_VFI update.",
8215,8216c10856,10860
< if (vfip->fcf_sparam.cmn.edtovResolution) {
< edtov = (LE_SWAP32(vfip->fcf_sparam.cmn.e_d_tov) + 999999) /
---
> /* Get the flogi_vpip's fabric_rpip's service parameters */
> flogi_sparam = &vfip->flogi_vpip->fabric_rpip->sparam;
>
> if (flogi_sparam->cmn.edtovResolution) {
> edtov = (LE_SWAP32(flogi_sparam->cmn.e_d_tov) + 999999) /
8219c10863
< edtov = LE_SWAP32(vfip->fcf_sparam.cmn.e_d_tov);
---
> edtov = LE_SWAP32(flogi_sparam->cmn.e_d_tov);
8222c10866
< ratov = (LE_SWAP32(vfip->fcf_sparam.cmn.w2.r_a_tov) + 999) / 1000;
---
> ratov = (LE_SWAP32(flogi_sparam->cmn.w2.r_a_tov) + 999) / 1000;
8224,8229c10868,10882
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "vfi_reg_action:%d attempts=%d edtov=%d ratov=%d. "
< "Sending REG_VFI.",
< vfip->VFI,
< vfip->attempts,
< edtov, ratov);
---
> if (vfip->flag & EMLXS_VFI_REG) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vfi_reg_action:%d attempts=%d edtov=%d ratov=%d. "
> "Updating REG_VFI. <",
> vfip->VFI,
> vfip->attempts,
> edtov, ratov);
> } else {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vfi_reg_action:%d attempts=%d edtov=%d ratov=%d. "
> "Sending REG_VFI. <",
> vfip->VFI,
> vfip->attempts,
> edtov, ratov);
> }
8231,8233c10884
< fcfp = vfip->fcfp;
<
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
8242c10893
< if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF, 1)) == 0) {
---
> if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF)) == 0) {
8259a10911
>
8260a10913
> mb4->un.varRegVFI4.upd = (vfip->flag & EMLXS_VFI_REG)? 1:0;
8262c10915,10917
< if (vfip->fcfp->vfi_online == 1) {
---
> /* If the flogi_vpip was not previously registered, */
> /* perform the REG_VPI now */
> if (!(vfip->flogi_vpip->flag & EMLXS_VPI_REG)) {
8264c10919
< mb4->un.varRegVFI4.vpi = port->VPIobj.VPI;
---
> mb4->un.varRegVFI4.vpi = vfip->flogi_vpip->VPI;
8267c10922,10926
< mb4->un.varRegVFI4.fcfi = fcfp->FCFI;
---
> mb4->un.varRegVFI4.fcfi = vfip->fcfp->FCFI;
> wwpn = (uint32_t *)&port->wwpn;
> mb4->un.varRegVFI4.portname[0] = BE_SWAP32(*wwpn);
> wwpn++;
> mb4->un.varRegVFI4.portname[1] = BE_SWAP32(*wwpn);
8270,8271d10928
<
< /* Convert to seconds */
8276,8277c10933,10934
< bcopy((uint32_t *)&vfip->fcf_sparam,
< (uint32_t *)mp->virt, sizeof (SERV_PARM));
---
> bcopy((uint32_t *)flogi_sparam, (uint32_t *)mp->virt,
> sizeof (SERV_PARM));
8300c10957
< uint32_t rval;
---
> uint32_t rval = 0;
8305c10962
< "Invalid state. Terminated.",
---
> "Invalid state. <",
8342,8343c10999,11000
< uint32_t rval;
< VPIobj_t *vpip;
---
> uint32_t rval = 0;
> VPIobj_t *vpip = port->vpip;
8349c11006
< "Invalid state. Terminated.",
---
> "Invalid state. <",
8368c11025,11028
< vpip = &port->VPIobj;
---
> /* Take the port's Fabric RPI online now */
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vfi_online_action:%d. Onlining Fabric RPI. >",
> vfip->VFI);
8370,8374c11030,11032
< /* Take Fabric RPI online now */
< if (vpip->rpip->state != RPI_STATE_ONLINE) {
< /* This will complete the FLOGI/FDISC back to Leadville */
< (void) emlxs_rpi_event(port, FCF_EVENT_RPI_ONLINE, vpip->rpip);
< }
---
> /* This will complete the FLOGI/FDISC back to Leadville */
> (void) emlxs_rpi_event(port, FCF_EVENT_RPI_ONLINE,
> vpip->fabric_rpip);
8383c11041
< vpip = &vport->VPIobj;
---
> vpip = vport->vpip;
8385c11043,11044
< if (!(vport->flag & EMLXS_PORT_BOUND)) {
---
> if (!(vport->flag & EMLXS_PORT_BOUND) ||
> (vpip->flag & EMLXS_VPI_PORT_UNBIND)) {
8396c11055
< "Onlining VPI:%d",
---
> "Onlining VPI:%d >",
8408c11067
< "VFI online. Notifying FCFI:%d.",
---
> "VFI online. Notifying FCFI:%d. >",
8440c11099
< (void) sprintf(buffer, "state=0x%x", state);
---
> (void) snprintf(buffer, sizeof (buffer), "state=0x%x", state);
8450c11109
< uint32_t rval;
---
> uint32_t rval = 0;
8492c11151
< "vpi:%d %s:%s arg=%p. No action. Terminated.",
---
> "vpi_action:%d %s:%s arg=%p. No action. <",
8513c11172
< uint32_t rval;
---
> uint32_t rval = 0;
8524c11183
< "rpi: %s arg=%p. Null RPI found. Terminated.",
---
> "vpi_event: %s arg=%p. Null RPI found. <",
8540c11199
< "vpi: %s arg=%p. Null VPI found. Terminated.",
---
> "vpi_event: %s arg=%p. Null VPI found. <",
8553c11212
< "vpi:%d %s:%s arg=%p",
---
> "vpi_event:%d %s:%s arg=%p",
8580c11239
< "State not changed. Terminated.",
---
> "State not changed. <",
8585d11243
<
8591c11249
< "vpi:%d %s-->%s arg=%p",
---
> "vpi_state:%d %s-->%s arg=%p",
8597c11255
< "vpi:%d %s-->%s:%s:%s arg=%p",
---
> "vpi_state:%d %s-->%s:%s:%s arg=%p",
8605c11263
< "vpi:%d %s-->%s:%s:0x%x arg=%p",
---
> "vpi_state:%d %s-->%s:%s:0x%x arg=%p",
8613c11271
< "vpi:%d %s-->%s:%s arg=%p",
---
> "vpi_state:%d %s-->%s:%s arg=%p",
8636c11294
< VPIobj_t *vpip = &port->VPIobj;
---
> VPIobj_t *vpip = port->vpip;
8641c11299
< uint32_t i;
---
> uint32_t i = 0;
8651a11310,11318
>
> /* Wait for VPI to go online */
> while ((vpip->state != VPI_STATE_PORT_ONLINE) &&
> (hba->state != FC_ERROR)) {
> delay(drv_usectohz(500000));
> if (i++ > 30) {
> break;
> }
> }
8680c11347
< "No FCF available yet. Terminated.",
---
> "No FCF available yet.",
8701c11368
< "No VFI available yet. Terminated.",
---
> "No VFI available yet.",
8714c11381
< "vpi_port_bind_notify:%d %s fcfi:%d vfi:%d. Onlining VPI:%d",
---
> "vpi_port_bind_notify:%d %s fcfi:%d vfi:%d. Onlining VPI:%d >",
8734c11401
< VPIobj_t *vpip = &port->VPIobj;
---
> VPIobj_t *vpip = port->vpip;
8743a11411,11414
> if (!(hba->sli.sli4.flag & EMLXS_SLI4_FCF_INIT)) {
> return (0);
> }
>
8750a11422,11427
> /*
> * Set flag to indicate that emlxs_vpi_port_unbind_notify
> * has been called
> */
> vpip->flag |= EMLXS_VPI_PORT_UNBIND;
>
8756c11433
< "Offlining VPI:%d,%d",
---
> "Offlining VPI:%d,%d >",
8774c11451
< DELAYMS(1000);
---
> BUSYWAIT_MS(1000);
8789a11467,11468
> vpip->flag &= ~EMLXS_VPI_PORT_UNBIND;
>
8802c11481
< uint32_t rval;
---
> uint32_t rval = 0;
8808c11487
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
8821c11500
< "rpi=%d. Waiting for LOGO. Terminated.",
---
> "rpi=%d. Waiting for LOGO. <",
8844c11523
< "rpi=%d. VPI paused. Terminated.",
---
> "rpi=%d. VPI paused. <",
8855c11534
< "rpi=%d. Terminated.",
---
> "rpi=%d. <",
8867c11546
< "Invalid state. Terminated.",
---
> "Invalid state. <",
8886c11565
< uint32_t rval;
---
> uint32_t rval = 0;
8892c11571
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
8905c11584
< "rpi=%d. Waiting for LOGO. Terminated.",
---
> "rpi=%d. Waiting for LOGO. <",
8928c11607
< "rpi=%d. VPI already paused. Terminated.",
---
> "rpi=%d. VPI already paused. <",
8940c11619
< "Invalid state. Terminated.",
---
> "Invalid state. <",
8964c11643
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
8973,8974c11652
< "vpi_rpi_online_evt_action:%d rpi_online=%d,%d did=%x rpi=%d. "
< "Terminated.",
---
> "vpi_rpi_online_evt_action:%d rpi_online=%d,%d did=%x rpi=%d. <",
8989c11667
< uint32_t rval;
---
> uint32_t rval = 0;
8994c11672
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
9005c11683
< "Online already requested. Terminated.",
---
> "Online already requested. <",
9038c11716
< "vpi_online_evt_action:%d flag=%x. Terminated.",
---
> "vpi_online_evt_action:%d flag=%x. <",
9053c11731
< uint32_t rval;
---
> uint32_t rval = 0;
9090c11768
< uint32_t rval;
---
> uint32_t rval = 0;
9096c11774
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
9108c11786
< "Offline already requested. Terminated.",
---
> "Offline already requested. <",
9189c11867
< "vpi_offline_evt_action:%d flag=%x. Terminated.",
---
> "vpi_offline_evt_action:%d flag=%x. <",
9206c11884
< uint32_t rval;
---
> uint32_t rval = 0;
9211c11889
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
9222c11900
< "Pause already requested. Terminated.",
---
> "Pause already requested. <",
9231c11909
< "Offline already requested. Terminated.",
---
> "Offline already requested. <",
9237c11915
< if (!(hba->sli.sli4.flag & EMLXS_SLI4_DOWN_LINK)) {
---
> if (SLI4_FC_MODE || !(hba->sli.sli4.flag & EMLXS_SLI4_DOWN_LINK)) {
9239,9246c11917
< vpip->flag &= ~EMLXS_VPI_LOGI;
< if (vpip->flag & EMLXS_VPI_VFI_LOGI) {
< vpip->flag &= ~EMLXS_VPI_VFI_LOGI;
<
< if (vpip->vfip->logi_count > 0) {
< vpip->vfip->logi_count--;
< }
< }
---
> emlxs_vpi_logo_handler(port, vpip);
9253c11924
< "Already offline. Terminated.",
---
> "Already offline. <",
9261c11932
< "Already paused. Terminated.",
---
> "Already paused. <",
9291c11962
< "vpi_pause_evt_action:%d flag=%x. Terminated.",
---
> "vpi_pause_evt_action:%d flag=%x. <",
9304c11975
< emlxs_pkt_cmpl_thread(emlxs_hba_t *hba,
---
> emlxs_deferred_cmpl_thread(emlxs_hba_t *hba,
9307,9308c11978,11984
< emlxs_buf_t *sbp = (emlxs_buf_t *)arg1;
< emlxs_pkt_complete(sbp, -1, 0, 1);
---
> emlxs_deferred_cmpl_t *cmpl = (emlxs_deferred_cmpl_t *)arg1;
> uint32_t status = (uint32_t)((unsigned long)arg2);
> emlxs_port_t *port;
> uint32_t mbxStatus;
> emlxs_buf_t *sbp;
> fc_unsol_buf_t *ubp;
> IOCBQ *iocbq;
9309a11986,11996
> mbxStatus = (status)? MBX_FAILURE:MBX_SUCCESS;
>
> port = cmpl->port;
> sbp = (emlxs_buf_t *)cmpl->arg1;
> ubp = (fc_unsol_buf_t *)cmpl->arg2;
> iocbq = (IOCBQ *)cmpl->arg3;
>
> kmem_free(cmpl, sizeof (emlxs_deferred_cmpl_t));
>
> emlxs_mb_deferred_cmpl(port, mbxStatus, sbp, ubp, iocbq);
>
9312c11999
< } /* emlxs_pkt_cmpl_thread() */
---
> } /* emlxs_deferred_cmpl_thread() */
9314a12002,12003
>
>
9321c12010
< uint32_t scope = (uint32_t)((uintptr_t)arg2);
---
> uint32_t scope = (uint32_t)((unsigned long)arg2);
9342a12032,12050
> static void
> emlxs_vpi_logo_handler(emlxs_port_t *port, VPIobj_t *vpip)
> {
> vpip->flag &= ~EMLXS_VPI_LOGI;
> if (vpip->flag & EMLXS_VPI_VFI_LOGI) {
> vpip->flag &= ~EMLXS_VPI_VFI_LOGI;
>
> if (vpip->vfip->logi_count) {
> vpip->vfip->logi_count--;
> }
> if (vpip == vpip->vfip->flogi_vpip) {
> vpip->vfip->flogi_vpip = NULL;
> }
> }
>
> } /* emlxs_vpi_logo_handler() */
>
>
> /*ARGSUSED*/
9354c12062
< "Invalid state. Terminated.",
---
> "Invalid state. <",
9363c12071
< "vpi_port_offline_action:%d flag=%x. Offline port.",
---
> "vpi_port_offline_action:%d flag=%x. Offlining port...",
9377c12085
< (void *)vpip->port, (void *)((uintptr_t)scope));
---
> (void *)vpip->port, (void *)((unsigned long)scope));
9391c12099
< "Pausing. Waiting for RPI's.",
---
> "Pausing. Waiting for RPI's. <",
9398c12106,12111
< if (vpip->rpip->state != RPI_STATE_FREE) {
---
> if (vpip->fabric_rpip->state != RPI_STATE_FREE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_port_offline_action:%d. "
> "Offlining Fabric RPI. >",
> vpip->VPI);
>
9400c12113
< vpip->rpip);
---
> vpip->fabric_rpip);
9417c12130
< "Waiting for RPI's.",
---
> "Waiting for RPI's. <",
9425,9426c12138,12144
< if (vpip->rpip->state != RPI_STATE_FREE) {
< (void) emlxs_rpi_event(port, FCF_EVENT_RPI_OFFLINE, vpip->rpip);
---
> if (vpip->fabric_rpip->state != RPI_STATE_FREE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_port_offline_action:%d. Offlining Fabric RPI. >",
> vpip->VPI);
>
> (void) emlxs_rpi_event(port, FCF_EVENT_RPI_OFFLINE,
> vpip->fabric_rpip);
9451c12169
< "Invalid state. Terminated.",
---
> "Invalid state. <",
9461c12179
< "vpi_paused_action:%d rpi_online=%d,%d. VPI paused.",
---
> "vpi_paused_action:%d rpi_online=%d,%d. VPI paused. <",
9475c12193
< uint32_t rval;
---
> uint32_t rval = 0;
9480c12198
< "Invalid state. Terminated.",
---
> "Invalid state. <",
9490c12208
< "Null vfip found. Terminated.",
---
> "Null vfip found. <",
9499,9500c12217,12223
< if (vpip->rpip->state != RPI_STATE_FREE) {
< (void) emlxs_rpi_event(port, FCF_EVENT_RPI_OFFLINE, vpip->rpip);
---
> if (vpip->fabric_rpip->state != RPI_STATE_FREE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_offline_action:%d. Offlining Fabric RPI. >",
> vpip->VPI);
>
> (void) emlxs_rpi_event(port, FCF_EVENT_RPI_OFFLINE,
> vpip->fabric_rpip);
9527c12250
< "VPI offline. Notifying VFI:%d.",
---
> "VPI offline. Notifying VFI:%d. >",
9555c12278
< "vpi_init_mbcmpl:%d %s. Terminated.",
---
> "vpi_init_mbcmpl:%d %s.",
9565c12288
< "vpi_init_mbcmpl:%d failed. status=%x",
---
> "vpi_init_mbcmpl:%d failed. %s. >",
9567c12290
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
9577c12300
< "vpi_init_mbcmpl:%d Initialized.",
---
> "vpi_init_mbcmpl:%d. Init complete. >",
9599c12322
< uint32_t rval;
---
> uint32_t rval = 0;
9604c12327
< "Invalid state. Terminated.",
---
> "Invalid state. <",
9630c12353,12354
< if (vpip->vfip->vpi_online == 1) {
---
> if (((hba->sli_intf & SLI_INTF_IF_TYPE_MASK) ==
> SLI_INTF_IF_TYPE_0) && (vpip->vfip->vpi_online == 1)) {
9632,9634c12356,12357
< "vpi_init_action:%d vpi_online=%d. Skipping init.",
< vpip->VPI,
< vpip->vfip->vpi_online);
---
> "vpi_init_action:%d. First VPI. Skipping INIT_VPI.",
> vpip->VPI);
9644c12367
< "Already init'd. Skipping init.",
---
> "Already init'd. Skipping INIT_VPI.",
9653c12376
< "vpi_init_action:%d vpi_online=%d attempts=%d. Sending INIT_VPI.",
---
> "vpi_init_action:%d vpi_online=%d attempts=%d. Sending INIT_VPI. <",
9658c12381
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
9696c12419
< uint32_t rval;
---
> uint32_t rval = 0;
9703c12426
< "Invalid state. Terminated.",
---
> "Invalid state. <",
9708d12430
<
9746c12468
< uint32_t rval;
---
> uint32_t rval = 0;
9751c12473
< "Invalid state. Terminated.",
---
> "Invalid state. <",
9776c12498,12499
< uint32_t rval;
---
> emlxs_config_t *cfg = &CFG;
> uint32_t rval = 0;
9781c12504
< "Invalid state. Terminated.",
---
> "Invalid state. <",
9804,9805c12527,12528
< if (vpip->rpip->state == RPI_STATE_FREE) {
< (void) emlxs_rpi_alloc(port, FABRIC_DID);
---
> if (vpip->fabric_rpip->state == RPI_STATE_FREE) {
> emlxs_rpi_alloc_fabric_rpi(vpip->port);
9807a12531,12563
> /* Notify ULP */
> vpip->flag |= EMLXS_VPI_PORT_ONLINE;
>
> if (hba->flag & FC_LOOPBACK_MODE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_port_online_action:%d. Loopback mode. "
> "Registering VPI.",
> vpip->VPI);
>
> if (hba->topology != TOPOLOGY_LOOP) {
> port->did = 1;
> }
>
> vpip->vfip->flogi_vpip = vpip;
>
> bcopy((void *)&vpip->port->sparam,
> (void *)&vpip->fabric_rpip->sparam,
> sizeof (SERV_PARM));
>
> /* Update the VPI Fabric RPI */
> vpip->fabric_rpip->sparam.cmn.w2.r_a_tov =
> LE_SWAP32((FF_DEF_RATOV * 1000));
>
> rval = emlxs_vpi_state(port, vpip, VPI_STATE_REG,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
> }
>
> if ((hba->topology == TOPOLOGY_LOOP) && ! (port->did)) {
> port->did = port->granted_alpa;
> }
>
9809c12565
< "vpi_port_online_action:%d vpi_online=%d. Onlining port.",
---
> "vpi_port_online_action:%d vpi_online=%d. Onlining port... <",
9813,9814c12569,12577
< /* Notify ULP */
< vpip->flag |= EMLXS_VPI_PORT_ONLINE;
---
> if (SLI4_FC_MODE && (port->vpi == 0)) {
> mutex_enter(&EMLXS_PORT_LOCK);
> hba->linkup_timer = hba->timer_tics +
> cfg[CFG_LINKUP_TIMEOUT].current;
> mutex_exit(&EMLXS_PORT_LOCK);
> } else {
> emlxs_thread_spawn(hba, emlxs_port_online_thread,
> (void *)vpip->port, 0);
> }
9816,9818d12578
< emlxs_thread_spawn(hba, emlxs_port_online_thread,
< (void *)vpip->port, 0);
<
9829c12589
< VPIobj_t *vpip = &port->VPIobj;
---
> VPIobj_t *vpip = port->vpip;
9831c12591
< uint32_t rval;
---
> uint32_t rval = 0;
9841c12601
< "port_logi_notify:%d %s. Terminated.",
---
> "vpi_logi_notify:%d %s.",
9852,9853c12612,12613
< "port_logi_notify:%d %s. "
< "Invalid state. Terminated.",
---
> "vpi_logi_notify:%d %s. "
> "Invalid state.",
9861a12622,12627
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_notify:%d %s. "
> "Logging in. >",
> vpip->VPI,
> emlxs_vpi_state_xlate(vpip->state));
>
9867c12633
< "port_logi_notify:%d %s rval=%d.",
---
> "vpi_logi_notify:%d %s rval=%d.",
9880,9881c12646,12647
< extern uint32_t
< emlxs_vpi_logi_cmpl_notify(emlxs_port_t *port, emlxs_buf_t *sbp)
---
> static uint32_t
> emlxs_vpi_logi_cmpl_notify(emlxs_port_t *port, RPIobj_t *rpip)
9883d12648
< VPIobj_t *vpip = &port->VPIobj;
9885c12650,12651
< uint32_t rval;
---
> VPIobj_t *vpip = port->vpip;
> uint32_t rval = 0;
9887,9891c12653
< if (hba->sli_mode < EMLXS_HBA_SLI4_MODE) {
< emlxs_pkt_complete(sbp, IOSTAT_LOCAL_REJECT,
< IOERR_NO_RESOURCES, 1);
< return (1);
< }
---
> /* EMLXS_FCF_LOCK must be held when calling this routine */
9893,9894d12654
< mutex_enter(&EMLXS_FCF_LOCK);
<
9897,9898c12657,12658
< "port_logi_cmpl_notify:%d %s. "
< "Invalid state. Terminated.",
---
> "vpi_logi_cmpl_notify:%d %s. "
> "Invalid state.",
9901,9902d12660
<
< mutex_exit(&EMLXS_FCF_LOCK);
9906,9907c12664,12670
< rval = emlxs_vpi_state(port, vpip, VPI_STATE_LOGI_CMPL,
< 0, 0, sbp);
---
> if (rpip->RPI == FABRIC_RPI) {
> if (hba->flag & FC_PT_TO_PT) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_cmpl_notify:%d %s. P2P mode. "
> "Completing FLOGI.",
> vpip->VPI,
> emlxs_vpi_state_xlate(vpip->state));
9909c12672,12687
< if (rval) {
---
> /* Complete the FLOGI/FDISC now */
> if (rpip->cmpl) {
> emlxs_rpi_deferred_cmpl(port, rpip, 0);
> }
>
> /* Wait for P2P PLOGI completion to continue */
> return (0);
> }
>
> if (!rpip->cmpl || !rpip->cmpl->arg1) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
> "vpi_logi_cmpl_notify:%d. Null sbp.",
> vpip->VPI);
> return (1);
> }
>
9911c12689,12690
< "port_logi_cmpl_notify:%d %s rval=%d.",
---
> "vpi_logi_cmpl_notify:%d %s. Fabric mode. "
> "Completing login. >",
9913,9914c12692,12705
< emlxs_vpi_state_xlate(vpip->state),
< rval);
---
> emlxs_vpi_state_xlate(vpip->state));
>
> rval = emlxs_vpi_state(port, vpip, VPI_STATE_LOGI_CMPL,
> 0, 0, 0);
>
> if (rval) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_cmpl_notify:%d %s rval=%d.",
> vpip->VPI,
> emlxs_vpi_state_xlate(vpip->state),
> rval);
> }
>
> return (rval);
9917c12708,12714
< mutex_exit(&EMLXS_FCF_LOCK);
---
> if (hba->flag & FC_PT_TO_PT) {
> if (port->did == 0) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_cmpl_notify:%d %s did=0. P2P mode. "
> "Wait for PLOGI compl.",
> vpip->VPI,
> emlxs_vpi_state_xlate(vpip->state));
9919c12716,12718
< return (rval);
---
> if (rpip->cmpl) {
> emlxs_rpi_deferred_cmpl(port, rpip, 0);
> }
9920a12720,12747
> /* Wait for P2P PLOGI completion to continue */
> return (0);
> }
>
> vpip->p2p_rpip = rpip;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_cmpl_notify:%d %s. P2P mode. "
> "Completing login. >",
> vpip->VPI,
> emlxs_vpi_state_xlate(vpip->state));
>
> rval = emlxs_vpi_state(port, vpip, VPI_STATE_LOGI_CMPL,
> 0, 0, 0);
>
> if (rval) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_cmpl_notify:%d %s rval=%d.",
> vpip->VPI,
> emlxs_vpi_state_xlate(vpip->state),
> rval);
> }
>
> return (rval);
> }
>
> return (1);
>
9925c12752
< emlxs_vpi_logi_failed_notify(emlxs_port_t *port)
---
> emlxs_vpi_logi_failed_notify(emlxs_port_t *port, emlxs_buf_t *sbp)
9928,9929c12755,12758
< VPIobj_t *vpip = &port->VPIobj;
< uint32_t rval;
---
> VPIobj_t *vpip = port->vpip;
> RPIobj_t *rpip = vpip->fabric_rpip;
> uint32_t rval = 0;
> emlxs_deferred_cmpl_t *cmpl;
9938,9940c12767,12769
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
< "port_logi_failed_notify:%d %s. "
< "Invalid state. Terminated.",
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_failed_notify:%d %s. "
> "Invalid state.",
9943a12773,12775
> /* Fabric logo is implied */
> emlxs_vpi_logo_handler(port, vpip);
>
9948a12781,12803
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_failed_notify:%d %s. "
> "Failing login. >",
> vpip->VPI,
> emlxs_vpi_state_xlate(vpip->state));
>
> /* For safety */
> if (rpip->cmpl) {
> emlxs_rpi_deferred_cmpl(port, rpip, 1);
> }
>
> if (sbp) {
> cmpl = (emlxs_deferred_cmpl_t *)kmem_zalloc(
> sizeof (emlxs_deferred_cmpl_t), KM_SLEEP);
>
> cmpl->port = port;
> cmpl->arg1 = (void *)sbp;
> cmpl->arg2 = 0;
> cmpl->arg3 = 0;
>
> rpip->cmpl = cmpl;
> }
>
9952,9957c12807,12809
< if (rval) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "port_logi_failed_notify:%d %s rval=%d.",
< vpip->VPI,
< emlxs_vpi_state_xlate(vpip->state),
< rval);
---
> if (rval && rpip->cmpl) {
> kmem_free(rpip->cmpl, sizeof (emlxs_deferred_cmpl_t));
> rpip->cmpl = 0;
9961d12812
<
9966a12818,12863
> extern uint32_t
> emlxs_vpi_logo_cmpl_notify(emlxs_port_t *port)
> {
> emlxs_hba_t *hba = HBA;
> VPIobj_t *vpip = port->vpip;
> uint32_t rval = 0;
> VFIobj_t *vfip;
> FCFIobj_t *fcfp;
>
> if (hba->sli_mode < EMLXS_HBA_SLI4_MODE) {
> return (1);
> }
>
> mutex_enter(&EMLXS_FCF_LOCK);
>
> /* Fabric logo is complete */
> emlxs_vpi_logo_handler(port, vpip);
>
> if ((vpip->state == VPI_STATE_OFFLINE) ||
> (vpip->flag & EMLXS_VPI_OFFLINE_REQ)) {
> /* Already offline. Do nothing */
> mutex_exit(&EMLXS_FCF_LOCK);
> return (0);
> }
>
> vfip = vpip->vfip;
> fcfp = vfip->fcfp;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logo_cmpl_notify:%d %s fcfi:%d vfi:%d. "
> "Offlining VPI:%d,%d >",
> vpip->VPI,
> emlxs_vpi_state_xlate(vpip->state),
> fcfp->fcf_index,
> vfip->VFI,
> vpip->index, vpip->VPI);
>
> rval = emlxs_vpi_event(port, FCF_EVENT_VPI_OFFLINE, vpip);
>
> mutex_exit(&EMLXS_FCF_LOCK);
>
> return (rval);
>
> } /* emlxs_vpi_logo_cmpl_notify() */
>
>
9971a12869
> emlxs_hba_t *hba = HBA;
9974c12872
< uint32_t rval;
---
> uint32_t rval = 0;
9979c12877
< "Invalid state. Terminated.",
---
> "Invalid state. <",
9998c12896
< vpip->VPI);
---
> vpip->VPI, vpip->flag);
10000,10002c12898,12900
< vpip->flag &= ~EMLXS_VPI_LOGI;
< if (vpip->flag & EMLXS_VPI_VFI_LOGI) {
< vpip->flag &= ~EMLXS_VPI_VFI_LOGI;
---
> /* Fabric logo is implied */
> emlxs_vpi_logo_handler(port, vpip);
> }
10004,10006c12902,12915
< if (vpip->vfip->logi_count > 0) {
< vpip->vfip->logi_count--;
< }
---
> /* Check if FC_PT_TO_PT is set */
> if (hba->flag & FC_PT_TO_PT) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_action:%d logi_count=%d. FLOGI set. P2P. <",
> vpip->VPI,
> vpip->vfip->logi_count);
>
> *((uint32_t *)pkt->pkt_cmd) = (uint32_t)ELS_CMD_FLOGI;
>
> vpip->vfip->flogi_vpip = vpip;
>
> if (vpip->vfip->logi_count == 0) {
> vpip->vfip->logi_count++;
> vpip->flag |= EMLXS_VPI_VFI_LOGI;
10007a12917,12918
>
> return (0);
10013c12924
< "vpi_logi_action:%d logi_count=%d. FLOGI set.",
---
> "vpi_logi_action:%d logi_count=%d. FLOGI set. <",
10017a12929,12930
>
> vpip->vfip->flogi_vpip = vpip;
10020c12933
< "vpi_logi_action:%d logi_count=%d. FDISC set.",
---
> "vpi_logi_action:%d logi_count=%d. FDISC set. <",
10040c12953,12954
< uint32_t rval;
---
> emlxs_hba_t *hba = HBA;
> uint32_t rval = 0;
10045c12959
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10052,10054c12966,12967
< vpip->flag &= ~EMLXS_VPI_LOGI;
< if (vpip->flag & EMLXS_VPI_VFI_LOGI) {
< vpip->flag &= ~EMLXS_VPI_VFI_LOGI;
---
> /* Fabric logo is implied */
> emlxs_vpi_logo_handler(port, vpip);
10056,10058c12969,12989
< if (vpip->vfip->logi_count > 0) {
< vpip->vfip->logi_count--;
< }
---
> if (hba->topology == TOPOLOGY_LOOP) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logi_failed_action:%d. Private loop. "
> "Registering VPI.",
> vpip->VPI);
>
> /* Update the VPI flogi_vpip pointer for loop */
> /* because the vpi_logo_handler cleared it */
> vpip->vfip->flogi_vpip = vpip;
>
> bcopy((void *)&vpip->port->sparam,
> (void *)&vpip->fabric_rpip->sparam,
> sizeof (SERV_PARM));
>
> /* Update the VPI Fabric RPI */
> vpip->fabric_rpip->sparam.cmn.w2.r_a_tov =
> LE_SWAP32((FF_DEF_RATOV * 1000));
>
> rval = emlxs_vpi_state(port, vpip, VPI_STATE_REG,
> FCF_REASON_EVENT, evt, arg1);
> return (rval);
10074,10106d13004
< static void
< emlxs_vpi_flogi_cmpl(emlxs_port_t *port, VPIobj_t *vpip, uint32_t status)
< {
< emlxs_hba_t *hba = HBA;
< emlxs_buf_t *sbp;
<
< sbp = vpip->flogi_sbp;
< if (!sbp) {
< return;
< }
< vpip->flogi_sbp = NULL;
<
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "vpi_flogi_cmpl:%d. status=%x",
< vpip->VPI,
< status);
<
< sbp->pkt_flags &= ~PACKET_STATE_VALID;
<
< if (status) {
< emlxs_set_pkt_state(sbp, IOSTAT_LOCAL_REJECT,
< IOERR_NO_RESOURCES, 1);
< } else {
< emlxs_set_pkt_state(sbp, IOSTAT_SUCCESS, 0, 1);
< }
<
< emlxs_thread_spawn(hba, emlxs_pkt_cmpl_thread, (void *)sbp, 0);
<
< return;
<
< } /* emlxs_vpi_flogi_cmpl() */
<
<
10112,10115c13010,13011
< uint32_t rval;
< SERV_PARM *sp;
< fc_packet_t *pkt;
< emlxs_buf_t *sbp;
---
> emlxs_hba_t *hba = HBA;
> uint32_t rval = 0;
10117a13014
> uint32_t new_config = 0;
10122c13019
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10131,10137c13028,13040
< sbp = (emlxs_buf_t *)arg1;
< if (!sbp) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
< "vpi_logi_cmpl_action:%d. Null sbp. Terminated.",
< vpip->VPI);
< return (1);
< }
---
> /* Check for new fabric */
> if (port->prev_did) {
> if (SLI4_FCOE_MODE) {
> /* Check for FCF change */
> if (((port->prev_did != port->did) ||
> bcmp(&port->prev_fabric_sparam.portName,
> &port->fabric_sparam.portName, 8)) &&
> emlxs_nport_count(port)) {
> new_config = 1;
> }
> } else {
> uint32_t old_topo;
> uint32_t new_topo;
10139,10141c13042,13044
< /* Check login parameters */
< pkt = PRIV2PKT(sbp);
< sp = (SERV_PARM *)((caddr_t)pkt->pkt_resp + sizeof (uint32_t));
---
> /* Check for topology change (0=loop 1=fabric) */
> old_topo = ((port->prev_did && 0xFFFF00) == 0)? 0:1;
> new_topo = ((port->did && 0xFFFF00) == 0)? 0:1;
10143,10147c13046,13047
< /* For safety */
< if (vpip->flogi_sbp) {
< emlxs_vpi_flogi_cmpl(port, vpip, 1);
< }
< vpip->flogi_sbp = sbp;
---
> if (old_topo != new_topo) {
> new_config = 1;
10149,10154c13049,13055
< /* Update the Fabric RPI */
< bcopy((void *)sp, (void *)&vpip->rpip->sparam, sizeof (SERV_PARM));
<
< if (vpip->vfip->vpi_online == 1) {
< bcopy((void *)sp, (void *)&vpip->vfip->fcf_sparam,
< sizeof (SERV_PARM));
---
> /* Check for any switch change */
> } else if ((port->prev_did != port->did) ||
> bcmp(&port->prev_fabric_sparam.portName,
> &port->fabric_sparam.portName, 8)) {
> new_config = 1;
> }
> }
10157,10162c13058
< if (port->prev_did &&
< ((port->prev_did != port->did) ||
< bcmp(&port->prev_fabric_sparam.portName,
< &port->fabric_sparam.portName, 8)) &&
< emlxs_nport_count(port)) {
<
---
> if (new_config) {
10165c13061
< "New fabric. Offlining port.",
---
> "New config. Offlining port.",
10171c13067
< emlxs_wwn_xlate(buffer1,
---
> emlxs_wwn_xlate(buffer1, sizeof (buffer1),
10173c13069
< emlxs_wwn_xlate(buffer2,
---
> emlxs_wwn_xlate(buffer2, sizeof (buffer2),
10202c13098
< uint32_t rval;
---
> uint32_t rval = 0;
10209c13105
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10214d13109
<
10256c13151
< uint32_t rval;
---
> uint32_t rval = 0;
10265c13160
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10269d13163
<
10275c13169
< "vpi_logo_action:%d. No login. Skipping logo.",
---
> "vpi_logo_action:%d. No login. Skipping LOGO.",
10283c13177,13178
< if (!(hba->flag & FC_ONLINE_MODE)) {
---
> if (!(hba->flag & FC_ONLINE_MODE) &&
> !(hba->flag & FC_OFFLINING_MODE)) {
10285c13180
< "vpi_logo_action:%d. HBA offline. Skipping logo.",
---
> "vpi_logo_action:%d. HBA offline. Skipping LOGO.",
10287a13183,13185
> /* Fabric logo is implied */
> emlxs_vpi_logo_handler(port, vpip);
>
10292a13191,13203
> if (SLI4_FC_MODE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_logo_action:%d. FC mode. Skipping LOGO.",
> vpip->VPI);
>
> /* Fabric logo is implied */
> emlxs_vpi_logo_handler(port, vpip);
>
> rval = emlxs_vpi_state(port, vpip, VPI_STATE_PORT_OFFLINE,
> FCF_REASON_EVENT, evt, arg1);
> return (rval);
> }
>
10296a13208,13210
> did = FABRIC_DID;
> sid = (vport->did)? vport->did:vport->prev_did;
>
10298c13212
< "vpi_logo_action:%d. Sending logo. Sending LOGO.",
---
> "vpi_logo_action:%d attempts=%d sid=%x did=%x. Sending LOGO. <",
10300c13214,13215
< vpip->attempts);
---
> vpip->attempts,
> sid, did);
10317,10319d13231
< did = FABRIC_DID;
< sid = (vport->did)? vport->did:vport->prev_did;
<
10341,10345d13252
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "vpi_logo_action:%d LOGO:sid=%x did=%x.",
< vpip->VPI,
< sid, did);
<
10347c13254
< rval = emlxs_pkt_send(pkt, 1);
---
> rval = emlxs_pkt_send(pkt, 0);
10372c13279
< uint32_t rval;
---
> uint32_t rval = 0;
10377c13284
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10384,10386c13291,13292
< vpip->flag &= ~EMLXS_VPI_LOGI;
< if (vpip->flag & EMLXS_VPI_VFI_LOGI) {
< vpip->flag &= ~EMLXS_VPI_VFI_LOGI;
---
> /* Fabric logo is complete */
> emlxs_vpi_logo_handler(port, vpip);
10388,10392d13293
< if (vpip->vfip->logi_count > 0) {
< vpip->vfip->logi_count--;
< }
< }
<
10411c13312
< uint32_t rval;
---
> uint32_t rval = 0;
10418c13319
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10423d13323
<
10470c13370
< "vpi_unreg_mbcmpl:%d state=%s. Terminated.",
---
> "vpi_unreg_mbcmpl:%d state=%s.",
10480c13380
< "vpi_unreg_mbcmpl:%d failed. status=%x",
---
> "vpi_unreg_mbcmpl:%d failed. %s. >",
10482c13382
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
10492c13392
< "vpi_unreg_mbcmpl:%d Unregistered.",
---
> "vpi_unreg_mbcmpl:%d. Unreg complete. >",
10512c13412
< uint32_t rval;
---
> uint32_t rval = 0;
10517c13417
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10521d13420
<
10525,10526c13424,13425
< if ((vpip->rpi_online > 0) ||
< (vpip->rpip->state != RPI_STATE_FREE)) {
---
> if ((vpip->rpi_online > vpip->rpi_paused) ||
> (vpip->fabric_rpip->state != RPI_STATE_FREE)) {
10528,10530c13427,13429
< "vpi_unreg_action:%d rpi_online=%d,%d. Waiting for RPI's.",
< vpip->VPI,
< vpip->rpi_online, vpip->rpi_paused);
---
> "vpi_unreg_action:%d rpi_online=%d,%d fstate=%x. "
> "Waiting for RPI's.", vpip->VPI, vpip->rpi_online,
> vpip->rpi_paused, vpip->fabric_rpip->state);
10539c13438
< "vpi_unreg_action:%d. Not registered. Skipping unreg.",
---
> "vpi_unreg_action:%d. Not registered. Skipping UNREG_VPI.",
10563c13462
< "vpi_unreg_action:%d attempts=%d. Sending UNREG_VPI.",
---
> "vpi_unreg_action:%d attempts=%d. Sending UNREG_VPI. <",
10567c13466
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
10606c13505
< uint32_t rval;
---
> uint32_t rval = 0;
10611c13510
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10636c13535
< uint32_t rval;
---
> uint32_t rval = 0;
10643c13542
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10693c13592
< "vpi_reg_mbcmpl:%d state=%s. Terminated.",
---
> "vpi_reg_mbcmpl:%d state=%s.",
10703c13602
< "vpi_reg_mbcmpl:%d failed. status=%x",
---
> "vpi_reg_mbcmpl:%d failed. %s. >",
10705c13604
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
10706a13606,13609
> if (mb4->mbxStatus == MBXERR_DID_INCONSISTENT) {
> vpip->flag |= EMLXS_VPI_OFFLINE_REQ;
> }
>
10715c13618
< "vpi_reg_mbcmpl:%d. Registered.",
---
> "vpi_reg_mbcmpl:%d. Reg complete. >",
10737c13640
< uint32_t rval;
---
> uint32_t rval = 0;
10742c13645
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10763,10767c13666,13667
< if (!(vpip->flag & EMLXS_VPI_REG) &&
< (vpip->vfip->vpi_online == 1)) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "vpi_reg_action:%d. First vpi. Skipping reg.",
< vpip->VPI);
---
> if (!(vpip->vfip->flag & EMLXS_VFI_REG)) {
> /* We can't register the VPI until our VFI is registered */
10769,10770c13669,13674
< rval = emlxs_vpi_state(port, vpip, VPI_STATE_ONLINE,
< FCF_REASON_EVENT, evt, arg1);
---
> /* If this is the flogi_vpip, then we can skip the REG_VPI. */
> /* REG_VPI will be performed later during REG_VFI */
> if (vpip == vpip->vfip->flogi_vpip) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_reg_action:%d. flogi_vpi. Skipping REG_VPI.",
> vpip->VPI);
10771a13676,13690
> rval = emlxs_vpi_state(port, vpip, VPI_STATE_ONLINE,
> FCF_REASON_EVENT, evt, arg1);
>
> return (rval);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "vpi_reg_action:%d attempts=%d. VFI not registered. "
> "Offlining.",
> vpip->VPI,
> vpip->attempts);
>
> vpip->flag &= ~EMLXS_VPI_REQ_MASK;
> vpip->flag |= EMLXS_VPI_OFFLINE_REQ;
> rval = emlxs_vpi_offline_handler(port, vpip, 0);
10777c13696
< "vpi_reg_action:%d attempts=%d. Updating REG_VPI.",
---
> "vpi_reg_action:%d attempts=%d. Updating REG_VPI. <",
10782c13701
< "vpi_reg_action:%d attempts=%d. Sending REG_VPI.",
---
> "vpi_reg_action:%d attempts=%d. Sending REG_VPI. <",
10787c13706
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
10834c13753
< uint32_t rval;
---
> uint32_t rval = 0;
10839c13758
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10874c13793
< uint32_t rval;
---
> uint32_t rval = 0;
10879c13798
< "Invalid state. Terminated.",
---
> "Invalid state. <",
10899c13818
< "vpi_online_action:%d. VPI online. Notifying VFI:%d",
---
> "vpi_online_action:%d. VPI online. Notifying VFI:%d >",
10929c13848
< (void) sprintf(buffer, "state=0x%x", state);
---
> (void) snprintf(buffer, sizeof (buffer), "state=0x%x", state);
10939c13858
< uint32_t rval;
---
> uint32_t rval = 0;
10975c13894
< "rpi:%d %s:%s arg=%p. No action. Terminated.",
---
> "rpi_action:%d %s:%s arg=%p. No action. <",
10995c13914
< uint32_t rval;
---
> uint32_t rval = 0;
11007c13926
< "rpi: %s arg=%p. Null RPI found. Terminated.",
---
> "rpi_event: %s arg=%p. Null RPI found. <",
11020c13939
< "rpi:%d %s:%s arg=%p",
---
> "rpi_event:%d %s:%s arg=%p",
11046,11047c13965
< "rpi_state:%d %s:%s:0x%x arg=%p. State not changed. "
< "Terminated.",
---
> "rpi_state:%d %s:%s:0x%x arg=%p. State not changed. <",
11052d13969
<
11058c13975
< "rpi:%d %s-->%s arg=%p",
---
> "rpi_state:%d %s-->%s arg=%p",
11064c13981
< "rpi:%d %s-->%s:%s:%s arg=%p",
---
> "rpi_state:%d %s-->%s:%s:%s arg=%p",
11072c13989
< "rpi:%d %s-->%s:%s:0x%x arg=%p",
---
> "rpi_state:%d %s-->%s:%s:0x%x arg=%p",
11080c13997
< "rpi:%d %s-->%s:%s arg=%p",
---
> "rpi_state:%d %s-->%s:%s arg=%p",
11099,11100c14016,14017
< static RPIobj_t *
< emlxs_rpi_alloc(emlxs_port_t *port, uint32_t did)
---
> static void
> emlxs_rpi_deferred_cmpl(emlxs_port_t *port, RPIobj_t *rpip, uint32_t status)
11103,11104c14020
< uint16_t i;
< RPIobj_t *rpip;
---
> emlxs_deferred_cmpl_t *cmpl;
11106,11109c14022,14024
< /* Special handling for Fabric RPI */
< if (did == FABRIC_DID) {
< /* Use the reserved RPI in the port */
< rpip = &port->VPIobj.fcf_rpi;
---
> if (!rpip->cmpl) {
> return;
> }
11111,11115c14026,14027
< bzero(rpip, sizeof (RPIobj_t));
< rpip->index = 0xffff;
< rpip->RPI = 0xffff;
< rpip->did = FABRIC_DID;
< rpip->vpip = &port->VPIobj;
---
> cmpl = rpip->cmpl;
> rpip->cmpl = 0;
11117,11118c14029,14032
< (void) emlxs_rpi_state(port, rpip, RPI_STATE_OFFLINE,
< 0, 0, 0);
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_deferred_cmpl:%d. status=%x ...",
> port->vpip->VPI,
> status);
11120c14034,14087
< return (rpip);
---
> emlxs_thread_spawn(hba, emlxs_deferred_cmpl_thread, (void *)cmpl,
> (void*)(uintptr_t)status);
>
> return;
>
> } /* emlxs_rpi_deferred_cmpl() */
>
>
> static void
> emlxs_rpi_idle_timer(emlxs_hba_t *hba)
> {
> emlxs_config_t *cfg = &CFG;
> RPIobj_t *rpip;
> uint32_t i;
>
> /* This timer monitors for idle timeout of an RPI in a */
> /* RESERVED state. */
> /* This means that the RPI was reserved, but never registered. */
> /* If the RPI sits for too long (~2 secs) in this state we free it */
> rpip = hba->sli.sli4.RPIp;
> for (i = 0; i < hba->sli.sli4.RPICount; i++, rpip++) {
> if (rpip->state != RPI_STATE_RESERVED) {
> continue;
> }
>
> /* If RPI is active, then clear timer. */
> if (rpip->xri_count) {
> rpip->idle_timer = 0;
> continue;
> }
>
> /* If an F-port RPI is found idle, then free it. */
> /* Since an F-port RPI is never registered after the login */
> /* completes, it is safe to free it immediately. */
> if ((rpip->did == FABRIC_DID) ||
> (rpip->did == SCR_DID)) {
> goto free_it;
> }
>
> /* Start idle timer if not already active */
> if (!rpip->idle_timer) {
> rpip->idle_timer = hba->timer_tics +
> cfg[CFG_FCF_RPI_IDLE_TIMEOUT].current;
> }
>
> /* Check for idle timeout */
> if (hba->timer_tics < rpip->idle_timer) {
> continue;
> }
> rpip->idle_timer = 0;
>
> free_it:
> (void) emlxs_rpi_state(rpip->vpip->port, rpip, RPI_STATE_FREE,
> FCF_REASON_UNUSED, 0, 0);
11122a14090,14101
> return;
>
> } /* emlxs_rpi_idle_timer() */
>
>
> static RPIobj_t *
> emlxs_rpi_alloc(emlxs_port_t *port, uint32_t did)
> {
> emlxs_hba_t *hba = HBA;
> uint16_t i;
> RPIobj_t *rpip;
>
11133,11134c14112,14113
< rpip->RPI = hba->sli.sli4.RPIBase + i;
< rpip->vpip = &port->VPIobj;
---
> rpip->RPI = emlxs_sli4_index_to_rpi(hba, i);
> rpip->vpip = port->vpip;
11137c14116,14120
< (void) emlxs_rpi_state(port, rpip, RPI_STATE_OFFLINE,
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_alloc:%d. RPI allocated. >",
> rpip->RPI);
>
> (void) emlxs_rpi_state(port, rpip, RPI_STATE_RESERVED,
11143a14127,14129
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_alloc: Out of RPI objects.");
>
11148a14135,14166
> /* Special routine for VPI object */
> static void
> emlxs_rpi_alloc_fabric_rpi(emlxs_port_t *port)
> {
> RPIobj_t *fabric_rpip;
>
> fabric_rpip = port->vpip->fabric_rpip;
>
> if (fabric_rpip->state != RPI_STATE_FREE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_alloc_fabric_rpi: Fabric RPI active:%s.",
> emlxs_rpi_state_xlate(fabric_rpip->state));
> return;
> }
>
> bzero(fabric_rpip, sizeof (RPIobj_t));
> fabric_rpip->index = 0xffff;
> fabric_rpip->RPI = FABRIC_RPI;
> fabric_rpip->did = FABRIC_DID;
> fabric_rpip->vpip = port->vpip;
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_alloc_fabric_rpi: Allocating Fabric RPI. >");
>
> (void) emlxs_rpi_state(port, fabric_rpip, RPI_STATE_RESERVED,
> 0, 0, 0);
>
> return;
>
> } /* emlxs_rpi_alloc_fabric_rpi() */
>
>
11152c14170
< uint32_t rval;
---
> uint32_t rval = 0;
11153a14172,14175
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_free:%d did=%x. Freeing RPI. >",
> rpip->RPI, rpip->did);
>
11158c14180
< } /* emlxs_fcfi_free() */
---
> } /* emlxs_rpi_free() */
11165c14187,14188
< RPIobj_t *rpip;
---
> RPIobj_t *rpip;
> uint32_t index;
11168,11169c14191,14192
< if (rpi == 0xffff) {
< return (port->VPIobj.rpip);
---
> if (rpi == FABRIC_RPI) {
> return (port->vpip->fabric_rpip);
11172,11173c14195,14197
< if ((rpi < hba->sli.sli4.RPIBase) ||
< (rpi >= hba->sli.sli4.RPIBase+hba->sli.sli4.RPICount)) {
---
> index = emlxs_sli4_rpi_to_index(hba, rpi);
>
> if (index >= hba->sli.sli4.RPICount) {
11175,11178c14199,14200
< "rpi_find:%d. RPI out of range (%d,%d).",
< rpi,
< hba->sli.sli4.RPIBase,
< hba->sli.sli4.RPIBase+hba->sli.sli4.RPICount);
---
> "rpi_find:%d. RPI Invalid.",
> rpi);
11183c14205
< rpip = &hba->sli.sli4.RPIp[(rpi - hba->sli.sli4.RPIBase)];
---
> rpip = &hba->sli.sli4.RPIp[index];
11206,11210d14227
< /* Special handling for Fabric RPI */
< if (did == FABRIC_DID) {
< return (port->VPIobj.rpip);
< }
<
11218c14235
< if ((rpip->did == did) && (rpip->vpip == &port->VPIobj)) {
---
> if ((rpip->did == did) && (rpip->vpip == port->vpip)) {
11230c14247
< emlxs_rpi_alloc_notify(emlxs_port_t *port, uint32_t did)
---
> emlxs_rpi_reserve_notify(emlxs_port_t *port, uint32_t did, XRIobj_t *xrip)
11232c14249
< emlxs_hba_t *hba = HBA;
---
> emlxs_hba_t *hba = HBA;
11234a14252,14253
> /* xrip will be NULL for unsolicited BLS requests */
>
11239,11240c14258,14272
< /* Fabric RPI will be handled automatically */
< if (did == FABRIC_DID) {
---
> mutex_enter(&EMLXS_FCF_LOCK);
>
> rpip = emlxs_rpi_find_did(port, did);
>
> if (!rpip) {
> rpip = emlxs_rpi_alloc(port, did);
> }
>
> if (!rpip) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_reserve_notify: Unable to reserve an rpi. "
> "did=%x xri=%d.",
> did, ((xrip)?xrip->XRI:0));
>
> mutex_exit(&EMLXS_FCF_LOCK);
11243a14276,14304
> /* Bind the XRI */
> if (xrip) {
> mutex_enter(&EMLXS_FCTAB_LOCK);
> xrip->reserved_rpip = rpip;
> rpip->xri_count++;
> mutex_exit(&EMLXS_FCTAB_LOCK);
> }
>
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_reserve_notify:%d did=%x xri=%d.",
> rpip->RPI, rpip->did, ((xrip)?xrip->XRI:0));
>
> mutex_exit(&EMLXS_FCF_LOCK);
>
> return (rpip);
>
> } /* emlxs_rpi_reserve_notify() */
>
>
> extern RPIobj_t *
> emlxs_rpi_alloc_notify(emlxs_port_t *port, uint32_t did)
> {
> emlxs_hba_t *hba = HBA;
> RPIobj_t *rpip;
>
> if (hba->sli_mode != EMLXS_HBA_SLI4_MODE) {
> return (NULL);
> }
>
11259c14320
< uint32_t rval;
---
> uint32_t rval = 0;
11270c14331
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
11297d14357
<
11302c14362
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
11308,11309c14368,14369
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_error_msg,
< "rpi_pause_notify:%d %s. Pausing.",
---
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_pause_notify:%d %s. Pausing RPI. >",
11328a14389
> uint32_t rval = 0;
11334,11335c14395,14396
< /* Fabric RPI will be handled automatically */
< if (did == FABRIC_DID) {
---
> if ((did == port->did) && (!(hba->flag & FC_LOOPBACK_MODE))) {
> /* We never register our local port */
11341,11347c14402,14405
< if (!(port->VPIobj.flag & EMLXS_VPI_PORT_ENABLED)) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "rpi_online_notify: vpi=%d. Port disabled.",
< port->VPIobj.VPI);
<
< mutex_exit(&EMLXS_FCF_LOCK);
< return (1);
---
> if (!rpip && (did == FABRIC_DID)) {
> /* We never online the Fabric DID other */
> /* than the fabric_rpip */
> rpip = port->vpip->fabric_rpip;
11379a14438,14442
> /* For safety */
> if (rpip->cmpl) {
> emlxs_rpi_deferred_cmpl(port, rpip, 1);
> }
>
11382a14446,14464
> if ((rpip->RPI == FABRIC_RPI) ||
> (hba->flag & FC_PT_TO_PT)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_online_notify:%d %s. %s. Login cmpl.",
> rpip->RPI,
> emlxs_rpi_state_xlate(rpip->state),
> ((allocated)? "Allocated":"Updated"));
>
> rval = emlxs_vpi_logi_cmpl_notify(port, rpip);
>
> if (rval && rpip->cmpl) {
> kmem_free(rpip->cmpl, sizeof (emlxs_deferred_cmpl_t));
> rpip->cmpl = 0;
> }
>
> mutex_exit(&EMLXS_FCF_LOCK);
> return (rval);
> }
>
11384c14466
< "rpi_online_notify:%d %s. %s. Onlining.",
---
> "rpi_online_notify:%d %s. %s. Onlining RPI. >",
11405d14486
<
11425d14505
<
11430c14510
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
11449c14529
< "rpi_offline_notify:%d %s. Offlining.",
---
> "rpi_offline_notify:%d %s. Offlining RPI. >",
11488d14567
<
11493c14572
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
11517c14596
< "rpi_resume_notify:%d %s. Resuming.",
---
> "rpi_resume_notify:%d %s. Resuming RPI. >",
11555c14634
< "Invalid state. Terminated.",
---
> "Invalid state. <",
11562,11565c14641,14642
< if (rpip->did == FABRIC_DID) {
< if (rpip->vpip->flogi_sbp) {
< emlxs_vpi_flogi_cmpl(port, rpip->vpip, 1);
< }
---
> if (rpip->cmpl) {
> emlxs_rpi_deferred_cmpl(port, rpip, 1);
11567a14645,14648
> if (rpip->vpip->p2p_rpip == rpip) {
> rpip->vpip->p2p_rpip = NULL;
> }
>
11589c14670
< xrip->rpip->xri_count--;
---
> rpip->xri_count--;
11591a14673,14685
>
> if (xrip->reserved_rpip == rpip) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_free_action:%d xri_count=%d. "
> "Removing XRI:%d iotag:%d.",
> rpip->RPI,
> rpip->xri_count,
> xrip->XRI, xrip->iotag);
>
> rpip->xri_count--;
> xrip->reserved_rpip = NULL;
> }
>
11604c14698
< "rpi_free_action:%d flag=%x. RPI freed.",
---
> "rpi_free_action:%d flag=%x. RPI freed. <",
11625c14719
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
11669c14763
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
11677c14771
< case RPI_STATE_OFFLINE:
---
> case RPI_STATE_RESERVED:
11679c14773
< "rpi_offline_evt_action:%d flag=%x. Offlining RPI.",
---
> "rpi_offline_evt_action:%d flag=%x. Freeing RPI.",
11683,11684c14777,14778
< rval = emlxs_rpi_state(port, rpip, RPI_STATE_OFFLINE,
< FCF_REASON_REENTER, evt, arg1);
---
> rval = emlxs_rpi_state(port, rpip, RPI_STATE_FREE,
> FCF_REASON_EVENT, evt, arg1);
11689,11690c14783,14784
< "rpi_offline_evt_action:%d flag=%x. Already unregistering. "
< "Terminated.",
---
> "rpi_offline_evt_action:%d flag=%x. "
> "Already unregistering. <",
11717a14812
> VPIobj_t *vpip;
11719a14815,14816
> vpip = rpip->vpip;
>
11723c14820
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
11732c14829
< case RPI_STATE_OFFLINE:
---
> case RPI_STATE_RESERVED:
11734c14831
< "rpi_pause_evt_action:%d flag=%x. Offlining RPI.",
---
> "rpi_pause_evt_action:%d flag=%x. Freeing RPI.",
11738,11739c14835,14836
< rval = emlxs_rpi_state(port, rpip, RPI_STATE_OFFLINE,
< FCF_REASON_REENTER, evt, arg1);
---
> rval = emlxs_rpi_state(port, rpip, RPI_STATE_FREE,
> FCF_REASON_EVENT, evt, arg1);
11744,11745c14841
< "rpi_pause_evt_action:%d flag=%x. Not online. "
< "Terminated.",
---
> "rpi_pause_evt_action:%d flag=%x. Not online. <",
11753,11754c14849
< "rpi_pause_evt_action:%d flag=%x. Already paused. "
< "Terminated.",
---
> "rpi_pause_evt_action:%d flag=%x. Already paused. <",
11767a14863,14876
> /* Don't pause an RPI, if the VPI is not pausing too */
> if (!(vpip->flag & EMLXS_VPI_PAUSE_REQ)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_pause_evt_action:%d rpi_online=%d,%d "
> "xri_count=%d. VPI:%d pause not requested. "
> "Unregistering.", rpip->RPI,
> vpip->rpi_online, vpip->rpi_paused,
> rpip->xri_count, vpip->VPI);
>
> rval = emlxs_rpi_state(port, rpip, RPI_STATE_UNREG,
> FCF_REASON_EVENT, evt, arg1);
> break;
> }
>
11774c14883
< "rpi_pause_evt_action:%d flag=%x. Terminated.",
---
> "rpi_pause_evt_action:%d flag=%x. <",
11795c14904
< "Invalid event type. Terminated.",
---
> "Invalid event type. <",
11816c14925
< "rpi_resume_evt_action:%d flag=%x. Not paused. Terminated.",
---
> "rpi_resume_evt_action:%d flag=%x. Not paused. <",
11829c14938
< emlxs_rpi_offline_action(emlxs_port_t *port, RPIobj_t *rpip, uint32_t evt,
---
> emlxs_rpi_reserved_action(emlxs_port_t *port, RPIobj_t *rpip, uint32_t evt,
11832d14940
< uint32_t rval;
11837c14945
< if (rpip->state != RPI_STATE_OFFLINE) {
---
> if (rpip->state != RPI_STATE_RESERVED) {
11839,11840c14947,14948
< "rpi_offline_action:%d %s:%s arg=%p. "
< "Invalid state. Terminated.",
---
> "rpi_reserved_action:%d %s:%s arg=%p. "
> "Invalid state. <",
11847c14955
< if (rpip->prev_state == RPI_STATE_FREE) {
---
> if (rpip->prev_state != RPI_STATE_FREE) {
11849c14957,14958
< "rpi_offline_action:%d rpi_online=%d,%d. Terminated.",
---
> "rpi_reserved_action:%d %s:%s arg=%p. "
> "Invalid previous state. %s <",
11851c14960,14962
< vpip->rpi_online, vpip->rpi_paused);
---
> emlxs_rpi_state_xlate(rpip->state),
> emlxs_fcf_event_xlate(evt), arg1,
> emlxs_rpi_state_xlate(rpip->prev_state));
11853c14964
< return (0);
---
> return (1);
11855a14967,14996
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_reserved_action:%d rpi_online=%d,%d. <",
> rpip->RPI,
> vpip->rpi_online, vpip->rpi_paused);
>
> return (0);
>
> } /* emlxs_rpi_reserved_action() */
>
>
> /*ARGSUSED*/
> static uint32_t
> emlxs_rpi_offline_action(emlxs_port_t *port, RPIobj_t *rpip, uint32_t evt,
> void *arg1)
> {
> uint32_t rval = 0;
> VPIobj_t *vpip;
>
> vpip = rpip->vpip;
>
> if (rpip->state != RPI_STATE_OFFLINE) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_offline_action:%d %s:%s arg=%p. "
> "Invalid state. <",
> rpip->RPI,
> emlxs_rpi_state_xlate(rpip->state),
> emlxs_fcf_event_xlate(evt), arg1);
> return (1);
> }
>
11877c15018
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
11896c15037
< "Notifying VPI:%d",
---
> "Notifying VPI:%d >",
11927a15069
> uint32_t rval = 0;
11934c15076
< "Invalid state. Terminated.",
---
> "Invalid state. <",
11940a15083,15096
> if (!(vpip->flag & EMLXS_VPI_PAUSE_REQ)) {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_paused_action:%d rpi_online=%d,%d xri_count=%d. "
> "VPI:%d pause not requested. Unregistering.",
> rpip->RPI,
> vpip->rpi_online, vpip->rpi_paused,
> rpip->xri_count,
> vpip->VPI);
>
> rval = emlxs_rpi_state(port, rpip, RPI_STATE_UNREG,
> FCF_REASON_EVENT, evt, arg1);
> return (rval);
> }
>
11951c15107
< "Notifying VPI:%d",
---
> "Notifying VPI:%d >",
11963c15119
< "RPI paused.",
---
> "RPI paused. <",
11979c15135
< uint32_t rval;
---
> uint32_t rval = 0;
11986c15142
< "Invalid state. Terminated.",
---
> "Invalid state. <",
11991d15146
<
12034c15189
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
12044a15200,15202
> /* We don't need to worry about xrip->reserved_rpip */
> /* here because the Fabric RPI can never be reserved */
> /* by an xri. */
12054c15212
< (void) emlxs_sli4_unreserve_xri(hba,
---
> (void) emlxs_sli4_unreserve_xri(port,
12118c15276
< "No longer in RPI_STATE_UNREG. Terminated.",
---
> "No longer in RPI_STATE_UNREG.",
12128c15286
< "rpi_unreg_mbcmpl:%d failed. status=%x",
---
> "rpi_unreg_mbcmpl:%d failed. %s. >",
12130c15288
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
12142c15300
< "rpi_unreg_mbcmpl:%d Unregistered. Unreg cmpl.",
---
> "rpi_unreg_mbcmpl:%d Unregistered. Unreg complete. >",
12162c15320
< uint32_t rval;
---
> uint32_t rval = 0;
12168c15326
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12172d15329
<
12191c15348
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
12209c15366
< "rpi_unreg_action:%d attempts=%d. Sending UNREG_RPI.",
---
> "rpi_unreg_action:%d attempts=%d. Sending UNREG_RPI. <",
12213c15370
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
12264c15421
< uint32_t rval;
---
> uint32_t rval = 0;
12269c15426
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12294c15451
< uint32_t rval;
---
> uint32_t rval = 0;
12301c15458
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12306d15462
<
12340a15497
> emlxs_hba_t *hba = HBA;
12356,12357c15513
< if (!(rpip->flag & EMLXS_RPI_VPI) &&
< (rpip->did != FABRIC_DID)) {
---
> if (!(rpip->flag & EMLXS_RPI_VPI) && (rpip->RPI != FABRIC_RPI)) {
12361a15518,15522
> /* If private loop and this is fabric RPI, then exit now */
> if (!(hba->flag & FC_FABRIC_ATTACHED) && (rpip->RPI == FABRIC_RPI)) {
> return (0);
> }
>
12386c15547
< uint32_t rval;
---
> uint32_t rval = 0;
12395,12396c15556
< "rpi_reg_mbcmpl:%d state=%s. No longer in RPI_STATE_REG. "
< "Terminated.",
---
> "rpi_reg_mbcmpl:%d state=%s. No longer in RPI_STATE_REG.",
12406c15566
< "rpi_reg_mbcmpl:%d failed. status=%x",
---
> "rpi_reg_mbcmpl:%d failed. %s. >",
12408c15568
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
12419a15580,15583
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_reg_mbcmpl:%d. Reg failed. >",
> rpip->RPI);
>
12432c15596
< "rpi_reg_mbcmpl:%d Registered. Reg cmpl.",
---
> "rpi_reg_mbcmpl:%d Registered. Reg complete. >",
12470c15634
< uint32_t rval;
---
> uint32_t rval = 0;
12475c15639
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12479d15642
<
12483c15646
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
12507,12520d15669
< if (!(rpip->vpip->flag & EMLXS_VPI_PORT_ENABLED)) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "rpi_reg_action:%d did=%x. vpi=%d. Port disabled. "
< "Offlining RPI.",
< rpip->RPI,
< rpip->did,
< rpip->vpip->VPI);
<
< rval = emlxs_rpi_state(port, rpip, RPI_STATE_OFFLINE,
< FCF_REASON_NOT_ALLOWED, evt, arg1);
<
< return (rval);
< }
<
12527,12529c15676,15685
< "rpi_reg_action:%d flag=%x. Already registered. "
< "Updating registration.",
< rpip->RPI, rpip->flag);
---
> "rpi_reg_action:%d attempts=%d. "
> "Updating REG_RPI. <",
> rpip->RPI,
> rpip->attempts);
> } else {
> EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
> "rpi_reg_action:%d attempts=%d. "
> "Sending REG_RPI. <",
> rpip->RPI,
> rpip->attempts);
12532,12535c15688
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "rpi_reg_action:%d attempts=%d. Sending REG_RPI.",
< rpip->RPI,
< rpip->attempts);
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
12537,12538d15689
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
<
12548c15699
< if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF, 1)) == 0) {
---
> if ((mp = (MATCHMAP *)emlxs_mem_get(hba, MEM_BUF)) == 0) {
12574a15726
> mb4->un.varRegLogin.update = (rpip->flag & EMLXS_RPI_REG)? 1:0;
12610c15762
< uint32_t rval;
---
> uint32_t rval = 0;
12615c15767
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12624c15776
< "rpi_reg_cmpl_action:%d flag=%x. Going online",
---
> "rpi_reg_cmpl_action:%d flag=%x. Going online.",
12650c15802
< uint32_t rval;
---
> uint32_t rval = 0;
12657c15809
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12662d15813
<
12712c15863
< "No longer in RPI_STATE_RESUME. Terminated.",
---
> "No longer in RPI_STATE_RESUME.",
12722c15873
< "rpi_resume_mbcmpl:%d failed. status=%x",
---
> "rpi_resume_mbcmpl:%d failed. %s. >",
12724c15875
< mb4->mbxStatus);
---
> emlxs_mb_xlate_status(mb4->mbxStatus));
12736c15887
< "rpi_resume_mbcmpl:%d Resumed. Resume cmpl.",
---
> "rpi_resume_mbcmpl:%d Resumed. Resume complete. >",
12756c15907
< uint32_t rval;
---
> uint32_t rval = 0;
12761c15912
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12765d15915
<
12780c15930
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
12800c15950
< "rpi_resume_action:%d attempts=%d. Sending RESUME_RPI.",
---
> "rpi_resume_action:%d attempts=%d. Sending RESUME_RPI. <",
12804c15954
< if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX, 1))) {
---
> if (!(mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) {
12855c16005
< uint32_t rval;
---
> uint32_t rval = 0;
12860c16010
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12906c16056,16057
< uint32_t rval;
---
> uint32_t rval = 0;
> RPIobj_t *p2p_rpip;
12911c16062
< "Invalid state. Terminated.",
---
> "Invalid state. <",
12918c16069
< if (rpip->did == FABRIC_DID) {
---
> if (rpip->RPI == FABRIC_RPI) {
12920,12921c16071
< "rpi_online_action:%d did=%x. Fabric RPI online. "
< "Terminated.",
---
> "rpi_online_action:%d did=%x. Fabric RPI online. <",
12925a16076,16084
> /* Now register the p2p_rpip */
> p2p_rpip = rpip->vpip->p2p_rpip;
> if (p2p_rpip) {
> rpip->vpip->p2p_rpip = NULL;
>
> rval = emlxs_rpi_state(port, p2p_rpip, RPI_STATE_REG,
> FCF_REASON_EVENT, evt, arg1);
> }
>
12928,12929c16087,16088
< if (rpip->vpip->flogi_sbp) {
< emlxs_vpi_flogi_cmpl(port, rpip->vpip, 0);
---
> if (rpip->cmpl) {
> emlxs_rpi_deferred_cmpl(port, rpip, 0);
12935,12948d16093
< if (!(rpip->vpip->flag & EMLXS_VPI_PORT_ENABLED)) {
< EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcf_detail_msg,
< "rpi_online_action:%d did=%x. vpi=%d. Port disabled. "
< "Offlining RPI.",
< rpip->RPI,
< rpip->did,
< rpip->vpip->VPI);
<
< rval = emlxs_rpi_state(port, rpip, RPI_STATE_OFFLINE,
< FCF_REASON_NOT_ALLOWED, evt, arg1);
<
< return (rval);
< }
<
12950c16095
< "rpi_online_action:%d did=%x. RPI online. Notifying VPI:%d.",
---
> "rpi_online_action:%d did=%x. RPI online. Notifying VPI:%d. >",