Commit 4d27e1fb authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.18

parent 09a304b6
......@@ -13,9 +13,10 @@ Chip families supported:
Piccolo
Picasso
Spectrum
Picasso4 (GD-5446)
Alpine (GD-543x/4x)
Picasso4 (GD-5446)
GD-5480
Laguna (GD-546x)
Bus's supported:
PCI
......@@ -41,19 +42,51 @@ Full support for startup video modes (modedb) will be integrated soon.
Version 1.9.4.4
---------------
* Preliminary Laguna support
* Overhaul color register routines. Shifts are now based on offset
values in var.cmap, so as long as those are correctly set for PReP
things should work (knock on wood).
* Associated with the above, console colors are now obtained from a LUT
called 'palette' instead of from the VGA registers. This code was
modeled after that in atyfb and matroxfb.
* Code cleanup, add comments.
* Overhaul SR07 handling.
* Bug fixes.
Version 1.9.4.3
---------------
* Correctly set default startup video mode.
* Do not override ram size setting. Define
CLGEN_USE_HARDCODED_RAM_SETTINGS if you _do_ want to override the RAM
setting.
* Compile fixes related to new 2.3.x IORESOURCE_IO[PORT] symbol changes.
* Use new 2.3.x resource allocation.
* Some code cleanup.
Version 1.9.4.2
---------------
* Casting fixes.
* Assertions no longer cause an oops on purpose.
* Bug fixes.
Version 1.9.4.1
---------------
Add compatibility support. Now requires a 2.1.x, 2.2.x or 2.3.x kernel.
* Add compatibility support. Now requires a 2.1.x, 2.2.x or 2.3.x kernel.
Version 1.9.4
-------------
Several enhancements, smaller memory footprint, a few bugfixes.
Requires kernel 2.3.14-pre1 or later.
* Several enhancements, smaller memory footprint, a few bugfixes.
* Requires kernel 2.3.14-pre1 or later.
Version 1.9.3
-------------
Bundled with kernel 2.3.14-pre1 or later.
* Bundled with kernel 2.3.14-pre1 or later.
/* $Id: irq.c,v 1.96 1999/08/31 06:54:21 davem Exp $
/* $Id: irq.c,v 1.97 1999/09/10 10:40:21 davem Exp $
* arch/sparc/kernel/irq.c: Interrupt request handling routines. On the
* Sparc the IRQ's are basically 'cast in stone'
* and you are supposed to probe the prom's device
......
/* $Id: setup.c,v 1.110 1999/08/31 06:54:23 davem Exp $
/* $Id: setup.c,v 1.111 1999/09/10 10:40:24 davem Exp $
* linux/arch/sparc/kernel/setup.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......
/* $Id: sparc_ksyms.c,v 1.78 1999/07/23 01:56:15 davem Exp $
/* $Id: sparc_ksyms.c,v 1.79 1999/09/10 10:40:28 davem Exp $
* arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
......
/* $Id: sun4d_irq.c,v 1.19 1999/08/31 06:54:25 davem Exp $
/* $Id: sun4d_irq.c,v 1.20 1999/09/10 10:40:30 davem Exp $
* arch/sparc/kernel/sun4d_irq.c:
* SS1000/SC2000 interrupt handling.
*
......
/* $Id: debuglocks.c,v 1.9 1999/08/14 03:51:39 anton Exp $
/* $Id: debuglocks.c,v 1.10 1999/09/10 10:40:36 davem Exp $
* debuglocks.c: Debugging versions of SMP locking primitives.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
......
/* $Id: io-unit.c,v 1.14 1999/08/31 06:54:33 davem Exp $
/* $Id: io-unit.c,v 1.15 1999/09/10 10:40:38 davem Exp $
* io-unit.c: IO-UNIT specific routines for memory management.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
......
/* $Id: srmmu.c,v 1.191 1999/08/31 06:54:38 davem Exp $
/* $Id: srmmu.c,v 1.192 1999/09/10 10:40:40 davem Exp $
* srmmu.c: SRMMU specific routines for memory management.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......
/* $Id: ioctl32.c,v 1.67 1999/08/20 00:27:08 davem Exp $
/* $Id: ioctl32.c,v 1.68 1999/09/10 05:59:25 davem Exp $
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
*
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
......@@ -410,6 +410,7 @@ struct ifreq32 {
int ifru_mtu;
struct ifmap32 ifru_map;
char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ];
__kernel_caddr_t32 ifru_data;
} ifr_ifru;
};
......@@ -432,6 +433,8 @@ static int dev_ifname32(unsigned int fd, unsigned long arg)
if (!dev)
return -ENODEV;
strcpy(ifr32.ifr_name, dev->name);
err = copy_to_user((struct ifreq32 *)arg, &ifr32, sizeof(struct ifreq32));
return (err ? -EFAULT : 0);
}
......
/* $Id: pci_impl.h,v 1.2 1999/09/05 04:58:05 davem Exp $
/* $Id: pci_impl.h,v 1.3 1999/09/10 10:40:44 davem Exp $
* pci_impl.h: Helper definitions for PCI controller support.
*
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
......
/* $Id: trampoline.S,v 1.9 1999/05/25 16:53:12 jj Exp $
/* $Id: trampoline.S,v 1.10 1999/09/10 10:40:48 davem Exp $
* trampoline.S: Jump start slave processors on sparc64.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
*/
#include <linux/config.h>
#include <asm/head.h>
#include <asm/asi.h>
#include <asm/lsu.h>
......
/* $Id: debuglocks.c,v 1.2 1998/10/13 09:07:27 davem Exp $
/* $Id: debuglocks.c,v 1.3 1999/09/10 10:40:50 davem Exp $
* debuglocks.c: Debugging versions of SMP locking primitives.
*
* Copyright (C) 1998 David S. Miller (davem@dm.cobaltmicro.com)
......
/* $Id: ultra.S,v 1.33 1999/08/02 08:39:49 davem Exp $
/* $Id: ultra.S,v 1.34 1999/09/10 10:40:51 davem Exp $
* ultra.S: Don't expand these all over the place...
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
*/
#include <linux/config.h>
#include <asm/asi.h>
#include <asm/pgtable.h>
#include <asm/spitfire.h>
......
/* $Id: p1275.c,v 1.17 1999/08/31 19:25:43 davem Exp $
/* $Id: p1275.c,v 1.18 1999/09/10 10:40:53 davem Exp $
* p1275.c: Sun IEEE 1275 PROM low level interface routines
*
* Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
......
......@@ -29,9 +29,13 @@ CONFIG_85230_MODULE :=
CONFIG_SYNCPPP_BUILTIN :=
CONFIG_SYNCPPP_MODULE :=
ifneq ($(CONFIG_PCMCIA),n)
ifeq ($(CONFIG_PCMCIA),y)
SUB_DIRS += pcmcia
MOD_SUB_DIRS += pcmcia
else
ifeq ($(CONFIG_PCMCIA),m)
MOD_SUB_DIRS += pcmcia
endif
endif
ifeq ($(CONFIG_ISDN),y)
......
This diff is collapsed.
......@@ -6,6 +6,7 @@ mainmenu_option next_comment
comment 'PCMCIA network devices'
tristate 'PCMCIA ethernet cards (NE2000 compatibles: DE-650, ...)' CONFIG_PCMCIA_PCNET
tristate '3Com 3c589 PCMCIA card' CONFIG_PCMCIA_3C589
tristate 'Aviator/Raytheon 2.4MHz wireless' CONFIG_PCMCIA_RAYCS
endmenu
......@@ -21,6 +21,14 @@ else
endif
endif
ifeq ($(CONFIG_PCMCIA_3C589),y)
O_OBJS += 3c589_cs.o
else
ifeq ($(CONFIG_PCMCIA_3C589),m)
MX_OBJS += 3c589_cs.o
endif
endif
ifeq ($(CONFIG_PCMCIA_RAYCS),y)
OX_OBJS += ray_cs.o
else
......
This diff is collapsed.
......@@ -289,29 +289,19 @@ struct qe_txd {
#define TX_RING_MAXSIZE 256
#define RX_RING_MAXSIZE 256
#define TX_RING_SIZE 256
#define RX_RING_SIZE 256
#define TX_RING_SIZE 16
#define RX_RING_SIZE 16
#define NEXT_RX(num) (((num) + 1) & (RX_RING_SIZE - 1))
#define NEXT_TX(num) (((num) + 1) & (TX_RING_SIZE - 1))
#define PREV_RX(num) (((num) - 1) & (RX_RING_SIZE - 1))
#define PREV_TX(num) (((num) - 1) & (TX_RING_SIZE - 1))
#define NEXT_RX(num) (((num) + 1) & (RX_RING_MAXSIZE - 1))
#define NEXT_TX(num) (((num) + 1) & (TX_RING_MAXSIZE - 1))
#define PREV_RX(num) (((num) - 1) & (RX_RING_MAXSIZE - 1))
#define PREV_TX(num) (((num) - 1) & (TX_RING_MAXSIZE - 1))
#define TX_BUFFS_AVAIL(qp) \
(((qp)->tx_old <= (qp)->tx_new) ? \
(qp)->tx_old + (TX_RING_SIZE - 1) - (qp)->tx_new : \
(qp)->tx_old - (qp)->tx_new - 1)
#define SUN4C_TX_BUFFS_AVAIL(qp) \
(((qp)->tx_old <= (qp)->tx_new) ? \
(qp)->tx_old + (SUN4C_TX_RING_SIZE - 1) - (qp)->tx_new : \
(qp)->tx_old - (qp)->tx_new - (TX_RING_SIZE - SUN4C_TX_RING_SIZE))
#define RX_COPY_THRESHOLD 256
#define RX_BUF_ALLOC_SIZE (1546 + 64)
struct qe_init_block {
struct qe_rxd qe_rxd[RX_RING_MAXSIZE];
struct qe_txd qe_txd[TX_RING_MAXSIZE];
......@@ -324,72 +314,39 @@ struct sunqe;
struct sunqec {
struct qe_globreg *gregs; /* QEC Global Registers */
struct sunqe *qes[4];
unsigned int qec_bursts;
struct linux_sbus_device *qec_sbus_dev;
struct sunqec *next_module;
struct sunqe *qes[4]; /* Each child MACE */
unsigned int qec_bursts; /* Support burst sizes */
struct linux_sbus_device *qec_sbus_dev; /* QEC's SBUS device */
struct sunqec *next_module; /* List of all QECs in system */
};
#define SUN4C_PKT_BUF_SZ 1544
#define SUN4C_RX_BUFF_SIZE SUN4C_PKT_BUF_SZ
#define SUN4C_TX_BUFF_SIZE SUN4C_PKT_BUF_SZ
#define SUN4C_RX_RING_SIZE 16
#define SUN4C_TX_RING_SIZE 16
#define PKT_BUF_SZ 1664
#define RXD_PKT_SZ 1664
struct sunqe_buffers {
char tx_buf[SUN4C_TX_RING_SIZE][SUN4C_TX_BUFF_SIZE];
char pad[2]; /* Align rx_buf for copy_and_sum(). */
char rx_buf[SUN4C_RX_RING_SIZE][SUN4C_RX_BUFF_SIZE];
char tx_buf[TX_RING_SIZE][PKT_BUF_SZ];
char __pad[2];
char rx_buf[RX_RING_SIZE][PKT_BUF_SZ];
};
#define qebuf_offset(mem, elem) \
((__u32)((unsigned long)(&(((struct sunqe_buffers *)0)->mem[elem][0]))))
#define SUN4C_NEXT_RX(num) (((num) + 1) & (SUN4C_RX_RING_SIZE - 1))
#define SUN4C_NEXT_TX(num) (((num) + 1) & (SUN4C_TX_RING_SIZE - 1))
#define SUN4C_PREV_RX(num) (((num) - 1) & (SUN4C_RX_RING_SIZE - 1))
#define SUN4C_PREV_TX(num) (((num) - 1) & (SUN4C_TX_RING_SIZE - 1))
struct sunqe {
struct qe_creg *qcregs; /* QEC per-channel Registers */
struct qe_mregs *mregs; /* Per-channel MACE Registers */
struct qe_init_block *qe_block; /* RX and TX descriptors */
__u32 qblock_dvma; /* RX and TX descriptors */
struct sk_buff *rx_skbs[RX_RING_SIZE];
struct sk_buff *tx_skbs[TX_RING_SIZE];
int rx_new, tx_new, rx_old, tx_old;
struct sunqe_buffers *sun4c_buffers; /* CPU visible address. */
__u32 s4c_buf_dvma; /* DVMA visible address. */
int rx_new, rx_old; /* RX ring extents */
int tx_new, tx_old; /* TX ring extents */
struct sunqe_buffers *buffers; /* CPU visible address. */
__u32 buffers_dvma; /* DVMA visible address. */
struct sunqec *parent;
struct net_device_stats net_stats; /* Statistical counters */
struct linux_sbus_device *qe_sbusdev; /* QE's SBUS device struct */
struct net_device *dev; /* QE's netdevice struct */
int channel; /* Who am I? */
unsigned char mconfig; /* Base MACE mconfig value */
struct net_device_stats net_stats; /* Statistical counters */
struct linux_sbus_device *qe_sbusdev; /* QE's SBUS device struct */
struct net_device *dev; /* QE's netdevice struct */
int channel; /* Who am I? */
};
/* We use this to acquire receive skb's that we can DMA directly into. */
#define ALIGNED_RX_SKB_ADDR(addr) \
((((unsigned long)(addr) + (64 - 1)) & ~(64 - 1)) - (unsigned long)(addr))
static inline struct sk_buff *qe_alloc_skb(unsigned int length, int gfp_flags)
{
struct sk_buff *skb;
skb = alloc_skb(length + 64, gfp_flags);
if(skb) {
int offset = ALIGNED_RX_SKB_ADDR(skb->data);
if(offset)
skb_reserve(skb, offset);
}
return skb;
}
#endif /* !(_SUNQE_H) */
......@@ -548,6 +548,7 @@ VENDOR( TTI, "Triones Technologies, Inc." )
ENDVENDOR()
VENDOR( VIA, "VIA Technologies" )
DEVICE( VIA, VIA_8501_0, "VT 8501")
DEVICE( VIA, VIA_82C505, "VT 82C505")
DEVICE( VIA, VIA_82C561, "VT 82C561")
DEVICE( VIA, VIA_82C586_1, "VT 82C586 Apollo IDE")
......@@ -571,6 +572,7 @@ VENDOR( VIA, "VIA Technologies" )
DEVICE( VIA, VIA_82C686_5, "VT 82C686 Apollo Super AC97/Audio")
DEVICE( VIA, VIA_82C686_6, "VT 82C686 Apollo Super AC97/Modem")
DEVICE( VIA, VIA_86C100A, "VT 86C100A")
DEVICE( VIA, VIA_8501_1, "VT 8501 PCI Bridge")
DEVICE( VIA, VIA_82C597_1, "VT 82C597 Apollo VP3 AGP")
DEVICE( VIA, VIA_82C598_1, "VT 82C598 Apollo MVP3 AGP")
ENDVENDOR()
......
......@@ -2255,6 +2255,9 @@ int pcmcia_init(void)
#ifdef CONFIG_PCMCIA_PCNET
init_pcnet_cs();
#endif
#ifdef CONFIG_PCMCIA_3C589
init_3c589_cs();
#endif
#ifdef CONFIG_PCMCIA_RAYCS
init_ray_cs();
#endif
......
......@@ -253,7 +253,7 @@ static int acm_write_irq(int state, void *__buffer, int count, void *dev_id)
static int rs_open(struct tty_struct *tty, struct file * filp)
{
struct acm_state *acm;
int ret;
info("USB_FILE_OPEN\n");
......@@ -272,10 +272,12 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
acm->active=1;
/*Start reading from the device*/
acm->ctrltransfer=usb_request_irq(acm->dev,acm->ctrlpipe, acm_irq, acm->ctrlinterval, acm);
ret = usb_request_irq(acm->dev,acm->ctrlpipe, acm_irq, acm->ctrlinterval, acm, &acm->ctrltransfer);
if (ret) {
printk (KERN_WARNING "usb-acm: usb_request_irq failed (0x%x)\n", ret);
}
acm->reading=1;
acm->readtransfer=usb_request_bulk(acm->dev,acm->readpipe, acm_read_irq, acm->readbuffer, acm->readsize, acm );
acm->readtransfer=usb_request_bulk(acm->dev,acm->readpipe, acm_read_irq, acm->readbuffer, acm->readsize, acm);
Set_Control_Line_Status (CTRL_STAT_DTR | CTRL_STAT_RTS, acm);
......@@ -307,7 +309,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
usb_terminate_bulk(acm->dev, acm->readtransfer);
acm->reading=0;
}
// usb_release_irq(acm->dev,acm->ctrltransfer);
// usb_release_irq(acm->dev,acm->ctrltransfer, acm->ctrlpipe);
acm->active=0;
}
......@@ -591,7 +593,7 @@ static void acm_disconnect(struct usb_device *dev)
usb_terminate_bulk(acm->dev, acm->readtransfer);
acm->reading=0;
}
// usb_release_irq(acm->dev,acm->ctrltransfer);
// usb_release_irq(acm->dev,acm->ctrltransfer, acm->ctrlpipe);
//BUG: What to do if a device is open?? Notify process or not allow cleanup?
acm->active=0;
acm->present=0;
......
......@@ -17,6 +17,7 @@ struct usb_audio {
struct list_head list;
void *irq_handle;
unsigned int irqpipe;
};
static struct usb_driver usb_audio_driver = {
......@@ -90,11 +91,13 @@ static int usb_audio_probe(struct usb_device *dev)
*/
/*
aud->irq_handle = usb_request_irq(dev,
usb_rcvctrlpipe(dev, endpoint->bEndpointAddress),
usb_audio_irq,
endpoint->bInterval,
aud);
aud->irqpipe = usb_rcvctrlpipe(dev, endpoint->bEndpointAddress);
na = usb_request_irq(dev, aud->irqpipe,
usb_audio_irq, endpoint->bInterval,
aud, &aud->irq_handle);
if (na) {
printk (KERN_WARNING "usb-audio: usb_request_irq failed (0x%x)\n", na);
}
*/
list_add(&aud->list, &usb_audio_list);
......@@ -111,8 +114,7 @@ static void usb_audio_disconnect(struct usb_device *dev)
list_del(&aud->list);
usb_release_irq(aud->dev, aud->irq_handle);
aud->irq_handle = NULL;
usb_release_irq(aud->dev, aud->irq_handle, aud->irqpipe);
kfree(aud);
dev->private = NULL;
......
......@@ -191,6 +191,7 @@ static int hub_probe(struct usb_device *dev)
struct usb_endpoint_descriptor *endpoint;
struct usb_hub *hub;
unsigned long flags;
int ret;
/* We don't handle multi-config hubs */
if (dev->descriptor.bNumConfigurations != 1)
......@@ -248,8 +249,15 @@ static int hub_probe(struct usb_device *dev)
spin_unlock_irqrestore(&hub_list_lock, flags);
if (usb_hub_configure(hub) >= 0) {
hub->irq_handle = usb_request_irq(dev, usb_rcvctrlpipe(dev,
endpoint->bEndpointAddress), hub_irq, endpoint->bInterval, hub);
hub->irqpipe = usb_rcvctrlpipe(dev, endpoint->bEndpointAddress);
ret = usb_request_irq(dev, hub->irqpipe,
hub_irq, endpoint->bInterval,
hub, &hub->irq_handle);
if (ret) {
printk (KERN_WARNING "usb-hub: usb_request_irq failed (0x%x)\n", ret);
/* FIXME: need to free <hub> but first clean up its list. */
return -1;
}
/* Wake up khubd */
wake_up(&khubd_wait);
......@@ -274,8 +282,7 @@ static void hub_disconnect(struct usb_device *dev)
spin_unlock_irqrestore(&hub_event_lock, flags);
if (hub->irq_handle) {
usb_release_irq(hub->dev, hub->irq_handle);
hub->irq_handle = NULL;
usb_release_irq(hub->dev, hub->irq_handle, hub->irqpipe);
}
/* Free the memory */
......
......@@ -86,8 +86,9 @@ struct usb_hub {
/* Device structure */
struct usb_device *dev;
/* Reference to the hub's polling IRQ */
/* Reference to the hub's polling IRQ and its associated pipe */
void *irq_handle;
unsigned int irqpipe;
/* List of hubs */
struct list_head hub_list;
......
......@@ -39,6 +39,7 @@ struct usb_keyboard
unsigned char repeat_key;
struct timer_list repeat_timer;
struct list_head list;
unsigned int irqpipe;
void *irq_handler; /* host controller's IRQ transfer handle */
};
......@@ -195,7 +196,8 @@ usb_kbd_probe(struct usb_device *dev)
struct usb_interface_descriptor *interface;
struct usb_endpoint_descriptor *endpoint;
struct usb_keyboard *kbd;
int ret;
if (dev->descriptor.bNumConfigurations < 1)
return -1;
......@@ -225,9 +227,14 @@ usb_kbd_probe(struct usb_device *dev)
usb_set_protocol(dev, 0);
usb_set_idle(dev, 0, 0);
kbd->irq_handler = usb_request_irq(dev,
usb_rcvctrlpipe(dev, endpoint->bEndpointAddress),
usb_kbd_irq, endpoint->bInterval, kbd);
kbd->irqpipe = usb_rcvctrlpipe(dev, endpoint->bEndpointAddress);
ret = usb_request_irq(dev, kbd->irqpipe,
usb_kbd_irq, endpoint->bInterval,
kbd, &kbd->irq_handler);
if (ret) {
printk(KERN_INFO "usb-keyboard failed usb_request_irq (0x%x)\n", ret);
goto probe_err;
}
list_add(&kbd->list, &usb_kbd_list);
......@@ -244,12 +251,13 @@ static void
usb_kbd_disconnect(struct usb_device *dev)
{
struct usb_keyboard *kbd = (struct usb_keyboard*) dev->private;
if(kbd)
if (kbd)
{
dev->private = NULL;
list_del(&kbd->list);
del_timer(&kbd->repeat_timer);
kfree(kbd);
usb_release_irq(dev, kbd->irq_handler, kbd->irqpipe);
dev->private = NULL;
list_del(&kbd->list);
del_timer(&kbd->repeat_timer);
kfree(kbd);
}
printk(KERN_INFO "USB HID boot protocol keyboard removed.\n");
......@@ -276,7 +284,7 @@ void usb_kbd_cleanup(void)
INIT_LIST_HEAD(&kbd->list);
if (kbd->irq_handler) {
usb_release_irq(kbd->dev, kbd->irq_handler);
usb_release_irq(kbd->dev, kbd->irq_handler, kbd->irqpipe);
/* never keep a reference to a released IRQ! */
kbd->irq_handler = NULL;
}
......
......@@ -148,7 +148,8 @@ static int release_mouse(struct inode * inode, struct file * file)
if (--mouse->active == 0) {
mouse->suspended = 0;
/* stop polling the mouse while its not in use */
usb_release_irq(mouse->dev, mouse->irq_handle);
usb_release_irq(mouse->dev, mouse->irq_handle,
usb_rcvctrlpipe(mouse->dev, mouse->bEndpointAddress));
/* never keep a reference to a released IRQ! */
mouse->irq_handle = NULL;
}
......@@ -159,6 +160,7 @@ static int release_mouse(struct inode * inode, struct file * file)
static int open_mouse(struct inode * inode, struct file * file)
{
struct mouse_state *mouse = &static_mouse_state;
int ret;
printk(KERN_DEBUG "%s(%d): open_mouse\n", __FILE__, __LINE__);
/*
......@@ -194,7 +196,13 @@ static int open_mouse(struct inode * inode, struct file * file)
return 0;
/* start the usb controller's polling of the mouse */
mouse->irq_handle = usb_request_irq(mouse->dev, usb_rcvctrlpipe(mouse->dev, mouse->bEndpointAddress), mouse_irq, mouse->bInterval, NULL);
ret = usb_request_irq(mouse->dev, usb_rcvctrlpipe(mouse->dev, mouse->bEndpointAddress),
mouse_irq, mouse->bInterval,
NULL, &mouse->irq_handle);
if (ret) {
printk (KERN_WARNING "usb-mouse: usb_request_irq failed (0x%x)\n", ret);
return ret;
}
return 0;
}
......@@ -320,6 +328,7 @@ static int mouse_probe(struct usb_device *dev)
struct usb_interface_descriptor *interface;
struct usb_endpoint_descriptor *endpoint;
struct mouse_state *mouse = &static_mouse_state;
int ret;
/* We don't handle multi-config mice */
if (dev->descriptor.bNumConfigurations != 1)
......@@ -372,9 +381,13 @@ static int mouse_probe(struct usb_device *dev)
{
printk(KERN_DEBUG "%s(%d): mouse resume\n", __FILE__, __LINE__);
/* restart the usb controller's polling of the mouse */
mouse->irq_handle = usb_request_irq(mouse->dev,
usb_rcvctrlpipe(mouse->dev, mouse->bEndpointAddress),
mouse_irq, mouse->bInterval, NULL);
ret = usb_request_irq(mouse->dev, usb_rcvctrlpipe(mouse->dev, mouse->bEndpointAddress),
mouse_irq, mouse->bInterval,
NULL, &mouse->irq_handle);
if (ret) {
printk (KERN_WARNING "usb-mouse: usb_request_irq failed (0x%x)\n", ret);
return ret;
}
mouse->suspended = 0;
}
......@@ -387,7 +400,8 @@ static void mouse_disconnect(struct usb_device *dev)
/* stop the usb interrupt transfer */
if (mouse->present) {
usb_release_irq(mouse->dev, mouse->irq_handle);
usb_release_irq(mouse->dev, mouse->irq_handle,
usb_rcvctrlpipe(mouse->dev, mouse->bEndpointAddress));
/* never keep a reference to a released IRQ! */
}
......@@ -427,7 +441,8 @@ void usb_mouse_cleanup(void)
/* stop the usb interrupt transfer */
if (mouse->present) {
usb_release_irq(mouse->dev, mouse->irq_handle);
usb_release_irq(mouse->dev, mouse->irq_handle,
usb_rcvctrlpipe(mouse->dev, mouse->bEndpointAddress));
/* never keep a reference to a released IRQ! */
mouse->irq_handle = NULL;
}
......
......@@ -179,7 +179,7 @@ static int sohci_iso_handler(void * ohci_in, struct usb_ohci_ed *ed, void * data
return 0;
}
static void * sohci_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id)
static int sohci_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id, void **handle)
{
struct ohci * ohci = usb_dev->bus->hcpriv;
struct ohci_device * dev = usb_to_ohci(usb_dev);
......@@ -188,7 +188,7 @@ static void * sohci_request_irq(struct usb_device *usb_dev, unsigned int pipe, u
#ifdef VROOTHUB
if(usb_pipedevice(pipe) == ohci->rh.devnum)
return root_hub_request_irq(usb_dev, pipe, handler, period, dev_id);
return root_hub_request_irq(usb_dev, pipe, handler, period, dev_id, handle);
#endif
usb_pipe_to_hcd_ed(usb_dev, pipe, &hcd_ed);
......@@ -198,8 +198,9 @@ static void * sohci_request_irq(struct usb_device *usb_dev, unsigned int pipe, u
OHCI_DEBUG( printk("USB HC IRQ>>>: %x: every %d ms\n", ed->hwINFO, period);)
ohci_trans_req(ohci, ed, 0, NULL, dev->data, hcd_ed.maxpack, (__OHCI_BAG) handler, (__OHCI_BAG) dev_id, INT_IN, sohci_int_handler);
if (ED_STATE(ed) != ED_OPER) ohci_link_ed(ohci, ed);
return ed;
if (ED_STATE(ed) != ED_OPER) ohci_link_ed(ohci, ed);
*handle = ed;
return 0;
}
......
......@@ -354,7 +354,7 @@ struct usb_ohci_ed * ohci_find_ep(struct usb_device * usb_dev, struct usb_hcd_ed
int root_hub_control_msg(struct usb_device *usb_dev, unsigned int pipe, devrequest *cmd, void *data, int len);
int root_hub_release_irq(struct usb_device *usb_dev, void * ed);
void * root_hub_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id);
int root_hub_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id, void **handle);
/* Root-Hub Register info */
......
......@@ -309,7 +309,7 @@ static int ohci_del_rh_int_timer(struct ohci * ohci) {
return 0;
}
void * root_hub_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id)
int root_hub_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id, void **handle)
{
struct ohci * ohci = usb_dev->bus->hcpriv;
......@@ -319,7 +319,8 @@ void * root_hub_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_d
ohci->rh.send = 1;
ohci->rh.interval = period;
ohci_init_rh_int_timer(usb_dev, period);
return ohci->rh.int_addr = usb_to_ohci(usb_dev);
*handle = ohci->rh.int_addr = usb_to_ohci(usb_dev);
return 0;
}
int root_hub_release_irq(struct usb_device *usb_dev, void * ed)
......
......@@ -943,11 +943,12 @@ static __u16 ohci_td_bytes_done(struct ohci_td *td)
* Period is desired polling interval in ms. The closest, shorter
* match will be used. Powers of two from 1-32 are supported by OHCI.
*
* Returns: a "handle pointer" that release_irq can use to stop this
* interrupt. (It's really a pointer to the TD). NULL = error.
* Returns: success (0) or failure (< 0).
* Also sets the "handle pointer" that release_irq can use to stop this
* interrupt. (It's really a pointer to the TD).
*/
static void* ohci_request_irq(struct usb_device *usb, unsigned int pipe,
usb_device_irq handler, int period, void *dev_id)
static int ohci_request_irq(struct usb_device *usb, unsigned int pipe,
usb_device_irq handler, int period, void *dev_id, void **handle)
{
struct ohci_device *dev = usb_to_ohci(usb);
struct ohci_td *td;
......@@ -961,7 +962,7 @@ static void* ohci_request_irq(struct usb_device *usb, unsigned int pipe,
interrupt_ed = ohci_get_free_ed(dev);
if (!interrupt_ed) {
printk(KERN_ERR "Out of EDs on device %p in ohci_request_irq\n", dev);
return NULL;
return (-ENOMEM);
}
/*
......@@ -988,7 +989,7 @@ static void* ohci_request_irq(struct usb_device *usb, unsigned int pipe,
if (!td) {
printk(KERN_ERR "Out of TDs in ohci_request_irq\n");
ohci_free_ed(interrupt_ed);
return NULL;
return (-ENOMEM);
}
/* Fill in the TD */
......@@ -1009,7 +1010,8 @@ static void* ohci_request_irq(struct usb_device *usb, unsigned int pipe,
td = ohci_add_tds_to_ed(td, interrupt_ed);
spin_unlock_irqrestore(&ohci_edtd_lock, flags);
return (void*)td;
*handle = (void*)td;
return 0;
} /* ohci_request_irq() */
/*
......
......@@ -64,6 +64,10 @@
static char *format_topo =
/* T: Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd If#=ddd MxCh=dd Driver=%s */
"T: Lev=%2.2d Prnt=%2.2d Port=%2.2d Cnt=%2.2d Dev#=%3d Spd=%3s If#=%3d MxCh=%2d Driver=%s\n";
static char *format_bandwidth =
/* B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd */
"B: Alloc=%3d/%3d us (%2d%%), #Int=%3d, #Iso=%3d\n";
static char *format_device1 =
/* D: Ver=xx.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd */
......@@ -193,10 +197,7 @@ static int usb_dump_interface (const struct usb_interface_descriptor *interface,
* 0. TBDs
* 1. marking active config and ifaces (code lists all, but should mark
* which ones are active, if any)
* 2. Add proc_usb_init() call from usb-core.c.
* 3. proc_usb as a MODULE ?
* 4. use __init ?
* 5. add <halted> status to each endpoint line
* 2. add <halted> status to each endpoint line
*/
static int usb_dump_config_descriptor (const struct usb_config_descriptor *desc,
......@@ -282,6 +283,17 @@ static int usb_dump_desc (const struct usb_device *dev, char *buf, int *len)
return 0;
}
static int usb_hcd_bandwidth (const struct usb_device *dev, char *buf, int *len)
{
*len += sprintf (buf + *len, format_bandwidth,
dev->bus->bandwidth_allocated, FRAME_TIME_MAX_USECS_ALLOC,
100 * dev->bus->bandwidth_allocated / FRAME_TIME_MAX_USECS_ALLOC,
dev->bus->bandwidth_int_reqs, dev->bus->bandwidth_isoc_reqs
);
return (*len >= DUMP_LIMIT) ? -1 : 0;
}
#ifdef PROC_EXTRA /* TBD: may want to add this code later */
static int usb_dump_hub_descriptor (const struct usb_hub_descriptor * desc,
......@@ -352,6 +364,10 @@ static int usb_device_dump (char *buf, int *len,
if (usb_dump_desc (usbdev, buf, len) < 0)
return -1;
}
else { /* for a host controller */
if (usb_hcd_bandwidth (usbdev, buf, len) < 0)
return -1;
}
/* Now look at all of this device's children. */
for (chix = 0; chix < usbdev->maxchild; chix++) {
......@@ -851,18 +867,4 @@ int proc_usb_init (void)
return 0;
}
#ifdef PROCFS_MODULE /* TBD: support proc_fs MODULE ??? */
int init_module (void)
{
return proc_usb_init ();
}
void cleanup_module (void)
{
proc_usb_cleanup ();
}
#endif /* PROCFS_MODULE */
/* end proc_usb.c */
......@@ -589,28 +589,33 @@ static void uhci_remove_transfer(struct uhci_td *td, char removeirq)
/*
* Request a interrupt handler..
*
* Returns: a "handle pointer" that release_irq can use to stop this
* Returns 0 (success) or negative (failure).
* Also returns/sets a "handle pointer" that release_irq can use to stop this
* interrupt. (It's really a pointer to the TD).
*/
static void *uhci_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id)
static int uhci_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id, void **handle)
{
struct uhci_device *dev = usb_to_uhci(usb_dev);
struct uhci_td *td = uhci_td_alloc(dev);
struct uhci_qh *qh = uhci_qh_alloc(dev);
unsigned int destination, status;
if (!td || !qh)
return NULL;
if (!td || !qh) {
if (td)
uhci_td_free(td);
if (qh)
uhci_qh_free(qh);
return (-ENOMEM);
}
/* Destination: pipe destination with INPUT */
destination = (pipe & PIPE_DEVEP_MASK) | usb_packetid(pipe);
/* Infinite errors is 0, so no bits */
status = (pipe & TD_CTRL_LS) | TD_CTRL_IOC | TD_CTRL_ACTIVE |
TD_CTRL_SPD;
status = (pipe & TD_CTRL_LS) | TD_CTRL_IOC | TD_CTRL_ACTIVE | TD_CTRL_SPD;
td->link = UHCI_PTR_TERM; /* Terminate */
td->status = status; /* In */
td->status = status;
td->info = destination | ((usb_maxpacket(usb_dev, pipe, usb_pipeout(pipe)) - 1) << 21) |
(usb_gettoggle(usb_dev, usb_pipeendpoint(pipe), usb_pipeout(pipe)) << TD_TOKEN_TOGGLE);
......@@ -632,7 +637,8 @@ static void *uhci_request_irq(struct usb_device *usb_dev, unsigned int pipe, usb
/* Add it into the skeleton */
uhci_insert_qh(qh->skel, qh);
return (void *)td;
*handle = (void *)td;
return 0;
}
/*
......@@ -684,7 +690,6 @@ static int uhci_get_current_frame_number(struct usb_device *usb_dev)
/*
* uhci_init_isoc()
*
* Checks bus bandwidth allocation for this USB bus.
* Allocates some data structures.
* Initializes parts of them from the function parameters.
*
......@@ -705,11 +710,6 @@ static int uhci_init_isoc (struct usb_device *usb_dev,
struct usb_isoc_desc *id;
int i;
#ifdef BANDWIDTH_ALLOCATION
/* TBD: add bandwidth allocation/checking/management HERE. */
/* TBD: some way to factor in frame_spacing ??? */
#endif
*isocdesc = NULL;
/* Check some parameters. */
......@@ -866,7 +866,7 @@ static int uhci_run_isoc (struct usb_isoc_desc *isocdesc,
return -EINVAL;
}
} /* end START_ABSOLUTE */
}
} /* end not pr_isocdesc */
/*
* Set the start/end frame numbers.
......@@ -1384,7 +1384,7 @@ static void * uhci_request_bulk(struct usb_device *usb_dev, unsigned int pipe, u
if (pktsze > maxsze)
pktsze = maxsze;
td->status = status; /* Status */
td->status = status;
td->info = destination | ((pktsze-1) << 21) |
(usb_gettoggle(usb_dev, usb_pipeendpoint(pipe), usb_pipeout(pipe)) << TD_TOKEN_TOGGLE); /* pktsze bytes of data */
td->buffer = virt_to_bus(data);
......@@ -1715,6 +1715,8 @@ static void uhci_interrupt(int irq, void *__uhci, struct pt_regs *regs)
* interrupt cause
*/
status = inw(io_addr + USBSTS);
if (!status) /* shared interrupt, not mine */
return;
outw(status, io_addr + USBSTS);
/* Walk the list of pending TD's to see which ones completed.. */
......
......@@ -13,6 +13,8 @@
* are evil.
*/
#define USB_DEBUG 1
#include <linux/config.h>
#include <linux/string.h>
#include <linux/bitops.h>
......@@ -109,6 +111,82 @@ static void usb_driver_purge(struct usb_driver *driver,struct usb_device *dev)
}
}
/*
* calc_bus_time:
*
* returns (approximate) USB bus time in nanoseconds for a USB transaction.
*/
static long calc_bus_time (int low_speed, int input_dir, int isoc, int bytecount)
{
unsigned long tmp;
if (low_speed) /* no isoc. here */
{
if (input_dir)
{
tmp = (67667L * (31L + 10L * BitTime (bytecount))) / 1000L;
return (64060L + (2 * BW_HUB_LS_SETUP) + BW_HOST_DELAY + tmp);
}
else
{
tmp = (66700L * (31L + 10L * BitTime (bytecount))) / 1000L;
return (64107L + (2 * BW_HUB_LS_SETUP) + BW_HOST_DELAY + tmp);
}
}
/* for full-speed: */
if (!isoc) /* Input or Output */
{
tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L;
return (9107L + BW_HOST_DELAY + tmp);
} /* end not Isoc */
/* for isoc: */
tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L;
return (((input_dir) ? 7268L : 6265L) + BW_HOST_DELAY + tmp);
} /* end calc_bus_time */
/*
* check_bandwidth_alloc():
*
* old_alloc is from host_controller->bandwidth_allocated in microseconds;
* bustime is from calc_bus_time(), but converted to microseconds.
*
* returns 0 if successful,
* -1 if bandwidth request fails.
*
* FIXME:
* This initial implementation does not use Endpoint.bInterval
* in managing bandwidth allocation.
* It probably needs to be expanded to use Endpoint.bInterval.
* This can be done as a later enhancement (correction).
* This will also probably require some kind of
* frame allocation tracking...meaning, for example,
* that if multiple drivers request interrupts every 10 USB frames,
* they don't all have to be allocated at
* frame numbers N, N+10, N+20, etc. Some of them could be at
* N+11, N+21, N+31, etc., and others at
* N+12, N+22, N+32, etc.
* However, this first cut at USB bandwidth allocation does not
* contain any frame allocation tracking.
*/
int check_bandwidth_alloc (unsigned int old_alloc, long bustime)
{
unsigned int new_alloc;
new_alloc = old_alloc + bustime;
/* what new total allocated bus time would be */
PRINTD ("usb-bandwidth-alloc: was: %ld, new: %ld, bustime = %ld us, Pipe allowed: %s",
old_alloc, new_alloc, bustime,
(new_alloc <= FRAME_TIME_MAX_USECS_ALLOC) ?
"yes" : "no");
return (new_alloc <= FRAME_TIME_MAX_USECS_ALLOC) ? 0 : -1;
} /* end check_bandwidth_alloc */
/*
* New functions for (de)registering a controller
*/
......@@ -125,6 +203,9 @@ struct usb_bus *usb_alloc_bus(struct usb_operations *op)
bus->op = op;
bus->root_hub = NULL;
bus->hcpriv = NULL;
bus->bandwidth_allocated = 0;
bus->bandwidth_int_reqs = 0;
bus->bandwidth_isoc_reqs = 0;
INIT_LIST_HEAD(&bus->bus_list);
......@@ -609,7 +690,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char
int i = 5;
int result;
dr.requesttype = 0x80;
dr.requesttype = USB_DIR_IN;
dr.request = USB_REQ_GET_DESCRIPTOR;
dr.value = (type << 8) + index;
dr.index = 0;
......@@ -627,7 +708,7 @@ int usb_get_string(struct usb_device *dev, unsigned short langid, unsigned char
{
devrequest dr;
dr.requesttype = 0x80;
dr.requesttype = USB_DIR_IN;
dr.request = USB_REQ_GET_DESCRIPTOR;
dr.value = (USB_DT_STRING << 8) + index;
dr.index = langid;
......@@ -667,7 +748,7 @@ int usb_get_protocol(struct usb_device *dev)
unsigned char buf[8];
devrequest dr;
dr.requesttype = USB_RT_HIDD | 0x80;
dr.requesttype = USB_RT_HIDD | USB_DIR_IN;
dr.request = USB_REQ_GET_PROTOCOL;
dr.value = 0;
dr.index = 1;
......@@ -764,7 +845,7 @@ int usb_clear_halt(struct usb_device *dev, int endp)
return result;
#if 1 /* let's be really tough */
dr.requesttype = 0x80 | USB_RT_ENDPOINT;
dr.requesttype = USB_DIR_IN | USB_RT_ENDPOINT;
dr.request = USB_REQ_GET_STATUS;
dr.length = 2;
status = 0xffff;
......@@ -840,7 +921,7 @@ int usb_get_report(struct usb_device *dev, unsigned char type, unsigned char id,
{
devrequest dr;
dr.requesttype = USB_RT_HIDD | 0x80;
dr.requesttype = USB_RT_HIDD | USB_DIR_IN;
dr.request = USB_REQ_GET_REPORT;
dr.value = (type << 8) + id;
dr.index = index;
......@@ -1047,9 +1128,32 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u
return dev->bus->op->control_msg(dev, pipe, &dr, data, size);
}
void *usb_request_irq(struct usb_device *dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id)
int usb_request_irq(struct usb_device *dev, unsigned int pipe, usb_device_irq handler, int period, void *dev_id, void **handle)
{
return dev->bus->op->request_irq(dev, pipe, handler, period, dev_id);
long bustime;
int ret;
*handle = NULL;
/* Check host controller's bandwidth for this int. request. */
bustime = calc_bus_time (usb_pipeslow(pipe), usb_pipein(pipe), 0,
usb_maxpacket(dev, pipe, usb_pipeout(pipe)));
bustime = NS_TO_US(bustime); /* work in microseconds */
if (check_bandwidth_alloc (dev->bus->bandwidth_allocated, bustime))
return (USB_ST_BANDWIDTH_ERROR);
ret = dev->bus->op->request_irq(dev, pipe, handler, period, dev_id, handle);
/* Claim the USB bandwidth if no error. */
if (!ret) {
dev->bus->bandwidth_allocated += bustime;
dev->bus->bandwidth_int_reqs++;
PRINTD ("bw_alloc bumped to %d for %d requesters\n",
dev->bus->bandwidth_allocated,
dev->bus->bandwidth_int_reqs);
}
return ret;
}
void *usb_request_bulk(struct usb_device *dev, unsigned int pipe, usb_device_irq handler, void *data, int len, void *dev_id)
......@@ -1062,9 +1166,26 @@ int usb_terminate_bulk(struct usb_device *dev, void *first)
return dev->bus->op->terminate_bulk(dev, first);
}
int usb_release_irq(struct usb_device *dev, void *handle)
int usb_release_irq(struct usb_device *dev, void *handle, unsigned int pipe)
{
return dev->bus->op->release_irq(dev, handle);
long bustime;
int err;
err = dev->bus->op->release_irq(dev, handle);
/* Return the USB bandwidth if no error. */
if (!err) {
bustime = calc_bus_time (usb_pipeslow(pipe), usb_pipein(pipe), 0,
usb_maxpacket(dev, pipe, usb_pipeout(pipe)));
bustime = NS_TO_US(bustime);
dev->bus->bandwidth_allocated -= bustime;
dev->bus->bandwidth_int_reqs--;
PRINTD ("bw_alloc reduced to %d for %d requesters\n",
dev->bus->bandwidth_allocated,
dev->bus->bandwidth_int_reqs);
}
return err;
}
/*
......@@ -1084,11 +1205,46 @@ int usb_init_isoc (struct usb_device *usb_dev,
void *context,
struct usb_isoc_desc **isocdesc)
{
return usb_dev->bus->op->init_isoc (usb_dev, pipe, frame_count, context, isocdesc);
long bustime;
int err;
/* Check host controller's bandwidth for this Isoc. request. */
/* TBD: some way to factor in frame_spacing ??? */
bustime = calc_bus_time (0, usb_pipein(pipe), 1,
usb_maxpacket(usb_dev, pipe, usb_pipeout(pipe)));
bustime = NS_TO_US(bustime); /* work in microseconds */
if (check_bandwidth_alloc (usb_dev->bus->bandwidth_allocated, bustime))
return USB_ST_BANDWIDTH_ERROR;
err = usb_dev->bus->op->init_isoc (usb_dev, pipe, frame_count, context, isocdesc);
/* Claim the USB bandwidth if no error. */
if (!err) {
usb_dev->bus->bandwidth_allocated += bustime;
usb_dev->bus->bandwidth_isoc_reqs++;
PRINTD ("bw_alloc bumped to %d for %d requesters\n",
usb_dev->bus->bandwidth_allocated,
usb_dev->bus->bandwidth_isoc_reqs);
}
return err;
}
void usb_free_isoc (struct usb_isoc_desc *isocdesc)
{
long bustime;
/* Return the USB bandwidth. */
bustime = calc_bus_time (0, usb_pipein(isocdesc->pipe), 1,
usb_maxpacket(isocdesc->usb_dev, isocdesc->pipe,
usb_pipeout(isocdesc->pipe)));
bustime = NS_TO_US(bustime);
isocdesc->usb_dev->bus->bandwidth_allocated -= bustime;
isocdesc->usb_dev->bus->bandwidth_isoc_reqs--;
PRINTD ("bw_alloc reduced to %d for %d requesters\n",
isocdesc->usb_dev->bus->bandwidth_allocated,
isocdesc->usb_dev->bus->bandwidth_isoc_reqs);
isocdesc->usb_dev->bus->op->free_isoc (isocdesc);
}
......
......@@ -201,6 +201,7 @@ typedef struct {
#define USB_ST_NOTSUPPORTED -2
#define USB_ST_BANDWIDTH_ERROR -3
/*
* USB device number allocation bitmap. There's one bitmap
* per USB tree.
......@@ -430,7 +431,7 @@ struct usb_operations {
int (*deallocate)(struct usb_device *);
int (*control_msg)(struct usb_device *, unsigned int, devrequest *, void *, int);
int (*bulk_msg)(struct usb_device *, unsigned int, void *, int,unsigned long *);
void *(*request_irq)(struct usb_device *, unsigned int, usb_device_irq, int, void *);
int (*request_irq)(struct usb_device *, unsigned int, usb_device_irq, int, void *, void **);
int (*release_irq)(struct usb_device *, void *);
void *(*request_bulk)(struct usb_device *, unsigned int, usb_device_irq,
void *, int, void *);
......@@ -453,6 +454,14 @@ struct usb_bus {
struct list_head bus_list;
void *hcpriv; /* Host Controller private data */
unsigned int bandwidth_allocated; /* on this Host Controller; */
/* applies to Int. and Isoc. pipes; */
/* measured in microseconds/frame; */
/* range is 0..900, where 900 = */
/* 90% of a 1-millisecond frame */
int bandwidth_int_reqs; /* number of Interrupt requesters */
int bandwidth_isoc_reqs; /* number of Isoc. requesters */
/* procfs entry */
int proc_busnum;
struct proc_dir_entry *proc_entry;
......@@ -522,8 +531,8 @@ extern void usb_inc_dev_use(struct usb_device *);
extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void *data, __u16 size);
extern void *usb_request_irq(struct usb_device *, unsigned int, usb_device_irq, int, void *);
extern int usb_release_irq(struct usb_device *dev, void *handle);
extern int usb_request_irq(struct usb_device *, unsigned int, usb_device_irq, int, void *, void **);
extern int usb_release_irq(struct usb_device *dev, void *handle, unsigned int pipe);
extern void *usb_request_bulk(struct usb_device *, unsigned int, usb_device_irq, void *, int, void *);
extern int usb_terminate_bulk(struct usb_device *, void *);
......@@ -652,6 +661,26 @@ int usb_get_report(struct usb_device *dev, unsigned char type, unsigned char id,
char *usb_string(struct usb_device *dev, int index);
int usb_clear_halt(struct usb_device *dev, int endp);
/*
* Some USB bandwidth allocation constants.
*/
#define BW_HOST_DELAY 1000L /* nanoseconds */
#define BW_HUB_LS_SETUP 333L /* nanoseconds */
/* 4 full-speed bit times (est.) */
#define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */
#define FRAME_TIME_MAX_BITS_ALLOC (90L * FRAME_TIME_BITS / 100L)
#define FRAME_TIME_USECS 1000L
#define FRAME_TIME_MAX_USECS_ALLOC (90L * FRAME_TIME_USECS / 100L)
#define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */
/* Trying not to use worst-case bit-stuffing
of (7/6 * 8 * bytecount) = 9.33 * bytecount */
/* bytecount = data payload byte count */
#define NS_TO_US(ns) ((ns + 500L) / 1000L)
/* convert & round nanoseconds to microseconds */
/*
* Debugging helpers..
*/
......@@ -663,6 +692,14 @@ void usb_show_endpoint_descriptor(struct usb_endpoint_descriptor *);
void usb_show_device(struct usb_device *);
void usb_show_string(struct usb_device *dev, char *id, int index);
#ifdef USB_DEBUG
#define PRINTD(format, args...) printk("usb: " format "\n" , ## args);
#else /* NOT DEBUGGING */
#define PRINTD(fmt, arg...) do {} while (0) /**/
#endif /* USB_DEBUG */
/* A simple way to change one line from DEBUG to NOT DEBUG: */
#define XPRINTD(fmt, arg...) do {} while (0)
/*
* procfs stuff
*/
......@@ -679,7 +716,7 @@ extern inline void proc_usb_add_device(struct usb_device *dev) {}
extern inline void proc_usb_remove_device(struct usb_device *dev) {}
#endif
#endif /* __KERNEL */
#endif /* __KERNEL__ */
#endif
......@@ -92,6 +92,7 @@ struct us_data {
int pid; /* control thread */
struct semaphore *notify; /* wait for thread to begin */
void *irq_handle; /* for USB interrupt requests */
unsigned int irqpipe; /* remember pipe for release_irq */
};
/*
......@@ -374,7 +375,6 @@ static int pop_CB_status(Scsi_Cmnd *srb)
__u8 status[2];
devrequest dr;
int retry = 5;
void *irq_handle;
US_DEBUGP("pop_CB_status, proto=%x\n", us->protocol);
switch (us->protocol) {
......@@ -382,7 +382,7 @@ static int pop_CB_status(Scsi_Cmnd *srb)
/* get from control */
while (retry--) {
dr.requesttype = 0x80 | USB_TYPE_STANDARD | USB_RT_DEVICE;
dr.requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RT_DEVICE;
dr.request = USB_REQ_GET_STATUS;
dr.index = 0;
dr.value = 0;
......@@ -410,14 +410,14 @@ static int pop_CB_status(Scsi_Cmnd *srb)
/* add interrupt transfer, marked for removal */
us->ip_wanted = 1;
irq_handle = us->pusb_dev->bus->op->request_irq(us->pusb_dev,
usb_rcvctrlpipe(us->pusb_dev, us->ep_int),
pop_CBI_irq, 0, (void *)us);
if (!irq_handle) {
US_DEBUGP("No interrupt for CBI\n");
us->irqpipe = usb_rcvctrlpipe(us->pusb_dev, us->ep_int);
result = us->pusb_dev->bus->op->request_irq(us->pusb_dev, us->irqpipe,
pop_CBI_irq, 0,
(void *)us, &us->irq_handle);
if (result) {
US_DEBUGP("usb_scsi: usb_request_irq failed (0x%x), No interrupt for CBI\n", result);
return DID_ABORT << 16;
}
us->irq_handle = irq_handle;
sleep_on(&us->ip_waitq);
if (us->ip_wanted) {
......@@ -651,8 +651,9 @@ static int us_release(struct Scsi_Host *psh)
struct us_data *prev = (struct us_data *)&us_list;
if (us->irq_handle) {
usb_release_irq(us->pusb_dev, us->irq_handle);
usb_release_irq(us->pusb_dev, us->irq_handle, us->irqpipe);
us->irq_handle = NULL;
us->irqpipe = 0;
}
if (us->filter)
us->filter->release(us->fdata);
......@@ -892,7 +893,7 @@ static int usbscsi_control_thread(void * __us)
us->srb->result = DID_OK << 16;
else {
unsigned int savelen = us->srb->request_bufflen;
unsigned int saveallocation;
unsigned int saveallocation = 0;
switch (us->srb->cmnd[0]) {
case REQUEST_SENSE:
......@@ -941,7 +942,7 @@ static int usbscsi_control_thread(void * __us)
if (savelen != us->srb->request_bufflen &&
us->srb->result == (DID_OK << 16)) {
unsigned char *p = (unsigned char *)us->srb->request_buffer;
unsigned int length;
unsigned int length = 0;
/* set correct length and retry */
switch (us->srb->cmnd[0]) {
......@@ -1194,7 +1195,7 @@ static int scsi_probe(struct usb_device *dev)
for (i = 0; i < interface->bNumEndpoints; i++) {
if (interface->endpoint[i].bmAttributes == 0x02) {
if (interface->endpoint[i].bEndpointAddress & 0x80)
if (interface->endpoint[i].bEndpointAddress & USB_DIR_IN)
ss->ep_in = interface->endpoint[i].bEndpointAddress & 0x0f;
else
ss->ep_out = interface->endpoint[i].bEndpointAddress & 0x0f;
......@@ -1287,7 +1288,7 @@ static int scsi_probe(struct usb_device *dev)
dev->descriptor.idProduct == 0x0001) {
devrequest dr;
__u8 qstat[2];
void *irq_handle;
int result;
/* shuttle E-USB */
dr.requesttype = 0xC0;
......@@ -1298,12 +1299,12 @@ static int scsi_probe(struct usb_device *dev)
ss->pusb_dev->bus->op->control_msg(ss->pusb_dev, usb_rcvctrlpipe(dev,0), &dr, qstat, 2);
US_DEBUGP("C0 status %x %x\n", qstat[0], qstat[1]);
init_waitqueue_head(&ss->ip_waitq);
irq_handle = ss->pusb_dev->bus->op->request_irq(ss->pusb_dev,
usb_rcvctrlpipe(ss->pusb_dev, ss->ep_int),
pop_CBI_irq, 0, (void *)ss);
if (!irq_handle)
ss->irqpipe = usb_rcvctrlpipe(ss->pusb_dev, ss->ep_int);
result = ss->pusb_dev->bus->op->request_irq(ss->pusb_dev, ss->irqpipe,
pop_CBI_irq, 0,
(void *)ss, &ss->irq_handle);
if (result)
return -1;
ss->irq_handle = irq_handle;
interruptible_sleep_on_timeout(&ss->ip_waitq, HZ*5);
} else if (ss->protocol == US_PR_CBI)
......
......@@ -27,7 +27,7 @@
void us_show_command(Scsi_Cmnd *srb)
{
char *what;
char *what = NULL;
switch (srb->cmnd[0]) {
case TEST_UNIT_READY: what = "TEST_UNIT_READY"; break;
......
......@@ -48,6 +48,7 @@
struct parport_uss720_private {
struct usb_device *usbdev;
void *irqhandle;
unsigned int irqpipe;
unsigned char reg[7]; /* USB registers */
};
......@@ -616,8 +617,15 @@ static int uss720_probe(struct usb_device *usbdev)
endpoint = &interface->endpoint[2];
printk(KERN_DEBUG "uss720: epaddr %d interval %d\n", endpoint->bEndpointAddress, endpoint->bInterval);
#if 0
priv->irqhandle = usb_request_irq(usbdev, usb_rcvctrlpipe(usbdev, endpoint->bEndpointAddress),
uss720_irq, endpoint->bInterval, pp);
priv->irqpipe = usb_rcvctrlpipe(usbdev, endpoint->bEndpointAddress);
i = usb_request_irq(usbdev, priv->irqpipe,
uss720_irq, endpoint->bInterval,
pp, &priv->irqhandle);
if (i) {
printk (KERN_WARNING "usb-uss720: usb_request_irq failed (0x%x)\n", i);
/* FIXME: undo some stuff and free some memory. */
return -1;
}
#endif
parport_proc_register(pp);
parport_announce_port(pp);
......@@ -632,7 +640,7 @@ static void uss720_disconnect(struct usb_device *usbdev)
struct parport_uss720_private *priv = pp->private_data;
#if 0
usb_release_irq(usbdev, priv->irqhandle);
usb_release_irq(usbdev, priv->irqhandle, priv->irqpipe);
#endif
usbdev->private = NULL;
priv->usbdev = NULL;
......
This diff is collapsed.
......@@ -641,6 +641,14 @@ struct proc_dir_entry proc_root_fs = {
NULL,
NULL, NULL
};
struct proc_dir_entry proc_root_driver = {
PROC_DRIVER, 6, "driver",
S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0,
0, &proc_dir_inode_operations,
NULL, NULL,
NULL,
NULL, NULL
};
static struct proc_dir_entry proc_root_dma = {
PROC_DMA, 3, "dma",
S_IFREG | S_IRUGO, 1, 0, 0,
......@@ -738,6 +746,7 @@ void __init proc_root_init(void)
#endif
proc_register(&proc_root, &proc_root_stat);
proc_register(&proc_root, &proc_root_devices);
proc_register(&proc_root, &proc_root_driver);
proc_register(&proc_root, &proc_root_partitions);
proc_register(&proc_root, &proc_root_interrupts);
proc_register(&proc_root, &proc_root_filesystems);
......
/* $Id: dma.h,v 1.30 1999/08/08 14:03:37 shadow Exp $
/* $Id: dma.h,v 1.31 1999/09/10 10:44:15 davem Exp $
* include/asm-sparc/dma.h
*
* Copyright 1995 (C) David S. Miller (davem@caip.rutgers.edu)
......
/* $Id: pgtable.h,v 1.81 1999/06/27 00:38:28 davem Exp $ */
/* $Id: pgtable.h,v 1.82 1999/09/10 10:44:21 davem Exp $ */
#ifndef _SPARC_PGTABLE_H
#define _SPARC_PGTABLE_H
......
/* $Id: dma.h,v 1.15 1999/09/08 03:44:38 davem Exp $
/* $Id: dma.h,v 1.16 1999/09/10 10:44:32 davem Exp $
* include/asm-sparc64/dma.h
*
* Copyright 1996 (C) David S. Miller (davem@caip.rutgers.edu)
......
/* $Id: mmu_context.h,v 1.39 1999/08/02 08:39:57 davem Exp $ */
/* $Id: mmu_context.h,v 1.40 1999/09/10 10:44:37 davem Exp $ */
#ifndef __SPARC64_MMU_CONTEXT_H
#define __SPARC64_MMU_CONTEXT_H
......
/* $Id: pbm.h,v 1.17 1999/08/30 10:14:54 davem Exp $
/* $Id: pbm.h,v 1.18 1999/09/10 10:44:40 davem Exp $
* pbm.h: UltraSparc PCI controller software state.
*
* Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com)
......
......@@ -69,83 +69,12 @@ extern __inline__ int spin_trylock(spinlock_t *lock)
extern __inline__ void spin_unlock(spinlock_t *lock)
{
__asm__ __volatile__("membar #StoreStore | #LoadStore\n\t"
"stb %%g0, [%0]\n\t"
"membar #StoreStore | #StoreLoad"
"stb %%g0, [%0]"
: /* No outputs */
: "r" (lock)
: "memory");
}
extern __inline__ void spin_lock_irq(spinlock_t *lock)
{
__asm__ __volatile__("
wrpr %%g0, 15, %%pil
1: ldstub [%0], %%g7
brnz,pn %%g7, 2f
membar #StoreLoad | #StoreStore
.subsection 2
2: ldub [%0], %%g7
brnz,pt %%g7, 2b
membar #LoadLoad
b,a,pt %%xcc, 1b
.previous
" : /* no outputs */
: "r" (lock)
: "g7", "memory");
}
extern __inline__ void spin_unlock_irq(spinlock_t *lock)
{
__asm__ __volatile__("membar #StoreStore | #LoadStore\n\t"
"stb %%g0, [%0]\n\t"
"membar #StoreStore | #StoreLoad\n\t"
"wrpr %%g0, 0x0, %%pil"
: /* no outputs */
: "r" (lock)
: "memory");
}
#define spin_lock_bh(__lock) \
do { local_bh_count++; \
spin_lock(__lock); \
} while(0)
#define spin_unlock_bh(__lock) \
do { spin_unlock(__lock); \
local_bh_count--; \
} while(0)
#define spin_lock_irqsave(__lock, flags) \
do { register spinlock_t *__lp asm("g1"); \
__lp = (__lock); \
__asm__ __volatile__( \
"\n rdpr %%pil, %0\n" \
" wrpr %%g0, 15, %%pil\n" \
"1: ldstub [%1], %%g7\n" \
" brnz,pn %%g7, 2f\n" \
" membar #StoreLoad | #StoreStore\n" \
" .subsection 2\n" \
"2: ldub [%1], %%g7\n" \
" brnz,pt %%g7, 2b\n" \
" membar #LoadLoad\n" \
" b,a,pt %%xcc, 1b\n" \
" .previous\n" \
: "=&r" (flags) \
: "r" (__lp) \
: "g7", "memory"); \
} while(0)
extern __inline__ void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
{
__asm__ __volatile__("membar #StoreStore | #LoadStore\n\t"
"stb %%g0, [%0]\n\t"
"membar #StoreStore | #StoreLoad\n\t"
"wrpr %1, 0x0, %%pil"
: /* no outputs */
: "r" (lock), "r" (flags)
: "memory");
}
#else /* !(SPIN_LOCK_DEBUG) */
typedef struct {
......@@ -170,13 +99,7 @@ extern int _spin_trylock (spinlock_t *lock);
#define spin_trylock(lp) _spin_trylock(lp)
#define spin_lock(lock) _do_spin_lock(lock, "spin_lock")
#define spin_lock_irq(lock) do { __cli(); _do_spin_lock(lock, "spin_lock_irq"); } while(0)
#define spin_lock_bh(lock) do { local_bh_count++; _do_spin_lock(lock, "spin_lock_bh"); } while(0)
#define spin_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_spin_lock(lock, "spin_lock_irqsave"); } while(0)
#define spin_unlock(lock) _do_spin_unlock(lock)
#define spin_unlock_irq(lock) do { _do_spin_unlock(lock); __sti(); } while(0)
#define spin_unlock_bh(lock) do { _do_spin_unlock(lock); local_bh_count--; } while(0)
#define spin_unlock_irqrestore(lock, flags) do { _do_spin_unlock(lock); __restore_flags(flags); } while(0)
#endif /* SPIN_LOCK_DEBUG */
......@@ -223,24 +146,6 @@ do { register rwlock_t *__X asm("g1"); \
: "g2", "g3", "g5", "g7", "cc", "memory"); \
} while(0)
#define read_lock_irq(lock) do { __cli(); read_lock(lock); } while (0)
#define read_unlock_irq(lock) do { read_unlock(lock); __sti(); } while (0)
#define read_lock_bh(lock) do { local_bh_count++; read_lock(lock); } while (0)
#define read_unlock_bh(lock) do { read_unlock(lock); local_bh_count--; } while (0)
#define write_lock_irq(lock) do { __cli(); write_lock(lock); } while (0)
#define write_unlock_irq(lock) do { write_unlock(lock); __sti(); } while (0)
#define write_lock_bh(lock) do { local_bh_count++; write_lock(lock); } while (0)
#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_count--; } while (0)
#define read_lock_irqsave(lock, flags) \
do { __save_and_cli(flags); read_lock(lock); } while (0)
#define read_unlock_irqrestore(lock, flags) \
do { read_unlock(lock); __restore_flags(flags); } while (0)
#define write_lock_irqsave(lock, flags) \
do { __save_and_cli(flags); write_lock(lock); } while (0)
#define write_unlock_irqrestore(lock, flags) \
do { write_unlock(lock); __restore_flags(flags); } while (0)
#else /* !(SPIN_LOCK_DEBUG) */
typedef struct {
......@@ -261,9 +166,6 @@ do { unsigned long flags; \
_do_read_lock(lock, "read_lock"); \
__restore_flags(flags); \
} while(0)
#define read_lock_irq(lock) do { __cli(); _do_read_lock(lock, "read_lock_irq"); } while(0)
#define read_lock_bh(lock) do { local_bh_count++; _do_read_lock(lock, "read_lock_bh"); } while(0)
#define read_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_read_lock(lock, "read_lock_irqsave"); } while(0)
#define read_unlock(lock) \
do { unsigned long flags; \
......@@ -271,9 +173,6 @@ do { unsigned long flags; \
_do_read_unlock(lock, "read_unlock"); \
__restore_flags(flags); \
} while(0)
#define read_unlock_irq(lock) do { _do_read_unlock(lock, "read_unlock_irq"); __sti() } while(0)
#define read_unlock_bh(lock) do { _do_read_unlock(lock, "read_unlock_bh"); local_bh_count--; } while(0)
#define read_unlock_irqrestore(lock, flags) do { _do_read_unlock(lock, "read_unlock_irqrestore"); __restore_flags(flags); } while(0)
#define write_lock(lock) \
do { unsigned long flags; \
......@@ -281,9 +180,6 @@ do { unsigned long flags; \
_do_write_lock(lock, "write_lock"); \
__restore_flags(flags); \
} while(0)
#define write_lock_irq(lock) do { __cli(); _do_write_lock(lock, "write_lock_irq"); } while(0)
#define write_lock_bh(lock) do { local_bh_count++; _do_write_lock(lock, "write_lock_bh"); } while(0)
#define write_lock_irqsave(lock, flags) do { __save_and_cli(flags); _do_write_lock(lock, "write_lock_irqsave"); } while(0)
#define write_unlock(lock) \
do { unsigned long flags; \
......@@ -291,9 +187,6 @@ do { unsigned long flags; \
_do_write_unlock(lock); \
__restore_flags(flags); \
} while(0)
#define write_unlock_irq(lock) do { _do_write_unlock(lock); __sti(); } while(0)
#define write_unlock_bh(lock) do { _do_write_unlock(lock); local_bh_count--; } while(0)
#define write_unlock_irqrestore(lock, flags) do { _do_write_unlock(lock); __restore_flags(flags); } while(0)
#endif /* SPIN_LOCK_DEBUG */
......
/* $Id: system.h,v 1.54 1999/09/01 08:06:12 davem Exp $ */
/* $Id: system.h,v 1.55 1999/09/10 10:44:44 davem Exp $ */
#ifndef __SPARC64_SYSTEM_H
#define __SPARC64_SYSTEM_H
......@@ -63,9 +63,13 @@ extern unsigned long empty_zero_page;
retval; \
})
#define __save_flags(flags) ((flags) = getipl())
#define __save_and_cli(flags) ((flags) = read_pil_and_cli())
#define __restore_flags(flags) setipl((flags))
#define __save_flags(flags) ((flags) = getipl())
#define __save_and_cli(flags) ((flags) = read_pil_and_cli())
#define __restore_flags(flags) setipl((flags))
#define local_irq_disable() __cli()
#define local_irq_enable() __sti()
#define local_irq_save(flags) __save_and_cli(flags)
#define local_irq_restore(flags) __restore_flags(flags)
#ifndef __SMP__
#define cli() __cli()
......
......@@ -96,7 +96,7 @@ struct sysinfo {
unsigned short procs; /* Number of current processes */
unsigned long totalbig; /* Total big memory size */
unsigned long freebig; /* Available big memory size */
char _f[12]; /* Padding to 64 bytes: libc5 uses this.. */
char _f[20-2*sizeof(long)]; /* Padding: libc5 uses this.. */
};
#endif
......@@ -871,6 +871,7 @@
#define PCI_DEVICE_ID_TTI_HPT366 0x0004
#define PCI_VENDOR_ID_VIA 0x1106
#define PCI_DEVICE_ID_VIA_8501_0 0x0501
#define PCI_DEVICE_ID_VIA_82C505 0x0505
#define PCI_DEVICE_ID_VIA_82C561 0x0561
#define PCI_DEVICE_ID_VIA_82C586_1 0x0571
......@@ -894,6 +895,7 @@
#define PCI_DEVICE_ID_VIA_82C686_5 0x3058
#define PCI_DEVICE_ID_VIA_82C686_6 0x3068
#define PCI_DEVICE_ID_VIA_86C100A 0x6100
#define PCI_DEVICE_ID_VIA_8501_1 0x8501
#define PCI_DEVICE_ID_VIA_82C597_1 0x8597
#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
......
......@@ -55,7 +55,8 @@ enum root_directory_inos {
PROC_SOUND,
PROC_MTRR, /* whether enabled or not */
PROC_FS,
PROC_SYSVIPC
PROC_SYSVIPC,
PROC_DRIVER,
};
enum pid_directory_inos {
......@@ -330,6 +331,7 @@ extern struct proc_dir_entry proc_pid_fd;
extern struct proc_dir_entry proc_mca;
extern struct proc_dir_entry *proc_bus;
extern struct proc_dir_entry *proc_sysvipc;
extern struct proc_dir_entry proc_root_driver;
extern struct inode_operations proc_scsi_inode_operations;
......@@ -339,6 +341,19 @@ extern void proc_base_init(void);
extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *);
extern int proc_unregister(struct proc_dir_entry *, int);
/*
* generic.c
*/
extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent);
extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
/*
* inlined /proc helper functions
*/
static inline int proc_net_register(struct proc_dir_entry * x)
{
return proc_register(proc_net, x);
......@@ -381,6 +396,50 @@ static inline int proc_scsi_unregister(struct proc_dir_entry *driver, int x)
}
}
/*
* retrieve the proc_dir_entry associated with /proc/driver/$module_name
*/
extern inline
struct proc_dir_entry *proc_driver_find (const char *module_name)
{
struct proc_dir_entry *p;
p = proc_root_driver.subdir;
while (p != NULL) {
if (strcmp (p->name, module_name) == 0)
return p;
p = p->next;
}
return NULL;
}
/*
* remove /proc/driver/$module_name, and all its contents
*/
extern inline int proc_driver_unregister(const char *module_name)
{
remove_proc_entry (module_name, &proc_root_driver);
return 0;
}
/*
* create driver-specific playground directory, /proc/driver/$module_name
*/
extern inline int proc_driver_register(const char *module_name)
{
struct proc_dir_entry *p;
p = create_proc_entry (module_name, S_IFDIR, &proc_root_driver);
return (p == NULL) ? -1 : 0;
}
extern struct super_block *proc_super_blocks;
extern struct dentry_operations proc_dentry_operations;
extern struct super_block *proc_read_super(struct super_block *,void *,int);
......@@ -442,13 +501,6 @@ extern struct inode_operations proc_omirr_inode_operations;
extern struct inode_operations proc_ppc_htab_inode_operations;
extern struct inode_operations proc_sysvipc_inode_operations;
/*
* generic.c
*/
struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent);
void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
/*
* proc_tty.c
*/
......@@ -481,6 +533,23 @@ extern inline void remove_proc_entry(const char *name, struct proc_dir_entry *pa
extern inline void proc_tty_register_driver(struct tty_driver *driver) {};
extern inline void proc_tty_unregister_driver(struct tty_driver *driver) {};
extern inline
struct proc_dir_entry *proc_driver_find (const char *module_name)
{
return NULL;
}
extern inline int proc_driver_unregister(const char *module_name)
{
return 0;
}
extern inline int proc_driver_register(const char *module_name)
{
return 0;
}
#endif /* CONFIG_PROC_FS */
#endif
#endif /* _LINUX_PROC_FS_H */
......@@ -29,7 +29,7 @@
#define write_unlock_irq(lock) do { write_unlock(lock); local_irq_enable(); } while (0)
#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_enable(); } while (0)
#ifdef CONFIG_SMP
#ifdef __SMP__
#include <asm/spinlock.h>
#else /* !SMP */
......
......@@ -238,7 +238,8 @@ enum
NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
NET_TCP_TW_RECYCLE=66,
NET_IPV4_TCP_KEEPALIVE_INTVL=67,
NET_IPV4_ALWAYS_DEFRAG=67,
NET_IPV4_TCP_KEEPALIVE_INTVL=68,
};
enum {
......
......@@ -174,10 +174,10 @@ int do_syslog(int type, char * buf, int len)
error = verify_area(VERIFY_WRITE,buf,len);
if (error)
goto out;
spin_lock_irq(&console_lock);
count = len;
if (count > LOG_BUF_LEN)
count = LOG_BUF_LEN;
spin_lock_irq(&console_lock);
if (count > logged_chars)
count = logged_chars;
if (do_clear)
......
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