diff options
Diffstat (limited to 'sys/dev/bxe/bxe_ioctl.h')
-rw-r--r-- | sys/dev/bxe/bxe_ioctl.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/sys/dev/bxe/bxe_ioctl.h b/sys/dev/bxe/bxe_ioctl.h index 2504982..a0f8478 100644 --- a/sys/dev/bxe/bxe_ioctl.h +++ b/sys/dev/bxe/bxe_ioctl.h @@ -42,6 +42,86 @@ struct bxe_grcdump { }; typedef struct bxe_grcdump bxe_grcdump_t; +#define BXE_DRV_NAME_LENGTH 32 +#define BXE_DRV_VERSION_LENGTH 32 +#define BXE_MFW_VERSION_LENGTH 32 +#define BXE_STORMFW_VERSION_LENGTH 32 +#define BXE_BUS_INFO_LENGTH 32 + +struct bxe_drvinfo { + char drv_name[BXE_DRV_NAME_LENGTH]; + char drv_version[BXE_DRV_VERSION_LENGTH]; + char mfw_version[BXE_MFW_VERSION_LENGTH]; + char stormfw_version[BXE_STORMFW_VERSION_LENGTH]; + uint32_t eeprom_dump_len; /* in bytes */ + uint32_t reg_dump_len; /* in bytes */ + char bus_info[BXE_BUS_INFO_LENGTH]; +}; +typedef struct bxe_drvinfo bxe_drvinfo_t; + +struct bxe_dev_setting { + + uint32_t supported; /* Features this interface supports */ + uint32_t advertising;/* Features this interface advertises */ + uint32_t speed; /* The forced speed, 10Mb, 100Mb, gigabit */ + uint32_t duplex; /* Duplex, half or full */ + uint32_t port; /* Which connector port */ + uint32_t phy_address;/* port number*/ + uint32_t autoneg; /* Enable or disable autonegotiation */ +}; +typedef struct bxe_dev_setting bxe_dev_setting_t; + +struct bxe_get_regs { + void *reg_buf; + uint32_t reg_buf_len; +}; +typedef struct bxe_get_regs bxe_get_regs_t; + +#define BXE_EEPROM_MAX_DATA_LEN 524288 + +struct bxe_eeprom { + uint32_t eeprom_cmd; +#define BXE_EEPROM_CMD_SET_EEPROM 0x01 +#define BXE_EEPROM_CMD_GET_EEPROM 0x02 + + void *eeprom_data; + uint32_t eeprom_offset; + uint32_t eeprom_data_len; + uint32_t eeprom_magic; +}; +typedef struct bxe_eeprom bxe_eeprom_t; + +struct bxe_reg_rdw { + uint32_t reg_cmd; +#define BXE_READ_REG_CMD 0x01 +#define BXE_WRITE_REG_CMD 0x02 + + uint32_t reg_id; + uint32_t reg_val; + uint32_t reg_access_type; +#define BXE_REG_ACCESS_DIRECT 0x01 +#define BXE_REG_ACCESS_INDIRECT 0x02 +}; + +typedef struct bxe_reg_rdw bxe_reg_rdw_t; + +struct bxe_pcicfg_rdw { + uint32_t cfg_cmd; +#define BXE_READ_PCICFG 0x01 +#define BXE_WRITE_PCICFG 0x01 + uint32_t cfg_id; + uint32_t cfg_val; + uint32_t cfg_width; +}; + +typedef struct bxe_pcicfg_rdw bxe_pcicfg_rdw_t; + +struct bxe_perm_mac_addr { + char mac_addr_str[32]; +}; + +typedef struct bxe_perm_mac_addr bxe_perm_mac_addr_t; + /* * Read grcdump size @@ -53,5 +133,41 @@ typedef struct bxe_grcdump bxe_grcdump_t; */ #define BXE_GRC_DUMP _IOWR('e', 2, bxe_grcdump_t) +/* + * Read driver info + */ +#define BXE_DRV_INFO _IOR('e', 3, bxe_drvinfo_t) + +/* + * Read Device Setting + */ +#define BXE_DEV_SETTING _IOR('e', 4, bxe_dev_setting_t) + +/* + * Get Registers + */ +#define BXE_GET_REGS _IOR('e', 5, bxe_get_regs_t) + +/* + * Get/Set EEPROM + */ +#define BXE_EEPROM _IOWR('e', 6, bxe_eeprom_t) + +/* + * read/write a register + */ +#define BXE_RDW_REG _IOWR('e', 7, bxe_reg_rdw_t) + +/* + * read/write PCIcfg + */ +#define BXE_RDW_PCICFG _IOWR('e', 8, bxe_reg_rdw_t) + +/* + * get permanent mac address + */ + +#define BXE_MAC_ADDR _IOWR('e', 9, bxe_perm_mac_addr_t) + #endif /* #ifndef _QLNX_IOCTL_H_ */ |