Merge branch 'master'
This commit is contained in:
@@ -104,6 +104,22 @@ static inline void random_ether_addr(u8 *addr)
|
||||
addr [0] &= 0xfe; /* clear multicast bit */
|
||||
addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
|
||||
}
|
||||
|
||||
/**
|
||||
* compare_ether_addr - Compare two Ethernet addresses
|
||||
* @addr1: Pointer to a six-byte array containing the Ethernet address
|
||||
* @addr2 Pointer other six-byte array containing the Ethernet address
|
||||
*
|
||||
* Compare two ethernet addresses, returns 0 if equal
|
||||
*/
|
||||
static inline unsigned compare_ether_addr(const u8 *_a, const u8 *_b)
|
||||
{
|
||||
const u16 *a = (const u16 *) _a;
|
||||
const u16 *b = (const u16 *) _b;
|
||||
|
||||
BUILD_BUG_ON(ETH_ALEN != 6);
|
||||
return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
|
||||
}
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_ETHERDEVICE_H */
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Platform information definitions for the
|
||||
* universal Freescale Ethernet driver.
|
||||
*
|
||||
* Copyright (c) 2003 Intracom S.A.
|
||||
* by Pantelis Antoniou <panto@intracom.gr>
|
||||
*
|
||||
* 2005 (c) MontaVista Software, Inc.
|
||||
* Vitaly Bordug <vbordug@ru.mvista.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public License
|
||||
* version 2. This program is licensed "as is" without any warranty of any
|
||||
* kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef FS_ENET_PD_H
|
||||
#define FS_ENET_PD_H
|
||||
|
||||
#include <linux/version.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
#define FS_ENET_NAME "fs_enet"
|
||||
|
||||
enum fs_id {
|
||||
fsid_fec1,
|
||||
fsid_fec2,
|
||||
fsid_fcc1,
|
||||
fsid_fcc2,
|
||||
fsid_fcc3,
|
||||
fsid_scc1,
|
||||
fsid_scc2,
|
||||
fsid_scc3,
|
||||
fsid_scc4,
|
||||
};
|
||||
|
||||
#define FS_MAX_INDEX 9
|
||||
|
||||
static inline int fs_get_fec_index(enum fs_id id)
|
||||
{
|
||||
if (id >= fsid_fec1 && id <= fsid_fec2)
|
||||
return id - fsid_fec1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int fs_get_fcc_index(enum fs_id id)
|
||||
{
|
||||
if (id >= fsid_fcc1 && id <= fsid_fcc3)
|
||||
return id - fsid_fcc1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int fs_get_scc_index(enum fs_id id)
|
||||
{
|
||||
if (id >= fsid_scc1 && id <= fsid_scc4)
|
||||
return id - fsid_scc1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
enum fs_mii_method {
|
||||
fsmii_fixed,
|
||||
fsmii_fec,
|
||||
fsmii_bitbang,
|
||||
};
|
||||
|
||||
enum fs_ioport {
|
||||
fsiop_porta,
|
||||
fsiop_portb,
|
||||
fsiop_portc,
|
||||
fsiop_portd,
|
||||
fsiop_porte,
|
||||
};
|
||||
|
||||
struct fs_mii_bus_info {
|
||||
int method; /* mii method */
|
||||
int id; /* the id of the mii_bus */
|
||||
int disable_aneg; /* if the controller needs to negothiate speed & duplex */
|
||||
int lpa; /* the default board-specific vallues will be applied otherwise */
|
||||
|
||||
union {
|
||||
struct {
|
||||
int duplex;
|
||||
int speed;
|
||||
} fixed;
|
||||
|
||||
struct {
|
||||
/* nothing */
|
||||
} fec;
|
||||
|
||||
struct {
|
||||
/* nothing */
|
||||
} scc;
|
||||
|
||||
struct {
|
||||
int mdio_port; /* port & bit for MDIO */
|
||||
int mdio_bit;
|
||||
int mdc_port; /* port & bit for MDC */
|
||||
int mdc_bit;
|
||||
int delay; /* delay in us */
|
||||
} bitbang;
|
||||
} i;
|
||||
};
|
||||
|
||||
struct fs_platform_info {
|
||||
|
||||
void(*init_ioports)(void);
|
||||
/* device specific information */
|
||||
int fs_no; /* controller index */
|
||||
|
||||
u32 cp_page; /* CPM page */
|
||||
u32 cp_block; /* CPM sblock */
|
||||
|
||||
u32 clk_trx; /* some stuff for pins & mux configuration*/
|
||||
u32 clk_route;
|
||||
u32 clk_mask;
|
||||
|
||||
u32 mem_offset;
|
||||
u32 dpram_offset;
|
||||
u32 fcc_regs_c;
|
||||
|
||||
u32 device_flags;
|
||||
|
||||
int phy_addr; /* the phy address (-1 no phy) */
|
||||
int phy_irq; /* the phy irq (if it exists) */
|
||||
|
||||
const struct fs_mii_bus_info *bus_info;
|
||||
|
||||
int rx_ring, tx_ring; /* number of buffers on rx */
|
||||
__u8 macaddr[6]; /* mac address */
|
||||
int rx_copybreak; /* limit we copy small frames */
|
||||
int use_napi; /* use NAPI */
|
||||
int napi_weight; /* NAPI weight */
|
||||
|
||||
int use_rmii; /* use RMII mode */
|
||||
};
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -218,7 +218,7 @@ typedef enum { ide_unknown, ide_generic, ide_pci,
|
||||
ide_rz1000, ide_trm290,
|
||||
ide_cmd646, ide_cy82c693, ide_4drives,
|
||||
ide_pmac, ide_etrax100, ide_acorn,
|
||||
ide_forced
|
||||
ide_au1xxx, ide_forced
|
||||
} hwif_chipset_t;
|
||||
|
||||
/*
|
||||
|
||||
@@ -132,6 +132,7 @@ struct pci_dev {
|
||||
unsigned int is_enabled:1; /* pci_enable_device has been called */
|
||||
unsigned int is_busmaster:1; /* device is busmaster */
|
||||
unsigned int no_msi:1; /* device may not use msi */
|
||||
unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
|
||||
|
||||
u32 saved_config_space[16]; /* config space saved at suspend time */
|
||||
struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
|
||||
@@ -490,6 +491,9 @@ extern void pci_disable_msix(struct pci_dev *dev);
|
||||
extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
|
||||
#endif
|
||||
|
||||
extern void pci_block_user_cfg_access(struct pci_dev *dev);
|
||||
extern void pci_unblock_user_cfg_access(struct pci_dev *dev);
|
||||
|
||||
/*
|
||||
* PCI domain support. Sometimes called PCI segment (eg by ACPI),
|
||||
* a PCI domain is defined to be a set of PCI busses which share
|
||||
@@ -560,6 +564,9 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en
|
||||
|
||||
#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
|
||||
|
||||
static inline void pci_block_user_cfg_access(struct pci_dev *dev) { }
|
||||
static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { }
|
||||
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
/* Include architecture-dependent settings and functions */
|
||||
|
||||
+12
-556
File diff suppressed because it is too large
Load Diff
+13
-1
@@ -224,7 +224,6 @@ struct dev_pm_info {
|
||||
unsigned should_wakeup:1;
|
||||
pm_message_t prev_state;
|
||||
void * saved_state;
|
||||
atomic_t pm_users;
|
||||
struct device * pm_parent;
|
||||
struct list_head entry;
|
||||
#endif
|
||||
@@ -244,6 +243,9 @@ extern int device_suspend(pm_message_t state);
|
||||
#define device_may_wakeup(dev) \
|
||||
(device_can_wakeup(dev) && (dev)->power.should_wakeup)
|
||||
|
||||
extern int dpm_runtime_suspend(struct device *, pm_message_t);
|
||||
extern void dpm_runtime_resume(struct device *);
|
||||
|
||||
#else /* !CONFIG_PM */
|
||||
|
||||
static inline int device_suspend(pm_message_t state)
|
||||
@@ -254,6 +256,16 @@ static inline int device_suspend(pm_message_t state)
|
||||
#define device_set_wakeup_enable(dev,val) do{}while(0)
|
||||
#define device_may_wakeup(dev) (0)
|
||||
|
||||
static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void dpm_runtime_resume(struct device * dev)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* changes to device_may_wakeup take effect on the next pm state change.
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
#define PORT_RSA 13
|
||||
#define PORT_NS16550A 14
|
||||
#define PORT_XSCALE 15
|
||||
#define PORT_MAX_8250 15 /* max port ID */
|
||||
#define PORT_IP3106 16
|
||||
#define PORT_MAX_8250 16 /* max port ID */
|
||||
|
||||
/*
|
||||
* ARM specific type numbers. These are not currently guaranteed
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Embedded Alley Solutions, source@embeddedalley.com.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_SERIAL_IP3106_H
|
||||
#define _LINUX_SERIAL_IP3106_H
|
||||
|
||||
#include <linux/serial_core.h>
|
||||
#include <linux/device.h>
|
||||
|
||||
#define IP3106_NR_PORTS 2
|
||||
|
||||
struct ip3106_port {
|
||||
struct uart_port port;
|
||||
struct timer_list timer;
|
||||
unsigned int old_status;
|
||||
};
|
||||
|
||||
/* register offsets */
|
||||
#define IP3106_LCR 0
|
||||
#define IP3106_MCR 0x004
|
||||
#define IP3106_BAUD 0x008
|
||||
#define IP3106_CFG 0x00c
|
||||
#define IP3106_FIFO 0x028
|
||||
#define IP3106_ISTAT 0xfe0
|
||||
#define IP3106_IEN 0xfe4
|
||||
#define IP3106_ICLR 0xfe8
|
||||
#define IP3106_ISET 0xfec
|
||||
#define IP3106_PD 0xff4
|
||||
#define IP3106_MID 0xffc
|
||||
|
||||
#define IP3106_UART_LCR_TXBREAK (1<<30)
|
||||
#define IP3106_UART_LCR_PAREVN 0x10000000
|
||||
#define IP3106_UART_LCR_PAREN 0x08000000
|
||||
#define IP3106_UART_LCR_2STOPB 0x04000000
|
||||
#define IP3106_UART_LCR_8BIT 0x01000000
|
||||
#define IP3106_UART_LCR_TX_RST 0x00040000
|
||||
#define IP3106_UART_LCR_RX_RST 0x00020000
|
||||
#define IP3106_UART_LCR_RX_NEXT 0x00010000
|
||||
|
||||
#define IP3106_UART_MCR_SCR 0xFF000000
|
||||
#define IP3106_UART_MCR_DCD 0x00800000
|
||||
#define IP3106_UART_MCR_CTS 0x00100000
|
||||
#define IP3106_UART_MCR_LOOP 0x00000010
|
||||
#define IP3106_UART_MCR_RTS 0x00000002
|
||||
#define IP3106_UART_MCR_DTR 0x00000001
|
||||
|
||||
#define IP3106_UART_INT_TX 0x00000080
|
||||
#define IP3106_UART_INT_EMPTY 0x00000040
|
||||
#define IP3106_UART_INT_RCVTO 0x00000020
|
||||
#define IP3106_UART_INT_RX 0x00000010
|
||||
#define IP3106_UART_INT_RXOVRN 0x00000008
|
||||
#define IP3106_UART_INT_FRERR 0x00000004
|
||||
#define IP3106_UART_INT_BREAK 0x00000002
|
||||
#define IP3106_UART_INT_PARITY 0x00000001
|
||||
#define IP3106_UART_INT_ALLRX 0x0000003F
|
||||
#define IP3106_UART_INT_ALLTX 0x000000C0
|
||||
|
||||
#define IP3106_UART_FIFO_TXFIFO 0x001F0000
|
||||
#define IP3106_UART_FIFO_TXFIFO_STA (0x1f<<16)
|
||||
#define IP3106_UART_FIFO_RXBRK 0x00008000
|
||||
#define IP3106_UART_FIFO_RXFE 0x00004000
|
||||
#define IP3106_UART_FIFO_RXPAR 0x00002000
|
||||
#define IP3106_UART_FIFO_RXFIFO 0x00001F00
|
||||
#define IP3106_UART_FIFO_RBRTHR 0x000000FF
|
||||
|
||||
#endif
|
||||
+103
-60
@@ -57,6 +57,7 @@ struct usb_host_endpoint {
|
||||
struct usb_endpoint_descriptor desc;
|
||||
struct list_head urb_list;
|
||||
void *hcpriv;
|
||||
struct kobject *kobj; /* For sysfs info */
|
||||
|
||||
unsigned char *extra; /* Extra descriptors */
|
||||
int extralen;
|
||||
@@ -136,7 +137,8 @@ struct usb_interface {
|
||||
* active alternate setting */
|
||||
unsigned num_altsetting; /* number of alternate settings */
|
||||
|
||||
int minor; /* minor number this interface is bound to */
|
||||
int minor; /* minor number this interface is
|
||||
* bound to */
|
||||
enum usb_interface_condition condition; /* state of binding */
|
||||
struct device dev; /* interface specific device info */
|
||||
struct class_device *class_dev;
|
||||
@@ -229,7 +231,7 @@ struct usb_interface_cache {
|
||||
struct usb_host_config {
|
||||
struct usb_config_descriptor desc;
|
||||
|
||||
char *string;
|
||||
char *string; /* iConfiguration string, if present */
|
||||
/* the interfaces associated with this configuration,
|
||||
* stored in no particular order */
|
||||
struct usb_interface *interface[USB_MAXINTERFACES];
|
||||
@@ -248,7 +250,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
|
||||
__usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\
|
||||
type,(void**)ptr)
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
struct usb_operations;
|
||||
|
||||
@@ -268,7 +270,8 @@ struct usb_bus {
|
||||
unsigned is_b_host:1; /* true during some HNP roleswitches */
|
||||
unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
|
||||
|
||||
int devnum_next; /* Next open device number in round-robin allocation */
|
||||
int devnum_next; /* Next open device number in
|
||||
* round-robin allocation */
|
||||
|
||||
struct usb_devmap devmap; /* device address allocation map */
|
||||
struct usb_operations *op; /* Operations (specific to the HC) */
|
||||
@@ -289,15 +292,16 @@ struct usb_bus {
|
||||
struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
|
||||
|
||||
struct class_device *class_dev; /* class device for this bus */
|
||||
struct kref kref; /* handles reference counting this bus */
|
||||
void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */
|
||||
struct kref kref; /* reference counting for this bus */
|
||||
void (*release)(struct usb_bus *bus);
|
||||
|
||||
#if defined(CONFIG_USB_MON)
|
||||
struct mon_bus *mon_bus; /* non-null when associated */
|
||||
int monitored; /* non-zero when monitored */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/* This is arbitrary.
|
||||
* From USB 2.0 spec Table 11-13, offset 7, a hub can
|
||||
@@ -326,7 +330,8 @@ struct usb_device {
|
||||
|
||||
struct semaphore serialize;
|
||||
|
||||
unsigned int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT) */
|
||||
unsigned int toggle[2]; /* one bit for each endpoint
|
||||
* ([0] = IN, [1] = OUT) */
|
||||
|
||||
struct usb_device *parent; /* our hub, unless we're the root */
|
||||
struct usb_bus *bus; /* Bus we're part of */
|
||||
@@ -343,12 +348,14 @@ struct usb_device {
|
||||
|
||||
char **rawdescriptors; /* Raw descriptors for each config */
|
||||
|
||||
int have_langid; /* whether string_langid is valid yet */
|
||||
int have_langid; /* whether string_langid is valid */
|
||||
int string_langid; /* language ID for strings */
|
||||
|
||||
char *product;
|
||||
char *manufacturer;
|
||||
char *serial; /* static strings from the device */
|
||||
/* static strings from the device */
|
||||
char *product; /* iProduct string, if present */
|
||||
char *manufacturer; /* iManufacturer string, if present */
|
||||
char *serial; /* iSerialNumber string, if present */
|
||||
|
||||
struct list_head filelist;
|
||||
struct class_device *class_dev;
|
||||
struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
|
||||
@@ -440,22 +447,31 @@ extern struct usb_host_interface *usb_altnum_to_altsetting(
|
||||
* USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are
|
||||
* high speed, and a different one if they are full or low speed.
|
||||
*/
|
||||
static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
|
||||
static inline int usb_make_path (struct usb_device *dev, char *buf,
|
||||
size_t size)
|
||||
{
|
||||
int actual;
|
||||
actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name, dev->devpath);
|
||||
actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name,
|
||||
dev->devpath);
|
||||
return (actual >= (int)size) ? -1 : actual;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
#define USB_DEVICE_ID_MATCH_DEVICE (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT)
|
||||
#define USB_DEVICE_ID_MATCH_DEV_RANGE (USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI)
|
||||
#define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION (USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE)
|
||||
#define USB_DEVICE_ID_MATCH_DEVICE \
|
||||
(USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT)
|
||||
#define USB_DEVICE_ID_MATCH_DEV_RANGE \
|
||||
(USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI)
|
||||
#define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
|
||||
(USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE)
|
||||
#define USB_DEVICE_ID_MATCH_DEV_INFO \
|
||||
(USB_DEVICE_ID_MATCH_DEV_CLASS | USB_DEVICE_ID_MATCH_DEV_SUBCLASS | USB_DEVICE_ID_MATCH_DEV_PROTOCOL)
|
||||
(USB_DEVICE_ID_MATCH_DEV_CLASS | \
|
||||
USB_DEVICE_ID_MATCH_DEV_SUBCLASS | \
|
||||
USB_DEVICE_ID_MATCH_DEV_PROTOCOL)
|
||||
#define USB_DEVICE_ID_MATCH_INT_INFO \
|
||||
(USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS | USB_DEVICE_ID_MATCH_INT_PROTOCOL)
|
||||
(USB_DEVICE_ID_MATCH_INT_CLASS | \
|
||||
USB_DEVICE_ID_MATCH_INT_SUBCLASS | \
|
||||
USB_DEVICE_ID_MATCH_INT_PROTOCOL)
|
||||
|
||||
/**
|
||||
* USB_DEVICE - macro used to describe a specific usb device
|
||||
@@ -466,9 +482,11 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
|
||||
* specific device.
|
||||
*/
|
||||
#define USB_DEVICE(vend,prod) \
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), .idProduct = (prod)
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), \
|
||||
.idProduct = (prod)
|
||||
/**
|
||||
* USB_DEVICE_VER - macro used to describe a specific usb device with a version range
|
||||
* USB_DEVICE_VER - macro used to describe a specific usb device with a
|
||||
* version range
|
||||
* @vend: the 16 bit USB Vendor ID
|
||||
* @prod: the 16 bit USB Product ID
|
||||
* @lo: the bcdDevice_lo value
|
||||
@@ -478,7 +496,9 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
|
||||
* specific device, with a version range.
|
||||
*/
|
||||
#define USB_DEVICE_VER(vend,prod,lo,hi) \
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, .idVendor = (vend), .idProduct = (prod), .bcdDevice_lo = (lo), .bcdDevice_hi = (hi)
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, \
|
||||
.idVendor = (vend), .idProduct = (prod), \
|
||||
.bcdDevice_lo = (lo), .bcdDevice_hi = (hi)
|
||||
|
||||
/**
|
||||
* USB_DEVICE_INFO - macro used to describe a class of usb devices
|
||||
@@ -490,7 +510,8 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
|
||||
* specific class of devices.
|
||||
*/
|
||||
#define USB_DEVICE_INFO(cl,sc,pr) \
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), .bDeviceSubClass = (sc), .bDeviceProtocol = (pr)
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), \
|
||||
.bDeviceSubClass = (sc), .bDeviceProtocol = (pr)
|
||||
|
||||
/**
|
||||
* USB_INTERFACE_INFO - macro used to describe a class of usb interfaces
|
||||
@@ -502,9 +523,10 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
|
||||
* specific class of interfaces.
|
||||
*/
|
||||
#define USB_INTERFACE_INFO(cl,sc,pr) \
|
||||
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
|
||||
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \
|
||||
.bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* struct usb_driver - identifies USB driver to usbcore
|
||||
@@ -557,7 +579,8 @@ struct usb_driver {
|
||||
|
||||
void (*disconnect) (struct usb_interface *intf);
|
||||
|
||||
int (*ioctl) (struct usb_interface *intf, unsigned int code, void *buf);
|
||||
int (*ioctl) (struct usb_interface *intf, unsigned int code,
|
||||
void *buf);
|
||||
|
||||
int (*suspend) (struct usb_interface *intf, pm_message_t message);
|
||||
int (*resume) (struct usb_interface *intf);
|
||||
@@ -572,10 +595,8 @@ extern struct bus_type usb_bus_type;
|
||||
|
||||
/**
|
||||
* struct usb_class_driver - identifies a USB driver that wants to use the USB major number
|
||||
* @name: devfs name for this driver. Will also be used by the driver
|
||||
* class code to create a usb class device.
|
||||
* @name: the usb class device name for this driver. Will show up in sysfs.
|
||||
* @fops: pointer to the struct file_operations of this driver.
|
||||
* @mode: the mode for the devfs file to be created for this driver.
|
||||
* @minor_base: the start of the minor range for this driver.
|
||||
*
|
||||
* This structure is used for the usb_register_dev() and
|
||||
@@ -585,8 +606,7 @@ extern struct bus_type usb_bus_type;
|
||||
struct usb_class_driver {
|
||||
char *name;
|
||||
struct file_operations *fops;
|
||||
mode_t mode;
|
||||
int minor_base;
|
||||
int minor_base;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -603,7 +623,7 @@ extern void usb_deregister_dev(struct usb_interface *intf,
|
||||
|
||||
extern int usb_disabled(void);
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* URB support, for asynchronous request completions
|
||||
@@ -613,12 +633,14 @@ extern int usb_disabled(void);
|
||||
* urb->transfer_flags:
|
||||
*/
|
||||
#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */
|
||||
#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */
|
||||
#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame
|
||||
* ignored */
|
||||
#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
|
||||
#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */
|
||||
#define URB_NO_FSBR 0x0020 /* UHCI-specific */
|
||||
#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */
|
||||
#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */
|
||||
#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
|
||||
#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
|
||||
* needed */
|
||||
|
||||
struct usb_iso_packet_descriptor {
|
||||
unsigned int offset;
|
||||
@@ -806,7 +828,8 @@ struct urb
|
||||
u8 reject; /* submissions will fail */
|
||||
|
||||
/* public, documented fields in the urb that can be used by drivers */
|
||||
struct list_head urb_list; /* list head for use by the urb owner */
|
||||
struct list_head urb_list; /* list head for use by the urb's
|
||||
* current owner */
|
||||
struct usb_device *dev; /* (in) pointer to associated device */
|
||||
unsigned int pipe; /* (in) pipe information */
|
||||
int status; /* (return) non-ISO status */
|
||||
@@ -819,14 +842,16 @@ struct urb
|
||||
dma_addr_t setup_dma; /* (in) dma addr for setup_packet */
|
||||
int start_frame; /* (modify) start frame (ISO) */
|
||||
int number_of_packets; /* (in) number of ISO packets */
|
||||
int interval; /* (modify) transfer interval (INT/ISO) */
|
||||
int interval; /* (modify) transfer interval
|
||||
* (INT/ISO) */
|
||||
int error_count; /* (return) number of ISO errors */
|
||||
void *context; /* (in) context for completion */
|
||||
usb_complete_t complete; /* (in) completion routine */
|
||||
struct usb_iso_packet_descriptor iso_frame_desc[0]; /* (in) ISO ONLY */
|
||||
struct usb_iso_packet_descriptor iso_frame_desc[0];
|
||||
/* (in) ISO ONLY */
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* usb_fill_control_urb - initializes a control urb
|
||||
@@ -974,11 +999,6 @@ extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
|
||||
void *data, int len, int *actual_length,
|
||||
int timeout);
|
||||
|
||||
/* selective suspend/resume */
|
||||
extern int usb_suspend_device(struct usb_device *dev, pm_message_t message);
|
||||
extern int usb_resume_device(struct usb_device *dev);
|
||||
|
||||
|
||||
/* wrappers around usb_control_msg() for the most common standard requests */
|
||||
extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
|
||||
unsigned char descindex, void *buf, int size);
|
||||
@@ -1056,7 +1076,7 @@ void usb_sg_cancel (struct usb_sg_request *io);
|
||||
void usb_sg_wait (struct usb_sg_request *io);
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* For various legacy reasons, Linux has a small cookie that's paired with
|
||||
@@ -1097,23 +1117,34 @@ void usb_sg_wait (struct usb_sg_request *io);
|
||||
/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */
|
||||
#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
|
||||
#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
|
||||
#define usb_settoggle(dev, ep, out, bit) ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | ((bit) << (ep)))
|
||||
#define usb_settoggle(dev, ep, out, bit) \
|
||||
((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \
|
||||
((bit) << (ep)))
|
||||
|
||||
|
||||
static inline unsigned int __create_pipe(struct usb_device *dev, unsigned int endpoint)
|
||||
static inline unsigned int __create_pipe(struct usb_device *dev,
|
||||
unsigned int endpoint)
|
||||
{
|
||||
return (dev->devnum << 8) | (endpoint << 15);
|
||||
}
|
||||
|
||||
/* Create various pipes... */
|
||||
#define usb_sndctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint))
|
||||
#define usb_rcvctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
|
||||
#define usb_sndisocpipe(dev,endpoint) ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint))
|
||||
#define usb_rcvisocpipe(dev,endpoint) ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
|
||||
#define usb_sndbulkpipe(dev,endpoint) ((PIPE_BULK << 30) | __create_pipe(dev,endpoint))
|
||||
#define usb_rcvbulkpipe(dev,endpoint) ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
|
||||
#define usb_sndintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint))
|
||||
#define usb_rcvintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
|
||||
#define usb_sndctrlpipe(dev,endpoint) \
|
||||
((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint))
|
||||
#define usb_rcvctrlpipe(dev,endpoint) \
|
||||
((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
|
||||
#define usb_sndisocpipe(dev,endpoint) \
|
||||
((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint))
|
||||
#define usb_rcvisocpipe(dev,endpoint) \
|
||||
((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
|
||||
#define usb_sndbulkpipe(dev,endpoint) \
|
||||
((PIPE_BULK << 30) | __create_pipe(dev,endpoint))
|
||||
#define usb_rcvbulkpipe(dev,endpoint) \
|
||||
((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
|
||||
#define usb_sndintpipe(dev,endpoint) \
|
||||
((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint))
|
||||
#define usb_rcvintpipe(dev,endpoint) \
|
||||
((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
@@ -1137,17 +1168,29 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
|
||||
return le16_to_cpu(ep->desc.wMaxPacketSize);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/* Events from the usb core */
|
||||
#define USB_DEVICE_ADD 0x0001
|
||||
#define USB_DEVICE_REMOVE 0x0002
|
||||
#define USB_BUS_ADD 0x0003
|
||||
#define USB_BUS_REMOVE 0x0004
|
||||
extern void usb_register_notify(struct notifier_block *nb);
|
||||
extern void usb_unregister_notify(struct notifier_block *nb);
|
||||
|
||||
#ifdef DEBUG
|
||||
#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg)
|
||||
#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#else
|
||||
#define dbg(format, arg...) do {} while (0)
|
||||
#endif
|
||||
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
@@ -63,6 +63,10 @@ struct otg_transceiver {
|
||||
int (*set_power)(struct otg_transceiver *otg,
|
||||
unsigned mA);
|
||||
|
||||
/* for non-OTG B devices: set transceiver into suspend mode */
|
||||
int (*set_suspend)(struct otg_transceiver *otg,
|
||||
int suspend);
|
||||
|
||||
/* for B devices only: start session with A-Host */
|
||||
int (*start_srp)(struct otg_transceiver *otg);
|
||||
|
||||
@@ -107,6 +111,15 @@ otg_set_power(struct otg_transceiver *otg, unsigned mA)
|
||||
return otg->set_power(otg, mA);
|
||||
}
|
||||
|
||||
static inline int
|
||||
otg_set_suspend(struct otg_transceiver *otg, int suspend)
|
||||
{
|
||||
if (otg->set_suspend != NULL)
|
||||
return otg->set_suspend(otg, suspend);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
otg_start_srp(struct otg_transceiver *otg)
|
||||
{
|
||||
|
||||
@@ -140,6 +140,12 @@ struct usbdevfs_urb32 {
|
||||
compat_caddr_t usercontext; /* unused */
|
||||
struct usbdevfs_iso_packet_desc iso_frame_desc[0];
|
||||
};
|
||||
|
||||
struct usbdevfs_ioctl32 {
|
||||
s32 ifno;
|
||||
s32 ioctl_code;
|
||||
compat_caddr_t data;
|
||||
};
|
||||
#endif
|
||||
|
||||
#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
|
||||
@@ -160,6 +166,7 @@ struct usbdevfs_urb32 {
|
||||
#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
|
||||
#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
|
||||
#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
|
||||
#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
|
||||
#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
|
||||
#define USBDEVFS_RESET _IO('U', 20)
|
||||
#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
|
||||
|
||||
Reference in New Issue
Block a user