Lines Matching refs:flash

3033 bfa_flash_cb(struct bfa_flash *flash)  in bfa_flash_cb()  argument
3035 flash->op_busy = 0; in bfa_flash_cb()
3036 if (flash->cbfn) in bfa_flash_cb()
3037 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_cb()
3043 struct bfa_flash *flash = cbarg; in bfa_flash_notify() local
3048 if (flash->op_busy) { in bfa_flash_notify()
3049 flash->status = BFA_STATUS_IOC_FAILURE; in bfa_flash_notify()
3050 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_notify()
3051 flash->op_busy = 0; in bfa_flash_notify()
3063 bfa_flash_write_send(struct bfa_flash *flash) in bfa_flash_write_send() argument
3066 (struct bfi_flash_write_req *) flash->mb.msg; in bfa_flash_write_send()
3069 msg->type = be32_to_cpu(flash->type); in bfa_flash_write_send()
3070 msg->instance = flash->instance; in bfa_flash_write_send()
3071 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_write_send()
3072 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_write_send()
3073 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_write_send()
3077 msg->last = (len == flash->residue) ? 1 : 0; in bfa_flash_write_send()
3080 bfa_ioc_portid(flash->ioc)); in bfa_flash_write_send()
3081 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_write_send()
3082 memcpy(flash->dbuf_kva, flash->ubuf + flash->offset, len); in bfa_flash_write_send()
3083 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_flash_write_send()
3085 flash->residue -= len; in bfa_flash_write_send()
3086 flash->offset += len; in bfa_flash_write_send()
3097 struct bfa_flash *flash = cbarg; in bfa_flash_read_send() local
3099 (struct bfi_flash_read_req *) flash->mb.msg; in bfa_flash_read_send()
3102 msg->type = be32_to_cpu(flash->type); in bfa_flash_read_send()
3103 msg->instance = flash->instance; in bfa_flash_read_send()
3104 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_read_send()
3105 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_read_send()
3106 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_read_send()
3109 bfa_ioc_portid(flash->ioc)); in bfa_flash_read_send()
3110 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_read_send()
3111 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_flash_read_send()
3123 struct bfa_flash *flash = flasharg; in bfa_flash_intr() local
3136 if (!flash->op_busy && msg->mh.msg_id != BFI_FLASH_I2H_EVENT) in bfa_flash_intr()
3146 attr = (struct bfa_flash_attr *) flash->ubuf; in bfa_flash_intr()
3147 f = (struct bfa_flash_attr *) flash->dbuf_kva; in bfa_flash_intr()
3165 flash->status = status; in bfa_flash_intr()
3166 bfa_flash_cb(flash); in bfa_flash_intr()
3170 if (status != BFA_STATUS_OK || flash->residue == 0) { in bfa_flash_intr()
3171 flash->status = status; in bfa_flash_intr()
3172 bfa_flash_cb(flash); in bfa_flash_intr()
3174 bfa_flash_write_send(flash); in bfa_flash_intr()
3179 flash->status = status; in bfa_flash_intr()
3180 bfa_flash_cb(flash); in bfa_flash_intr()
3183 memcpy(flash->ubuf + flash->offset, in bfa_flash_intr()
3184 flash->dbuf_kva, len); in bfa_flash_intr()
3185 flash->residue -= len; in bfa_flash_intr()
3186 flash->offset += len; in bfa_flash_intr()
3187 if (flash->residue == 0) { in bfa_flash_intr()
3188 flash->status = status; in bfa_flash_intr()
3189 bfa_flash_cb(flash); in bfa_flash_intr()
3191 bfa_flash_read_send(flash); in bfa_flash_intr()
3219 bfa_nw_flash_attach(struct bfa_flash *flash, struct bfa_ioc *ioc, void *dev) in bfa_nw_flash_attach() argument
3221 flash->ioc = ioc; in bfa_nw_flash_attach()
3222 flash->cbfn = NULL; in bfa_nw_flash_attach()
3223 flash->cbarg = NULL; in bfa_nw_flash_attach()
3224 flash->op_busy = 0; in bfa_nw_flash_attach()
3226 bfa_nw_ioc_mbox_regisr(flash->ioc, BFI_MC_FLASH, bfa_flash_intr, flash); in bfa_nw_flash_attach()
3227 bfa_ioc_notify_init(&flash->ioc_notify, bfa_flash_notify, flash); in bfa_nw_flash_attach()
3228 list_add_tail(&flash->ioc_notify.qe, &flash->ioc->notify_q); in bfa_nw_flash_attach()
3239 bfa_nw_flash_memclaim(struct bfa_flash *flash, u8 *dm_kva, u64 dm_pa) in bfa_nw_flash_memclaim() argument
3241 flash->dbuf_kva = dm_kva; in bfa_nw_flash_memclaim()
3242 flash->dbuf_pa = dm_pa; in bfa_nw_flash_memclaim()
3243 memset(flash->dbuf_kva, 0, BFA_FLASH_DMA_BUF_SZ); in bfa_nw_flash_memclaim()
3259 bfa_nw_flash_get_attr(struct bfa_flash *flash, struct bfa_flash_attr *attr, in bfa_nw_flash_get_attr() argument
3263 (struct bfi_flash_query_req *) flash->mb.msg; in bfa_nw_flash_get_attr()
3265 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_get_attr()
3268 if (flash->op_busy) in bfa_nw_flash_get_attr()
3271 flash->op_busy = 1; in bfa_nw_flash_get_attr()
3272 flash->cbfn = cbfn; in bfa_nw_flash_get_attr()
3273 flash->cbarg = cbarg; in bfa_nw_flash_get_attr()
3274 flash->ubuf = (u8 *) attr; in bfa_nw_flash_get_attr()
3277 bfa_ioc_portid(flash->ioc)); in bfa_nw_flash_get_attr()
3278 bfa_alen_set(&msg->alen, sizeof(struct bfa_flash_attr), flash->dbuf_pa); in bfa_nw_flash_get_attr()
3279 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_nw_flash_get_attr()
3299 bfa_nw_flash_update_part(struct bfa_flash *flash, u32 type, u8 instance, in bfa_nw_flash_update_part() argument
3303 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_update_part()
3315 if (flash->op_busy) in bfa_nw_flash_update_part()
3318 flash->op_busy = 1; in bfa_nw_flash_update_part()
3319 flash->cbfn = cbfn; in bfa_nw_flash_update_part()
3320 flash->cbarg = cbarg; in bfa_nw_flash_update_part()
3321 flash->type = type; in bfa_nw_flash_update_part()
3322 flash->instance = instance; in bfa_nw_flash_update_part()
3323 flash->residue = len; in bfa_nw_flash_update_part()
3324 flash->offset = 0; in bfa_nw_flash_update_part()
3325 flash->addr_off = offset; in bfa_nw_flash_update_part()
3326 flash->ubuf = buf; in bfa_nw_flash_update_part()
3328 bfa_flash_write_send(flash); in bfa_nw_flash_update_part()
3348 bfa_nw_flash_read_part(struct bfa_flash *flash, u32 type, u8 instance, in bfa_nw_flash_read_part() argument
3352 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_read_part()
3361 if (flash->op_busy) in bfa_nw_flash_read_part()
3364 flash->op_busy = 1; in bfa_nw_flash_read_part()
3365 flash->cbfn = cbfn; in bfa_nw_flash_read_part()
3366 flash->cbarg = cbarg; in bfa_nw_flash_read_part()
3367 flash->type = type; in bfa_nw_flash_read_part()
3368 flash->instance = instance; in bfa_nw_flash_read_part()
3369 flash->residue = len; in bfa_nw_flash_read_part()
3370 flash->offset = 0; in bfa_nw_flash_read_part()
3371 flash->addr_off = offset; in bfa_nw_flash_read_part()
3372 flash->ubuf = buf; in bfa_nw_flash_read_part()
3374 bfa_flash_read_send(flash); in bfa_nw_flash_read_part()