Rename mlx5_fwdump_addr to more neutral mlx5_tool_addr in mlx5core.

Submitted by:	kib@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2019-05-08 10:50:08 +00:00
parent 20a63539d6
commit b255ca093a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=347287
4 changed files with 18 additions and 18 deletions

View File

@ -25,7 +25,7 @@
.\" .\"
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd February 20, 2018 .Dd May 7, 2019
.Dt mlx5io 4 .Dt mlx5io 4
.Os .Os
.Sh NAME .Sh NAME
@ -55,10 +55,10 @@ far, or existing dump cleared with the
.Dv MLX5_FWDUMP_RESET .Dv MLX5_FWDUMP_RESET
command for the specified device. command for the specified device.
The argument for the command should point to the The argument for the command should point to the
.Vt struct mlx5_fwdump_addr .Vt struct mlx5_tool_addr
structure, containing the PCIe bus address of the device. structure, containing the PCIe bus address of the device.
.Bd -literal .Bd -literal
struct mlx5_fwdump_addr { struct mlx5_tool_addr {
uint32_t domain; uint32_t domain;
uint8_t bus; uint8_t bus;
uint8_t slot; uint8_t slot;
@ -69,7 +69,7 @@ struct mlx5_fwdump_addr {
Clear the stored firmware dump, preparing the kernel buffer for Clear the stored firmware dump, preparing the kernel buffer for
the next dump. the next dump.
The argument for the command should point to the The argument for the command should point to the
.Vt struct mlx5_fwdump_addr .Vt struct mlx5_tool_addr
structure, containing the PCIe bus address of the device. structure, containing the PCIe bus address of the device.
.It Dv MLX5_FWDUMP_GET .It Dv MLX5_FWDUMP_GET
Fetch the stored firmware dump into the user memory. Fetch the stored firmware dump into the user memory.
@ -88,7 +88,7 @@ in the
field. field.
.Bd -literal .Bd -literal
struct mlx5_fwdump_get { struct mlx5_fwdump_get {
struct mlx5_fwdump_addr devaddr; struct mlx5_tool_addr devaddr;
struct mlx5_fwdump_reg *buf; struct mlx5_fwdump_reg *buf;
size_t reg_cnt; size_t reg_cnt;
size_t reg_filled; /* out */ size_t reg_filled; /* out */

View File

@ -170,7 +170,7 @@ mlx5_fwdump_clean(struct mlx5_core_dev *mdev)
} }
static int static int
mlx5_dbsf_to_core(const struct mlx5_fwdump_addr *devaddr, mlx5_dbsf_to_core(const struct mlx5_tool_addr *devaddr,
struct mlx5_core_dev **mdev) struct mlx5_core_dev **mdev)
{ {
device_t dev; device_t dev;
@ -231,7 +231,7 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
{ {
struct mlx5_core_dev *mdev; struct mlx5_core_dev *mdev;
struct mlx5_fwdump_get *fwg; struct mlx5_fwdump_get *fwg;
struct mlx5_fwdump_addr *devaddr; struct mlx5_tool_addr *devaddr;
struct mlx5_dump_data *dd; struct mlx5_dump_data *dd;
int error; int error;
@ -254,7 +254,7 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
error = EBADF; error = EBADF;
break; break;
} }
devaddr = (struct mlx5_fwdump_addr *)data; devaddr = (struct mlx5_tool_addr *)data;
error = mlx5_dbsf_to_core(devaddr, &mdev); error = mlx5_dbsf_to_core(devaddr, &mdev);
if (error != 0) if (error != 0)
break; break;
@ -269,7 +269,7 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
error = EBADF; error = EBADF;
break; break;
} }
devaddr = (struct mlx5_fwdump_addr *)data; devaddr = (struct mlx5_tool_addr *)data;
error = mlx5_dbsf_to_core(devaddr, &mdev); error = mlx5_dbsf_to_core(devaddr, &mdev);
if (error != 0) if (error != 0)
break; break;

View File

@ -35,7 +35,7 @@ struct mlx5_fwdump_reg {
uint32_t val; uint32_t val;
}; };
struct mlx5_fwdump_addr { struct mlx5_tool_addr {
uint32_t domain; uint32_t domain;
uint8_t bus; uint8_t bus;
uint8_t slot; uint8_t slot;
@ -43,15 +43,15 @@ struct mlx5_fwdump_addr {
}; };
struct mlx5_fwdump_get { struct mlx5_fwdump_get {
struct mlx5_fwdump_addr devaddr; struct mlx5_tool_addr devaddr;
struct mlx5_fwdump_reg *buf; struct mlx5_fwdump_reg *buf;
size_t reg_cnt; size_t reg_cnt;
size_t reg_filled; /* out */ size_t reg_filled; /* out */
}; };
#define MLX5_FWDUMP_GET _IOWR('m', 1, struct mlx5_fwdump_get) #define MLX5_FWDUMP_GET _IOWR('m', 1, struct mlx5_fwdump_get)
#define MLX5_FWDUMP_RESET _IOW('m', 2, struct mlx5_fwdump_addr) #define MLX5_FWDUMP_RESET _IOW('m', 2, struct mlx5_tool_addr)
#define MLX5_FWDUMP_FORCE _IOW('m', 3, struct mlx5_fwdump_addr) #define MLX5_FWDUMP_FORCE _IOW('m', 3, struct mlx5_tool_addr)
#ifndef _KERNEL #ifndef _KERNEL
#define MLX5_DEV_PATH _PATH_DEV"mlx5ctl" #define MLX5_DEV_PATH _PATH_DEV"mlx5ctl"

View File

@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
/* stolen from pciconf.c: parsesel() */ /* stolen from pciconf.c: parsesel() */
static int static int
parse_pci_addr(const char *addrstr, struct mlx5_fwdump_addr *addr) parse_pci_addr(const char *addrstr, struct mlx5_tool_addr *addr)
{ {
char *eppos; char *eppos;
unsigned long selarr[4]; unsigned long selarr[4];
@ -73,7 +73,7 @@ parse_pci_addr(const char *addrstr, struct mlx5_fwdump_addr *addr)
} }
static int static int
mlx5tool_save_dump(int ctldev, const struct mlx5_fwdump_addr *addr, mlx5tool_save_dump(int ctldev, const struct mlx5_tool_addr *addr,
const char *dumpname) const char *dumpname)
{ {
struct mlx5_fwdump_get fdg; struct mlx5_fwdump_get fdg;
@ -123,7 +123,7 @@ mlx5tool_save_dump(int ctldev, const struct mlx5_fwdump_addr *addr,
} }
static int static int
mlx5tool_dump_reset(int ctldev, const struct mlx5_fwdump_addr *addr) mlx5tool_dump_reset(int ctldev, const struct mlx5_tool_addr *addr)
{ {
if (ioctl(ctldev, MLX5_FWDUMP_RESET, addr) == -1) { if (ioctl(ctldev, MLX5_FWDUMP_RESET, addr) == -1) {
@ -134,7 +134,7 @@ mlx5tool_dump_reset(int ctldev, const struct mlx5_fwdump_addr *addr)
} }
static int static int
mlx5tool_dump_force(int ctldev, const struct mlx5_fwdump_addr *addr) mlx5tool_dump_force(int ctldev, const struct mlx5_tool_addr *addr)
{ {
if (ioctl(ctldev, MLX5_FWDUMP_FORCE, addr) == -1) { if (ioctl(ctldev, MLX5_FWDUMP_FORCE, addr) == -1) {
@ -166,7 +166,7 @@ enum mlx5_action {
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
struct mlx5_fwdump_addr addr; struct mlx5_tool_addr addr;
char *dumpname; char *dumpname;
char *addrstr; char *addrstr;
int c, ctldev, res; int c, ctldev, res;