Commit 588a2e29 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.22pre3

parent a7f16fab
......@@ -12581,8 +12581,7 @@ CONFIG_PPDEV
Saying Y to this adds support for /dev/parport device nodes. This
is needed for programs that want portable access to the parallel
port, for instance deviceid (which displays Plug-and-Play device
IDs) and vlp (which makes a Linux computer act as though it's a
printer).
IDs).
This is the parallel port equivalent of SCSI generic support (sg).
It is safe to say N to this -- it is not needed for normal printing
......
......@@ -278,6 +278,9 @@ int parport_negotiate (struct parport *port, int mode)
return -ENOSYS; /* FIXME (implement BECP) */
}
if (mode & IEEE1284_EXT_LINK)
m = 1<<7; /* request extensibility link */
port->ieee1284.phase = IEEE1284_PH_NEGOTIATION;
/* Start off with nStrobe and nAutoFd high, and nSelectIn low */
......@@ -354,12 +357,59 @@ int parport_negotiate (struct parport *port, int mode)
return 1;
}
/* More to do if we've requested extensibility link. */
if (mode & IEEE1284_EXT_LINK) {
m = mode & 0x7f;
udelay (1);
parport_write_data (port, m);
udelay (1);
/* Event 51: Set nStrobe low */
parport_frob_control (port,
PARPORT_CONTROL_STROBE,
PARPORT_CONTROL_STROBE);
/* Event 53: Set nStrobe high */
udelay (5);
parport_frob_control (port,
PARPORT_CONTROL_STROBE,
0);
/* Event 55: nAck goes high */
if (parport_wait_peripheral (port,
PARPORT_STATUS_ACK,
PARPORT_STATUS_ACK)) {
/* This shouldn't really happen with a compliant
* device. */
DPRINTK (KERN_DEBUG
"%s: Mode 0x%02x not supported? (0x%02x)\n",
port->name, mode,
port->ops->read_status (port));
parport_ieee1284_terminate (port);
return 1;
}
/* Event 54: Peripheral sets XFlag to reflect support */
xflag = parport_read_status (port) & PARPORT_STATUS_SELECT;
/* xflag should be high. */
if (!xflag) {
/* Extended mode not supported. */
DPRINTK (KERN_DEBUG "%s: Extended mode 0x%02x not "
"supported\n", port->name, mode);
parport_ieee1284_terminate (port);
return 1;
}
/* Any further setup is left to the caller. */
}
/* Mode is supported */
DPRINTK (KERN_DEBUG "%s: In mode 0x%02x\n", port->name, mode);
port->ieee1284.mode = mode;
/* But ECP is special */
if (mode & IEEE1284_MODE_ECP) {
if (!(mode & IEEE1284_EXT_LINK) && (mode & IEEE1284_MODE_ECP)) {
port->ieee1284.phase = IEEE1284_PH_ECP_SETUP;
/* Event 30: Set nAutoFd low */
......
......@@ -1708,58 +1708,83 @@ static int __init parport_pc_init_pci (int irq, int dma)
struct {
unsigned int vendor;
unsigned int device;
unsigned int subvendor;
unsigned int subdevice;
unsigned int numports;
struct {
unsigned long lo;
unsigned long hi; /* -ve if not there */
} addr[4];
} cards[] = {
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_550, 1,
{ { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_650, 1,
{ { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_850, 1,
{ { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1P_10x, 1,
{ { 2, 3 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P_10x, 2,
{ { 2, 3 }, { 4, 5 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_550, 1,
{ { 4, 5 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_650, 1,
{ { 4, 5 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_850, 1,
{ { 4, 5 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1P_20x, 1,
{ { 0, 1 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P_20x, 2,
{ { 0, 1 }, { 2, 3 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_550, 2,
{ { 1, 2 }, { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_650, 2,
{ { 1, 2 }, { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_850, 2,
{ { 1, 2 }, { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_550, 1,
{ { 1, 2 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_650, 1,
{ { 1, 2 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_850, 1,
{ { 1, 2 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_550, 1,
{ { 2, 3 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_650, 1,
{ { 2, 3 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_850, 1,
{ { 2, 3 }, } },
{ PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PARALLEL, 1,
{ { 0, -1 }, } },
{ PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DUAL_PAR_A, 1,
{ { 0, -1 }, } },
{ PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DUAL_PAR_B, 1,
{ { 0, -1 }, } },
{ PCI_VENDOR_ID_EXSYS, PCI_DEVICE_ID_EXSYS_4014, 2,
{ { 2, -1 }, { 3, -1 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_550,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_650,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_850,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1P_10x,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 2, 3 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P_10x,
PCI_ANY_ID, PCI_ANY_ID,
2, { { 2, 3 }, { 4, 5 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_550,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 4, 5 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_650,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 4, 5 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_850,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 4, 5 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1P_20x,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 0, 1 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P_20x,
PCI_ANY_ID, PCI_ANY_ID,
2, { { 0, 1 }, { 2, 3 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_550,
PCI_ANY_ID, PCI_ANY_ID,
2, { { 1, 2 }, { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_650,
PCI_ANY_ID, PCI_ANY_ID,
2, { { 1, 2 }, { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_850,
PCI_ANY_ID, PCI_ANY_ID,
2, { { 1, 2 }, { 3, 4 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_550,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 1, 2 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_650,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 1, 2 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_850,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 1, 2 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_550,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 2, 3 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_650,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 2, 3 }, } },
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_850,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 2, 3 }, } },
{ PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PARALLEL,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 0, -1 }, } },
{ PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DUAL_PAR_A,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 0, -1 }, } },
{ PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DUAL_PAR_B,
PCI_ANY_ID, PCI_ANY_ID,
1, { { 0, -1 }, } },
{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
PCI_SUBVENDOR_ID_EXSYS, PCI_SUBDEVICE_ID_EXSYS_4014,
2, { { 4, -1 }, { 5, -1 }, } },
{ 0, }
};
......@@ -1776,6 +1801,15 @@ static int __init parport_pc_init_pci (int irq, int dma)
cards[i].device,
pcidev)) != NULL) {
int n;
if (cards[i].subvendor != PCI_ANY_ID &&
cards[i].subvendor != pcidev->subsystem_vendor)
continue;
if (cards[i].subdevice != PCI_ANY_ID &&
cards[i].subdevice != pcidev->subsystem_device)
continue;
for (n = 0; n < cards[i].numports; n++) {
unsigned long lo = cards[i].addr[n].lo;
unsigned long hi = cards[i].addr[n].hi;
......
......@@ -994,10 +994,6 @@ VENDOR( ATRONICS, "Atronics" )
DEVICE( ATRONICS, ATRONICS_2015, "IDE-2015PL")
ENDVENDOR()
VENDOR( EXSYS, "Exsys" )
DEVICE( EXSYS, EXSYS_4014, "EX-4014")
ENDVENDOR()
VENDOR( TIGERJET, "TigerJet" )
DEVICE( TIGERJET, TIGERJET_300, "Tiger300 ISDN")
ENDVENDOR()
......
......@@ -34,7 +34,7 @@ printk_name(const char *name, int len)
len = 80;
strncpy(buf, name, len);
buf[len] = 0;
printk(buf);
printk("%s", buf);
}
#endif
......
......@@ -71,6 +71,10 @@ typedef enum {
#define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */
#define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */
#define IEEE1284_DEVICEID (1<<2) /* This is a flag */
#define IEEE1284_EXT_LINK (1<<14) /* This flag causes the
* extensibility link to
* be requested, using
* bits 0-6. */
/* For the benefit of parport_read/write, you can use these with
* parport_negotiate to use address operations. They have no effect
......
......@@ -1076,8 +1076,8 @@
#define PCI_VENDOR_ID_HOLTEK 0x9412
#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
#define PCI_VENDOR_ID_EXSYS 0xd84d
#define PCI_DEVICE_ID_EXSYS_4014 0x4014
#define PCI_SUBVENDOR_ID_EXSYS 0xd84d
#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014
#define PCI_VENDOR_ID_TIGERJET 0xe159
#define PCI_DEVICE_ID_TIGERJET_300 0x0001
......
......@@ -699,6 +699,8 @@ extern void exit_fs(struct task_struct *);
extern void exit_files(struct task_struct *);
extern void exit_sighand(struct task_struct *);
extern void daemonize(void);
extern int do_execve(char *, char **, char **, struct pt_regs *);
extern int do_fork(unsigned long, unsigned long, struct pt_regs *);
......
......@@ -15,6 +15,7 @@
#include <linux/errno.h>
#include <linux/socket.h>
#include <linux/sunrpc/clnt.h>
#include <linux/spinlock.h>
#ifdef RPC_DEBUG
# define RPCDBG_FACILITY RPCDBG_AUTH
......@@ -71,6 +72,8 @@ rpcauth_destroy(struct rpc_auth *auth)
auth->au_ops->destroy(auth);
}
spinlock_t rpc_credcache_lock = SPIN_LOCK_UNLOCKED;
/*
* Initialize RPC credential cache
*/
......@@ -94,6 +97,7 @@ rpcauth_free_credcache(struct rpc_auth *auth)
if (!(destroy = auth->au_ops->crdestroy))
destroy = (void (*)(struct rpc_cred *)) rpc_free;
spin_lock(&rpc_credcache_lock);
for (i = 0; i < RPC_CREDCACHE_NR; i++) {
q = &auth->au_credcache[i];
while ((cred = *q) != NULL) {
......@@ -101,6 +105,7 @@ rpcauth_free_credcache(struct rpc_auth *auth)
destroy(cred);
}
}
spin_unlock(&rpc_credcache_lock);
}
/*
......@@ -113,6 +118,7 @@ rpcauth_gc_credcache(struct rpc_auth *auth)
int i, safe = 0;
dprintk("RPC: gc'ing RPC credentials for auth %p\n", auth);
spin_lock(&rpc_credcache_lock);
for (i = 0; i < RPC_CREDCACHE_NR; i++) {
q = &auth->au_credcache[i];
while ((cred = *q) != NULL) {
......@@ -129,6 +135,7 @@ rpcauth_gc_credcache(struct rpc_auth *auth)
q = &cred->cr_next;
}
}
spin_unlock(&rpc_credcache_lock);
while ((cred = free) != NULL) {
free = cred->cr_next;
rpc_free(cred);
......@@ -145,10 +152,12 @@ rpcauth_insert_credcache(struct rpc_auth *auth, struct rpc_cred *cred)
int nr;
nr = (cred->cr_uid % RPC_CREDCACHE_NR);
spin_lock(&rpc_credcache_lock);
cred->cr_next = auth->au_credcache[nr];
auth->au_credcache[nr] = cred;
cred->cr_expire = jiffies + auth->au_expire;
cred->cr_count++;
spin_unlock(&rpc_credcache_lock);
}
/*
......@@ -166,6 +175,7 @@ rpcauth_lookup_credcache(struct rpc_task *task)
if (time_before(auth->au_nextgc, jiffies))
rpcauth_gc_credcache(auth);
spin_lock(&rpc_credcache_lock);
q = &auth->au_credcache[nr];
while ((cred = *q) != NULL) {
if (auth->au_ops->crmatch(task, cred)) {
......@@ -174,6 +184,7 @@ rpcauth_lookup_credcache(struct rpc_task *task)
}
q = &cred->cr_next;
}
spin_unlock(&rpc_credcache_lock);
if (!cred)
cred = auth->au_ops->crcreate(task);
......@@ -194,6 +205,7 @@ rpcauth_remove_credcache(struct rpc_auth *auth, struct rpc_cred *cred)
int nr;
nr = (cred->cr_uid % RPC_CREDCACHE_NR);
spin_lock(&rpc_credcache_lock);
q = &auth->au_credcache[nr];
while ((cr = *q) != NULL) {
if (cred == cr) {
......@@ -202,6 +214,7 @@ rpcauth_remove_credcache(struct rpc_auth *auth, struct rpc_cred *cred)
}
q = &cred->cr_next;
}
spin_unlock(&rpc_credcache_lock);
}
struct rpc_cred *
......
This diff is collapsed.
......@@ -76,6 +76,9 @@
static struct rpc_xprt * sock_list = NULL;
#endif
/* Spinlock for critical sections in the code. */
spinlock_t xprt_lock = SPIN_LOCK_UNLOCKED;
#ifdef RPC_DEBUG
# undef RPC_DEBUG_DATA
# define RPCDBG_FACILITY RPCDBG_XPRT
......@@ -497,6 +500,7 @@ xprt_reconn_timeout(struct rpc_task *task)
rpc_wake_up_task(task);
}
extern spinlock_t rpc_queue_lock;
/*
* Look up the RPC request corresponding to a reply.
*/
......@@ -505,22 +509,28 @@ xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid)
{
struct rpc_task *head, *task;
struct rpc_rqst *req;
unsigned long oldflags;
int safe = 0;
spin_lock_irqsave(&rpc_queue_lock, oldflags);
if ((head = xprt->pending.task) != NULL) {
task = head;
do {
if ((req = task->tk_rqstp) && req->rq_xid == xid)
return req;
goto out;
task = task->tk_next;
if (++safe > 100) {
printk("xprt_lookup_rqst: loop in Q!\n");
return NULL;
goto out_bad;
}
} while (task != head);
}
dprintk("RPC: unknown XID %08x in reply.\n", xid);
return NULL;
out_bad:
req = NULL;
out:
spin_unlock_irqrestore(&rpc_queue_lock, oldflags);
return req;
}
/*
......@@ -1018,6 +1028,7 @@ xprt_down_transmit(struct rpc_task *task)
struct rpc_rqst *req = task->tk_rqstp;
start_bh_atomic();
spin_lock(&xprt_lock);
if (xprt->snd_task && xprt->snd_task != task) {
dprintk("RPC: %4d TCP write queue full (task %d)\n",
task->tk_pid, xprt->snd_task->tk_pid);
......@@ -1030,6 +1041,7 @@ xprt_down_transmit(struct rpc_task *task)
#endif
req->rq_bytes_sent = 0;
}
spin_unlock(&xprt_lock);
end_bh_atomic();
return xprt->snd_task == task;
}
......@@ -1132,11 +1144,12 @@ do_xprt_transmit(struct rpc_task *task)
if (status < 0)
break;
if (xprt->stream)
if (xprt->stream) {
req->rq_bytes_sent += status;
if (req->rq_bytes_sent >= req->rq_slen)
goto out_release;
if (req->rq_bytes_sent >= req->rq_slen)
goto out_release;
}
if (status < req->rq_slen)
status = -EAGAIN;
......@@ -1304,11 +1317,14 @@ xprt_reserve_status(struct rpc_task *task)
} else if (!RPCXPRT_CONGESTED(xprt) && xprt->free) {
/* OK: There's room for us. Grab a free slot and bump
* congestion value */
spin_lock(&xprt_lock);
if (!(req = xprt->free)) {
spin_unlock(&xprt_lock);
goto out_nofree;
}
xprt->free = req->rq_next;
req->rq_next = NULL;
spin_unlock(&xprt_lock);
xprt->cong += RPC_CWNDSCALE;
task->tk_rqstp = req;
xprt_request_init(task, xprt);
......@@ -1363,8 +1379,19 @@ xprt_release(struct rpc_task *task)
dprintk("RPC: %4d release request %p\n", task->tk_pid, req);
spin_lock(&xprt_lock);
req->rq_next = xprt->free;
xprt->free = req;
spin_unlock(&xprt_lock);
/* remove slot from queue of pending */
start_bh_atomic();
if (task->tk_rpcwait) {
printk("RPC: task of released request still queued!\n");
rpc_del_timer(task);
rpc_remove_wait_queue(task);
}
end_bh_atomic();
/* Decrease congestion value. */
xprt->cong -= RPC_CWNDSCALE;
......
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