diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2011-06-24 23:27:13 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 18:23:29 -0400 |
commit | 5a54b1d576d1880eb249e906e0c8e2ffe64506d3 (patch) | |
tree | 642890240be4d1fed626ff591296f7cb59338132 /drivers/scsi/bfa/bfa_ioc.h | |
parent | 51e569aa1f0c10bd71af05e76e4ba0e42c51e4ab (diff) |
[SCSI] bfa: Added support for flash configuration
- Added flash sub-module.
- Implemented the interface to read/erase/update flash partition.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.h')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 1d51164faa81..c302b996b920 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h | |||
@@ -348,6 +348,28 @@ struct bfa_ioc_hwif_s { | |||
348 | }; | 348 | }; |
349 | 349 | ||
350 | /* | 350 | /* |
351 | * Queue element to wait for room in request queue. FIFO order is | ||
352 | * maintained when fullfilling requests. | ||
353 | */ | ||
354 | struct bfa_reqq_wait_s { | ||
355 | struct list_head qe; | ||
356 | void (*qresume) (void *cbarg); | ||
357 | void *cbarg; | ||
358 | }; | ||
359 | |||
360 | typedef void (*bfa_cb_cbfn_t) (void *cbarg, bfa_boolean_t complete); | ||
361 | |||
362 | /* | ||
363 | * Generic BFA callback element. | ||
364 | */ | ||
365 | struct bfa_cb_qe_s { | ||
366 | struct list_head qe; | ||
367 | bfa_cb_cbfn_t cbfn; | ||
368 | bfa_boolean_t once; | ||
369 | void *cbarg; | ||
370 | }; | ||
371 | |||
372 | /* | ||
351 | * ASIC block configurtion related | 373 | * ASIC block configurtion related |
352 | */ | 374 | */ |
353 | 375 | ||
@@ -419,6 +441,56 @@ bfa_status_t bfa_sfp_speed(struct bfa_sfp_s *sfp, | |||
419 | enum bfa_port_speed portspeed, | 441 | enum bfa_port_speed portspeed, |
420 | bfa_cb_sfp_t cbfn, void *cbarg); | 442 | bfa_cb_sfp_t cbfn, void *cbarg); |
421 | 443 | ||
444 | /* | ||
445 | * Flash module specific | ||
446 | */ | ||
447 | typedef void (*bfa_cb_flash_t) (void *cbarg, bfa_status_t status); | ||
448 | |||
449 | struct bfa_flash_s { | ||
450 | struct bfa_ioc_s *ioc; /* back pointer to ioc */ | ||
451 | struct bfa_trc_mod_s *trcmod; | ||
452 | u32 type; /* partition type */ | ||
453 | u8 instance; /* partition instance */ | ||
454 | u8 rsv[3]; | ||
455 | u32 op_busy; /* operation busy flag */ | ||
456 | u32 residue; /* residual length */ | ||
457 | u32 offset; /* offset */ | ||
458 | bfa_status_t status; /* status */ | ||
459 | u8 *dbuf_kva; /* dma buf virtual address */ | ||
460 | u64 dbuf_pa; /* dma buf physical address */ | ||
461 | struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */ | ||
462 | bfa_cb_flash_t cbfn; /* user callback function */ | ||
463 | void *cbarg; /* user callback arg */ | ||
464 | u8 *ubuf; /* user supplied buffer */ | ||
465 | struct bfa_cb_qe_s hcb_qe; /* comp: BFA callback qelem */ | ||
466 | u32 addr_off; /* partition address offset */ | ||
467 | struct bfa_mbox_cmd_s mb; /* mailbox */ | ||
468 | struct bfa_ioc_notify_s ioc_notify; /* ioc event notify */ | ||
469 | struct bfa_mem_dma_s flash_dma; | ||
470 | }; | ||
471 | |||
472 | #define BFA_FLASH(__bfa) (&(__bfa)->modules.flash) | ||
473 | #define BFA_MEM_FLASH_DMA(__bfa) (&(BFA_FLASH(__bfa)->flash_dma)) | ||
474 | |||
475 | bfa_status_t bfa_flash_get_attr(struct bfa_flash_s *flash, | ||
476 | struct bfa_flash_attr_s *attr, | ||
477 | bfa_cb_flash_t cbfn, void *cbarg); | ||
478 | bfa_status_t bfa_flash_erase_part(struct bfa_flash_s *flash, | ||
479 | enum bfa_flash_part_type type, u8 instance, | ||
480 | bfa_cb_flash_t cbfn, void *cbarg); | ||
481 | bfa_status_t bfa_flash_update_part(struct bfa_flash_s *flash, | ||
482 | enum bfa_flash_part_type type, u8 instance, | ||
483 | void *buf, u32 len, u32 offset, | ||
484 | bfa_cb_flash_t cbfn, void *cbarg); | ||
485 | bfa_status_t bfa_flash_read_part(struct bfa_flash_s *flash, | ||
486 | enum bfa_flash_part_type type, u8 instance, void *buf, | ||
487 | u32 len, u32 offset, bfa_cb_flash_t cbfn, void *cbarg); | ||
488 | u32 bfa_flash_meminfo(bfa_boolean_t mincfg); | ||
489 | void bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc, | ||
490 | void *dev, struct bfa_trc_mod_s *trcmod, bfa_boolean_t mincfg); | ||
491 | void bfa_flash_memclaim(struct bfa_flash_s *flash, | ||
492 | u8 *dm_kva, u64 dm_pa, bfa_boolean_t mincfg); | ||
493 | |||
422 | #define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func) | 494 | #define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func) |
423 | #define bfa_ioc_devid(__ioc) ((__ioc)->pcidev.device_id) | 495 | #define bfa_ioc_devid(__ioc) ((__ioc)->pcidev.device_id) |
424 | #define bfa_ioc_bar0(__ioc) ((__ioc)->pcidev.pci_bar_kva) | 496 | #define bfa_ioc_bar0(__ioc) ((__ioc)->pcidev.pci_bar_kva) |