/* Product information read from the Edgeport */
struct product_info {
int TiMode; /* Current TI Mode */
- __u8 hardware_type; /* Type of hardware */
+ u8 hardware_type; /* Type of hardware */
} __attribute__((packed));
/*
} __packed;
struct edgeport_port {
- __u16 uart_base;
- __u16 dma_address;
- __u8 shadow_msr;
- __u8 shadow_mcr;
- __u8 shadow_lsr;
- __u8 lsr_mask;
- __u32 ump_read_timeout; /*
+ u16 uart_base;
+ u16 dma_address;
+ u8 shadow_msr;
+ u8 shadow_mcr;
+ u8 shadow_lsr;
+ u8 lsr_mask;
+ u32 ump_read_timeout; /*
* Number of milliseconds the UMP will
* wait without data before completing
* a read short
struct edgeport_serial *edge_serial;
struct usb_serial_port *port;
- __u8 bUartMode; /* Port type, 0: RS232, etc. */
+ u8 bUartMode; /* Port type, 0: RS232, etc. */
spinlock_t ep_lock;
int ep_read_urb_state;
int ep_write_urb_in_use;
}
/* clear tx/rx buffers and fifo in TI UMP */
-static int purge_port(struct usb_serial_port *port, __u16 mask)
+static int purge_port(struct usb_serial_port *port, u16 mask)
{
int port_number = port->port_number;
* @buffer: pointer to input data buffer
*/
static int read_download_mem(struct usb_device *dev, int start_address,
- int length, __u8 address_type, __u8 *buffer)
+ int length, u8 address_type, u8 *buffer)
{
int status = 0;
- __u8 read_length;
+ u8 read_length;
u16 be_start_address;
dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, length);
if (length > 64)
read_length = 64;
else
- read_length = (__u8)length;
+ read_length = (u8)length;
if (read_length > 1) {
dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, read_length);
*/
be_start_address = swab16((u16)start_address);
status = ti_vread_sync(dev, UMPC_MEMORY_READ,
- (__u16)address_type,
+ (u16)address_type,
be_start_address,
buffer, read_length);
}
static int read_ram(struct usb_device *dev, int start_address,
- int length, __u8 *buffer)
+ int length, u8 *buffer)
{
return read_download_mem(dev, start_address, length,
DTK_ADDR_SPACE_XDATA, buffer);
/* Read edgeport memory to a given block */
static int read_boot_mem(struct edgeport_serial *serial,
- int start_address, int length, __u8 *buffer)
+ int start_address, int length, u8 *buffer)
{
int status = 0;
int i;
for (i = 0; i < length; i++) {
status = ti_vread_sync(serial->serial->dev,
UMPC_MEMORY_READ, serial->TI_I2C_Type,
- (__u16)(start_address+i), &buffer[i], 0x01);
+ (u16)(start_address+i), &buffer[i], 0x01);
if (status) {
dev_dbg(&serial->serial->dev->dev, "%s - ERROR %x\n", __func__, status);
return status;
/* Write given block to TI EPROM memory */
static int write_boot_mem(struct edgeport_serial *serial,
- int start_address, int length, __u8 *buffer)
+ int start_address, int length, u8 *buffer)
{
int status = 0;
int i;
/* Write edgeport I2C memory to TI chip */
static int write_i2c_mem(struct edgeport_serial *serial,
- int start_address, int length, __u8 address_type, __u8 *buffer)
+ int start_address, int length, u8 address_type, u8 *buffer)
{
struct device *dev = &serial->serial->dev->dev;
int status = 0;
{
int status;
struct out_endpoint_desc_block *oedb;
- __u8 *lsr;
+ u8 *lsr;
int bytes_left = 0;
oedb = kmalloc(sizeof(*oedb), GFP_KERNEL);
}
static int read_rom(struct edgeport_serial *serial,
- int start_address, int length, __u8 *buffer)
+ int start_address, int length, u8 *buffer)
{
int status;
}
static int write_rom(struct edgeport_serial *serial, int start_address,
- int length, __u8 *buffer)
+ int length, u8 *buffer)
{
if (serial->product_info.TiMode == TI_MODE_BOOT)
return write_boot_mem(serial, start_address, length,
status = read_rom(serial,
start_address,
sizeof(struct ti_i2c_desc),
- (__u8 *)rom_desc);
+ (u8 *)rom_desc);
if (status)
return 0;
}
/* Validate descriptor checksum */
-static int valid_csum(struct ti_i2c_desc *rom_desc, __u8 *buffer)
+static int valid_csum(struct ti_i2c_desc *rom_desc, u8 *buffer)
{
- __u16 i;
- __u8 cs = 0;
+ u16 i;
+ u8 cs = 0;
for (i = 0; i < le16_to_cpu(rom_desc->Size); i++)
- cs = (__u8)(cs + buffer[i]);
+ cs = (u8)(cs + buffer[i]);
if (cs != rom_desc->CheckSum) {
pr_debug("%s - Mismatch %x - %x", __func__, rom_desc->CheckSum, cs);
int status = 0;
struct ti_i2c_desc *rom_desc;
int start_address = 2;
- __u8 *buffer;
- __u16 ttype;
+ u8 *buffer;
+ u16 ttype;
rom_desc = kmalloc(sizeof(*rom_desc), GFP_KERNEL);
if (!rom_desc)
status = read_rom(serial,
start_address,
sizeof(struct ti_i2c_desc),
- (__u8 *)rom_desc);
+ (u8 *)rom_desc);
if (status)
break;
return status;
}
-static int get_manuf_info(struct edgeport_serial *serial, __u8 *buffer)
+static int get_manuf_info(struct edgeport_serial *serial, u8 *buffer)
{
int status;
int start_address;
/* Build firmware header used for firmware update */
static int build_i2c_fw_hdr(u8 *header, const struct firmware *fw)
{
- __u8 *buffer;
+ u8 *buffer;
int buffer_size;
int i;
- __u8 cs = 0;
+ u8 cs = 0;
struct ti_i2c_desc *i2c_header;
struct ti_i2c_image_header *img_header;
struct ti_i2c_firmware_rec *firmware_rec;
le16_to_cpu(img_header->Length));
for (i=0; i < buffer_size; i++) {
- cs = (__u8)(cs + buffer[i]);
+ cs = (u8)(cs + buffer[i]);
}
kfree(buffer);
}
/* Download given firmware image to the device (IN BOOT MODE) */
-static int download_code(struct edgeport_serial *serial, __u8 *image,
+static int download_code(struct edgeport_serial *serial, u8 *image,
int image_length)
{
int status = 0;
if (!ti_manuf_desc)
return -ENOMEM;
- status = get_manuf_info(serial, (__u8 *)ti_manuf_desc);
+ status = get_manuf_info(serial, (u8 *)ti_manuf_desc);
if (status) {
kfree(ti_manuf_desc);
return status;
status = read_rom(serial, start_address +
sizeof(struct ti_i2c_desc),
sizeof(struct ti_i2c_firmware_rec),
- (__u8 *)firmware_version);
+ (u8 *)firmware_version);
if (status) {
kfree(firmware_version);
kfree(rom_desc);
if (start_address != 0) {
#define HEADER_SIZE (sizeof(struct ti_i2c_desc) + \
sizeof(struct ti_i2c_firmware_rec))
- __u8 *header;
- __u8 *vheader;
+ u8 *header;
+ u8 *vheader;
header = kmalloc(HEADER_SIZE, GFP_KERNEL);
if (!header) {
if (!check_i2c_image(serial)) {
struct ti_i2c_image_header *header;
int i;
- __u8 cs = 0;
- __u8 *buffer;
+ u8 cs = 0;
+ u8 *buffer;
int buffer_size;
/*
if (!ti_manuf_desc)
return -ENOMEM;
- status = get_manuf_info(serial, (__u8 *)ti_manuf_desc);
+ status = get_manuf_info(serial, (u8 *)ti_manuf_desc);
if (status) {
kfree(ti_manuf_desc);
goto stayinbootmode;
for (i = sizeof(struct ti_i2c_image_header);
i < buffer_size; i++) {
- cs = (__u8)(cs + buffer[i]);
+ cs = (u8)(cs + buffer[i]);
}
header = (struct ti_i2c_image_header *)buffer;
/* update length and checksum after padding */
- header->Length = cpu_to_le16((__u16)(buffer_size -
+ header->Length = cpu_to_le16((u16)(buffer_size -
sizeof(struct ti_i2c_image_header)));
header->CheckSum = cs;
return send_port_cmd(port->port, feature, on, NULL, 0);
}
-static int restore_mcr(struct edgeport_port *port, __u8 mcr)
+static int restore_mcr(struct edgeport_port *port, u8 mcr)
{
int status = 0;
}
/* Convert TI LSR to standard UART flags */
-static __u8 map_line_status(__u8 ti_lsr)
+static u8 map_line_status(u8 ti_lsr)
{
- __u8 lsr = 0;
+ u8 lsr = 0;
#define MAP_FLAG(flagUmp, flagUart) \
if (ti_lsr & flagUmp) \
return lsr;
}
-static void handle_new_msr(struct edgeport_port *edge_port, __u8 msr)
+static void handle_new_msr(struct edgeport_port *edge_port, u8 msr)
{
struct async_icount *icount;
struct tty_struct *tty;
}
static void handle_new_lsr(struct edgeport_port *edge_port, int lsr_data,
- __u8 lsr, __u8 data)
+ u8 lsr, u8 data)
{
struct async_icount *icount;
- __u8 new_lsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR |
+ u8 new_lsr = (u8)(lsr & (u8)(LSR_OVER_ERR | LSR_PAR_ERR |
LSR_FRM_ERR | LSR_BREAK));
dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, new_lsr);
* Parity and Framing errors only count if they
* occur exclusive of a break being received.
*/
- new_lsr &= (__u8)(LSR_OVER_ERR | LSR_BREAK);
+ new_lsr &= (u8)(LSR_OVER_ERR | LSR_BREAK);
/* Place LSR data byte into Rx buffer */
if (lsr_data)
int port_number;
int function;
int retval;
- __u8 lsr;
- __u8 msr;
+ u8 lsr;
+ u8 msr;
int status = urb->status;
switch (status) {
/* These flags must be set */
config->wFlags |= UMP_MASK_UART_FLAGS_RECEIVE_MS_INT;
config->wFlags |= UMP_MASK_UART_FLAGS_AUTO_START_ON_ERR;
- config->bUartMode = (__u8)(edge_port->bUartMode);
+ config->bUartMode = (u8)(edge_port->bUartMode);
switch (cflag & CSIZE) {
case CS5:
}
edge_port->baud_rate = baud;
- config->wBaudRate = (__u16)((461550L + baud/2) / baud);
+ config->wBaudRate = (u16)((461550L + baud/2) / baud);
/* FIXME: Recompute actual baud from divisor here */