Commit a3204711 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: io_edgeport: checkpatch cleanups

Minor whitespace cleanups to make checkpatch happy.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3bb36aa2
......@@ -91,7 +91,7 @@ All 16-bit fields are sent in little-endian (Intel) format.
struct int_status_pkt {
__u16 RxBytesAvail; // Additional bytes available to
// be read from Bulk IN pipe
__u16 TxCredits[ MAX_RS232_PORTS ]; // Additional space available in
__u16 TxCredits[MAX_RS232_PORTS]; // Additional space available in
// given port's TxBuffer
};
......@@ -115,24 +115,24 @@ struct int_status_pkt {
#define IOSP_CMD_STAT_BIT 0x80 // If set, this is command/status header
#define IS_CMD_STAT_HDR(Byte1) ((Byte1) & IOSP_CMD_STAT_BIT)
#define IS_DATA_HDR(Byte1) (! IS_CMD_STAT_HDR(Byte1))
#define IS_DATA_HDR(Byte1) (!IS_CMD_STAT_HDR(Byte1))
#define IOSP_GET_HDR_PORT(Byte1) ((__u8) ((Byte1) & IOSP_PORT_MASK))
#define IOSP_GET_HDR_DATA_LEN(Byte1, Byte2) ((__u16) ( ((__u16)((Byte1) & 0x78)) << 5) | (Byte2))
#define IOSP_GET_HDR_DATA_LEN(Byte1, Byte2) ((__u16) (((__u16)((Byte1) & 0x78)) << 5) | (Byte2))
#define IOSP_GET_STATUS_CODE(Byte1) ((__u8) (((Byte1) & 0x78) >> 3))
//
// These macros build the 1st and 2nd bytes for a data header
//
#define IOSP_BUILD_DATA_HDR1(Port, Len) ((__u8) (((Port) | ((__u8) (((__u16) (Len)) >> 5) & 0x78 ))))
#define IOSP_BUILD_DATA_HDR1(Port, Len) ((__u8) (((Port) | ((__u8) (((__u16) (Len)) >> 5) & 0x78))))
#define IOSP_BUILD_DATA_HDR2(Port, Len) ((__u8) (Len))
//
// These macros build the 1st and 2nd bytes for a command header
//
#define IOSP_BUILD_CMD_HDR1(Port, Cmd) ((__u8) ( IOSP_CMD_STAT_BIT | (Port) | ((__u8) ((Cmd) << 3)) ))
#define IOSP_BUILD_CMD_HDR1(Port, Cmd) ((__u8) (IOSP_CMD_STAT_BIT | (Port) | ((__u8) ((Cmd) << 3))))
//--------------------------------------------------------------
......@@ -195,23 +195,24 @@ struct int_status_pkt {
//
#define MAKE_CMD_WRITE_REG(ppBuf, pLen, Port, Reg, Val) \
do { \
(*(ppBuf))[0] = IOSP_BUILD_CMD_HDR1( (Port), IOSP_WRITE_UART_REG(Reg) ); \
do { \
(*(ppBuf))[0] = IOSP_BUILD_CMD_HDR1((Port), \
IOSP_WRITE_UART_REG(Reg)); \
(*(ppBuf))[1] = (Val); \
\
*ppBuf += 2; \
*pLen += 2; \
} while (0)
} while (0)
#define MAKE_CMD_EXT_CMD(ppBuf, pLen, Port, ExtCmd, Param) \
do { \
(*(ppBuf))[0] = IOSP_BUILD_CMD_HDR1( (Port), IOSP_EXT_CMD ); \
do { \
(*(ppBuf))[0] = IOSP_BUILD_CMD_HDR1((Port), IOSP_EXT_CMD); \
(*(ppBuf))[1] = (ExtCmd); \
(*(ppBuf))[2] = (Param); \
\
*ppBuf += 3; \
*pLen += 3; \
} while (0)
} while (0)
......@@ -446,9 +447,9 @@ struct int_status_pkt {
// Macros to parse status messages
//
#define IOSP_GET_STATUS_LEN(code) ( (code) < 8 ? 2 : ((code) < 0x0A ? 3 : 4) )
#define IOSP_GET_STATUS_LEN(code) ((code) < 8 ? 2 : ((code) < 0x0A ? 3 : 4))
#define IOSP_STATUS_IS_2BYTE(code) ( (code) < 0x08 )
#define IOSP_STATUS_IS_3BYTE(code) ( ((code) >= 0x08) && ((code) <= 0x0B) )
#define IOSP_STATUS_IS_4BYTE(code) ( ((code) >= 0x0C) && ((code) <= 0x0D) )
#define IOSP_STATUS_IS_2BYTE(code) ((code) < 0x08)
#define IOSP_STATUS_IS_3BYTE(code) (((code) >= 0x08) && ((code) <= 0x0B))
#define IOSP_STATUS_IS_4BYTE(code) (((code) >= 0x0C) && ((code) <= 0x0D))
......@@ -22,7 +22,7 @@
#define DTK_ADDR_SPACE_I2C_TYPE_II 0x82 /* Addr is placed in I2C area */
#define DTK_ADDR_SPACE_I2C_TYPE_III 0x83 /* Addr is placed in I2C area */
// UART Defines
/* UART Defines */
#define UMPMEM_BASE_UART1 0xFFA0 /* UMP UART1 base address */
#define UMPMEM_BASE_UART2 0xFFB0 /* UMP UART2 base address */
#define UMPMEM_OFFS_UART_LSR 0x05 /* UMP UART LSR register offset */
......@@ -54,7 +54,7 @@
#define UMP_UART_LSR_RX_MASK 0x10
#define UMP_UART_LSR_TX_MASK 0x20
#define UMP_UART_LSR_DATA_MASK ( LSR_PAR_ERR | LSR_FRM_ERR | LSR_BREAK )
#define UMP_UART_LSR_DATA_MASK (LSR_PAR_ERR | LSR_FRM_ERR | LSR_BREAK)
/* Port Settings Constants) */
#define UMP_MASK_UART_FLAGS_RTS_FLOW 0x0001
......@@ -79,10 +79,10 @@
#define UMP_PORT_DIR_OUT 0x01
#define UMP_PORT_DIR_IN 0x02
// Address of Port 0
/* Address of Port 0 */
#define UMPM_UART1_PORT 0x03
// Commands
/* Commands */
#define UMPC_SET_CONFIG 0x05
#define UMPC_OPEN_PORT 0x06
#define UMPC_CLOSE_PORT 0x07
......@@ -91,36 +91,43 @@
#define UMPC_TEST_PORT 0x0A
#define UMPC_PURGE_PORT 0x0B
#define UMPC_COMPLETE_READ 0x80 // Force the Firmware to complete the current Read
#define UMPC_HARDWARE_RESET 0x81 // Force UMP back into BOOT Mode
#define UMPC_COPY_DNLD_TO_I2C 0x82 // Copy current download image to type 0xf2 record in 16k I2C
// firmware will change 0xff record to type 2 record when complete
/* Force the Firmware to complete the current Read */
#define UMPC_COMPLETE_READ 0x80
/* Force UMP back into BOOT Mode */
#define UMPC_HARDWARE_RESET 0x81
/*
* Copy current download image to type 0xf2 record in 16k I2C
* firmware will change 0xff record to type 2 record when complete
*/
#define UMPC_COPY_DNLD_TO_I2C 0x82
// Special function register commands
// wIndex is register address
// wValue is MSB/LSB mask/data
#define UMPC_WRITE_SFR 0x83 // Write SFR Register
/*
* Special function register commands
* wIndex is register address
* wValue is MSB/LSB mask/data
*/
#define UMPC_WRITE_SFR 0x83 /* Write SFR Register */
// wIndex is register address
#define UMPC_READ_SFR 0x84 // Read SRF Register
/* wIndex is register address */
#define UMPC_READ_SFR 0x84 /* Read SRF Register */
// Set or Clear DTR (wValue bit 0 Set/Clear) wIndex ModuleID (port)
/* Set or Clear DTR (wValue bit 0 Set/Clear) wIndex ModuleID (port) */
#define UMPC_SET_CLR_DTR 0x85
// Set or Clear RTS (wValue bit 0 Set/Clear) wIndex ModuleID (port)
/* Set or Clear RTS (wValue bit 0 Set/Clear) wIndex ModuleID (port) */
#define UMPC_SET_CLR_RTS 0x86
// Set or Clear LOOPBACK (wValue bit 0 Set/Clear) wIndex ModuleID (port)
/* Set or Clear LOOPBACK (wValue bit 0 Set/Clear) wIndex ModuleID (port) */
#define UMPC_SET_CLR_LOOPBACK 0x87
// Set or Clear BREAK (wValue bit 0 Set/Clear) wIndex ModuleID (port)
/* Set or Clear BREAK (wValue bit 0 Set/Clear) wIndex ModuleID (port) */
#define UMPC_SET_CLR_BREAK 0x88
// Read MSR wIndex ModuleID (port)
/* Read MSR wIndex ModuleID (port) */
#define UMPC_READ_MSR 0x89
/* Toolkit commands */
/* Read-write group */
/* Toolkit commands */
/* Read-write group */
#define UMPC_MEMORY_READ 0x92
#define UMPC_MEMORY_WRITE 0x93
......@@ -130,8 +137,7 @@
#define UMPD_OEDB1_ADDRESS 0xFF08
#define UMPD_OEDB2_ADDRESS 0xFF10
struct out_endpoint_desc_block
{
struct out_endpoint_desc_block {
__u8 Configuration;
__u8 XBufAddr;
__u8 XByteCount;
......@@ -147,8 +153,8 @@ struct out_endpoint_desc_block
* TYPE DEFINITIONS
* Structures for Firmware commands
*/
struct ump_uart_config /* UART settings */
{
/* UART settings */
struct ump_uart_config {
__u16 wBaudRate; /* Baud rate */
__u16 wFlags; /* Bitmap mask of flags */
__u8 bDataBits; /* 5..8 - data bits per character */
......@@ -165,8 +171,8 @@ struct ump_uart_config /* UART settings */
* TYPE DEFINITIONS
* Structures for USB interrupts
*/
struct ump_interrupt /* Interrupt packet structure */
{
/* Interrupt packet structure */
struct ump_interrupt {
__u8 bICode; /* Interrupt code (interrupt num) */
__u8 bIInfo; /* Interrupt information */
} __attribute__((packed));
......
......@@ -217,17 +217,17 @@
#define ION_DEVICE_ID_MT4X56USB 0x1403 // OEM device
#define GENERATION_ID_FROM_USB_PRODUCT_ID( ProductId ) \
( (__u16) ((ProductId >> 8) & (ION_GENERATION_MASK)) )
#define GENERATION_ID_FROM_USB_PRODUCT_ID(ProductId) \
((__u16) ((ProductId >> 8) & (ION_GENERATION_MASK)))
#define MAKE_USB_PRODUCT_ID( OemId, DeviceId ) \
( (__u16) (((OemId) << 10) || (DeviceId)) )
#define MAKE_USB_PRODUCT_ID(OemId, DeviceId) \
((__u16) (((OemId) << 10) || (DeviceId)))
#define DEVICE_ID_FROM_USB_PRODUCT_ID( ProductId ) \
( (__u16) ((ProductId) & (EDGEPORT_DEVICE_ID_MASK)) )
#define DEVICE_ID_FROM_USB_PRODUCT_ID(ProductId) \
((__u16) ((ProductId) & (EDGEPORT_DEVICE_ID_MASK)))
#define OEM_ID_FROM_USB_PRODUCT_ID( ProductId ) \
( (__u16) (((ProductId) >> 10) & 0x3F) )
#define OEM_ID_FROM_USB_PRODUCT_ID(ProductId) \
((__u16) (((ProductId) >> 10) & 0x3F))
//
// Definitions of parameters for download code. Note that these are
......@@ -237,7 +237,7 @@
// TxCredits value below which driver won't bother sending (to prevent too many small writes).
// Send only if above 25%
#define EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(InitialCredit, MaxPacketSize) (max( ((InitialCredit) / 4), (MaxPacketSize) ))
#define EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(InitialCredit, MaxPacketSize) (max(((InitialCredit) / 4), (MaxPacketSize)))
#define EDGE_FW_BULK_MAX_PACKET_SIZE 64 // Max Packet Size for Bulk In Endpoint (EP1)
#define EDGE_FW_BULK_READ_BUFFER_SIZE 1024 // Size to use for Bulk reads
......@@ -301,8 +301,7 @@
// this is a "real" Edgeport.
//
struct edge_compatibility_bits
{
struct edge_compatibility_bits {
// This __u32 defines which Vendor-specific commands/functionality
// the device supports on the default EP0 pipe.
......@@ -334,15 +333,13 @@ struct edge_compatibility_bits
__u32 TrueEdgeport : 1; // 0001 Set if device is a 'real' Edgeport
// (Used only by driver, NEVER set by an EPiC device)
__u32 GenUnused : 31; // Available for future expansion, must be 0
};
#define EDGE_COMPATIBILITY_MASK0 0x0001
#define EDGE_COMPATIBILITY_MASK1 0x3FFF
#define EDGE_COMPATIBILITY_MASK2 0x0001
struct edge_compatibility_descriptor
{
struct edge_compatibility_descriptor {
__u8 Length; // Descriptor Length (per USB spec)
__u8 DescType; // Descriptor Type (per USB spec, =DEVICE type)
__u8 EpicVer; // Version of EPiC spec supported
......@@ -350,7 +347,7 @@ struct edge_compatibility_descriptor
__u8 NumPorts; // Number of serial ports supported
__u8 iDownloadFile; // Index of string containing download code filename
// 0=no download, FF=download compiled into driver.
__u8 Unused[ 3 ]; // Available for future expansion, must be 0
__u8 Unused[3]; // Available for future expansion, must be 0
// (Currently must be 0).
__u8 MajorVersion; // Firmware version: xx.
__u8 MinorVersion; // yy.
......@@ -359,9 +356,7 @@ struct edge_compatibility_descriptor
// The following structure contains __u32s, with each bit
// specifying whether the EPiC device supports the given
// command or functionality.
struct edge_compatibility_bits Supports;
};
// Values for iDownloadFile
......@@ -391,8 +386,8 @@ struct edge_compatibility_descriptor
// Define the max block size that may be read or written
// in a read/write RAM/ROM command.
#define MAX_SIZE_REQ_ION_READ_MEM ( (__u16) 64 )
#define MAX_SIZE_REQ_ION_WRITE_MEM ( (__u16) 64 )
#define MAX_SIZE_REQ_ION_READ_MEM ((__u16)64)
#define MAX_SIZE_REQ_ION_WRITE_MEM ((__u16)64)
//
......@@ -597,41 +592,36 @@ struct edge_boot_descriptor {
#define I2C_DESC_TYPE_ION 0 // Not defined by TI
struct ti_i2c_desc
{
struct ti_i2c_desc {
__u8 Type; // Type of descriptor
__u16 Size; // Size of data only not including header
__u8 CheckSum; // Checksum (8 bit sum of data only)
__u8 Data[0]; // Data starts here
}__attribute__((packed));
} __attribute__((packed));
// for 5152 devices only (type 2 record)
// for 3410 the version is stored in the WATCHPORT_FIRMWARE_VERSION descriptor
struct ti_i2c_firmware_rec
{
struct ti_i2c_firmware_rec {
__u8 Ver_Major; // Firmware Major version number
__u8 Ver_Minor; // Firmware Minor version number
__u8 Data[0]; // Download starts here
}__attribute__((packed));
} __attribute__((packed));
struct watchport_firmware_version
{
struct watchport_firmware_version {
// Added 2 bytes for version number
__u8 Version_Major; // Download Version (for Watchport)
__u8 Version_Minor;
}__attribute__((packed));
} __attribute__((packed));
// Structure of header of download image in fw_down.h
struct ti_i2c_image_header
{
struct ti_i2c_image_header {
__le16 Length;
__u8 CheckSum;
}__attribute__((packed));
} __attribute__((packed));
struct ti_basic_descriptor
{
struct ti_basic_descriptor {
__u8 Power; // Self powered
// bit 7: 1 - power switching supported
// 0 - power switching not supported
......@@ -663,7 +653,7 @@ struct ti_basic_descriptor
#define TI_I2C_SIZE_MASK 0x1f // 5 bits
#define TI_GET_I2C_SIZE(x) ((((x) & TI_I2C_SIZE_MASK)+1)*256)
#define TI_MAX_I2C_SIZE ( 16 * 1024 )
#define TI_MAX_I2C_SIZE (16 * 1024)
#define TI_MANUF_VERSION_0 0
......@@ -676,8 +666,7 @@ struct ti_basic_descriptor
#define TI_CONFIG2_WATCHPORT 0x10
struct edge_ti_manuf_descriptor
{
struct edge_ti_manuf_descriptor {
__u8 IonConfig; // Config byte for ION manufacturing use
__u8 IonConfig2; // Expansion
__u8 Version; // Version
......@@ -688,7 +677,7 @@ struct edge_ti_manuf_descriptor
__u8 HubConfig2; // Used to configure the Hub
__u8 TotalPorts; // Total Number of Com Ports for the entire device (All UMPs)
__u8 Reserved; // Reserved
}__attribute__((packed));
} __attribute__((packed));
#endif // if !defined(_USBVEND_H)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment