linux/drivers/atm/nicstar.c
<<
>>
Prefs
   1/*
   2 * nicstar.c
   3 *
   4 * Device driver supporting CBR for IDT 77201/77211 "NICStAR" based cards.
   5 *
   6 * IMPORTANT: The included file nicstarmac.c was NOT WRITTEN BY ME.
   7 *            It was taken from the frle-0.22 device driver.
   8 *            As the file doesn't have a copyright notice, in the file
   9 *            nicstarmac.copyright I put the copyright notice from the
  10 *            frle-0.22 device driver.
  11 *            Some code is based on the nicstar driver by M. Welsh.
  12 *
  13 * Author: Rui Prior (rprior@inescn.pt)
  14 * PowerPC support by Jay Talbott (jay_talbott@mcg.mot.com) April 1999
  15 *
  16 *
  17 * (C) INESC 1999
  18 */
  19
  20/*
  21 * IMPORTANT INFORMATION
  22 *
  23 * There are currently three types of spinlocks:
  24 *
  25 * 1 - Per card interrupt spinlock (to protect structures and such)
  26 * 2 - Per SCQ scq spinlock
  27 * 3 - Per card resource spinlock (to access registers, etc.)
  28 *
  29 * These must NEVER be grabbed in reverse order.
  30 *
  31 */
  32
  33/* Header files */
  34
  35#include <linux/module.h>
  36#include <linux/kernel.h>
  37#include <linux/skbuff.h>
  38#include <linux/atmdev.h>
  39#include <linux/atm.h>
  40#include <linux/pci.h>
  41#include <linux/dma-mapping.h>
  42#include <linux/types.h>
  43#include <linux/string.h>
  44#include <linux/delay.h>
  45#include <linux/init.h>
  46#include <linux/sched.h>
  47#include <linux/timer.h>
  48#include <linux/interrupt.h>
  49#include <linux/bitops.h>
  50#include <linux/slab.h>
  51#include <linux/idr.h>
  52#include <asm/io.h>
  53#include <asm/uaccess.h>
  54#include <linux/atomic.h>
  55#include "nicstar.h"
  56#ifdef CONFIG_ATM_NICSTAR_USE_SUNI
  57#include "suni.h"
  58#endif /* CONFIG_ATM_NICSTAR_USE_SUNI */
  59#ifdef CONFIG_ATM_NICSTAR_USE_IDT77105
  60#include "idt77105.h"
  61#endif /* CONFIG_ATM_NICSTAR_USE_IDT77105 */
  62
  63/* Additional code */
  64
  65#include "nicstarmac.c"
  66
  67/* Configurable parameters */
  68
  69#undef PHY_LOOPBACK
  70#undef TX_DEBUG
  71#undef RX_DEBUG
  72#undef GENERAL_DEBUG
  73#undef EXTRA_DEBUG
  74
  75#undef NS_USE_DESTRUCTORS       /* For now keep this undefined unless you know
  76                                   you're going to use only raw ATM */
  77
  78/* Do not touch these */
  79
  80#ifdef TX_DEBUG
  81#define TXPRINTK(args...) printk(args)
  82#else
  83#define TXPRINTK(args...)
  84#endif /* TX_DEBUG */
  85
  86#ifdef RX_DEBUG
  87#define RXPRINTK(args...) printk(args)
  88#else
  89#define RXPRINTK(args...)
  90#endif /* RX_DEBUG */
  91
  92#ifdef GENERAL_DEBUG
  93#define PRINTK(args...) printk(args)
  94#else
  95#define PRINTK(args...)
  96#endif /* GENERAL_DEBUG */
  97
  98#ifdef EXTRA_DEBUG
  99#define XPRINTK(args...) printk(args)
 100#else
 101#define XPRINTK(args...)
 102#endif /* EXTRA_DEBUG */
 103
 104/* Macros */
 105
 106#define CMD_BUSY(card) (readl((card)->membase + STAT) & NS_STAT_CMDBZ)
 107
 108#define NS_DELAY mdelay(1)
 109
 110#define PTR_DIFF(a, b)  ((u32)((unsigned long)(a) - (unsigned long)(b)))
 111
 112#ifndef ATM_SKB
 113#define ATM_SKB(s) (&(s)->atm)
 114#endif
 115
 116#define scq_virt_to_bus(scq, p) \
 117                (scq->dma + ((unsigned long)(p) - (unsigned long)(scq)->org))
 118
 119/* Function declarations */
 120
 121static u32 ns_read_sram(ns_dev * card, u32 sram_address);
 122static void ns_write_sram(ns_dev * card, u32 sram_address, u32 * value,
 123                          int count);
 124static int ns_init_card(int i, struct pci_dev *pcidev);
 125static void ns_init_card_error(ns_dev * card, int error);
 126static scq_info *get_scq(ns_dev *card, int size, u32 scd);
 127static void free_scq(ns_dev *card, scq_info * scq, struct atm_vcc *vcc);
 128static void push_rxbufs(ns_dev *, struct sk_buff *);
 129static irqreturn_t ns_irq_handler(int irq, void *dev_id);
 130static int ns_open(struct atm_vcc *vcc);
 131static void ns_close(struct atm_vcc *vcc);
 132static void fill_tst(ns_dev * card, int n, vc_map * vc);
 133static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb);
 134static int push_scqe(ns_dev * card, vc_map * vc, scq_info * scq, ns_scqe * tbd,
 135                     struct sk_buff *skb);
 136static void process_tsq(ns_dev * card);
 137static void drain_scq(ns_dev * card, scq_info * scq, int pos);
 138static void process_rsq(ns_dev * card);
 139static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe);
 140#ifdef NS_USE_DESTRUCTORS
 141static void ns_sb_destructor(struct sk_buff *sb);
 142static void ns_lb_destructor(struct sk_buff *lb);
 143static void ns_hb_destructor(struct sk_buff *hb);
 144#endif /* NS_USE_DESTRUCTORS */
 145static void recycle_rx_buf(ns_dev * card, struct sk_buff *skb);
 146static void recycle_iovec_rx_bufs(ns_dev * card, struct iovec *iov, int count);
 147static void recycle_iov_buf(ns_dev * card, struct sk_buff *iovb);
 148static void dequeue_sm_buf(ns_dev * card, struct sk_buff *sb);
 149static void dequeue_lg_buf(ns_dev * card, struct sk_buff *lb);
 150static int ns_proc_read(struct atm_dev *dev, loff_t * pos, char *page);
 151static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user * arg);
 152#ifdef EXTRA_DEBUG
 153static void which_list(ns_dev * card, struct sk_buff *skb);
 154#endif
 155static void ns_poll(unsigned long arg);
 156static int ns_parse_mac(char *mac, unsigned char *esi);
 157static void ns_phy_put(struct atm_dev *dev, unsigned char value,
 158                       unsigned long addr);
 159static unsigned char ns_phy_get(struct atm_dev *dev, unsigned long addr);
 160
 161/* Global variables */
 162
 163static struct ns_dev *cards[NS_MAX_CARDS];
 164static unsigned num_cards;
 165static struct atmdev_ops atm_ops = {
 166        .open = ns_open,
 167        .close = ns_close,
 168        .ioctl = ns_ioctl,
 169        .send = ns_send,
 170        .phy_put = ns_phy_put,
 171        .phy_get = ns_phy_get,
 172        .proc_read = ns_proc_read,
 173        .owner = THIS_MODULE,
 174};
 175
 176static struct timer_list ns_timer;
 177static char *mac[NS_MAX_CARDS];
 178module_param_array(mac, charp, NULL, 0);
 179MODULE_LICENSE("GPL");
 180
 181/* Functions */
 182
 183static int nicstar_init_one(struct pci_dev *pcidev,
 184                            const struct pci_device_id *ent)
 185{
 186        static int index = -1;
 187        unsigned int error;
 188
 189        index++;
 190        cards[index] = NULL;
 191
 192        error = ns_init_card(index, pcidev);
 193        if (error) {
 194                cards[index--] = NULL;  /* don't increment index */
 195                goto err_out;
 196        }
 197
 198        return 0;
 199err_out:
 200        return -ENODEV;
 201}
 202
 203static void nicstar_remove_one(struct pci_dev *pcidev)
 204{
 205        int i, j;
 206        ns_dev *card = pci_get_drvdata(pcidev);
 207        struct sk_buff *hb;
 208        struct sk_buff *iovb;
 209        struct sk_buff *lb;
 210        struct sk_buff *sb;
 211
 212        i = card->index;
 213
 214        if (cards[i] == NULL)
 215                return;
 216
 217        if (card->atmdev->phy && card->atmdev->phy->stop)
 218                card->atmdev->phy->stop(card->atmdev);
 219
 220        /* Stop everything */
 221        writel(0x00000000, card->membase + CFG);
 222
 223        /* De-register device */
 224        atm_dev_deregister(card->atmdev);
 225
 226        /* Disable PCI device */
 227        pci_disable_device(pcidev);
 228
 229        /* Free up resources */
 230        j = 0;
 231        PRINTK("nicstar%d: freeing %d huge buffers.\n", i, card->hbpool.count);
 232        while ((hb = skb_dequeue(&card->hbpool.queue)) != NULL) {
 233                dev_kfree_skb_any(hb);
 234                j++;
 235        }
 236        PRINTK("nicstar%d: %d huge buffers freed.\n", i, j);
 237        j = 0;
 238        PRINTK("nicstar%d: freeing %d iovec buffers.\n", i,
 239               card->iovpool.count);
 240        while ((iovb = skb_dequeue(&card->iovpool.queue)) != NULL) {
 241                dev_kfree_skb_any(iovb);
 242                j++;
 243        }
 244        PRINTK("nicstar%d: %d iovec buffers freed.\n", i, j);
 245        while ((lb = skb_dequeue(&card->lbpool.queue)) != NULL)
 246                dev_kfree_skb_any(lb);
 247        while ((sb = skb_dequeue(&card->sbpool.queue)) != NULL)
 248                dev_kfree_skb_any(sb);
 249        free_scq(card, card->scq0, NULL);
 250        for (j = 0; j < NS_FRSCD_NUM; j++) {
 251                if (card->scd2vc[j] != NULL)
 252                        free_scq(card, card->scd2vc[j]->scq, card->scd2vc[j]->tx_vcc);
 253        }
 254        idr_destroy(&card->idr);
 255        pci_free_consistent(card->pcidev, NS_RSQSIZE + NS_RSQ_ALIGNMENT,
 256                            card->rsq.org, card->rsq.dma);
 257        pci_free_consistent(card->pcidev, NS_TSQSIZE + NS_TSQ_ALIGNMENT,
 258                            card->tsq.org, card->tsq.dma);
 259        free_irq(card->pcidev->irq, card);
 260        iounmap(card->membase);
 261        kfree(card);
 262}
 263
 264static struct pci_device_id nicstar_pci_tbl[] = {
 265        { PCI_VDEVICE(IDT, PCI_DEVICE_ID_IDT_IDT77201), 0 },
 266        {0,}                    /* terminate list */
 267};
 268
 269MODULE_DEVICE_TABLE(pci, nicstar_pci_tbl);
 270
 271static struct pci_driver nicstar_driver = {
 272        .name = "nicstar",
 273        .id_table = nicstar_pci_tbl,
 274        .probe = nicstar_init_one,
 275        .remove = nicstar_remove_one,
 276};
 277
 278static int __init nicstar_init(void)
 279{
 280        unsigned error = 0;     /* Initialized to remove compile warning */
 281
 282        XPRINTK("nicstar: nicstar_init() called.\n");
 283
 284        error = pci_register_driver(&nicstar_driver);
 285
 286        TXPRINTK("nicstar: TX debug enabled.\n");
 287        RXPRINTK("nicstar: RX debug enabled.\n");
 288        PRINTK("nicstar: General debug enabled.\n");
 289#ifdef PHY_LOOPBACK
 290        printk("nicstar: using PHY loopback.\n");
 291#endif /* PHY_LOOPBACK */
 292        XPRINTK("nicstar: nicstar_init() returned.\n");
 293
 294        if (!error) {
 295                init_timer(&ns_timer);
 296                ns_timer.expires = jiffies + NS_POLL_PERIOD;
 297                ns_timer.data = 0UL;
 298                ns_timer.function = ns_poll;
 299                add_timer(&ns_timer);
 300        }
 301
 302        return error;
 303}
 304
 305static void __exit nicstar_cleanup(void)
 306{
 307        XPRINTK("nicstar: nicstar_cleanup() called.\n");
 308
 309        del_timer(&ns_timer);
 310
 311        pci_unregister_driver(&nicstar_driver);
 312
 313        XPRINTK("nicstar: nicstar_cleanup() returned.\n");
 314}
 315
 316static u32 ns_read_sram(ns_dev * card, u32 sram_address)
 317{
 318        unsigned long flags;
 319        u32 data;
 320        sram_address <<= 2;
 321        sram_address &= 0x0007FFFC;     /* address must be dword aligned */
 322        sram_address |= 0x50000000;     /* SRAM read command */
 323        spin_lock_irqsave(&card->res_lock, flags);
 324        while (CMD_BUSY(card)) ;
 325        writel(sram_address, card->membase + CMD);
 326        while (CMD_BUSY(card)) ;
 327        data = readl(card->membase + DR0);
 328        spin_unlock_irqrestore(&card->res_lock, flags);
 329        return data;
 330}
 331
 332static void ns_write_sram(ns_dev * card, u32 sram_address, u32 * value,
 333                          int count)
 334{
 335        unsigned long flags;
 336        int i, c;
 337        count--;                /* count range now is 0..3 instead of 1..4 */
 338        c = count;
 339        c <<= 2;                /* to use increments of 4 */
 340        spin_lock_irqsave(&card->res_lock, flags);
 341        while (CMD_BUSY(card)) ;
 342        for (i = 0; i <= c; i += 4)
 343                writel(*(value++), card->membase + i);
 344        /* Note: DR# registers are the first 4 dwords in nicstar's memspace,
 345           so card->membase + DR0 == card->membase */
 346        sram_address <<= 2;
 347        sram_address &= 0x0007FFFC;
 348        sram_address |= (0x40000000 | count);
 349        writel(sram_address, card->membase + CMD);
 350        spin_unlock_irqrestore(&card->res_lock, flags);
 351}
 352
 353static int ns_init_card(int i, struct pci_dev *pcidev)
 354{
 355        int j;
 356        struct ns_dev *card = NULL;
 357        unsigned char pci_latency;
 358        unsigned error;
 359        u32 data;
 360        u32 u32d[4];
 361        u32 ns_cfg_rctsize;
 362        int bcount;
 363        unsigned long membase;
 364
 365        error = 0;
 366
 367        if (pci_enable_device(pcidev)) {
 368                printk("nicstar%d: can't enable PCI device\n", i);
 369                error = 2;
 370                ns_init_card_error(card, error);
 371                return error;
 372        }
 373        if ((pci_set_dma_mask(pcidev, DMA_BIT_MASK(32)) != 0) ||
 374            (pci_set_consistent_dma_mask(pcidev, DMA_BIT_MASK(32)) != 0)) {
 375                printk(KERN_WARNING
 376                       "nicstar%d: No suitable DMA available.\n", i);
 377                error = 2;
 378                ns_init_card_error(card, error);
 379                return error;
 380        }
 381
 382        if ((card = kmalloc(sizeof(ns_dev), GFP_KERNEL)) == NULL) {
 383                printk
 384                    ("nicstar%d: can't allocate memory for device structure.\n",
 385                     i);
 386                error = 2;
 387                ns_init_card_error(card, error);
 388                return error;
 389        }
 390        cards[i] = card;
 391        spin_lock_init(&card->int_lock);
 392        spin_lock_init(&card->res_lock);
 393
 394        pci_set_drvdata(pcidev, card);
 395
 396        card->index = i;
 397        card->atmdev = NULL;
 398        card->pcidev = pcidev;
 399        membase = pci_resource_start(pcidev, 1);
 400        card->membase = ioremap(membase, NS_IOREMAP_SIZE);
 401        if (!card->membase) {
 402                printk("nicstar%d: can't ioremap() membase.\n", i);
 403                error = 3;
 404                ns_init_card_error(card, error);
 405                return error;
 406        }
 407        PRINTK("nicstar%d: membase at 0x%p.\n", i, card->membase);
 408
 409        pci_set_master(pcidev);
 410
 411        if (pci_read_config_byte(pcidev, PCI_LATENCY_TIMER, &pci_latency) != 0) {
 412                printk("nicstar%d: can't read PCI latency timer.\n", i);
 413                error = 6;
 414                ns_init_card_error(card, error);
 415                return error;
 416        }
 417#ifdef NS_PCI_LATENCY
 418        if (pci_latency < NS_PCI_LATENCY) {
 419                PRINTK("nicstar%d: setting PCI latency timer to %d.\n", i,
 420                       NS_PCI_LATENCY);
 421                for (j = 1; j < 4; j++) {
 422                        if (pci_write_config_byte
 423                            (pcidev, PCI_LATENCY_TIMER, NS_PCI_LATENCY) != 0)
 424                                break;
 425                }
 426                if (j == 4) {
 427                        printk
 428                            ("nicstar%d: can't set PCI latency timer to %d.\n",
 429                             i, NS_PCI_LATENCY);
 430                        error = 7;
 431                        ns_init_card_error(card, error);
 432                        return error;
 433                }
 434        }
 435#endif /* NS_PCI_LATENCY */
 436
 437        /* Clear timer overflow */
 438        data = readl(card->membase + STAT);
 439        if (data & NS_STAT_TMROF)
 440                writel(NS_STAT_TMROF, card->membase + STAT);
 441
 442        /* Software reset */
 443        writel(NS_CFG_SWRST, card->membase + CFG);
 444        NS_DELAY;
 445        writel(0x00000000, card->membase + CFG);
 446
 447        /* PHY reset */
 448        writel(0x00000008, card->membase + GP);
 449        NS_DELAY;
 450        writel(0x00000001, card->membase + GP);
 451        NS_DELAY;
 452        while (CMD_BUSY(card)) ;
 453        writel(NS_CMD_WRITE_UTILITY | 0x00000100, card->membase + CMD); /* Sync UTOPIA with SAR clock */
 454        NS_DELAY;
 455
 456        /* Detect PHY type */
 457        while (CMD_BUSY(card)) ;
 458        writel(NS_CMD_READ_UTILITY | 0x00000200, card->membase + CMD);
 459        while (CMD_BUSY(card)) ;
 460        data = readl(card->membase + DR0);
 461        switch (data) {
 462        case 0x00000009:
 463                printk("nicstar%d: PHY seems to be 25 Mbps.\n", i);
 464                card->max_pcr = ATM_25_PCR;
 465                while (CMD_BUSY(card)) ;
 466                writel(0x00000008, card->membase + DR0);
 467                writel(NS_CMD_WRITE_UTILITY | 0x00000200, card->membase + CMD);
 468                /* Clear an eventual pending interrupt */
 469                writel(NS_STAT_SFBQF, card->membase + STAT);
 470#ifdef PHY_LOOPBACK
 471                while (CMD_BUSY(card)) ;
 472                writel(0x00000022, card->membase + DR0);
 473                writel(NS_CMD_WRITE_UTILITY | 0x00000202, card->membase + CMD);
 474#endif /* PHY_LOOPBACK */
 475                break;
 476        case 0x00000030:
 477        case 0x00000031:
 478                printk("nicstar%d: PHY seems to be 155 Mbps.\n", i);
 479                card->max_pcr = ATM_OC3_PCR;
 480#ifdef PHY_LOOPBACK
 481                while (CMD_BUSY(card)) ;
 482                writel(0x00000002, card->membase + DR0);
 483                writel(NS_CMD_WRITE_UTILITY | 0x00000205, card->membase + CMD);
 484#endif /* PHY_LOOPBACK */
 485                break;
 486        default:
 487                printk("nicstar%d: unknown PHY type (0x%08X).\n", i, data);
 488                error = 8;
 489                ns_init_card_error(card, error);
 490                return error;
 491        }
 492        writel(0x00000000, card->membase + GP);
 493
 494        /* Determine SRAM size */
 495        data = 0x76543210;
 496        ns_write_sram(card, 0x1C003, &data, 1);
 497        data = 0x89ABCDEF;
 498        ns_write_sram(card, 0x14003, &data, 1);
 499        if (ns_read_sram(card, 0x14003) == 0x89ABCDEF &&
 500            ns_read_sram(card, 0x1C003) == 0x76543210)
 501                card->sram_size = 128;
 502        else
 503                card->sram_size = 32;
 504        PRINTK("nicstar%d: %dK x 32bit SRAM size.\n", i, card->sram_size);
 505
 506        card->rct_size = NS_MAX_RCTSIZE;
 507
 508#if (NS_MAX_RCTSIZE == 4096)
 509        if (card->sram_size == 128)
 510                printk
 511                    ("nicstar%d: limiting maximum VCI. See NS_MAX_RCTSIZE in nicstar.h\n",
 512                     i);
 513#elif (NS_MAX_RCTSIZE == 16384)
 514        if (card->sram_size == 32) {
 515                printk
 516                    ("nicstar%d: wasting memory. See NS_MAX_RCTSIZE in nicstar.h\n",
 517                     i);
 518                card->rct_size = 4096;
 519        }
 520#else
 521#error NS_MAX_RCTSIZE must be either 4096 or 16384 in nicstar.c
 522#endif
 523
 524        card->vpibits = NS_VPIBITS;
 525        if (card->rct_size == 4096)
 526                card->vcibits = 12 - NS_VPIBITS;
 527        else                    /* card->rct_size == 16384 */
 528                card->vcibits = 14 - NS_VPIBITS;
 529
 530        /* Initialize the nicstar eeprom/eprom stuff, for the MAC addr */
 531        if (mac[i] == NULL)
 532                nicstar_init_eprom(card->membase);
 533
 534        /* Set the VPI/VCI MSb mask to zero so we can receive OAM cells */
 535        writel(0x00000000, card->membase + VPM);
 536
 537        /* Initialize TSQ */
 538        card->tsq.org = pci_alloc_consistent(card->pcidev,
 539                                             NS_TSQSIZE + NS_TSQ_ALIGNMENT,
 540                                             &card->tsq.dma);
 541        if (card->tsq.org == NULL) {
 542                printk("nicstar%d: can't allocate TSQ.\n", i);
 543                error = 10;
 544                ns_init_card_error(card, error);
 545                return error;
 546        }
 547        card->tsq.base = PTR_ALIGN(card->tsq.org, NS_TSQ_ALIGNMENT);
 548        card->tsq.next = card->tsq.base;
 549        card->tsq.last = card->tsq.base + (NS_TSQ_NUM_ENTRIES - 1);
 550        for (j = 0; j < NS_TSQ_NUM_ENTRIES; j++)
 551                ns_tsi_init(card->tsq.base + j);
 552        writel(0x00000000, card->membase + TSQH);
 553        writel(ALIGN(card->tsq.dma, NS_TSQ_ALIGNMENT), card->membase + TSQB);
 554        PRINTK("nicstar%d: TSQ base at 0x%p.\n", i, card->tsq.base);
 555
 556        /* Initialize RSQ */
 557        card->rsq.org = pci_alloc_consistent(card->pcidev,
 558                                             NS_RSQSIZE + NS_RSQ_ALIGNMENT,
 559                                             &card->rsq.dma);
 560        if (card->rsq.org == NULL) {
 561                printk("nicstar%d: can't allocate RSQ.\n", i);
 562                error = 11;
 563                ns_init_card_error(card, error);
 564                return error;
 565        }
 566        card->rsq.base = PTR_ALIGN(card->rsq.org, NS_RSQ_ALIGNMENT);
 567        card->rsq.next = card->rsq.base;
 568        card->rsq.last = card->rsq.base + (NS_RSQ_NUM_ENTRIES - 1);
 569        for (j = 0; j < NS_RSQ_NUM_ENTRIES; j++)
 570                ns_rsqe_init(card->rsq.base + j);
 571        writel(0x00000000, card->membase + RSQH);
 572        writel(ALIGN(card->rsq.dma, NS_RSQ_ALIGNMENT), card->membase + RSQB);
 573        PRINTK("nicstar%d: RSQ base at 0x%p.\n", i, card->rsq.base);
 574
 575        /* Initialize SCQ0, the only VBR SCQ used */
 576        card->scq1 = NULL;
 577        card->scq2 = NULL;
 578        card->scq0 = get_scq(card, VBR_SCQSIZE, NS_VRSCD0);
 579        if (card->scq0 == NULL) {
 580                printk("nicstar%d: can't get SCQ0.\n", i);
 581                error = 12;
 582                ns_init_card_error(card, error);
 583                return error;
 584        }
 585        u32d[0] = scq_virt_to_bus(card->scq0, card->scq0->base);
 586        u32d[1] = (u32) 0x00000000;
 587        u32d[2] = (u32) 0xffffffff;
 588        u32d[3] = (u32) 0x00000000;
 589        ns_write_sram(card, NS_VRSCD0, u32d, 4);
 590        ns_write_sram(card, NS_VRSCD1, u32d, 4);        /* These last two won't be used */
 591        ns_write_sram(card, NS_VRSCD2, u32d, 4);        /* but are initialized, just in case... */
 592        card->scq0->scd = NS_VRSCD0;
 593        PRINTK("nicstar%d: VBR-SCQ0 base at 0x%p.\n", i, card->scq0->base);
 594
 595        /* Initialize TSTs */
 596        card->tst_addr = NS_TST0;
 597        card->tst_free_entries = NS_TST_NUM_ENTRIES;
 598        data = NS_TST_OPCODE_VARIABLE;
 599        for (j = 0; j < NS_TST_NUM_ENTRIES; j++)
 600                ns_write_sram(card, NS_TST0 + j, &data, 1);
 601        data = ns_tste_make(NS_TST_OPCODE_END, NS_TST0);
 602        ns_write_sram(card, NS_TST0 + NS_TST_NUM_ENTRIES, &data, 1);
 603        for (j = 0; j < NS_TST_NUM_ENTRIES; j++)
 604                ns_write_sram(card, NS_TST1 + j, &data, 1);
 605        data = ns_tste_make(NS_TST_OPCODE_END, NS_TST1);
 606        ns_write_sram(card, NS_TST1 + NS_TST_NUM_ENTRIES, &data, 1);
 607        for (j = 0; j < NS_TST_NUM_ENTRIES; j++)
 608                card->tste2vc[j] = NULL;
 609        writel(NS_TST0 << 2, card->membase + TSTB);
 610
 611        /* Initialize RCT. AAL type is set on opening the VC. */
 612#ifdef RCQ_SUPPORT
 613        u32d[0] = NS_RCTE_RAWCELLINTEN;
 614#else
 615        u32d[0] = 0x00000000;
 616#endif /* RCQ_SUPPORT */
 617        u32d[1] = 0x00000000;
 618        u32d[2] = 0x00000000;
 619        u32d[3] = 0xFFFFFFFF;
 620        for (j = 0; j < card->rct_size; j++)
 621                ns_write_sram(card, j * 4, u32d, 4);
 622
 623        memset(card->vcmap, 0, NS_MAX_RCTSIZE * sizeof(vc_map));
 624
 625        for (j = 0; j < NS_FRSCD_NUM; j++)
 626                card->scd2vc[j] = NULL;
 627
 628        /* Initialize buffer levels */
 629        card->sbnr.min = MIN_SB;
 630        card->sbnr.init = NUM_SB;
 631        card->sbnr.max = MAX_SB;
 632        card->lbnr.min = MIN_LB;
 633        card->lbnr.init = NUM_LB;
 634        card->lbnr.max = MAX_LB;
 635        card->iovnr.min = MIN_IOVB;
 636        card->iovnr.init = NUM_IOVB;
 637        card->iovnr.max = MAX_IOVB;
 638        card->hbnr.min = MIN_HB;
 639        card->hbnr.init = NUM_HB;
 640        card->hbnr.max = MAX_HB;
 641
 642        card->sm_handle = 0x00000000;
 643        card->sm_addr = 0x00000000;
 644        card->lg_handle = 0x00000000;
 645        card->lg_addr = 0x00000000;
 646
 647        card->efbie = 1;        /* To prevent push_rxbufs from enabling the interrupt */
 648
 649        idr_init(&card->idr);
 650
 651        /* Pre-allocate some huge buffers */
 652        skb_queue_head_init(&card->hbpool.queue);
 653        card->hbpool.count = 0;
 654        for (j = 0; j < NUM_HB; j++) {
 655                struct sk_buff *hb;
 656                hb = __dev_alloc_skb(NS_HBUFSIZE, GFP_KERNEL);
 657                if (hb == NULL) {
 658                        printk
 659                            ("nicstar%d: can't allocate %dth of %d huge buffers.\n",
 660                             i, j, NUM_HB);
 661                        error = 13;
 662                        ns_init_card_error(card, error);
 663                        return error;
 664                }
 665                NS_PRV_BUFTYPE(hb) = BUF_NONE;
 666                skb_queue_tail(&card->hbpool.queue, hb);
 667                card->hbpool.count++;
 668        }
 669
 670        /* Allocate large buffers */
 671        skb_queue_head_init(&card->lbpool.queue);
 672        card->lbpool.count = 0; /* Not used */
 673        for (j = 0; j < NUM_LB; j++) {
 674                struct sk_buff *lb;
 675                lb = __dev_alloc_skb(NS_LGSKBSIZE, GFP_KERNEL);
 676                if (lb == NULL) {
 677                        printk
 678                            ("nicstar%d: can't allocate %dth of %d large buffers.\n",
 679                             i, j, NUM_LB);
 680                        error = 14;
 681                        ns_init_card_error(card, error);
 682                        return error;
 683                }
 684                NS_PRV_BUFTYPE(lb) = BUF_LG;
 685                skb_queue_tail(&card->lbpool.queue, lb);
 686                skb_reserve(lb, NS_SMBUFSIZE);
 687                push_rxbufs(card, lb);
 688                /* Due to the implementation of push_rxbufs() this is 1, not 0 */
 689                if (j == 1) {
 690                        card->rcbuf = lb;
 691                        card->rawcell = (struct ns_rcqe *) lb->data;
 692                        card->rawch = NS_PRV_DMA(lb);
 693                }
 694        }
 695        /* Test for strange behaviour which leads to crashes */
 696        if ((bcount =
 697             ns_stat_lfbqc_get(readl(card->membase + STAT))) < card->lbnr.min) {
 698                printk
 699                    ("nicstar%d: Strange... Just allocated %d large buffers and lfbqc = %d.\n",
 700                     i, j, bcount);
 701                error = 14;
 702                ns_init_card_error(card, error);
 703                return error;
 704        }
 705
 706        /* Allocate small buffers */
 707        skb_queue_head_init(&card->sbpool.queue);
 708        card->sbpool.count = 0; /* Not used */
 709        for (j = 0; j < NUM_SB; j++) {
 710                struct sk_buff *sb;
 711                sb = __dev_alloc_skb(NS_SMSKBSIZE, GFP_KERNEL);
 712                if (sb == NULL) {
 713                        printk
 714                            ("nicstar%d: can't allocate %dth of %d small buffers.\n",
 715                             i, j, NUM_SB);
 716                        error = 15;
 717                        ns_init_card_error(card, error);
 718                        return error;
 719                }
 720                NS_PRV_BUFTYPE(sb) = BUF_SM;
 721                skb_queue_tail(&card->sbpool.queue, sb);
 722                skb_reserve(sb, NS_AAL0_HEADER);
 723                push_rxbufs(card, sb);
 724        }
 725        /* Test for strange behaviour which leads to crashes */
 726        if ((bcount =
 727             ns_stat_sfbqc_get(readl(card->membase + STAT))) < card->sbnr.min) {
 728                printk
 729                    ("nicstar%d: Strange... Just allocated %d small buffers and sfbqc = %d.\n",
 730                     i, j, bcount);
 731                error = 15;
 732                ns_init_card_error(card, error);
 733                return error;
 734        }
 735
 736        /* Allocate iovec buffers */
 737        skb_queue_head_init(&card->iovpool.queue);
 738        card->iovpool.count = 0;
 739        for (j = 0; j < NUM_IOVB; j++) {
 740                struct sk_buff *iovb;
 741                iovb = alloc_skb(NS_IOVBUFSIZE, GFP_KERNEL);
 742                if (iovb == NULL) {
 743                        printk
 744                            ("nicstar%d: can't allocate %dth of %d iovec buffers.\n",
 745                             i, j, NUM_IOVB);
 746                        error = 16;
 747                        ns_init_card_error(card, error);
 748                        return error;
 749                }
 750                NS_PRV_BUFTYPE(iovb) = BUF_NONE;
 751                skb_queue_tail(&card->iovpool.queue, iovb);
 752                card->iovpool.count++;
 753        }
 754
 755        /* Configure NICStAR */
 756        if (card->rct_size == 4096)
 757                ns_cfg_rctsize = NS_CFG_RCTSIZE_4096_ENTRIES;
 758        else                    /* (card->rct_size == 16384) */
 759                ns_cfg_rctsize = NS_CFG_RCTSIZE_16384_ENTRIES;
 760
 761        card->efbie = 1;
 762
 763        card->intcnt = 0;
 764        if (request_irq
 765            (pcidev->irq, &ns_irq_handler, IRQF_SHARED, "nicstar", card) != 0) {
 766                printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq);
 767                error = 9;
 768                ns_init_card_error(card, error);
 769                return error;
 770        }
 771
 772        /* Register device */
 773        card->atmdev = atm_dev_register("nicstar", &card->pcidev->dev, &atm_ops,
 774                                        -1, NULL);
 775        if (card->atmdev == NULL) {
 776                printk("nicstar%d: can't register device.\n", i);
 777                error = 17;
 778                ns_init_card_error(card, error);
 779                return error;
 780        }
 781
 782        if (ns_parse_mac(mac[i], card->atmdev->esi)) {
 783                nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET,
 784                                   card->atmdev->esi, 6);
 785                if (memcmp(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00", 6) ==
 786                    0) {
 787                        nicstar_read_eprom(card->membase,
 788                                           NICSTAR_EPROM_MAC_ADDR_OFFSET_ALT,
 789                                           card->atmdev->esi, 6);
 790                }
 791        }
 792
 793        printk("nicstar%d: MAC address %pM\n", i, card->atmdev->esi);
 794
 795        card->atmdev->dev_data = card;
 796        card->atmdev->ci_range.vpi_bits = card->vpibits;
 797        card->atmdev->ci_range.vci_bits = card->vcibits;
 798        card->atmdev->link_rate = card->max_pcr;
 799        card->atmdev->phy = NULL;
 800
 801#ifdef CONFIG_ATM_NICSTAR_USE_SUNI
 802        if (card->max_pcr == ATM_OC3_PCR)
 803                suni_init(card->atmdev);
 804#endif /* CONFIG_ATM_NICSTAR_USE_SUNI */
 805
 806#ifdef CONFIG_ATM_NICSTAR_USE_IDT77105
 807        if (card->max_pcr == ATM_25_PCR)
 808                idt77105_init(card->atmdev);
 809#endif /* CONFIG_ATM_NICSTAR_USE_IDT77105 */
 810
 811        if (card->atmdev->phy && card->atmdev->phy->start)
 812                card->atmdev->phy->start(card->atmdev);
 813
 814        writel(NS_CFG_RXPATH | NS_CFG_SMBUFSIZE | NS_CFG_LGBUFSIZE | NS_CFG_EFBIE | NS_CFG_RSQSIZE | NS_CFG_VPIBITS | ns_cfg_rctsize | NS_CFG_RXINT_NODELAY | NS_CFG_RAWIE |    /* Only enabled if RCQ_SUPPORT */
 815               NS_CFG_RSQAFIE | NS_CFG_TXEN | NS_CFG_TXIE | NS_CFG_TSQFIE_OPT | /* Only enabled if ENABLE_TSQFIE */
 816               NS_CFG_PHYIE, card->membase + CFG);
 817
 818        num_cards++;
 819
 820        return error;
 821}
 822
 823static void ns_init_card_error(ns_dev *card, int error)
 824{
 825        if (error >= 17) {
 826                writel(0x00000000, card->membase + CFG);
 827        }
 828        if (error >= 16) {
 829                struct sk_buff *iovb;
 830                while ((iovb = skb_dequeue(&card->iovpool.queue)) != NULL)
 831                        dev_kfree_skb_any(iovb);
 832        }
 833        if (error >= 15) {
 834                struct sk_buff *sb;
 835                while ((sb = skb_dequeue(&card->sbpool.queue)) != NULL)
 836                        dev_kfree_skb_any(sb);
 837                free_scq(card, card->scq0, NULL);
 838        }
 839        if (error >= 14) {
 840                struct sk_buff *lb;
 841                while ((lb = skb_dequeue(&card->lbpool.queue)) != NULL)
 842                        dev_kfree_skb_any(lb);
 843        }
 844        if (error >= 13) {
 845                struct sk_buff *hb;
 846                while ((hb = skb_dequeue(&card->hbpool.queue)) != NULL)
 847                        dev_kfree_skb_any(hb);
 848        }
 849        if (error >= 12) {
 850                kfree(card->rsq.org);
 851        }
 852        if (error >= 11) {
 853                kfree(card->tsq.org);
 854        }
 855        if (error >= 10) {
 856                free_irq(card->pcidev->irq, card);
 857        }
 858        if (error >= 4) {
 859                iounmap(card->membase);
 860        }
 861        if (error >= 3) {
 862                pci_disable_device(card->pcidev);
 863                kfree(card);
 864        }
 865}
 866
 867static scq_info *get_scq(ns_dev *card, int size, u32 scd)
 868{
 869        scq_info *scq;
 870        int i;
 871
 872        if (size != VBR_SCQSIZE && size != CBR_SCQSIZE)
 873                return NULL;
 874
 875        scq = kmalloc(sizeof(scq_info), GFP_KERNEL);
 876        if (!scq)
 877                return NULL;
 878        scq->org = pci_alloc_consistent(card->pcidev, 2 * size, &scq->dma);
 879        if (!scq->org) {
 880                kfree(scq);
 881                return NULL;
 882        }
 883        scq->skb = kmalloc(sizeof(struct sk_buff *) *
 884                           (size / NS_SCQE_SIZE), GFP_KERNEL);
 885        if (!scq->skb) {
 886                kfree(scq->org);
 887                kfree(scq);
 888                return NULL;
 889        }
 890        scq->num_entries = size / NS_SCQE_SIZE;
 891        scq->base = PTR_ALIGN(scq->org, size);
 892        scq->next = scq->base;
 893        scq->last = scq->base + (scq->num_entries - 1);
 894        scq->tail = scq->last;
 895        scq->scd = scd;
 896        scq->num_entries = size / NS_SCQE_SIZE;
 897        scq->tbd_count = 0;
 898        init_waitqueue_head(&scq->scqfull_waitq);
 899        scq->full = 0;
 900        spin_lock_init(&scq->lock);
 901
 902        for (i = 0; i < scq->num_entries; i++)
 903                scq->skb[i] = NULL;
 904
 905        return scq;
 906}
 907
 908/* For variable rate SCQ vcc must be NULL */
 909static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc)
 910{
 911        int i;
 912
 913        if (scq->num_entries == VBR_SCQ_NUM_ENTRIES)
 914                for (i = 0; i < scq->num_entries; i++) {
 915                        if (scq->skb[i] != NULL) {
 916                                vcc = ATM_SKB(scq->skb[i])->vcc;
 917                                if (vcc->pop != NULL)
 918                                        vcc->pop(vcc, scq->skb[i]);
 919                                else
 920                                        dev_kfree_skb_any(scq->skb[i]);
 921                        }
 922        } else {                /* vcc must be != NULL */
 923
 924                if (vcc == NULL) {
 925                        printk
 926                            ("nicstar: free_scq() called with vcc == NULL for fixed rate scq.");
 927                        for (i = 0; i < scq->num_entries; i++)
 928                                dev_kfree_skb_any(scq->skb[i]);
 929                } else
 930                        for (i = 0; i < scq->num_entries; i++) {
 931                                if (scq->skb[i] != NULL) {
 932                                        if (vcc->pop != NULL)
 933                                                vcc->pop(vcc, scq->skb[i]);
 934                                        else
 935                                                dev_kfree_skb_any(scq->skb[i]);
 936                                }
 937                        }
 938        }
 939        kfree(scq->skb);
 940        pci_free_consistent(card->pcidev,
 941                            2 * (scq->num_entries == VBR_SCQ_NUM_ENTRIES ?
 942                                 VBR_SCQSIZE : CBR_SCQSIZE),
 943                            scq->org, scq->dma);
 944        kfree(scq);
 945}
 946
 947/* The handles passed must be pointers to the sk_buff containing the small
 948   or large buffer(s) cast to u32. */
 949static void push_rxbufs(ns_dev * card, struct sk_buff *skb)
 950{
 951        struct sk_buff *handle1, *handle2;
 952        int id1, id2;
 953        u32 addr1, addr2;
 954        u32 stat;
 955        unsigned long flags;
 956
 957        /* *BARF* */
 958        handle2 = NULL;
 959        addr2 = 0;
 960        handle1 = skb;
 961        addr1 = pci_map_single(card->pcidev,
 962                               skb->data,
 963                               (NS_PRV_BUFTYPE(skb) == BUF_SM
 964                                ? NS_SMSKBSIZE : NS_LGSKBSIZE),
 965                               PCI_DMA_TODEVICE);
 966        NS_PRV_DMA(skb) = addr1; /* save so we can unmap later */
 967
 968#ifdef GENERAL_DEBUG
 969        if (!addr1)
 970                printk("nicstar%d: push_rxbufs called with addr1 = 0.\n",
 971                       card->index);
 972#endif /* GENERAL_DEBUG */
 973
 974        stat = readl(card->membase + STAT);
 975        card->sbfqc = ns_stat_sfbqc_get(stat);
 976        card->lbfqc = ns_stat_lfbqc_get(stat);
 977        if (NS_PRV_BUFTYPE(skb) == BUF_SM) {
 978                if (!addr2) {
 979                        if (card->sm_addr) {
 980                                addr2 = card->sm_addr;
 981                                handle2 = card->sm_handle;
 982                                card->sm_addr = 0x00000000;
 983                                card->sm_handle = 0x00000000;
 984                        } else {        /* (!sm_addr) */
 985
 986                                card->sm_addr = addr1;
 987                                card->sm_handle = handle1;
 988                        }
 989                }
 990        } else {                /* buf_type == BUF_LG */
 991
 992                if (!addr2) {
 993                        if (card->lg_addr) {
 994                                addr2 = card->lg_addr;
 995                                handle2 = card->lg_handle;
 996                                card->lg_addr = 0x00000000;
 997                                card->lg_handle = 0x00000000;
 998                        } else {        /* (!lg_addr) */
 999
1000                                card->lg_addr = addr1;
1001                                card->lg_handle = handle1;
1002                        }
1003                }
1004        }
1005
1006        if (addr2) {
1007                if (NS_PRV_BUFTYPE(skb) == BUF_SM) {
1008                        if (card->sbfqc >= card->sbnr.max) {
1009                                skb_unlink(handle1, &card->sbpool.queue);
1010                                dev_kfree_skb_any(handle1);
1011                                skb_unlink(handle2, &card->sbpool.queue);
1012                                dev_kfree_skb_any(handle2);
1013                                return;
1014                        } else
1015                                card->sbfqc += 2;
1016                } else {        /* (buf_type == BUF_LG) */
1017
1018                        if (card->lbfqc >= card->lbnr.max) {
1019                                skb_unlink(handle1, &card->lbpool.queue);
1020                                dev_kfree_skb_any(handle1);
1021                                skb_unlink(handle2, &card->lbpool.queue);
1022                                dev_kfree_skb_any(handle2);
1023                                return;
1024                        } else
1025                                card->lbfqc += 2;
1026                }
1027
1028                id1 = idr_alloc(&card->idr, handle1, 0, 0, GFP_ATOMIC);
1029                if (id1 < 0)
1030                        goto out;
1031
1032                id2 = idr_alloc(&card->idr, handle2, 0, 0, GFP_ATOMIC);
1033                if (id2 < 0)
1034                        goto out;
1035
1036                spin_lock_irqsave(&card->res_lock, flags);
1037                while (CMD_BUSY(card)) ;
1038                writel(addr2, card->membase + DR3);
1039                writel(id2, card->membase + DR2);
1040                writel(addr1, card->membase + DR1);
1041                writel(id1, card->membase + DR0);
1042                writel(NS_CMD_WRITE_FREEBUFQ | NS_PRV_BUFTYPE(skb),
1043                       card->membase + CMD);
1044                spin_unlock_irqrestore(&card->res_lock, flags);
1045
1046                XPRINTK("nicstar%d: Pushing %s buffers at 0x%x and 0x%x.\n",
1047                        card->index,
1048                        (NS_PRV_BUFTYPE(skb) == BUF_SM ? "small" : "large"),
1049                        addr1, addr2);
1050        }
1051
1052        if (!card->efbie && card->sbfqc >= card->sbnr.min &&
1053            card->lbfqc >= card->lbnr.min) {
1054                card->efbie = 1;
1055                writel((readl(card->membase + CFG) | NS_CFG_EFBIE),
1056                       card->membase + CFG);
1057        }
1058
1059out:
1060        return;
1061}
1062
1063static irqreturn_t ns_irq_handler(int irq, void *dev_id)
1064{
1065        u32 stat_r;
1066        ns_dev *card;
1067        struct atm_dev *dev;
1068        unsigned long flags;
1069
1070        card = (ns_dev *) dev_id;
1071        dev = card->atmdev;
1072        card->intcnt++;
1073
1074        PRINTK("nicstar%d: NICStAR generated an interrupt\n", card->index);
1075
1076        spin_lock_irqsave(&card->int_lock, flags);
1077
1078        stat_r = readl(card->membase + STAT);
1079
1080        /* Transmit Status Indicator has been written to T. S. Queue */
1081        if (stat_r & NS_STAT_TSIF) {
1082                TXPRINTK("nicstar%d: TSI interrupt\n", card->index);
1083                process_tsq(card);
1084                writel(NS_STAT_TSIF, card->membase + STAT);
1085        }
1086
1087        /* Incomplete CS-PDU has been transmitted */
1088        if (stat_r & NS_STAT_TXICP) {
1089                writel(NS_STAT_TXICP, card->membase + STAT);
1090                TXPRINTK("nicstar%d: Incomplete CS-PDU transmitted.\n",
1091                         card->index);
1092        }
1093
1094        /* Transmit Status Queue 7/8 full */
1095        if (stat_r & NS_STAT_TSQF) {
1096                writel(NS_STAT_TSQF, card->membase + STAT);
1097                PRINTK("nicstar%d: TSQ full.\n", card->index);
1098                process_tsq(card);
1099        }
1100
1101        /* Timer overflow */
1102        if (stat_r & NS_STAT_TMROF) {
1103                writel(NS_STAT_TMROF, card->membase + STAT);
1104                PRINTK("nicstar%d: Timer overflow.\n", card->index);
1105        }
1106
1107        /* PHY device interrupt signal active */
1108        if (stat_r & NS_STAT_PHYI) {
1109                writel(NS_STAT_PHYI, card->membase + STAT);
1110                PRINTK("nicstar%d: PHY interrupt.\n", card->index);
1111                if (dev->phy && dev->phy->interrupt) {
1112                        dev->phy->interrupt(dev);
1113                }
1114        }
1115
1116        /* Small Buffer Queue is full */
1117        if (stat_r & NS_STAT_SFBQF) {
1118                writel(NS_STAT_SFBQF, card->membase + STAT);
1119                printk("nicstar%d: Small free buffer queue is full.\n",
1120                       card->index);
1121        }
1122
1123        /* Large Buffer Queue is full */
1124        if (stat_r & NS_STAT_LFBQF) {
1125                writel(NS_STAT_LFBQF, card->membase + STAT);
1126                printk("nicstar%d: Large free buffer queue is full.\n",
1127                       card->index);
1128        }
1129
1130        /* Receive Status Queue is full */
1131        if (stat_r & NS_STAT_RSQF) {
1132                writel(NS_STAT_RSQF, card->membase + STAT);
1133                printk("nicstar%d: RSQ full.\n", card->index);
1134                process_rsq(card);
1135        }
1136
1137        /* Complete CS-PDU received */
1138        if (stat_r & NS_STAT_EOPDU) {
1139                RXPRINTK("nicstar%d: End of CS-PDU received.\n", card->index);
1140                process_rsq(card);
1141                writel(NS_STAT_EOPDU, card->membase + STAT);
1142        }
1143
1144        /* Raw cell received */
1145        if (stat_r & NS_STAT_RAWCF) {
1146                writel(NS_STAT_RAWCF, card->membase + STAT);
1147#ifndef RCQ_SUPPORT
1148                printk("nicstar%d: Raw cell received and no support yet...\n",
1149                       card->index);
1150#endif /* RCQ_SUPPORT */
1151                /* NOTE: the following procedure may keep a raw cell pending until the
1152                   next interrupt. As this preliminary support is only meant to
1153                   avoid buffer leakage, this is not an issue. */
1154                while (readl(card->membase + RAWCT) != card->rawch) {
1155
1156                        if (ns_rcqe_islast(card->rawcell)) {
1157                                struct sk_buff *oldbuf;
1158
1159                                oldbuf = card->rcbuf;
1160                                card->rcbuf = idr_find(&card->idr,
1161                                                       ns_rcqe_nextbufhandle(card->rawcell));
1162                                card->rawch = NS_PRV_DMA(card->rcbuf);
1163                                card->rawcell = (struct ns_rcqe *)
1164                                                card->rcbuf->data;
1165                                recycle_rx_buf(card, oldbuf);
1166                        } else {
1167                                card->rawch += NS_RCQE_SIZE;
1168                                card->rawcell++;
1169                        }
1170                }
1171        }
1172
1173        /* Small buffer queue is empty */
1174        if (stat_r & NS_STAT_SFBQE) {
1175                int i;
1176                struct sk_buff *sb;
1177
1178                writel(NS_STAT_SFBQE, card->membase + STAT);
1179                printk("nicstar%d: Small free buffer queue empty.\n",
1180                       card->index);
1181                for (i = 0; i < card->sbnr.min; i++) {
1182                        sb = dev_alloc_skb(NS_SMSKBSIZE);
1183                        if (sb == NULL) {
1184                                writel(readl(card->membase + CFG) &
1185                                       ~NS_CFG_EFBIE, card->membase + CFG);
1186                                card->efbie = 0;
1187                                break;
1188                        }
1189                        NS_PRV_BUFTYPE(sb) = BUF_SM;
1190                        skb_queue_tail(&card->sbpool.queue, sb);
1191                        skb_reserve(sb, NS_AAL0_HEADER);
1192                        push_rxbufs(card, sb);
1193                }
1194                card->sbfqc = i;
1195                process_rsq(card);
1196        }
1197
1198        /* Large buffer queue empty */
1199        if (stat_r & NS_STAT_LFBQE) {
1200                int i;
1201                struct sk_buff *lb;
1202
1203                writel(NS_STAT_LFBQE, card->membase + STAT);
1204                printk("nicstar%d: Large free buffer queue empty.\n",
1205                       card->index);
1206                for (i = 0; i < card->lbnr.min; i++) {
1207                        lb = dev_alloc_skb(NS_LGSKBSIZE);
1208                        if (lb == NULL) {
1209                                writel(readl(card->membase + CFG) &
1210                                       ~NS_CFG_EFBIE, card->membase + CFG);
1211                                card->efbie = 0;
1212                                break;
1213                        }
1214                        NS_PRV_BUFTYPE(lb) = BUF_LG;
1215                        skb_queue_tail(&card->lbpool.queue, lb);
1216                        skb_reserve(lb, NS_SMBUFSIZE);
1217                        push_rxbufs(card, lb);
1218                }
1219                card->lbfqc = i;
1220                process_rsq(card);
1221        }
1222
1223        /* Receive Status Queue is 7/8 full */
1224        if (stat_r & NS_STAT_RSQAF) {
1225                writel(NS_STAT_RSQAF, card->membase + STAT);
1226                RXPRINTK("nicstar%d: RSQ almost full.\n", card->index);
1227                process_rsq(card);
1228        }
1229
1230        spin_unlock_irqrestore(&card->int_lock, flags);
1231        PRINTK("nicstar%d: end of interrupt service\n", card->index);
1232        return IRQ_HANDLED;
1233}
1234
1235static int ns_open(struct atm_vcc *vcc)
1236{
1237        ns_dev *card;
1238        vc_map *vc;
1239        unsigned long tmpl, modl;
1240        int tcr, tcra;          /* target cell rate, and absolute value */
1241        int n = 0;              /* Number of entries in the TST. Initialized to remove
1242                                   the compiler warning. */
1243        u32 u32d[4];
1244        int frscdi = 0;         /* Index of the SCD. Initialized to remove the compiler
1245                                   warning. How I wish compilers were clever enough to
1246                                   tell which variables can truly be used
1247                                   uninitialized... */
1248        int inuse;              /* tx or rx vc already in use by another vcc */
1249        short vpi = vcc->vpi;
1250        int vci = vcc->vci;
1251
1252        card = (ns_dev *) vcc->dev->dev_data;
1253        PRINTK("nicstar%d: opening vpi.vci %d.%d \n", card->index, (int)vpi,
1254               vci);
1255        if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) {
1256                PRINTK("nicstar%d: unsupported AAL.\n", card->index);
1257                return -EINVAL;
1258        }
1259
1260        vc = &(card->vcmap[vpi << card->vcibits | vci]);
1261        vcc->dev_data = vc;
1262
1263        inuse = 0;
1264        if (vcc->qos.txtp.traffic_class != ATM_NONE && vc->tx)
1265                inuse = 1;
1266        if (vcc->qos.rxtp.traffic_class != ATM_NONE && vc->rx)
1267                inuse += 2;
1268        if (inuse) {
1269                printk("nicstar%d: %s vci already in use.\n", card->index,
1270                       inuse == 1 ? "tx" : inuse == 2 ? "rx" : "tx and rx");
1271                return -EINVAL;
1272        }
1273
1274        set_bit(ATM_VF_ADDR, &vcc->flags);
1275
1276        /* NOTE: You are not allowed to modify an open connection's QOS. To change
1277           that, remove the ATM_VF_PARTIAL flag checking. There may be other changes
1278           needed to do that. */
1279        if (!test_bit(ATM_VF_PARTIAL, &vcc->flags)) {
1280                scq_info *scq;
1281
1282                set_bit(ATM_VF_PARTIAL, &vcc->flags);
1283                if (vcc->qos.txtp.traffic_class == ATM_CBR) {
1284                        /* Check requested cell rate and availability of SCD */
1285                        if (vcc->qos.txtp.max_pcr == 0 && vcc->qos.txtp.pcr == 0
1286                            && vcc->qos.txtp.min_pcr == 0) {
1287                                PRINTK
1288                                    ("nicstar%d: trying to open a CBR vc with cell rate = 0 \n",
1289                                     card->index);
1290                                clear_bit(ATM_VF_PARTIAL, &vcc->flags);
1291                                clear_bit(ATM_VF_ADDR, &vcc->flags);
1292                                return -EINVAL;
1293                        }
1294
1295                        tcr = atm_pcr_goal(&(vcc->qos.txtp));
1296                        tcra = tcr >= 0 ? tcr : -tcr;
1297
1298                        PRINTK("nicstar%d: target cell rate = %d.\n",
1299                               card->index, vcc->qos.txtp.max_pcr);
1300
1301                        tmpl =
1302                            (unsigned long)tcra *(unsigned long)
1303                            NS_TST_NUM_ENTRIES;
1304                        modl = tmpl % card->max_pcr;
1305
1306                        n = (int)(tmpl / card->max_pcr);
1307                        if (tcr > 0) {
1308                                if (modl > 0)
1309                                        n++;
1310                        } else if (tcr == 0) {
1311                                if ((n =
1312                                     (card->tst_free_entries -
1313                                      NS_TST_RESERVED)) <= 0) {
1314                                        PRINTK
1315                                            ("nicstar%d: no CBR bandwidth free.\n",
1316                                             card->index);
1317                                        clear_bit(ATM_VF_PARTIAL, &vcc->flags);
1318                                        clear_bit(ATM_VF_ADDR, &vcc->flags);
1319                                        return -EINVAL;
1320                                }
1321                        }
1322
1323                        if (n == 0) {
1324                                printk
1325                                    ("nicstar%d: selected bandwidth < granularity.\n",
1326                                     card->index);
1327                                clear_bit(ATM_VF_PARTIAL, &vcc->flags);
1328                                clear_bit(ATM_VF_ADDR, &vcc->flags);
1329                                return -EINVAL;
1330                        }
1331
1332                        if (n > (card->tst_free_entries - NS_TST_RESERVED)) {
1333                                PRINTK
1334                                    ("nicstar%d: not enough free CBR bandwidth.\n",
1335                                     card->index);
1336                                clear_bit(ATM_VF_PARTIAL, &vcc->flags);
1337                                clear_bit(ATM_VF_ADDR, &vcc->flags);
1338                                return -EINVAL;
13376 (n > >13376 (1337index);
flagsu32 <             1332          return -

1226                    ss="strcla/a> = 0;ring">"nicstar%d: not enough free CBR bandwer warning3 */
1299                               card->1332        vcc->u32d[4];
1244         class="line" n="line" name="L1244">1244   >vcmap[tst_free_entrieFRSCD  1244  ass="sref">min; 
1194                fcd2NEa>  ard->1244  ]              if (lb == 
1194                fcd2NEa>  ard->1244  ]  >dev_data = 1212                3tialized..3 */
1330    another vc3 */
1330    class="sre3">vpi;
1244                if (tst_free_entrieFRSCD  lb == vci;
1333                                1251
1315                                  mmen ;
1335                                     card->vpi,
1335                                     u32 +             1332          return -1336                                clear_bit(ATM_VF_PARTIAL, &vcc->ATM_3AL0) {
1336                                clear_bit(ATM_VF_ADDR, &vcc->3ndex);
1338BUSY                BUSY      return -;
1330    cnother vc3>        }
1259
tst_free_entrieFRSCD +  class="line" n="line" name="L1244">1244   *           if (]);
vc;
push_rxbufs(push_rxbufs(1262
lb == inu3e = 0;
1335="L1298">1298                        tx)
1335                                     card->inu3e = 1;
e" name="L1194">1194                fcd2NEa>  ard->1244  ]  >3f">rx)
e" name="L1194">1194                u32 +             1332          return -inus3 += 2;
1328                                clear_bit(ATM_VF_PARTIAL, &vcc->i3use) {
1328                                clear_bit(ATM_VF_ADDR, &vcc->,
1338NOMEaf">tst_free_ent>NOMEa      return -);
1330    ss="sref">3INVAL;
scq_info *1272        }
  virt_to_bu"+code=vcc" clasa>  virt_to_bu"        card->inu3">1273
) 0x00000000cc->) 0xffffffffcc->inu3">1275
) 0x00000000cc->3nge
e_sram32">1332    s_e_sram        push_rxbufs(inus3ges
i3 */
, &push_rxbufs(1332        sh_rxbufs(fl3gs)) {
13ef="+code=index" class="sref">index, vcc->qos.txtp.traffiU_class == scq;
1281
1194                scq_info *3lags);
1330    "sref">ATM3CBR) {

13ef="+code=index" class="sref">index, vcc->qos.txtp.traffic_class == inu3r == 0
min_pcr<3a> == 0) {
inus3PRINTK
1279bd_counna>     0        i3t;,
1330    ss="sref">3ndex);
1266        if (vcc->qos.rxtp.traffic_class == 3lags);
        h_rxbufs(3lags);
3INVAL;
1294
               if (3xtp));
