USB: fix codingstyle issues in include/linux/usb/

Fixes a number of coding style issues in the USB public header files.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2008-01-30 15:21:33 -08:00
parent 969ab2ee9d
commit 41dceed51f
11 changed files with 219 additions and 204 deletions

View file

@ -27,13 +27,13 @@
/* 4.3.2 Class-Specific AC Interface Descriptor */
struct usb_ac_header_descriptor {
__u8 bLength; // 8+n
__u8 bDescriptorType; // USB_DT_CS_INTERFACE
__u8 bDescriptorSubtype; // USB_MS_HEADER
__le16 bcdADC; // 0x0100
__le16 wTotalLength; // includes Unit and Terminal desc.
__u8 bInCollection; // n
__u8 baInterfaceNr[]; // [n]
__u8 bLength; /* 8+n */
__u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
__u8 bDescriptorSubtype; /* USB_MS_HEADER */
__le16 bcdADC; /* 0x0100 */
__le16 wTotalLength; /* includes Unit and Terminal desc. */
__u8 bInCollection; /* n */
__u8 baInterfaceNr[]; /* [n] */
} __attribute__ ((packed));
#define USB_DT_AC_HEADER_SIZE(n) (8+(n))

View file

@ -70,9 +70,10 @@ struct usb_ep;
*
* Bulk endpoints can use any size buffers, and can also be used for interrupt
* transfers. interrupt-only endpoints can be much less functional.
*
* NOTE: this is analagous to 'struct urb' on the host side, except that
* it's thinner and promotes more pre-allocation.
*/
// NOTE this is analagous to 'struct urb' on the host side,
// except that it's thinner and promotes more pre-allocation.
struct usb_request {
void *buf;
@ -168,8 +169,8 @@ struct usb_ep {
*
* returns zero, or a negative error code.
*/
static inline int
usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc)
static inline int usb_ep_enable(struct usb_ep *ep,
const struct usb_endpoint_descriptor *desc)
{
return ep->ops->enable(ep, desc);
}
@ -186,8 +187,7 @@ usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc)
*
* returns zero, or a negative error code.
*/
static inline int
usb_ep_disable (struct usb_ep *ep)
static inline int usb_ep_disable(struct usb_ep *ep)
{
return ep->ops->disable(ep);
}
@ -206,8 +206,8 @@ usb_ep_disable (struct usb_ep *ep)
*
* Returns the request, or null if one could not be allocated.
*/
static inline struct usb_request *
usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags)
static inline struct usb_request *usb_ep_alloc_request(struct usb_ep *ep,
gfp_t gfp_flags)
{
return ep->ops->alloc_request(ep, gfp_flags);
}
@ -221,8 +221,8 @@ usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags)
* Caller guarantees the request is not queued, and that it will
* no longer be requeued (or otherwise used).
*/
static inline void
usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
static inline void usb_ep_free_request(struct usb_ep *ep,
struct usb_request *req)
{
ep->ops->free_request(ep, req);
}
@ -281,8 +281,8 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
* report errors; errors will also be
* reported when the usb peripheral is disconnected.
*/
static inline int
usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags)
static inline int usb_ep_queue(struct usb_ep *ep,
struct usb_request *req, gfp_t gfp_flags)
{
return ep->ops->queue(ep, req, gfp_flags);
}
@ -327,8 +327,7 @@ static inline int usb_ep_dequeue (struct usb_ep *ep, struct usb_request *req)
* transfer requests are still queued, or if the controller hardware
* (usually a FIFO) still holds bytes that the host hasn't collected.
*/
static inline int
usb_ep_set_halt (struct usb_ep *ep)
static inline int usb_ep_set_halt(struct usb_ep *ep)
{
return ep->ops->set_halt(ep, 1);
}
@ -346,8 +345,7 @@ usb_ep_set_halt (struct usb_ep *ep)
* Note that some hardware can't support this request (like pxa2xx_udc),
* and accordingly can't correctly implement interface altsettings.
*/
static inline int
usb_ep_clear_halt (struct usb_ep *ep)
static inline int usb_ep_clear_halt(struct usb_ep *ep)
{
return ep->ops->set_halt(ep, 0);
}
@ -367,8 +365,7 @@ usb_ep_clear_halt (struct usb_ep *ep)
* errno if the endpoint doesn't use a FIFO or doesn't support such
* precise handling.
*/
static inline int
usb_ep_fifo_status (struct usb_ep *ep)
static inline int usb_ep_fifo_status(struct usb_ep *ep)
{
if (ep->ops->fifo_status)
return ep->ops->fifo_status(ep);
@ -385,8 +382,7 @@ usb_ep_fifo_status (struct usb_ep *ep)
* must never be used except when endpoint is not being used for any
* protocol translation.
*/
static inline void
usb_ep_fifo_flush (struct usb_ep *ep)
static inline void usb_ep_fifo_flush(struct usb_ep *ep)
{
if (ep->ops->fifo_flush)
ep->ops->fifo_flush(ep);
@ -511,7 +507,6 @@ static inline int gadget_is_otg(struct usb_gadget *g)
#endif
}
/**
* usb_gadget_frame_number - returns the current frame number
* @gadget: controller that reports the frame number
@ -553,8 +548,7 @@ static inline int usb_gadget_wakeup (struct usb_gadget *gadget)
*
* returns zero on success, else negative errno.
*/
static inline int
usb_gadget_set_selfpowered (struct usb_gadget *gadget)
static inline int usb_gadget_set_selfpowered(struct usb_gadget *gadget)
{
if (!gadget->ops->set_selfpowered)
return -EOPNOTSUPP;
@ -571,8 +565,7 @@ usb_gadget_set_selfpowered (struct usb_gadget *gadget)
*
* returns zero on success, else negative errno.
*/
static inline int
usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
static inline int usb_gadget_clear_selfpowered(struct usb_gadget *gadget)
{
if (!gadget->ops->set_selfpowered)
return -EOPNOTSUPP;
@ -591,8 +584,7 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
*
* Returns zero on success, else negative errno.
*/
static inline int
usb_gadget_vbus_connect(struct usb_gadget *gadget)
static inline int usb_gadget_vbus_connect(struct usb_gadget *gadget)
{
if (!gadget->ops->vbus_session)
return -EOPNOTSUPP;
@ -611,8 +603,7 @@ usb_gadget_vbus_connect(struct usb_gadget *gadget)
*
* Returns zero on success, else negative errno.
*/
static inline int
usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
{
if (!gadget->ops->vbus_draw)
return -EOPNOTSUPP;
@ -629,8 +620,7 @@ usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
*
* Returns zero on success, else negative errno.
*/
static inline int
usb_gadget_vbus_disconnect(struct usb_gadget *gadget)
static inline int usb_gadget_vbus_disconnect(struct usb_gadget *gadget)
{
if (!gadget->ops->vbus_session)
return -EOPNOTSUPP;
@ -648,8 +638,7 @@ usb_gadget_vbus_disconnect(struct usb_gadget *gadget)
*
* Returns zero on success, else negative errno.
*/
static inline int
usb_gadget_connect (struct usb_gadget *gadget)
static inline int usb_gadget_connect(struct usb_gadget *gadget)
{
if (!gadget->ops->pullup)
return -EOPNOTSUPP;
@ -671,8 +660,7 @@ usb_gadget_connect (struct usb_gadget *gadget)
*
* Returns zero on success, else negative errno.
*/
static inline int
usb_gadget_disconnect (struct usb_gadget *gadget)
static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
{
if (!gadget->ops->pullup)
return -EOPNOTSUPP;
@ -680,7 +668,6 @@ usb_gadget_disconnect (struct usb_gadget *gadget)
}
/*-------------------------------------------------------------------------*/
/**
@ -764,7 +751,7 @@ struct usb_gadget_driver {
void (*suspend)(struct usb_gadget *);
void (*resume)(struct usb_gadget *);
// FIXME support safe rmmod
/* FIXME support safe rmmod */
struct device_driver driver;
};

View file

@ -36,7 +36,7 @@ enum usb_gadgetfs_event_type {
GADGETFS_DISCONNECT,
GADGETFS_SETUP,
GADGETFS_SUSPEND,
// and likely more !
/* and likely more ! */
};
/* NOTE: this structure must stay the same size and layout on
@ -44,15 +44,17 @@ enum usb_gadgetfs_event_type {
*/
struct usb_gadgetfs_event {
union {
// NOP, DISCONNECT, SUSPEND: nothing
// ... some hardware can't report disconnection
/* NOP, DISCONNECT, SUSPEND: nothing
* ... some hardware can't report disconnection
*/
// CONNECT: just the speed
/* CONNECT: just the speed */
enum usb_device_speed speed;
// SETUP: packet; DATA phase i/o precedes next event
// (setup.bmRequestType & USB_DIR_IN) flags direction
// ... includes SET_CONFIGURATION, SET_INTERFACE
/* SETUP: packet; DATA phase i/o precedes next event
*(setup.bmRequestType & USB_DIR_IN) flags direction
* ... includes SET_CONFIGURATION, SET_INTERFACE
*/
struct usb_ctrlrequest setup;
} u;
enum usb_gadgetfs_event_type type;

View file

@ -14,14 +14,23 @@
this information.
*/
struct iowarrior_info {
__u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */
__u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */
__u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */
__u32 revision; /* revision number of the chip */
__u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */
__u32 power; /* power consumption of the device in mA */
__u32 if_num; /* the number of the endpoint */
__u32 report_size; /* size of the data-packets on this interface */
/* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */
__u32 vendor;
/* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_X) */
__u32 product;
/* the serial number of our chip (if a serial-number is not available
* this is empty string) */
__u8 serial[9];
/* revision number of the chip */
__u32 revision;
/* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */
__u32 speed;
/* power consumption of the device in mA */
__u32 power;
/* the number of the endpoint */
__u32 if_num;
/* size of the data-packets on this interface */
__u32 report_size;
};
/*

View file

@ -47,9 +47,9 @@ struct usb_ms_header_descriptor {
/* 6.1.2.2 MIDI IN Jack Descriptor */
struct usb_midi_in_jack_descriptor {
__u8 bLength;
__u8 bDescriptorType; // USB_DT_CS_INTERFACE
__u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK
__u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL
__u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
__u8 bDescriptorSubtype; /* USB_MS_MIDI_IN_JACK */
__u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */
__u8 bJackID;
__u8 iJack;
} __attribute__ ((packed));
@ -64,12 +64,12 @@ struct usb_midi_source_pin {
/* 6.1.2.3 MIDI OUT Jack Descriptor */
struct usb_midi_out_jack_descriptor {
__u8 bLength;
__u8 bDescriptorType; // USB_DT_CS_INTERFACE
__u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK
__u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL
__u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
__u8 bDescriptorSubtype; /* USB_MS_MIDI_OUT_JACK */
__u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */
__u8 bJackID;
__u8 bNrInputPins; // p
struct usb_midi_source_pin pins[]; // [p]
__u8 bNrInputPins; /* p */
struct usb_midi_source_pin pins[]; /* [p] */
/*__u8 iJack; -- ommitted due to variable-sized pins[] */
} __attribute__ ((packed));
@ -90,11 +90,11 @@ struct usb_midi_out_jack_descriptor_##p { \
/* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */
struct usb_ms_endpoint_descriptor {
__u8 bLength; // 4+n
__u8 bDescriptorType; // USB_DT_CS_ENDPOINT
__u8 bDescriptorSubtype; // USB_MS_GENERAL
__u8 bNumEmbMIDIJack; // n
__u8 baAssocJackID[]; // [n]
__u8 bLength; /* 4+n */
__u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */
__u8 bDescriptorSubtype; /* USB_MS_GENERAL */
__u8 bNumEmbMIDIJack; /* n */
__u8 baAssocJackID[]; /* [n] */
} __attribute__ ((packed));
#define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))

View file

@ -37,7 +37,7 @@
/* main registers, BAR0 + 0x0000 */
struct net2280_regs {
// offset 0x0000
/* offset 0x0000 */
u32 devinit;
#define LOCAL_CLOCK_FREQUENCY 8
#define FORCE_PCI_RESET 7
@ -61,7 +61,7 @@ struct net2280_regs {
#define EEPROM_WRITE_DATA 0
u32 eeclkfreq;
u32 _unused0;
// offset 0x0010
/* offset 0x0010 */
u32 pciirqenb0; /* interrupt PCI master ... */
#define SETUP_PACKET_INTERRUPT_ENABLE 7
@ -131,7 +131,7 @@ struct net2280_regs {
#define RESUME_INTERRUPT_ENABLE 1
#define SOF_INTERRUPT_ENABLE 0
// offset 0x0020
/* offset 0x0020 */
u32 _unused1;
u32 usbirqenb1;
#define USB_INTERRUPT_ENABLE 31
@ -195,7 +195,7 @@ struct net2280_regs {
#define SUSPEND_REQUEST_CHANGE_INTERRUPT 2
#define RESUME_INTERRUPT 1
#define SOF_INTERRUPT 0
// offset 0x0030
/* offset 0x0030 */
u32 idxaddr;
u32 idxdata;
u32 fifoctl;
@ -204,7 +204,7 @@ struct net2280_regs {
#define PCI_BASE2_SELECT 2
#define FIFO_CONFIGURATION_SELECT 0
u32 _unused2;
// offset 0x0040
/* offset 0x0040 */
u32 memaddr;
#define START 28
#define DIRECTION 27
@ -213,7 +213,7 @@ struct net2280_regs {
u32 memdata0;
u32 memdata1;
u32 _unused3;
// offset 0x0050
/* offset 0x0050 */
u32 gpioctl;
#define GPIO3_LED_SELECT 12
#define GPIO3_INTERRUPT_ENABLE 11
@ -237,7 +237,7 @@ struct net2280_regs {
/* usb control, BAR0 + 0x0080 */
struct net2280_usb_regs {
// offset 0x0080
/* offset 0x0080 */
u32 stdrsp;
#define STALL_UNSUPPORTED_REQUESTS 31
#define SET_TEST_MODE 16
@ -275,7 +275,7 @@ struct net2280_usb_regs {
#define PME_WAKEUP_ENABLE 2
#define DEVICE_REMOTE_WAKEUP_ENABLE 1
#define SELF_POWERED_STATUS 0
// offset 0x0090
/* offset 0x0090 */
u32 usbstat;
#define HIGH_SPEED 7
#define FULL_SPEED 6
@ -291,7 +291,7 @@ struct net2280_usb_regs {
#define TERMINATION_SELECT 0
u32 setup0123;
u32 setup4567;
// offset 0x0090
/* offset 0x0090 */
u32 _unused0;
u32 ouraddr;
#define FORCE_IMMEDIATE 7
@ -301,7 +301,7 @@ struct net2280_usb_regs {
/* pci control, BAR0 + 0x0100 */
struct net2280_pci_regs {
// offset 0x0100
/* offset 0x0100 */
u32 pcimstctl;
#define PCI_ARBITER_PARK_SELECT 13
#define PCI_MULTI LEVEL_ARBITER 12
@ -331,7 +331,7 @@ struct net2280_pci_regs {
* that can be loaded into some of these registers.
*/
struct net2280_dma_regs { /* [11.7] */
// offset 0x0180, 0x01a0, 0x01c0, 0x01e0,
/* offset 0x0180, 0x01a0, 0x01c0, 0x01e0, */
u32 dmactl;
#define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25
#define DMA_CLEAR_COUNT_ENABLE 21
@ -355,7 +355,7 @@ struct net2280_dma_regs { /* [11.7] */
#define DMA_ABORT 1
#define DMA_START 0
u32 _unused0 [2];
// offset 0x0190, 0x01b0, 0x01d0, 0x01f0,
/* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */
u32 dmacount;
#define VALID_BIT 31
#define DMA_DIRECTION 30
@ -371,9 +371,9 @@ struct net2280_dma_regs { /* [11.7] */
/* dedicated endpoint registers, BAR0 + 0x0200 */
struct net2280_dep_regs { /* [11.8] */
// offset 0x0200, 0x0210, 0x220, 0x230, 0x240
/* offset 0x0200, 0x0210, 0x220, 0x230, 0x240 */
u32 dep_cfg;
// offset 0x0204, 0x0214, 0x224, 0x234, 0x244
/* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */
u32 dep_rsp;
u32 _unused [2];
} __attribute__ ((packed));
@ -383,7 +383,7 @@ struct net2280_dep_regs { /* [11.8] */
* ep0 reserved for control; E and F have only 64 bytes of fifo
*/
struct net2280_ep_regs { /* [11.9] */
// offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0
/* offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 */
u32 ep_cfg;
#define ENDPOINT_BYTE_COUNT 16
#define ENDPOINT_ENABLE 10
@ -435,7 +435,7 @@ struct net2280_ep_regs { /* [11.9] */
#define DATA_PACKET_TRANSMITTED_INTERRUPT 2
#define DATA_OUT_PING_TOKEN_INTERRUPT 1
#define DATA_IN_TOKEN_INTERRUPT 0
// offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0
/* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */
u32 ep_avail;
u32 ep_data;
u32 _unused0 [2];

View file

@ -1,4 +1,4 @@
// include/linux/usb/otg.h
/* USB OTG (On The Go) defines */
/*
* These APIs may be used between USB controllers. USB device drivers

View file

@ -20,7 +20,8 @@
#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
#define SERIAL_TTY_MINORS 255 /* loads of devices :) */
#define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */
/* The maximum number of ports one device can grab at once */
#define MAX_NUM_PORTS 8
/* parity check flag */
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
@ -103,7 +104,8 @@ static inline void *usb_get_serial_port_data (struct usb_serial_port *port)
return dev_get_drvdata(&port->dev);
}
static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data)
static inline void usb_set_serial_port_data(struct usb_serial_port *port,
void *data)
{
dev_set_drvdata(&port->dev, data);
}
@ -159,8 +161,8 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
/**
* usb_serial_driver - describes a usb serial driver
* @description: pointer to a string that describes this driver. This string used
* in the syslog messages when a device is inserted or removed.
* @description: pointer to a string that describes this driver. This string
* used in the syslog messages when a device is inserted or removed.
* @id_table: pointer to a list of usb_device_id structures that define all
* of the devices this structure can support.
* @num_interrupt_in: If a device doesn't have this many interrupt-in
@ -236,35 +238,41 @@ struct usb_serial_driver {
/* serial function calls */
int (*open)(struct usb_serial_port *port, struct file *filp);
void (*close)(struct usb_serial_port *port, struct file *filp);
int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count);
int (*write)(struct usb_serial_port *port, const unsigned char *buf,
int count);
int (*write_room)(struct usb_serial_port *port);
int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
int (*ioctl)(struct usb_serial_port *port, struct file *file,
unsigned int cmd, unsigned long arg);
void (*set_termios)(struct usb_serial_port *port, struct ktermios *old);
void (*break_ctl)(struct usb_serial_port *port, int break_state);
int (*chars_in_buffer)(struct usb_serial_port *port);
void (*throttle)(struct usb_serial_port *port);
void (*unthrottle)(struct usb_serial_port *port);
int (*tiocmget)(struct usb_serial_port *port, struct file *file);
int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
int (*tiocmset)(struct usb_serial_port *port, struct file *file,
unsigned int set, unsigned int clear);
void (*read_int_callback)(struct urb *urb);
void (*write_int_callback)(struct urb *urb);
void (*read_bulk_callback)(struct urb *urb);
void (*write_bulk_callback)(struct urb *urb);
};
#define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver)
#define to_usb_serial_driver(d) \
container_of(d, struct usb_serial_driver, driver)
extern int usb_serial_register(struct usb_serial_driver *driver);
extern void usb_serial_deregister(struct usb_serial_driver *driver);
extern void usb_serial_port_softint(struct usb_serial_port *port);
extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id);
extern int usb_serial_probe(struct usb_interface *iface,
const struct usb_device_id *id);
extern void usb_serial_disconnect(struct usb_interface *iface);
extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message);
extern int usb_serial_resume(struct usb_interface *intf);
extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest);
extern int ezusb_writememory(struct usb_serial *serial, int address,
unsigned char *data, int length, __u8 bRequest);
extern int ezusb_set_reset(struct usb_serial *serial, unsigned char reset_bit);
/* USB Serial console functions */
@ -281,9 +289,12 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
/* Functions needed by other parts of the usbserial core */
extern struct usb_serial *usb_serial_get_by_index(unsigned int minor);
extern void usb_serial_put(struct usb_serial *serial);
extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp);
extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count);
extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp);
extern int usb_serial_generic_open(struct usb_serial_port *port,
struct file *filp);
extern int usb_serial_generic_write(struct usb_serial_port *port,
const unsigned char *buf, int count);
extern void usb_serial_generic_close(struct usb_serial_port *port,
struct file *filp);
extern int usb_serial_generic_resume(struct usb_serial *serial);
extern int usb_serial_generic_write_room(struct usb_serial_port *port);
extern int usb_serial_generic_chars_in_buffer(struct usb_serial_port *port);
@ -310,7 +321,8 @@ static inline void usb_serial_debug_data(int debug,
int i;
if (debug) {
dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size);
dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ",
function, size);
for (i = 0; i < size; ++i)
printk("%.2x ", data[i]);
printk("\n");
@ -319,7 +331,12 @@ static inline void usb_serial_debug_data(int debug,
/* Use our own dbg macro */
#undef dbg
#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0)
#define dbg(format, arg...) \
do { \
if (debug) \
printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , \
## arg); \
} while (0)

View file

@ -19,8 +19,8 @@ struct sl811_platform_data {
/* pulse sl811 nRST (probably with a GPIO) */
void (*reset)(struct device *dev);
// some boards need something like these:
// int (*check_overcurrent)(struct device *dev);
// void (*clock_enable)(struct device *dev, int is_on);
/* some boards need something like these: */
/* int (*check_overcurrent)(struct device *dev); */
/* void (*clock_enable)(struct device *dev, int is_on); */
};