idt77252.c (7e66eaf14e19c032433be7c4df3c892fa2a5282f) idt77252.c (3a816054fcd345d0fe47c666c375d372c6170371)
1/*******************************************************************
2 *
3 * Copyright (c) 2000 ATecoM GmbH
4 *
5 * The author may be reached at ecd@atecom.com.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the

--- 32 unchanged lines hidden (view full) ---

41#include <linux/bitops.h>
42#include <linux/wait.h>
43#include <linux/jiffies.h>
44#include <linux/mutex.h>
45#include <linux/slab.h>
46
47#include <asm/io.h>
48#include <asm/uaccess.h>
1/*******************************************************************
2 *
3 * Copyright (c) 2000 ATecoM GmbH
4 *
5 * The author may be reached at ecd@atecom.com.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the

--- 32 unchanged lines hidden (view full) ---

41#include <linux/bitops.h>
42#include <linux/wait.h>
43#include <linux/jiffies.h>
44#include <linux/mutex.h>
45#include <linux/slab.h>
46
47#include <asm/io.h>
48#include <asm/uaccess.h>
49#include <linux/atomic.h>
49#include <asm/atomic.h>
50#include <asm/byteorder.h>
51
52#ifdef CONFIG_ATM_IDT77252_USE_SUNI
53#include "suni.h"
54#endif /* CONFIG_ATM_IDT77252_USE_SUNI */
55
56
57#include "idt77252.h"

--- 3353 unchanged lines hidden (view full) ---

3411 }
3412 memset(card->raw_cell_hnd, 0, 2 * sizeof(u32));
3413 writel(card->raw_cell_paddr, SAR_REG_RAWHND);
3414 IPRINTK("%s: raw cell handle is at 0x%p.\n", card->name,
3415 card->raw_cell_hnd);
3416
3417 size = sizeof(struct vc_map *) * card->tct_size;
3418 IPRINTK("%s: allocate %d byte for VC map.\n", card->name, size);
50#include <asm/byteorder.h>
51
52#ifdef CONFIG_ATM_IDT77252_USE_SUNI
53#include "suni.h"
54#endif /* CONFIG_ATM_IDT77252_USE_SUNI */
55
56
57#include "idt77252.h"

--- 3353 unchanged lines hidden (view full) ---

3411 }
3412 memset(card->raw_cell_hnd, 0, 2 * sizeof(u32));
3413 writel(card->raw_cell_paddr, SAR_REG_RAWHND);
3414 IPRINTK("%s: raw cell handle is at 0x%p.\n", card->name,
3415 card->raw_cell_hnd);
3416
3417 size = sizeof(struct vc_map *) * card->tct_size;
3418 IPRINTK("%s: allocate %d byte for VC map.\n", card->name, size);
3419 if (NULL == (card->vcs = vmalloc(size))) {
3419 card->vcs = vzalloc(size);
3420 if (!card->vcs) {
3420 printk("%s: memory allocation failure.\n", card->name);
3421 deinit_card(card);
3422 return -1;
3423 }
3421 printk("%s: memory allocation failure.\n", card->name);
3422 deinit_card(card);
3423 return -1;
3424 }
3424 memset(card->vcs, 0, size);
3425
3426 size = sizeof(struct vc_map *) * card->scd_size;
3427 IPRINTK("%s: allocate %d byte for SCD to VC mapping.\n",
3428 card->name, size);
3425
3426 size = sizeof(struct vc_map *) * card->scd_size;
3427 IPRINTK("%s: allocate %d byte for SCD to VC mapping.\n",
3428 card->name, size);
3429 if (NULL == (card->scd2vc = vmalloc(size))) {
3429 card->scd2vc = vzalloc(size);
3430 if (!card->scd2vc) {
3430 printk("%s: memory allocation failure.\n", card->name);
3431 deinit_card(card);
3432 return -1;
3433 }
3431 printk("%s: memory allocation failure.\n", card->name);
3432 deinit_card(card);
3433 return -1;
3434 }
3434 memset(card->scd2vc, 0, size);
3435
3436 size = sizeof(struct tst_info) * (card->tst_size - 2);
3437 IPRINTK("%s: allocate %d byte for TST to VC mapping.\n",
3438 card->name, size);
3435
3436 size = sizeof(struct tst_info) * (card->tst_size - 2);
3437 IPRINTK("%s: allocate %d byte for TST to VC mapping.\n",
3438 card->name, size);
3439 if (NULL == (card->soft_tst = vmalloc(size))) {
3439 card->soft_tst = vmalloc(size);
3440 if (!card->soft_tst) {
3440 printk("%s: memory allocation failure.\n", card->name);
3441 deinit_card(card);
3442 return -1;
3443 }
3444 for (i = 0; i < card->tst_size - 2; i++) {
3445 card->soft_tst[i].tste = TSTE_OPC_VAR;
3446 card->soft_tst[i].vc = NULL;
3447 }

--- 356 unchanged lines hidden ---
3441 printk("%s: memory allocation failure.\n", card->name);
3442 deinit_card(card);
3443 return -1;
3444 }
3445 for (i = 0; i < card->tst_size - 2; i++) {
3446 card->soft_tst[i].tste = TSTE_OPC_VAR;
3447 card->soft_tst[i].vc = NULL;
3448 }

--- 356 unchanged lines hidden ---