git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
atm
/
idt77252.c
diff --git
a/drivers/atm/idt77252.c
b/drivers/atm/idt77252.c
index
baaf1a3
..
f407861
100644
(file)
--- a/
drivers/atm/idt77252.c
+++ b/
drivers/atm/idt77252.c
@@
-34,8
+34,8
@@
static char const rcsid[] =
#include <linux/module.h>
#include <linux/module.h>
-#include <linux/config.h>
#include <linux/pci.h>
#include <linux/pci.h>
+#include <linux/poison.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/vmalloc.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/vmalloc.h>
@@
-46,6
+46,7
@@
static char const rcsid[] =
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/wait.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/wait.h>
+#include <linux/jiffies.h>
#include <asm/semaphore.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
#include <asm/io.h>
#include <asm/uaccess.h>
@@
-134,7
+135,7
@@
static int idt77252_change_qos(struct atm_vcc *vcc, struct atm_qos *qos,
int flags);
static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos,
char *page);
int flags);
static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos,
char *page);
-static void idt77252_softint(
void *dev_id
);
+static void idt77252_softint(
struct work_struct *work
);
static struct atmdev_ops idt77252_ops =
static struct atmdev_ops idt77252_ops =
@@
-641,11
+642,9
@@
alloc_scq(struct idt77252_dev *card, int class)
{
struct scq_info *scq;
{
struct scq_info *scq;
- scq =
(struct scq_info *) km
alloc(sizeof(struct scq_info), GFP_KERNEL);
+ scq =
kz
alloc(sizeof(struct scq_info), GFP_KERNEL);
if (!scq)
return NULL;
if (!scq)
return NULL;
- memset(scq, 0, sizeof(struct scq_info));
-
scq->base = pci_alloc_consistent(card->pcidev, SCQ_SIZE,
&scq->paddr);
if (scq->base == NULL) {
scq->base = pci_alloc_consistent(card->pcidev, SCQ_SIZE,
&scq->paddr);
if (scq->base == NULL) {
@@
-780,7
+779,7
@@
push_on_scq(struct idt77252_dev *card, struct vc_map *vc, struct sk_buff *skb)
return 0;
out:
return 0;
out:
- if (
jiffies - scq->trans_start > HZ
) {
+ if (
time_after(jiffies, scq->trans_start + HZ)
) {
printk("%s: Error pushing TBD for %d.%d\n",
card->name, vc->tx_vcc->vpi, vc->tx_vcc->vci);
#ifdef CONFIG_ATM_IDT77252_DEBUG
printk("%s: Error pushing TBD for %d.%d\n",
card->name, vc->tx_vcc->vpi, vc->tx_vcc->vci);
#ifdef CONFIG_ATM_IDT77252_DEBUG
@@
-1100,7
+1099,7
@@
dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
cell, ATM_CELL_PAYLOAD);
ATM_SKB(sb)->vcc = vcc;
cell, ATM_CELL_PAYLOAD);
ATM_SKB(sb)->vcc = vcc;
-
do_gettimeofday(&sb->stamp
);
+
__net_timestamp(sb
);
vcc->push(vcc, sb);
atomic_inc(&vcc->stats->rx);
vcc->push(vcc, sb);
atomic_inc(&vcc->stats->rx);
@@
-1178,7
+1177,7
@@
dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
skb_trim(skb, len);
ATM_SKB(skb)->vcc = vcc;
skb_trim(skb, len);
ATM_SKB(skb)->vcc = vcc;
-
do_gettimeofday(&skb->stamp
);
+
__net_timestamp(skb
);
vcc->push(vcc, skb);
atomic_inc(&vcc->stats->rx);
vcc->push(vcc, skb);
atomic_inc(&vcc->stats->rx);
@@
-1200,7
+1199,7
@@
dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
skb_trim(skb, len);
ATM_SKB(skb)->vcc = vcc;
skb_trim(skb, len);
ATM_SKB(skb)->vcc = vcc;
-
do_gettimeofday(&skb->stamp
);
+
__net_timestamp(skb
);
vcc->push(vcc, skb);
atomic_inc(&vcc->stats->rx);
vcc->push(vcc, skb);
atomic_inc(&vcc->stats->rx);
@@
-1339,7
+1338,7
@@
idt77252_rx_raw(struct idt77252_dev *card)
ATM_CELL_PAYLOAD);
ATM_SKB(sb)->vcc = vcc;
ATM_CELL_PAYLOAD);
ATM_SKB(sb)->vcc = vcc;
-
do_gettimeofday(&sb->stamp
);
+
__net_timestamp(sb
);
vcc->push(vcc, sb);
atomic_inc(&vcc->stats->rx);
vcc->push(vcc, sb);
atomic_inc(&vcc->stats->rx);
@@
-2141,11
+2140,9
@@
idt77252_init_est(struct vc_map *vc, int pcr)
{
struct rate_estimator *est;
{
struct rate_estimator *est;
- est = k
m
alloc(sizeof(struct rate_estimator), GFP_KERNEL);
+ est = k
z
alloc(sizeof(struct rate_estimator), GFP_KERNEL);
if (!est)
return NULL;
if (!est)
return NULL;
- memset(est, 0, sizeof(*est));
-
est->maxcps = pcr < 0 ? -pcr : pcr;
est->cps = est->maxcps;
est->avcps = est->cps << 5;
est->maxcps = pcr < 0 ? -pcr : pcr;
est->cps = est->maxcps;
est->avcps = est->cps << 5;
@@
-2450,14
+2447,12
@@
idt77252_open(struct atm_vcc *vcc)
index = VPCI2VC(card, vpi, vci);
if (!card->vcs[index]) {
index = VPCI2VC(card, vpi, vci);
if (!card->vcs[index]) {
- card->vcs[index] = k
m
alloc(sizeof(struct vc_map), GFP_KERNEL);
+ card->vcs[index] = k
z
alloc(sizeof(struct vc_map), GFP_KERNEL);
if (!card->vcs[index]) {
printk("%s: can't alloc vc in open()\n", card->name);
up(&card->mutex);
return -ENOMEM;
}
if (!card->vcs[index]) {
printk("%s: can't alloc vc in open()\n", card->name);
up(&card->mutex);
return -ENOMEM;
}
- memset(card->vcs[index], 0, sizeof(struct vc_map));
-
card->vcs[index]->card = card;
card->vcs[index]->index = index;
card->vcs[index]->card = card;
card->vcs[index]->index = index;
@@
-2779,7
+2774,7
@@
idt77252_collect_stat(struct idt77252_dev *card)
}
static irqreturn_t
}
static irqreturn_t
-idt77252_interrupt(int irq, void *dev_id
, struct pt_regs *ptregs
)
+idt77252_interrupt(int irq, void *dev_id)
{
struct idt77252_dev *card = dev_id;
u32 stat;
{
struct idt77252_dev *card = dev_id;
u32 stat;
@@
-2871,9
+2866,10
@@
out:
}
static void
}
static void
-idt77252_softint(
void *dev_id
)
+idt77252_softint(
struct work_struct *work
)
{
{
- struct idt77252_dev *card = dev_id;
+ struct idt77252_dev *card =
+ container_of(work, struct idt77252_dev, tqueue);
u32 stat;
int done;
u32 stat;
int done;
@@
-2925,13
+2921,11
@@
open_card_oam(struct idt77252_dev *card)
for (vci = 3; vci < 5; vci++) {
index = VPCI2VC(card, vpi, vci);
for (vci = 3; vci < 5; vci++) {
index = VPCI2VC(card, vpi, vci);
- vc = k
m
alloc(sizeof(struct vc_map), GFP_KERNEL);
+ vc = k
z
alloc(sizeof(struct vc_map), GFP_KERNEL);
if (!vc) {
printk("%s: can't alloc vc\n", card->name);
return -ENOMEM;
}
if (!vc) {
printk("%s: can't alloc vc\n", card->name);
return -ENOMEM;
}
- memset(vc, 0, sizeof(struct vc_map));
-
vc->index = index;
card->vcs[index] = vc;
vc->index = index;
card->vcs[index] = vc;
@@
-2994,12
+2988,11
@@
open_card_ubr0(struct idt77252_dev *card)
{
struct vc_map *vc;
{
struct vc_map *vc;
- vc = k
m
alloc(sizeof(struct vc_map), GFP_KERNEL);
+ vc = k
z
alloc(sizeof(struct vc_map), GFP_KERNEL);
if (!vc) {
printk("%s: can't alloc vc\n", card->name);
return -ENOMEM;
}
if (!vc) {
printk("%s: can't alloc vc\n", card->name);
return -ENOMEM;
}
- memset(vc, 0, sizeof(struct vc_map));
card->vcs[0] = vc;
vc->class = SCHED_UBR0;
card->vcs[0] = vc;
vc->class = SCHED_UBR0;
@@
-3386,7
+3379,7
@@
init_card(struct atm_dev *dev)
writel(SAR_STAT_TMROF, SAR_REG_STAT);
}
IPRINTK("%s: Request IRQ ... ", card->name);
writel(SAR_STAT_TMROF, SAR_REG_STAT);
}
IPRINTK("%s: Request IRQ ... ", card->name);
- if (request_irq(pcidev->irq, idt77252_interrupt,
SA_INTERRUPT|SA_SHIRQ
,
+ if (request_irq(pcidev->irq, idt77252_interrupt,
IRQF_DISABLED|IRQF_SHARED
,
card->name, card) != 0) {
printk("%s: can't allocate IRQ.\n", card->name);
deinit_card(card);
card->name, card) != 0) {
printk("%s: can't allocate IRQ.\n", card->name);
deinit_card(card);
@@
-3657,7
+3650,7
@@
probe_sram(struct idt77252_dev *card)
writel(SAR_CMD_WRITE_SRAM | (0 << 2), SAR_REG_CMD);
for (addr = 0x4000; addr < 0x80000; addr += 0x4000) {
writel(SAR_CMD_WRITE_SRAM | (0 << 2), SAR_REG_CMD);
for (addr = 0x4000; addr < 0x80000; addr += 0x4000) {
- writel(
0xdeadbeef
, SAR_REG_DR0);
+ writel(
ATM_POISON
, SAR_REG_DR0);
writel(SAR_CMD_WRITE_SRAM | (addr << 2), SAR_REG_CMD);
writel(SAR_CMD_READ_SRAM | (0 << 2), SAR_REG_CMD);
writel(SAR_CMD_WRITE_SRAM | (addr << 2), SAR_REG_CMD);
writel(SAR_CMD_READ_SRAM | (0 << 2), SAR_REG_CMD);
@@
-3694,20
+3687,18
@@
idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
goto err_out_disable_pdev;
}
goto err_out_disable_pdev;
}
- card = k
m
alloc(sizeof(struct idt77252_dev), GFP_KERNEL);
+ card = k
z
alloc(sizeof(struct idt77252_dev), GFP_KERNEL);
if (!card) {
printk("idt77252-%d: can't allocate private data\n", index);
err = -ENOMEM;
goto err_out_disable_pdev;
}
if (!card) {
printk("idt77252-%d: can't allocate private data\n", index);
err = -ENOMEM;
goto err_out_disable_pdev;
}
- memset(card, 0, sizeof(struct idt77252_dev));
-
card->revision = revision;
card->index = index;
card->pcidev = pcidev;
sprintf(card->name, "idt77252-%d", card->index);
card->revision = revision;
card->index = index;
card->pcidev = pcidev;
sprintf(card->name, "idt77252-%d", card->index);
- INIT_WORK(&card->tqueue, idt77252_softint
, (void *)card
);
+ INIT_WORK(&card->tqueue, idt77252_softint);
membase = pci_resource_start(pcidev, 1);
srambase = pci_resource_start(pcidev, 2);
membase = pci_resource_start(pcidev, 1);
srambase = pci_resource_start(pcidev, 2);