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

[SCSI] bfa: Rename pport to fcport in BFA FCS.

Rename pport structures to fcport in BFA FCS, to resolve confusion
about the port structures in the firmware, and make sure the SG page
is setup correctly.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Krishna Gudipati and committed by
James Bottomley
1c8a4c37 13cc20c5

+1102 -734
+907 -661
drivers/scsi/bfa/bfa_fcport.c
··· 23 23 #include <cs/bfa_plog.h> 24 24 #include <aen/bfa_aen_port.h> 25 25 26 - BFA_TRC_FILE(HAL, PPORT); 27 - BFA_MODULE(pport); 26 + BFA_TRC_FILE(HAL, FCPORT); 27 + BFA_MODULE(fcport); 28 28 29 29 /* 30 30 * The port is considered disabled if corresponding physical port or IOC are 31 31 * disabled explicitly 32 32 */ 33 33 #define BFA_PORT_IS_DISABLED(bfa) \ 34 - ((bfa_pport_is_disabled(bfa) == BFA_TRUE) || \ 34 + ((bfa_fcport_is_disabled(bfa) == BFA_TRUE) || \ 35 35 (bfa_ioc_is_disabled(&bfa->ioc) == BFA_TRUE)) 36 36 37 37 /* 38 38 * forward declarations 39 39 */ 40 - static bfa_boolean_t bfa_pport_send_enable(struct bfa_pport_s *port); 41 - static bfa_boolean_t bfa_pport_send_disable(struct bfa_pport_s *port); 42 - static void bfa_pport_update_linkinfo(struct bfa_pport_s *pport); 43 - static void bfa_pport_reset_linkinfo(struct bfa_pport_s *pport); 44 - static void bfa_pport_set_wwns(struct bfa_pport_s *port); 45 - static void __bfa_cb_port_event(void *cbarg, bfa_boolean_t complete); 40 + static bfa_boolean_t bfa_fcport_send_enable(struct bfa_fcport_s *fcport); 41 + static bfa_boolean_t bfa_fcport_send_disable(struct bfa_fcport_s *fcport); 42 + static void bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport); 43 + static void bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport); 44 + static void bfa_fcport_set_wwns(struct bfa_fcport_s *fcport); 45 + static void __bfa_cb_fcport_event(void *cbarg, bfa_boolean_t complete); 46 + static void bfa_fcport_callback(struct bfa_fcport_s *fcport, 47 + enum bfa_pport_linkstate event); 48 + static void bfa_fcport_queue_cb(struct bfa_fcport_ln_s *ln, 49 + enum bfa_pport_linkstate event); 50 + static void __bfa_cb_fcport_stats(void *cbarg, bfa_boolean_t complete); 51 + static void __bfa_cb_fcport_stats_clr(void *cbarg, bfa_boolean_t complete); 52 + static void bfa_fcport_stats_timeout(void *cbarg); 53 + static void bfa_fcport_stats_clr_timeout(void *cbarg); 54 + 46 55 static void __bfa_cb_port_stats(void *cbarg, bfa_boolean_t complete); 47 56 static void __bfa_cb_port_stats_clr(void *cbarg, bfa_boolean_t complete); 48 57 static void bfa_port_stats_timeout(void *cbarg); 49 58 static void bfa_port_stats_clr_timeout(void *cbarg); 50 - static void bfa_pport_callback(struct bfa_pport_s *pport, 51 - enum bfa_pport_linkstate event); 52 - static void bfa_pport_queue_cb(struct bfa_pport_ln_s *ln, 53 - enum bfa_pport_linkstate event); 59 + 54 60 /** 55 61 * bfa_pport_private 56 62 */ ··· 64 58 /** 65 59 * BFA port state machine events 66 60 */ 67 - enum bfa_pport_sm_event { 68 - BFA_PPORT_SM_START = 1, /* start port state machine */ 69 - BFA_PPORT_SM_STOP = 2, /* stop port state machine */ 70 - BFA_PPORT_SM_ENABLE = 3, /* enable port */ 71 - BFA_PPORT_SM_DISABLE = 4, /* disable port state machine */ 72 - BFA_PPORT_SM_FWRSP = 5, /* firmware enable/disable rsp */ 73 - BFA_PPORT_SM_LINKUP = 6, /* firmware linkup event */ 74 - BFA_PPORT_SM_LINKDOWN = 7, /* firmware linkup down */ 75 - BFA_PPORT_SM_QRESUME = 8, /* CQ space available */ 76 - BFA_PPORT_SM_HWFAIL = 9, /* IOC h/w failure */ 61 + enum bfa_fcport_sm_event { 62 + BFA_FCPORT_SM_START = 1, /* start port state machine */ 63 + BFA_FCPORT_SM_STOP = 2, /* stop port state machine */ 64 + BFA_FCPORT_SM_ENABLE = 3, /* enable port */ 65 + BFA_FCPORT_SM_DISABLE = 4, /* disable port state machine */ 66 + BFA_FCPORT_SM_FWRSP = 5, /* firmware enable/disable rsp */ 67 + BFA_FCPORT_SM_LINKUP = 6, /* firmware linkup event */ 68 + BFA_FCPORT_SM_LINKDOWN = 7, /* firmware linkup down */ 69 + BFA_FCPORT_SM_QRESUME = 8, /* CQ space available */ 70 + BFA_FCPORT_SM_HWFAIL = 9, /* IOC h/w failure */ 77 71 }; 78 72 79 73 /** 80 74 * BFA port link notification state machine events 81 75 */ 82 76 83 - enum bfa_pport_ln_sm_event { 84 - BFA_PPORT_LN_SM_LINKUP = 1, /* linkup event */ 85 - BFA_PPORT_LN_SM_LINKDOWN = 2, /* linkdown event */ 86 - BFA_PPORT_LN_SM_NOTIFICATION = 3 /* done notification */ 77 + enum bfa_fcport_ln_sm_event { 78 + BFA_FCPORT_LN_SM_LINKUP = 1, /* linkup event */ 79 + BFA_FCPORT_LN_SM_LINKDOWN = 2, /* linkdown event */ 80 + BFA_FCPORT_LN_SM_NOTIFICATION = 3 /* done notification */ 87 81 }; 88 82 89 - static void bfa_pport_sm_uninit(struct bfa_pport_s *pport, 90 - enum bfa_pport_sm_event event); 91 - static void bfa_pport_sm_enabling_qwait(struct bfa_pport_s *pport, 92 - enum bfa_pport_sm_event event); 93 - static void bfa_pport_sm_enabling(struct bfa_pport_s *pport, 94 - enum bfa_pport_sm_event event); 95 - static void bfa_pport_sm_linkdown(struct bfa_pport_s *pport, 96 - enum bfa_pport_sm_event event); 97 - static void bfa_pport_sm_linkup(struct bfa_pport_s *pport, 98 - enum bfa_pport_sm_event event); 99 - static void bfa_pport_sm_disabling(struct bfa_pport_s *pport, 100 - enum bfa_pport_sm_event event); 101 - static void bfa_pport_sm_disabling_qwait(struct bfa_pport_s *pport, 102 - enum bfa_pport_sm_event event); 103 - static void bfa_pport_sm_disabled(struct bfa_pport_s *pport, 104 - enum bfa_pport_sm_event event); 105 - static void bfa_pport_sm_stopped(struct bfa_pport_s *pport, 106 - enum bfa_pport_sm_event event); 107 - static void bfa_pport_sm_iocdown(struct bfa_pport_s *pport, 108 - enum bfa_pport_sm_event event); 109 - static void bfa_pport_sm_iocfail(struct bfa_pport_s *pport, 110 - enum bfa_pport_sm_event event); 83 + static void bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport, 84 + enum bfa_fcport_sm_event event); 85 + static void bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport, 86 + enum bfa_fcport_sm_event event); 87 + static void bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport, 88 + enum bfa_fcport_sm_event event); 89 + static void bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, 90 + enum bfa_fcport_sm_event event); 91 + static void bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport, 92 + enum bfa_fcport_sm_event event); 93 + static void bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport, 94 + enum bfa_fcport_sm_event event); 95 + static void bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport, 96 + enum bfa_fcport_sm_event event); 97 + static void bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport, 98 + enum bfa_fcport_sm_event event); 99 + static void bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport, 100 + enum bfa_fcport_sm_event event); 101 + static void bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport, 102 + enum bfa_fcport_sm_event event); 103 + static void bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport, 104 + enum bfa_fcport_sm_event event); 111 105 112 - static void bfa_pport_ln_sm_dn(struct bfa_pport_ln_s *ln, 113 - enum bfa_pport_ln_sm_event event); 114 - static void bfa_pport_ln_sm_dn_nf(struct bfa_pport_ln_s *ln, 115 - enum bfa_pport_ln_sm_event event); 116 - static void bfa_pport_ln_sm_dn_up_nf(struct bfa_pport_ln_s *ln, 117 - enum bfa_pport_ln_sm_event event); 118 - static void bfa_pport_ln_sm_up(struct bfa_pport_ln_s *ln, 119 - enum bfa_pport_ln_sm_event event); 120 - static void bfa_pport_ln_sm_up_nf(struct bfa_pport_ln_s *ln, 121 - enum bfa_pport_ln_sm_event event); 122 - static void bfa_pport_ln_sm_up_dn_nf(struct bfa_pport_ln_s *ln, 123 - enum bfa_pport_ln_sm_event event); 124 - static void bfa_pport_ln_sm_up_dn_up_nf(struct bfa_pport_ln_s *ln, 125 - enum bfa_pport_ln_sm_event event); 106 + static void bfa_fcport_ln_sm_dn(struct bfa_fcport_ln_s *ln, 107 + enum bfa_fcport_ln_sm_event event); 108 + static void bfa_fcport_ln_sm_dn_nf(struct bfa_fcport_ln_s *ln, 109 + enum bfa_fcport_ln_sm_event event); 110 + static void bfa_fcport_ln_sm_dn_up_nf(struct bfa_fcport_ln_s *ln, 111 + enum bfa_fcport_ln_sm_event event); 112 + static void bfa_fcport_ln_sm_up(struct bfa_fcport_ln_s *ln, 113 + enum bfa_fcport_ln_sm_event event); 114 + static void bfa_fcport_ln_sm_up_nf(struct bfa_fcport_ln_s *ln, 115 + enum bfa_fcport_ln_sm_event event); 116 + static void bfa_fcport_ln_sm_up_dn_nf(struct bfa_fcport_ln_s *ln, 117 + enum bfa_fcport_ln_sm_event event); 118 + static void bfa_fcport_ln_sm_up_dn_up_nf(struct bfa_fcport_ln_s *ln, 119 + enum bfa_fcport_ln_sm_event event); 126 120 127 121 static struct bfa_sm_table_s hal_pport_sm_table[] = { 128 - {BFA_SM(bfa_pport_sm_uninit), BFA_PPORT_ST_UNINIT}, 129 - {BFA_SM(bfa_pport_sm_enabling_qwait), BFA_PPORT_ST_ENABLING_QWAIT}, 130 - {BFA_SM(bfa_pport_sm_enabling), BFA_PPORT_ST_ENABLING}, 131 - {BFA_SM(bfa_pport_sm_linkdown), BFA_PPORT_ST_LINKDOWN}, 132 - {BFA_SM(bfa_pport_sm_linkup), BFA_PPORT_ST_LINKUP}, 133 - {BFA_SM(bfa_pport_sm_disabling_qwait), 134 - BFA_PPORT_ST_DISABLING_QWAIT}, 135 - {BFA_SM(bfa_pport_sm_disabling), BFA_PPORT_ST_DISABLING}, 136 - {BFA_SM(bfa_pport_sm_disabled), BFA_PPORT_ST_DISABLED}, 137 - {BFA_SM(bfa_pport_sm_stopped), BFA_PPORT_ST_STOPPED}, 138 - {BFA_SM(bfa_pport_sm_iocdown), BFA_PPORT_ST_IOCDOWN}, 139 - {BFA_SM(bfa_pport_sm_iocfail), BFA_PPORT_ST_IOCDOWN}, 122 + {BFA_SM(bfa_fcport_sm_uninit), BFA_PPORT_ST_UNINIT}, 123 + {BFA_SM(bfa_fcport_sm_enabling_qwait), BFA_PPORT_ST_ENABLING_QWAIT}, 124 + {BFA_SM(bfa_fcport_sm_enabling), BFA_PPORT_ST_ENABLING}, 125 + {BFA_SM(bfa_fcport_sm_linkdown), BFA_PPORT_ST_LINKDOWN}, 126 + {BFA_SM(bfa_fcport_sm_linkup), BFA_PPORT_ST_LINKUP}, 127 + {BFA_SM(bfa_fcport_sm_disabling_qwait), BFA_PPORT_ST_DISABLING_QWAIT}, 128 + {BFA_SM(bfa_fcport_sm_disabling), BFA_PPORT_ST_DISABLING}, 129 + {BFA_SM(bfa_fcport_sm_disabled), BFA_PPORT_ST_DISABLED}, 130 + {BFA_SM(bfa_fcport_sm_stopped), BFA_PPORT_ST_STOPPED}, 131 + {BFA_SM(bfa_fcport_sm_iocdown), BFA_PPORT_ST_IOCDOWN}, 132 + {BFA_SM(bfa_fcport_sm_iocfail), BFA_PPORT_ST_IOCDOWN}, 140 133 }; 141 134 142 135 static void 143 - bfa_pport_aen_post(struct bfa_pport_s *pport, enum bfa_port_aen_event event) 136 + bfa_fcport_aen_post(struct bfa_fcport_s *fcport, enum bfa_port_aen_event event) 144 137 { 145 138 union bfa_aen_data_u aen_data; 146 - struct bfa_log_mod_s *logmod = pport->bfa->logm; 147 - wwn_t pwwn = pport->pwwn; 139 + struct bfa_log_mod_s *logmod = fcport->bfa->logm; 140 + wwn_t pwwn = fcport->pwwn; 148 141 char pwwn_ptr[BFA_STRING_32]; 149 142 struct bfa_ioc_attr_s ioc_attr; 150 143 ··· 172 167 break; 173 168 } 174 169 175 - bfa_ioc_get_attr(&pport->bfa->ioc, &ioc_attr); 170 + bfa_ioc_get_attr(&fcport->bfa->ioc, &ioc_attr); 176 171 aen_data.port.ioc_type = ioc_attr.ioc_type; 177 172 aen_data.port.pwwn = pwwn; 178 173 } 179 174 180 175 static void 181 - bfa_pport_sm_uninit(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 176 + bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport, 177 + enum bfa_fcport_sm_event event) 182 178 { 183 - bfa_trc(pport->bfa, event); 179 + bfa_trc(fcport->bfa, event); 184 180 185 181 switch (event) { 186 - case BFA_PPORT_SM_START: 182 + case BFA_FCPORT_SM_START: 187 183 /** 188 184 * Start event after IOC is configured and BFA is started. 189 185 */ 190 - if (bfa_pport_send_enable(pport)) 191 - bfa_sm_set_state(pport, bfa_pport_sm_enabling); 186 + if (bfa_fcport_send_enable(fcport)) 187 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); 192 188 else 193 - bfa_sm_set_state(pport, bfa_pport_sm_enabling_qwait); 189 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling_qwait); 194 190 break; 195 191 196 - case BFA_PPORT_SM_ENABLE: 192 + case BFA_FCPORT_SM_ENABLE: 197 193 /** 198 194 * Port is persistently configured to be in enabled state. Do 199 195 * not change state. Port enabling is done when START event is ··· 202 196 */ 203 197 break; 204 198 205 - case BFA_PPORT_SM_DISABLE: 199 + case BFA_FCPORT_SM_DISABLE: 206 200 /** 207 201 * If a port is persistently configured to be disabled, the 208 202 * first event will a port disable request. 209 203 */ 210 - bfa_sm_set_state(pport, bfa_pport_sm_disabled); 204 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); 211 205 break; 212 206 213 - case BFA_PPORT_SM_HWFAIL: 214 - bfa_sm_set_state(pport, bfa_pport_sm_iocdown); 207 + case BFA_FCPORT_SM_HWFAIL: 208 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); 215 209 break; 216 210 217 211 default: 218 - bfa_sm_fault(pport->bfa, event); 212 + bfa_sm_fault(fcport->bfa, event); 219 213 } 220 214 } 221 215 222 216 static void 223 - bfa_pport_sm_enabling_qwait(struct bfa_pport_s *pport, 224 - enum bfa_pport_sm_event event) 217 + bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport, 218 + enum bfa_fcport_sm_event event) 225 219 { 226 - bfa_trc(pport->bfa, event); 220 + bfa_trc(fcport->bfa, event); 227 221 228 222 switch (event) { 229 - case BFA_PPORT_SM_QRESUME: 230 - bfa_sm_set_state(pport, bfa_pport_sm_enabling); 231 - bfa_pport_send_enable(pport); 223 + case BFA_FCPORT_SM_QRESUME: 224 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); 225 + bfa_fcport_send_enable(fcport); 232 226 break; 233 227 234 - case BFA_PPORT_SM_STOP: 235 - bfa_reqq_wcancel(&pport->reqq_wait); 236 - bfa_sm_set_state(pport, bfa_pport_sm_stopped); 228 + case BFA_FCPORT_SM_STOP: 229 + bfa_reqq_wcancel(&fcport->reqq_wait); 230 + bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); 237 231 break; 238 232 239 - case BFA_PPORT_SM_ENABLE: 233 + case BFA_FCPORT_SM_ENABLE: 240 234 /** 241 235 * Already enable is in progress. 242 236 */ 243 237 break; 244 238 245 - case BFA_PPORT_SM_DISABLE: 239 + case BFA_FCPORT_SM_DISABLE: 246 240 /** 247 241 * Just send disable request to firmware when room becomes 248 242 * available in request queue. 249 243 */ 250 - bfa_sm_set_state(pport, bfa_pport_sm_disabled); 251 - bfa_reqq_wcancel(&pport->reqq_wait); 252 - bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, 244 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); 245 + bfa_reqq_wcancel(&fcport->reqq_wait); 246 + bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 253 247 BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); 254 - bfa_pport_aen_post(pport, BFA_PORT_AEN_DISABLE); 248 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); 255 249 break; 256 250 257 - case BFA_PPORT_SM_LINKUP: 258 - case BFA_PPORT_SM_LINKDOWN: 251 + case BFA_FCPORT_SM_LINKUP: 252 + case BFA_FCPORT_SM_LINKDOWN: 259 253 /** 260 254 * Possible to get link events when doing back-to-back 261 255 * enable/disables. 262 256 */ 263 257 break; 264 258 265 - case BFA_PPORT_SM_HWFAIL: 266 - bfa_reqq_wcancel(&pport->reqq_wait); 267 - bfa_sm_set_state(pport, bfa_pport_sm_iocdown); 259 + case BFA_FCPORT_SM_HWFAIL: 260 + bfa_reqq_wcancel(&fcport->reqq_wait); 261 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); 268 262 break; 269 263 270 264 default: 271 - bfa_sm_fault(pport->bfa, event); 265 + bfa_sm_fault(fcport->bfa, event); 272 266 } 273 267 } 274 268 275 269 static void 276 - bfa_pport_sm_enabling(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 270 + bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport, 271 + enum bfa_fcport_sm_event event) 277 272 { 278 - bfa_trc(pport->bfa, event); 273 + bfa_trc(fcport->bfa, event); 279 274 280 275 switch (event) { 281 - case BFA_PPORT_SM_FWRSP: 282 - case BFA_PPORT_SM_LINKDOWN: 283 - bfa_sm_set_state(pport, bfa_pport_sm_linkdown); 276 + case BFA_FCPORT_SM_FWRSP: 277 + case BFA_FCPORT_SM_LINKDOWN: 278 + bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); 284 279 break; 285 280 286 - case BFA_PPORT_SM_LINKUP: 287 - bfa_pport_update_linkinfo(pport); 288 - bfa_sm_set_state(pport, bfa_pport_sm_linkup); 281 + case BFA_FCPORT_SM_LINKUP: 282 + bfa_fcport_update_linkinfo(fcport); 283 + bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); 289 284 290 - bfa_assert(pport->event_cbfn); 291 - bfa_pport_callback(pport, BFA_PPORT_LINKUP); 285 + bfa_assert(fcport->event_cbfn); 286 + bfa_fcport_callback(fcport, BFA_PPORT_LINKUP); 292 287 break; 293 288 294 - case BFA_PPORT_SM_ENABLE: 289 + case BFA_FCPORT_SM_ENABLE: 295 290 /** 296 291 * Already being enabled. 297 292 */ 298 293 break; 299 294 300 - case BFA_PPORT_SM_DISABLE: 301 - if (bfa_pport_send_disable(pport)) 302 - bfa_sm_set_state(pport, bfa_pport_sm_disabling); 295 + case BFA_FCPORT_SM_DISABLE: 296 + if (bfa_fcport_send_disable(fcport)) 297 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); 303 298 else 304 - bfa_sm_set_state(pport, bfa_pport_sm_disabling_qwait); 299 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); 305 300 306 - bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, 301 + bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 307 302 BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); 308 - bfa_pport_aen_post(pport, BFA_PORT_AEN_DISABLE); 303 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); 309 304 break; 310 305 311 - case BFA_PPORT_SM_STOP: 312 - bfa_sm_set_state(pport, bfa_pport_sm_stopped); 306 + case BFA_FCPORT_SM_STOP: 307 + bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); 313 308 break; 314 309 315 - case BFA_PPORT_SM_HWFAIL: 316 - bfa_sm_set_state(pport, bfa_pport_sm_iocdown); 310 + case BFA_FCPORT_SM_HWFAIL: 311 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); 317 312 break; 318 313 319 314 default: 320 - bfa_sm_fault(pport->bfa, event); 315 + bfa_sm_fault(fcport->bfa, event); 321 316 } 322 317 } 323 318 324 319 static void 325 - bfa_pport_sm_linkdown(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 320 + bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, 321 + enum bfa_fcport_sm_event event) 326 322 { 327 - bfa_trc(pport->bfa, event); 323 + bfa_trc(fcport->bfa, event); 328 324 329 325 switch (event) { 330 - case BFA_PPORT_SM_LINKUP: 331 - bfa_pport_update_linkinfo(pport); 332 - bfa_sm_set_state(pport, bfa_pport_sm_linkup); 333 - bfa_assert(pport->event_cbfn); 334 - bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, 326 + case BFA_FCPORT_SM_LINKUP: 327 + bfa_fcport_update_linkinfo(fcport); 328 + bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); 329 + bfa_assert(fcport->event_cbfn); 330 + bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 335 331 BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkup"); 336 - bfa_pport_callback(pport, BFA_PPORT_LINKUP); 337 - bfa_pport_aen_post(pport, BFA_PORT_AEN_ONLINE); 332 + bfa_fcport_callback(fcport, BFA_PPORT_LINKUP); 333 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ONLINE); 338 334 /** 339 335 * If QoS is enabled and it is not online, 340 336 * Send a separate event. 341 337 */ 342 - if ((pport->cfg.qos_enabled) 343 - && (bfa_os_ntohl(pport->qos_attr.state) != BFA_QOS_ONLINE)) 344 - bfa_pport_aen_post(pport, BFA_PORT_AEN_QOS_NEG); 338 + if ((fcport->cfg.qos_enabled) 339 + && (bfa_os_ntohl(fcport->qos_attr.state) != BFA_QOS_ONLINE)) 340 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_QOS_NEG); 345 341 346 342 break; 347 343 348 - case BFA_PPORT_SM_LINKDOWN: 344 + case BFA_FCPORT_SM_LINKDOWN: 349 345 /** 350 346 * Possible to get link down event. 351 347 */ 352 348 break; 353 349 354 - case BFA_PPORT_SM_ENABLE: 350 + case BFA_FCPORT_SM_ENABLE: 355 351 /** 356 352 * Already enabled. 357 353 */ 358 354 break; 359 355 360 - case BFA_PPORT_SM_DISABLE: 361 - if (bfa_pport_send_disable(pport)) 362 - bfa_sm_set_state(pport, bfa_pport_sm_disabling); 356 + case BFA_FCPORT_SM_DISABLE: 357 + if (bfa_fcport_send_disable(fcport)) 358 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); 363 359 else 364 - bfa_sm_set_state(pport, bfa_pport_sm_disabling_qwait); 360 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); 365 361 366 - bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, 362 + bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 367 363 BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); 368 - bfa_pport_aen_post(pport, BFA_PORT_AEN_DISABLE); 364 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); 369 365 break; 370 366 371 - case BFA_PPORT_SM_STOP: 372 - bfa_sm_set_state(pport, bfa_pport_sm_stopped); 367 + case BFA_FCPORT_SM_STOP: 368 + bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); 373 369 break; 374 370 375 - case BFA_PPORT_SM_HWFAIL: 376 - bfa_sm_set_state(pport, bfa_pport_sm_iocdown); 371 + case BFA_FCPORT_SM_HWFAIL: 372 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); 377 373 break; 378 374 379 375 default: 380 - bfa_sm_fault(pport->bfa, event); 376 + bfa_sm_fault(fcport->bfa, event); 381 377 } 382 378 } 383 379 384 380 static void 385 - bfa_pport_sm_linkup(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 381 + bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport, 382 + enum bfa_fcport_sm_event event) 386 383 { 387 - bfa_trc(pport->bfa, event); 384 + bfa_trc(fcport->bfa, event); 388 385 389 386 switch (event) { 390 - case BFA_PPORT_SM_ENABLE: 387 + case BFA_FCPORT_SM_ENABLE: 391 388 /** 392 389 * Already enabled. 393 390 */ 394 391 break; 395 392 396 - case BFA_PPORT_SM_DISABLE: 397 - if (bfa_pport_send_disable(pport)) 398 - bfa_sm_set_state(pport, bfa_pport_sm_disabling); 393 + case BFA_FCPORT_SM_DISABLE: 394 + if (bfa_fcport_send_disable(fcport)) 395 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); 399 396 else 400 - bfa_sm_set_state(pport, bfa_pport_sm_disabling_qwait); 397 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); 401 398 402 - bfa_pport_reset_linkinfo(pport); 403 - bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); 404 - bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, 399 + bfa_fcport_reset_linkinfo(fcport); 400 + bfa_fcport_callback(fcport, BFA_PPORT_LINKDOWN); 401 + bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 405 402 BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); 406 - bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); 407 - bfa_pport_aen_post(pport, BFA_PORT_AEN_DISABLE); 403 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); 404 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); 408 405 break; 409 406 410 - case BFA_PPORT_SM_LINKDOWN: 411 - bfa_sm_set_state(pport, bfa_pport_sm_linkdown); 412 - bfa_pport_reset_linkinfo(pport); 413 - bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); 414 - bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, 407 + case BFA_FCPORT_SM_LINKDOWN: 408 + bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); 409 + bfa_fcport_reset_linkinfo(fcport); 410 + bfa_fcport_callback(fcport, BFA_PPORT_LINKDOWN); 411 + bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 415 412 BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkdown"); 416 - if (BFA_PORT_IS_DISABLED(pport->bfa)) 417 - bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); 413 + if (BFA_PORT_IS_DISABLED(fcport->bfa)) 414 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); 418 415 else 419 - bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); 416 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); 420 417 break; 421 418 422 - case BFA_PPORT_SM_STOP: 423 - bfa_sm_set_state(pport, bfa_pport_sm_stopped); 424 - bfa_pport_reset_linkinfo(pport); 425 - if (BFA_PORT_IS_DISABLED(pport->bfa)) 426 - bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); 419 + case BFA_FCPORT_SM_STOP: 420 + bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); 421 + bfa_fcport_reset_linkinfo(fcport); 422 + if (BFA_PORT_IS_DISABLED(fcport->bfa)) 423 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); 427 424 else 428 - bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); 425 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); 429 426 break; 430 427 431 - case BFA_PPORT_SM_HWFAIL: 432 - bfa_sm_set_state(pport, bfa_pport_sm_iocdown); 433 - bfa_pport_reset_linkinfo(pport); 434 - bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); 435 - if (BFA_PORT_IS_DISABLED(pport->bfa)) 436 - bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); 428 + case BFA_FCPORT_SM_HWFAIL: 429 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); 430 + bfa_fcport_reset_linkinfo(fcport); 431 + bfa_fcport_callback(fcport, BFA_PPORT_LINKDOWN); 432 + if (BFA_PORT_IS_DISABLED(fcport->bfa)) 433 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); 437 434 else 438 - bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); 435 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); 439 436 break; 440 437 441 438 default: 442 - bfa_sm_fault(pport->bfa, event); 439 + bfa_sm_fault(fcport->bfa, event); 443 440 } 444 441 } 445 442 446 443 static void 447 - bfa_pport_sm_disabling_qwait(struct bfa_pport_s *pport, 448 - enum bfa_pport_sm_event event) 444 + bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport, 445 + enum bfa_fcport_sm_event event) 449 446 { 450 - bfa_trc(pport->bfa, event); 447 + bfa_trc(fcport->bfa, event); 451 448 452 449 switch (event) { 453 - case BFA_PPORT_SM_QRESUME: 454 - bfa_sm_set_state(pport, bfa_pport_sm_disabling); 455 - bfa_pport_send_disable(pport); 450 + case BFA_FCPORT_SM_QRESUME: 451 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); 452 + bfa_fcport_send_disable(fcport); 456 453 break; 457 454 458 - case BFA_PPORT_SM_STOP: 459 - bfa_sm_set_state(pport, bfa_pport_sm_stopped); 460 - bfa_reqq_wcancel(&pport->reqq_wait); 455 + case BFA_FCPORT_SM_STOP: 456 + bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); 457 + bfa_reqq_wcancel(&fcport->reqq_wait); 461 458 break; 462 459 463 - case BFA_PPORT_SM_DISABLE: 460 + case BFA_FCPORT_SM_DISABLE: 464 461 /** 465 462 * Already being disabled. 466 463 */ 467 464 break; 468 465 469 - case BFA_PPORT_SM_LINKUP: 470 - case BFA_PPORT_SM_LINKDOWN: 466 + case BFA_FCPORT_SM_LINKUP: 467 + case BFA_FCPORT_SM_LINKDOWN: 471 468 /** 472 469 * Possible to get link events when doing back-to-back 473 470 * enable/disables. 474 471 */ 475 472 break; 476 473 477 - case BFA_PPORT_SM_HWFAIL: 478 - bfa_sm_set_state(pport, bfa_pport_sm_iocfail); 479 - bfa_reqq_wcancel(&pport->reqq_wait); 474 + case BFA_FCPORT_SM_HWFAIL: 475 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); 476 + bfa_reqq_wcancel(&fcport->reqq_wait); 480 477 break; 481 478 482 479 default: 483 - bfa_sm_fault(pport->bfa, event); 480 + bfa_sm_fault(fcport->bfa, event); 484 481 } 485 482 } 486 483 487 484 static void 488 - bfa_pport_sm_disabling(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 485 + bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport, 486 + enum bfa_fcport_sm_event event) 489 487 { 490 - bfa_trc(pport->bfa, event); 488 + bfa_trc(fcport->bfa, event); 491 489 492 490 switch (event) { 493 - case BFA_PPORT_SM_FWRSP: 494 - bfa_sm_set_state(pport, bfa_pport_sm_disabled); 491 + case BFA_FCPORT_SM_FWRSP: 492 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); 495 493 break; 496 494 497 - case BFA_PPORT_SM_DISABLE: 495 + case BFA_FCPORT_SM_DISABLE: 498 496 /** 499 497 * Already being disabled. 500 498 */ 501 499 break; 502 500 503 - case BFA_PPORT_SM_ENABLE: 504 - if (bfa_pport_send_enable(pport)) 505 - bfa_sm_set_state(pport, bfa_pport_sm_enabling); 501 + case BFA_FCPORT_SM_ENABLE: 502 + if (bfa_fcport_send_enable(fcport)) 503 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); 506 504 else 507 - bfa_sm_set_state(pport, bfa_pport_sm_enabling_qwait); 505 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling_qwait); 508 506 509 - bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, 507 + bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 510 508 BFA_PL_EID_PORT_ENABLE, 0, "Port Enable"); 511 - bfa_pport_aen_post(pport, BFA_PORT_AEN_ENABLE); 509 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); 512 510 break; 513 511 514 - case BFA_PPORT_SM_STOP: 515 - bfa_sm_set_state(pport, bfa_pport_sm_stopped); 512 + case BFA_FCPORT_SM_STOP: 513 + bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); 516 514 break; 517 515 518 - case BFA_PPORT_SM_LINKUP: 519 - case BFA_PPORT_SM_LINKDOWN: 516 + case BFA_FCPORT_SM_LINKUP: 517 + case BFA_FCPORT_SM_LINKDOWN: 520 518 /** 521 519 * Possible to get link events when doing back-to-back 522 520 * enable/disables. 523 521 */ 524 522 break; 525 523 526 - case BFA_PPORT_SM_HWFAIL: 527 - bfa_sm_set_state(pport, bfa_pport_sm_iocfail); 524 + case BFA_FCPORT_SM_HWFAIL: 525 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); 528 526 break; 529 527 530 528 default: 531 - bfa_sm_fault(pport->bfa, event); 529 + bfa_sm_fault(fcport->bfa, event); 532 530 } 533 531 } 534 532 535 533 static void 536 - bfa_pport_sm_disabled(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 534 + bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport, 535 + enum bfa_fcport_sm_event event) 537 536 { 538 - bfa_trc(pport->bfa, event); 537 + bfa_trc(fcport->bfa, event); 539 538 540 539 switch (event) { 541 - case BFA_PPORT_SM_START: 540 + case BFA_FCPORT_SM_START: 542 541 /** 543 542 * Ignore start event for a port that is disabled. 544 543 */ 545 544 break; 546 545 547 - case BFA_PPORT_SM_STOP: 548 - bfa_sm_set_state(pport, bfa_pport_sm_stopped); 546 + case BFA_FCPORT_SM_STOP: 547 + bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); 549 548 break; 550 549 551 - case BFA_PPORT_SM_ENABLE: 552 - if (bfa_pport_send_enable(pport)) 553 - bfa_sm_set_state(pport, bfa_pport_sm_enabling); 550 + case BFA_FCPORT_SM_ENABLE: 551 + if (bfa_fcport_send_enable(fcport)) 552 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); 554 553 else 555 - bfa_sm_set_state(pport, bfa_pport_sm_enabling_qwait); 554 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling_qwait); 556 555 557 - bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, 556 + bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 558 557 BFA_PL_EID_PORT_ENABLE, 0, "Port Enable"); 559 - bfa_pport_aen_post(pport, BFA_PORT_AEN_ENABLE); 558 + bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); 560 559 break; 561 560 562 - case BFA_PPORT_SM_DISABLE: 561 + case BFA_FCPORT_SM_DISABLE: 563 562 /** 564 563 * Already disabled. 565 564 */ 566 565 break; 567 566 568 - case BFA_PPORT_SM_HWFAIL: 569 - bfa_sm_set_state(pport, bfa_pport_sm_iocfail); 567 + case BFA_FCPORT_SM_HWFAIL: 568 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); 570 569 break; 571 570 572 571 default: 573 - bfa_sm_fault(pport->bfa, event); 572 + bfa_sm_fault(fcport->bfa, event); 574 573 } 575 574 } 576 575 577 576 static void 578 - bfa_pport_sm_stopped(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 577 + bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport, 578 + enum bfa_fcport_sm_event event) 579 579 { 580 - bfa_trc(pport->bfa, event); 580 + bfa_trc(fcport->bfa, event); 581 581 582 582 switch (event) { 583 - case BFA_PPORT_SM_START: 584 - if (bfa_pport_send_enable(pport)) 585 - bfa_sm_set_state(pport, bfa_pport_sm_enabling); 583 + case BFA_FCPORT_SM_START: 584 + if (bfa_fcport_send_enable(fcport)) 585 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); 586 586 else 587 - bfa_sm_set_state(pport, bfa_pport_sm_enabling_qwait); 587 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling_qwait); 588 588 break; 589 589 590 590 default: ··· 605 593 * Port is enabled. IOC is down/failed. 606 594 */ 607 595 static void 608 - bfa_pport_sm_iocdown(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 596 + bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport, 597 + enum bfa_fcport_sm_event event) 609 598 { 610 - bfa_trc(pport->bfa, event); 599 + bfa_trc(fcport->bfa, event); 611 600 612 601 switch (event) { 613 - case BFA_PPORT_SM_START: 614 - if (bfa_pport_send_enable(pport)) 615 - bfa_sm_set_state(pport, bfa_pport_sm_enabling); 602 + case BFA_FCPORT_SM_START: 603 + if (bfa_fcport_send_enable(fcport)) 604 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); 616 605 else 617 - bfa_sm_set_state(pport, bfa_pport_sm_enabling_qwait); 606 + bfa_sm_set_state(fcport, bfa_fcport_sm_enabling_qwait); 618 607 break; 619 608 620 609 default: ··· 630 617 * Port is disabled. IOC is down/failed. 631 618 */ 632 619 static void 633 - bfa_pport_sm_iocfail(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) 620 + bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport, 621 + enum bfa_fcport_sm_event event) 634 622 { 635 - bfa_trc(pport->bfa, event); 623 + bfa_trc(fcport->bfa, event); 636 624 637 625 switch (event) { 638 - case BFA_PPORT_SM_START: 639 - bfa_sm_set_state(pport, bfa_pport_sm_disabled); 626 + case BFA_FCPORT_SM_START: 627 + bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); 640 628 break; 641 629 642 - case BFA_PPORT_SM_ENABLE: 643 - bfa_sm_set_state(pport, bfa_pport_sm_iocdown); 630 + case BFA_FCPORT_SM_ENABLE: 631 + bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); 644 632 break; 645 633 646 634 default: ··· 656 642 * Link state is down 657 643 */ 658 644 static void 659 - bfa_pport_ln_sm_dn(struct bfa_pport_ln_s *ln, 660 - enum bfa_pport_ln_sm_event event) 645 + bfa_fcport_ln_sm_dn(struct bfa_fcport_ln_s *ln, 646 + enum bfa_fcport_ln_sm_event event) 661 647 { 662 - bfa_trc(ln->pport->bfa, event); 648 + bfa_trc(ln->fcport->bfa, event); 663 649 664 650 switch (event) { 665 - case BFA_PPORT_LN_SM_LINKUP: 666 - bfa_sm_set_state(ln, bfa_pport_ln_sm_up_nf); 667 - bfa_pport_queue_cb(ln, BFA_PPORT_LINKUP); 651 + case BFA_FCPORT_LN_SM_LINKUP: 652 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_up_nf); 653 + bfa_fcport_queue_cb(ln, BFA_PPORT_LINKUP); 668 654 break; 669 655 670 656 default: 671 - bfa_sm_fault(ln->pport->bfa, event); 657 + bfa_sm_fault(ln->fcport->bfa, event); 672 658 } 673 659 } 674 660 ··· 676 662 * Link state is waiting for down notification 677 663 */ 678 664 static void 679 - bfa_pport_ln_sm_dn_nf(struct bfa_pport_ln_s *ln, 680 - enum bfa_pport_ln_sm_event event) 665 + bfa_fcport_ln_sm_dn_nf(struct bfa_fcport_ln_s *ln, 666 + enum bfa_fcport_ln_sm_event event) 681 667 { 682 - bfa_trc(ln->pport->bfa, event); 668 + bfa_trc(ln->fcport->bfa, event); 683 669 684 670 switch (event) { 685 - case BFA_PPORT_LN_SM_LINKUP: 686 - bfa_sm_set_state(ln, bfa_pport_ln_sm_dn_up_nf); 671 + case BFA_FCPORT_LN_SM_LINKUP: 672 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn_up_nf); 687 673 break; 688 674 689 - case BFA_PPORT_LN_SM_NOTIFICATION: 690 - bfa_sm_set_state(ln, bfa_pport_ln_sm_dn); 675 + case BFA_FCPORT_LN_SM_NOTIFICATION: 676 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn); 691 677 break; 692 678 693 679 default: 694 - bfa_sm_fault(ln->pport->bfa, event); 680 + bfa_sm_fault(ln->fcport->bfa, event); 695 681 } 696 682 } 697 683 ··· 699 685 * Link state is waiting for down notification and there is a pending up 700 686 */ 701 687 static void 702 - bfa_pport_ln_sm_dn_up_nf(struct bfa_pport_ln_s *ln, 703 - enum bfa_pport_ln_sm_event event) 688 + bfa_fcport_ln_sm_dn_up_nf(struct bfa_fcport_ln_s *ln, 689 + enum bfa_fcport_ln_sm_event event) 704 690 { 705 - bfa_trc(ln->pport->bfa, event); 691 + bfa_trc(ln->fcport->bfa, event); 706 692 707 693 switch (event) { 708 - case BFA_PPORT_LN_SM_LINKDOWN: 709 - bfa_sm_set_state(ln, bfa_pport_ln_sm_dn_nf); 694 + case BFA_FCPORT_LN_SM_LINKDOWN: 695 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn_nf); 710 696 break; 711 697 712 - case BFA_PPORT_LN_SM_NOTIFICATION: 713 - bfa_sm_set_state(ln, bfa_pport_ln_sm_up_nf); 714 - bfa_pport_queue_cb(ln, BFA_PPORT_LINKUP); 698 + case BFA_FCPORT_LN_SM_NOTIFICATION: 699 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_up_nf); 700 + bfa_fcport_queue_cb(ln, BFA_PPORT_LINKUP); 715 701 break; 716 702 717 703 default: 718 - bfa_sm_fault(ln->pport->bfa, event); 704 + bfa_sm_fault(ln->fcport->bfa, event); 719 705 } 720 706 } 721 707 ··· 723 709 * Link state is up 724 710 */ 725 711 static void 726 - bfa_pport_ln_sm_up(struct bfa_pport_ln_s *ln, 727 - enum bfa_pport_ln_sm_event event) 712 + bfa_fcport_ln_sm_up(struct bfa_fcport_ln_s *ln, 713 + enum bfa_fcport_ln_sm_event event) 728 714 { 729 - bfa_trc(ln->pport->bfa, event); 715 + bfa_trc(ln->fcport->bfa, event); 730 716 731 717 switch (event) { 732 - case BFA_PPORT_LN_SM_LINKDOWN: 733 - bfa_sm_set_state(ln, bfa_pport_ln_sm_dn_nf); 734 - bfa_pport_queue_cb(ln, BFA_PPORT_LINKDOWN); 718 + case BFA_FCPORT_LN_SM_LINKDOWN: 719 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn_nf); 720 + bfa_fcport_queue_cb(ln, BFA_PPORT_LINKDOWN); 735 721 break; 736 722 737 723 default: 738 - bfa_sm_fault(ln->pport->bfa, event); 724 + bfa_sm_fault(ln->fcport->bfa, event); 739 725 } 740 726 } 741 727 ··· 743 729 * Link state is waiting for up notification 744 730 */ 745 731 static void 746 - bfa_pport_ln_sm_up_nf(struct bfa_pport_ln_s *ln, 747 - enum bfa_pport_ln_sm_event event) 732 + bfa_fcport_ln_sm_up_nf(struct bfa_fcport_ln_s *ln, 733 + enum bfa_fcport_ln_sm_event event) 748 734 { 749 - bfa_trc(ln->pport->bfa, event); 735 + bfa_trc(ln->fcport->bfa, event); 750 736 751 737 switch (event) { 752 - case BFA_PPORT_LN_SM_LINKDOWN: 753 - bfa_sm_set_state(ln, bfa_pport_ln_sm_up_dn_nf); 738 + case BFA_FCPORT_LN_SM_LINKDOWN: 739 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_up_dn_nf); 754 740 break; 755 741 756 - case BFA_PPORT_LN_SM_NOTIFICATION: 757 - bfa_sm_set_state(ln, bfa_pport_ln_sm_up); 742 + case BFA_FCPORT_LN_SM_NOTIFICATION: 743 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_up); 758 744 break; 759 745 760 746 default: 761 - bfa_sm_fault(ln->pport->bfa, event); 747 + bfa_sm_fault(ln->fcport->bfa, event); 762 748 } 763 749 } 764 750 ··· 766 752 * Link state is waiting for up notification and there is a pending down 767 753 */ 768 754 static void 769 - bfa_pport_ln_sm_up_dn_nf(struct bfa_pport_ln_s *ln, 770 - enum bfa_pport_ln_sm_event event) 755 + bfa_fcport_ln_sm_up_dn_nf(struct bfa_fcport_ln_s *ln, 756 + enum bfa_fcport_ln_sm_event event) 771 757 { 772 - bfa_trc(ln->pport->bfa, event); 758 + bfa_trc(ln->fcport->bfa, event); 773 759 774 760 switch (event) { 775 - case BFA_PPORT_LN_SM_LINKUP: 776 - bfa_sm_set_state(ln, bfa_pport_ln_sm_up_dn_up_nf); 761 + case BFA_FCPORT_LN_SM_LINKUP: 762 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_up_dn_up_nf); 777 763 break; 778 764 779 - case BFA_PPORT_LN_SM_NOTIFICATION: 780 - bfa_sm_set_state(ln, bfa_pport_ln_sm_dn_nf); 781 - bfa_pport_queue_cb(ln, BFA_PPORT_LINKDOWN); 765 + case BFA_FCPORT_LN_SM_NOTIFICATION: 766 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn_nf); 767 + bfa_fcport_queue_cb(ln, BFA_PPORT_LINKDOWN); 782 768 break; 783 769 784 770 default: 785 - bfa_sm_fault(ln->pport->bfa, event); 771 + bfa_sm_fault(ln->fcport->bfa, event); 786 772 } 787 773 } 788 774 ··· 790 776 * Link state is waiting for up notification and there are pending down and up 791 777 */ 792 778 static void 793 - bfa_pport_ln_sm_up_dn_up_nf(struct bfa_pport_ln_s *ln, 794 - enum bfa_pport_ln_sm_event event) 779 + bfa_fcport_ln_sm_up_dn_up_nf(struct bfa_fcport_ln_s *ln, 780 + enum bfa_fcport_ln_sm_event event) 795 781 { 796 - bfa_trc(ln->pport->bfa, event); 782 + bfa_trc(ln->fcport->bfa, event); 797 783 798 784 switch (event) { 799 - case BFA_PPORT_LN_SM_LINKDOWN: 800 - bfa_sm_set_state(ln, bfa_pport_ln_sm_up_dn_nf); 785 + case BFA_FCPORT_LN_SM_LINKDOWN: 786 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_up_dn_nf); 801 787 break; 802 788 803 - case BFA_PPORT_LN_SM_NOTIFICATION: 804 - bfa_sm_set_state(ln, bfa_pport_ln_sm_dn_up_nf); 805 - bfa_pport_queue_cb(ln, BFA_PPORT_LINKDOWN); 789 + case BFA_FCPORT_LN_SM_NOTIFICATION: 790 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn_up_nf); 791 + bfa_fcport_queue_cb(ln, BFA_PPORT_LINKDOWN); 806 792 break; 807 793 808 794 default: 809 - bfa_sm_fault(ln->pport->bfa, event); 795 + bfa_sm_fault(ln->fcport->bfa, event); 810 796 } 811 797 } 812 798 ··· 815 801 */ 816 802 817 803 static void 818 - __bfa_cb_port_event(void *cbarg, bfa_boolean_t complete) 804 + __bfa_cb_fcport_event(void *cbarg, bfa_boolean_t complete) 819 805 { 820 - struct bfa_pport_ln_s *ln = cbarg; 806 + struct bfa_fcport_ln_s *ln = cbarg; 821 807 822 808 if (complete) 823 - ln->pport->event_cbfn(ln->pport->event_cbarg, ln->ln_event); 809 + ln->fcport->event_cbfn(ln->fcport->event_cbarg, ln->ln_event); 824 810 else 825 - bfa_sm_send_event(ln, BFA_PPORT_LN_SM_NOTIFICATION); 811 + bfa_sm_send_event(ln, BFA_FCPORT_LN_SM_NOTIFICATION); 826 812 } 827 813 828 - #define PPORT_STATS_DMA_SZ (BFA_ROUNDUP(sizeof(union bfa_pport_stats_u), \ 814 + #define PPORT_STATS_DMA_SZ (BFA_ROUNDUP(sizeof(union bfa_fcport_stats_u), \ 815 + BFA_CACHELINE_SZ)) 816 + 817 + #define FCPORT_STATS_DMA_SZ (BFA_ROUNDUP(sizeof(union bfa_fcport_stats_u), \ 829 818 BFA_CACHELINE_SZ)) 830 819 831 820 static void 832 - bfa_pport_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *ndm_len, 821 + bfa_fcport_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *ndm_len, 833 822 u32 *dm_len) 834 823 { 824 + *dm_len += PPORT_STATS_DMA_SZ; 835 825 *dm_len += PPORT_STATS_DMA_SZ; 836 826 } 837 827 838 828 static void 839 - bfa_pport_qresume(void *cbarg) 829 + bfa_fcport_qresume(void *cbarg) 840 830 { 841 - struct bfa_pport_s *port = cbarg; 831 + struct bfa_fcport_s *port = cbarg; 842 832 843 - bfa_sm_send_event(port, BFA_PPORT_SM_QRESUME); 833 + bfa_sm_send_event(port, BFA_FCPORT_SM_QRESUME); 844 834 } 845 835 846 836 static void 847 - bfa_pport_mem_claim(struct bfa_pport_s *pport, struct bfa_meminfo_s *meminfo) 837 + bfa_fcport_mem_claim(struct bfa_fcport_s *fcport, struct bfa_meminfo_s *meminfo) 848 838 { 849 839 u8 *dm_kva; 850 840 u64 dm_pa; ··· 856 838 dm_kva = bfa_meminfo_dma_virt(meminfo); 857 839 dm_pa = bfa_meminfo_dma_phys(meminfo); 858 840 859 - pport->stats_kva = dm_kva; 860 - pport->stats_pa = dm_pa; 861 - pport->stats = (union bfa_pport_stats_u *)dm_kva; 841 + fcport->stats_kva = dm_kva; 842 + fcport->stats_pa = dm_pa; 843 + fcport->stats = (union bfa_pport_stats_u *)dm_kva; 862 844 863 845 dm_kva += PPORT_STATS_DMA_SZ; 864 846 dm_pa += PPORT_STATS_DMA_SZ; 847 + 848 + /* FC port stats */ 849 + 850 + fcport->fcport_stats_kva = dm_kva; 851 + fcport->fcport_stats_pa = dm_pa; 852 + fcport->fcport_stats = (union bfa_fcport_stats_u *) dm_kva; 853 + 854 + dm_kva += FCPORT_STATS_DMA_SZ; 855 + dm_pa += FCPORT_STATS_DMA_SZ; 865 856 866 857 bfa_meminfo_dma_virt(meminfo) = dm_kva; 867 858 bfa_meminfo_dma_phys(meminfo) = dm_pa; ··· 880 853 * Memory initialization. 881 854 */ 882 855 static void 883 - bfa_pport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, 856 + bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, 884 857 struct bfa_meminfo_s *meminfo, struct bfa_pcidev_s *pcidev) 885 858 { 886 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 887 - struct bfa_pport_cfg_s *port_cfg = &pport->cfg; 888 - struct bfa_pport_ln_s *ln = &pport->ln; 859 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 860 + struct bfa_pport_cfg_s *port_cfg = &fcport->cfg; 861 + struct bfa_fcport_ln_s *ln = &fcport->ln; 889 862 890 - bfa_os_memset(pport, 0, sizeof(struct bfa_pport_s)); 891 - pport->bfa = bfa; 892 - ln->pport = pport; 863 + bfa_os_memset(fcport, 0, sizeof(struct bfa_fcport_s)); 864 + fcport->bfa = bfa; 865 + ln->fcport = fcport; 893 866 894 - bfa_pport_mem_claim(pport, meminfo); 867 + bfa_fcport_mem_claim(fcport, meminfo); 895 868 896 - bfa_sm_set_state(pport, bfa_pport_sm_uninit); 897 - bfa_sm_set_state(ln, bfa_pport_ln_sm_dn); 869 + bfa_sm_set_state(fcport, bfa_fcport_sm_uninit); 870 + bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn); 898 871 899 872 /** 900 873 * initialize and set default configuration ··· 906 879 907 880 port_cfg->trl_def_speed = BFA_PPORT_SPEED_1GBPS; 908 881 909 - bfa_reqq_winit(&pport->reqq_wait, bfa_pport_qresume, pport); 882 + bfa_reqq_winit(&fcport->reqq_wait, bfa_fcport_qresume, fcport); 910 883 } 911 884 912 885 static void 913 - bfa_pport_initdone(struct bfa_s *bfa) 886 + bfa_fcport_initdone(struct bfa_s *bfa) 914 887 { 915 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 888 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 916 889 917 890 /** 918 891 * Initialize port attributes from IOC hardware data. 919 892 */ 920 - bfa_pport_set_wwns(pport); 921 - if (pport->cfg.maxfrsize == 0) 922 - pport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc); 923 - pport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); 924 - pport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); 893 + bfa_fcport_set_wwns(fcport); 894 + if (fcport->cfg.maxfrsize == 0) 895 + fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc); 896 + fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); 897 + fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); 925 898 926 - bfa_assert(pport->cfg.maxfrsize); 927 - bfa_assert(pport->cfg.rx_bbcredit); 928 - bfa_assert(pport->speed_sup); 899 + bfa_assert(fcport->cfg.maxfrsize); 900 + bfa_assert(fcport->cfg.rx_bbcredit); 901 + bfa_assert(fcport->speed_sup); 929 902 } 930 903 931 904 static void 932 - bfa_pport_detach(struct bfa_s *bfa) 905 + bfa_fcport_detach(struct bfa_s *bfa) 933 906 { 934 907 } 935 908 ··· 937 910 * Called when IOC is ready. 938 911 */ 939 912 static void 940 - bfa_pport_start(struct bfa_s *bfa) 913 + bfa_fcport_start(struct bfa_s *bfa) 941 914 { 942 - bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_START); 915 + bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_START); 943 916 } 944 917 945 918 /** 946 919 * Called before IOC is stopped. 947 920 */ 948 921 static void 949 - bfa_pport_stop(struct bfa_s *bfa) 922 + bfa_fcport_stop(struct bfa_s *bfa) 950 923 { 951 - bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_STOP); 924 + bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_STOP); 952 925 } 953 926 954 927 /** 955 928 * Called when IOC failure is detected. 956 929 */ 957 930 static void 958 - bfa_pport_iocdisable(struct bfa_s *bfa) 931 + bfa_fcport_iocdisable(struct bfa_s *bfa) 959 932 { 960 - bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_HWFAIL); 933 + bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_HWFAIL); 961 934 } 962 935 963 936 static void 964 - bfa_pport_update_linkinfo(struct bfa_pport_s *pport) 937 + bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport) 965 938 { 966 - struct bfi_pport_event_s *pevent = pport->event_arg.i2hmsg.event; 939 + struct bfi_pport_event_s *pevent = fcport->event_arg.i2hmsg.event; 967 940 968 - pport->speed = pevent->link_state.speed; 969 - pport->topology = pevent->link_state.topology; 941 + fcport->speed = pevent->link_state.speed; 942 + fcport->topology = pevent->link_state.topology; 970 943 971 - if (pport->topology == BFA_PPORT_TOPOLOGY_LOOP) 972 - pport->myalpa = pevent->link_state.tl.loop_info.myalpa; 944 + if (fcport->topology == BFA_PPORT_TOPOLOGY_LOOP) 945 + fcport->myalpa = 946 + pevent->link_state.tl.loop_info.myalpa; 973 947 974 948 /* 975 949 * QoS Details 976 950 */ 977 - bfa_os_assign(pport->qos_attr, pevent->link_state.qos_attr); 978 - bfa_os_assign(pport->qos_vc_attr, pevent->link_state.qos_vc_attr); 951 + bfa_os_assign(fcport->qos_attr, pevent->link_state.qos_attr); 952 + bfa_os_assign(fcport->qos_vc_attr, pevent->link_state.qos_vc_attr); 979 953 980 - bfa_trc(pport->bfa, pport->speed); 981 - bfa_trc(pport->bfa, pport->topology); 954 + bfa_trc(fcport->bfa, fcport->speed); 955 + bfa_trc(fcport->bfa, fcport->topology); 982 956 } 983 957 984 958 static void 985 - bfa_pport_reset_linkinfo(struct bfa_pport_s *pport) 959 + bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport) 986 960 { 987 - pport->speed = BFA_PPORT_SPEED_UNKNOWN; 988 - pport->topology = BFA_PPORT_TOPOLOGY_NONE; 961 + fcport->speed = BFA_PPORT_SPEED_UNKNOWN; 962 + fcport->topology = BFA_PPORT_TOPOLOGY_NONE; 989 963 } 990 964 991 965 /** 992 966 * Send port enable message to firmware. 993 967 */ 994 968 static bfa_boolean_t 995 - bfa_pport_send_enable(struct bfa_pport_s *port) 969 + bfa_fcport_send_enable(struct bfa_fcport_s *fcport) 996 970 { 997 971 struct bfi_pport_enable_req_s *m; 998 972 ··· 1001 973 * Increment message tag before queue check, so that responses to old 1002 974 * requests are discarded. 1003 975 */ 1004 - port->msgtag++; 976 + fcport->msgtag++; 1005 977 1006 978 /** 1007 979 * check for room in queue to send request now 1008 980 */ 1009 - m = bfa_reqq_next(port->bfa, BFA_REQQ_PORT); 981 + m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); 1010 982 if (!m) { 1011 - bfa_reqq_wait(port->bfa, BFA_REQQ_PORT, &port->reqq_wait); 983 + bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, 984 + &fcport->reqq_wait); 1012 985 return BFA_FALSE; 1013 986 } 1014 987 1015 988 bfi_h2i_set(m->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_ENABLE_REQ, 1016 - bfa_lpuid(port->bfa)); 1017 - m->nwwn = port->nwwn; 1018 - m->pwwn = port->pwwn; 1019 - m->port_cfg = port->cfg; 1020 - m->msgtag = port->msgtag; 1021 - m->port_cfg.maxfrsize = bfa_os_htons(port->cfg.maxfrsize); 1022 - bfa_dma_be_addr_set(m->stats_dma_addr, port->stats_pa); 1023 - bfa_trc(port->bfa, m->stats_dma_addr.a32.addr_lo); 1024 - bfa_trc(port->bfa, m->stats_dma_addr.a32.addr_hi); 989 + bfa_lpuid(fcport->bfa)); 990 + m->nwwn = fcport->nwwn; 991 + m->pwwn = fcport->pwwn; 992 + m->port_cfg = fcport->cfg; 993 + m->msgtag = fcport->msgtag; 994 + m->port_cfg.maxfrsize = bfa_os_htons(fcport->cfg.maxfrsize); 995 + bfa_dma_be_addr_set(m->stats_dma_addr, fcport->stats_pa); 996 + bfa_dma_be_addr_set(m->fcport_stats_dma_addr, fcport->fcport_stats_pa); 997 + bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo); 998 + bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi); 1025 999 1026 1000 /** 1027 1001 * queue I/O message to firmware 1028 1002 */ 1029 - bfa_reqq_produce(port->bfa, BFA_REQQ_PORT); 1003 + bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 1030 1004 return BFA_TRUE; 1031 1005 } 1032 1006 ··· 1036 1006 * Send port disable message to firmware. 1037 1007 */ 1038 1008 static bfa_boolean_t 1039 - bfa_pport_send_disable(struct bfa_pport_s *port) 1009 + bfa_fcport_send_disable(struct bfa_fcport_s *fcport) 1040 1010 { 1041 1011 bfi_pport_disable_req_t *m; 1042 1012 ··· 1044 1014 * Increment message tag before queue check, so that responses to old 1045 1015 * requests are discarded. 1046 1016 */ 1047 - port->msgtag++; 1017 + fcport->msgtag++; 1048 1018 1049 1019 /** 1050 1020 * check for room in queue to send request now 1051 1021 */ 1052 - m = bfa_reqq_next(port->bfa, BFA_REQQ_PORT); 1022 + m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); 1053 1023 if (!m) { 1054 - bfa_reqq_wait(port->bfa, BFA_REQQ_PORT, &port->reqq_wait); 1024 + bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, 1025 + &fcport->reqq_wait); 1055 1026 return BFA_FALSE; 1056 1027 } 1057 1028 1058 1029 bfi_h2i_set(m->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_DISABLE_REQ, 1059 - bfa_lpuid(port->bfa)); 1060 - m->msgtag = port->msgtag; 1030 + bfa_lpuid(fcport->bfa)); 1031 + m->msgtag = fcport->msgtag; 1061 1032 1062 1033 /** 1063 1034 * queue I/O message to firmware 1064 1035 */ 1065 - bfa_reqq_produce(port->bfa, BFA_REQQ_PORT); 1036 + bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 1066 1037 1067 1038 return BFA_TRUE; 1068 1039 } 1069 1040 1070 1041 static void 1071 - bfa_pport_set_wwns(struct bfa_pport_s *port) 1042 + bfa_fcport_set_wwns(struct bfa_fcport_s *fcport) 1072 1043 { 1073 - port->pwwn = bfa_ioc_get_pwwn(&port->bfa->ioc); 1074 - port->nwwn = bfa_ioc_get_nwwn(&port->bfa->ioc); 1044 + fcport->pwwn = bfa_ioc_get_pwwn(&fcport->bfa->ioc); 1045 + fcport->nwwn = bfa_ioc_get_nwwn(&fcport->bfa->ioc); 1075 1046 1076 - bfa_trc(port->bfa, port->pwwn); 1077 - bfa_trc(port->bfa, port->nwwn); 1047 + bfa_trc(fcport->bfa, fcport->pwwn); 1048 + bfa_trc(fcport->bfa, fcport->nwwn); 1078 1049 } 1079 1050 1080 1051 static void 1081 - bfa_port_send_txcredit(void *port_cbarg) 1052 + bfa_fcport_send_txcredit(void *port_cbarg) 1082 1053 { 1083 1054 1084 - struct bfa_pport_s *port = port_cbarg; 1055 + struct bfa_fcport_s *fcport = port_cbarg; 1085 1056 struct bfi_pport_set_svc_params_req_s *m; 1086 1057 1087 1058 /** 1088 1059 * check for room in queue to send request now 1089 1060 */ 1090 - m = bfa_reqq_next(port->bfa, BFA_REQQ_PORT); 1061 + m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); 1091 1062 if (!m) { 1092 - bfa_trc(port->bfa, port->cfg.tx_bbcredit); 1063 + bfa_trc(fcport->bfa, fcport->cfg.tx_bbcredit); 1093 1064 return; 1094 1065 } 1095 1066 1096 1067 bfi_h2i_set(m->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_SET_SVC_PARAMS_REQ, 1097 - bfa_lpuid(port->bfa)); 1098 - m->tx_bbcredit = bfa_os_htons((u16) port->cfg.tx_bbcredit); 1068 + bfa_lpuid(fcport->bfa)); 1069 + m->tx_bbcredit = bfa_os_htons((u16) fcport->cfg.tx_bbcredit); 1099 1070 1100 1071 /** 1101 1072 * queue I/O message to firmware 1102 1073 */ 1103 - bfa_reqq_produce(port->bfa, BFA_REQQ_PORT); 1074 + bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 1104 1075 } 1105 1076 1106 1077 ··· 1114 1083 * Firmware message handler. 1115 1084 */ 1116 1085 void 1117 - bfa_pport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg) 1086 + bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg) 1118 1087 { 1119 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1088 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1120 1089 union bfi_pport_i2h_msg_u i2hmsg; 1121 1090 1122 1091 i2hmsg.msg = msg; 1123 - pport->event_arg.i2hmsg = i2hmsg; 1092 + fcport->event_arg.i2hmsg = i2hmsg; 1124 1093 1125 1094 switch (msg->mhdr.msg_id) { 1126 1095 case BFI_PPORT_I2H_ENABLE_RSP: 1127 - if (pport->msgtag == i2hmsg.enable_rsp->msgtag) 1128 - bfa_sm_send_event(pport, BFA_PPORT_SM_FWRSP); 1096 + if (fcport->msgtag == i2hmsg.enable_rsp->msgtag) 1097 + bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); 1129 1098 break; 1130 1099 1131 1100 case BFI_PPORT_I2H_DISABLE_RSP: 1132 - if (pport->msgtag == i2hmsg.enable_rsp->msgtag) 1133 - bfa_sm_send_event(pport, BFA_PPORT_SM_FWRSP); 1101 + if (fcport->msgtag == i2hmsg.enable_rsp->msgtag) 1102 + bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); 1134 1103 break; 1135 1104 1136 1105 case BFI_PPORT_I2H_EVENT: 1137 1106 switch (i2hmsg.event->link_state.linkstate) { 1138 1107 case BFA_PPORT_LINKUP: 1139 - bfa_sm_send_event(pport, BFA_PPORT_SM_LINKUP); 1108 + bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP); 1140 1109 break; 1141 1110 case BFA_PPORT_LINKDOWN: 1142 - bfa_sm_send_event(pport, BFA_PPORT_SM_LINKDOWN); 1111 + bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKDOWN); 1143 1112 break; 1144 1113 case BFA_PPORT_TRUNK_LINKDOWN: 1145 1114 /** todo: event notification */ ··· 1152 1121 /* 1153 1122 * check for timer pop before processing the rsp 1154 1123 */ 1155 - if (pport->stats_busy == BFA_FALSE 1156 - || pport->stats_status == BFA_STATUS_ETIMER) 1124 + if (fcport->stats_busy == BFA_FALSE 1125 + || fcport->stats_status == BFA_STATUS_ETIMER) 1157 1126 break; 1158 1127 1159 - bfa_timer_stop(&pport->timer); 1160 - pport->stats_status = i2hmsg.getstats_rsp->status; 1161 - bfa_cb_queue(pport->bfa, &pport->hcb_qe, __bfa_cb_port_stats, 1162 - pport); 1128 + bfa_timer_stop(&fcport->timer); 1129 + fcport->stats_status = i2hmsg.getstats_rsp->status; 1130 + bfa_cb_queue(fcport->bfa, &fcport->hcb_qe, __bfa_cb_port_stats, 1131 + fcport); 1163 1132 break; 1164 1133 case BFI_PPORT_I2H_CLEAR_STATS_RSP: 1165 1134 case BFI_PPORT_I2H_CLEAR_QOS_STATS_RSP: 1166 1135 /* 1167 1136 * check for timer pop before processing the rsp 1168 1137 */ 1169 - if (pport->stats_busy == BFA_FALSE 1170 - || pport->stats_status == BFA_STATUS_ETIMER) 1138 + if (fcport->stats_busy == BFA_FALSE 1139 + || fcport->stats_status == BFA_STATUS_ETIMER) 1171 1140 break; 1172 1141 1173 - bfa_timer_stop(&pport->timer); 1174 - pport->stats_status = BFA_STATUS_OK; 1175 - bfa_cb_queue(pport->bfa, &pport->hcb_qe, 1176 - __bfa_cb_port_stats_clr, pport); 1142 + bfa_timer_stop(&fcport->timer); 1143 + fcport->stats_status = BFA_STATUS_OK; 1144 + bfa_cb_queue(fcport->bfa, &fcport->hcb_qe, 1145 + __bfa_cb_port_stats_clr, fcport); 1146 + break; 1147 + 1148 + case BFI_FCPORT_I2H_GET_STATS_RSP: 1149 + /* 1150 + * check for timer pop before processing the rsp 1151 + */ 1152 + if (fcport->stats_busy == BFA_FALSE || 1153 + fcport->stats_status == BFA_STATUS_ETIMER) { 1154 + break; 1155 + } 1156 + 1157 + bfa_timer_stop(&fcport->timer); 1158 + fcport->stats_status = i2hmsg.getstats_rsp->status; 1159 + bfa_cb_queue(fcport->bfa, &fcport->hcb_qe, 1160 + __bfa_cb_fcport_stats, fcport); 1161 + break; 1162 + 1163 + case BFI_FCPORT_I2H_CLEAR_STATS_RSP: 1164 + /* 1165 + * check for timer pop before processing the rsp 1166 + */ 1167 + if (fcport->stats_busy == BFA_FALSE || 1168 + fcport->stats_status == BFA_STATUS_ETIMER) { 1169 + break; 1170 + } 1171 + 1172 + bfa_timer_stop(&fcport->timer); 1173 + fcport->stats_status = BFA_STATUS_OK; 1174 + bfa_cb_queue(fcport->bfa, &fcport->hcb_qe, 1175 + __bfa_cb_fcport_stats_clr, fcport); 1177 1176 break; 1178 1177 1179 1178 default: 1180 1179 bfa_assert(0); 1180 + break; 1181 1181 } 1182 1182 } 1183 1183 ··· 1222 1160 * Registered callback for port events. 1223 1161 */ 1224 1162 void 1225 - bfa_pport_event_register(struct bfa_s *bfa, 1163 + bfa_fcport_event_register(struct bfa_s *bfa, 1226 1164 void (*cbfn) (void *cbarg, bfa_pport_event_t event), 1227 1165 void *cbarg) 1228 1166 { 1229 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1167 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1230 1168 1231 - pport->event_cbfn = cbfn; 1232 - pport->event_cbarg = cbarg; 1169 + fcport->event_cbfn = cbfn; 1170 + fcport->event_cbarg = cbarg; 1233 1171 } 1234 1172 1235 1173 bfa_status_t 1236 - bfa_pport_enable(struct bfa_s *bfa) 1174 + bfa_fcport_enable(struct bfa_s *bfa) 1237 1175 { 1238 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1176 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1239 1177 1240 - if (pport->diag_busy) 1178 + if (fcport->diag_busy) 1241 1179 return BFA_STATUS_DIAG_BUSY; 1242 1180 else if (bfa_sm_cmp_state 1243 - (BFA_PORT_MOD(bfa), bfa_pport_sm_disabling_qwait)) 1181 + (BFA_FCPORT_MOD(bfa), bfa_fcport_sm_disabling_qwait)) 1244 1182 return BFA_STATUS_DEVBUSY; 1245 1183 1246 - bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_ENABLE); 1184 + bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_ENABLE); 1247 1185 return BFA_STATUS_OK; 1248 1186 } 1249 1187 1250 1188 bfa_status_t 1251 - bfa_pport_disable(struct bfa_s *bfa) 1189 + bfa_fcport_disable(struct bfa_s *bfa) 1252 1190 { 1253 - bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_DISABLE); 1191 + bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DISABLE); 1254 1192 return BFA_STATUS_OK; 1255 1193 } 1256 1194 ··· 1258 1196 * Configure port speed. 1259 1197 */ 1260 1198 bfa_status_t 1261 - bfa_pport_cfg_speed(struct bfa_s *bfa, enum bfa_pport_speed speed) 1199 + bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_pport_speed speed) 1262 1200 { 1263 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1201 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1264 1202 1265 1203 bfa_trc(bfa, speed); 1266 1204 1267 - if ((speed != BFA_PPORT_SPEED_AUTO) && (speed > pport->speed_sup)) { 1268 - bfa_trc(bfa, pport->speed_sup); 1205 + if ((speed != BFA_PPORT_SPEED_AUTO) && (speed > fcport->speed_sup)) { 1206 + bfa_trc(bfa, fcport->speed_sup); 1269 1207 return BFA_STATUS_UNSUPP_SPEED; 1270 1208 } 1271 1209 1272 - pport->cfg.speed = speed; 1210 + fcport->cfg.speed = speed; 1273 1211 1274 1212 return BFA_STATUS_OK; 1275 1213 } ··· 1278 1216 * Get current speed. 1279 1217 */ 1280 1218 enum bfa_pport_speed 1281 - bfa_pport_get_speed(struct bfa_s *bfa) 1219 + bfa_fcport_get_speed(struct bfa_s *bfa) 1282 1220 { 1283 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1221 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1284 1222 1285 - return port->speed; 1223 + return fcport->speed; 1286 1224 } 1287 1225 1288 1226 /** 1289 1227 * Configure port topology. 1290 1228 */ 1291 1229 bfa_status_t 1292 - bfa_pport_cfg_topology(struct bfa_s *bfa, enum bfa_pport_topology topology) 1230 + bfa_fcport_cfg_topology(struct bfa_s *bfa, enum bfa_pport_topology topology) 1293 1231 { 1294 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1232 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1295 1233 1296 1234 bfa_trc(bfa, topology); 1297 - bfa_trc(bfa, pport->cfg.topology); 1235 + bfa_trc(bfa, fcport->cfg.topology); 1298 1236 1299 1237 switch (topology) { 1300 1238 case BFA_PPORT_TOPOLOGY_P2P: ··· 1306 1244 return BFA_STATUS_EINVAL; 1307 1245 } 1308 1246 1309 - pport->cfg.topology = topology; 1247 + fcport->cfg.topology = topology; 1310 1248 return BFA_STATUS_OK; 1311 1249 } 1312 1250 ··· 1314 1252 * Get current topology. 1315 1253 */ 1316 1254 enum bfa_pport_topology 1317 - bfa_pport_get_topology(struct bfa_s *bfa) 1255 + bfa_fcport_get_topology(struct bfa_s *bfa) 1318 1256 { 1319 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1257 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1320 1258 1321 - return port->topology; 1259 + return fcport->topology; 1322 1260 } 1323 1261 1324 1262 bfa_status_t 1325 - bfa_pport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa) 1263 + bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa) 1326 1264 { 1327 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1265 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1328 1266 1329 1267 bfa_trc(bfa, alpa); 1330 - bfa_trc(bfa, pport->cfg.cfg_hardalpa); 1331 - bfa_trc(bfa, pport->cfg.hardalpa); 1268 + bfa_trc(bfa, fcport->cfg.cfg_hardalpa); 1269 + bfa_trc(bfa, fcport->cfg.hardalpa); 1332 1270 1333 - pport->cfg.cfg_hardalpa = BFA_TRUE; 1334 - pport->cfg.hardalpa = alpa; 1271 + fcport->cfg.cfg_hardalpa = BFA_TRUE; 1272 + fcport->cfg.hardalpa = alpa; 1335 1273 1336 1274 return BFA_STATUS_OK; 1337 1275 } 1338 1276 1339 1277 bfa_status_t 1340 - bfa_pport_clr_hardalpa(struct bfa_s *bfa) 1278 + bfa_fcport_clr_hardalpa(struct bfa_s *bfa) 1341 1279 { 1342 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1280 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1343 1281 1344 - bfa_trc(bfa, pport->cfg.cfg_hardalpa); 1345 - bfa_trc(bfa, pport->cfg.hardalpa); 1282 + bfa_trc(bfa, fcport->cfg.cfg_hardalpa); 1283 + bfa_trc(bfa, fcport->cfg.hardalpa); 1346 1284 1347 - pport->cfg.cfg_hardalpa = BFA_FALSE; 1285 + fcport->cfg.cfg_hardalpa = BFA_FALSE; 1348 1286 return BFA_STATUS_OK; 1349 1287 } 1350 1288 1351 1289 bfa_boolean_t 1352 - bfa_pport_get_hardalpa(struct bfa_s *bfa, u8 *alpa) 1290 + bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa) 1353 1291 { 1354 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1292 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1355 1293 1356 - *alpa = port->cfg.hardalpa; 1357 - return port->cfg.cfg_hardalpa; 1294 + *alpa = fcport->cfg.hardalpa; 1295 + return fcport->cfg.cfg_hardalpa; 1358 1296 } 1359 1297 1360 1298 u8 1361 - bfa_pport_get_myalpa(struct bfa_s *bfa) 1299 + bfa_fcport_get_myalpa(struct bfa_s *bfa) 1362 1300 { 1363 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1301 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1364 1302 1365 - return port->myalpa; 1303 + return fcport->myalpa; 1366 1304 } 1367 1305 1368 1306 bfa_status_t 1369 - bfa_pport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxfrsize) 1307 + bfa_fcport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxfrsize) 1370 1308 { 1371 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1309 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1372 1310 1373 1311 bfa_trc(bfa, maxfrsize); 1374 - bfa_trc(bfa, pport->cfg.maxfrsize); 1312 + bfa_trc(bfa, fcport->cfg.maxfrsize); 1375 1313 1376 1314 /* 1377 1315 * with in range ··· 1385 1323 if ((maxfrsize != FC_MAX_PDUSZ) && (maxfrsize & (maxfrsize - 1))) 1386 1324 return BFA_STATUS_INVLD_DFSZ; 1387 1325 1388 - pport->cfg.maxfrsize = maxfrsize; 1326 + fcport->cfg.maxfrsize = maxfrsize; 1389 1327 return BFA_STATUS_OK; 1390 1328 } 1391 1329 1392 1330 u16 1393 - bfa_pport_get_maxfrsize(struct bfa_s *bfa) 1331 + bfa_fcport_get_maxfrsize(struct bfa_s *bfa) 1394 1332 { 1395 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1333 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1396 1334 1397 - return port->cfg.maxfrsize; 1335 + return fcport->cfg.maxfrsize; 1398 1336 } 1399 1337 1400 1338 u32 1401 - bfa_pport_mypid(struct bfa_s *bfa) 1339 + bfa_fcport_mypid(struct bfa_s *bfa) 1402 1340 { 1403 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1341 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1404 1342 1405 - return port->mypid; 1343 + return fcport->mypid; 1406 1344 } 1407 1345 1408 1346 u8 1409 - bfa_pport_get_rx_bbcredit(struct bfa_s *bfa) 1347 + bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa) 1410 1348 { 1411 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1349 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1412 1350 1413 - return port->cfg.rx_bbcredit; 1351 + return fcport->cfg.rx_bbcredit; 1414 1352 } 1415 1353 1416 1354 void 1417 - bfa_pport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit) 1355 + bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit) 1418 1356 { 1419 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1357 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1420 1358 1421 - port->cfg.tx_bbcredit = (u8) tx_bbcredit; 1422 - bfa_port_send_txcredit(port); 1359 + fcport->cfg.tx_bbcredit = (u8) tx_bbcredit; 1360 + bfa_fcport_send_txcredit(fcport); 1423 1361 } 1424 1362 1425 1363 /** ··· 1427 1365 */ 1428 1366 1429 1367 wwn_t 1430 - bfa_pport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node) 1368 + bfa_fcport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node) 1431 1369 { 1432 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1370 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1433 1371 if (node) 1434 - return pport->nwwn; 1372 + return fcport->nwwn; 1435 1373 else 1436 - return pport->pwwn; 1374 + return fcport->pwwn; 1437 1375 } 1438 1376 1439 1377 void 1440 - bfa_pport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr) 1378 + bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr) 1441 1379 { 1442 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1380 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1443 1381 1444 1382 bfa_os_memset(attr, 0, sizeof(struct bfa_pport_attr_s)); 1445 1383 1446 - attr->nwwn = pport->nwwn; 1447 - attr->pwwn = pport->pwwn; 1384 + attr->nwwn = fcport->nwwn; 1385 + attr->pwwn = fcport->pwwn; 1448 1386 1449 - bfa_os_memcpy(&attr->pport_cfg, &pport->cfg, 1387 + bfa_os_memcpy(&attr->pport_cfg, &fcport->cfg, 1450 1388 sizeof(struct bfa_pport_cfg_s)); 1451 1389 /* 1452 1390 * speed attributes 1453 1391 */ 1454 - attr->pport_cfg.speed = pport->cfg.speed; 1455 - attr->speed_supported = pport->speed_sup; 1456 - attr->speed = pport->speed; 1392 + attr->pport_cfg.speed = fcport->cfg.speed; 1393 + attr->speed_supported = fcport->speed_sup; 1394 + attr->speed = fcport->speed; 1457 1395 attr->cos_supported = FC_CLASS_3; 1458 1396 1459 1397 /* 1460 1398 * topology attributes 1461 1399 */ 1462 - attr->pport_cfg.topology = pport->cfg.topology; 1463 - attr->topology = pport->topology; 1400 + attr->pport_cfg.topology = fcport->cfg.topology; 1401 + attr->topology = fcport->topology; 1464 1402 1465 1403 /* 1466 1404 * beacon attributes 1467 1405 */ 1468 - attr->beacon = pport->beacon; 1469 - attr->link_e2e_beacon = pport->link_e2e_beacon; 1470 - attr->plog_enabled = bfa_plog_get_setting(pport->bfa->plog); 1406 + attr->beacon = fcport->beacon; 1407 + attr->link_e2e_beacon = fcport->link_e2e_beacon; 1408 + attr->plog_enabled = bfa_plog_get_setting(fcport->bfa->plog); 1471 1409 1472 1410 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); 1473 1411 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); 1474 - attr->port_state = bfa_sm_to_state(hal_pport_sm_table, pport->sm); 1475 - if (bfa_ioc_is_disabled(&pport->bfa->ioc)) 1412 + attr->port_state = bfa_sm_to_state(hal_pport_sm_table, fcport->sm); 1413 + if (bfa_ioc_is_disabled(&fcport->bfa->ioc)) 1476 1414 attr->port_state = BFA_PPORT_ST_IOCDIS; 1477 - else if (bfa_ioc_fw_mismatch(&pport->bfa->ioc)) 1415 + else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) 1478 1416 attr->port_state = BFA_PPORT_ST_FWMISMATCH; 1479 1417 } 1480 1418 1481 1419 static void 1482 1420 bfa_port_stats_query(void *cbarg) 1483 1421 { 1484 - struct bfa_pport_s *port = (struct bfa_pport_s *)cbarg; 1422 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; 1485 1423 bfi_pport_get_stats_req_t *msg; 1486 1424 1487 - msg = bfa_reqq_next(port->bfa, BFA_REQQ_PORT); 1425 + msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); 1488 1426 1489 1427 if (!msg) { 1490 - port->stats_qfull = BFA_TRUE; 1491 - bfa_reqq_winit(&port->stats_reqq_wait, bfa_port_stats_query, 1492 - port); 1493 - bfa_reqq_wait(port->bfa, BFA_REQQ_PORT, &port->stats_reqq_wait); 1428 + fcport->stats_qfull = BFA_TRUE; 1429 + bfa_reqq_winit(&fcport->stats_reqq_wait, bfa_port_stats_query, 1430 + fcport); 1431 + bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, 1432 + &fcport->stats_reqq_wait); 1494 1433 return; 1495 1434 } 1496 - port->stats_qfull = BFA_FALSE; 1435 + fcport->stats_qfull = BFA_FALSE; 1497 1436 1498 1437 bfa_os_memset(msg, 0, sizeof(bfi_pport_get_stats_req_t)); 1499 1438 bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_GET_STATS_REQ, 1500 - bfa_lpuid(port->bfa)); 1501 - bfa_reqq_produce(port->bfa, BFA_REQQ_PORT); 1439 + bfa_lpuid(fcport->bfa)); 1440 + bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 1502 1441 1503 1442 return; 1504 1443 } ··· 1507 1444 static void 1508 1445 bfa_port_stats_clear(void *cbarg) 1509 1446 { 1510 - struct bfa_pport_s *port = (struct bfa_pport_s *)cbarg; 1447 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; 1511 1448 bfi_pport_clear_stats_req_t *msg; 1512 1449 1513 - msg = bfa_reqq_next(port->bfa, BFA_REQQ_PORT); 1450 + msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); 1514 1451 1515 1452 if (!msg) { 1516 - port->stats_qfull = BFA_TRUE; 1517 - bfa_reqq_winit(&port->stats_reqq_wait, bfa_port_stats_clear, 1518 - port); 1519 - bfa_reqq_wait(port->bfa, BFA_REQQ_PORT, &port->stats_reqq_wait); 1453 + fcport->stats_qfull = BFA_TRUE; 1454 + bfa_reqq_winit(&fcport->stats_reqq_wait, bfa_port_stats_clear, 1455 + fcport); 1456 + bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, 1457 + &fcport->stats_reqq_wait); 1520 1458 return; 1521 1459 } 1522 - port->stats_qfull = BFA_FALSE; 1460 + fcport->stats_qfull = BFA_FALSE; 1523 1461 1524 1462 bfa_os_memset(msg, 0, sizeof(bfi_pport_clear_stats_req_t)); 1525 1463 bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_CLEAR_STATS_REQ, 1526 - bfa_lpuid(port->bfa)); 1527 - bfa_reqq_produce(port->bfa, BFA_REQQ_PORT); 1464 + bfa_lpuid(fcport->bfa)); 1465 + bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 1528 1466 return; 1467 + } 1468 + 1469 + static void 1470 + bfa_fcport_stats_query(void *cbarg) 1471 + { 1472 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; 1473 + bfi_pport_get_stats_req_t *msg; 1474 + 1475 + msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); 1476 + 1477 + if (!msg) { 1478 + fcport->stats_qfull = BFA_TRUE; 1479 + bfa_reqq_winit(&fcport->stats_reqq_wait, 1480 + bfa_fcport_stats_query, fcport); 1481 + bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, 1482 + &fcport->stats_reqq_wait); 1483 + return; 1484 + } 1485 + fcport->stats_qfull = BFA_FALSE; 1486 + 1487 + bfa_os_memset(msg, 0, sizeof(bfi_pport_get_stats_req_t)); 1488 + bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_FCPORT_H2I_GET_STATS_REQ, 1489 + bfa_lpuid(fcport->bfa)); 1490 + bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 1491 + } 1492 + 1493 + static void 1494 + bfa_fcport_stats_clear(void *cbarg) 1495 + { 1496 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; 1497 + bfi_pport_clear_stats_req_t *msg; 1498 + 1499 + msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); 1500 + 1501 + if (!msg) { 1502 + fcport->stats_qfull = BFA_TRUE; 1503 + bfa_reqq_winit(&fcport->stats_reqq_wait, 1504 + bfa_fcport_stats_clear, fcport); 1505 + bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, 1506 + &fcport->stats_reqq_wait); 1507 + return; 1508 + } 1509 + fcport->stats_qfull = BFA_FALSE; 1510 + 1511 + bfa_os_memset(msg, 0, sizeof(bfi_pport_clear_stats_req_t)); 1512 + bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_FCPORT_H2I_CLEAR_STATS_REQ, 1513 + bfa_lpuid(fcport->bfa)); 1514 + bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 1529 1515 } 1530 1516 1531 1517 static void 1532 1518 bfa_port_qos_stats_clear(void *cbarg) 1533 1519 { 1534 - struct bfa_pport_s *port = (struct bfa_pport_s *)cbarg; 1520 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; 1535 1521 bfi_pport_clear_qos_stats_req_t *msg; 1536 1522 1537 - msg = bfa_reqq_next(port->bfa, BFA_REQQ_PORT); 1523 + msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); 1538 1524 1539 1525 if (!msg) { 1540 - port->stats_qfull = BFA_TRUE; 1541 - bfa_reqq_winit(&port->stats_reqq_wait, bfa_port_qos_stats_clear, 1542 - port); 1543 - bfa_reqq_wait(port->bfa, BFA_REQQ_PORT, &port->stats_reqq_wait); 1526 + fcport->stats_qfull = BFA_TRUE; 1527 + bfa_reqq_winit(&fcport->stats_reqq_wait, 1528 + bfa_port_qos_stats_clear, fcport); 1529 + bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, 1530 + &fcport->stats_reqq_wait); 1544 1531 return; 1545 1532 } 1546 - port->stats_qfull = BFA_FALSE; 1533 + fcport->stats_qfull = BFA_FALSE; 1547 1534 1548 1535 bfa_os_memset(msg, 0, sizeof(bfi_pport_clear_qos_stats_req_t)); 1549 1536 bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_CLEAR_QOS_STATS_REQ, 1550 - bfa_lpuid(port->bfa)); 1551 - bfa_reqq_produce(port->bfa, BFA_REQQ_PORT); 1537 + bfa_lpuid(fcport->bfa)); 1538 + bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 1552 1539 return; 1553 1540 } 1554 1541 1555 1542 static void 1556 - bfa_pport_stats_swap(union bfa_pport_stats_u *d, union bfa_pport_stats_u *s) 1543 + bfa_fcport_stats_swap(union bfa_fcport_stats_u *d, union bfa_fcport_stats_u *s) 1557 1544 { 1558 - u32 *dip = (u32 *) d; 1559 - u32 *sip = (u32 *) s; 1545 + u32 *dip = (u32 *) d; 1546 + u32 *sip = (u32 *) s; 1560 1547 int i; 1561 1548 1562 - /* 1563 - * Do 64 bit fields swap first 1564 - */ 1565 - for (i = 0; 1566 - i < 1567 - ((sizeof(union bfa_pport_stats_u) - 1568 - sizeof(struct bfa_qos_stats_s)) / sizeof(u32)); i = i + 2) { 1549 + /* Do 64 bit fields swap first */ 1550 + for (i = 0; i < ((sizeof(union bfa_fcport_stats_u) - 1551 + sizeof(struct bfa_qos_stats_s))/sizeof(u32)); i = i + 2) { 1569 1552 #ifdef __BIGENDIAN 1570 1553 dip[i] = bfa_os_ntohl(sip[i]); 1571 1554 dip[i + 1] = bfa_os_ntohl(sip[i + 1]); ··· 1621 1512 #endif 1622 1513 } 1623 1514 1624 - /* 1625 - * Now swap the 32 bit fields 1626 - */ 1627 - for (; i < (sizeof(union bfa_pport_stats_u) / sizeof(u32)); ++i) 1515 + /* Now swap the 32 bit fields */ 1516 + for (; i < (sizeof(union bfa_fcport_stats_u)/sizeof(u32)); ++i) 1628 1517 dip[i] = bfa_os_ntohl(sip[i]); 1518 + } 1519 + 1520 + static void 1521 + bfa_port_stats_swap(union bfa_pport_stats_u *d, union bfa_pport_stats_u *s) 1522 + { 1523 + u32 *dip = (u32 *) d; 1524 + u32 *sip = (u32 *) s; 1525 + int i; 1526 + 1527 + /* Do 64 bit fields swap first */ 1528 + for (i = 0; i < (sizeof(union bfa_pport_stats_u) / sizeof(u32)); 1529 + i = i + 2) { 1530 + #ifdef __BIGENDIAN 1531 + dip[i] = bfa_os_ntohl(sip[i]); 1532 + dip[i + 1] = bfa_os_ntohl(sip[i + 1]); 1533 + #else 1534 + dip[i] = bfa_os_ntohl(sip[i + 1]); 1535 + dip[i + 1] = bfa_os_ntohl(sip[i]); 1536 + #endif 1537 + } 1629 1538 } 1630 1539 1631 1540 static void 1632 1541 __bfa_cb_port_stats_clr(void *cbarg, bfa_boolean_t complete) 1633 1542 { 1634 - struct bfa_pport_s *port = cbarg; 1543 + struct bfa_fcport_s *fcport = cbarg; 1635 1544 1636 1545 if (complete) { 1637 - port->stats_cbfn(port->stats_cbarg, port->stats_status); 1546 + fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status); 1638 1547 } else { 1639 - port->stats_busy = BFA_FALSE; 1640 - port->stats_status = BFA_STATUS_OK; 1548 + fcport->stats_busy = BFA_FALSE; 1549 + fcport->stats_status = BFA_STATUS_OK; 1550 + } 1551 + } 1552 + 1553 + static void 1554 + __bfa_cb_fcport_stats_clr(void *cbarg, bfa_boolean_t complete) 1555 + { 1556 + struct bfa_fcport_s *fcport = cbarg; 1557 + 1558 + if (complete) { 1559 + fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status); 1560 + } else { 1561 + fcport->stats_busy = BFA_FALSE; 1562 + fcport->stats_status = BFA_STATUS_OK; 1641 1563 } 1642 1564 } 1643 1565 1644 1566 static void 1645 1567 bfa_port_stats_clr_timeout(void *cbarg) 1646 1568 { 1647 - struct bfa_pport_s *port = (struct bfa_pport_s *)cbarg; 1569 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; 1648 1570 1649 - bfa_trc(port->bfa, port->stats_qfull); 1571 + bfa_trc(fcport->bfa, fcport->stats_qfull); 1650 1572 1651 - if (port->stats_qfull) { 1652 - bfa_reqq_wcancel(&port->stats_reqq_wait); 1653 - port->stats_qfull = BFA_FALSE; 1573 + if (fcport->stats_qfull) { 1574 + bfa_reqq_wcancel(&fcport->stats_reqq_wait); 1575 + fcport->stats_qfull = BFA_FALSE; 1654 1576 } 1655 1577 1656 - port->stats_status = BFA_STATUS_ETIMER; 1657 - bfa_cb_queue(port->bfa, &port->hcb_qe, __bfa_cb_port_stats_clr, port); 1578 + fcport->stats_status = BFA_STATUS_ETIMER; 1579 + bfa_cb_queue(fcport->bfa, &fcport->hcb_qe, 1580 + __bfa_cb_port_stats_clr, fcport); 1658 1581 } 1659 1582 1660 1583 static void 1661 - bfa_pport_callback(struct bfa_pport_s *pport, enum bfa_pport_linkstate event) 1584 + bfa_fcport_callback(struct bfa_fcport_s *fcport, enum bfa_pport_linkstate event) 1662 1585 { 1663 - if (pport->bfa->fcs) { 1664 - pport->event_cbfn(pport->event_cbarg, event); 1586 + if (fcport->bfa->fcs) { 1587 + fcport->event_cbfn(fcport->event_cbarg, event); 1665 1588 return; 1666 1589 } 1667 1590 1668 1591 switch (event) { 1669 1592 case BFA_PPORT_LINKUP: 1670 - bfa_sm_send_event(&pport->ln, BFA_PPORT_LN_SM_LINKUP); 1593 + bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKUP); 1671 1594 break; 1672 1595 case BFA_PPORT_LINKDOWN: 1673 - bfa_sm_send_event(&pport->ln, BFA_PPORT_LN_SM_LINKDOWN); 1596 + bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKDOWN); 1674 1597 break; 1675 1598 default: 1676 1599 bfa_assert(0); ··· 1710 1569 } 1711 1570 1712 1571 static void 1713 - bfa_pport_queue_cb(struct bfa_pport_ln_s *ln, enum bfa_pport_linkstate event) 1572 + bfa_fcport_queue_cb(struct bfa_fcport_ln_s *ln, enum bfa_pport_linkstate event) 1714 1573 { 1715 1574 ln->ln_event = event; 1716 - bfa_cb_queue(ln->pport->bfa, &ln->ln_qe, __bfa_cb_port_event, ln); 1575 + bfa_cb_queue(ln->fcport->bfa, &ln->ln_qe, __bfa_cb_fcport_event, ln); 1576 + } 1577 + 1578 + static void 1579 + bfa_fcport_stats_clr_timeout(void *cbarg) 1580 + { 1581 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; 1582 + 1583 + bfa_trc(fcport->bfa, fcport->stats_qfull); 1584 + 1585 + if (fcport->stats_qfull) { 1586 + bfa_reqq_wcancel(&fcport->stats_reqq_wait); 1587 + fcport->stats_qfull = BFA_FALSE; 1588 + } 1589 + 1590 + fcport->stats_status = BFA_STATUS_ETIMER; 1591 + bfa_cb_queue(fcport->bfa, &fcport->hcb_qe, __bfa_cb_fcport_stats_clr, 1592 + fcport); 1717 1593 } 1718 1594 1719 1595 static void 1720 1596 __bfa_cb_port_stats(void *cbarg, bfa_boolean_t complete) 1721 1597 { 1722 - struct bfa_pport_s *port = cbarg; 1598 + struct bfa_fcport_s *fcport = cbarg; 1723 1599 1724 1600 if (complete) { 1725 - if (port->stats_status == BFA_STATUS_OK) 1726 - bfa_pport_stats_swap(port->stats_ret, port->stats); 1727 - port->stats_cbfn(port->stats_cbarg, port->stats_status); 1601 + if (fcport->stats_status == BFA_STATUS_OK) 1602 + bfa_port_stats_swap(fcport->stats_ret, fcport->stats); 1603 + fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status); 1728 1604 } else { 1729 - port->stats_busy = BFA_FALSE; 1730 - port->stats_status = BFA_STATUS_OK; 1605 + fcport->stats_busy = BFA_FALSE; 1606 + fcport->stats_status = BFA_STATUS_OK; 1731 1607 } 1732 1608 } 1733 1609 1734 1610 static void 1735 1611 bfa_port_stats_timeout(void *cbarg) 1736 1612 { 1737 - struct bfa_pport_s *port = (struct bfa_pport_s *)cbarg; 1613 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; 1738 1614 1739 - bfa_trc(port->bfa, port->stats_qfull); 1615 + bfa_trc(fcport->bfa, fcport->stats_qfull); 1740 1616 1741 - if (port->stats_qfull) { 1742 - bfa_reqq_wcancel(&port->stats_reqq_wait); 1743 - port->stats_qfull = BFA_FALSE; 1617 + if (fcport->stats_qfull) { 1618 + bfa_reqq_wcancel(&fcport->stats_reqq_wait); 1619 + fcport->stats_qfull = BFA_FALSE; 1744 1620 } 1745 1621 1746 - port->stats_status = BFA_STATUS_ETIMER; 1747 - bfa_cb_queue(port->bfa, &port->hcb_qe, __bfa_cb_port_stats, port); 1622 + fcport->stats_status = BFA_STATUS_ETIMER; 1623 + bfa_cb_queue(fcport->bfa, &fcport->hcb_qe, __bfa_cb_port_stats, fcport); 1624 + } 1625 + 1626 + static void 1627 + __bfa_cb_fcport_stats(void *cbarg, bfa_boolean_t complete) 1628 + { 1629 + struct bfa_fcport_s *fcport = cbarg; 1630 + 1631 + if (complete) { 1632 + if (fcport->stats_status == BFA_STATUS_OK) { 1633 + bfa_fcport_stats_swap(fcport->fcport_stats_ret, 1634 + fcport->fcport_stats); 1635 + } 1636 + fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status); 1637 + } else { 1638 + fcport->stats_busy = BFA_FALSE; 1639 + fcport->stats_status = BFA_STATUS_OK; 1640 + } 1641 + } 1642 + 1643 + static void 1644 + bfa_fcport_stats_timeout(void *cbarg) 1645 + { 1646 + struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; 1647 + 1648 + bfa_trc(fcport->bfa, fcport->stats_qfull); 1649 + 1650 + if (fcport->stats_qfull) { 1651 + bfa_reqq_wcancel(&fcport->stats_reqq_wait); 1652 + fcport->stats_qfull = BFA_FALSE; 1653 + } 1654 + 1655 + fcport->stats_status = BFA_STATUS_ETIMER; 1656 + bfa_cb_queue(fcport->bfa, &fcport->hcb_qe, __bfa_cb_fcport_stats, 1657 + fcport); 1748 1658 } 1749 1659 1750 1660 #define BFA_PORT_STATS_TOV 1000 ··· 1807 1615 bfa_pport_get_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, 1808 1616 bfa_cb_pport_t cbfn, void *cbarg) 1809 1617 { 1810 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1618 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1811 1619 1812 - if (port->stats_busy) { 1813 - bfa_trc(bfa, port->stats_busy); 1620 + if (fcport->stats_busy) { 1621 + bfa_trc(bfa, fcport->stats_busy); 1814 1622 return BFA_STATUS_DEVBUSY; 1815 1623 } 1816 1624 1817 - port->stats_busy = BFA_TRUE; 1818 - port->stats_ret = stats; 1819 - port->stats_cbfn = cbfn; 1820 - port->stats_cbarg = cbarg; 1625 + fcport->stats_busy = BFA_TRUE; 1626 + fcport->stats_ret = stats; 1627 + fcport->stats_cbfn = cbfn; 1628 + fcport->stats_cbarg = cbarg; 1821 1629 1822 - bfa_port_stats_query(port); 1630 + bfa_port_stats_query(fcport); 1823 1631 1824 - bfa_timer_start(bfa, &port->timer, bfa_port_stats_timeout, port, 1632 + bfa_timer_start(bfa, &fcport->timer, bfa_port_stats_timeout, fcport, 1825 1633 BFA_PORT_STATS_TOV); 1826 1634 return BFA_STATUS_OK; 1827 1635 } ··· 1829 1637 bfa_status_t 1830 1638 bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) 1831 1639 { 1832 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1640 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1833 1641 1834 - if (port->stats_busy) { 1835 - bfa_trc(bfa, port->stats_busy); 1642 + if (fcport->stats_busy) { 1643 + bfa_trc(bfa, fcport->stats_busy); 1836 1644 return BFA_STATUS_DEVBUSY; 1837 1645 } 1838 1646 1839 - port->stats_busy = BFA_TRUE; 1840 - port->stats_cbfn = cbfn; 1841 - port->stats_cbarg = cbarg; 1647 + fcport->stats_busy = BFA_TRUE; 1648 + fcport->stats_cbfn = cbfn; 1649 + fcport->stats_cbarg = cbarg; 1842 1650 1843 - bfa_port_stats_clear(port); 1651 + bfa_port_stats_clear(fcport); 1844 1652 1845 - bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port, 1653 + bfa_timer_start(bfa, &fcport->timer, bfa_port_stats_clr_timeout, 1654 + fcport, BFA_PORT_STATS_TOV); 1655 + return BFA_STATUS_OK; 1656 + } 1657 + 1658 + /** 1659 + * @brief 1660 + * Fetch FCPort statistics. 1661 + * Todo TBD: sharing timer,stats_busy and other resources of fcport for now - 1662 + * ideally we want to create seperate ones for fcport once bfa_fcport_s is 1663 + * decided. 1664 + * 1665 + */ 1666 + bfa_status_t 1667 + bfa_fcport_get_stats(struct bfa_s *bfa, union bfa_fcport_stats_u *stats, 1668 + bfa_cb_pport_t cbfn, void *cbarg) 1669 + { 1670 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1671 + 1672 + if (fcport->stats_busy) { 1673 + bfa_trc(bfa, fcport->stats_busy); 1674 + return BFA_STATUS_DEVBUSY; 1675 + } 1676 + 1677 + fcport->stats_busy = BFA_TRUE; 1678 + fcport->fcport_stats_ret = stats; 1679 + fcport->stats_cbfn = cbfn; 1680 + fcport->stats_cbarg = cbarg; 1681 + 1682 + bfa_fcport_stats_query(fcport); 1683 + 1684 + bfa_timer_start(bfa, &fcport->timer, bfa_fcport_stats_timeout, fcport, 1846 1685 BFA_PORT_STATS_TOV); 1686 + 1847 1687 return BFA_STATUS_OK; 1848 1688 } 1849 1689 1850 1690 bfa_status_t 1851 - bfa_pport_trunk_enable(struct bfa_s *bfa, u8 bitmap) 1691 + bfa_fcport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) 1852 1692 { 1853 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1693 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1694 + 1695 + if (fcport->stats_busy) { 1696 + bfa_trc(bfa, fcport->stats_busy); 1697 + return BFA_STATUS_DEVBUSY; 1698 + } 1699 + 1700 + fcport->stats_busy = BFA_TRUE; 1701 + fcport->stats_cbfn = cbfn; 1702 + fcport->stats_cbarg = cbarg; 1703 + 1704 + bfa_fcport_stats_clear(fcport); 1705 + 1706 + bfa_timer_start(bfa, &fcport->timer, bfa_fcport_stats_clr_timeout, 1707 + fcport, BFA_PORT_STATS_TOV); 1708 + 1709 + return BFA_STATUS_OK; 1710 + } 1711 + 1712 + bfa_status_t 1713 + bfa_fcport_trunk_enable(struct bfa_s *bfa, u8 bitmap) 1714 + { 1715 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1854 1716 1855 1717 bfa_trc(bfa, bitmap); 1856 - bfa_trc(bfa, pport->cfg.trunked); 1857 - bfa_trc(bfa, pport->cfg.trunk_ports); 1718 + bfa_trc(bfa, fcport->cfg.trunked); 1719 + bfa_trc(bfa, fcport->cfg.trunk_ports); 1858 1720 1859 1721 if (!bitmap || (bitmap & (bitmap - 1))) 1860 1722 return BFA_STATUS_EINVAL; 1861 1723 1862 - pport->cfg.trunked = BFA_TRUE; 1863 - pport->cfg.trunk_ports = bitmap; 1724 + fcport->cfg.trunked = BFA_TRUE; 1725 + fcport->cfg.trunk_ports = bitmap; 1864 1726 1865 1727 return BFA_STATUS_OK; 1866 1728 } 1867 1729 1868 1730 void 1869 - bfa_pport_qos_get_attr(struct bfa_s *bfa, struct bfa_qos_attr_s *qos_attr) 1731 + bfa_fcport_qos_get_attr(struct bfa_s *bfa, struct bfa_qos_attr_s *qos_attr) 1870 1732 { 1871 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1733 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1872 1734 1873 - qos_attr->state = bfa_os_ntohl(pport->qos_attr.state); 1874 - qos_attr->total_bb_cr = bfa_os_ntohl(pport->qos_attr.total_bb_cr); 1735 + qos_attr->state = bfa_os_ntohl(fcport->qos_attr.state); 1736 + qos_attr->total_bb_cr = bfa_os_ntohl(fcport->qos_attr.total_bb_cr); 1875 1737 } 1876 1738 1877 1739 void 1878 - bfa_pport_qos_get_vc_attr(struct bfa_s *bfa, 1740 + bfa_fcport_qos_get_vc_attr(struct bfa_s *bfa, 1879 1741 struct bfa_qos_vc_attr_s *qos_vc_attr) 1880 1742 { 1881 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1882 - struct bfa_qos_vc_attr_s *bfa_vc_attr = &pport->qos_vc_attr; 1743 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1744 + struct bfa_qos_vc_attr_s *bfa_vc_attr = &fcport->qos_vc_attr; 1883 1745 u32 i = 0; 1884 1746 1885 1747 qos_vc_attr->total_vc_count = bfa_os_ntohs(bfa_vc_attr->total_vc_count); ··· 1959 1713 * Fetch QoS Stats. 1960 1714 */ 1961 1715 bfa_status_t 1962 - bfa_pport_get_qos_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, 1716 + bfa_fcport_get_qos_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, 1963 1717 bfa_cb_pport_t cbfn, void *cbarg) 1964 1718 { 1965 1719 /* ··· 1969 1723 } 1970 1724 1971 1725 bfa_status_t 1972 - bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) 1726 + bfa_fcport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) 1973 1727 { 1974 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1728 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 1975 1729 1976 - if (port->stats_busy) { 1977 - bfa_trc(bfa, port->stats_busy); 1730 + if (fcport->stats_busy) { 1731 + bfa_trc(bfa, fcport->stats_busy); 1978 1732 return BFA_STATUS_DEVBUSY; 1979 1733 } 1980 1734 1981 - port->stats_busy = BFA_TRUE; 1982 - port->stats_cbfn = cbfn; 1983 - port->stats_cbarg = cbarg; 1735 + fcport->stats_busy = BFA_TRUE; 1736 + fcport->stats_cbfn = cbfn; 1737 + fcport->stats_cbarg = cbarg; 1984 1738 1985 - bfa_port_qos_stats_clear(port); 1739 + bfa_port_qos_stats_clear(fcport); 1986 1740 1987 - bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port, 1988 - BFA_PORT_STATS_TOV); 1741 + bfa_timer_start(bfa, &fcport->timer, bfa_port_stats_clr_timeout, 1742 + fcport, BFA_PORT_STATS_TOV); 1989 1743 return BFA_STATUS_OK; 1990 1744 } 1991 1745 ··· 1993 1747 * Fetch port attributes. 1994 1748 */ 1995 1749 bfa_status_t 1996 - bfa_pport_trunk_disable(struct bfa_s *bfa) 1750 + bfa_fcport_trunk_disable(struct bfa_s *bfa) 1997 1751 { 1998 1752 return BFA_STATUS_OK; 1999 1753 } 2000 1754 2001 1755 bfa_boolean_t 2002 - bfa_pport_trunk_query(struct bfa_s *bfa, u32 *bitmap) 1756 + bfa_fcport_trunk_query(struct bfa_s *bfa, u32 *bitmap) 2003 1757 { 2004 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1758 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2005 1759 2006 - *bitmap = port->cfg.trunk_ports; 2007 - return port->cfg.trunked; 1760 + *bitmap = fcport->cfg.trunk_ports; 1761 + return fcport->cfg.trunked; 2008 1762 } 2009 1763 2010 1764 bfa_boolean_t 2011 - bfa_pport_is_disabled(struct bfa_s *bfa) 1765 + bfa_fcport_is_disabled(struct bfa_s *bfa) 2012 1766 { 2013 - struct bfa_pport_s *port = BFA_PORT_MOD(bfa); 1767 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2014 1768 2015 - return bfa_sm_to_state(hal_pport_sm_table, port->sm) == 1769 + return bfa_sm_to_state(hal_pport_sm_table, fcport->sm) == 2016 1770 BFA_PPORT_ST_DISABLED; 2017 1771 2018 1772 } 2019 1773 2020 1774 bfa_boolean_t 2021 - bfa_pport_is_ratelim(struct bfa_s *bfa) 1775 + bfa_fcport_is_ratelim(struct bfa_s *bfa) 2022 1776 { 2023 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1777 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2024 1778 2025 - return pport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE; 1779 + return fcport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE; 2026 1780 2027 1781 } 2028 1782 2029 1783 void 2030 - bfa_pport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off) 1784 + bfa_fcport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off) 2031 1785 { 2032 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1786 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2033 1787 2034 1788 bfa_trc(bfa, on_off); 2035 - bfa_trc(bfa, pport->cfg.qos_enabled); 1789 + bfa_trc(bfa, fcport->cfg.qos_enabled); 2036 1790 2037 - pport->cfg.qos_enabled = on_off; 1791 + fcport->cfg.qos_enabled = on_off; 2038 1792 } 2039 1793 2040 1794 void 2041 - bfa_pport_cfg_ratelim(struct bfa_s *bfa, bfa_boolean_t on_off) 1795 + bfa_fcport_cfg_ratelim(struct bfa_s *bfa, bfa_boolean_t on_off) 2042 1796 { 2043 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1797 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2044 1798 2045 1799 bfa_trc(bfa, on_off); 2046 - bfa_trc(bfa, pport->cfg.ratelimit); 1800 + bfa_trc(bfa, fcport->cfg.ratelimit); 2047 1801 2048 - pport->cfg.ratelimit = on_off; 2049 - if (pport->cfg.trl_def_speed == BFA_PPORT_SPEED_UNKNOWN) 2050 - pport->cfg.trl_def_speed = BFA_PPORT_SPEED_1GBPS; 1802 + fcport->cfg.ratelimit = on_off; 1803 + if (fcport->cfg.trl_def_speed == BFA_PPORT_SPEED_UNKNOWN) 1804 + fcport->cfg.trl_def_speed = BFA_PPORT_SPEED_1GBPS; 2051 1805 } 2052 1806 2053 1807 /** 2054 1808 * Configure default minimum ratelim speed 2055 1809 */ 2056 1810 bfa_status_t 2057 - bfa_pport_cfg_ratelim_speed(struct bfa_s *bfa, enum bfa_pport_speed speed) 1811 + bfa_fcport_cfg_ratelim_speed(struct bfa_s *bfa, enum bfa_pport_speed speed) 2058 1812 { 2059 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1813 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2060 1814 2061 1815 bfa_trc(bfa, speed); 2062 1816 2063 1817 /* 2064 1818 * Auto and speeds greater than the supported speed, are invalid 2065 1819 */ 2066 - if ((speed == BFA_PPORT_SPEED_AUTO) || (speed > pport->speed_sup)) { 2067 - bfa_trc(bfa, pport->speed_sup); 1820 + if ((speed == BFA_PPORT_SPEED_AUTO) || (speed > fcport->speed_sup)) { 1821 + bfa_trc(bfa, fcport->speed_sup); 2068 1822 return BFA_STATUS_UNSUPP_SPEED; 2069 1823 } 2070 1824 2071 - pport->cfg.trl_def_speed = speed; 1825 + fcport->cfg.trl_def_speed = speed; 2072 1826 2073 1827 return BFA_STATUS_OK; 2074 1828 } ··· 2077 1831 * Get default minimum ratelim speed 2078 1832 */ 2079 1833 enum bfa_pport_speed 2080 - bfa_pport_get_ratelim_speed(struct bfa_s *bfa) 1834 + bfa_fcport_get_ratelim_speed(struct bfa_s *bfa) 2081 1835 { 2082 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1836 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2083 1837 2084 - bfa_trc(bfa, pport->cfg.trl_def_speed); 2085 - return pport->cfg.trl_def_speed; 1838 + bfa_trc(bfa, fcport->cfg.trl_def_speed); 1839 + return fcport->cfg.trl_def_speed; 2086 1840 2087 1841 } 2088 1842 2089 1843 void 2090 - bfa_pport_busy(struct bfa_s *bfa, bfa_boolean_t status) 1844 + bfa_fcport_busy(struct bfa_s *bfa, bfa_boolean_t status) 2091 1845 { 2092 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1846 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2093 1847 2094 1848 bfa_trc(bfa, status); 2095 - bfa_trc(bfa, pport->diag_busy); 1849 + bfa_trc(bfa, fcport->diag_busy); 2096 1850 2097 - pport->diag_busy = status; 1851 + fcport->diag_busy = status; 2098 1852 } 2099 1853 2100 1854 void 2101 - bfa_pport_beacon(struct bfa_s *bfa, bfa_boolean_t beacon, 1855 + bfa_fcport_beacon(struct bfa_s *bfa, bfa_boolean_t beacon, 2102 1856 bfa_boolean_t link_e2e_beacon) 2103 1857 { 2104 - struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); 1858 + struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2105 1859 2106 1860 bfa_trc(bfa, beacon); 2107 1861 bfa_trc(bfa, link_e2e_beacon); 2108 - bfa_trc(bfa, pport->beacon); 2109 - bfa_trc(bfa, pport->link_e2e_beacon); 1862 + bfa_trc(bfa, fcport->beacon); 1863 + bfa_trc(bfa, fcport->link_e2e_beacon); 2110 1864 2111 - pport->beacon = beacon; 2112 - pport->link_e2e_beacon = link_e2e_beacon; 1865 + fcport->beacon = beacon; 1866 + fcport->link_e2e_beacon = link_e2e_beacon; 2113 1867 } 2114 1868 2115 1869 bfa_boolean_t 2116 - bfa_pport_is_linkup(struct bfa_s *bfa) 1870 + bfa_fcport_is_linkup(struct bfa_s *bfa) 2117 1871 { 2118 - return bfa_sm_cmp_state(BFA_PORT_MOD(bfa), bfa_pport_sm_linkup); 1872 + return bfa_sm_cmp_state(BFA_FCPORT_MOD(bfa), bfa_fcport_sm_linkup); 2119 1873 } 2120 1874 2121 1875
+1 -1
drivers/scsi/bfa/bfa_fcs_port.c
··· 57 57 void 58 58 bfa_fcs_pport_attach(struct bfa_fcs_s *fcs) 59 59 { 60 - bfa_pport_event_register(fcs->bfa, bfa_fcs_pport_event_handler, fcs); 60 + bfa_fcport_event_register(fcs->bfa, bfa_fcs_pport_event_handler, fcs); 61 61 }
+2 -2
drivers/scsi/bfa/bfa_module.c
··· 24 24 */ 25 25 struct bfa_module_s *hal_mods[] = { 26 26 &hal_mod_sgpg, 27 - &hal_mod_pport, 27 + &hal_mod_fcport, 28 28 &hal_mod_fcxp, 29 29 &hal_mod_lps, 30 30 &hal_mod_uf, ··· 45 45 bfa_isr_unhandled, /* BFI_MC_DIAG */ 46 46 bfa_isr_unhandled, /* BFI_MC_FLASH */ 47 47 bfa_isr_unhandled, /* BFI_MC_CEE */ 48 - bfa_pport_isr, /* BFI_MC_PORT */ 48 + bfa_fcport_isr, /* BFI_MC_FCPORT */ 49 49 bfa_isr_unhandled, /* BFI_MC_IOCFC */ 50 50 bfa_isr_unhandled, /* BFI_MC_LL */ 51 51 bfa_uf_isr, /* BFI_MC_UF */
+1 -1
drivers/scsi/bfa/bfa_modules_priv.h
··· 29 29 30 30 31 31 struct bfa_modules_s { 32 - struct bfa_pport_s pport; /* physical port module */ 32 + struct bfa_fcport_s fcport; /* fc port module */ 33 33 struct bfa_fcxp_mod_s fcxp_mod; /* fcxp module */ 34 34 struct bfa_lps_mod_s lps_mod; /* fcxp module */ 35 35 struct bfa_uf_mod_s uf_mod; /* unsolicited frame module */
+12 -7
drivers/scsi/bfa/bfa_port_priv.h
··· 25 25 /** 26 26 * Link notification data structure 27 27 */ 28 - struct bfa_pport_ln_s { 29 - struct bfa_pport_s *pport; 28 + struct bfa_fcport_ln_s { 29 + struct bfa_fcport_s *fcport; 30 30 bfa_sm_t sm; 31 31 struct bfa_cb_qe_s ln_qe; /* BFA callback queue elem for ln */ 32 32 enum bfa_pport_linkstate ln_event; /* ln event for callback */ 33 33 }; 34 34 35 35 /** 36 - * BFA physical port data structure 36 + * BFA FC port data structure 37 37 */ 38 - struct bfa_pport_s { 38 + struct bfa_fcport_s { 39 39 struct bfa_s *bfa; /* parent BFA instance */ 40 40 bfa_sm_t sm; /* port state machine */ 41 41 wwn_t nwwn; /* node wwn of physical port */ ··· 62 62 union bfi_pport_i2h_msg_u i2hmsg; 63 63 } event_arg; 64 64 void *bfad; /* BFA driver handle */ 65 - struct bfa_pport_ln_s ln; /* Link Notification */ 65 + struct bfa_fcport_ln_s ln; /* Link Notification */ 66 66 struct bfa_cb_qe_s hcb_qe; /* BFA callback queue elem */ 67 67 u32 msgtag; /* fimrware msg tag for reply */ 68 68 u8 *stats_kva; ··· 88 88 /* driver callback function */ 89 89 void *stats_cbarg; 90 90 /* *!< user callback arg */ 91 + /* FCport stats */ 92 + u8 *fcport_stats_kva; 93 + u64 fcport_stats_pa; 94 + union bfa_fcport_stats_u *fcport_stats; 95 + union bfa_fcport_stats_u *fcport_stats_ret; 91 96 }; 92 97 93 - #define BFA_PORT_MOD(__bfa) (&(__bfa)->modules.pport) 98 + #define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport) 94 99 95 100 /* 96 101 * public functions 97 102 */ 98 - void bfa_pport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); 103 + void bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); 99 104 #endif /* __BFA_PORT_PRIV_H__ */
+1 -1
drivers/scsi/bfa/bfa_priv.h
··· 101 101 extern struct bfa_module_s hal_mod_flash; 102 102 extern struct bfa_module_s hal_mod_fcdiag; 103 103 extern struct bfa_module_s hal_mod_sgpg; 104 - extern struct bfa_module_s hal_mod_pport; 104 + extern struct bfa_module_s hal_mod_fcport; 105 105 extern struct bfa_module_s hal_mod_fcxp; 106 106 extern struct bfa_module_s hal_mod_lps; 107 107 extern struct bfa_module_s hal_mod_uf;
+1 -1
drivers/scsi/bfa/bfa_trcmod_priv.h
··· 37 37 BFA_TRC_HAL_IOIM = 6, 38 38 BFA_TRC_HAL_TSKIM = 7, 39 39 BFA_TRC_HAL_ITNIM = 8, 40 - BFA_TRC_HAL_PPORT = 9, 40 + BFA_TRC_HAL_FCPORT = 9, 41 41 BFA_TRC_HAL_SGPG = 10, 42 42 BFA_TRC_HAL_FLASH = 11, 43 43 BFA_TRC_HAL_DEBUG = 12,
+1 -1
drivers/scsi/bfa/bfad.c
··· 664 664 665 665 sprintf(symname, "%s-%d", BFAD_DRIVER_NAME, bfad->inst_no); 666 666 memcpy(port_cfg.sym_name.symname, symname, strlen(symname)); 667 - bfa_pport_get_attr(&bfad->bfa, &attr); 667 + bfa_fcport_get_attr(&bfad->bfa, &attr); 668 668 port_cfg.nwwn = attr.nwwn; 669 669 port_cfg.pwwn = attr.pwwn; 670 670
+3 -3
drivers/scsi/bfa/bfad_attr.c
··· 141 141 struct bfad_s *bfad = im_port->bfad; 142 142 struct bfa_pport_attr_s attr; 143 143 144 - bfa_pport_get_attr(&bfad->bfa, &attr); 144 + bfa_fcport_get_attr(&bfad->bfa, &attr); 145 145 146 146 switch (attr.port_type) { 147 147 case BFA_PPORT_TYPE_NPORT: ··· 173 173 struct bfad_s *bfad = im_port->bfad; 174 174 struct bfa_pport_attr_s attr; 175 175 176 - bfa_pport_get_attr(&bfad->bfa, &attr); 176 + bfa_fcport_get_attr(&bfad->bfa, &attr); 177 177 178 178 switch (attr.port_state) { 179 179 case BFA_PPORT_ST_LINKDOWN: ··· 232 232 unsigned long flags; 233 233 234 234 spin_lock_irqsave(shost->host_lock, flags); 235 - bfa_pport_get_attr(&bfad->bfa, &attr); 235 + bfa_fcport_get_attr(&bfad->bfa, &attr); 236 236 switch (attr.speed) { 237 237 case BFA_PPORT_SPEED_8GBPS: 238 238 fc_host_speed(shost) = FC_PORTSPEED_8GBIT;
+1 -1
drivers/scsi/bfa/bfad_im.c
··· 966 966 FC_PORTSPEED_1GBIT; 967 967 968 968 memset(&attr.pattr, 0, sizeof(attr.pattr)); 969 - bfa_pport_get_attr(&bfad->bfa, &attr.pattr); 969 + bfa_fcport_get_attr(&bfad->bfa, &attr.pattr); 970 970 fc_host_maxframe_size(host) = attr.pattr.pport_cfg.maxfrsize; 971 971 } 972 972
+10 -10
drivers/scsi/bfa/fabric.c
··· 37 37 #define BFA_FCS_FABRIC_CLEANUP_DELAY (10000) /* Milliseconds */ 38 38 39 39 #define bfa_fcs_fabric_set_opertype(__fabric) do { \ 40 - if (bfa_pport_get_topology((__fabric)->fcs->bfa) \ 40 + if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \ 41 41 == BFA_PPORT_TOPOLOGY_P2P) \ 42 42 (__fabric)->oper_type = BFA_PPORT_TYPE_NPORT; \ 43 43 else \ ··· 160 160 161 161 switch (event) { 162 162 case BFA_FCS_FABRIC_SM_START: 163 - if (bfa_pport_is_linkup(fabric->fcs->bfa)) { 163 + if (bfa_fcport_is_linkup(fabric->fcs->bfa)) { 164 164 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi); 165 165 bfa_fcs_fabric_login(fabric); 166 166 } else ··· 224 224 switch (event) { 225 225 case BFA_FCS_FABRIC_SM_CONT_OP: 226 226 227 - bfa_pport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit); 227 + bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit); 228 228 fabric->fab_type = BFA_FCS_FABRIC_SWITCHED; 229 229 230 230 if (fabric->auth_reqd && fabric->is_auth) { ··· 251 251 252 252 case BFA_FCS_FABRIC_SM_NO_FABRIC: 253 253 fabric->fab_type = BFA_FCS_FABRIC_N2N; 254 - bfa_pport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit); 254 + bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit); 255 255 bfa_fcs_fabric_notify_online(fabric); 256 256 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_nofabric); 257 257 break; ··· 418 418 419 419 case BFA_FCS_FABRIC_SM_NO_FABRIC: 420 420 bfa_trc(fabric->fcs, fabric->bb_credit); 421 - bfa_pport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit); 421 + bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit); 422 422 break; 423 423 424 424 default: ··· 718 718 struct bfa_port_cfg_s *pcfg = &fabric->bport.port_cfg; 719 719 u8 alpa = 0; 720 720 721 - if (bfa_pport_get_topology(bfa) == BFA_PPORT_TOPOLOGY_LOOP) 722 - alpa = bfa_pport_get_myalpa(bfa); 721 + if (bfa_fcport_get_topology(bfa) == BFA_PPORT_TOPOLOGY_LOOP) 722 + alpa = bfa_fcport_get_myalpa(bfa); 723 723 724 - bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_pport_get_maxfrsize(bfa), 724 + bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_fcport_get_maxfrsize(bfa), 725 725 pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd); 726 726 727 727 fabric->stats.flogi_sent++; ··· 1176 1176 reqlen = fc_flogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), 1177 1177 bfa_os_hton3b(FC_FABRIC_PORT), 1178 1178 n2n_port->reply_oxid, pcfg->pwwn, 1179 - pcfg->nwwn, bfa_pport_get_maxfrsize(bfa), 1180 - bfa_pport_get_rx_bbcredit(bfa)); 1179 + pcfg->nwwn, bfa_fcport_get_maxfrsize(bfa), 1180 + bfa_fcport_get_rx_bbcredit(bfa)); 1181 1181 1182 1182 bfa_fcxp_send(fcxp, NULL, fabric->vf_id, bfa_lps_get_tag(fabric->lps), 1183 1183 BFA_FALSE, FC_CLASS_3, reqlen, &fchs,
+1 -1
drivers/scsi/bfa/fdmi.c
··· 1175 1175 /* 1176 1176 * get pport attributes from hal 1177 1177 */ 1178 - bfa_pport_get_attr(port->fcs->bfa, &pport_attr); 1178 + bfa_fcport_get_attr(port->fcs->bfa, &pport_attr); 1179 1179 1180 1180 /* 1181 1181 * get FC4 type Bitmask
+42 -34
drivers/scsi/bfa/include/bfa_svc.h
··· 26 26 #include <defs/bfa_defs_pport.h> 27 27 #include <defs/bfa_defs_rport.h> 28 28 #include <defs/bfa_defs_qos.h> 29 + #include <defs/bfa_defs_fcport.h> 29 30 #include <cs/bfa_sm.h> 30 31 #include <bfa.h> 31 32 ··· 152 151 bfa_eproto_status_t ext_status; 153 152 }; 154 153 154 + #define BFA_FCPORT(_bfa) (&((_bfa)->modules.port)) 155 + 155 156 /* 156 157 * bfa pport API functions 157 158 */ 158 - bfa_status_t bfa_pport_enable(struct bfa_s *bfa); 159 - bfa_status_t bfa_pport_disable(struct bfa_s *bfa); 160 - bfa_status_t bfa_pport_cfg_speed(struct bfa_s *bfa, 159 + bfa_status_t bfa_fcport_enable(struct bfa_s *bfa); 160 + bfa_status_t bfa_fcport_disable(struct bfa_s *bfa); 161 + bfa_status_t bfa_fcport_cfg_speed(struct bfa_s *bfa, 161 162 enum bfa_pport_speed speed); 162 - enum bfa_pport_speed bfa_pport_get_speed(struct bfa_s *bfa); 163 - bfa_status_t bfa_pport_cfg_topology(struct bfa_s *bfa, 163 + enum bfa_pport_speed bfa_fcport_get_speed(struct bfa_s *bfa); 164 + bfa_status_t bfa_fcport_cfg_topology(struct bfa_s *bfa, 164 165 enum bfa_pport_topology topo); 165 - enum bfa_pport_topology bfa_pport_get_topology(struct bfa_s *bfa); 166 - bfa_status_t bfa_pport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa); 167 - bfa_boolean_t bfa_pport_get_hardalpa(struct bfa_s *bfa, u8 *alpa); 168 - u8 bfa_pport_get_myalpa(struct bfa_s *bfa); 169 - bfa_status_t bfa_pport_clr_hardalpa(struct bfa_s *bfa); 170 - bfa_status_t bfa_pport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxsize); 171 - u16 bfa_pport_get_maxfrsize(struct bfa_s *bfa); 172 - u32 bfa_pport_mypid(struct bfa_s *bfa); 173 - u8 bfa_pport_get_rx_bbcredit(struct bfa_s *bfa); 174 - bfa_status_t bfa_pport_trunk_enable(struct bfa_s *bfa, u8 bitmap); 175 - bfa_status_t bfa_pport_trunk_disable(struct bfa_s *bfa); 176 - bfa_boolean_t bfa_pport_trunk_query(struct bfa_s *bfa, u32 *bitmap); 177 - void bfa_pport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr); 178 - wwn_t bfa_pport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node); 166 + enum bfa_pport_topology bfa_fcport_get_topology(struct bfa_s *bfa); 167 + bfa_status_t bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa); 168 + bfa_boolean_t bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa); 169 + u8 bfa_fcport_get_myalpa(struct bfa_s *bfa); 170 + bfa_status_t bfa_fcport_clr_hardalpa(struct bfa_s *bfa); 171 + bfa_status_t bfa_fcport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxsize); 172 + u16 bfa_fcport_get_maxfrsize(struct bfa_s *bfa); 173 + u32 bfa_fcport_mypid(struct bfa_s *bfa); 174 + u8 bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa); 175 + bfa_status_t bfa_fcport_trunk_enable(struct bfa_s *bfa, u8 bitmap); 176 + bfa_status_t bfa_fcport_trunk_disable(struct bfa_s *bfa); 177 + bfa_boolean_t bfa_fcport_trunk_query(struct bfa_s *bfa, u32 *bitmap); 178 + void bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr); 179 + wwn_t bfa_fcport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node); 179 180 bfa_status_t bfa_pport_get_stats(struct bfa_s *bfa, 180 181 union bfa_pport_stats_u *stats, 181 182 bfa_cb_pport_t cbfn, void *cbarg); 182 183 bfa_status_t bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, 183 184 void *cbarg); 184 - void bfa_pport_event_register(struct bfa_s *bfa, 185 + void bfa_fcport_event_register(struct bfa_s *bfa, 185 186 void (*event_cbfn) (void *cbarg, 186 187 bfa_pport_event_t event), void *event_cbarg); 187 - bfa_boolean_t bfa_pport_is_disabled(struct bfa_s *bfa); 188 - void bfa_pport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off); 189 - void bfa_pport_cfg_ratelim(struct bfa_s *bfa, bfa_boolean_t on_off); 190 - bfa_status_t bfa_pport_cfg_ratelim_speed(struct bfa_s *bfa, 188 + bfa_boolean_t bfa_fcport_is_disabled(struct bfa_s *bfa); 189 + void bfa_fcport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off); 190 + void bfa_fcport_cfg_ratelim(struct bfa_s *bfa, bfa_boolean_t on_off); 191 + bfa_status_t bfa_fcport_cfg_ratelim_speed(struct bfa_s *bfa, 191 192 enum bfa_pport_speed speed); 192 - enum bfa_pport_speed bfa_pport_get_ratelim_speed(struct bfa_s *bfa); 193 + enum bfa_pport_speed bfa_fcport_get_ratelim_speed(struct bfa_s *bfa); 193 194 194 - void bfa_pport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit); 195 - void bfa_pport_busy(struct bfa_s *bfa, bfa_boolean_t status); 196 - void bfa_pport_beacon(struct bfa_s *bfa, bfa_boolean_t beacon, 195 + void bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit); 196 + void bfa_fcport_busy(struct bfa_s *bfa, bfa_boolean_t status); 197 + void bfa_fcport_beacon(struct bfa_s *bfa, bfa_boolean_t beacon, 197 198 bfa_boolean_t link_e2e_beacon); 198 199 void bfa_cb_pport_event(void *cbarg, bfa_pport_event_t event); 199 - void bfa_pport_qos_get_attr(struct bfa_s *bfa, struct bfa_qos_attr_s *qos_attr); 200 - void bfa_pport_qos_get_vc_attr(struct bfa_s *bfa, 200 + void bfa_fcport_qos_get_attr(struct bfa_s *bfa, struct bfa_qos_attr_s *qos_attr); 201 + void bfa_fcport_qos_get_vc_attr(struct bfa_s *bfa, 201 202 struct bfa_qos_vc_attr_s *qos_vc_attr); 202 - bfa_status_t bfa_pport_get_qos_stats(struct bfa_s *bfa, 203 + bfa_status_t bfa_fcport_get_qos_stats(struct bfa_s *bfa, 203 204 union bfa_pport_stats_u *stats, 204 205 bfa_cb_pport_t cbfn, void *cbarg); 205 - bfa_status_t bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, 206 + bfa_status_t bfa_fcport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, 206 207 void *cbarg); 207 - bfa_boolean_t bfa_pport_is_ratelim(struct bfa_s *bfa); 208 - bfa_boolean_t bfa_pport_is_linkup(struct bfa_s *bfa); 208 + bfa_boolean_t bfa_fcport_is_ratelim(struct bfa_s *bfa); 209 + bfa_boolean_t bfa_fcport_is_linkup(struct bfa_s *bfa); 210 + bfa_status_t bfa_fcport_get_stats(struct bfa_s *bfa, 211 + union bfa_fcport_stats_u *stats, 212 + bfa_cb_pport_t cbfn, void *cbarg); 213 + bfa_status_t bfa_fcport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, 214 + void *cbarg); 209 215 210 216 /* 211 217 * bfa rport API functions
+5
drivers/scsi/bfa/include/bfi/bfi_pport.h
··· 32 32 BFI_PPORT_H2I_ENABLE_TX_VF_TAG_REQ = (7), 33 33 BFI_PPORT_H2I_GET_QOS_STATS_REQ = (8), 34 34 BFI_PPORT_H2I_CLEAR_QOS_STATS_REQ = (9), 35 + BFI_FCPORT_H2I_GET_STATS_REQ = (10), 36 + BFI_FCPORT_H2I_CLEAR_STATS_REQ = (11), 35 37 }; 36 38 37 39 enum bfi_pport_i2h { ··· 47 45 BFI_PPORT_I2H_EVENT = BFA_I2HM(8), 48 46 BFI_PPORT_I2H_GET_QOS_STATS_RSP = BFA_I2HM(9), 49 47 BFI_PPORT_I2H_CLEAR_QOS_STATS_RSP = BFA_I2HM(10), 48 + BFI_FCPORT_I2H_GET_STATS_RSP = BFA_I2HM(11), 49 + BFI_FCPORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(12), 50 50 }; 51 51 52 52 /** ··· 79 75 wwn_t pwwn; /* port wwn of physical port */ 80 76 struct bfa_pport_cfg_s port_cfg; /* port configuration */ 81 77 union bfi_addr_u stats_dma_addr; /* DMA address for stats */ 78 + union bfi_addr_u fcport_stats_dma_addr;/*!< DMA address for stats */ 82 79 u32 msgtag; /* msgtag for reply */ 83 80 u32 rsvd2; 84 81 };
+8
drivers/scsi/bfa/include/cs/bfa_sm.h
··· 23 23 #define __BFA_SM_H__ 24 24 25 25 typedef void (*bfa_sm_t)(void *sm, int event); 26 + /** 27 + * oc - object class eg. bfa_ioc 28 + * st - state, eg. reset 29 + * otype - object type, eg. struct bfa_ioc_s 30 + * etype - object type, eg. enum ioc_event 31 + */ 32 + #define bfa_sm_state_decl(oc, st, otype, etype) \ 33 + static void oc ## _sm_ ## st(otype * fsm, etype event) 26 34 27 35 #define bfa_sm_set_state(_sm, _state) ((_sm)->sm = (bfa_sm_t)(_state)) 28 36 #define bfa_sm_send_event(_sm, _event) ((_sm)->sm((_sm), (_event)))
+1
drivers/scsi/bfa/include/defs/bfa_defs_ethport.h
··· 19 19 #define __BFA_DEFS_ETHPORT_H__ 20 20 21 21 #include <defs/bfa_defs_status.h> 22 + #include <defs/bfa_defs_port.h> 22 23 #include <protocol/types.h> 23 24 #include <cna/pstats/phyport_defs.h> 24 25 #include <cna/pstats/ethport_defs.h>
+94
drivers/scsi/bfa/include/defs/bfa_defs_fcport.h
··· 1 + /* 2 + * Copyright (c) 2005-2009 Brocade Communications Systems, Inc. 3 + * All rights reserved 4 + * www.brocade.com 5 + * 6 + * bfa_defs_fcport.h 7 + * 8 + * Linux driver for Brocade Fibre Channel Host Bus Adapter. 9 + * 10 + * This program is free software; you can redistribute it and/or modify it 11 + * under the terms of the GNU General Public License (GPL) Version 2 as 12 + * published by the Free Software Foundation 13 + * 14 + * This program is distributed in the hope that it will be useful, but 15 + * WITHOUT ANY WARRANTY; without even the implied warranty of 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 + * General Public License for more details. 18 + */ 19 + #ifndef __BFA_DEFS_FCPORT_H__ 20 + #define __BFA_DEFS_FCPORT_H__ 21 + 22 + #include <defs/bfa_defs_types.h> 23 + #include <protocol/types.h> 24 + 25 + #pragma pack(1) 26 + 27 + /** 28 + * FCoE statistics 29 + */ 30 + struct bfa_fcoe_stats_s { 31 + u64 secs_reset; /* Seconds since stats reset */ 32 + u64 cee_linkups; /* CEE link up */ 33 + u64 cee_linkdns; /* CEE link down */ 34 + u64 fip_linkups; /* FIP link up */ 35 + u64 fip_linkdns; /* FIP link down */ 36 + u64 fip_fails; /* FIP failures */ 37 + u64 mac_invalids; /* Invalid mac assignments */ 38 + u64 vlan_req; /* Vlan requests */ 39 + u64 vlan_notify; /* Vlan notifications */ 40 + u64 vlan_err; /* Vlan notification errors */ 41 + u64 vlan_timeouts; /* Vlan request timeouts */ 42 + u64 vlan_invalids; /* Vlan invalids */ 43 + u64 disc_req; /* Discovery requests */ 44 + u64 disc_rsp; /* Discovery responses */ 45 + u64 disc_err; /* Discovery error frames */ 46 + u64 disc_unsol; /* Discovery unsolicited */ 47 + u64 disc_timeouts; /* Discovery timeouts */ 48 + u64 disc_fcf_unavail; /* Discovery FCF not avail */ 49 + u64 linksvc_unsupp; /* FIP link service req unsupp. */ 50 + u64 linksvc_err; /* FIP link service req errors */ 51 + u64 logo_req; /* FIP logo */ 52 + u64 clrvlink_req; /* Clear virtual link requests */ 53 + u64 op_unsupp; /* FIP operation unsupp. */ 54 + u64 untagged; /* FIP untagged frames */ 55 + u64 txf_ucast; /* Tx FCoE unicast frames */ 56 + u64 txf_ucast_vlan; /* Tx FCoE unicast vlan frames */ 57 + u64 txf_ucast_octets; /* Tx FCoE unicast octets */ 58 + u64 txf_mcast; /* Tx FCoE mutlicast frames */ 59 + u64 txf_mcast_vlan; /* Tx FCoE mutlicast vlan frames */ 60 + u64 txf_mcast_octets; /* Tx FCoE multicast octets */ 61 + u64 txf_bcast; /* Tx FCoE broadcast frames */ 62 + u64 txf_bcast_vlan; /* Tx FCoE broadcast vlan frames */ 63 + u64 txf_bcast_octets; /* Tx FCoE broadcast octets */ 64 + u64 txf_timeout; /* Tx timeouts */ 65 + u64 txf_parity_errors; /* Transmit parity err */ 66 + u64 txf_fid_parity_errors; /* Transmit FID parity err */ 67 + u64 tx_pause; /* Tx pause frames */ 68 + u64 tx_zero_pause; /* Tx zero pause frames */ 69 + u64 tx_first_pause; /* Tx first pause frames */ 70 + u64 rx_pause; /* Rx pause frames */ 71 + u64 rx_zero_pause; /* Rx zero pause frames */ 72 + u64 rx_first_pause; /* Rx first pause frames */ 73 + u64 rxf_ucast_octets; /* Rx unicast octets */ 74 + u64 rxf_ucast; /* Rx unicast frames */ 75 + u64 rxf_ucast_vlan; /* Rx unicast vlan frames */ 76 + u64 rxf_mcast_octets; /* Rx multicast octets */ 77 + u64 rxf_mcast; /* Rx multicast frames */ 78 + u64 rxf_mcast_vlan; /* Rx multicast vlan frames */ 79 + u64 rxf_bcast_octets; /* Rx broadcast octests */ 80 + u64 rxf_bcast; /* Rx broadcast frames */ 81 + u64 rxf_bcast_vlan; /* Rx broadcast vlan frames */ 82 + }; 83 + 84 + /** 85 + * QoS or FCoE stats (fcport stats excluding physical FC port stats) 86 + */ 87 + union bfa_fcport_stats_u { 88 + struct bfa_qos_stats_s fcqos; 89 + struct bfa_fcoe_stats_s fcoe; 90 + }; 91 + 92 + #pragma pack() 93 + 94 + #endif /* __BFA_DEFS_FCPORT_H__ */
+1
drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h
··· 236 236 u32 disc_err; /* Discovery advt. parse errors */ 237 237 u32 disc_unsol; /* Discovery unsolicited */ 238 238 u32 disc_timeouts; /* Discovery timeouts */ 239 + u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */ 239 240 u32 linksvc_unsupp; /* Unsupported link service req */ 240 241 u32 linksvc_err; /* Parse error in link service req */ 241 242 u32 logo_req; /* Number of FIP logos received */
+1 -1
drivers/scsi/bfa/loop.c
··· 162 162 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), alpa, 163 163 bfa_fcs_port_get_fcid(port), 0, 164 164 port->port_cfg.pwwn, port->port_cfg.nwwn, 165 - bfa_pport_get_maxfrsize(port->fcs->bfa)); 165 + bfa_fcport_get_maxfrsize(port->fcs->bfa)); 166 166 167 167 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, 168 168 FC_CLASS_3, len, &fchs,
+1 -1
drivers/scsi/bfa/lport_api.c
··· 156 156 /* 157 157 * Get Physical port's current speed 158 158 */ 159 - bfa_pport_get_attr(port->fcs->bfa, &pport_attr); 159 + bfa_fcport_get_attr(port->fcs->bfa, &pport_attr); 160 160 pport_speed = pport_attr.speed; 161 161 bfa_trc(fcs, pport_speed); 162 162
+1 -1
drivers/scsi/bfa/ms.c
··· 637 637 bfa_os_hton3b(FC_MGMT_SERVER), 638 638 bfa_fcs_port_get_fcid(port), 0, 639 639 port->port_cfg.pwwn, port->port_cfg.nwwn, 640 - bfa_pport_get_maxfrsize(port->fcs->bfa)); 640 + bfa_fcport_get_maxfrsize(port->fcs->bfa)); 641 641 642 642 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, 643 643 FC_CLASS_3, len, &fchs, bfa_fcs_port_ms_plogi_response,
+1 -1
drivers/scsi/bfa/ns.c
··· 660 660 bfa_os_hton3b(FC_NAME_SERVER), 661 661 bfa_fcs_port_get_fcid(port), 0, 662 662 port->port_cfg.pwwn, port->port_cfg.nwwn, 663 - bfa_pport_get_maxfrsize(port->fcs->bfa)); 663 + bfa_fcport_get_maxfrsize(port->fcs->bfa)); 664 664 665 665 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, 666 666 FC_CLASS_3, len, &fchs, bfa_fcs_port_ns_plogi_response,
+4 -4
drivers/scsi/bfa/rport.c
··· 1373 1373 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, 1374 1374 bfa_fcs_port_get_fcid(port), 0, 1375 1375 port->port_cfg.pwwn, port->port_cfg.nwwn, 1376 - bfa_pport_get_maxfrsize(port->fcs->bfa)); 1376 + bfa_fcport_get_maxfrsize(port->fcs->bfa)); 1377 1377 1378 1378 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, 1379 1379 FC_CLASS_3, len, &fchs, bfa_fcs_rport_plogi_response, ··· 1485 1485 len = fc_plogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, 1486 1486 bfa_fcs_port_get_fcid(port), rport->reply_oxid, 1487 1487 port->port_cfg.pwwn, port->port_cfg.nwwn, 1488 - bfa_pport_get_maxfrsize(port->fcs->bfa)); 1488 + bfa_fcport_get_maxfrsize(port->fcs->bfa)); 1489 1489 1490 1490 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, 1491 1491 FC_CLASS_3, len, &fchs, NULL, NULL, FC_MAX_PDUSZ, 0); ··· 1820 1820 /* 1821 1821 * get curent speed from pport attributes from BFA 1822 1822 */ 1823 - bfa_pport_get_attr(port->fcs->bfa, &pport_attr); 1823 + bfa_fcport_get_attr(port->fcs->bfa, &pport_attr); 1824 1824 1825 1825 speeds.port_op_speed = fc_bfa_speed_to_rpsc_operspeed(pport_attr.speed); 1826 1826 ··· 2171 2171 bfa_trc(port->fcs, port->fabric->bb_credit); 2172 2172 2173 2173 port->fabric->bb_credit = bfa_os_ntohs(plogi->csp.bbcred); 2174 - bfa_pport_set_tx_bbcredit(port->fcs->bfa, 2174 + bfa_fcport_set_tx_bbcredit(port->fcs->bfa, 2175 2175 port->fabric->bb_credit); 2176 2176 } 2177 2177
+1 -1
drivers/scsi/bfa/rport_api.c
··· 102 102 rport_attr->qos_attr = qos_attr; 103 103 104 104 rport_attr->trl_enforced = BFA_FALSE; 105 - if (bfa_pport_is_ratelim(port->fcs->bfa)) { 105 + if (bfa_fcport_is_ratelim(port->fcs->bfa)) { 106 106 if ((rport->rpf.rpsc_speed == BFA_PPORT_SPEED_UNKNOWN) || 107 107 (rport->rpf.rpsc_speed < 108 108 bfa_fcs_port_get_rport_max_speed(port)))
+1 -1
drivers/scsi/bfa/vport.c
··· 478 478 bfa_fcs_vport_do_fdisc(struct bfa_fcs_vport_s *vport) 479 479 { 480 480 bfa_lps_fdisc(vport->lps, vport, 481 - bfa_pport_get_maxfrsize(__vport_bfa(vport)), 481 + bfa_fcport_get_maxfrsize(__vport_bfa(vport)), 482 482 __vport_pwwn(vport), __vport_nwwn(vport)); 483 483 vport->vport_stats.fdisc_sent++; 484 484 }