patch-2.4.23 linux-2.4.23/drivers/atm/eni.c
Next file: linux-2.4.23/drivers/atm/fore200e.c
Previous file: linux-2.4.23/drivers/atm/atmtcp.c
Back to the patch index
Back to the overall index
- Lines: 112
- Date:
2003-11-28 10:26:19.000000000 -0800
- Orig file:
linux-2.4.22/drivers/atm/eni.c
- Orig date:
2003-08-25 04:44:41.000000000 -0700
diff -urN linux-2.4.22/drivers/atm/eni.c linux-2.4.23/drivers/atm/eni.c
@@ -1887,10 +1887,10 @@
static int get_ci(struct atm_vcc *vcc,short *vpi,int *vci)
{
- unsigned long flags;
+ struct sock *s;
struct atm_vcc *walk;
- spin_lock_irqsave(&vcc->dev->lock, flags);
+ read_lock(&vcc_sklist_lock);
if (*vpi == ATM_VPI_ANY) *vpi = 0;
if (*vci == ATM_VCI_ANY) {
for (*vci = ATM_NOT_RSV_VCI; *vci < NR_VCI; (*vci)++) {
@@ -1898,40 +1898,47 @@
ENI_DEV(vcc->dev)->rx_map[*vci])
continue;
if (vcc->qos.txtp.traffic_class != ATM_NONE) {
- for (walk = vcc->dev->vccs; walk;
- walk = walk->next)
+ for (s = vcc_sklist; s; s = s->next) {
+ walk = s->protinfo.af_atm;
+ if (walk->dev != vcc->dev)
+ continue;
if (test_bit(ATM_VF_ADDR,&walk->flags)
&& walk->vci == *vci &&
walk->qos.txtp.traffic_class !=
ATM_NONE)
break;
- if (walk) continue;
+ }
+ if (s) continue;
}
break;
}
- spin_unlock_irqrestore(&vcc->dev->lock, flags);
+ read_unlock(&vcc_sklist_lock);
return *vci == NR_VCI ? -EADDRINUSE : 0;
}
if (*vci == ATM_VCI_UNSPEC) {
- spin_unlock_irqrestore(&vcc->dev->lock, flags);
+ read_unlock(&vcc_sklist_lock);
return 0;
}
if (vcc->qos.rxtp.traffic_class != ATM_NONE &&
ENI_DEV(vcc->dev)->rx_map[*vci]) {
- spin_unlock_irqrestore(&vcc->dev->lock, flags);
+ read_unlock(&vcc_sklist_lock);
return -EADDRINUSE;
}
if (vcc->qos.txtp.traffic_class == ATM_NONE) {
- spin_unlock_irqrestore(&vcc->dev->lock, flags);
+ read_unlock(&vcc_sklist_lock);
return 0;
}
- for (walk = vcc->dev->vccs; walk; walk = walk->next)
+ for (s = vcc_sklist; s; s = s->next) {
+ walk = s->protinfo.af_atm;
+ if (walk->dev != vcc->dev)
+ continue;
if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vci == *vci &&
walk->qos.txtp.traffic_class != ATM_NONE) {
- spin_unlock_irqrestore(&vcc->dev->lock, flags);
+ read_unlock(&vcc_sklist_lock);
return -EADDRINUSE;
}
- spin_unlock_irqrestore(&vcc->dev->lock, flags);
+ }
+ read_unlock(&vcc_sklist_lock);
return 0;
}
@@ -2139,7 +2146,7 @@
static int eni_proc_read(struct atm_dev *dev,loff_t *pos,char *page)
{
- unsigned long flags;
+ struct sock *s;
static const char *signal[] = { "LOST","unknown","okay" };
struct eni_dev *eni_dev = ENI_DEV(dev);
struct atm_vcc *vcc;
@@ -2212,11 +2219,15 @@
return sprintf(page,"%10sbacklog %u packets\n","",
skb_queue_len(&tx->backlog));
}
- spin_lock_irqsave(&dev->lock, flags);
- for (vcc = dev->vccs; vcc; vcc = vcc->next) {
- struct eni_vcc *eni_vcc = ENI_VCC(vcc);
+ read_lock(&vcc_sklist_lock);
+ for (s = vcc_sklist; s; s = s->next) {
+ struct eni_vcc *eni_vcc;
int length;
+ vcc = s->protinfo.af_atm;
+ if (vcc->dev != dev)
+ continue;
+ eni_vcc = ENI_VCC(vcc);
if (--left) continue;
length = sprintf(page,"vcc %4d: ",vcc->vci);
if (eni_vcc->rx) {
@@ -2231,10 +2242,10 @@
length += sprintf(page+length,"tx[%d], txing %d bytes",
eni_vcc->tx->index,eni_vcc->txing);
page[length] = '\n';
- spin_unlock_irqrestore(&dev->lock, flags);
+ read_unlock(&vcc_sklist_lock);
return length+1;
}
- spin_unlock_irqrestore(&dev->lock, flags);
+ read_unlock(&vcc_sklist_lock);
for (i = 0; i < eni_dev->free_len; i++) {
struct eni_free *fe = eni_dev->free_list+i;
unsigned long offset;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)