Commit 93316d04 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.99pre3-6

parent 558d8e73
......@@ -1961,6 +1961,16 @@ S: Lazarettstrasse 8
S: 91054 Erlangen
S: Germany
N: Giuliano Procida
E: myxie@debian.org,gprocida@madge.com
D: Madge Ambassador driver (Collage 155 Server ATM adapter)
D: Madge Horizon driver (Collage 25 and 155 Client ATM adapters)
P: 1024/93898735 D3 9E F4 F7 6D 8D 2F 3A 38 BA 06 7C 2B 33 43 7D
S: Madge Networks
S: Framewood Road
S: Wexham SL3 6PJ
S: United Kingdom
N: Daniel Quinlan
E: quinlan@pathname.com
W: http://www.pathname.com/~quinlan/
......
......@@ -13297,7 +13297,7 @@ CONFIG_IEEE1394_OHCI1394
say M here and read Documentation/modules.txt. The module will be
called ohci1394.o.
RAW IEEE 1394 I/O support
Raw IEEE 1394 I/O support
CONFIG_IEEE1394_RAWIO
Say Y here if you want support for the raw device. This is generally
a good idea, so you should say Y here. The raw device enables
......@@ -13308,6 +13308,17 @@ CONFIG_IEEE1394_RAWIO
say M here and read Documentation/modules.txt. The module will be
called raw1394.o.
Excessive debugging output
CONFIG_IEEE1394_VERBOSEDEBUG
If you say Y here, you will get very verbose debugging logs from the
subsystem which includes a dump of the header of every sent and
received packet. This can amount to a high amount of data collected
in a very short time which is usually also saved to disk by the
system logging daemons.
Say Y if you really want or need the debugging output, everyone else
says N.
#
# m68k-specific kernel options
# Documented by Chris Lawrence <quango@themall.net> et al.
......
......@@ -495,36 +495,32 @@ S: Maintained
IEEE 1394 SUBSYSTEM
P: Andreas Bombe
M: andreas.bombe@munich.netsurf.de
L: linux1394-devel@eclipt.uni-klu.ac.at
W: http://eclipt.uni-klu.ac.at/ieee1394
L: linux1394-devel@lists.sourceforge.net
W: http://linux1394.sourceforge.net/
S: Maintained
IEEE 1394 AIC5800 DRIVER
P: Emanuel Pirker
M: epirker@edu.uni-klu.ac.at
L: linux1394-devel@eclipt.uni-klu.ac.at
W: http://eclipt.uni-klu.ac.at/ieee1394
S: Maintained
IEEE 1394 OHCI DRIVER
P: Sebastien Rougeaux
M: sebastien.rougeaux@anu.edu.au
L: linux1394-devel@eclipt.uni-klu.ac.at
W: http://eclipt.uni-klu.ac.at/ieee1394
S: Maintained
IEEE 1394 PCILYNX DRIVER
P: Andreas Bombe
M: andreas.bombe@munich.netsurf.de
L: linux1394-devel@eclipt.uni-klu.ac.at
W: http://eclipt.uni-klu.ac.at/ieee1394
S: Maintained
IEEE 1394 RAW I/O DRIVER
P: Andreas Bombe
M: andreas.bombe@munich.netsurf.de
L: linux1394-devel@eclipt.uni-klu.ac.at
W: http://eclipt.uni-klu.ac.at/ieee1394
S: Maintained
INTEL APIC/IOAPIC, LOWLEVEL X86 SMP SUPPORT
......
......@@ -146,7 +146,7 @@ DRIVERS-$(CONFIG_APPLETALK) += drivers/net/appletalk/appletalk.a
DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.a
DRIVERS-$(CONFIG_WAN) += drivers/net/wan/wan.a
DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnet.a
DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.a
DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o
DRIVERS-$(CONFIG_IDE) += drivers/ide/ide.a
DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsi.a
DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394.a
......
# $Id: Makefile,v 1.45 2000/01/29 01:08:48 anton Exp $
# $Id: Makefile,v 1.46 2000/03/21 06:12:26 davem Exp $
# sparc/Makefile
#
# Makefile for the architecture dependent flags and dependencies on the
......
# $Id: Makefile,v 1.42 2000/03/09 05:56:43 jj Exp $
# $Id: Makefile,v 1.43 2000/03/21 06:12:28 davem Exp $
# sparc64/Makefile
#
# Makefile for the architecture dependent flags and dependencies on the
......@@ -18,6 +18,8 @@ NEW_GCC := $(shell if $(CC) -m64 -mcmodel=medlow -S -o /dev/null -xc /dev/null >
NEW_GAS := $(shell if $(LD) --version 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi)
UNDECLARED_REGS := $(shell if $(CC) -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null; then echo y; else echo n; fi; )
export NEW_GCC
ifneq ($(NEW_GAS),y)
AS = sparc64-linux-as
LD = sparc64-linux-ld
......
# $Id: Makefile,v 1.51 2000/02/08 05:11:31 jj Exp $
# $Id: Makefile,v 1.52 2000/03/19 07:00:29 ecd Exp $
# Makefile for the linux kernel.
#
# Note! Dependencies are done automagically by 'make dep', which also
......@@ -61,7 +61,7 @@ head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \
#
binfmt_elf32.o: $(TOPDIR)/fs/binfmt_elf.c
ifneq ($(IS_EGCS),y)
ifneq ($(NEW_GCC),y)
CMODEL_CFLAG := -mmedlow
else
CMODEL_CFLAG := -mcmodel=medlow
......
/* $Id: ioctl32.c,v 1.83 2000/03/14 07:31:25 jj Exp $
/* $Id: ioctl32.c,v 1.84 2000/03/21 21:19:18 davem Exp $
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
*
* Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
......@@ -1803,6 +1803,8 @@ struct atm_iobuf32 {
#define ATM_SETESIF32 _IOW('a', ATMIOC_ITF+13, struct atmif_sioc32)
#define ATM_GETSTAT32 _IOW('a', ATMIOC_SARCOM+0, struct atmif_sioc32)
#define ATM_GETSTATZ32 _IOW('a', ATMIOC_SARCOM+1, struct atmif_sioc32)
#define ATM_GETLOOP32 _IOW('a', ATMIOC_SARCOM+2, struct atmif_sioc32)
#define ATM_SETLOOP32 _IOW('a', ATMIOC_SARCOM+3, struct atmif_sioc32)
static struct {
unsigned int cmd32;
......@@ -1821,7 +1823,9 @@ static struct {
{ ATM_SETESI32, ATM_SETESI },
{ ATM_SETESIF32, ATM_SETESIF },
{ ATM_GETSTAT32, ATM_GETSTAT },
{ ATM_GETSTATZ32, ATM_GETSTATZ }
{ ATM_GETSTATZ32, ATM_GETSTATZ },
{ ATM_GETLOOP32, ATM_GETLOOP },
{ ATM_SETLOOP32, ATM_SETLOOP }
};
#define NR_ATM_IOCTL (sizeof(atm_ioctl_map)/sizeof(atm_ioctl_map[0]))
......@@ -1941,8 +1945,6 @@ static int do_atm_ioctl(unsigned int fd, unsigned int cmd32, unsigned long arg)
unsigned int cmd = 0;
switch (cmd32) {
case SUNI_GETLOOP:
case SUNI_SETLOOP:
case SONET_GETSTAT:
case SONET_GETSTATZ:
case SONET_GETDIAG:
......@@ -1954,7 +1956,6 @@ static int do_atm_ioctl(unsigned int fd, unsigned int cmd32, unsigned long arg)
return do_atmif_sioc(fd, cmd32, arg);
}
if (cmd == 0) {
for (i = 0; i < NR_ATM_IOCTL; i++) {
if (cmd32 == atm_ioctl_map[i].cmd32) {
cmd = atm_ioctl_map[i].cmd;
......@@ -1964,7 +1965,6 @@ static int do_atm_ioctl(unsigned int fd, unsigned int cmd32, unsigned long arg)
if (i == NR_ATM_IOCTL) {
return -EINVAL;
}
}
switch (cmd) {
case ATM_GETNAMES:
......@@ -1983,6 +1983,8 @@ static int do_atm_ioctl(unsigned int fd, unsigned int cmd32, unsigned long arg)
case ATM_SETESIF:
case ATM_GETSTAT:
case ATM_GETSTATZ:
case ATM_GETLOOP:
case ATM_SETLOOP:
return do_atmif_sioc(fd, cmd, arg);
}
......@@ -3076,8 +3078,8 @@ HANDLE_IOCTL(ATM_SETESI32, do_atm_ioctl)
HANDLE_IOCTL(ATM_SETESIF32, do_atm_ioctl)
HANDLE_IOCTL(ATM_GETSTAT32, do_atm_ioctl)
HANDLE_IOCTL(ATM_GETSTATZ32, do_atm_ioctl)
HANDLE_IOCTL(SUNI_GETLOOP, do_atm_ioctl)
HANDLE_IOCTL(SUNI_SETLOOP, do_atm_ioctl)
HANDLE_IOCTL(ATM_GETLOOP32, do_atm_ioctl)
HANDLE_IOCTL(ATM_SETLOOP32, do_atm_ioctl)
HANDLE_IOCTL(SONET_GETSTAT, do_atm_ioctl)
HANDLE_IOCTL(SONET_GETSTATZ, do_atm_ioctl)
HANDLE_IOCTL(SONET_GETDIAG, do_atm_ioctl)
......
/* $Id: sys_sparc32.c,v 1.139 2000/03/16 20:37:57 davem Exp $
/* $Id: sys_sparc32.c,v 1.140 2000/03/22 02:44:35 davem Exp $
* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
......@@ -3634,7 +3634,7 @@ struct nfsctl_arg32 {
union nfsctl_res32 {
__u8 cr32_getfh[NFS_FHSIZE];
u32 cr32_debug;
struct knfsd_fh cr32_getfs;
};
static int nfs_svc32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
......@@ -3760,15 +3760,12 @@ static int nfs_getfh32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32
return err;
}
/* This really doesn't need translations, we are only passing
* back a union which contains opaque nfs file handle data.
*/
static int nfs_getfh32_res_trans(union nfsctl_res *kres, union nfsctl_res32 *res32)
{
int err;
err = copy_to_user(&res32->cr32_getfh,
&kres->cr_getfh,
sizeof(res32->cr32_getfh));
err |= __put_user(kres->cr_debug, &res32->cr32_debug);
return err;
return copy_to_user(res32, kres, sizeof(*res32));
}
extern asmlinkage int sys_nfsservctl(int cmd, void *arg, void *resp);
......
......@@ -3,15 +3,15 @@
# Makefile for the Linux network (ATM) device drivers.
#
L_TARGET := atm.a
L_OBJS := atmdev_init.o
O_TARGET := atm.o
O_OBJS := atmdev_init.o
M_OBJS :=
MOD_LIST_NAME := ATM_MODULES
include ../../.config
ifeq ($(CONFIG_ATM_ENI),y)
L_OBJS += eni.o
O_OBJS += eni.o
NEED_SUNI_LX = suni.o
else
ifeq ($(CONFIG_ATM_ENI),m)
......@@ -21,8 +21,8 @@ else
endif
ifeq ($(CONFIG_ATM_ZATM),y)
L_OBJS += zatm.o
LX_OBJS += uPD98402.o
O_OBJS += zatm.o
OX_OBJS += uPD98402.o
else
ifeq ($(CONFIG_ATM_ZATM),m)
M_OBJS += zatm.o
......@@ -31,11 +31,11 @@ else
endif
ifeq ($(CONFIG_ATM_TNETA1570),y)
L_OBJS += tneta1570.o suni.o
O_OBJS += tneta1570.o suni.o
endif
ifeq ($(CONFIG_ATM_NICSTAR),y)
L_OBJS += nicstar.o
O_OBJS += nicstar.o
ifeq ($(CONFIG_ATM_NICSTAR_USE_SUNI),y)
NEED_SUNI_LX = suni.o
endif
......@@ -55,7 +55,7 @@ else
endif
ifeq ($(CONFIG_ATM_HORIZON),y)
L_OBJS += horizon.o
O_OBJS += horizon.o
else
ifeq ($(CONFIG_ATM_HORIZON),m)
M_OBJS += horizon.o
......@@ -63,7 +63,7 @@ else
endif
ifeq ($(CONFIG_ATM_AMBASSADOR),y)
L_OBJS += ambassador.o
O_OBJS += ambassador.o
else
ifeq ($(CONFIG_ATM_AMBASSADOR),m)
M_OBJS += ambassador.o
......@@ -71,7 +71,7 @@ else
endif
ifeq ($(CONFIG_ATM_TCP),y)
L_OBJS += atmtcp.o
O_OBJS += atmtcp.o
else
ifeq ($(CONFIG_ATM_TCP),m)
M_OBJS += atmtcp.o
......@@ -79,7 +79,7 @@ else
endif
ifeq ($(CONFIG_ATM_IA),y)
L_OBJS += iphase.o
O_OBJS += iphase.o
NEED_SUNI_LX = suni.o
else
ifeq ($(CONFIG_ATM_IA),m)
......@@ -91,13 +91,13 @@ endif
ifeq ($(NEED_SUNI_LX),)
MX_OBJS += $(NEED_SUNI_MX)
else
LX_OBJS += $(NEED_SUNI_LX)
OX_OBJS += $(NEED_SUNI_LX)
endif
ifeq ($(NEED_IDT77105_LX),)
MX_OBJS += $(NEED_IDT77105_MX)
else
LX_OBJS += $(NEED_IDT77105_LX)
OX_OBJS += $(NEED_IDT77105_LX)
endif
ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
......@@ -114,7 +114,7 @@ FORE200E_FW_OBJS += fore200e_sba_fw.o
endif
endif
ifeq ($(CONFIG_ATM_FORE200E),y)
L_OBJS += fore200e.o $(FORE200E_FW_OBJS)
O_OBJS += fore200e.o $(FORE200E_FW_OBJS)
else
ifeq ($(CONFIG_ATM_FORE200E),m)
M_OBJS += fore_200e.o
......
This diff is collapsed.
......@@ -237,8 +237,6 @@
#define FP_155_RATE 0x24b1
#define FP_25_RATE 0x1f9d
#define AMB_RESET 0x40
/* #define VERSION_NUMBER 0x01000000 // initial release */
/* #define VERSION_NUMBER 0x01010000 // fixed startup probs PLX MB0 not cleared */
/* #define VERSION_NUMBER 0x01020000 // changed SUNI reset timings; allowed r/w onchip */
......@@ -333,9 +331,10 @@ typedef struct {
u32 reset_control;
} amb_mem;
/* IRQ (card to host) and doorbell (host to card) enable bits */
#define AMB_INTERRUPT_BITS 0x00030000
#define AMB_DOORBELL_BITS 0x00000300
/* RESET bit, IRQ (card to host) and doorbell (host to card) enable bits */
#define AMB_RESET_BITS 0x40000000
#define AMB_INTERRUPT_BITS 0x00000300
#define AMB_DOORBELL_BITS 0x00030000
/* loader commands */
......@@ -543,14 +542,19 @@ typedef enum {
( (current)+1 < (limit) ? (current)+1 : (start) )
typedef struct {
spinlock_t lock;
unsigned int pending;
unsigned int high;
unsigned int maximum; // size - 1 (q implementation)
command * start;
command * in;
command * out;
command * limit;
} amb_cq_ptrs;
typedef struct {
spinlock_t lock;
unsigned int pending;
unsigned int high;
unsigned int filled;
unsigned int maximum; // size - 1 (q implementation)
amb_cq_ptrs ptrs;
} amb_cq;
typedef struct {
......
......@@ -39,7 +39,7 @@ int __init atmdev_init(void)
devs = 0;
#ifdef CONFIG_ATM_ENI
devs += eni_detect();
// devs += eni_detect();
#endif
#ifdef CONFIG_ATM_ZATM
devs += zatm_detect();
......
......@@ -7,7 +7,9 @@
#include <linux/wait.h>
#include <linux/atmdev.h>
#include <linux/atm_tcp.h>
#include <linux/bitops.h>
#include <asm/uaccess.h>
#include <asm/atomic.h>
extern int atm_init_aal5(struct atm_vcc *vcc); /* "raw" AAL5 transport */
......@@ -36,12 +38,14 @@ struct atmtcp_dev_data {
static int atmtcp_send_control(struct atm_vcc *vcc,int type,
const struct atmtcp_control *msg,unsigned short flag)
const struct atmtcp_control *msg,int flag)
{
DECLARE_WAITQUEUE(wait,current);
struct atm_vcc *out_vcc;
struct sk_buff *skb;
struct atmtcp_control *new_msg;
unsigned short old_flags;
int old_test;
int error = 0;
out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL;
if (!out_vcc) return -EUNATCH;
......@@ -60,16 +64,21 @@ static int atmtcp_send_control(struct atm_vcc *vcc,int type,
new_msg->type = type;
memset(&new_msg->vcc,0,sizeof(atm_kptr_t));
*(struct atm_vcc **) &new_msg->vcc = vcc;
old_flags = vcc->flags;
old_test = test_bit(flag,&vcc->flags);
out_vcc->push(out_vcc,skb);
while (!((vcc->flags ^ old_flags) & flag)) {
add_wait_queue(&vcc->sleep,&wait);
while (test_bit(flag,&vcc->flags) == old_test) {
mb();
out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL;
if (!out_vcc) return -EUNATCH;
sleep_on(&vcc->sleep);
if (!out_vcc) {
error = -EUNATCH;
break;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule();
}
return 0;
remove_wait_queue(&vcc->sleep,&wait);
return error;
}
......@@ -83,10 +92,10 @@ static int atmtcp_recv_control(const struct atmtcp_control *msg)
vcc->reply = msg->result;
switch (msg->type) {
case ATMTCP_CTRL_OPEN:
vcc->flags ^= ATM_VF_READY;
change_bit(ATM_VF_READY,&vcc->flags);
break;
case ATMTCP_CTRL_CLOSE:
vcc->flags ^= ATM_VF_ADDR;
change_bit(ATM_VF_ADDR,&vcc->flags);
break;
default:
printk(KERN_ERR "atmtcp_recv_control: unknown type %d\n",
......@@ -120,8 +129,8 @@ static int atmtcp_v_open(struct atm_vcc *vcc,short vpi,int vci)
if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) return 0;
msg.type = ATMTCP_CTRL_OPEN;
msg.qos = vcc->qos;
vcc->flags |= ATM_VF_ADDR;
vcc->flags &= ~ATM_VF_READY; /* just in case ... */
set_bit(ATM_VF_ADDR,&vcc->flags);
clear_bit(ATM_VF_READY,&vcc->flags); /* just in case ... */
error = atmtcp_send_control(vcc,ATMTCP_CTRL_OPEN,&msg,ATM_VF_READY);
if (error) return error;
return vcc->reply;
......@@ -136,7 +145,7 @@ static void atmtcp_v_close(struct atm_vcc *vcc)
msg.addr.sap_family = AF_ATMPVC;
msg.addr.sap_addr.vpi = vcc->vpi;
msg.addr.sap_addr.vci = vcc->vci;
vcc->flags &= ~ATM_VF_READY;
clear_bit(ATM_VF_READY,&vcc->flags);
(void) atmtcp_send_control(vcc,ATMTCP_CTRL_CLOSE,&msg,ATM_VF_ADDR);
}
......@@ -168,13 +177,18 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
struct atmtcp_hdr *hdr;
int size;
if (vcc->qos.txtp.traffic_class == ATM_NONE) {
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb(skb);
return -EINVAL;
}
dev_data = PRIV(vcc->dev);
if (dev_data) out_vcc = dev_data->vcc;
if (!dev_data || !out_vcc) {
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb(skb);
if (dev_data) return 0;
vcc->stats->tx_err++;
atomic_inc(&vcc->stats->tx_err);
return -ENOLINK;
}
size = skb->len+sizeof(struct atmtcp_hdr);
......@@ -182,7 +196,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
if (!new_skb) {
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb(skb);
vcc->stats->tx_err++;
atomic_inc(&vcc->stats->tx_err);
return -ENOBUFS;
}
hdr = (void *) skb_put(new_skb,sizeof(struct atmtcp_hdr));
......@@ -193,8 +207,8 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb(skb);
out_vcc->push(out_vcc,new_skb);
vcc->stats->tx++;
out_vcc->stats->rx++;
atomic_inc(&vcc->stats->tx);
atomic_inc(&out_vcc->stats->rx);
return 0;
}
......@@ -251,7 +265,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
out_vcc->qos.rxtp.traffic_class != ATM_NONE)
break;
if (!out_vcc) {
vcc->stats->tx_err++;
atomic_inc(&vcc->stats->tx_err);
goto done;
}
skb_pull(skb,sizeof(struct atmtcp_hdr));
......@@ -263,8 +277,8 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
new_skb->stamp = xtime;
memcpy(skb_put(new_skb,skb->len),skb->data,skb->len);
out_vcc->push(out_vcc,new_skb);
vcc->stats->tx++;
out_vcc->stats->rx++;
atomic_inc(&vcc->stats->tx);
atomic_inc(&out_vcc->stats->rx);
done:
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb(skb);
......@@ -305,7 +319,7 @@ static struct atm_dev atmtcp_control_dev = {
999, /* dummy device number */
NULL,NULL, /* pretend not to have any VCCs */
NULL,NULL, /* no data */
0, /* no flags */
{ 0 }, /* no flags */
NULL, /* no local address */
{ 0 } /* no ESI, no statistics */
};
......@@ -318,7 +332,7 @@ static int atmtcp_create(int itf,int persist,struct atm_dev **result)
dev_data = kmalloc(sizeof(*dev_data),GFP_KERNEL);
if (!dev_data) return -ENOMEM;
dev = atm_dev_register(DEV_LABEL,&atmtcp_v_dev_ops,itf,0);
dev = atm_dev_register(DEV_LABEL,&atmtcp_v_dev_ops,itf,NULL);
if (!dev) {
kfree(dev_data);
return itf == -1 ? -ENOMEM : -EBUSY;
......@@ -352,7 +366,8 @@ int atmtcp_attach(struct atm_vcc *vcc,int itf)
}
PRIV(dev)->vcc = vcc;
bind_vcc(vcc,&atmtcp_control_dev);
vcc->flags |= ATM_VF_READY | ATM_VF_META;
set_bit(ATM_VF_META,&vcc->flags);
set_bit(ATM_VF_READY,&vcc->flags);
vcc->dev_data = dev;
(void) atm_init_aal5(vcc); /* @@@ losing AAL in transit ... */
vcc->stats = &atmtcp_control_dev.stats.aal5;
......
This diff is collapsed.
......@@ -12,6 +12,7 @@
#include <linux/skbuff.h>
#include <linux/time.h>
#include <linux/pci.h>
#include <linux/spinlock.h>
#include "midway.h"
......@@ -65,6 +66,8 @@ struct eni_vcc {
};
struct eni_dev {
/*-------------------------------- spinlock */
spinlock_t lock; /* sync with interrupt */
/*-------------------------------- base pointers into Midway address
space */
unsigned long phy; /* PHY interface chip registers */
......
This diff is collapsed.
......@@ -559,6 +559,7 @@ typedef struct chunk {
void* alloc_addr; /* base address of allocated chunk */
void* align_addr; /* base address of aligned chunk */
u32 dma_addr; /* DMA address of aligned chunk */
int direction; /* direction of DMA mapping */
u32 alloc_size; /* length of allocated chunk */
u32 align_size; /* length of aligned chunk */
} chunk_t;
......@@ -796,9 +797,9 @@ typedef struct fore200e_bus {
const unsigned int* fw_size; /* address of firmware data size */
u32 (*read)(volatile u32*);
void (*write)(u32, volatile u32*);
u32 (*dma_map)(struct fore200e*, void*, int);
void (*dma_unmap)(struct fore200e*, u32, int);
void (*dma_sync)(struct fore200e*, u32, int);
u32 (*dma_map)(struct fore200e*, void*, int, int);
void (*dma_unmap)(struct fore200e*, u32, int, int);
void (*dma_sync)(struct fore200e*, u32, int, int);
int (*dma_chunk_alloc)(struct fore200e*, struct chunk*, int, int, int);
void (*dma_chunk_free)(struct fore200e*, struct chunk*);
struct fore200e* (*detect)(const struct fore200e_bus*, int);
......@@ -814,6 +815,31 @@ typedef struct fore200e_bus {
} fore200e_bus_t;
#if defined(CONFIG_ATM_FORE200E_SBA)
# if defined(CONFIG_ATM_FORE200E_PCA)
# if (PCI_DMA_BIDIRECTIONAL == SBUS_DMA_BIDIRECTIONAL) && \
(PCI_DMA_TODEVICE == SBUS_DMA_TODEVICE) && \
(PCI_DMA_FROMDEVICE == SBUS_DMA_FROMDEVICE)
# define FORE200E_DMA_BIDIRECTIONAL PCI_DMA_BIDIRECTIONAL
# define FORE200E_DMA_TODEVICE PCI_DMA_TODEVICE
# define FORE200E_DMA_FROMDEVICE PCI_DMA_FROMDEVICE
# else
/* in that case, we'll need to add an extra indirection, e.g.
fore200e->bus->dma_direction[ fore200e_dma_direction ] */
# error PCI and SBUS DMA direction flags differ!
# endif
# else
# define FORE200E_DMA_BIDIRECTIONAL SBA_DMA_BIDIRECTIONAL
# define FORE200E_DMA_TODEVICE SBA_DMA_TODEVICE
# define FORE200E_DMA_FROMDEVICE SBA_DMA_FROMDEVICE
# endif
#else
# define FORE200E_DMA_BIDIRECTIONAL PCI_DMA_BIDIRECTIONAL
# define FORE200E_DMA_TODEVICE PCI_DMA_TODEVICE
# define FORE200E_DMA_FROMDEVICE PCI_DMA_FROMDEVICE
#endif
/* per-device data */
typedef struct fore200e {
......
......@@ -42,6 +42,7 @@
#include <asm/system.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
#include <asm/string.h>
#include <asm/byteorder.h>
......@@ -50,7 +51,7 @@
#define maintainer_string "Giuliano Procida at Madge Networks <gprocida@madge.com>"
#define description_string "Madge ATM Horizon [Ultra] driver"
#define version_string "1.2"
#define version_string "1.2.1"
static inline void __init show_version (void) {
printk ("%s version %s\n", description_string, version_string);
......@@ -246,7 +247,7 @@ static inline void __init show_version (void) {
Atomic test and set tx_busy until we succeed; we should implement
some sort of timeout so that tx_busy will never be stuck at true.
If no TX channel is setup for this VC we wait for an idle one (if
If no TX channel is set up for this VC we wait for an idle one (if
necessary) and set it up.
At this point we have a TX channel ready for use. We wait for enough
......@@ -276,7 +277,7 @@ static inline void __init show_version (void) {
available handler is locked out over the same period.
Data available on the card triggers an interrupt. If the data is not
suitable for out existing RX channels or we cannot allocate a buffer
suitable for our existing RX channels or we cannot allocate a buffer
it is flushed. Otherwise an RX receive is scheduled. Multiple RX
transfers may be scheduled for the same frame.
......@@ -321,7 +322,7 @@ static inline void __init show_version (void) {
and the frame continues to be received.
The solution is to make sure any received frames are flushed when
ready. This is currently done just before the solution to 3.
ready. This is currently done just before the solution to 2.
4. PCI bus (original Horizon only, fixed in Ultra)
......@@ -608,7 +609,7 @@ static int make_rate (const hrz_dev * dev, u32 c, rounding r,
u32 pre;
// local fn to build the timer bits
inline int set_cr (void) {
int set_cr (void) {
// paranoia
if (div > CR_MAXD || (!pre) || pre > 1<<CR_MAXPEXP) {
PRINTD (DBG_QOS, "set_cr internal failure: d=%u p=%u",
......@@ -813,7 +814,7 @@ static inline void hrz_kfree_skb (struct sk_buff * skb) {
if (ATM_SKB(skb)->vcc->pop) {
ATM_SKB(skb)->vcc->pop (ATM_SKB(skb)->vcc, skb);
} else {
dev_kfree_skb (skb);
dev_kfree_skb_any (skb);
}
}
......@@ -961,12 +962,11 @@ static void hrz_close_rx (hrz_dev * dev, u16 vc) {
static void rx_schedule (hrz_dev * dev, int irq) {
unsigned int rx_bytes;
int pio_instead;
int pio_instead = 0;
#ifndef TAILRECURSIONWORKS
do {
pio_instead = 1;
while (pio_instead) {
#endif
pio_instead = 0;
// bytes waiting for RX transfer
rx_bytes = dev->rx_bytes;
......@@ -1047,7 +1047,7 @@ static void rx_schedule (hrz_dev * dev, int irq) {
{
struct atm_vcc * vcc = ATM_SKB(skb)->vcc;
// VC layer stats
vcc->stats->rx++;
atomic_inc(&vcc->stats->rx);
skb->stamp = xtime;
// end of our responsability
vcc->push (vcc, skb);
......@@ -1078,12 +1078,12 @@ static void rx_schedule (hrz_dev * dev, int irq) {
#ifdef TAILRECURSIONWORKS
// and we all bless optimised tail calls
if (pio_instead)
rx_schedule (dev, 0);
return rx_schedule (dev, 0);
return;
#else
// grrrrrrr!
irq = 0;
} while (pio_instead);
}
return;
#endif
}
......@@ -1130,11 +1130,11 @@ static void tx_schedule (hrz_dev * const dev, int irq) {
int append_desc = 0;
int pio_instead;
int pio_instead = 0;
#ifndef TAILRECURSIONWORKS
do {
pio_instead = 1;
while (pio_instead) {
#endif
pio_instead = 0;
// bytes in current region waiting for TX transfer
tx_bytes = dev->tx_bytes;
......@@ -1201,7 +1201,7 @@ static void tx_schedule (hrz_dev * const dev, int irq) {
dev->tx_iovec = 0;
// VC layer stats
ATM_SKB(skb)->vcc->stats->tx++;
atomic_inc(&ATM_SKB(skb)->vcc->stats->tx);
// free the skb
hrz_kfree_skb (skb);
......@@ -1236,12 +1236,12 @@ static void tx_schedule (hrz_dev * const dev, int irq) {
#ifdef TAILRECURSIONWORKS
// and we all bless optimised tail calls
if (pio_instead)
tx_schedule (dev, 0);
return tx_schedule (dev, 0);
return;
#else
// grrrrrrr!
irq = 0;
} while (pio_instead);
}
return;
#endif
}
......@@ -1340,37 +1340,33 @@ static inline void rx_data_av_handler (hrz_dev * dev) {
if (atm_vcc->qos.rxtp.traffic_class != ATM_NONE) {
if (rx_len <= atm_vcc->qos.rxtp.max_sdu) {
struct sk_buff *skb = atm_alloc_charge(atm_vcc,rx_len,GFP_ATOMIC);
// If everyone has to call atm_pdu2... why isn't it part of
// atm_charge? B'cos some people already have skb->truesize!
// WA: well. even if they think they do, they might not ... :-)
if (skb) {
// remember this so we can push it later
dev->rx_skb = skb;
// remember this so we can flush it later
dev->rx_channel = rx_channel;
// prepare socket buffer
skb_put (skb, rx_len);
ATM_SKB(skb)->vcc = atm_vcc;
// simple transfer
// dev->rx_regions = 0;
// dev->rx_iovec = 0;
dev->rx_bytes = rx_len;
dev->rx_addr = skb->data;
PRINTD (DBG_RX, "RX start simple transfer (addr %p, len %d)",
skb->data, rx_len);
// do the business
rx_schedule (dev, 0);
return;
} else {
PRINTD (DBG_INFO, "failed to get skb");
}
struct sk_buff * skb = atm_alloc_charge (atm_vcc, rx_len, GFP_ATOMIC);
if (skb) {
// remember this so we can push it later
dev->rx_skb = skb;
// remember this so we can flush it later
dev->rx_channel = rx_channel;
// prepare socket buffer
skb_put (skb, rx_len);
ATM_SKB(skb)->vcc = atm_vcc;
// simple transfer
// dev->rx_regions = 0;
// dev->rx_iovec = 0;
dev->rx_bytes = rx_len;
dev->rx_addr = skb->data;
PRINTD (DBG_RX, "RX start simple transfer (addr %p, len %d)",
skb->data, rx_len);
// do the business
rx_schedule (dev, 0);
return;
} else {
PRINTD (DBG_SKB|DBG_WARN, "failed to get skb");
}
} else {
PRINTK (KERN_INFO, "frame received on TX-only VC %x", rx_channel);
......@@ -1662,6 +1658,7 @@ static int hrz_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
if (!channel) {
PRINTD (DBG_ERR|DBG_TX, "attempt to transmit on zero (rx_)channel");
hrz_kfree_skb (skb);
return -EIO;
}
......@@ -1699,9 +1696,11 @@ static int hrz_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
#endif
// wait until TX is free and grab lock
if (tx_hold (dev))
if (tx_hold (dev)) {
hrz_kfree_skb (skb);
return -ERESTARTSYS;
}
// Wait for enough space to be available in transmit buffer memory.
// should be number of cells needed + 2 (according to hardware docs)
......@@ -1722,6 +1721,7 @@ static int hrz_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
PRINTD (DBG_TX|DBG_ERR, "spun out waiting for tx buffers, got %d of %d",
free_buffers, buffers_required);
tx_release (dev);
hrz_kfree_skb (skb);
return -ERESTARTSYS;
}
}
......@@ -1820,12 +1820,12 @@ static u16 __init read_bia (const hrz_dev * dev, u16 addr) {
u32 ctrl = rd_regl (dev, CONTROL_0_REG);
inline void WRITE_IT_WAIT (void) {
void WRITE_IT_WAIT (void) {
wr_regl (dev, CONTROL_0_REG, ctrl);
udelay (5);
}
inline void CLOCK_IT (void) {
void CLOCK_IT (void) {
// DI must be valid around rising SK edge
ctrl &= ~SEEPROM_SK;
WRITE_IT_WAIT();
......@@ -2530,7 +2530,7 @@ static int hrz_open (struct atm_vcc * atm_vcc, short vpi, int vci) {
// this is "immediately before allocating the connection identifier
// in hardware" - so long as the next call does not fail :)
atm_vcc->flags |= ATM_VF_ADDR;
set_bit(ATM_VF_ADDR,&atm_vcc->flags);
// any errors here are very serious and should never occur
......@@ -2554,7 +2554,7 @@ static int hrz_open (struct atm_vcc * atm_vcc, short vpi, int vci) {
atm_vcc->dev_data = (void *) vccp;
// indicate readiness
atm_vcc->flags |= ATM_VF_READY;
set_bit(ATM_VF_READY,&atm_vcc->flags);
MOD_INC_USE_COUNT;
return 0;
......@@ -2569,7 +2569,7 @@ static void hrz_close (struct atm_vcc * atm_vcc) {
PRINTD (DBG_VCC|DBG_FLOW, "hrz_close");
// indicate unreadiness
atm_vcc->flags &= ~ATM_VF_READY;
clear_bit(ATM_VF_READY,&atm_vcc->flags);
if (atm_vcc->qos.txtp.traffic_class != ATM_NONE) {
unsigned int i;
......@@ -2611,7 +2611,7 @@ static void hrz_close (struct atm_vcc * atm_vcc) {
// free our structure
kfree (vcc);
// say the VPI/VCI is free again
atm_vcc->flags &= ~ATM_VF_ADDR;
clear_bit(ATM_VF_ADDR,&atm_vcc->flags);
MOD_DEC_USE_COUNT;
}
......@@ -2758,13 +2758,13 @@ static int __init hrz_probe (void) {
devs = 0;
pci_dev = NULL;
while ((pci_dev = pci_find_device
(PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_HORIZON, pci_dev)
)) {
(PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_HORIZON, pci_dev)
)) {
hrz_dev * dev;
// adapter slot free, read resources from PCI configuration space
u32 iobase = pci_dev->resource[0].start;
u32 * membase = bus_to_virt(pci_dev->resource[1].start);
u32 * membase = bus_to_virt (pci_dev->resource[1].start);
u8 irq = pci_dev->irq;
// check IO region
......@@ -2795,7 +2795,7 @@ static int __init hrz_probe (void) {
PRINTD (DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p",
iobase, irq, membase);
dev->atm_dev = atm_dev_register (DEV_LABEL, &hrz_ops, -1, 0);
dev->atm_dev = atm_dev_register (DEV_LABEL, &hrz_ops, -1, NULL);
if (!(dev->atm_dev)) {
PRINTD (DBG_ERR, "failed to register Madge ATM adapter");
} else {
......
......@@ -31,10 +31,8 @@
#define DRIVER_ATM_HORIZON_H
#include <linux/config.h>
#include <linux/version.h>
#ifdef CONFIG_ATM_HORIZON_DEBUG
#define DEBUG_HORIZON
#endif
......
......@@ -157,36 +157,54 @@ static int fetch_stats(struct atm_dev *dev,struct idt77105_stats *arg,int zero)
}
static int set_loopback(struct atm_dev *dev,int mode)
{
int diag;
diag = GET(DIAG) & ~IDT77105_DIAG_LCMASK;
switch (mode) {
case ATM_LM_NONE:
break;
case ATM_LM_LOC_ATM:
diag |= IDT77105_DIAG_LC_PHY_LOOPBACK;
break;
case ATM_LM_RMT_ATM:
diag |= IDT77105_DIAG_LC_LINE_LOOPBACK;
break;
default:
return -EINVAL;
}
PUT(diag,DIAG);
printk(KERN_NOTICE "%s(%d) Loopback mode is: %s\n", dev->type,
dev->number,
(mode == ATM_LM_NONE ? "NONE" :
(mode == ATM_LM_LOC_ATM ? "DIAG (local)" :
(mode == IDT77105_DIAG_LC_LINE_LOOPBACK ? "LOOP (remote)" :
"unknown")))
);
PRIV(dev)->loop_mode = mode;
return 0;
}
static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
{
printk(KERN_NOTICE "%s(%d) idt77105_ioctl() called\n",dev->type,dev->number);
switch (cmd) {
case IDT77105_GETSTATZ:
if (!capable(CAP_NET_ADMIN)) return -EPERM;
/* fall through */
case IDT77105_GETSTAT:
return fetch_stats(dev,(struct idt77105_stats *) arg,
cmd == IDT77105_GETSTATZ);
case IDT77105_SETLOOP:
if (!capable(CAP_NET_ADMIN)) return -EPERM;
if ((int) arg < 0 || (int) arg > IDT77105_LM_LOOP)
return -EINVAL;
PUT((GET(DIAG) & ~IDT77105_DIAG_LCMASK) |
((int) arg == IDT77105_LM_NONE ? IDT77105_DIAG_LC_NORMAL : 0) |
((int) arg == IDT77105_LM_DIAG ? IDT77105_DIAG_LC_PHY_LOOPBACK : 0) |
((int) arg == IDT77105_LM_LOOP ? IDT77105_DIAG_LC_LINE_LOOPBACK : 0),
DIAG);
printk(KERN_NOTICE "%s(%d) Loopback mode is: %s\n",
dev->type, dev->number,
((int) arg == IDT77105_LM_NONE ? "NONE" :
((int) arg == IDT77105_LM_DIAG ? "DIAG (local)" :
((int) arg == IDT77105_LM_LOOP ? "LOOP (remote)" :
"unknown")))
);
PRIV(dev)->loop_mode = (int) arg;
return 0;
case IDT77105_GETLOOP:
case ATM_SETLOOP:
return set_loopback(dev,(int) (long) arg);
case ATM_GETLOOP:
return put_user(PRIV(dev)->loop_mode,(int *) arg) ?
-EFAULT : sizeof(int);
-EFAULT : 0;
case ATM_QUERYLOOP:
return put_user(ATM_LM_LOC_ATM | ATM_LM_RMT_ATM,
(int *) arg) ? -EFAULT : 0;
default:
return -ENOIOCTLCMD;
}
......@@ -266,13 +284,13 @@ static int idt77105_start(struct atm_dev *dev)
/* initialise loop mode from hardware */
switch ( GET(DIAG) & IDT77105_DIAG_LCMASK ) {
case IDT77105_DIAG_LC_NORMAL:
PRIV(dev)->loop_mode = IDT77105_LM_NONE;
PRIV(dev)->loop_mode = ATM_LM_NONE;
break;
case IDT77105_DIAG_LC_PHY_LOOPBACK:
PRIV(dev)->loop_mode = IDT77105_LM_DIAG;
PRIV(dev)->loop_mode = ATM_LM_LOC_ATM;
break;
case IDT77105_DIAG_LC_LINE_LOOPBACK:
PRIV(dev)->loop_mode = IDT77105_LM_LOOP;
PRIV(dev)->loop_mode = ATM_LM_RMT_ATM;
break;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -100,8 +100,6 @@
#define NS_IOREMAP_SIZE 4096
#define IDT_25_PCR ((25600000 / 8 - 8000) / 54)
#define BUF_SM 0x00000000 /* These two are used for push_rxbufs() */
#define BUF_LG 0x00000001 /* CMD, Write_FreeBufQ, LBUF bit */
......
/* drivers/atm/suni.c - PMC SUNI (PHY) driver */
/* drivers/atm/suni.c - PMC PM5346 SUNI (PHY) driver */
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
......@@ -18,6 +18,7 @@
#include <asm/system.h>
#include <asm/param.h>
#include <asm/uaccess.h>
#include <asm/atomic.h>
#include "suni.h"
......@@ -30,8 +31,8 @@
struct suni_priv {
struct sonet_stats sonet_stats; /* link diagnostics */
unsigned char loop_mode; /* loopback mode */
struct k_sonet_stats sonet_stats; /* link diagnostics */
int loop_mode; /* loopback mode */
struct atm_dev *dev; /* device back-pointer */
struct suni_priv *next; /* next SUNI */
};
......@@ -46,69 +47,62 @@ struct suni_priv {
static struct timer_list poll_timer;
static int start_timer = 1;
static struct suni_priv *sunis = NULL;
static spinlock_t sunis_lock = SPIN_LOCK_UNLOCKED;
static void suni_hz(unsigned long dummy)
#define ADD_LIMITED(s,v) \
atomic_add((v),&stats->s); \
if (atomic_read(&stats->s) < 0) atomic_set(&stats->s,INT_MAX);
static void suni_hz(unsigned long from_timer)
{
struct suni_priv *walk;
struct atm_dev *dev;
struct sonet_stats *stats;
struct k_sonet_stats *stats;
for (walk = sunis; walk; walk = walk->next) {
dev = walk->dev;
stats = &walk->sonet_stats;
PUT(0,MRI); /* latch counters */
udelay(1);
stats->section_bip += (GET(RSOP_SBL) & 0xff) |
((GET(RSOP_SBM) & 0xff) << 8);
if (stats->section_bip < 0) stats->section_bip = LONG_MAX;
stats->line_bip += (GET(RLOP_LBL) & 0xff) |
ADD_LIMITED(section_bip,(GET(RSOP_SBL) & 0xff) |
((GET(RSOP_SBM) & 0xff) << 8));
ADD_LIMITED(line_bip,(GET(RLOP_LBL) & 0xff) |
((GET(RLOP_LB) & 0xff) << 8) |
((GET(RLOP_LBM) & 0xf) << 16);
if (stats->line_bip < 0) stats->line_bip = LONG_MAX;
stats->path_bip += (GET(RPOP_PBL) & 0xff) |
((GET(RPOP_PBM) & 0xff) << 8);
if (stats->path_bip < 0) stats->path_bip = LONG_MAX;
stats->line_febe += (GET(RLOP_LFL) & 0xff) |
((GET(RLOP_LBM) & 0xf) << 16));
ADD_LIMITED(path_bip,(GET(RPOP_PBL) & 0xff) |
((GET(RPOP_PBM) & 0xff) << 8));
ADD_LIMITED(line_febe,(GET(RLOP_LFL) & 0xff) |
((GET(RLOP_LF) & 0xff) << 8) |
((GET(RLOP_LFM) & 0xf) << 16);
if (stats->line_febe < 0) stats->line_febe = LONG_MAX;
stats->path_febe += (GET(RPOP_PFL) & 0xff) |
((GET(RPOP_PFM) & 0xff) << 8);
if (stats->path_febe < 0) stats->path_febe = LONG_MAX;
stats->corr_hcs += GET(RACP_CHEC) & 0xff;
if (stats->corr_hcs < 0) stats->corr_hcs = LONG_MAX;
stats->uncorr_hcs += GET(RACP_UHEC) & 0xff;
if (stats->uncorr_hcs < 0) stats->uncorr_hcs = LONG_MAX;
stats->rx_cells += (GET(RACP_RCCL) & 0xff) |
((GET(RLOP_LFM) & 0xf) << 16));
ADD_LIMITED(path_febe,(GET(RPOP_PFL) & 0xff) |
((GET(RPOP_PFM) & 0xff) << 8));
ADD_LIMITED(corr_hcs,GET(RACP_CHEC) & 0xff);
ADD_LIMITED(uncorr_hcs,GET(RACP_UHEC) & 0xff);
ADD_LIMITED(rx_cells,(GET(RACP_RCCL) & 0xff) |
((GET(RACP_RCC) & 0xff) << 8) |
((GET(RACP_RCCM) & 7) << 16);
if (stats->rx_cells < 0) stats->rx_cells = LONG_MAX;
stats->tx_cells += (GET(TACP_TCCL) & 0xff) |
((GET(RACP_RCCM) & 7) << 16));
ADD_LIMITED(tx_cells,(GET(TACP_TCCL) & 0xff) |
((GET(TACP_TCC) & 0xff) << 8) |
((GET(TACP_TCCM) & 7) << 16);
if (stats->tx_cells < 0) stats->tx_cells = LONG_MAX;
((GET(TACP_TCCM) & 7) << 16));
}
if (!start_timer) mod_timer(&poll_timer,jiffies+HZ);
if (from_timer) mod_timer(&poll_timer,jiffies+HZ);
}
#undef ADD_LIMITED
static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero)
{
unsigned long flags;
int error;
error = 0;
save_flags(flags);
cli();
if (arg)
error = copy_to_user(arg,&PRIV(dev)->sonet_stats,
sizeof(struct sonet_stats));
if (zero && !error)
memset(&PRIV(dev)->sonet_stats,0,sizeof(struct sonet_stats));
restore_flags(flags);
struct sonet_stats tmp;
int error = 0;
sonet_copy_stats(&PRIV(dev)->sonet_stats,&tmp);
if (arg) error = copy_to_user(arg,&tmp,sizeof(tmp));
if (zero && !error) sonet_subtract_stats(&PRIV(dev)->sonet_stats,&tmp);
return error ? -EFAULT : 0;
}
......@@ -158,6 +152,29 @@ static int get_diag(struct atm_dev *dev,void *arg)
}
static int set_loopback(struct atm_dev *dev,int mode)
{
unsigned char control;
control = GET(MCT) & ~(SUNI_MCT_DLE | SUNI_MCT_LLE);
switch (mode) {
case ATM_LM_NONE:
break;
case ATM_LM_LOC_PHY:
control |= SUNI_MCT_DLE;
break;
case ATM_LM_RMT_PHY:
control |= SUNI_MCT_LLE;
break;
default:
return -EINVAL;
}
PUT(control,MCT);
PRIV(dev)->loop_mode = mode;
return 0;
}
static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
{
switch (cmd) {
......@@ -172,7 +189,6 @@ static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
case SONET_GETDIAG:
return get_diag(dev,arg);
case SONET_SETFRAMING:
if (!capable(CAP_NET_ADMIN)) return -EPERM;
if (arg != SONET_FRAME_SONET) return -EINVAL;
return 0;
case SONET_GETFRAMING:
......@@ -180,23 +196,14 @@ static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
-EFAULT : 0;
case SONET_GETFRSENSE:
return -EINVAL;
case SUNI_SETLOOP:
{
int int_arg = (int) (long) arg;
if (!capable(CAP_NET_ADMIN)) return -EPERM;
if (int_arg < 0 || int_arg > SUNI_LM_LOOP)
return -EINVAL;
PUT((GET(MCT) & ~(SUNI_MCT_DLE | SUNI_MCT_LLE))
| (int_arg == SUNI_LM_DIAG ? SUNI_MCT_DLE :
0) | (int_arg == SUNI_LM_LOOP ?
SUNI_MCT_LLE : 0),MCT);
PRIV(dev)->loop_mode = int_arg;
return 0;
}
case SUNI_GETLOOP:
case ATM_SETLOOP:
return set_loopback(dev,(int) (long) arg);
case ATM_GETLOOP:
return put_user(PRIV(dev)->loop_mode,(int *) arg) ?
-EFAULT : 0;
case ATM_QUERYLOOP:
return put_user(ATM_LM_LOC_PHY | ATM_LM_RMT_PHY,
(int *) arg) ? -EFAULT : 0;
default:
return -ENOIOCTLCMD;
}
......@@ -221,33 +228,31 @@ static void suni_int(struct atm_dev *dev)
static int suni_start(struct atm_dev *dev)
{
unsigned long flags;
int first;
if (!(PRIV(dev) = kmalloc(sizeof(struct suni_priv),GFP_KERNEL)))
return -ENOMEM;
PRIV(dev)->dev = dev;
save_flags(flags);
cli();
spin_lock_irqsave(&sunis_lock,flags);
first = !sunis;
PRIV(dev)->next = sunis;
sunis = PRIV(dev);
restore_flags(flags);
memset(&PRIV(dev)->sonet_stats,0,sizeof(struct sonet_stats));
spin_unlock_irqrestore(&sunis_lock,flags);
memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats));
PUT(GET(RSOP_CIE) | SUNI_RSOP_CIE_LOSE,RSOP_CIE);
/* interrupt on loss of signal */
poll_los(dev); /* ... and clear SUNI interrupts */
if (dev->signal == ATM_PHY_SIG_LOST)
printk(KERN_WARNING "%s(itf %d): no signal\n",dev->type,
dev->number);
PRIV(dev)->loop_mode = SUNI_LM_NONE;
PRIV(dev)->loop_mode = ATM_LM_NONE;
suni_hz(0); /* clear SUNI counters */
(void) fetch_stats(dev,NULL,1); /* clear kernel counters */
cli();
if (!start_timer) restore_flags(flags);
else {
start_timer = 0;
restore_flags(flags);
if (first) {
init_timer(&poll_timer);
poll_timer.expires = jiffies+HZ;
poll_timer.function = suni_hz;
poll_timer.data = 1;
#if 0
printk(KERN_DEBUG "[u] p=0x%lx,n=0x%lx\n",(unsigned long) poll_timer.prev,
(unsigned long) poll_timer.next);
......@@ -258,10 +263,28 @@ printk(KERN_DEBUG "[u] p=0x%lx,n=0x%lx\n",(unsigned long) poll_timer.prev,
}
static int suni_stop(struct atm_dev *dev)
{
struct suni_priv **walk;
unsigned long flags;
/* let SAR driver worry about stopping interrupts */
spin_lock_irqsave(&sunis_lock,flags);
for (walk = &sunis; *walk != PRIV(dev);
walk = &PRIV((*walk)->dev)->next);
*walk = PRIV((*walk)->dev)->next;
if (!sunis) del_timer_sync(&poll_timer);
spin_unlock_irqrestore(&sunis_lock,flags);
kfree(PRIV(dev));
return 0;
}
static const struct atmphy_ops suni_ops = {
suni_start,
suni_ioctl,
suni_int
start: suni_start,
ioctl: suni_ioctl,
interrupt: suni_int,
stop: suni_stop,
};
......
/* drivers/atm/suni.h - PMC SUNI (PHY) declarations */
/* drivers/atm/suni.h - PMC PM5346 SUNI (PHY) declarations */
/* Written 1995,1998 by Werner Almesberger, EPFL LRC/ICA */
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
#ifndef DRIVER_ATM_SUNI_H
......
......@@ -11,6 +11,7 @@
#include <linux/sonet.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/atomic.h>
#include "uPD98402.h"
......@@ -23,8 +24,9 @@
struct uPD98402_priv {
struct sonet_stats sonet_stats; /* link diagnostics */
struct k_sonet_stats sonet_stats;/* link diagnostics */
unsigned char framing; /* SONET/SDH framing */
int loop_mode; /* loopback mode */
};
......@@ -36,23 +38,18 @@ struct uPD98402_priv {
static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero)
{
unsigned long flags;
int error;
struct sonet_stats tmp;
int error = 0;
error = 0;
save_flags(flags);
cli();
PRIV(dev)->sonet_stats.uncorr_hcs += GET(HECCT);
if (arg)
error = copy_to_user(arg,&PRIV(dev)->sonet_stats,
sizeof(struct sonet_stats));
atomic_add(GET(HECCT),&PRIV(dev)->sonet_stats.uncorr_hcs);
sonet_copy_stats(&PRIV(dev)->sonet_stats,&tmp);
if (arg) error = copy_to_user(arg,&tmp,sizeof(tmp));
if (zero && !error) {
memset(&PRIV(dev)->sonet_stats,0,sizeof(struct sonet_stats));
PRIV(dev)->sonet_stats.corr_hcs = -1;
PRIV(dev)->sonet_stats.tx_cells = -1;
PRIV(dev)->sonet_stats.rx_cells = -1;
/* unused fields are reported as -1, but we must not "adjust"
them */
tmp.corr_hcs = tmp.tx_cells = tmp.rx_cells = 0;
sonet_subtract_stats(&PRIV(dev)->sonet_stats,&tmp);
}
restore_flags(flags);
return error ? -EFAULT : 0;
}
......@@ -102,6 +99,39 @@ static int get_sense(struct atm_dev *dev,u8 *arg)
}
static int set_loopback(struct atm_dev *dev,int mode)
{
unsigned char mode_reg;
mode_reg = GET(MDR) & ~(uPD98402_MDR_TPLP | uPD98402_MDR_ALP |
uPD98402_MDR_RPLP);
switch (__ATM_LM_XTLOC(mode)) {
case __ATM_LM_NONE:
break;
case __ATM_LM_PHY:
mode_reg |= uPD98402_MDR_TPLP;
break;
case __ATM_LM_ATM:
mode_reg |= uPD98402_MDR_ALP;
break;
default:
return -EINVAL;
}
switch (__ATM_LM_XTRMT(mode)) {
case __ATM_LM_NONE:
break;
case __ATM_LM_PHY:
mode_reg |= uPD98402_MDR_RPLP;
break;
default:
return -EINVAL;
}
PUT(mode_reg,MDR);
PRIV(dev)->loop_mode = mode;
return 0;
}
static int uPD98402_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
{
switch (cmd) {
......@@ -117,35 +147,42 @@ static int uPD98402_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
-EFAULT : 0;
case SONET_GETFRSENSE:
return get_sense(dev,arg);
case ATM_SETLOOP:
return set_loopback(dev,(int) (long) arg);
case ATM_GETLOOP:
return put_user(PRIV(dev)->loop_mode,(int *) arg) ?
-EFAULT : 0;
case ATM_QUERYLOOP:
return put_user(ATM_LM_LOC_PHY | ATM_LM_LOC_ATM |
ATM_LM_RMT_PHY,(int *) arg) ? -EFAULT : 0;
default:
return -ENOIOCTLCMD;
return -ENOIOCTLCMD;
}
}
#define ADD_LIMITED(s,v) \
{ atomic_add(GET(v),&PRIV(dev)->sonet_stats.s); \
if (atomic_read(&PRIV(dev)->sonet_stats.s) < 0) \
atomic_set(&PRIV(dev)->sonet_stats.s,INT_MAX); }
static void stat_event(struct atm_dev *dev)
{
unsigned char events;
events = GET(PCR);
if (events & uPD98402_PFM_PFEB)
if ((PRIV(dev)->sonet_stats.path_febe += GET(PFECB)) < 0)
PRIV(dev)->sonet_stats.path_febe = LONG_MAX;
if (events & uPD98402_PFM_LFEB)
if ((PRIV(dev)->sonet_stats.line_febe += GET(LECCT)) < 0)
PRIV(dev)->sonet_stats.line_febe = LONG_MAX;
if (events & uPD98402_PFM_B3E)
if ((PRIV(dev)->sonet_stats.path_bip += GET(B3ECT)) < 0)
PRIV(dev)->sonet_stats.path_bip = LONG_MAX;
if (events & uPD98402_PFM_B2E)
if ((PRIV(dev)->sonet_stats.line_bip += GET(B2ECT)) < 0)
PRIV(dev)->sonet_stats.line_bip = LONG_MAX;
if (events & uPD98402_PFM_B1E)
if ((PRIV(dev)->sonet_stats.section_bip += GET(B1ECT)) < 0)
PRIV(dev)->sonet_stats.section_bip = LONG_MAX;
if (events & uPD98402_PFM_PFEB) ADD_LIMITED(path_febe,PFECB);
if (events & uPD98402_PFM_LFEB) ADD_LIMITED(line_febe,LECCT);
if (events & uPD98402_PFM_B3E) ADD_LIMITED(path_bip,B3ECT);
if (events & uPD98402_PFM_B2E) ADD_LIMITED(line_bip,B2ECT);
if (events & uPD98402_PFM_B1E) ADD_LIMITED(section_bip,B1ECT);
}
#undef ADD_LIMITED
static void uPD98402_int(struct atm_dev *dev)
{
static unsigned long silence = 0;
......@@ -158,7 +195,8 @@ static void uPD98402_int(struct atm_dev *dev)
if (reason & uPD98402_INT_PFM) stat_event(dev);
if (reason & uPD98402_INT_PCO) {
(void) GET(PCOCR); /* clear interrupt cause */
PRIV(dev)->sonet_stats.uncorr_hcs += GET(HECCT);
atomic_add(GET(HECCT),
&PRIV(dev)->sonet_stats.uncorr_hcs);
}
if ((reason & uPD98402_INT_RFO) &&
(time_after(jiffies, silence) || silence == 0)) {
......@@ -172,10 +210,10 @@ static void uPD98402_int(struct atm_dev *dev)
static int uPD98402_start(struct atm_dev *dev)
{
DPRINTK("phy_start\n");
DPRINTK("phy_start\n");
if (!(PRIV(dev) = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
return -ENOMEM;
memset(&PRIV(dev)->sonet_stats,0,sizeof(struct sonet_stats));
memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats));
(void) GET(PCR); /* clear performance events */
PUT(uPD98402_PFM_FJ,PCMR); /* ignore frequency adj */
(void) GET(PCOCR); /* clear overflows */
......@@ -184,15 +222,26 @@ DPRINTK("phy_start\n");
PUT(~(uPD98402_INT_PFM | uPD98402_INT_ALM | uPD98402_INT_RFO |
uPD98402_INT_LOS),PIMR); /* enable them */
(void) fetch_stats(dev,NULL,1); /* clear kernel counters */
atomic_set(&PRIV(dev)->sonet_stats.corr_hcs,-1);
atomic_set(&PRIV(dev)->sonet_stats.tx_cells,-1);
atomic_set(&PRIV(dev)->sonet_stats.rx_cells,-1);
return 0;
}
static int uPD98402_stop(struct atm_dev *dev)
{
/* let SAR driver worry about stopping interrupts */
kfree(PRIV(dev));
return 0;
}
static const struct atmphy_ops uPD98402_ops = {
uPD98402_start,
uPD98402_ioctl, /* no ioctl yet */
uPD98402_int
start: uPD98402_start,
ioctl: uPD98402_ioctl,
interrupt: uPD98402_int,
stop: uPD98402_stop,
};
......
......@@ -21,10 +21,12 @@
#include <linux/init.h>
#include <linux/atm_zatm.h>
#include <linux/capability.h>
#include <linux/bitops.h>
#include <asm/byteorder.h>
#include <asm/system.h>
#include <asm/string.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
#include "uPD98401.h"
......@@ -637,7 +639,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]);
}
if (!size) {
dev_kfree_skb_irq(skb);
if (vcc) vcc->stats->rx_err++;
if (vcc) atomic_inc(&vcc->stats->rx_err);
continue;
}
if (!atm_charge(vcc,skb->truesize)) {
......@@ -647,7 +649,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]);
skb->len = size;
ATM_SKB(skb)->vcc = vcc;
vcc->push(vcc,skb);
vcc->stats->rx++;
atomic_inc(&vcc->stats->rx);
}
zout(pos & 0xffff,MTA(mbx));
#if 0 /* probably a stupid idea */
......@@ -914,7 +916,7 @@ if (*ZATM_PRV_DSC(skb) != (uPD98401_TXPD_V | uPD98401_TXPD_DP |
skb_queue_head(&zatm_vcc->backlog,skb);
break;
}
vcc->stats->tx++;
atomic_inc(&vcc->stats->tx);
wake_up(&zatm_vcc->tx_wait);
}
......@@ -1537,7 +1539,7 @@ static void zatm_close(struct atm_vcc *vcc)
{
DPRINTK(">zatm_close\n");
if (!ZATM_VCC(vcc)) return;
vcc->flags &= ~ATM_VF_READY;
clear_bit(ATM_VF_READY,&vcc->flags);
close_rx(vcc);
EVENT("close_tx\n",0,0);
close_tx(vcc);
......@@ -1545,7 +1547,7 @@ static void zatm_close(struct atm_vcc *vcc)
/* deallocate memory */
kfree(ZATM_VCC(vcc));
ZATM_VCC(vcc) = NULL;
vcc->flags &= ~ATM_VF_ADDR;
clear_bit(ATM_VF_ADDR,&vcc->flags);
}
......@@ -1557,20 +1559,20 @@ static int zatm_open(struct atm_vcc *vcc,short vpi,int vci)
DPRINTK(">zatm_open\n");
zatm_dev = ZATM_DEV(vcc->dev);
if (!(vcc->flags & ATM_VF_PARTIAL)) ZATM_VCC(vcc) = NULL;
if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) ZATM_VCC(vcc) = NULL;
error = atm_find_ci(vcc,&vpi,&vci);
if (error) return error;
vcc->vpi = vpi;
vcc->vci = vci;
if (vci != ATM_VPI_UNSPEC && vpi != ATM_VCI_UNSPEC)
vcc->flags |= ATM_VF_ADDR;
set_bit(ATM_VF_ADDR,&vcc->flags);
if (vcc->qos.aal != ATM_AAL5) return -EINVAL; /* @@@ AAL0 */
DPRINTK(DEV_LABEL "(itf %d): open %d.%d\n",vcc->dev->number,vcc->vpi,
vcc->vci);
if (!(vcc->flags & ATM_VF_PARTIAL)) {
if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) {
zatm_vcc = kmalloc(sizeof(struct zatm_vcc),GFP_KERNEL);
if (!zatm_vcc) {
vcc->flags &= ~ATM_VF_ADDR;
clear_bit(ATM_VF_ADDR,&vcc->flags);
return -ENOMEM;
}
ZATM_VCC(vcc) = zatm_vcc;
......@@ -1593,7 +1595,7 @@ static int zatm_open(struct atm_vcc *vcc,short vpi,int vci)
zatm_close(vcc);
return error;
}
vcc->flags |= ATM_VF_READY;
set_bit(ATM_VF_READY,&vcc->flags);
return 0;
}
......@@ -1733,7 +1735,7 @@ static int zatm_send(struct atm_vcc *vcc,struct sk_buff *skb)
int error;
EVENT(">zatm_send 0x%lx\n",(unsigned long) skb,0);
if (!ZATM_VCC(vcc)->tx_chan || !(vcc->flags & ATM_VF_READY)) {
if (!ZATM_VCC(vcc)->tx_chan || !test_bit(ATM_VF_READY,&vcc->flags)) {
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb(skb);
return -EINVAL;
......@@ -1809,7 +1811,7 @@ int __init zatm_detect(void)
while ((pci_dev = pci_find_device(PCI_VENDOR_ID_ZEITNET,type ?
PCI_DEVICE_ID_ZEITNET_1225 : PCI_DEVICE_ID_ZEITNET_1221,
pci_dev))) {
dev = atm_dev_register(DEV_LABEL,&ops,-1,0);
dev = atm_dev_register(DEV_LABEL,&ops,-1,NULL);
if (!dev) break;
zatm_dev->pci_dev = pci_dev;
ZATM_DEV(dev) = zatm_dev;
......
......@@ -117,7 +117,7 @@ static int __init atixl_busmouse_init(void)
* may race another module load of the same I/O
*/
if (request_region(ATIXL_MSE_DATA_PORT, 3, "atixlmouse"))
if (!request_region(ATIXL_MSE_DATA_PORT, 3, "atixlmouse"))
return -EIO;
a = inb( ATIXL_MSE_SIGNATURE_PORT ); /* Get signature */
......
......@@ -48,8 +48,6 @@
*/
/*#define BROKEN_MOUSE*/
extern int sun_mouse_init(void);
struct busmouse_data {
struct miscdevice miscdev;
struct busmouse *ops;
......@@ -446,27 +444,8 @@ int unregister_busmouse(int mousedev)
return err;
}
int __init bus_mouse_init(void)
{
#ifdef CONFIG_SUN_MOUSE
sun_mouse_init();
#endif
return 0;
}
EXPORT_SYMBOL(busmouse_add_movementbuttons);
EXPORT_SYMBOL(busmouse_add_movement);
EXPORT_SYMBOL(busmouse_add_buttons);
EXPORT_SYMBOL(register_busmouse);
EXPORT_SYMBOL(unregister_busmouse);
#ifdef MODULE
int init_module(void)
{
return bus_mouse_init();
}
void cleanup_module(void)
{
}
#endif
......@@ -23,6 +23,4 @@ extern void busmouse_add_buttons(int mousedev, int clear, int eor);
extern int register_busmouse(struct busmouse *ops);
extern int unregister_busmouse(int mousedev);
extern int bus_mouse_init(void);
#endif
......@@ -224,9 +224,6 @@ EXPORT_SYMBOL(misc_deregister);
int __init misc_init(void)
{
create_proc_read_entry("misc", 0, 0, misc_read_proc, NULL);
#ifdef CONFIG_BUSMOUSE
bus_mouse_init();
#endif
#if defined CONFIG_82C710_MOUSE
qpmouse_init();
#endif
......
......@@ -14,11 +14,12 @@ if [ "$CONFIG_PCI" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
fi
dep_tristate 'Adaptec AIC-5800 (AHA-89xx) support' CONFIG_IEEE1394_AIC5800 $CONFIG_IEEE1394
dep_tristate 'OHCI (Open Host Controller Interface) support' CONFIG_IEEE1394_OHCI1394 $CONFIG_IEEE1394
dep_tristate 'Raw IEEE1394 I/O support' CONFIG_IEEE1394_RAWIO $CONFIG_IEEE1394
bool 'Excessive debugging output' CONFIG_IEEE1394_VERBOSEDEBUG
fi
endmenu
fi
This diff is collapsed.
......@@ -46,7 +46,6 @@ struct csr_control {
quadlet_t topology_map[256];
quadlet_t speed_map[1024];
quadlet_t fcp_data[1024];
};
......
......@@ -192,23 +192,35 @@ void highlevel_iso_receive(struct hpsb_host *host, quadlet_t *data,
read_unlock(&hl_drivers_lock);
}
void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction,
u8 *data, unsigned int length)
{
struct list_head *entry;
struct hpsb_highlevel *hl;
int cts = data[0];
read_lock(&hl_drivers_lock);
entry = hl_drivers.next;
while (entry != &hl_drivers) {
hl = list_entry(entry, struct hpsb_highlevel, hl_list);
if (hl->op->fcp_request) {
hl->op->fcp_request(host, nodeid, direction, cts, data,
length);
}
entry = entry->next;
}
read_unlock(&hl_drivers_lock);
}
int highlevel_read(struct hpsb_host *host, quadlet_t *buffer, u64 addr,
unsigned int length)
int highlevel_read(struct hpsb_host *host, int nodeid, quadlet_t *buffer,
u64 addr, unsigned int length)
{
struct hpsb_address_serve *as;
struct list_head *entry;
unsigned int partlength;
int rcode = RCODE_ADDRESS_ERROR;
if ((addr | length) & 0x3) {
/* Addresses or lengths not a multiple of a quadlet pose a big
* problem on little endian machines because we always do this
* in arch endian and swapping would mess it all up. So we
* simply don't allow this at all. */
return RCODE_TYPE_ERROR;
}
read_lock(&addr_space_lock);
entry = addr_space.next;
......@@ -220,7 +232,7 @@ int highlevel_read(struct hpsb_host *host, quadlet_t *buffer, u64 addr,
length);
if (as->op->read != NULL) {
rcode = as->op->read(host, buffer, addr,
rcode = as->op->read(host, nodeid, buffer, addr,
partlength);
} else {
rcode = RCODE_TYPE_ERROR;
......@@ -247,18 +259,14 @@ int highlevel_read(struct hpsb_host *host, quadlet_t *buffer, u64 addr,
return rcode;
}
int highlevel_write(struct hpsb_host *host, quadlet_t *data, u64 addr,
unsigned int length)
int highlevel_write(struct hpsb_host *host, int nodeid, quadlet_t *data,
u64 addr, unsigned int length)
{
struct hpsb_address_serve *as;
struct list_head *entry;
unsigned int partlength;
int rcode = RCODE_ADDRESS_ERROR;
if ((addr | length) & 0x3) {
return RCODE_TYPE_ERROR;
}
read_lock(&addr_space_lock);
entry = addr_space.next;
......@@ -270,7 +278,7 @@ int highlevel_write(struct hpsb_host *host, quadlet_t *data, u64 addr,
length);
if (as->op->write != NULL) {
rcode = as->op->write(host, data, addr,
rcode = as->op->write(host, nodeid, data, addr,
partlength);
} else {
rcode = RCODE_TYPE_ERROR;
......@@ -298,8 +306,8 @@ int highlevel_write(struct hpsb_host *host, quadlet_t *data, u64 addr,
}
int highlevel_lock(struct hpsb_host *host, quadlet_t *store, u64 addr,
quadlet_t data, quadlet_t arg, int ext_tcode)
int highlevel_lock(struct hpsb_host *host, int nodeid, quadlet_t *store,
u64 addr, quadlet_t data, quadlet_t arg, int ext_tcode)
{
struct hpsb_address_serve *as;
struct list_head *entry;
......@@ -313,8 +321,8 @@ int highlevel_lock(struct hpsb_host *host, quadlet_t *store, u64 addr,
while (as->start <= addr) {
if (as->end > addr) {
if (as->op->lock != NULL) {
rcode = as->op->lock(host, store, addr, data,
arg, ext_tcode);
rcode = as->op->lock(host, nodeid, store, addr,
data, arg, ext_tcode);
} else {
rcode = RCODE_TYPE_ERROR;
}
......@@ -331,8 +339,8 @@ int highlevel_lock(struct hpsb_host *host, quadlet_t *store, u64 addr,
return rcode;
}
int highlevel_lock64(struct hpsb_host *host, octlet_t *store, u64 addr,
octlet_t data, octlet_t arg, int ext_tcode)
int highlevel_lock64(struct hpsb_host *host, int nodeid, octlet_t *store,
u64 addr, octlet_t data, octlet_t arg, int ext_tcode)
{
struct hpsb_address_serve *as;
struct list_head *entry;
......@@ -346,8 +354,9 @@ int highlevel_lock64(struct hpsb_host *host, octlet_t *store, u64 addr,
while (as->start <= addr) {
if (as->end > addr) {
if (as->op->lock64 != NULL) {
rcode = as->op->lock64(host, store, addr, data,
arg, ext_tcode);
rcode = as->op->lock64(host, nodeid, store,
addr, data, arg,
ext_tcode);
} else {
rcode = RCODE_TYPE_ERROR;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -6,6 +6,7 @@
#include <linux/types.h>
#include <linux/version.h>
#include <linux/list.h>
#include <asm/byteorder.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
......@@ -24,6 +25,8 @@ static __inline__ void list_add_tail(struct list_head *new, struct list_head *he
__list_add(new, head->prev, head);
}
#define __constant_cpu_to_be32(x) __constant_htonl((x))
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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