• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/mips/broadcom/

Lines Matching refs:iocfe

66 BHND_NVRAM_IOPS_DEFN(iocfe)
71 static int bcm_nvram_iocfe_init(struct bcm_nvram_iocfe *iocfe,
191 * @param[out] iocfe On success, an I/O context mapping the CFE NVRAM
196 * @retval 0 success. the caller inherits ownership of @p iocfe.
201 bcm_nvram_find_cfedev(struct bcm_nvram_iocfe *iocfe,
225 if ((error = bcm_nvram_iocfe_init(iocfe, dname)))
229 result = bhnd_nvram_data_probe(*cls, &iocfe->io);
236 bhnd_nvram_io_free(&iocfe->io);
259 bcm_nvram_iocfe_init(struct bcm_nvram_iocfe *iocfe, char *dname)
268 iocfe->io.iops = &bhnd_nvram_iocfe_ops;
269 iocfe->dname = dname;
272 iocfe->fd = cfe_open(dname);
273 if (iocfe->fd <= 0) {
274 IOCFE_LOG(iocfe, "cfe_open() failed: %d\n", iocfe->fd);
280 if ((devinfo = cfe_getdevinfo(iocfe->dname)) < 0) {
281 IOCFE_LOG(iocfe, "cfe_getdevinfo() failed: %d\n", devinfo);
294 IOCFE_LOG(iocfe, "unknown device type: %d\n", dtype);
300 cerr = cfe_ioctl(iocfe->fd, IOCTL_NVRAM_GETINFO,
307 IOCFE_LOG(iocfe, "invalid NVRAM layout (%d/%d)\n",
317 IOCFE_LOG(iocfe, "IOCTL_NVRAM_GETINFO failed: %d\n", cerr);
331 cerr = cfe_ioctl(iocfe->fd, IOCTL_FLASH_GETINFO,
335 IOCFE_LOG(iocfe, "IOCTL_FLASH_GETINFO failed %d\n",
349 IOCFE_LOG(iocfe, "invalid NVRAM layout (%#x/%#jx)\n",
355 iocfe->offset = nv_offset;
356 iocfe->size = nv_size;
357 iocfe->req_blk_erase = req_blk_erase;
362 if (iocfe->fd >= 0)
363 cfe_close(iocfe->fd);
371 struct bcm_nvram_iocfe *iocfe = (struct bcm_nvram_iocfe *)io;
375 cfe_close(iocfe->fd);
381 struct bcm_nvram_iocfe *iocfe = (struct bcm_nvram_iocfe *)io;
382 return (iocfe->size);
420 struct bcm_nvram_iocfe *iocfe;
425 iocfe = (struct bcm_nvram_iocfe *)io;
429 if (iocfe->offset > INT64_MAX || offset > INT64_MAX)
433 if (INT64_MAX - offset < iocfe->offset)
436 cfe_offset = iocfe->offset + offset;
453 nr = cfe_readblk(iocfe->fd, cfe_noff, p, nreq);
455 IOCFE_LOG(iocfe, "cfe_readblk() failed: %d\n", nr);
463 if (remain < iocfe->size &&
464 iocfe->size - remain > offset)
466 IOCFE_LOG(iocfe, "cfe_readblk() returned "