diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2011-12-22 08:29:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-23 16:50:58 -0500 |
commit | 72a9730b3f556e18912f3e1b494a7aee7ae3dd91 (patch) | |
tree | 1b589cb530e6cf5145a29c3423c176408c667033 /drivers/net/ethernet/brocade/bna/bfa_ioc.h | |
parent | 6fc0d0f2e3bcbb4bfbc22a89c996e5905da4cc43 (diff) |
bna: Added flash sub-module and ethtool eeprom entry points.
Change details:
- The patch adds flash sub-module to the bna driver.
- Added ethtool set_eeprom() and get_eeprom() entry points to
support flash partition read/write operations.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade/bna/bfa_ioc.h')
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bfa_ioc.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.h b/drivers/net/ethernet/brocade/bna/bfa_ioc.h index ca158d1eaef3..fc108c7a735e 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc.h +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.h | |||
@@ -68,6 +68,16 @@ __bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa) | |||
68 | dma_addr->a32.addr_hi = (u32) htonl(upper_32_bits(pa)); | 68 | dma_addr->a32.addr_hi = (u32) htonl(upper_32_bits(pa)); |
69 | } | 69 | } |
70 | 70 | ||
71 | #define bfa_alen_set(__alen, __len, __pa) \ | ||
72 | __bfa_alen_set(__alen, __len, (u64)__pa) | ||
73 | |||
74 | static inline void | ||
75 | __bfa_alen_set(struct bfi_alen *alen, u32 len, u64 pa) | ||
76 | { | ||
77 | alen->al_len = cpu_to_be32(len); | ||
78 | bfa_dma_be_addr_set(alen->al_addr, pa); | ||
79 | } | ||
80 | |||
71 | struct bfa_ioc_regs { | 81 | struct bfa_ioc_regs { |
72 | void __iomem *hfn_mbox_cmd; | 82 | void __iomem *hfn_mbox_cmd; |
73 | void __iomem *hfn_mbox; | 83 | void __iomem *hfn_mbox; |
@@ -322,4 +332,42 @@ void bfa_nw_iocpf_sem_timeout(void *ioc); | |||
322 | u32 *bfa_cb_image_get_chunk(enum bfi_asic_gen asic_gen, u32 off); | 332 | u32 *bfa_cb_image_get_chunk(enum bfi_asic_gen asic_gen, u32 off); |
323 | u32 bfa_cb_image_get_size(enum bfi_asic_gen asic_gen); | 333 | u32 bfa_cb_image_get_size(enum bfi_asic_gen asic_gen); |
324 | 334 | ||
335 | /* | ||
336 | * Flash module specific | ||
337 | */ | ||
338 | typedef void (*bfa_cb_flash) (void *cbarg, enum bfa_status status); | ||
339 | |||
340 | struct bfa_flash { | ||
341 | struct bfa_ioc *ioc; /* back pointer to ioc */ | ||
342 | u32 type; /* partition type */ | ||
343 | u8 instance; /* partition instance */ | ||
344 | u8 rsv[3]; | ||
345 | u32 op_busy; /* operation busy flag */ | ||
346 | u32 residue; /* residual length */ | ||
347 | u32 offset; /* offset */ | ||
348 | enum bfa_status status; /* status */ | ||
349 | u8 *dbuf_kva; /* dma buf virtual address */ | ||
350 | u64 dbuf_pa; /* dma buf physical address */ | ||
351 | bfa_cb_flash cbfn; /* user callback function */ | ||
352 | void *cbarg; /* user callback arg */ | ||
353 | u8 *ubuf; /* user supplied buffer */ | ||
354 | u32 addr_off; /* partition address offset */ | ||
355 | struct bfa_mbox_cmd mb; /* mailbox */ | ||
356 | struct bfa_ioc_notify ioc_notify; /* ioc event notify */ | ||
357 | }; | ||
358 | |||
359 | enum bfa_status bfa_nw_flash_get_attr(struct bfa_flash *flash, | ||
360 | struct bfa_flash_attr *attr, | ||
361 | bfa_cb_flash cbfn, void *cbarg); | ||
362 | enum bfa_status bfa_nw_flash_update_part(struct bfa_flash *flash, | ||
363 | u32 type, u8 instance, void *buf, u32 len, u32 offset, | ||
364 | bfa_cb_flash cbfn, void *cbarg); | ||
365 | enum bfa_status bfa_nw_flash_read_part(struct bfa_flash *flash, | ||
366 | u32 type, u8 instance, void *buf, u32 len, u32 offset, | ||
367 | bfa_cb_flash cbfn, void *cbarg); | ||
368 | u32 bfa_nw_flash_meminfo(void); | ||
369 | void bfa_nw_flash_attach(struct bfa_flash *flash, | ||
370 | struct bfa_ioc *ioc, void *dev); | ||
371 | void bfa_nw_flash_memclaim(struct bfa_flash *flash, u8 *dm_kva, u64 dm_pa); | ||
372 | |||
325 | #endif /* __BFA_IOC_H__ */ | 373 | #endif /* __BFA_IOC_H__ */ |