min_pcr<3">tcr;
1O  (<">12comment">/n clh4/* Check requested cell rate and availab3name="L1293">1297
1255        if (vcc->aal,
->->ma4_pcr);
15"> ass." c=ef="sref">a"t">/* Check requested cell rate and availab4name="L1304">1300
->->);
-> *(uns4gned long)
(-> *(uns4g        }
1RCQ_SUPPORT"t">/* Check requested cell rate and availab4n5a> *(uns4g>1294
e_sram32">1332    s_e_sram        pusck requested cell rate and availab4n6a> *(uns4gtp));
 +ck requested cell rate and availab4n7a> *(uns4g>tcr;
vcmap[vpi << card->(modl<4a> > 0)
1330   4class="sre4">n++;
tcr<4a> == 0) {
1330   4c2me="L1304f">n =
 -
1282                (ATM_VF_ADDR, &vcc->))4<= 0) {

1330   4c6a> *(uns4t;,
4ndex);
ATM_VF   if (4lags);
4lags);
4INVAL;
vpi        tcr<4         }
h_rxbufs(vpi        vpi        1322
n<4a> == 0) {

vpi             if (, &vpi         *(uns4t;,
1298                        1299                               ca       4ndex);
index, 4lags);
4lags);
1328                                (ATM_VF_ADDR, &vcc->4INVAL;
1266        if (vcc->qos.rxtp.traffic_class == 1331
h_rxbufs(            add<>vpi        )) {
        n<4PRINTK
,
4ndex);
 +ck requested cell rate and availab4ss="sref">4lags);
1266        if (vcmap[vpi << card->index, (        4lags);
vpi << vcc->4INVAL;
pu)) cc->n > >13346 (e href="+code=qose         ->vcma2a       
vpi << tst_free_entpMDef">vcc->
vpi << vcc->
u42d[4];

   ef="+code=traffic_a href="+code=lb" class="sref">lb == 
(        
        h_rxbufs((        4 */

(             if (              rea/a        pu << vcc->vpi;
pu << fbfqE/a>(             if ((vcc->vci;
pu << lbfqE/a>(             if ((vcc->1251
;
, &1298              r.c#L1322" id="L1322" class="line"4n="sref">u4">vpi,
1299                               cvcc->) {
(  >  cc->);
pu,  struct              (_ADDR, &vpin          4INVAL;
()vcc->        }
()   0        1259
vpi << vcc->]);
pu,    ()cc->vc;
vpi << vcc->1262
               if (inu4e = 0;
1330   4 class="sr4f">tx)
1330   4 ver enoug4e = 1;
4f">rx)
13ef="+code=index" class="sref">index, vcc->qos.txtp.traffic_class == 4 += 2;
) {
1330   4ass="sref"4index,
);
1266        if (vcc->qos.txtp.traffiC_class == 4INVAL;
        1272        }
        inu4">1273
        1275
  >        4nge
4ges
 == 
, &->vcc->fl4gs)) {
             if (        scq;
              if (card4">1281
             if (        1272);
13376 (ATM4CBR) {
1335acqdhref="+code=qos"acqdhef">--                      if (inu4r == 0
1335apin_unlock_irq estorde=card" class="opin_unlock_irq estord      href="+code=ATM_VF_ode=scq_info" class="sref_ADDR, &vcc->4a> == 0) {
1212                4"ref">inus4PRINTK
1330   4"="sref">i4t;,
1If<">12q_it/a> =y is not a TSR, place onen cl">12SCQn clorder to>/* Check requested cell rate and availab4ss="sref">4ndex);
1neclooe."t">/* Check requested cell rate and availab4ss="sref">4lags);
            ns_acqd_is_ts<        )a href href           if ( == 4lags);
1212                4ss="sref">4INVAL;
h_rxbufs(44  sh_rxbufs(44qi>vpi        h_rxbufs(vpi        1294
c        inu4xtp));
min_pcr<4">tcr;
            ts<    sref">qos.            word_1ef">             if (            ns_ts<_mkword_1        vcc->1297
44  52        tst_free_entrieFRSCD) /4_rxbufs(,
44qi>vpi             if ( -4_rxbufs(card<  return -ma5_pcr);
            ts<    sref">qos.             if (44  sh_rxbufs(44qi>vpivcc->1300
qos.);
            ts<    sref">qos.;
_ADDR, &             if (            ts<    me="L1212">1212                5=4a> *(uns5g        }
c5244qi>vpi         *(uns5g>1294
_ADDR, &ard->c]  > *(uns5gtp));
              if (v        *(uns5g>tcr;
_ADDR, &             if (card<  return - *(uns5g>1297
13376 (modl<5a> > 0)
_ADDR, &++  return -n++;
vpi  >  virt_to_bu"        <  return -1332    s_e_sram        push_rxbufs(_ADDR, &  sh href="+code=ATM_VF_dat                dat >vpin 1vcc->n =
1330   5st_free_en5ries -
->vcc->))5<= 0) {
 *(uns5PRINTK
1330   5s6a> *(uns5t;,
5ndex);
1Free all TST ef">u32"t">/* Check requested cell rate and availab5ss="sref">5lags);
vpi  >5lags);
->vcmap[ == 5INVAL;
vpi << ard->1332    s_e_sram        push_rxbufs(vpi <<             tst_add(1322
vpi << ard->n<5a> == 0) {
vpi << u32/a>            tst_free_ef">u32ef">++  return -
1330   5s6a> *(uns5t;,
1330   5ss="sref">5ndex);
5lags);
e" name="L1194">1194                a/a>        tst_free_entrieFRSCD) /4_rxbufs(5lags);
push_rxbufs(ard->5INVAL;
1330   5          5         }
1330   5 2me="L1305">1331
1remove all ineerenc32"to15"> be120e delet5   it"t">/* Check requested cell rate and availab5_TST_RESER5ED)) {
1266        if (vcc->qos.txtp.traffic_class == n<5PRINTK
, &        ,
             if (<>e" name="L1194">1194                scq_info *5ndex);
5lags);
->vcc->5lags);
5INVAL;
->vcmap[u32/a>            num_ef">u32ard<            if ( == n > >13356 (_ADDR, &ard->trafficSKB        ard->index, 1266              if (
trafficSKB        ard->index, 1266  >
1266sh_rxbufs(_ADDR, &ard-> << vcc->
1298              r.c#L1322" id="L1322" class="line"5s="sref">u52d[4];
 mappingpan class="strivcc->
1330   5ever enoug5 to
1330   5es="sref">5sed
5 */
->vcc->
1330   5class="sre5">vpi;
vci;
1266        if (vpi  >1251
1328                                ATM_VF_ADDR, &vcc->;
1328                                traffileaADD ass=sh href="+code=ATM_VF_ADDR" class="sref">ATM_VF_ADDR, &vcc->u5">vpi,
->) {
);
h_rxbufs((sh_rxbufs(5INVAL;
(             if (              rea/a        pu << vcc->        }
              rea/a        pu << vcc->1259
(sh_rxbufs(]);
vc;
1262
vpi << qos.card(vpi << qos.n          u5e = 0;
vpi << qos.sh_rxbufs(              rea/a        pu << ->tx)
 = 1;
rx)
pu << qos.card(vpi << qos.n          5 += 2;
pu << qos.sh_rxbufs(              rea/a        pu << ->) {
,
pu << ->);
;
(vsh_rxbufs(vpi <<               sbpooass="sref">qos.n          1272        }
(vsh_rxbufs(vpi <<               lbpooass="sref">qos.vcc->u5">1273
vpi <<               hbpooass="sref">qos.nL_rxbufs(vpi << qos.vcc->1275
1330   57s="sref">5nge
1RX_DEBUG"t">/* Check requested cell rate and availab57s="sref">5ges
1330   57nother vc5 */
1330   5="sref">fl5gs)) {
pushant              nL_rxbufs(1330   5=nd rx&quo5">scq;
5">1281
h_rxbufs(1272);
u5CBR) {
sh_rxbufs(              r="srrd->h_rxbufs(vpi        inu5r == 0
5a> == 0) {
1It wouldlee hrey me=plicatlonto keepl">12two TSTs synchronizlonwhild  * Check requested cell rate and availab5"ref">inus5PRINTK
at w/a>es are only madelto ">12inact ce TST. So,L1206now I  * Check requested cell rate and availab5"nother vc5t;,
/* Check requested cell rate and availab5ss="sref">5ndex);
5lags);
1194                            tst_add5lags);
5INVAL;
1Fill procedure t">/* Check requested cell rate and availab5s="sref">u5         }
1294
->   0f           if ( >vcmap[++ == inu5xtp));
vpi << ard->]              if (1330   5s>min_pcr<5">tcr;
1212                5name="L1295">1297
1330   537;d.\n&qu5t;,
   >ma6_pcr);
u32"found. pan class="strinne" name="L1333"">1299                               cvcc->1300
->);
1330   6=3me="L1306"NVAL;
1330   6=4me="L1306"        }
cc->1294
));
tst_free_entrieTST_OPCODE_FIXEDef">nL_rxbufs(tcr;
 *(uns6g>1297
 ==  *(uns6g;,
vpi << ard->]              if (n++;
vpi << ard->]  L_rxbufs(e_sram32">1332    s_e_sram        push_rxbufs(sh href="+code=ATM_VF_dat                dat >vpin 1vcc->n =
 -
              r="sr--        ))6<= 0) {
1330   6R5a> *(uns6PRINTK
 *(uns6t;,
   >6ndex);
   0f> ==  *(uns6lags);
1330   6R9a> *(uns6lags);
cc->6INVAL;
1330   6same="L1306         }
1330   6s2me="L1306         }
1End of fill procedure t">/* Check requested cell rate and availab6st_free_en6">1322
1330   6="sref">n<6a> == 0) {
tst_free_entrieTST_OPCODE_END">push_rxbufs(
e_sram32">1332    s_e_sram        push_rxbufs(vpin 1vcc-> *(uns6t;,
1332    s_e_sram        push_rxbufs(vpi <<             tst_add(vpin 1vcc->6ndex);
vpi <<             tst_add6lags);
1330   6=s="sref">6lags);
1330   6ss="sref">6INVAL;
(1266shstruct              vss="line" name="L1330">1330   6          6         }
1331
(vpird->)) {
(n<6PRINTK
cc->,
cc-> *(uns6ndex);
6lags);
h_rxbufs( c#L1309" id="L"ss="line" name="L1284">1TBD s="sr, not CPU s="sr t">/* Check requested cell rate and availab6_s="sref">6lags);
6INVAL;
vpi  L_rxbufs(1266        if (        if (vpicc->n > >13366 (1298    TX="L129          1299                               cvcc->
1266        if (vpi)              if (
 def_dat     lass onsms_send().pan class="strin> == 
1299                               cvcc->n<62d[4];
ATM_VF_ADDR, &vpi <<             tx_ercvcc->
vcc-> *(uns6 to
vpicc->6sed
1330   6 s="sref">6 */

vpi;
vci;
1299                               cvcc->1251
ATM_VF_ADDR, &vpi <<             tx_ercvcc->;
vcc->u6">vpi,
vpicc->1330   6lver enoug6AL0) {
);
1266        if (vcc->aaaode=card" classaaacstaref="+code=traffic_clasAAL5ode=card" classclasAAL5cstar href href           if (<="line" name="L1266">1266        if (vcc->aaaode=card" classaaacstaref="+code=traffic_clasAALcode=aal" class=clasAALc="srv/a> == 6INVAL;
 ==         }
1299                               cvcc->1259
ATM_VF_ADDR, &vpi <<             tx_ercvcc->]);
vcc->vc;
vpicc->1262
1330   6a="sref">u6e = 0;
tx)
v_ADDR, & = 1;
1299                               cvcc->rx)
ATM_VF_ADDR, &vpi <<             tx_ercvcc->6 += 2;
vcc->) {
vpicc->,
1330   6and rx&quo6;);
1330   6azed to re6INVAL;
trafficSKB        v_ADDR, &1266  >1266cc->        }
1330   6a="sref">u6">1273
v  >1299                                       if (vpin> ==         if (nne" name="L1333"PCI_DMA_TODEVICEef="+code=lb" cPCI_DMA_TODEVICEef">vcc->1275
6nge
1266        if (vcc->aaaode=card" classaaacstar             if ( == 6ges
52                if ( + 47 + 8) /448 *448;L"ss="line" name="L1284">1Multiple of 48 *">/* Check requested cell rate and availab67nother vc6 */
  >->fl6gs)) {
vcc->word_ss="line" name="word_sef">  >vvcc->scq;
vcc->word_3s="line" name="word_3ef">  >        if (vcc->1281
vcc->word_4s="line" name="word_icstar=c->);
)9d="L1266" class="line" name="L1266">1266        if (nn/a>        )9d="L1266" class="line" name="L1266">1266        if (nn0n> == u6CBR) {
trafficSKB        v_ADDR> == -> == 0
 | >->6a> == 0) {
1(6"> ass.aaar   clasAALc) *">/* Check requested cell rate and availab6"ref">inus6PRINTK
,
52<          if (tst_free_entclasCELL_PAYLOAD1266c id="L_ss="line" name="L1284">1i.e., 48 by>es *">/* Check requested cell rate and availab6ss="sref">6ndex);
  >->6lags);
vcc->word_ss="line" name="word_sef">  >vr+h_rxbufs(trsreAALc_HEADE ef">vcc->6lags);
vcc->word_3s="line" name="word_3ef">  >;
(        if (vpir href 0x02)"L_ss="line" name="L1284">1Payload type 1 - end of pdu *">/* Check requested cell rate and availab6s="sref">u6         }
 | >->1294
vcc->word_4s="line" name="word_icstar=c->inu6xtp));
h*)9d="L1266" classskbode=card" classskbef">        if (vpi)r href ~gt;1298    sreTBDsVC_MAS9ef">vcc->6">tcr;
1Force ">12VPI/VCIl"o be ">12s="d as in VCChstruct *">/* Check requested cell rate and availab6sref">inus6">1297
vcc->word_4s="line" name="word_icstar|=c->,
)9d="L1266" class="line" name="L1266">1266 c->ma7_pcr);
) >vcm>vcmap[)9d="L1266" class="line" name="L1266">1266 c->ma7_ags);
) >vcm>vcmc->ma7_ags);
1298    sreTBDsVC_MAS9ef">vcc->;
1330   7=4me="L1307"        }
1294
1266        if (vcc->txthref="+code=qos"txth="sref">vcc->traffic_f="+cref="+code=qos"traffic_f="+ccstar             if (traffiCB csta == ));
vcc->word_1s="line" name="word_1ef">  >nn/a>        )9d="L1266" classbuflenef="+code=lb" cbuflenef">vcc->tcr;
52        1266        if (vpi)_ADDR, &cc-> *(uns7g>1297
 *(uns7g;,
vcc->word_1s="line" name="word_1ef">  c->n++;
            ns_tbd_mkword_1        nn/a>        )91nn/a>        )91nn/a>        )9d="L1266" classbuflenef="+code=lb" cbuflenef">vcc->52<       if (vpi << cc->n =
1330   7st_free_en7ries -
1330   7RVED))7<= 0) {
push_rxbufs(sh href="+code=ATM_VF_acqde=card" class="acqdcstanne" name="L1333"akbode=card" classskbef">)ref=0 ==  *(uns7PRINTK
ATM_VF_ADDR, &vpi <<             tx_ercvcc-> *(uns7t;,
vcc->7ndex);
cc-> *(uns7lags);
1330   7R9a> *(uns7lags);
ATM_VF_ADDR, &vpi <<             txef">vcc->7INVAL;
 == 1330   7st_free_en7">1322
1330   7="sref">n<7a> == 0) {
pusha>        (sh               tbf">pusss="line" name="L1330">1330   7=5a> *(uns7printk
vss="line" name="L1330">1330   7s6a> *(uns7t;,
7ndex);
 > ==  *(uns7lags);
7lags);
h_rxbufs(7INVAL;
h_rxbufs(vpi        1331
c        )) {
1330   7_"sref">n<7PRINTK
        if (vcc->,
        if (        if ( ==  *(uns7ndex);
 == 7lags);
        if (vcc-> *(uns7lags);
1299                               cvcc->7INVAL;
->n > >13376 (1330   7c         7 */
1330   7ized to re7ove
        if (52<1cc->
        if (vcc->n<72d[4];
        if (pusss="line" name="L1330">1330   7css="sref"7ler
vcc-> *(uns7 to
        if (vcc->7sed
7 */
        if ( == 
        if (vcc->vpi;
vci;
1299                               cvcc->1251
->;
1330   7n="sref">u7">vpi,
1330   7nss="sref"7>vci);
        if (pucc-> *(uns7AL0) {
c52        if (        if (cvcc->7ndex);
        if (ard->c]  L_rxbufs(cc->7INVAL;
1298    X="L129                  }
1299                               cnne" name="L1333"akbode=card" classskbef">nne" name="L1333"f="+code=card" class="sref">cvcc->1259
1298    X="L129           == ]);
1299                               cnne" name="L1333"leas_to_cpuref="+code=qos"leas_to_cpu        pu              )nne" name="L1333"leas_to_cpuref="+code=qos"leas_to_cpu        pu              )n> == vc;
pu              )nne" name="L1333"leas_to_cpuref="+code=qos"leas_to_cpu        pu              1262
        if (->u7e = 0;
        if (        if (vss="line" name="L1330">1330   7nass="sref7f">tx)
        if (        if (ccc-> *(uns7e = 1;
7f">rx)
        if (->7 += 2;
) {
->,
        if ( == );
_ADDR, &->;
            acq_is_vb->        }
u7">1273
 ==  *(uns7">1275
 == 7nge
(_ADDR, & == 7ges
 == 
1330   7="sref">fl7gs)) {
        if (        if ( == scq;
 == 1281
sh           if (->);
e_sram        pusha>                if (push href="+code=ATM_VF_dat                dat >vpin 1->u7CBR) {
        if (vcc-> == 0
1299                               cvcc->7a> == 0) {
 == inus7PRINTK
1330   7"nother vc7t;,
1330   7ss="sref">7ndex);
        if (52<1cc->7lags);
1330   7ss="sref">7lags);
;
        if (vcc->u7         }
        if (pusss="line" name="L1330">1330   7name="L1297">1294
vcc->inu7xtp));
        if (vcc->7">tcr;
1330   7sref">inus7">1297
,
        if ( == ma8_pcr);
            tsvcc->word_1s="line" name="word_1ef">  >            sreTSR_INTENABLEef">vcc->ma8_ags);
            acq_is_vb1330   8=2sref">ma8_ags);
trsreTSR_SCDISVB f">ccc->;
trsreFRSCDef">            sreFRSCD_SIZEf">ccc->1294
        if (        if (ccc->));
            tsvcc->word_ss="line" name="word_sef">  >->tcr;
            tsvcc->word_3s="line" name="word_3ef">  &0x00000000cc->1297
            tsvcc->word_4s="line" name="word_icstar=&0x00000000cc->,
1330   8class="sre8">n++;
        if (            ts->c52->ma8f">n =
        if (ard->c]  L_rxbufs(            sULLcstacc->1298    X="L129    c-> ==  *(uns8PRINTK
1299                               cnne" name="L1333"leas_to_cpuref="+code=qos"leas_to_cpu        vcc->word_1s="line" name="word_1ef">)n> ==  *(uns8t;,
vcc->word_ss="line" name="word_sef">)nLd="L1266" classleas_to_cpuref="+code=qos"leas_to_cpu        vcc->word_3s="line" name="word_3ef">)n> == vcc->word_4s="line" name="word_icsta)nh           if (-> *(uns8lags);
        if (        if (vss="line" name="L1330">1330   8R9a> *(uns8lags);
        if (        if (ccc->8INVAL;
        if (-> == 1322
_ADDR, & ==  *(uns8printk
1298    ="L129           *(uns8t;,
1299                               cvcc->8ndex);
1330   8s8a> *(uns8lags);
sh           if (-> *(uns8lags);
e_sram        pusha>                if (push href="+code=ATM_VF_dat                dat >vpin 1->8INVAL;
        if (vcc->1331
)) {
 == n<8PRINTK
1330   8_ss="sref"8t;,
 *(uns8ndex);
puvss="line" name="L1330">1330   8_s="sref">8lags);
 *(uns8lags);
h_rxbufs( ==  *(uns8INVAL;
f> == n > >13386 (f> == f "Lmss="line" name="L1284">1s="s9andicati"+lat least on en+cy was aerviced *">/* Check requested cell rate and availab8ized to re8ove

 2<0f> == n<82d[4];

1299                               vcc->next+code=vcc" clasnextcsta52            if (<">1299                               vcc->="+t+code=vcc" clas="+tef">vss="line" name="L1330">1330   8c6a> *(uns8 to
vpi << vcc->basde=card" class="basdf">ccc->8sed
8 */
vpi << vcc->next+code=vcc" clasnextcsta5+<1cc->
1330   8class="sre8">vpi;
1299                               vcc->="+t+code=vcc" clas="+tef">vss="line" name="L1330">1330   8c         8">vci;
52<       if (vpi << vcc->basde=card" class="basdf">ccc->1251
;
52<       if (u8">vpi,
vci);
pu << vcc->next+code=vcc" clasnextcsta)i||L!d="L1266" classns_tsd_isempty               ns_tsd_isempty         *(uns8AL0) {
)vss="line" name="L1330">1330   8cs="sref">8ndex);
1At most two empty, as atated in the 77201 errata *">/* Check requested cell rate and availab8cs="sref">8INVAL;
        }
 2<1cc->1259
]);
1Skip the one or two possible empty en+coe" *">/* Check requested cell rate and availab8nzed to re8f">vc;
pu << vcc->next+code=vcc" clasnextcsta) == 1262
1299                               vcc->next+code=vcc" clasnextcsta52            if (<">1299                               vcc->="+t+code=vcc" clas="+tef">vss="line" name="L1330">1330   8n="sref">u8e = 0;
1299                               vcc->next+code=vcc" clasnextcsta52<       if (vpi << vcc->basde=card" class="basdf">ccc->tx)
 *(uns8e = 1;
1299                               vcc->next+code=vcc" clasnextcsta++cc->8f">rx)
1330   8ns="sref">8 += 2;
) {
pu << vcc->next+code=vcc" clasnextcsta) == ,
pu << vcc->next+code=vcc" clasnextcsta)cc->);
trsreTSI_SCDISVB f">cvss="line" name="L1330">1330   8azed to re8INVAL;
52<       if (vpi << ccc->        }
u8">1273
vpi << vpiard-> ==  *(uns8">1275
 == 8nge
1299                               cvcc->8ges
pu << vcc->next+code=vcc" clasnextcsta)cc->
->fl8gs)) {
1330   8=nd rx&quo8">scq;
52<       if (vpi << vpiard-> << cc->1281
1330   8=r warning8lags);
pusha>        sha>        pu << vcc->next+code=vcc" clasnextcsta))cc->u8CBR) {
        if (52<0f> ==         if (pu))cc-> *(uns8r == 0
1330   8=s="sref">8a> == 0) {
inus8PRINTK
pu << vcc->next+code=vcc" clasnextcsta)cc->,
pu << vcc->next+code=vcc" clasnextcstacc->8ndex);
1299                               vcc->next+code=vcc" clasnextcsta52            if (<">1299                               vcc->="+t+code=vcc" clas="+tef">vss="line" name="L1330">1330   8ss="sref">8lags);
1299                               vcc->next+code=vcc" clasnextcsta52<       if (vpi << vcc->basde=card" class="basdf">ccc->8lags);
;
1299                               vcc->next+code=vcc" clasnextcsta++cc->u8         }
1294
1299                               vcc->next+code=vcc" clasnextcsta52            if (<">1299                               vcc->="+t+code=vcc" clas="+tef">vss="line" name="L1330">1330   8s6a> *(uns8xtp));
vpi << vcc->basde=card" class="basdf">ccc->8">tcr;
inus8">1297
vpi << vcc->next+code=vcc" clasnextcsta5+<1cc->,
1330   9="sref">ma9_pcr);
1299                               vcc->="+t+code=vcc" clas="+tef">vss="line" name="L1330">1330   9=1sref">ma9_ags);
52<       if (vpi << vcc->basde=card" class="basdf">ccc->ma9_ags);
;
52<       if (1330   9=5me="L1309">1294
));
vss="line" name="L1330">1330   9=7me="L1309">tcr;
ea                vpi << vcc->basde=card" class="basdf">c)n> == 1297
        vpi << ,
1330   9class="sre9">n++;
pusha>                shant              1330   9c2sref">ma9f">n =
->cc-> ==  *(uns9t;,
f> ==  *(uns9lags);
1298    X="L129           ==  *(uns9lags);
vpi << cnne" name="L1333"acqref="+code=qos"acqef">sha>         == 9INVAL;
        if ( == 1299                               cvcc->->1322
1330   9s4me="L1309a> == 0) {
 *(uns9printk
        if (vcc-> *(uns9t;,
        if (        if (cvcc->        if (-> *(uns9lags);
 ==  *(uns9lags);
 == 9INVAL;
52        if (ard-> == 1298    X="L129          1331
vpi << cnne" name="L1333"akbode=card" classskbef">nne" name="L1333"fode=card" classd"srevcc->)) {
5!            if (            sULLcsta == n<9PRINTK
vpi << n> ==  *(uns9t;,
)n> ==  *(uns9ndex);
        if (n> == -> *(uns9lags);
)        if (-> *(uns9INVAL;
 << 5!            if (            sULLcsta == n > >13396 ( << id="L1266" classvcc=dev_data" clasvcccstanne" name="L1333"akbode=card" classskbef">vcc->
)cc->
1330   9c"sref">n<92d[4];
        if (ard->(            sULLcstacc->
1330   9c6a> *(uns9 to
        if (->9sed
 == 9 */
1330   9c9a> *(uns9 */
        if (        if (c5+<<<  == vpi;
        if (vcc->vci;
1330   9czed to re9">1251
;
puvss="line" name="L1330">1330   9n="sref">u9">vpi,
vci);
-> *(uns9AL0) {
9ndex);
vpi << vcc->next+code=vcc" clasnextcsta))c->9INVAL;
->        }
1259
vpinL="+code=ATM_VF_">1299                               vcc->next+code=vcc" clasnextcsta)cc->]);
vpi << vcc->next+code=vcc" clasnextcsta)cc->vc;
vpi << vcc->next+code=vcc" clasnextcstacc->1262
1299                               vcc->next+code=vcc" clasnextcsta52            if (<">1299                               vcc->l"+t+code=vcc" clas="+tef">vss="line" name="L1330">1330   9n="sref">u9e = 0;
1299                               vcc->next+code=vcc" clasnextcsta525d="L1266" class">1299                               vcc->basde=card" class="basdf">ccc->tx)
 *(uns9e = 1;
1299                               vcc->next+code=vcc" clasnextcsta++cc->9f">rx)
vpi << vcc->next+code=vcc" clasnextcsta))cc->9 += 2;
ea                vpi << vcc->basde=card" class="basdf">c)nh   vpi << ) {
1330   9ass="sref"9index,
);
pusha>        1330   9azed to re9INVAL;
        }
h_rxbufs(pusha>         == u9">1273
 ==  *(uns9">1275
 == 9nge
->9ges
cc->
cc->fl9gs)) {
cc->scq;
h_rxbufs(cc->1281
h_rxbufs(f> == );
u9CBR) {
525d="L1266" classreadaode=card" classreada        vpi << vpi << 525d="L1266" classns_stat_sfbqc_gete=card" class="ns_stat_sfbqc_get        )cc-> *(uns9r == 0
vpi << 525d="L1266" classns_stat_lfbqc_gete=card" class="ns_stat_lfbqc_get        )cc->9a> == 0) {
inus9PRINTK
525d="L1266" classle32_to_cpuef="+code=lb" cle32_to_cpu        )cc->,
52vpi << pusha>        )cc->9ndex);
)/a> == 9lags);
1298    RX="L129      lt;< trKERN_ER csta       9lags);
1299                               cvcc->;
->u9         }
1330   9name="L1299">1294
vpi << pusha>        )cc-> *(uns9xtp));
vpi << n> == 9">tcr;
)n> == inus9">1297
)52            if (,
)n> == m20="srspan>,
20="cstar.c#L1287" id="L1192" id="L91" id="L<< )cc
73/65/bd8a07d20cbc03e5f79fbb38a35aece6109b_3/20="s> == m20=ags); vpi << n> == m20=ags); )n> == m20=NVAL; )52 if (m20= } )n> == m20=>1294 )cc<== m20=tp)); pu525d="L1266" classns_rsqd_vpdode=card" classns_rsqd_vpd m20=>tcr; m20=>1297 pu5ADDR 1UL <<L="+code=ATM_VF_">1299 pu5||0 1299 pu)/a> == m20=;, == m20">n++; n>20">cstar.c#L1335" id="LLLLLLLL="+code=ATM_VF_">1299 csha> pusha> m20a> == 0) { vpinne" name="L1333"akbode=card" classskbef">vcc->m20f">n = >20"icstar.c#L1192" id="Le" namcc->m20ries - 1330 20"4sref">m20<= 0) { m20PRINTK 1299 ->pu5Alt;<L="+code=ATM_VF_">1299 pu |0 ->m20t;, == m20ndex); 1298 RX="L129 == m20lags); 1299 csha> pusha> m20lags); vpinne" name="L1333"akbode=card" classskbef">vcc->m20INVAL; ->m20 } 1330 2022sref">m20 } m20">1322 1>20Iicstar.c#L129a> ->m20a> == 0) { m20printk << vcc->aaaode=card" classaaacsta522 == m20t;, cc->m20ndex); cc->m20lags); == m20lags); 1330 203"sref">m20INVAL; r2 if ( == m20 } == m20">1331 1>20Iicstar.c#L1192" id="L91" id="6" i 525d="L1266" classdef_alloc_akbode=card" classdef_alloc_akb sULLcsta == m20ED)) { m20PRINTK == m20t;, 1299 cvcc->m20ndex); vcc->atomic_ad299 atomic_ad2 << << cvcc->m20lags); ->m20lags); 1330 2039sref">m20INVAL; if (m20ss="sref">n > >1320ss=>20sscstar.c#L1306" id="L" id="LLLLLLLLLLf">vcc->RX="L1298">1298 RX="L129 > == m20 */ == m20ove vcc->">1299 cvcc->m20 */ atomic_ad2 << << cvcl" id="Ld /* alreadyLancreased by 1 */s="stric->m202d[4]; vcc->m20ler m20 to 1330 2047sref">m20sed ->m20 */ h*)ne" name="L1333"abode=card" classsbef"> if (->m20 */ m20">vpi; v>20">cstar.c#L1339" id="L1301" c06" i"line" name="L1dode=card" classd"sre52= 1 href hrefld="L1266" classns_rsqd_eopduef="+code=lb" cns_rsqd_eopdu 1330 20"1sref">m20">vci; v>20"icstar.c#L1301" id="LLLLLLLLLLLLLLLLL*i h*)ne" name="L1333"abode=card" classsbef"> if (->m20">1251 1>20"icstar.c#L1192" id="LLLLLLLLL="+code=ATM_VF_skb_putode=card" classskb_put nne" name="L1333"NS_AAL0_HEADE class="sref">trNS_AAL0_HEADE ef">vcc->m20_data; vnL="+code=ATM_VF_"elaode=card" classcelaef">nL="+code=ATM_VF_ATM_CELL_PAYLOADref="+code=qos"ATM_CELL_PAYLOADef">vcc->m20">vpi, v>20"icstar.c#L1334" id="Lr.c#L129a> nne" name="L1333"ATM_CELL_PAYLOADref="+code=qos"ATM_CELL_PAYLOADef">vcc->m20>vci); v if (->m20AL0) { vcc->m20ndex); << vcc->m20INVAL; atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << vcc->m20> } r+2cc->m20">1259 1>20">cstar.c#L1339" id="L4ss="line" name="L1330">1330 2061sref">m20vci]); == m20f">vc; >20"icstar.c#L1192" id="L vpinne" name="L1333"akbode=card" classskbef">vcc->m20">1262 1>20"icstar.c#L1293" id="Le" namcc->m20e = 0; 1330 20"5sref">m20f">tx) >20"5 > == m20e = 1; /* ToLe"ach this point, the AAL layer c m20f">rx) >20"icsta m20 += 2; sULLcsta == m20use) { 1299 vcc->queueode=card" classqueue ))cc->m20index, sULLcsta/* No buffersLin the queue */s="stric->m20;); vpinne" name="L1333"GFP_ATOMICode=card" classGFP_ATOMICef">vcc->m20INVAL; sULLcsta->m20> } == m20">1273 1>20iicstar.c#L1334" id="L1" id="L9"""""""""""="Ld="L1266" class">1299 cvcc->m20lags); atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << cvcc->m20">1275 1>20iicstar.c#L1306" id="L" id="LLLLLLLLLLf">vcc->e"cycle_rc_bufode=card" classrecycle_rc_buf vpinne" name="L1333"akbode=card" classskbef">vcc->m20nge ->m20ges 1330 2079sref">m20 */ cc->m20gs)) { 1299 vcc->count+code=vcc" clascount <L="+code=ATM_VF_">1299 vcc->minef="+code=lb" cmincsta->m20">scq; s>20gicstar.c#L1301" id="LLLLLLLLLstruct cc->m20">1281 1>20gicstar.c#L1192" id="L91" id="6" i =c->m20lags); vpinne" name="L1333"GFP_ATOMICode=card" classGFP_ATOMICef">v)5! if ( sULLcsta == m20CBR) { cc->m20 */ 1299 vcc->queueode=card" classqueue sha> vcc->m20r == 0 vcc->">1299 vcc->count+code=vcc" clascount ++cc->m20a> == 0) { 1330 2088sref">m20PRINTK 1330 2089sref">m20t;, == m20ndex); == m20lags); << 5250f> == m20lags); << << == m20INVAL; == m20 } ->m20">1294 1>20nicsta 1287" id="L1192" idbuffer is stordd as iovec base, NOT a pointer to the "stric->m20xtp)); m20">tcr; t>20nicstar.c#L130}Lelse/6" id="L1266" classsS_PRV_IOVCNTe=card" class="sS_PRV_IOVCNT m20">1297 1>20nicstar.c#L1338" id="Ld="L1266" classprref="+code=qos"pf="tk 1299 cvcc->m20t;, atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << cvcc->m21="srspan>, 21="cstar.c#L1287" id="Lf">vcc->e"cycle_iovec_rc_buf"+code=vcc" clase"cycle_iovec_rc_buf" vpinn(struct << == m21=ags); m21=ags); == m21=NVAL; << 5250f> == m21= } << << == m21=>1294 == m21=tp)); 1330 21=7sref">m21=>tcr; << -> == m21=>1297 cc->m21=;, m21">n++; n>21">cstar.c#L133<< << 5+2->m21a> == 0) { m21f">n = >21"icsta#ifdef == m21ries - == m21<= 0) { )5! if ( == m21PRINTK m21t;, == m21ndex); 1299 cvcc->m21lags); vpinn )cc->m21lags); atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << cvcc->m21INVAL; vpinne" name="L1333"akbode=card" classskbef">vcc->m21 } sULLcstacc->m21 } vpinne" name="L1333"dovbode=card" classiovb"sre)f> == m21">1322 1>212icstar.c#L1293" id="LLLLLLLLLe" namcc->m21a> == 0) { 1330 2125sref">m21printk ->m21t;, m21ndex); )5! if ( == m21lags); == m21lags); == m21INVAL; 1299 cvcc->m21 } vpinn )cc->m21">1331 1>21Iicstar.c#L1192" id="L91" id=" atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << cvcc->m21ED)) { vcc->e"cycle_iovec_rc_buf"+code=vcc" clase"cycle_iovec_rc_buf" vpinn(struct << == m21PRINTK vcc->sS_PRV_IOVCNTe=card" class="sS_PRV_IOVCNT ->m21t;, sULLcstacc->m21ndex); vpinne" name="L1333"dovbode=card" classiovb"sre)f> == m21lags); ->m21lags); 1330 2139sref">m21INVAL; 1330 214"sref">m21ss="sref">n > >1321ss=>21sscsta#end6" = /* EXTRA_DEBUG */s="stric->m21 */ m21ove m21 */ m212d[4]; 1330 2145sref">m21ler << ( == m21 to == m21sed 5=L == m21 */ m21 */ 5+L8 3<< << 5||0 5+L(475+L8) <L="+code=ATM_VF_dovbode=card" classiovb"sre << v/a> == m21">vpi; v>21">cstar.c#L1339" id="L1301" c0="+code=ATM_VF_prref="+code=qos"pf="tk =" 1299 cvcc->m21">vci; v>21"icstar.c#L1301" id="LLLLLLLLL6" id="L1266" classlenef="+code=lb" clenef">5+L8 3<< << 5||0 5+L(475+L8) <L="+code=ATM_VF_dovbode=card" classiovb"sre << vc->m21">1251 1>21"icstar.c#L1192" id="LLLLLLLLL1301" c0="+code=ATM_VF_prref="+code=qos"pf="tk =" ->m21_data; m21">vpi, v>21"icstar.c#L1334" id="Lr.c#L1291301" c0="+code=ATM_VF_prref="+code=qos"pf="tk =" ->m21>vci); atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << cvcc->m21AL0) { vpinn(struct << == m21ndex); ->m21INVAL; sULLcstacc->m21> } vpinne" name="L1333"dovbode=card" classiovb"sre)f> == m21">1259 1>21">cstar.c#L1339" id="LLLLLLLLLe" namcc->m21vci]); 1330 2162sref">m21f">vc; >2162cstac->m21">1262 1>21"icstar.c#L1293" id="L /* By this point we (hopefully) have a completesSDULwithout errors. */s="stric->m21e = 0; m21f">tx) >216icstar.c#L1335" id="L6" id="L1266" classsS_PRV_IOVCNTe=card" class="sS_PRV_IOVCNT /* Just adsmall buffer */s="stric->m21e = 1; ->m21f">rx) >216icstar.c#L1307" id="LLLLLLLLL6" i!d="L1266" classe=A_chargde=card" class="e=A_chargd << m21 += 2; vpinn )cc->m21use) { atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << cvcc->m21index, m21;); nn vcc->m21INVAL; vpinn )cc->m21> } m21">1273 1>21iicstar.c#L1334" id="L1" id="L9""""""" << m21lags); /* sS_USE_DESTRUCTORS */s="stric->m21">1275 1>21iicstar.c#L1306" id="L" id="LLLLLLLLLLf">vcc->ATM_SKB=dev_data" clasATM_SKB ) if (->m21nge )cc->m21ges << )cc->m21 */ atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << )cc->m21gs)) { 1330 2181sref">m21">scq; s>21gicstar.c#L1301" id="L}Lelse/6" id="L1266" classsS_PRV_IOVCNTe=card" class="sS_PRV_IOVCNT /* One small plus one largddbuffer */s="stric->m21">1281 1>21gicstar.c#L1192" id="L91" id="struct cc->m21lags); m21CBR) { 5=L struct if (->m21 */ ->m21r == 0 m21a> == 0) { 5< d="L1266" classsS_SMBUFSIZEode=card" classsS_SMBUFSIZEef">v/a> == m21PRINTK if (m21t;, vpinn vcc->m21ndex); << << cvcc->m21lags); m21lags); nne" name="L1333"lenef="+code=lb" clenef">vcc->m21INVAL; vpinn vcc->m21 } m21">1294 1>219icstar.c#L1335" id="LLLLLLLLLLLLLLLLLLLLLLLLLe" name="L1333"abode=card" classsbef"> if (m21xtp)); /* sS_USE_DESTRUCTORS */s="stric->m21">tcr; t>219icstar.c#L1307" id="LLLLLLLLLc#L1306" id="L" f">vcc->ATM_SKB=dev_data" clasATM_SKB v if (->m21">1297 1>21nicstar.c#L1338" id="LLLLLLLLLc#L1306" id="L" f">vcc->__net_timeflamp+code=vcc" clas__net_timeflamp vcc->m21t;, vcc->vcc=dev_data" clasvcccsta << vcc->m22="srspan>, 22="cstar.c#L1287" id="LLLLLLLLLc#L1306" id="L" f">vcc->atomic_anc99 atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << )cc->m22=ags); 1330 22=2sref">m22=ags); m22=NVAL; vcc->push_rcbuf"+code=vcc" claspush_rcbuf" vpinn )cc->m22= } m22=>1294 ->m22=tp)); m22=>tcr; << m22=>1297 vcc->push_rcbuf"+code=vcc" claspush_rcbuf" vpinn )cc->m22=;, vcc->atomic_anc99 atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << cvcc->m22">n++; n>221"cstar.c#L1287" id="LLLLLLLLLc#L1306"}Lelse/{c->m22a> == 0) { vpinn )cc->m22f">n = >22"icsta#ifdefm22ries - << m22<= 0) { /* sS_USE_DESTRUCTORS */s="stric->m22PRINTK nn vcc->m22t;, nne" name="L1333"akbode=card" classskbef"> << == m22ndex); vcc->m22lags); nn -L vcc->m22lags); ) if (->m22INVAL; )cc->m22 } << )cc->m22 } << << )cc->m22">1322 1>222icstar.c#L1293" id="LLLLLLLLLLLLLLLLL4ss="line" name="L1330">1330 2224sref">m22a> == 0) { m22printk vpinn vcc->m22t;, m22ndex); 1330 2228sref">m22lags); 1330 2229sref">m22lags); m22INVAL; m22 } nn* nn* cc->m22">1331 1>22Iicstar.c#L1192" id="L91" id="int << vpinn cc->m22ED)) { cc->m22PRINTK m22t;, 52vpi << vpi.<< ->m22ndex); 522 sULLcsta)/{2" id="= /* sodbuffersLin the queue */s="stric->m22lags); m22lags); 52vcc->m22INVAL; 522 sULLcsta)/{c->m22ss="sref">n > >1322ss=>224Ncstar.c#L1192" id="L1323" clLLLLd="L1" id="L == m22 */ == m22ove 1299 cvcc->m22 */ atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << cvcc->m222d[4]; vpinc->m22ler ->m22 to << == m22sed ->m22 */ sULLcstacc->m22 */ vpinne" name="L1333"dovbode=card" classiovb"sre)f> == m22">vpi; v>22">cstar.c#L1339" id="L1301" c00000000000000000e" namcc->m22">vci; v>22"icstar.c#L1301" id="LLLLLLLLLLLLLLLLL}Lelse/6" id="L1266" classccode=vpi" class="sref">vpi << vpi.<< vpi << ->m22">1251 1>22"icstar.c#L1192" id="LLLLLLLLL1301" c000000000struct ->m22_data; ->m22">vpi, v>22"icstar.c#L1334" id="Lr.c#L1291301" c00000000000000ode=ATM_VF_pf="dev_alloc_akbode=card" classdev_alloc_akb v)5! c->m22>vci); sULLcsta)/{c->m22AL0) { vpi << vpi.c->m22ndex); == m22INVAL; vpi << vpi.<< == m22> } 1330 226"sref">m22">1259 1>22">cstar.c#L1339" id="LLLLLLLLL000000004ss="line" name="L1330">1330 2261sref">m22vci]); )52->m22f">vc; >226icstar.c#L1192" id="LLLLLLLLL}Lelse/6" i--ode=ATM_VF_pf="ccode=vpi" class="sref">vpi << vpi.<< vpi << ->m22">1262 1>22"icstar.c#L1293" id="LLLLLLLLLLLLLLLLLstruct ->m22e = 0; ->m22f">tx) >226icstar.c#L1335" id="Lid="L c00000000000000ode=ATM_VF_pf="dev_alloc_akbode=card" classdev_alloc_akb v)5! 0ode=ATM_VF_pf="sULL/a> sULLcsta)/{c->m22e = 1; ->m22f">rx) >226icstar.c#L1307" id="LLLLLLLLL c00000000000000ode=ATM_VF_pf="skb_queue_taiaode=card" classskb_queue_taia href="+code=ATM_VF_ccode=vpi" class="sref">vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nc->m22 += 2; == m22use) { vpi << vpi.<< == m22index, 1330 2271sref">m22;); vpi << vpi.<< vpi << ->m22INVAL; ->m22> } v)5! c->m22">1273 1>22iicstar.c#L1334" id="L1" id="L9"""""""LLLLLLLLLLLLode=ATM_VF_pf="sULL/a> sULLcsta)/{c->m22lags); ->m22">1275 1>22iicstar.c#L1306" id="L" id="LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLode=ATM_VF_pf="BUF_NONEode=card" classBUF_NONEcstacc->m22nge vpi << vpi.c->m22ges == m22 */ vpi << vpi.<< == m22gs)) { 1330 2281sref">m22">scq; s>22gicstar.c#L1301" id="LLLLLLLLLLLLLLLLL4ss="line" name="L1330">1330 2282sref">m22">1281 1>22gicstar.c#L1192" id="L91" id="4ss="line" name="L1330">1330 2283sref">m22lags); m22CBR) { << == m22 */ m22r == 0 << m22a> == 0) { vpinn ->m22PRINTK ->m22t;, vpi << vpi.<< vpi << ->m22ndex); vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nne" name="L1333"hbode=card" classhbef">)cc->m22lags); vpi << vpi.<< == m22lags); m22INVAL; )f> == m22 } << << cvcc->m22">1294 1>229icstar.c#L1335" id="LLLLLLLLL}Lelse/{c->m22xtp)); ->m22">tcr; t>229icstar.c#L1307" id="LLLLLLLLLc#L1306"<< 5=L struct if (->m22">1297 1>22nicstar.c#L1338" id="LLLLLLLLLc#L1306" nne" name="L1333"hbode=card" classhbef"> << == m22t;, if (cvcc->m23="srspan>, 23="cstar.c#L1287" id="LLLLLLLLLc#L1306" nn if (cvcc->m23=ags); vpi52 -L if (ccc->m23=ags); == m23=NVAL; /* Free the small buffer */s="stric->m23= } vpinn vcc->m23=>1294 m23=tp)); ->m23=>tcr; 52<1;L="+code=ATM_VF_je=card" class="jef">5<L="+code=ATM_VF_sS_PRV_IOVCNTe=card" class="sS_PRV_IOVCNT ++)/{c->m23=>1297 vcc->lbode=card" classlbef">5=L struct if (->m23=;, vcc->tocopye=card" class="tocopyef">52c->m23">n++; n>231"cstar.c#L1287" id="LLLLLLLLLc#L1306"306" id="L" f">vcc->min_tode=card" classmin_t intnn vpinn if (cvcc->m23a> == 0) { n> == m23f">n = >231icstar.c#L1192" id="LLLLLLLLLLLLLd="L1" id="Lid="LLLLLLLLLLLLLLLLLL"L"L m23ries - )nn vcc->m23<= 0) { nn vcc->m23PRINTK == m23t;, vpi5-2cc->m23ndex); vpinn vcc->m23lags); 1330 23"9sref">m23lags); == m23INVAL; vpi5!= 0 ||ne" name="L1333"hbode=card" classhbef"> << ! 0ode=ATM_VF_pf="lenef="+code=lb" clenef">v> == m23 } == m23 } == m23">1322 1>232icstar.c#L1293" id="LLLLLLLLLLLLLLLLLLd="L1" id="L 1299 cvcc->m23a> == 0) { /* EXTRA_DEBUG */s="stric->m23printk ) if (->m23t;, m23ndex); << m23lags); /* sS_USE_DESTRUCTORS */s="stric->m23lags); )f> == m23INVAL; << )f> == m23 } atomic_anc href="+code=ATM_VF_vcc=dev_data" clasvcccsta << << )f> == m23">1331 1>23Iicstar.c#L1192" id="L91" id="4ss="line" name="L1330">1330 2333sref">m23ED)) { 1330 2334sref">m23PRINTK m23t;, << sULLcstacc->m23ndex); vpinne" name="L1333"dovbode=card" classiovb"sre)f> == m23lags); 1330 2338sref">m23lags); 1330 2339sref">m23INVAL; 1330 234"sref">m23ss="sref">n > >1323ss=>234Ncstac->m23 */ m23ove m23 */ vc->m232d[4]; m23ler vpif> == m23 to 1331 ass="suIicstar<< vpif> == m23sed m23 */ vpi5=L ode=ATM_VF_pf="ns_dev=dev_data" clasns_devcstar*)L v if ( << << vpif> == m23 */ vpi52vpi << == m23">vpi; v>23">cstar.c#L133 vpi << vpi)f> == m23">vci; v>23"icstar.c#L130 vpi << vpi)f> == m23">1251 1>2352cstac->m23_data; ->m23">vpi, v>23"icstar.c#L1334" id="L 52vpinne" name="L1333"GFP_KERNEL/a> GFP_KERNEL>vpi)f> == m23>vci); 52 0ode=ATM_VF_pf="sULL/a> sULLcsta)> == m23AL0) { m23ndex); v52vpif> == m23INVAL; vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nne" name="L1333"abode=card" classsbef">vcc->m23> } nn vcc->m23">1259 1>23">cstar.c#L1339" id="L vpinn vcc->m23vci]); vpi << vpi << ->m23f">vc; >236icsta4ss="line" name="L1330">1330 2363sref">m23">1262 1>236icstac->m23e = 0; vc->m23f">tx) >236icsta{c->m23e = 1; vpif> == m23f">rx) >236icstar.c#L130 1331 ass="suIicstar<< vpif> == m23 += 2; 1330 2369sref">m23use) { vpi5=L ode=ATM_VF_pf="ns_dev=dev_data" clasns_devcstar*)L v if ( << << vpif> == m23index, vpi52vpi << == m23;); vpi << vpi)f> == m23INVAL; vpi << vpi)f> == m23> } m23">1273 1>23iicstar.c#L133do/{c->m23lags); 52vpinne" name="L1333"GFP_KERNEL/a> GFP_KERNEL>vpi)f> == m23">1275 1>23iicstar.c#L1306" id="L6" id="L1266" classlbode=card" classlbef">52 0ode=ATM_VF_pf="sULL/a> sULLcsta)> == m23nge == m23ges v52vpif> == m23 */ vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nne" name="L1333"lbode=card" classlbef">vcc->m23gs)) { nL vcc->m23">scq; s>23gicstar.c#L1301" id="L vpinn vcc->m23">1281 1>23gicstar.c#L119} while id="L1266" classccode=vpi" class="sref">vpi << vpi << ->m23lags); 1330 2384sref">m23CBR) { m23 */ )r.c#L1294" id="L1294" class="line2386sref">m23r == 0 m23a> == 0) { vpif> == m23PRINTK 1330 2389sref">m23t;, vpi5=L ode=ATM_VF_pf="ns_dev=dev_data" clasns_devcstar*)L ) if ( << << vpif> == m23ndex); m23lags); vpi << vpi.<< vpi << v5{c->m23lags); 52nne" name="L1333"GFP_KERNEL/a> GFP_KERNEL>vpi)f> == m23INVAL; 52 0ode=ATM_VF_pf="sULL/a> sULLcsta)> == m23 } m23">1294 1>239icstar.c#L1335" id="L )52->m23xtp)); vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nne" name="L1333"hbode=card" classhbef">)cc->m23">tcr; t>239icstar.c#L1307" id="Ld="L1266" classccode=vpi" class="sref">vpi << vpi.<< == m23">1297 1>23nicstar.c#L1334ss="line" name="L1330">1330 2399sref">m23t;, 1330 24="sref">m24="srspan>, 240Ncstac->m24=ags); /* sS_USE_DESTRUCTORS */s="stric->m24=ags); m24=NVAL; vpi,Lstruct == m24= } m24=>1294 == m24=tp)); == m24=>tcr; vpi << cvcc->m24=>1297 ->m24=;, m24">n++; n>241"cstar.c#L1287" id="L vpinn ->m24a> == 0) { 1330 24"2sref">m24f">n = >2412cstac->m24ries - vpi,Lstruct vpi,L Ld="L1266" classcount+code=vcc" clascount )> == m24<= 0) { m24PRINTK 0)> == m24t;, vpi,L struct vpi++) if (->m24ndex); 1330 24"8sref">m24lags); 1330 24"9sref">m24lags); vpi,Lstruct 1330 242"sref">m24INVAL; m24 } vpi << vpi.<< vpi << ->m24 } vpi << vpi.<< == m24">1322 1>242icstar.c#L1293" id="Ld="L1266" classccode=vpi" class="sref">vpi << vpi.<< == m24a> == 0) { m24printk == m24t;, 1330 2427sref">m24ndex); m24lags); vpi,Lstruct vc->m24lags); m24INVAL; nn href="+code=ATM_VF_ccode=vpi" class="sref">vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue )f> == m24 } m24">1331 1>24Iicstar.c#L1196" id="L1266" classccode=vpi" class="sref">vpi << vpi << m24ED)) { m24PRINTK vpi << vpi << v5{c->m24t;, ->m24ndex); vpi)) ! 0ode=ATM_VF_pf="sULL/a> sULLcsta)5{c->m24lags); vpif> == m24lags); vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nne" name="L1333"new_abode=card" classnew_abcstavf> == m24INVAL; vcc->m24ss="sref">n > >1324ss=>244"cstar.c#L1287" id="LLLLLLLLL vpinn == m24 */ 1330 2442sref">m24ove 1330 2443sref">m24 */ vpi << vpi << vss="line" name="L1330">1330 2444sref">m242d[4]; /* sS_USE_DESTRUCTORS */s="stric->m24ler m24 to ->m24sed vpi)) ! 0ode=ATM_VF_pf="sULL/a> sULLcsta)5{c->m24 */ vpif> == m24 */ vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nne" name="L1333"new_abode=card" classnew_abcstavf> == m24">vpi; v>245"cstar.c#L1287" id="LLLLLLLLL vcc->m24">vci; v>245icstar.c#L1291" id="LLLLLLLLL vpinn == m24">1251 1>245icstar.c#L1192" id="L}ss="line" name="L1330">1330 24"3sref">m24_data; 1330 24"4sref">m24">vpi, v>24"icsta}ss="line" name="L1330">1330 24"5sref">m24>vci); m24AL0) { vpi,Lstruct vc->m24ndex); ->m24INVAL; nL href="+code=ATM_VF_ccode=vpi" class="sref">vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue vf> == m24> } m24">1259 1>24">cstar.c#L1336" id="L1266" classccode=vpi" class="sref">vpi << vpi << m24vci]); m24f">vc; >246icstar.c#L1196" id="L1266" classccode=vpi" class="sref">vpi << vpi << v5{c->m24">1262 1>246icstar.c#L1293" id="Lstruct vpif> == m24e = 0; vpi52vpi)) ! 0ode=ATM_VF_pf="sULL/a> sULLcsta)5{c->m24f">tx) >246icstar.c#L1335" id="LLLLLLLLL vpiv52vpif> == m24e = 1; vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nne" name="L1333"new_lbode=card" classnew_lb>vpivf> == m24f">rx) >246icstar.c#L1287" id="L1192" id vpinL vcc->m24 += 2; vpinn vpivf> == m24use) { 1330 247"sref">m24index, 1330 2471sref">m24;); vpi << vpi << vss="line" name="L1330">1330 2472sref">m24INVAL; /* sS_USE_DESTRUCTORS */s="stric->m24> } m24">1273 1>247icstar.c#L1334" id="Lstruct vpif> == m24lags); vpi52vpi)) ! 0ode=ATM_VF_pf="sULL/a> sULLcsta)5{c->m24">1275 1>24iicstar.c#L1306" id="L1323" cl vpiv52vpif> == m24nge vpi << vpi.ode=ATM_VF_pf="queueode=card" classqueue nne" name="L1333"new_lbode=card" classnew_lb>vpivf> == m24ges vpinL vcc->m24 */ vpinn vpivf> == m24gs)) { 1330 2481sref">m24">scq; s>24gicstar.c#L130}ss="line" name="L1330">1330 2482sref">m24">1281 1>248icsta4ss="line" name="L1330">1330 2483sref">m24lags); m24CBR) { vss="line" name="L1330">1330 2485sref">m24 */ m24r == 0 1331 ass="suIicstar<< vpif> == m24a> == 0) { vpif> == m24PRINTK vpif> == m24t;, m24ndex); vpi5=L )* == m24lags); vpi5=L ode=ATM_VF_pf="ns_dev=dev_data" clasns_devcstar*)L << vpif> == m24lags); vpi52vpi << == m24INVAL; vpi--vss="line" name="L1330">1330 24n4sref">m24 } , " m24">1294 1>249icstar.c#L1336" i! vpi--vss="line" name="L1330">1330 24n6sref">m24xtp)); , " == m24">tcr; t>249icstar.c#L1307" id="LLLLLLLLLLLLLLLLode=ATM_VF_pf="ns_stat_sfbqc_get+code=vcc" clasns_atat_sfbqc_get vpi)nn vpi << == m24">1297 1>249icstar.c#L1338" id="L1192" id.c#L130 vpi << nn vpi << == m24t;, vpi--vss="line" name="L1330">1330 25="sref">m25="srspan>, 250scstar.c#L1339" id="Lreturn9<< , " == m25=ags); vpi)nn vpi << == m25=ags); vpi << nn vpi << == m25=NVAL; vpi--vss="line" name="L1330">1330 25=4sref">m25= } , " == m25=>1294 vpi << vpi.<< vpi << == m25=tp)); vpi << nn vpi << == m25=>tcr; vpi--vss="line" name="L1330">1330 25=8sref">m25=>1297 , " == m25=;, vpi << vpi.<< vpi << == m25">n++; n>251"cstar.c#L1287" id="L1192" id.c#L130 vpi << nn vpi << == m25a> == 0) { vpi--v5{c->m25f">n = >251icstar.c#L1192" id="L Ld="L1266" classretvaaode=card" classretvaa>vpif> == m25ries - vpi => == m25<= 0) { , " vpi << == m25PRINTK vpi << == m25t;, vpif> == m25ndex); 1330 25"8sref">m25lags); 1330 25"9sref">m25lags); ->m25INVAL; ->m25 } ->m25 } vpi << vpi--v5{c->m25">1322 1>252icstar.c#L1293" id="Ld="L1266" classu">1331 ass="suIicstar<< == m25a> == 0) { 1331 ass="suIicstar<< vpif> == m25printk m25t;, vpi = 0fr<< vpi5<L4fr<< vpi++v5{c->m25ndex); vpi)) f> == m25lags); vpin> == m25lags); vpi << == m25INVAL; vpi)) f> == m25 } vpi]52vpi << m25">1331 1>253icstar.c#L1192" id="L4ss="line" name="L1330">1330 2533sref">m25ED)) { m25PRINTK , " == m25t;, == m25ndex); == m25lags); 1330 2538sref">m25lags); /* 0 - Dump 25.6 Mbps PHYLregisters */s="stric->m25INVAL; 1330 254"sref">m25ss="sref">n > >1325ss=>2540cstar.c#L133& /* Dump TST */s="stric->m25 */ vpi--5<L="+code=ATM_VF_NS_TST_NUM_ENTRIESe=card" class="sS_TST_NUM_ENTRIES>vpi) {c->m25ove vpi << vpi5+ 1]52 0ode=ATM_VF_pf="sULL/a> sULLcsta)> == m25 */ , " vpi5+ 1)f> == m252d[4]; m25ler , " vpi5+ 1n> == m25 to vpi << vpi5+ 1] << vpi << vpin> == m25sed vpi << vpi5+ 1] << vpi << == m25 */ 1330 2549sref">m25 */ /* 0 */s="stric->m25">vpi; v>255"cstar.c#L128return90f> == m25">vci; v>255icsta4ss="line" name="L1330">1330 2552sref">m25">1251 1>2552cstac->m25_data; vpinnvoid == m25">vpi, v>255icsta{c->m25>vci); vpif> == m25AL0) { vpif> == m25ndex); vpif> == m25INVAL; vpif> == m25> } m25">1259 1>256>cstar.c#L133 vpi5=L << vpif> == m25vci]); vpi) {c->m25f">vc; >256icstar.c#L119aasr ="+code=ATM_VF_NS_GETPSTATe=card" class="NS_GETPSTATcsta:c->m25">1262 1>256icstar.c#L1293" id="L " id="L1266" classget_userrxbufs" class="get_usercsta> == m25e = 0; vpi.<< vpinn hrefi << vpi))> == m25f">tx) >256icstar.c#L1335" id="LLLLLLLLLreturn9-<< m25e = 1; vpi.<< vpi) {c->m25f">rx) >256icstar.c#L1287" id="Laasr ="+code=ATM_VF_NS_BUFTYPE_SMALL/a> sS_BUFTYPE_SMALLcsta:c->m25 += 2; vpi.<< == m25use) { vpi << == m25index, vpi.<< vpi.<< vpi << == m25;); vpi.<< vpi.<< 5=L vpi << f> == m25INVAL; vpi.<< vpi.<< vpi << == m25> } m25">1273 1>257icsta> == m25lags); sS_BUFTYPE_LARGEcsta:c->m25">1275 1>25iicstar.c#L1306" id="L1323" cl vpi.<< == m25nge vpi << == m25ges vpi.<< vpi.<< vpi << == m25 */ vpi.<< vpi.<< 5=L vpi << f> == m25gs)) { vpi.<< vpi.<< vpi << == m25">scq; s>258icstar.c#L1291" id="LLLLLLLLLbreakf> == m25">1281 1>2582cstac->m25lags); sS_BUFTYPE_HUGEcsta:c->m25CBR) { vpi.<< vpi << vpi.<< == m25 */ vpi.<< vpi.<< vpi << == m25r == 0 vpi.<< vpi.<< 5=L vpi << f> == m25a> == 0) { vpi.<< vpi.<< vpi << == m25PRINTK == m25t;, m25ndex); sS_BUFTYPE_IOVECcsta:c->m25lags); vpi.<< vpi << vpi.<< == m25lags); vpi.<< vpi.<< vpi << == m25INVAL; vpi.<< vpi.<< 5=L vpi << f> == m25 } vpi.<< vpi.<< vpi << == m25">1294 1>259icstar.c#L1335" id="LLLLLLLLLbreakf> == m25xtp)); m25">tcr; t>259icstar.c#L1307" id="Ldefault:c->m25">1297 1>259icstar.c#L1338" id="L1192" idreturn9-<< == m25t;, m26="srspan>, 260scstar.c#L1339" id="L4ss="line" name="L1330">1330 26=1sref">m26=ags); vpi, sizeofid="L1266" classpaode=card" classpa>vpi)))> == m26=ags); vpi))f> == m26=NVAL; m26= } m26=>1294 m26=tp)); sS_SETBUFLEVcsta:c->m26=>tcr; m26=>1297 m26=;, vpi, vpi)))> == m26">n++; n>261"cstar.c#L1287" id="L1192" idreturn9-<< m26a> == 0) { vpi.<< vpi.<< =L vpi.<< vpi.<< > == m26f">n = >261icstar.c#L1192" id="LLLLL|| << vpi.<< vpi.<< 5/a> =L vpi.<< vpi.<< == m26ries - EINVAL>vpif> == m26<= 0) { vpi.<< vpi.<< == m26PRINTK EINVAL>vpif> == m26t;, vpi.<< vpi) {c->m26ndex); sS_BUFTYPE_SMALLcsta:c->m26lags); vpi.<< vpi.<< ="+code=ATM_VF_TOP_SBode=card" classTOP_SBcsta)> == m26lags); EINVAL>vpif> == m26INVAL; vpi << vpi.<< vpi.<< == m26 } vpi << 5=L vpi.<< vpi.<< f> == m26 } vpi << vpi.<< vpi.<< == m26">1322 1>262icstar.c#L1293" id="LLLLLLLLLbreakf> == m26a> == 0) { m26printk sS_BUFTYPE_LARGEcsta:c->m26t;, vpi.<< vpi.<< ="+code=ATM_VF_TOP_LBode=card" classTOP_LBcsta)> == m26ndex); m26lags); vpi << vpi.<< vpi.<< == m26lags); vpi << 5=L vpi.<< vpi.<< f> == m26INVAL; vpi << vpi.<< vpi.<< == m26 } m26">1331 1>2632cstac->m26ED)) { sS_BUFTYPE_HUGEcsta:c->m26PRINTK vpi.<< vpi.<< ="+code=ATM_VF_TOP_HBode=card" classTOP_HBcsta)> == m26t;, m26ndex); vpi << vpi.<< vpi.<< == m26lags); vpi << 5=L vpi.<< vpi.<< f> == m26lags); vpi << vpi.<< vpi.<< == m26INVAL; == m26ss="sref">n > >1326ss=>2640csta> == m26 */ sS_BUFTYPE_IOVECcsta:c->m26ove vpi.<< vpi.<< ="+code=ATM_VF_TOP_IOVBode=card" classTOP_IOVBcsta)> == m26 */ m262d[4]; vpi << vpi.<< vpi.<< == m26ler vpi << 5=L vpi.<< vpi.<< f> == m26 to vpi << vpi.<< vpi.<< == m26sed m26 */ m26 */ m26">vpi; v>265"cstar.c#L1287" id="L1192" idreturn9-<< EINVAL>vpif> == m26">vci; v>265icsta> == m26">1251 1>265icstar.c#L1192" id="L4ss="line" name="L1330">1330 26"3sref">m26_data; m26">vpi, v>265icsta> == m26>vci); sS_ADJBUFLEVcsta:c->m26AL0) { m26ndex); m26INVAL; vpi5=L(long)<< m26> } vpi) {c->m26">1259 1>266scstar.c#L1339" id="Laasr ="+code=ATM_VF_NS_BUFTYPE_SMALL/a> sS_BUFTYPE_SMALLcsta:c->m26vci]); vpi << vpi << ) {c->m26f">vc; >266icstar.c#L1192" id="LLLLLLLLL9" id="Lstruct m26">1262 1>266icstac->m26e = 0; sS_SMSKBSIZE nLd="L1266" classGFP_KERNEL/a> GFP_KERNELef">)f> == m26f">tx) >266icstar.c#L1335" id="LLLLLLLLLLLLLLLLL6" i sULLcsta)> == m26e = 1; m26f">rx) >266icstar.c#L1287" id="LLLLLL1338" id="L<< sS_PRV_BUFTYPE m26 += 2; vpi << vpi.<< m26use) { vpi)f> == m26index, vpinLd="L1266" classsbrxbufs" class="sb>vpi)f> == m26;); 1330 2672sref">m26INVAL; == m26> } m26">1273 1>267icstar.c#L1334" id="Laasr ="+code=ATM_VF_NS_BUFTYPE_LARGE/a> sS_BUFTYPE_LARGEcsta:c->m26lags); vpi << vpi << ) {c->m26">1275 1>26iicstar.c#L1306" id="L1323" clllllllllstruct m26nge m26ges sS_LGSKBSIZE nLd="L1266" classGFP_KERNEL/a> GFP_KERNELef">)f> == m26 */ sULLcsta)> == m26gs)) { m26">scq; s>268icstar.c#L1291" id="LLLLLLLLLdddddddd m26">1281 1>268icstar.c#L1192" id="LLLLLLLLL9" id="L<< vpi << vpi.<< m26lags); sS_SMBUFSIZE>vpi)f> == m26CBR) { vpinLd="L1266" classlbrxbufs" class="lb>vpi)f> == m26 */ 1330 2686sref">m26r == 0 == m26a> == 0) { m26PRINTK sS_BUFTYPE_HUGEcsta:c->m26t;, vpi << vpi.<< ="+code=ATM_VF_ccode=vpi" class="sref">vpi << ) {c->m26ndex); m26lags); m26lags); vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m26INVAL; vpi << vpi.<< == m26 } vpi << vpi.<< == m26">1294 1>269icstar.c#L1335" id="LLLLLLLLLdddddddd vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m26xtp)); sULLcsta)> == m26">tcr; t>269icstar.c#L1307" id="L5" id="LLLLLLLLLdddddddd == m26">1297 1>269icstar.c#L1338" id="L1192" iddddddddddddddddddddd(& "M_CBR" %d: huge buffer count inconsistent.\n"s="stri,> == m26t;, vpi << vpi)f> == m27="srspan>, 270scstar.c#L1339" id="LLLLLLLLLLLLLLLLLelsec->m27=ags); m27=ags); m27=NVAL; 1330 27=4sref">m27= } vpi << vpi.<< vpi << ) {c->m27=>1294 m27=tp)); m27=>tcr; sS_HBUFSIZE>vpinLd="L1266" classGFP_KERNEL/a> GFP_KERNELef">)f> == m27=>1297 sULLcsta)> == m27=;, m27">n++; n>271"cstar.c#L1287" id="L1192" iddddddddd sS_PRV_BUFTYPE m27a> == 0) { vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m27f">n = >271icstar.c#L1192" id="LLLLL" iddddddddd vpi << vpi.<< m27ries - vpi << vpi.<< == m27<= 0) { vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m27PRINTK 1330 2716sref">m27t;, m27ndex); m27lags); sS_BUFTYPE_IOVECcsta:c->m27lags); vpi << vpi.<< ="+code=ATM_VF_ccode=vpi" class="sref">vpi << ) {c->m27INVAL; m27 } m27 } vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m27">1322 1>272icstar.c#L1293" id="LLLLLLLLLdddddddd vpi << vpi.<< == m27a> == 0) { vpi << vpi.<< == m27printk vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m27t;, sULLcsta)> == m27ndex); == m27lags); "M_CBR" %d: iovec buffer count inconsistent.\n"s="stri,> == m27lags); vpi << vpi)f> == m27INVAL; ->m27 } m27">1331 1>2732cstac->m27ED)) { 1330 2734sref">m27PRINTK vpi << vpi.<< vpi << ) {c->m27t;, m27ndex); m27lags); sS_IOVBUFSIZE>vpinLd="L1266" classGFP_KERNEL/a> GFP_KERNELef">)f> == m27lags); sULLcsta)> == m27INVAL; m27ss="sref">n > >1327ss=>274"cstar.c#L1287" id="L1192" iddddddddd sS_PRV_BUFTYPE m27 */ vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m27ove vpi << vpi.<< m27 */ vpi << vpi.<< == m272d[4]; vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m27ler 1330 2746sref">m27 to m27sed m27 */ m27 */ m27">vpi; v>2750csta> == m27">vci; v>275icstar.c#L1291" id="L4ss="line" name="L1330">1330 2752sref">m27">1251 1>275icstar.c#L1192" id="Lreturn90f> == m27_data; m27">vpi, v>275icstar.c#L133default:c->m27>vci); vpi << vpi << << ) {c->m27AL0) { vpi << << id="L1266" classdevode=card" classdev>vpinLd="L1266" classcmde=vpi" class="srm">vpinLd="L1266" class"rg=dev_data" clas"rgcsta)f> == m27ndex); m27INVAL; "M_CBR" %d: %s5= 0sULL \n"s="stri,d vpi << vpi,> == m27> } vpi << "dev phy iocta"s="stri : & "dev phy"s="stri)f> == m27">1259 1>276scstar.c#L1339" id="L2" id="Lreturn9-<< m27vci]); 1330 2762sref">m27f">vc; >276icstar.c#L1194ss="line" name="L1330">1330 2763sref">m27">1262 1>276icsta4ss="line" name="L1330">1330 2764sref">m27e = 0; m27f">tx) >276icsta#ifdefL m27e = 1; id="L1266" classns_devode=card" classns_devcstar*d vpi,Lstruct m27f">rx) >276icsta{c->m27 += 2; "skb buf_type: 0x%08x\n"s="stri,d sS_PRV_BUFTYPE m27use) { 1330 277"sref">m27index, /* EXTRA_DEBUG */s="stric->m27;); m27INVAL; == m27> } m27">1273 1>277icstar.c#L133intLd="L1266" classiode=card" classi>vpif> == m27lags); vpif> == m27">1275 1>27iicstar.c#L130unsignedLlongrd="L1266" classflag"+code=vcc" clasflag">vpif> == m27nge 1331 " clasu32csta vpinLd="L1266" classsR"t_wrxbufs" class="sR"t_w>vpif> == m27ges m27 */ "M_CBR" : Entering ns_pola().\n"s="stri)f> == m27gs)) { vpi = 0fd vpi /lt;L="+code=ATM_VF_num_ref""+code=vcc" clasnum_ref"">vpifd vpi++) {c->m27">scq; s>278icstar.c#L1291" id="L vpi5=L vpi[ vpi]f> == m27">1281 1>278icstar.c#L1192" id="L6" i vpi << vpi)) {c->m27lags); ->m27CBR) { == m27 */ 1330 2786sref">m27r == 0 vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m27a> == 0) { m27PRINTK vpi = 0f> == m27t;, vpi5=L vpi << vpi5+L vpi)f> == m27ndex); vpi5/hrefd sS_STAT_TSIFcsta)> == m27lags); vpi | 0ode=ATM_VF_pf="sS_STAT_TSIF/a> sS_STAT_TSIFcstaf> == m27lags); vpi5/hrefd sS_STAT_EOPDUcsta)> == m27INVAL; vpi | 0ode=ATM_VF_pf="sS_STAT_EOPDU/a> sS_STAT_EOPDUcstaf> == m27 } m27">1294 1>279icstar.c#L1335" id="L vpi)f> == m27xtp)); vpi)f> == m27">tcr; t>279icsta> == m27">1297 1>279icstar.c#L1338" id="L vpi,d vpi << vpi5+L vpi)f> == m27t;, vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m28="srspan>, 280scstar.c#L1334ss="line" name="L1330">1330 28=1sref">m28=ags); vpi5+L m28=ags); "M_CBR" : Leaving ns_pola().\n"s="stri)f> == m28=NVAL; 1330 28=4sref">m28= } m28=>1294 == m28=tp)); m28=>tcr; vpinLd="L1266" classj+code=vcc" clasjcstaf> == m28=>1297 vpinLd="L1266" classbyte0+code=vcc" clasbyte0cstaf> == m28=;, m28">n++; n>281"cstar.c#L1286" i sULLcsta ||0ode=ATM_VF_pf="esiode=card" classesicsta5= 0ode=ATM_VF_pf="sULL/a> sULLcsta)> == m28a> == 0) { m28f">n = >2812cstar.c#L129<< == m28ries - vpi = 0fd vpi /lt;L6fd vpi++) {c->m28<= 0) { vpi5=L == m28PRINTK == m28t;, == m28ndex); == m28lags); vpi]5=L(unsignedLchar)id="L1266" classbyte1+code=vcc" clasbyte1>vpi5* 165+L == m28lags); vpi /lt;L5) {c->m28INVAL; ':'s="stri)c->m28 } == m28 } 1330 28I3sref">m28">1322 1>282icstar.c#L1294ss="line" name="L1330">1330 28I4sref">m28a> == 0) { m28printk 1330 28I6sref">m28t;, m28ndex); m28lags); vpi5* vpinLunsignedLcharr vpin> == m28lags); == m28INVAL; ->m28 } vpif> == m28">1331 1>283icstar.c#L119unsignedLlongrd="L1266" classflag"+code=vcc" clasflag">vpif> == m28ED)) { m28PRINTK vpi5=L vpi << vpif> == m28t;, vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m28ndex); vpi)) f> == m28lags); 1331 " clasu32csta)r vpind vpi << vpi5+L vpi)f> == m28lags); == m28INVAL; vpi << vpi5+L m28ss="sref">n > >1328ss=>284"cstar.c#L128 vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m28 */ 1330 2842sref">m28ove m28 */ vpi5* vpinLunsignedLlongrd="L1266" class"ddrrxbufs" class=""ddrcsta)> == m282d[4]; m28ler vpif> == m28 to vpif> == m28sed 1331 " clasu32csta vpif> == m28 */ m28 */ vpi5=L vpi << vpif> == m28">vpi; v>285"cstar.c#L128 vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m28">vci; v>285icstar.c#L129while id="L1266" classCMD_BUSY+code=vcc" clasCMD_BUSY vpi)) f> == m28">1251 1>2852cstar.c#L129<< == m28_data; vpi << vpi5+L m28">vpi, v>285icstar.c#L133while id="L1266" classCMD_BUSY+code=vcc" clasCMD_BUSY vpi)) f> == m28>vci); vpi5=L vpi << vpi5+L vpi)5/hrefd0x000000FFf> == m28AL0) { vpi << vpinLd="L1266" classflag"+code=vcc" clasflag">vpi)f> == m28ndex); vpif> == m28INVAL; 1330 2859sref">m28> } m28">1259 1>286scsta<< vpi)f> == m28vci]); vpi)f> == m28f">vc; >286icsta
; footer"> The original LXR software by thr ="+code=Ahttp://sourceforge.net/projects/lxr">LXR community>vpinLthis experimental "+coion by ="+code=Amailto:lxr@lxr@vpi.
; subfooter"> lxr.Redpill La pro AS>vpinLprovider of La uxdconsulting and operations services since 1995.