Skip to content
Snippets Groups Projects
Commit c08b1b26 authored by Marek Vasut's avatar Marek Vasut Committed by Wolfgang Denk
Browse files

USB: Staticize internal functions


Signed-off-by: default avatarMarek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>
Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
parent e9100420
No related branches found
No related tags found
No related merge requests found
...@@ -80,10 +80,10 @@ char usb_started; /* flag for the started/stopped USB status */ ...@@ -80,10 +80,10 @@ char usb_started; /* flag for the started/stopped USB status */
/********************************************************************** /**********************************************************************
* some forward declerations... * some forward declerations...
*/ */
void usb_scan_devices(void); static void usb_scan_devices(void);
int usb_hub_probe(struct usb_device *dev, int ifnum); static int usb_hub_probe(struct usb_device *dev, int ifnum);
void usb_hub_reset(void); static void usb_hub_reset(void);
static int hub_port_reset(struct usb_device *dev, int port, static int hub_port_reset(struct usb_device *dev, int port,
unsigned short *portstat); unsigned short *portstat);
...@@ -316,7 +316,7 @@ usb_set_maxpacket_ep(struct usb_device *dev, int if_idx, int ep_idx) ...@@ -316,7 +316,7 @@ usb_set_maxpacket_ep(struct usb_device *dev, int if_idx, int ep_idx)
/* /*
* set the max packed value of all endpoints in the given configuration * set the max packed value of all endpoints in the given configuration
*/ */
int usb_set_maxpacket(struct usb_device *dev) static int usb_set_maxpacket(struct usb_device *dev)
{ {
int i, ii; int i, ii;
...@@ -331,7 +331,8 @@ int usb_set_maxpacket(struct usb_device *dev) ...@@ -331,7 +331,8 @@ int usb_set_maxpacket(struct usb_device *dev)
* Parse the config, located in buffer, and fills the dev->config structure. * Parse the config, located in buffer, and fills the dev->config structure.
* Note that all little/big endian swapping are done automatically. * Note that all little/big endian swapping are done automatically.
*/ */
int usb_parse_config(struct usb_device *dev, unsigned char *buffer, int cfgno) static int usb_parse_config(struct usb_device *dev,
unsigned char *buffer, int cfgno)
{ {
struct usb_descriptor_header *head; struct usb_descriptor_header *head;
int index, ifno, epno, curr_if_num; int index, ifno, epno, curr_if_num;
...@@ -450,7 +451,7 @@ int usb_clear_halt(struct usb_device *dev, int pipe) ...@@ -450,7 +451,7 @@ int usb_clear_halt(struct usb_device *dev, int pipe)
/********************************************************************** /**********************************************************************
* get_descriptor type * get_descriptor type
*/ */
int usb_get_descriptor(struct usb_device *dev, unsigned char type, static int usb_get_descriptor(struct usb_device *dev, unsigned char type,
unsigned char index, void *buf, int size) unsigned char index, void *buf, int size)
{ {
int res; int res;
...@@ -500,7 +501,7 @@ int usb_get_configuration_no(struct usb_device *dev, ...@@ -500,7 +501,7 @@ int usb_get_configuration_no(struct usb_device *dev,
* set address of a device to the value in dev->devnum. * set address of a device to the value in dev->devnum.
* This can only be done by addressing the device via the default address (0) * This can only be done by addressing the device via the default address (0)
*/ */
int usb_set_address(struct usb_device *dev) static int usb_set_address(struct usb_device *dev)
{ {
int res; int res;
...@@ -553,7 +554,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate) ...@@ -553,7 +554,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
/******************************************************************** /********************************************************************
* set configuration number to configuration * set configuration number to configuration
*/ */
int usb_set_configuration(struct usb_device *dev, int configuration) static int usb_set_configuration(struct usb_device *dev, int configuration)
{ {
int res; int res;
USB_PRINTF("set configuration %d\n", configuration); USB_PRINTF("set configuration %d\n", configuration);
...@@ -616,7 +617,7 @@ int usb_get_class_descriptor(struct usb_device *dev, int ifnum, ...@@ -616,7 +617,7 @@ int usb_get_class_descriptor(struct usb_device *dev, int ifnum,
/******************************************************************** /********************************************************************
* get string index in buffer * get string index in buffer
*/ */
int usb_get_string(struct usb_device *dev, unsigned short langid, static int usb_get_string(struct usb_device *dev, unsigned short langid,
unsigned char index, void *buf, int size) unsigned char index, void *buf, int size)
{ {
int i; int i;
...@@ -764,7 +765,7 @@ struct usb_device *usb_get_dev_index(int index) ...@@ -764,7 +765,7 @@ struct usb_device *usb_get_dev_index(int index)
/* returns a pointer of a new device structure or NULL, if /* returns a pointer of a new device structure or NULL, if
* no device struct is available * no device struct is available
*/ */
struct usb_device *usb_alloc_new_device(void) static struct usb_device *usb_alloc_new_device(void)
{ {
int i; int i;
USB_PRINTF("New Device %d\n", dev_index); USB_PRINTF("New Device %d\n", dev_index);
...@@ -790,7 +791,7 @@ struct usb_device *usb_alloc_new_device(void) ...@@ -790,7 +791,7 @@ struct usb_device *usb_alloc_new_device(void)
* *
* Returns 0 for success, != 0 for error. * Returns 0 for success, != 0 for error.
*/ */
int usb_new_device(struct usb_device *dev) static int usb_new_device(struct usb_device *dev)
{ {
int addr, err; int addr, err;
int tmp; int tmp;
...@@ -954,7 +955,7 @@ int usb_new_device(struct usb_device *dev) ...@@ -954,7 +955,7 @@ int usb_new_device(struct usb_device *dev)
} }
/* build device Tree */ /* build device Tree */
void usb_scan_devices(void) static void usb_scan_devices(void)
{ {
int i; int i;
struct usb_device *dev; struct usb_device *dev;
...@@ -988,42 +989,42 @@ static struct usb_hub_device hub_dev[USB_MAX_HUB]; ...@@ -988,42 +989,42 @@ static struct usb_hub_device hub_dev[USB_MAX_HUB];
static int usb_hub_index; static int usb_hub_index;
int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size) static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size)
{ {
return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB, USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB,
USB_DT_HUB << 8, 0, data, size, USB_CNTL_TIMEOUT); USB_DT_HUB << 8, 0, data, size, USB_CNTL_TIMEOUT);
} }
int usb_clear_hub_feature(struct usb_device *dev, int feature) static int usb_clear_hub_feature(struct usb_device *dev, int feature)
{ {
return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_CLEAR_FEATURE, USB_RT_HUB, feature, USB_REQ_CLEAR_FEATURE, USB_RT_HUB, feature,
0, NULL, 0, USB_CNTL_TIMEOUT); 0, NULL, 0, USB_CNTL_TIMEOUT);
} }
int usb_clear_port_feature(struct usb_device *dev, int port, int feature) static int usb_clear_port_feature(struct usb_device *dev, int port, int feature)
{ {
return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_CLEAR_FEATURE, USB_RT_PORT, feature, USB_REQ_CLEAR_FEATURE, USB_RT_PORT, feature,
port, NULL, 0, USB_CNTL_TIMEOUT); port, NULL, 0, USB_CNTL_TIMEOUT);
} }
int usb_set_port_feature(struct usb_device *dev, int port, int feature) static int usb_set_port_feature(struct usb_device *dev, int port, int feature)
{ {
return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_SET_FEATURE, USB_RT_PORT, feature, USB_REQ_SET_FEATURE, USB_RT_PORT, feature,
port, NULL, 0, USB_CNTL_TIMEOUT); port, NULL, 0, USB_CNTL_TIMEOUT);
} }
int usb_get_hub_status(struct usb_device *dev, void *data) static int usb_get_hub_status(struct usb_device *dev, void *data)
{ {
return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_HUB, 0, 0, USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_HUB, 0, 0,
data, sizeof(struct usb_hub_status), USB_CNTL_TIMEOUT); data, sizeof(struct usb_hub_status), USB_CNTL_TIMEOUT);
} }
int usb_get_port_status(struct usb_device *dev, int port, void *data) static int usb_get_port_status(struct usb_device *dev, int port, void *data)
{ {
return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port, USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port,
...@@ -1046,12 +1047,12 @@ static void usb_hub_power_on(struct usb_hub_device *hub) ...@@ -1046,12 +1047,12 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
} }
} }
void usb_hub_reset(void) static void usb_hub_reset(void)
{ {
usb_hub_index = 0; usb_hub_index = 0;
} }
struct usb_hub_device *usb_hub_allocate(void) static struct usb_hub_device *usb_hub_allocate(void)
{ {
if (usb_hub_index < USB_MAX_HUB) if (usb_hub_index < USB_MAX_HUB)
return &hub_dev[usb_hub_index++]; return &hub_dev[usb_hub_index++];
...@@ -1187,7 +1188,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port) ...@@ -1187,7 +1188,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
} }
int usb_hub_configure(struct usb_device *dev) static int usb_hub_configure(struct usb_device *dev)
{ {
int i; int i;
unsigned char buffer[USB_BUFSIZ], *bitmap; unsigned char buffer[USB_BUFSIZ], *bitmap;
...@@ -1370,7 +1371,7 @@ int usb_hub_configure(struct usb_device *dev) ...@@ -1370,7 +1371,7 @@ int usb_hub_configure(struct usb_device *dev)
return 0; return 0;
} }
int usb_hub_probe(struct usb_device *dev, int ifnum) static int usb_hub_probe(struct usb_device *dev, int ifnum)
{ {
struct usb_interface *iface; struct usb_interface *iface;
struct usb_endpoint_descriptor *ep; struct usb_endpoint_descriptor *ep;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment