31 */ 32 33#ifndef _SYS_HUNT_IMPL_H 34#define _SYS_HUNT_IMPL_H 35 36#include "efx.h" 37#include "efx_regs.h" 38#include "efx_regs_ef10.h" 39#include "efx_mcdi.h" 40 41#ifdef __cplusplus 42extern "C" { 43#endif 44 45#define HUNTINGTON_NVRAM_CHUNK 0x80 46 47/* Alignment requirement for value written to RX WPTR: 48 * the WPTR must be aligned to an 8 descriptor boundary 49 */ 50#define HUNTINGTON_RX_WPTR_ALIGN 8 51 52/* Invalid RSS context handle */ 53#define HUNTINGTON_RSS_CONTEXT_INVALID (0xffffffff) 54 55 56/* EV */ 57 58 __checkReturn efx_rc_t 59hunt_ev_init( 60 __in efx_nic_t *enp); 61 62 void 63hunt_ev_fini( 64 __in efx_nic_t *enp); 65 66 __checkReturn efx_rc_t 67hunt_ev_qcreate( 68 __in efx_nic_t *enp, 69 __in unsigned int index, 70 __in efsys_mem_t *esmp, 71 __in size_t n, 72 __in uint32_t id, 73 __in efx_evq_t *eep); 74 75 void 76hunt_ev_qdestroy( 77 __in efx_evq_t *eep); 78 79 __checkReturn efx_rc_t 80hunt_ev_qprime( 81 __in efx_evq_t *eep, 82 __in unsigned int count); 83 84 void 85hunt_ev_qpost( 86 __in efx_evq_t *eep, 87 __in uint16_t data); 88 89 __checkReturn efx_rc_t 90hunt_ev_qmoderate( 91 __in efx_evq_t *eep, 92 __in unsigned int us); 93 94#if EFSYS_OPT_QSTATS 95 void 96hunt_ev_qstats_update( 97 __in efx_evq_t *eep, 98 __inout_ecount(EV_NQSTATS) efsys_stat_t *stat); 99#endif /* EFSYS_OPT_QSTATS */ 100 101 void 102hunt_ev_rxlabel_init( 103 __in efx_evq_t *eep, 104 __in efx_rxq_t *erp, 105 __in unsigned int label); 106 107 void 108hunt_ev_rxlabel_fini( 109 __in efx_evq_t *eep, 110 __in unsigned int label); 111 112/* INTR */ 113 114 __checkReturn efx_rc_t 115hunt_intr_init( 116 __in efx_nic_t *enp, 117 __in efx_intr_type_t type, 118 __in efsys_mem_t *esmp); 119 120 void 121hunt_intr_enable( 122 __in efx_nic_t *enp); 123 124 void 125hunt_intr_disable( 126 __in efx_nic_t *enp); 127 128 void 129hunt_intr_disable_unlocked( 130 __in efx_nic_t *enp); 131 132 __checkReturn efx_rc_t 133hunt_intr_trigger( 134 __in efx_nic_t *enp, 135 __in unsigned int level); 136 137 void 138hunt_intr_fini( 139 __in efx_nic_t *enp); 140 141/* NIC */ 142 143extern __checkReturn efx_rc_t 144hunt_nic_probe( 145 __in efx_nic_t *enp); 146 147extern __checkReturn efx_rc_t 148hunt_nic_set_drv_limits( 149 __inout efx_nic_t *enp, 150 __in efx_drv_limits_t *edlp); 151 152extern __checkReturn efx_rc_t 153hunt_nic_get_vi_pool( 154 __in efx_nic_t *enp, 155 __out uint32_t *vi_countp); 156 157extern __checkReturn efx_rc_t 158hunt_nic_get_bar_region( 159 __in efx_nic_t *enp, 160 __in efx_nic_region_t region, 161 __out uint32_t *offsetp, 162 __out size_t *sizep); 163 164extern __checkReturn efx_rc_t 165hunt_nic_reset( 166 __in efx_nic_t *enp); 167 168extern __checkReturn efx_rc_t 169hunt_nic_init( 170 __in efx_nic_t *enp); 171 172#if EFSYS_OPT_DIAG 173 174extern __checkReturn efx_rc_t 175hunt_nic_register_test( 176 __in efx_nic_t *enp); 177 178#endif /* EFSYS_OPT_DIAG */ 179 180extern void 181hunt_nic_fini( 182 __in efx_nic_t *enp); 183 184extern void 185hunt_nic_unprobe( 186 __in efx_nic_t *enp); 187 188 189/* MAC */ 190 191extern __checkReturn efx_rc_t 192hunt_mac_poll( 193 __in efx_nic_t *enp, 194 __out efx_link_mode_t *link_modep); 195 196extern __checkReturn efx_rc_t 197hunt_mac_up( 198 __in efx_nic_t *enp, 199 __out boolean_t *mac_upp); 200 201extern __checkReturn efx_rc_t 202hunt_mac_addr_set( 203 __in efx_nic_t *enp); 204 205extern __checkReturn efx_rc_t 206hunt_mac_reconfigure( 207 __in efx_nic_t *enp); 208 209extern __checkReturn efx_rc_t 210hunt_mac_multicast_list_set( 211 __in efx_nic_t *enp); 212 213extern __checkReturn efx_rc_t 214hunt_mac_filter_default_rxq_set( 215 __in efx_nic_t *enp, 216 __in efx_rxq_t *erp, 217 __in boolean_t using_rss); 218 219extern void 220hunt_mac_filter_default_rxq_clear( 221 __in efx_nic_t *enp); 222 223#if EFSYS_OPT_LOOPBACK 224 225extern __checkReturn efx_rc_t 226hunt_mac_loopback_set( 227 __in efx_nic_t *enp, 228 __in efx_link_mode_t link_mode, 229 __in efx_loopback_type_t loopback_type); 230 231#endif /* EFSYS_OPT_LOOPBACK */ 232 233#if EFSYS_OPT_MAC_STATS 234 235extern __checkReturn efx_rc_t 236hunt_mac_stats_update( 237 __in efx_nic_t *enp, 238 __in efsys_mem_t *esmp, 239 __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, 240 __inout_opt uint32_t *generationp); 241 242#endif /* EFSYS_OPT_MAC_STATS */ 243 244 245/* MCDI */ 246 247#if EFSYS_OPT_MCDI 248 249extern __checkReturn efx_rc_t 250hunt_mcdi_init( 251 __in efx_nic_t *enp, 252 __in const efx_mcdi_transport_t *mtp); 253 254extern void 255hunt_mcdi_fini( 256 __in efx_nic_t *enp); 257 258extern void 259hunt_mcdi_request_copyin( 260 __in efx_nic_t *enp, 261 __in efx_mcdi_req_t *emrp, 262 __in unsigned int seq, 263 __in boolean_t ev_cpl, 264 __in boolean_t new_epoch); 265 266extern __checkReturn boolean_t 267hunt_mcdi_request_poll( 268 __in efx_nic_t *enp); 269 270extern void 271hunt_mcdi_request_copyout( 272 __in efx_nic_t *enp, 273 __in efx_mcdi_req_t *emrp); 274 275extern efx_rc_t 276hunt_mcdi_poll_reboot( 277 __in efx_nic_t *enp); 278 279extern __checkReturn efx_rc_t 280hunt_mcdi_fw_update_supported( 281 __in efx_nic_t *enp, 282 __out boolean_t *supportedp); 283 284extern __checkReturn efx_rc_t 285hunt_mcdi_macaddr_change_supported( 286 __in efx_nic_t *enp, 287 __out boolean_t *supportedp); 288
| 31 */ 32 33#ifndef _SYS_HUNT_IMPL_H 34#define _SYS_HUNT_IMPL_H 35 36#include "efx.h" 37#include "efx_regs.h" 38#include "efx_regs_ef10.h" 39#include "efx_mcdi.h" 40 41#ifdef __cplusplus 42extern "C" { 43#endif 44 45#define HUNTINGTON_NVRAM_CHUNK 0x80 46 47/* Alignment requirement for value written to RX WPTR: 48 * the WPTR must be aligned to an 8 descriptor boundary 49 */ 50#define HUNTINGTON_RX_WPTR_ALIGN 8 51 52/* Invalid RSS context handle */ 53#define HUNTINGTON_RSS_CONTEXT_INVALID (0xffffffff) 54 55 56/* EV */ 57 58 __checkReturn efx_rc_t 59hunt_ev_init( 60 __in efx_nic_t *enp); 61 62 void 63hunt_ev_fini( 64 __in efx_nic_t *enp); 65 66 __checkReturn efx_rc_t 67hunt_ev_qcreate( 68 __in efx_nic_t *enp, 69 __in unsigned int index, 70 __in efsys_mem_t *esmp, 71 __in size_t n, 72 __in uint32_t id, 73 __in efx_evq_t *eep); 74 75 void 76hunt_ev_qdestroy( 77 __in efx_evq_t *eep); 78 79 __checkReturn efx_rc_t 80hunt_ev_qprime( 81 __in efx_evq_t *eep, 82 __in unsigned int count); 83 84 void 85hunt_ev_qpost( 86 __in efx_evq_t *eep, 87 __in uint16_t data); 88 89 __checkReturn efx_rc_t 90hunt_ev_qmoderate( 91 __in efx_evq_t *eep, 92 __in unsigned int us); 93 94#if EFSYS_OPT_QSTATS 95 void 96hunt_ev_qstats_update( 97 __in efx_evq_t *eep, 98 __inout_ecount(EV_NQSTATS) efsys_stat_t *stat); 99#endif /* EFSYS_OPT_QSTATS */ 100 101 void 102hunt_ev_rxlabel_init( 103 __in efx_evq_t *eep, 104 __in efx_rxq_t *erp, 105 __in unsigned int label); 106 107 void 108hunt_ev_rxlabel_fini( 109 __in efx_evq_t *eep, 110 __in unsigned int label); 111 112/* INTR */ 113 114 __checkReturn efx_rc_t 115hunt_intr_init( 116 __in efx_nic_t *enp, 117 __in efx_intr_type_t type, 118 __in efsys_mem_t *esmp); 119 120 void 121hunt_intr_enable( 122 __in efx_nic_t *enp); 123 124 void 125hunt_intr_disable( 126 __in efx_nic_t *enp); 127 128 void 129hunt_intr_disable_unlocked( 130 __in efx_nic_t *enp); 131 132 __checkReturn efx_rc_t 133hunt_intr_trigger( 134 __in efx_nic_t *enp, 135 __in unsigned int level); 136 137 void 138hunt_intr_fini( 139 __in efx_nic_t *enp); 140 141/* NIC */ 142 143extern __checkReturn efx_rc_t 144hunt_nic_probe( 145 __in efx_nic_t *enp); 146 147extern __checkReturn efx_rc_t 148hunt_nic_set_drv_limits( 149 __inout efx_nic_t *enp, 150 __in efx_drv_limits_t *edlp); 151 152extern __checkReturn efx_rc_t 153hunt_nic_get_vi_pool( 154 __in efx_nic_t *enp, 155 __out uint32_t *vi_countp); 156 157extern __checkReturn efx_rc_t 158hunt_nic_get_bar_region( 159 __in efx_nic_t *enp, 160 __in efx_nic_region_t region, 161 __out uint32_t *offsetp, 162 __out size_t *sizep); 163 164extern __checkReturn efx_rc_t 165hunt_nic_reset( 166 __in efx_nic_t *enp); 167 168extern __checkReturn efx_rc_t 169hunt_nic_init( 170 __in efx_nic_t *enp); 171 172#if EFSYS_OPT_DIAG 173 174extern __checkReturn efx_rc_t 175hunt_nic_register_test( 176 __in efx_nic_t *enp); 177 178#endif /* EFSYS_OPT_DIAG */ 179 180extern void 181hunt_nic_fini( 182 __in efx_nic_t *enp); 183 184extern void 185hunt_nic_unprobe( 186 __in efx_nic_t *enp); 187 188 189/* MAC */ 190 191extern __checkReturn efx_rc_t 192hunt_mac_poll( 193 __in efx_nic_t *enp, 194 __out efx_link_mode_t *link_modep); 195 196extern __checkReturn efx_rc_t 197hunt_mac_up( 198 __in efx_nic_t *enp, 199 __out boolean_t *mac_upp); 200 201extern __checkReturn efx_rc_t 202hunt_mac_addr_set( 203 __in efx_nic_t *enp); 204 205extern __checkReturn efx_rc_t 206hunt_mac_reconfigure( 207 __in efx_nic_t *enp); 208 209extern __checkReturn efx_rc_t 210hunt_mac_multicast_list_set( 211 __in efx_nic_t *enp); 212 213extern __checkReturn efx_rc_t 214hunt_mac_filter_default_rxq_set( 215 __in efx_nic_t *enp, 216 __in efx_rxq_t *erp, 217 __in boolean_t using_rss); 218 219extern void 220hunt_mac_filter_default_rxq_clear( 221 __in efx_nic_t *enp); 222 223#if EFSYS_OPT_LOOPBACK 224 225extern __checkReturn efx_rc_t 226hunt_mac_loopback_set( 227 __in efx_nic_t *enp, 228 __in efx_link_mode_t link_mode, 229 __in efx_loopback_type_t loopback_type); 230 231#endif /* EFSYS_OPT_LOOPBACK */ 232 233#if EFSYS_OPT_MAC_STATS 234 235extern __checkReturn efx_rc_t 236hunt_mac_stats_update( 237 __in efx_nic_t *enp, 238 __in efsys_mem_t *esmp, 239 __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, 240 __inout_opt uint32_t *generationp); 241 242#endif /* EFSYS_OPT_MAC_STATS */ 243 244 245/* MCDI */ 246 247#if EFSYS_OPT_MCDI 248 249extern __checkReturn efx_rc_t 250hunt_mcdi_init( 251 __in efx_nic_t *enp, 252 __in const efx_mcdi_transport_t *mtp); 253 254extern void 255hunt_mcdi_fini( 256 __in efx_nic_t *enp); 257 258extern void 259hunt_mcdi_request_copyin( 260 __in efx_nic_t *enp, 261 __in efx_mcdi_req_t *emrp, 262 __in unsigned int seq, 263 __in boolean_t ev_cpl, 264 __in boolean_t new_epoch); 265 266extern __checkReturn boolean_t 267hunt_mcdi_request_poll( 268 __in efx_nic_t *enp); 269 270extern void 271hunt_mcdi_request_copyout( 272 __in efx_nic_t *enp, 273 __in efx_mcdi_req_t *emrp); 274 275extern efx_rc_t 276hunt_mcdi_poll_reboot( 277 __in efx_nic_t *enp); 278 279extern __checkReturn efx_rc_t 280hunt_mcdi_fw_update_supported( 281 __in efx_nic_t *enp, 282 __out boolean_t *supportedp); 283 284extern __checkReturn efx_rc_t 285hunt_mcdi_macaddr_change_supported( 286 __in efx_nic_t *enp, 287 __out boolean_t *supportedp); 288
|
289#endif /* EFSYS_OPT_MCDI */ 290 291/* NVRAM */ 292 293#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD 294 295extern __checkReturn efx_rc_t 296hunt_nvram_buf_read_tlv( 297 __in efx_nic_t *enp, 298 __in_bcount(max_seg_size) caddr_t seg_data, 299 __in size_t max_seg_size, 300 __in uint32_t tag, 301 __deref_out_bcount_opt(*sizep) caddr_t *datap, 302 __out size_t *sizep); 303 304extern __checkReturn efx_rc_t 305hunt_nvram_buf_write_tlv( 306 __inout_bcount(partn_size) caddr_t partn_data, 307 __in size_t partn_size, 308 __in uint32_t tag, 309 __in_bcount(tag_size) caddr_t tag_data, 310 __in size_t tag_size, 311 __out size_t *total_lengthp); 312 313extern __checkReturn efx_rc_t 314hunt_nvram_partn_read_tlv( 315 __in efx_nic_t *enp, 316 __in uint32_t partn, 317 __in uint32_t tag, 318 __deref_out_bcount_opt(*sizep) caddr_t *datap, 319 __out size_t *sizep); 320 321extern __checkReturn efx_rc_t 322hunt_nvram_partn_write_tlv( 323 __in efx_nic_t *enp, 324 __in uint32_t partn, 325 __in uint32_t tag, 326 __in_bcount(size) caddr_t data, 327 __in size_t size); 328 329extern __checkReturn efx_rc_t 330hunt_nvram_partn_write_segment_tlv( 331 __in efx_nic_t *enp, 332 __in uint32_t partn, 333 __in uint32_t tag, 334 __in_bcount(size) caddr_t data, 335 __in size_t size, 336 __in boolean_t all_segments); 337 338extern __checkReturn efx_rc_t 339hunt_nvram_partn_size( 340 __in efx_nic_t *enp, 341 __in unsigned int partn, 342 __out size_t *sizep); 343 344extern __checkReturn efx_rc_t 345hunt_nvram_partn_lock( 346 __in efx_nic_t *enp, 347 __in unsigned int partn); 348 349extern __checkReturn efx_rc_t 350hunt_nvram_partn_read( 351 __in efx_nic_t *enp, 352 __in unsigned int partn, 353 __in unsigned int offset, 354 __out_bcount(size) caddr_t data, 355 __in size_t size); 356 357extern __checkReturn efx_rc_t 358hunt_nvram_partn_erase( 359 __in efx_nic_t *enp, 360 __in unsigned int partn, 361 __in unsigned int offset, 362 __in size_t size); 363 364extern __checkReturn efx_rc_t 365hunt_nvram_partn_write( 366 __in efx_nic_t *enp, 367 __in unsigned int partn, 368 __in unsigned int offset, 369 __out_bcount(size) caddr_t data, 370 __in size_t size); 371 372extern void 373hunt_nvram_partn_unlock( 374 __in efx_nic_t *enp, 375 __in unsigned int partn); 376 377#endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ 378 379#if EFSYS_OPT_NVRAM 380 381#if EFSYS_OPT_DIAG 382 383extern __checkReturn efx_rc_t 384hunt_nvram_test( 385 __in efx_nic_t *enp); 386 387#endif /* EFSYS_OPT_DIAG */ 388 389extern __checkReturn efx_rc_t 390hunt_nvram_size( 391 __in efx_nic_t *enp, 392 __in efx_nvram_type_t type, 393 __out size_t *sizep); 394 395extern __checkReturn efx_rc_t 396hunt_nvram_get_version( 397 __in efx_nic_t *enp, 398 __in efx_nvram_type_t type, 399 __out uint32_t *subtypep, 400 __out_ecount(4) uint16_t version[4]); 401 402extern __checkReturn efx_rc_t 403hunt_nvram_rw_start( 404 __in efx_nic_t *enp, 405 __in efx_nvram_type_t type, 406 __out size_t *pref_chunkp); 407 408extern __checkReturn efx_rc_t 409hunt_nvram_read_chunk( 410 __in efx_nic_t *enp, 411 __in efx_nvram_type_t type, 412 __in unsigned int offset, 413 __out_bcount(size) caddr_t data, 414 __in size_t size); 415 416extern __checkReturn efx_rc_t 417hunt_nvram_erase( 418 __in efx_nic_t *enp, 419 __in efx_nvram_type_t type); 420 421extern __checkReturn efx_rc_t 422hunt_nvram_write_chunk( 423 __in efx_nic_t *enp, 424 __in efx_nvram_type_t type, 425 __in unsigned int offset, 426 __in_bcount(size) caddr_t data, 427 __in size_t size); 428 429extern void 430hunt_nvram_rw_finish( 431 __in efx_nic_t *enp, 432 __in efx_nvram_type_t type); 433 434extern __checkReturn efx_rc_t 435hunt_nvram_partn_set_version( 436 __in efx_nic_t *enp, 437 __in unsigned int partn, 438 __in_ecount(4) uint16_t version[4]); 439 440extern __checkReturn efx_rc_t 441hunt_nvram_set_version( 442 __in efx_nic_t *enp, 443 __in efx_nvram_type_t type, 444 __in_ecount(4) uint16_t version[4]); 445 446#endif /* EFSYS_OPT_NVRAM */ 447 448 449/* PHY */ 450 451typedef struct hunt_link_state_s { 452 uint32_t hls_adv_cap_mask; 453 uint32_t hls_lp_cap_mask; 454 unsigned int hls_fcntl; 455 efx_link_mode_t hls_link_mode; 456#if EFSYS_OPT_LOOPBACK 457 efx_loopback_type_t hls_loopback; 458#endif 459 boolean_t hls_mac_up; 460} hunt_link_state_t; 461 462extern void 463hunt_phy_link_ev( 464 __in efx_nic_t *enp, 465 __in efx_qword_t *eqp, 466 __out efx_link_mode_t *link_modep); 467 468extern __checkReturn efx_rc_t 469hunt_phy_get_link( 470 __in efx_nic_t *enp, 471 __out hunt_link_state_t *hlsp); 472 473extern __checkReturn efx_rc_t 474hunt_phy_power( 475 __in efx_nic_t *enp, 476 __in boolean_t on); 477 478extern __checkReturn efx_rc_t 479hunt_phy_reconfigure( 480 __in efx_nic_t *enp); 481 482extern __checkReturn efx_rc_t 483hunt_phy_verify( 484 __in efx_nic_t *enp); 485 486extern __checkReturn efx_rc_t 487hunt_phy_oui_get( 488 __in efx_nic_t *enp, 489 __out uint32_t *ouip); 490 491#if EFSYS_OPT_PHY_STATS 492 493extern __checkReturn efx_rc_t 494hunt_phy_stats_update( 495 __in efx_nic_t *enp, 496 __in efsys_mem_t *esmp, 497 __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); 498 499#endif /* EFSYS_OPT_PHY_STATS */ 500 501#if EFSYS_OPT_PHY_PROPS 502 503#if EFSYS_OPT_NAMES 504 505extern const char * 506hunt_phy_prop_name( 507 __in efx_nic_t *enp, 508 __in unsigned int id); 509 510#endif /* EFSYS_OPT_NAMES */ 511 512extern __checkReturn efx_rc_t 513hunt_phy_prop_get( 514 __in efx_nic_t *enp, 515 __in unsigned int id, 516 __in uint32_t flags, 517 __out uint32_t *valp); 518 519extern __checkReturn efx_rc_t 520hunt_phy_prop_set( 521 __in efx_nic_t *enp, 522 __in unsigned int id, 523 __in uint32_t val); 524 525#endif /* EFSYS_OPT_PHY_PROPS */ 526 527#if EFSYS_OPT_BIST 528 529extern __checkReturn efx_rc_t 530hunt_bist_enable_offline( 531 __in efx_nic_t *enp); 532 533extern __checkReturn efx_rc_t 534hunt_bist_start( 535 __in efx_nic_t *enp, 536 __in efx_bist_type_t type); 537 538extern __checkReturn efx_rc_t 539hunt_bist_poll( 540 __in efx_nic_t *enp, 541 __in efx_bist_type_t type, 542 __out efx_bist_result_t *resultp, 543 __out_opt __drv_when(count > 0, __notnull) 544 uint32_t *value_maskp, 545 __out_ecount_opt(count) __drv_when(count > 0, __notnull) 546 unsigned long *valuesp, 547 __in size_t count); 548 549extern void 550hunt_bist_stop( 551 __in efx_nic_t *enp, 552 __in efx_bist_type_t type); 553 554#endif /* EFSYS_OPT_BIST */ 555 556 557/* SRAM */ 558 559#if EFSYS_OPT_DIAG 560 561extern __checkReturn efx_rc_t 562hunt_sram_test( 563 __in efx_nic_t *enp, 564 __in efx_sram_pattern_fn_t func); 565 566#endif /* EFSYS_OPT_DIAG */ 567 568 569/* TX */ 570 571extern __checkReturn efx_rc_t 572hunt_tx_init( 573 __in efx_nic_t *enp); 574 575extern void 576hunt_tx_fini( 577 __in efx_nic_t *enp); 578 579extern __checkReturn efx_rc_t 580hunt_tx_qcreate( 581 __in efx_nic_t *enp, 582 __in unsigned int index, 583 __in unsigned int label, 584 __in efsys_mem_t *esmp, 585 __in size_t n, 586 __in uint32_t id, 587 __in uint16_t flags, 588 __in efx_evq_t *eep, 589 __in efx_txq_t *etp, 590 __out unsigned int *addedp); 591 592extern void 593hunt_tx_qdestroy( 594 __in efx_txq_t *etp); 595 596extern __checkReturn efx_rc_t 597hunt_tx_qpost( 598 __in efx_txq_t *etp, 599 __in_ecount(n) efx_buffer_t *eb, 600 __in unsigned int n, 601 __in unsigned int completed, 602 __inout unsigned int *addedp); 603 604extern void 605hunt_tx_qpush( 606 __in efx_txq_t *etp, 607 __in unsigned int added, 608 __in unsigned int pushed); 609 610extern __checkReturn efx_rc_t 611hunt_tx_qpace( 612 __in efx_txq_t *etp, 613 __in unsigned int ns); 614 615extern __checkReturn efx_rc_t 616hunt_tx_qflush( 617 __in efx_txq_t *etp); 618 619extern void 620hunt_tx_qenable( 621 __in efx_txq_t *etp); 622 623extern __checkReturn efx_rc_t 624hunt_tx_qpio_enable( 625 __in efx_txq_t *etp); 626 627extern void 628hunt_tx_qpio_disable( 629 __in efx_txq_t *etp); 630 631extern __checkReturn efx_rc_t 632hunt_tx_qpio_write( 633 __in efx_txq_t *etp, 634 __in_ecount(buf_length) uint8_t *buffer, 635 __in size_t buf_length, 636 __in size_t pio_buf_offset); 637 638extern __checkReturn efx_rc_t 639hunt_tx_qpio_post( 640 __in efx_txq_t *etp, 641 __in size_t pkt_length, 642 __in unsigned int completed, 643 __inout unsigned int *addedp); 644 645extern __checkReturn efx_rc_t 646hunt_tx_qdesc_post( 647 __in efx_txq_t *etp, 648 __in_ecount(n) efx_desc_t *ed, 649 __in unsigned int n, 650 __in unsigned int completed, 651 __inout unsigned int *addedp); 652 653extern void 654hunt_tx_qdesc_dma_create( 655 __in efx_txq_t *etp, 656 __in efsys_dma_addr_t addr, 657 __in size_t size, 658 __in boolean_t eop, 659 __out efx_desc_t *edp); 660 661extern void 662hunt_tx_qdesc_tso_create( 663 __in efx_txq_t *etp, 664 __in uint16_t ipv4_id, 665 __in uint32_t tcp_seq, 666 __in uint8_t tcp_flags, 667 __out efx_desc_t *edp); 668 669extern void 670hunt_tx_qdesc_vlantci_create( 671 __in efx_txq_t *etp, 672 __in uint16_t vlan_tci, 673 __out efx_desc_t *edp); 674 675 676#if EFSYS_OPT_QSTATS 677 678extern void 679hunt_tx_qstats_update( 680 __in efx_txq_t *etp, 681 __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); 682 683#endif /* EFSYS_OPT_QSTATS */ 684 685/* PIO */ 686 687/* Missing register definitions */ 688#ifndef ER_DZ_TX_PIOBUF_OFST 689#define ER_DZ_TX_PIOBUF_OFST 0x00001000 690#endif 691#ifndef ER_DZ_TX_PIOBUF_STEP 692#define ER_DZ_TX_PIOBUF_STEP 8192 693#endif 694#ifndef ER_DZ_TX_PIOBUF_ROWS 695#define ER_DZ_TX_PIOBUF_ROWS 2048 696#endif 697 698#ifndef ER_DZ_TX_PIOBUF_SIZE 699#define ER_DZ_TX_PIOBUF_SIZE 2048 700#endif 701 702#define HUNT_PIOBUF_NBUFS (16) 703#define HUNT_PIOBUF_SIZE (ER_DZ_TX_PIOBUF_SIZE) 704 705#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) 706 707#define HUNT_LEGACY_PF_PRIVILEGE_MASK \ 708 (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ 709 MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ 710 MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ 711 MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP | \ 712 MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS | \ 713 MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING | \ 714 MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST | \ 715 MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST | \ 716 MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST | \ 717 MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ 718 MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) 719 720#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0 721 722typedef uint32_t efx_piobuf_handle_t; 723 724#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) 725 726extern __checkReturn efx_rc_t 727hunt_nic_pio_alloc( 728 __inout efx_nic_t *enp, 729 __out uint32_t *bufnump, 730 __out efx_piobuf_handle_t *handlep, 731 __out uint32_t *blknump, 732 __out uint32_t *offsetp, 733 __out size_t *sizep); 734 735extern __checkReturn efx_rc_t 736hunt_nic_pio_free( 737 __inout efx_nic_t *enp, 738 __in uint32_t bufnum, 739 __in uint32_t blknum); 740 741extern __checkReturn efx_rc_t 742hunt_nic_pio_link( 743 __inout efx_nic_t *enp, 744 __in uint32_t vi_index, 745 __in efx_piobuf_handle_t handle); 746 747extern __checkReturn efx_rc_t 748hunt_nic_pio_unlink( 749 __inout efx_nic_t *enp, 750 __in uint32_t vi_index); 751 752 753/* VPD */ 754 755#if EFSYS_OPT_VPD 756 757extern __checkReturn efx_rc_t 758hunt_vpd_init( 759 __in efx_nic_t *enp); 760 761extern __checkReturn efx_rc_t 762hunt_vpd_size( 763 __in efx_nic_t *enp, 764 __out size_t *sizep); 765 766extern __checkReturn efx_rc_t 767hunt_vpd_read( 768 __in efx_nic_t *enp, 769 __out_bcount(size) caddr_t data, 770 __in size_t size); 771 772extern __checkReturn efx_rc_t 773hunt_vpd_verify( 774 __in efx_nic_t *enp, 775 __in_bcount(size) caddr_t data, 776 __in size_t size); 777 778extern __checkReturn efx_rc_t 779hunt_vpd_reinit( 780 __in efx_nic_t *enp, 781 __in_bcount(size) caddr_t data, 782 __in size_t size); 783 784extern __checkReturn efx_rc_t 785hunt_vpd_get( 786 __in efx_nic_t *enp, 787 __in_bcount(size) caddr_t data, 788 __in size_t size, 789 __inout efx_vpd_value_t *evvp); 790 791extern __checkReturn efx_rc_t 792hunt_vpd_set( 793 __in efx_nic_t *enp, 794 __in_bcount(size) caddr_t data, 795 __in size_t size, 796 __in efx_vpd_value_t *evvp); 797 798extern __checkReturn efx_rc_t 799hunt_vpd_next( 800 __in efx_nic_t *enp, 801 __in_bcount(size) caddr_t data, 802 __in size_t size, 803 __out efx_vpd_value_t *evvp, 804 __inout unsigned int *contp); 805 806extern __checkReturn efx_rc_t 807hunt_vpd_write( 808 __in efx_nic_t *enp, 809 __in_bcount(size) caddr_t data, 810 __in size_t size); 811 812extern void 813hunt_vpd_fini( 814 __in efx_nic_t *enp); 815 816#endif /* EFSYS_OPT_VPD */ 817 818 819/* RX */ 820 821extern __checkReturn efx_rc_t 822hunt_rx_init( 823 __in efx_nic_t *enp); 824 825#if EFSYS_OPT_RX_HDR_SPLIT 826extern __checkReturn efx_rc_t 827hunt_rx_hdr_split_enable( 828 __in efx_nic_t *enp, 829 __in unsigned int hdr_buf_size, 830 __in unsigned int pld_buf_size); 831#endif /* EFSYS_OPT_RX_HDR_SPLIT */ 832 833#if EFSYS_OPT_RX_SCATTER 834extern __checkReturn efx_rc_t 835hunt_rx_scatter_enable( 836 __in efx_nic_t *enp, 837 __in unsigned int buf_size); 838#endif /* EFSYS_OPT_RX_SCATTER */ 839 840 841#if EFSYS_OPT_RX_SCALE 842 843extern __checkReturn efx_rc_t 844hunt_rx_scale_mode_set( 845 __in efx_nic_t *enp, 846 __in efx_rx_hash_alg_t alg, 847 __in efx_rx_hash_type_t type, 848 __in boolean_t insert); 849 850extern __checkReturn efx_rc_t 851hunt_rx_scale_key_set( 852 __in efx_nic_t *enp, 853 __in_ecount(n) uint8_t *key, 854 __in size_t n); 855 856extern __checkReturn efx_rc_t 857hunt_rx_scale_tbl_set( 858 __in efx_nic_t *enp, 859 __in_ecount(n) unsigned int *table, 860 __in size_t n); 861 862#endif /* EFSYS_OPT_RX_SCALE */ 863 864extern void 865hunt_rx_qpost( 866 __in efx_rxq_t *erp, 867 __in_ecount(n) efsys_dma_addr_t *addrp, 868 __in size_t size, 869 __in unsigned int n, 870 __in unsigned int completed, 871 __in unsigned int added); 872 873extern void 874hunt_rx_qpush( 875 __in efx_rxq_t *erp, 876 __in unsigned int added, 877 __inout unsigned int *pushedp); 878 879extern __checkReturn efx_rc_t 880hunt_rx_qflush( 881 __in efx_rxq_t *erp); 882 883extern void 884hunt_rx_qenable( 885 __in efx_rxq_t *erp); 886 887extern __checkReturn efx_rc_t 888hunt_rx_qcreate( 889 __in efx_nic_t *enp, 890 __in unsigned int index, 891 __in unsigned int label, 892 __in efx_rxq_type_t type, 893 __in efsys_mem_t *esmp, 894 __in size_t n, 895 __in uint32_t id, 896 __in efx_evq_t *eep, 897 __in efx_rxq_t *erp); 898 899extern void 900hunt_rx_qdestroy( 901 __in efx_rxq_t *erp); 902 903extern void 904hunt_rx_fini( 905 __in efx_nic_t *enp); 906 907#if EFSYS_OPT_FILTER 908 909typedef struct hunt_filter_handle_s { 910 uint32_t hfh_lo; 911 uint32_t hfh_hi; 912} hunt_filter_handle_t; 913 914typedef struct hunt_filter_entry_s { 915 uintptr_t hfe_spec; /* pointer to filter spec plus busy bit */ 916 hunt_filter_handle_t hfe_handle; 917} hunt_filter_entry_t; 918 919/* 920 * BUSY flag indicates that an update is in progress. 921 * AUTO_OLD flag is used to mark and sweep MAC packet filters. 922 */ 923#define EFX_HUNT_FILTER_FLAG_BUSY 1U 924#define EFX_HUNT_FILTER_FLAG_AUTO_OLD 2U 925#define EFX_HUNT_FILTER_FLAGS 3U 926 927#define EFX_HUNT_FILTER_TBL_ROWS 8192 928 929/* Allow for the broadcast address to be added to the multicast list */ 930#define EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) 931 932typedef struct hunt_filter_table_s { 933 hunt_filter_entry_t hft_entry[EFX_HUNT_FILTER_TBL_ROWS]; 934 efx_rxq_t * hft_default_rxq; 935 boolean_t hft_using_rss; 936 uint32_t hft_unicst_filter_index; 937 boolean_t hft_unicst_filter_set; 938 uint32_t hft_mulcst_filter_indexes[ 939 EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX]; 940 uint32_t hft_mulcst_filter_count; 941} hunt_filter_table_t; 942 943 __checkReturn efx_rc_t 944hunt_filter_init( 945 __in efx_nic_t *enp); 946 947 void 948hunt_filter_fini( 949 __in efx_nic_t *enp); 950 951 __checkReturn efx_rc_t 952hunt_filter_restore( 953 __in efx_nic_t *enp); 954 955 __checkReturn efx_rc_t 956hunt_filter_add( 957 __in efx_nic_t *enp, 958 __inout efx_filter_spec_t *spec, 959 __in boolean_t may_replace); 960 961 __checkReturn efx_rc_t 962hunt_filter_delete( 963 __in efx_nic_t *enp, 964 __inout efx_filter_spec_t *spec); 965 966extern __checkReturn efx_rc_t 967hunt_filter_supported_filters( 968 __in efx_nic_t *enp, 969 __out uint32_t *list, 970 __out size_t *length); 971 972extern __checkReturn efx_rc_t 973hunt_filter_reconfigure( 974 __in efx_nic_t *enp, 975 __in_ecount(6) uint8_t const *mac_addr, 976 __in boolean_t all_unicst, 977 __in boolean_t mulcst, 978 __in boolean_t all_mulcst, 979 __in boolean_t brdcst, 980 __in_ecount(6*count) uint8_t const *addrs, 981 __in int count); 982 983extern void 984hunt_filter_get_default_rxq( 985 __in efx_nic_t *enp, 986 __out efx_rxq_t **erpp, 987 __out boolean_t *using_rss); 988 989extern void 990hunt_filter_default_rxq_set( 991 __in efx_nic_t *enp, 992 __in efx_rxq_t *erp, 993 __in boolean_t using_rss); 994 995extern void 996hunt_filter_default_rxq_clear( 997 __in efx_nic_t *enp); 998 999 1000#endif /* EFSYS_OPT_FILTER */ 1001 1002extern __checkReturn efx_rc_t 1003hunt_pktfilter_set( 1004 __in efx_nic_t *enp, 1005 __in boolean_t unicst, 1006 __in boolean_t brdcst); 1007 1008#if EFSYS_OPT_MCAST_FILTER_LIST 1009 1010extern __checkReturn efx_rc_t 1011hunt_pktfilter_mcast_set( 1012 __in efx_nic_t *enp, 1013 __in uint8_t const *addrs, 1014 __in int count); 1015 1016#endif /* EFSYS_OPT_MCAST_FILTER_LIST */ 1017 1018extern __checkReturn efx_rc_t 1019hunt_pktfilter_mcast_all( 1020 __in efx_nic_t *enp); 1021 1022extern __checkReturn efx_rc_t 1023efx_mcdi_get_function_info( 1024 __in efx_nic_t *enp, 1025 __out uint32_t *pfp, 1026 __out_opt uint32_t *vfp); 1027 1028extern __checkReturn efx_rc_t 1029efx_mcdi_privilege_mask( 1030 __in efx_nic_t *enp, 1031 __in uint32_t pf, 1032 __in uint32_t vf, 1033 __out uint32_t *maskp); 1034 1035#ifdef __cplusplus 1036} 1037#endif 1038 1039#endif /* _SYS_HUNT_IMPL_H */
| 294#endif /* EFSYS_OPT_MCDI */ 295 296/* NVRAM */ 297 298#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD 299 300extern __checkReturn efx_rc_t 301hunt_nvram_buf_read_tlv( 302 __in efx_nic_t *enp, 303 __in_bcount(max_seg_size) caddr_t seg_data, 304 __in size_t max_seg_size, 305 __in uint32_t tag, 306 __deref_out_bcount_opt(*sizep) caddr_t *datap, 307 __out size_t *sizep); 308 309extern __checkReturn efx_rc_t 310hunt_nvram_buf_write_tlv( 311 __inout_bcount(partn_size) caddr_t partn_data, 312 __in size_t partn_size, 313 __in uint32_t tag, 314 __in_bcount(tag_size) caddr_t tag_data, 315 __in size_t tag_size, 316 __out size_t *total_lengthp); 317 318extern __checkReturn efx_rc_t 319hunt_nvram_partn_read_tlv( 320 __in efx_nic_t *enp, 321 __in uint32_t partn, 322 __in uint32_t tag, 323 __deref_out_bcount_opt(*sizep) caddr_t *datap, 324 __out size_t *sizep); 325 326extern __checkReturn efx_rc_t 327hunt_nvram_partn_write_tlv( 328 __in efx_nic_t *enp, 329 __in uint32_t partn, 330 __in uint32_t tag, 331 __in_bcount(size) caddr_t data, 332 __in size_t size); 333 334extern __checkReturn efx_rc_t 335hunt_nvram_partn_write_segment_tlv( 336 __in efx_nic_t *enp, 337 __in uint32_t partn, 338 __in uint32_t tag, 339 __in_bcount(size) caddr_t data, 340 __in size_t size, 341 __in boolean_t all_segments); 342 343extern __checkReturn efx_rc_t 344hunt_nvram_partn_size( 345 __in efx_nic_t *enp, 346 __in unsigned int partn, 347 __out size_t *sizep); 348 349extern __checkReturn efx_rc_t 350hunt_nvram_partn_lock( 351 __in efx_nic_t *enp, 352 __in unsigned int partn); 353 354extern __checkReturn efx_rc_t 355hunt_nvram_partn_read( 356 __in efx_nic_t *enp, 357 __in unsigned int partn, 358 __in unsigned int offset, 359 __out_bcount(size) caddr_t data, 360 __in size_t size); 361 362extern __checkReturn efx_rc_t 363hunt_nvram_partn_erase( 364 __in efx_nic_t *enp, 365 __in unsigned int partn, 366 __in unsigned int offset, 367 __in size_t size); 368 369extern __checkReturn efx_rc_t 370hunt_nvram_partn_write( 371 __in efx_nic_t *enp, 372 __in unsigned int partn, 373 __in unsigned int offset, 374 __out_bcount(size) caddr_t data, 375 __in size_t size); 376 377extern void 378hunt_nvram_partn_unlock( 379 __in efx_nic_t *enp, 380 __in unsigned int partn); 381 382#endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ 383 384#if EFSYS_OPT_NVRAM 385 386#if EFSYS_OPT_DIAG 387 388extern __checkReturn efx_rc_t 389hunt_nvram_test( 390 __in efx_nic_t *enp); 391 392#endif /* EFSYS_OPT_DIAG */ 393 394extern __checkReturn efx_rc_t 395hunt_nvram_size( 396 __in efx_nic_t *enp, 397 __in efx_nvram_type_t type, 398 __out size_t *sizep); 399 400extern __checkReturn efx_rc_t 401hunt_nvram_get_version( 402 __in efx_nic_t *enp, 403 __in efx_nvram_type_t type, 404 __out uint32_t *subtypep, 405 __out_ecount(4) uint16_t version[4]); 406 407extern __checkReturn efx_rc_t 408hunt_nvram_rw_start( 409 __in efx_nic_t *enp, 410 __in efx_nvram_type_t type, 411 __out size_t *pref_chunkp); 412 413extern __checkReturn efx_rc_t 414hunt_nvram_read_chunk( 415 __in efx_nic_t *enp, 416 __in efx_nvram_type_t type, 417 __in unsigned int offset, 418 __out_bcount(size) caddr_t data, 419 __in size_t size); 420 421extern __checkReturn efx_rc_t 422hunt_nvram_erase( 423 __in efx_nic_t *enp, 424 __in efx_nvram_type_t type); 425 426extern __checkReturn efx_rc_t 427hunt_nvram_write_chunk( 428 __in efx_nic_t *enp, 429 __in efx_nvram_type_t type, 430 __in unsigned int offset, 431 __in_bcount(size) caddr_t data, 432 __in size_t size); 433 434extern void 435hunt_nvram_rw_finish( 436 __in efx_nic_t *enp, 437 __in efx_nvram_type_t type); 438 439extern __checkReturn efx_rc_t 440hunt_nvram_partn_set_version( 441 __in efx_nic_t *enp, 442 __in unsigned int partn, 443 __in_ecount(4) uint16_t version[4]); 444 445extern __checkReturn efx_rc_t 446hunt_nvram_set_version( 447 __in efx_nic_t *enp, 448 __in efx_nvram_type_t type, 449 __in_ecount(4) uint16_t version[4]); 450 451#endif /* EFSYS_OPT_NVRAM */ 452 453 454/* PHY */ 455 456typedef struct hunt_link_state_s { 457 uint32_t hls_adv_cap_mask; 458 uint32_t hls_lp_cap_mask; 459 unsigned int hls_fcntl; 460 efx_link_mode_t hls_link_mode; 461#if EFSYS_OPT_LOOPBACK 462 efx_loopback_type_t hls_loopback; 463#endif 464 boolean_t hls_mac_up; 465} hunt_link_state_t; 466 467extern void 468hunt_phy_link_ev( 469 __in efx_nic_t *enp, 470 __in efx_qword_t *eqp, 471 __out efx_link_mode_t *link_modep); 472 473extern __checkReturn efx_rc_t 474hunt_phy_get_link( 475 __in efx_nic_t *enp, 476 __out hunt_link_state_t *hlsp); 477 478extern __checkReturn efx_rc_t 479hunt_phy_power( 480 __in efx_nic_t *enp, 481 __in boolean_t on); 482 483extern __checkReturn efx_rc_t 484hunt_phy_reconfigure( 485 __in efx_nic_t *enp); 486 487extern __checkReturn efx_rc_t 488hunt_phy_verify( 489 __in efx_nic_t *enp); 490 491extern __checkReturn efx_rc_t 492hunt_phy_oui_get( 493 __in efx_nic_t *enp, 494 __out uint32_t *ouip); 495 496#if EFSYS_OPT_PHY_STATS 497 498extern __checkReturn efx_rc_t 499hunt_phy_stats_update( 500 __in efx_nic_t *enp, 501 __in efsys_mem_t *esmp, 502 __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); 503 504#endif /* EFSYS_OPT_PHY_STATS */ 505 506#if EFSYS_OPT_PHY_PROPS 507 508#if EFSYS_OPT_NAMES 509 510extern const char * 511hunt_phy_prop_name( 512 __in efx_nic_t *enp, 513 __in unsigned int id); 514 515#endif /* EFSYS_OPT_NAMES */ 516 517extern __checkReturn efx_rc_t 518hunt_phy_prop_get( 519 __in efx_nic_t *enp, 520 __in unsigned int id, 521 __in uint32_t flags, 522 __out uint32_t *valp); 523 524extern __checkReturn efx_rc_t 525hunt_phy_prop_set( 526 __in efx_nic_t *enp, 527 __in unsigned int id, 528 __in uint32_t val); 529 530#endif /* EFSYS_OPT_PHY_PROPS */ 531 532#if EFSYS_OPT_BIST 533 534extern __checkReturn efx_rc_t 535hunt_bist_enable_offline( 536 __in efx_nic_t *enp); 537 538extern __checkReturn efx_rc_t 539hunt_bist_start( 540 __in efx_nic_t *enp, 541 __in efx_bist_type_t type); 542 543extern __checkReturn efx_rc_t 544hunt_bist_poll( 545 __in efx_nic_t *enp, 546 __in efx_bist_type_t type, 547 __out efx_bist_result_t *resultp, 548 __out_opt __drv_when(count > 0, __notnull) 549 uint32_t *value_maskp, 550 __out_ecount_opt(count) __drv_when(count > 0, __notnull) 551 unsigned long *valuesp, 552 __in size_t count); 553 554extern void 555hunt_bist_stop( 556 __in efx_nic_t *enp, 557 __in efx_bist_type_t type); 558 559#endif /* EFSYS_OPT_BIST */ 560 561 562/* SRAM */ 563 564#if EFSYS_OPT_DIAG 565 566extern __checkReturn efx_rc_t 567hunt_sram_test( 568 __in efx_nic_t *enp, 569 __in efx_sram_pattern_fn_t func); 570 571#endif /* EFSYS_OPT_DIAG */ 572 573 574/* TX */ 575 576extern __checkReturn efx_rc_t 577hunt_tx_init( 578 __in efx_nic_t *enp); 579 580extern void 581hunt_tx_fini( 582 __in efx_nic_t *enp); 583 584extern __checkReturn efx_rc_t 585hunt_tx_qcreate( 586 __in efx_nic_t *enp, 587 __in unsigned int index, 588 __in unsigned int label, 589 __in efsys_mem_t *esmp, 590 __in size_t n, 591 __in uint32_t id, 592 __in uint16_t flags, 593 __in efx_evq_t *eep, 594 __in efx_txq_t *etp, 595 __out unsigned int *addedp); 596 597extern void 598hunt_tx_qdestroy( 599 __in efx_txq_t *etp); 600 601extern __checkReturn efx_rc_t 602hunt_tx_qpost( 603 __in efx_txq_t *etp, 604 __in_ecount(n) efx_buffer_t *eb, 605 __in unsigned int n, 606 __in unsigned int completed, 607 __inout unsigned int *addedp); 608 609extern void 610hunt_tx_qpush( 611 __in efx_txq_t *etp, 612 __in unsigned int added, 613 __in unsigned int pushed); 614 615extern __checkReturn efx_rc_t 616hunt_tx_qpace( 617 __in efx_txq_t *etp, 618 __in unsigned int ns); 619 620extern __checkReturn efx_rc_t 621hunt_tx_qflush( 622 __in efx_txq_t *etp); 623 624extern void 625hunt_tx_qenable( 626 __in efx_txq_t *etp); 627 628extern __checkReturn efx_rc_t 629hunt_tx_qpio_enable( 630 __in efx_txq_t *etp); 631 632extern void 633hunt_tx_qpio_disable( 634 __in efx_txq_t *etp); 635 636extern __checkReturn efx_rc_t 637hunt_tx_qpio_write( 638 __in efx_txq_t *etp, 639 __in_ecount(buf_length) uint8_t *buffer, 640 __in size_t buf_length, 641 __in size_t pio_buf_offset); 642 643extern __checkReturn efx_rc_t 644hunt_tx_qpio_post( 645 __in efx_txq_t *etp, 646 __in size_t pkt_length, 647 __in unsigned int completed, 648 __inout unsigned int *addedp); 649 650extern __checkReturn efx_rc_t 651hunt_tx_qdesc_post( 652 __in efx_txq_t *etp, 653 __in_ecount(n) efx_desc_t *ed, 654 __in unsigned int n, 655 __in unsigned int completed, 656 __inout unsigned int *addedp); 657 658extern void 659hunt_tx_qdesc_dma_create( 660 __in efx_txq_t *etp, 661 __in efsys_dma_addr_t addr, 662 __in size_t size, 663 __in boolean_t eop, 664 __out efx_desc_t *edp); 665 666extern void 667hunt_tx_qdesc_tso_create( 668 __in efx_txq_t *etp, 669 __in uint16_t ipv4_id, 670 __in uint32_t tcp_seq, 671 __in uint8_t tcp_flags, 672 __out efx_desc_t *edp); 673 674extern void 675hunt_tx_qdesc_vlantci_create( 676 __in efx_txq_t *etp, 677 __in uint16_t vlan_tci, 678 __out efx_desc_t *edp); 679 680 681#if EFSYS_OPT_QSTATS 682 683extern void 684hunt_tx_qstats_update( 685 __in efx_txq_t *etp, 686 __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); 687 688#endif /* EFSYS_OPT_QSTATS */ 689 690/* PIO */ 691 692/* Missing register definitions */ 693#ifndef ER_DZ_TX_PIOBUF_OFST 694#define ER_DZ_TX_PIOBUF_OFST 0x00001000 695#endif 696#ifndef ER_DZ_TX_PIOBUF_STEP 697#define ER_DZ_TX_PIOBUF_STEP 8192 698#endif 699#ifndef ER_DZ_TX_PIOBUF_ROWS 700#define ER_DZ_TX_PIOBUF_ROWS 2048 701#endif 702 703#ifndef ER_DZ_TX_PIOBUF_SIZE 704#define ER_DZ_TX_PIOBUF_SIZE 2048 705#endif 706 707#define HUNT_PIOBUF_NBUFS (16) 708#define HUNT_PIOBUF_SIZE (ER_DZ_TX_PIOBUF_SIZE) 709 710#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) 711 712#define HUNT_LEGACY_PF_PRIVILEGE_MASK \ 713 (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ 714 MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ 715 MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ 716 MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP | \ 717 MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS | \ 718 MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING | \ 719 MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST | \ 720 MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST | \ 721 MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST | \ 722 MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ 723 MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) 724 725#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0 726 727typedef uint32_t efx_piobuf_handle_t; 728 729#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) 730 731extern __checkReturn efx_rc_t 732hunt_nic_pio_alloc( 733 __inout efx_nic_t *enp, 734 __out uint32_t *bufnump, 735 __out efx_piobuf_handle_t *handlep, 736 __out uint32_t *blknump, 737 __out uint32_t *offsetp, 738 __out size_t *sizep); 739 740extern __checkReturn efx_rc_t 741hunt_nic_pio_free( 742 __inout efx_nic_t *enp, 743 __in uint32_t bufnum, 744 __in uint32_t blknum); 745 746extern __checkReturn efx_rc_t 747hunt_nic_pio_link( 748 __inout efx_nic_t *enp, 749 __in uint32_t vi_index, 750 __in efx_piobuf_handle_t handle); 751 752extern __checkReturn efx_rc_t 753hunt_nic_pio_unlink( 754 __inout efx_nic_t *enp, 755 __in uint32_t vi_index); 756 757 758/* VPD */ 759 760#if EFSYS_OPT_VPD 761 762extern __checkReturn efx_rc_t 763hunt_vpd_init( 764 __in efx_nic_t *enp); 765 766extern __checkReturn efx_rc_t 767hunt_vpd_size( 768 __in efx_nic_t *enp, 769 __out size_t *sizep); 770 771extern __checkReturn efx_rc_t 772hunt_vpd_read( 773 __in efx_nic_t *enp, 774 __out_bcount(size) caddr_t data, 775 __in size_t size); 776 777extern __checkReturn efx_rc_t 778hunt_vpd_verify( 779 __in efx_nic_t *enp, 780 __in_bcount(size) caddr_t data, 781 __in size_t size); 782 783extern __checkReturn efx_rc_t 784hunt_vpd_reinit( 785 __in efx_nic_t *enp, 786 __in_bcount(size) caddr_t data, 787 __in size_t size); 788 789extern __checkReturn efx_rc_t 790hunt_vpd_get( 791 __in efx_nic_t *enp, 792 __in_bcount(size) caddr_t data, 793 __in size_t size, 794 __inout efx_vpd_value_t *evvp); 795 796extern __checkReturn efx_rc_t 797hunt_vpd_set( 798 __in efx_nic_t *enp, 799 __in_bcount(size) caddr_t data, 800 __in size_t size, 801 __in efx_vpd_value_t *evvp); 802 803extern __checkReturn efx_rc_t 804hunt_vpd_next( 805 __in efx_nic_t *enp, 806 __in_bcount(size) caddr_t data, 807 __in size_t size, 808 __out efx_vpd_value_t *evvp, 809 __inout unsigned int *contp); 810 811extern __checkReturn efx_rc_t 812hunt_vpd_write( 813 __in efx_nic_t *enp, 814 __in_bcount(size) caddr_t data, 815 __in size_t size); 816 817extern void 818hunt_vpd_fini( 819 __in efx_nic_t *enp); 820 821#endif /* EFSYS_OPT_VPD */ 822 823 824/* RX */ 825 826extern __checkReturn efx_rc_t 827hunt_rx_init( 828 __in efx_nic_t *enp); 829 830#if EFSYS_OPT_RX_HDR_SPLIT 831extern __checkReturn efx_rc_t 832hunt_rx_hdr_split_enable( 833 __in efx_nic_t *enp, 834 __in unsigned int hdr_buf_size, 835 __in unsigned int pld_buf_size); 836#endif /* EFSYS_OPT_RX_HDR_SPLIT */ 837 838#if EFSYS_OPT_RX_SCATTER 839extern __checkReturn efx_rc_t 840hunt_rx_scatter_enable( 841 __in efx_nic_t *enp, 842 __in unsigned int buf_size); 843#endif /* EFSYS_OPT_RX_SCATTER */ 844 845 846#if EFSYS_OPT_RX_SCALE 847 848extern __checkReturn efx_rc_t 849hunt_rx_scale_mode_set( 850 __in efx_nic_t *enp, 851 __in efx_rx_hash_alg_t alg, 852 __in efx_rx_hash_type_t type, 853 __in boolean_t insert); 854 855extern __checkReturn efx_rc_t 856hunt_rx_scale_key_set( 857 __in efx_nic_t *enp, 858 __in_ecount(n) uint8_t *key, 859 __in size_t n); 860 861extern __checkReturn efx_rc_t 862hunt_rx_scale_tbl_set( 863 __in efx_nic_t *enp, 864 __in_ecount(n) unsigned int *table, 865 __in size_t n); 866 867#endif /* EFSYS_OPT_RX_SCALE */ 868 869extern void 870hunt_rx_qpost( 871 __in efx_rxq_t *erp, 872 __in_ecount(n) efsys_dma_addr_t *addrp, 873 __in size_t size, 874 __in unsigned int n, 875 __in unsigned int completed, 876 __in unsigned int added); 877 878extern void 879hunt_rx_qpush( 880 __in efx_rxq_t *erp, 881 __in unsigned int added, 882 __inout unsigned int *pushedp); 883 884extern __checkReturn efx_rc_t 885hunt_rx_qflush( 886 __in efx_rxq_t *erp); 887 888extern void 889hunt_rx_qenable( 890 __in efx_rxq_t *erp); 891 892extern __checkReturn efx_rc_t 893hunt_rx_qcreate( 894 __in efx_nic_t *enp, 895 __in unsigned int index, 896 __in unsigned int label, 897 __in efx_rxq_type_t type, 898 __in efsys_mem_t *esmp, 899 __in size_t n, 900 __in uint32_t id, 901 __in efx_evq_t *eep, 902 __in efx_rxq_t *erp); 903 904extern void 905hunt_rx_qdestroy( 906 __in efx_rxq_t *erp); 907 908extern void 909hunt_rx_fini( 910 __in efx_nic_t *enp); 911 912#if EFSYS_OPT_FILTER 913 914typedef struct hunt_filter_handle_s { 915 uint32_t hfh_lo; 916 uint32_t hfh_hi; 917} hunt_filter_handle_t; 918 919typedef struct hunt_filter_entry_s { 920 uintptr_t hfe_spec; /* pointer to filter spec plus busy bit */ 921 hunt_filter_handle_t hfe_handle; 922} hunt_filter_entry_t; 923 924/* 925 * BUSY flag indicates that an update is in progress. 926 * AUTO_OLD flag is used to mark and sweep MAC packet filters. 927 */ 928#define EFX_HUNT_FILTER_FLAG_BUSY 1U 929#define EFX_HUNT_FILTER_FLAG_AUTO_OLD 2U 930#define EFX_HUNT_FILTER_FLAGS 3U 931 932#define EFX_HUNT_FILTER_TBL_ROWS 8192 933 934/* Allow for the broadcast address to be added to the multicast list */ 935#define EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) 936 937typedef struct hunt_filter_table_s { 938 hunt_filter_entry_t hft_entry[EFX_HUNT_FILTER_TBL_ROWS]; 939 efx_rxq_t * hft_default_rxq; 940 boolean_t hft_using_rss; 941 uint32_t hft_unicst_filter_index; 942 boolean_t hft_unicst_filter_set; 943 uint32_t hft_mulcst_filter_indexes[ 944 EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX]; 945 uint32_t hft_mulcst_filter_count; 946} hunt_filter_table_t; 947 948 __checkReturn efx_rc_t 949hunt_filter_init( 950 __in efx_nic_t *enp); 951 952 void 953hunt_filter_fini( 954 __in efx_nic_t *enp); 955 956 __checkReturn efx_rc_t 957hunt_filter_restore( 958 __in efx_nic_t *enp); 959 960 __checkReturn efx_rc_t 961hunt_filter_add( 962 __in efx_nic_t *enp, 963 __inout efx_filter_spec_t *spec, 964 __in boolean_t may_replace); 965 966 __checkReturn efx_rc_t 967hunt_filter_delete( 968 __in efx_nic_t *enp, 969 __inout efx_filter_spec_t *spec); 970 971extern __checkReturn efx_rc_t 972hunt_filter_supported_filters( 973 __in efx_nic_t *enp, 974 __out uint32_t *list, 975 __out size_t *length); 976 977extern __checkReturn efx_rc_t 978hunt_filter_reconfigure( 979 __in efx_nic_t *enp, 980 __in_ecount(6) uint8_t const *mac_addr, 981 __in boolean_t all_unicst, 982 __in boolean_t mulcst, 983 __in boolean_t all_mulcst, 984 __in boolean_t brdcst, 985 __in_ecount(6*count) uint8_t const *addrs, 986 __in int count); 987 988extern void 989hunt_filter_get_default_rxq( 990 __in efx_nic_t *enp, 991 __out efx_rxq_t **erpp, 992 __out boolean_t *using_rss); 993 994extern void 995hunt_filter_default_rxq_set( 996 __in efx_nic_t *enp, 997 __in efx_rxq_t *erp, 998 __in boolean_t using_rss); 999 1000extern void 1001hunt_filter_default_rxq_clear( 1002 __in efx_nic_t *enp); 1003 1004 1005#endif /* EFSYS_OPT_FILTER */ 1006 1007extern __checkReturn efx_rc_t 1008hunt_pktfilter_set( 1009 __in efx_nic_t *enp, 1010 __in boolean_t unicst, 1011 __in boolean_t brdcst); 1012 1013#if EFSYS_OPT_MCAST_FILTER_LIST 1014 1015extern __checkReturn efx_rc_t 1016hunt_pktfilter_mcast_set( 1017 __in efx_nic_t *enp, 1018 __in uint8_t const *addrs, 1019 __in int count); 1020 1021#endif /* EFSYS_OPT_MCAST_FILTER_LIST */ 1022 1023extern __checkReturn efx_rc_t 1024hunt_pktfilter_mcast_all( 1025 __in efx_nic_t *enp); 1026 1027extern __checkReturn efx_rc_t 1028efx_mcdi_get_function_info( 1029 __in efx_nic_t *enp, 1030 __out uint32_t *pfp, 1031 __out_opt uint32_t *vfp); 1032 1033extern __checkReturn efx_rc_t 1034efx_mcdi_privilege_mask( 1035 __in efx_nic_t *enp, 1036 __in uint32_t pf, 1037 __in uint32_t vf, 1038 __out uint32_t *maskp); 1039 1040#ifdef __cplusplus 1041} 1042#endif 1043 1044#endif /* _SYS_HUNT_IMPL_H */
|