linux/drivers/pcmcia/cistpl.c
<<
>>
Prefs
   1/*
   2 * cistpl.c -- 16-bit PCMCIA Card Information Structure parser
   3 *
   4 * This program is free software; you can redistribute it and/or modify
   5 * it under the terms of the GNU General Public License version 2 as
   6 * published by the Free Software Foundation.
   7 *
   8 * The initial developer of the original code is David A. Hinds
   9 * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
  10 * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
  11 *
  12 * (C) 1999             David A. Hinds
  13 */
  14
  15#include <linux/module.h>
  16#include <linux/moduleparam.h>
  17#include <linux/kernel.h>
  18#include <linux/string.h>
  19#include <linux/major.h>
  20#include <linux/errno.h>
  21#include <linux/timer.h>
  22#include <linux/slab.h>
  23#include <linux/mm.h>
  24#include <linux/pci.h>
  25#include <linux/ioport.h>
  26#include <linux/io.h>
  27#include <asm/byteorder.h>
  28#include <asm/unaligned.h>
  29
  30#include <pcmcia/ss.h>
  31#include <pcmcia/cisreg.h>
  32#include <pcmcia/cistpl.h>
  33#include "cs_internal.h"
  34
  35static const u_char mantissa[] = {
  36    10, 12, 13, 15, 20, 25, 30, 35,
  37    40, 45, 50, 55, 60, 70, 80, 90
  38};
  39
  40static const u_int exponent[] = {
  41    1, 10, 100, 1000, 10000, 100000, 1000000, 10000000
  42};
  43
  44/* Convert an extended speed byte to a time in nanoseconds */
  45#define SPEED_CVT(v) \
  46    (mantissa[(((v)>>3)&15)-1] * exponent[(v)&7] / 10)
  47/* Convert a power byte to a current in 0.1 microamps */
  48#define POWER_CVT(v) \
  49    (mantissa[((v)>>3)&15] * exponent[(v)&7] / 10)
  50#define POWER_SCALE(v)          (exponent[(v)&7])
  51
  52/* Upper limit on reasonable # of tuples */
  53#define MAX_TUPLES              200
  54
  55/* Bits in IRQInfo1 field */
  56#define IRQ_INFO2_VALID         0x10
  57
  58/* 16-bit CIS? */
  59static int cis_width;
  60module_param(cis_width, int, 0444);
  61
  62void release_cis_mem(struct pcmcia_socket *s)
  63{
  64        mutex_lock(&s->ops_mutex);
  65        if (s->cis_mem.flags & MAP_ACTIVE) {
  66                s->cis_mem.flags &= ~MAP_ACTIVE;
  67                s->ops->set_mem_map(s, &s->cis_mem);
  68                if (s->cis_mem.res) {
  69                        release_resource(s->cis_mem.res);
  70                        kfree(s->cis_mem.res);
  71                        s->cis_mem.res = NULL;
  72                }
  73                iounmap(s->cis_virt);
  74                s->cis_virt = NULL;
  75        }
  76        mutex_unlock(&s->ops_mutex);
  77}
  78
  79/**
  80 * set_cis_map() - map the card memory at "card_offset" into virtual space.
  81 *
  82 * If flags & MAP_ATTRIB, map the attribute space, otherwise
  83 * map the memory space.
  84 *
  85 * Must be called with ops_mutex held.
  86 */
  87static void __iomem *set_cis_map(struct pcmcia_socket *s,
  88                                unsigned int card_offset, unsigned int flags)
  89{
  90        pccard_mem_map *mem = &s->cis_mem;
  91        int ret;
  92
  93        if (!(s->features & SS_CAP_STATIC_MAP) && (mem->res == NULL)) {
  94                mem->res = pcmcia_find_mem_region(0, s->map_size,
  95                                                s->map_size, 0, s);
  96                if (mem->res == NULL) {
  97                        dev_printk(KERN_NOTICE, &s->dev,
  98                                   "cs: unable to map card memory!\n");
  99                        return NULL;
 100                }
 101                s->cis_virt = NULL;
 102        }
 103
 104        if (!(s->features & SS_CAP_STATIC_MAP) && (!s->cis_virt))
 105                s->cis_virt = ioremap(mem->res->start, s->map_size);
 106
 107        mem->card_start = card_offset;
 108        mem->flags = flags;
 109
 110        ret = s->ops->set_mem_map(s, mem);
 111        if (ret) {
 112                iounmap(s->cis_virt);
 113                s->cis_virt = NULL;
 114                return NULL;
 115        }
 116
 117        if (s->features & SS_CAP_STATIC_MAP) {
 118                if (s->cis_virt)
 119                        iounmap(s->cis_virt);
 120                s->cis_virt = ioremap(mem->static_start, s->map_size);
 121        }
 122
 123        return s->cis_virt;
 124}
 125
 126
 127/* Bits in attr field */
 128#define IS_ATTR         1
 129#define IS_INDIRECT     8
 130
 131/**
 132 * pcmcia_read_cis_mem() - low-level function to read CIS memory
 133 *
 134 * must be called with ops_mutex held
 135 */
 136int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
 137                 u_int len, void *ptr)
 138{
 139        void __iomem *sys, *end;
 140        unsigned char *buf = ptr;
 141
 142        dev_dbg(&s->dev, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
 143
 144        if (attr & IS_INDIRECT) {
 145                /* Indirect accesses use a bunch of special registers at fixed
 146                   locations in common memory */
 147                u_char flags = ICTRL0_COMMON|ICTRL0_AUTOINC|ICTRL0_BYTEGRAN;
 148                if (attr & IS_ATTR) {
 149                        addr *= 2;
 150                        flags = ICTRL0_AUTOINC;
 151                }
 152
 153                sys = set_cis_map(s, 0, MAP_ACTIVE |
 154                                ((cis_width) ? MAP_16BIT : 0));
 155                if (!sys) {
 156                        dev_dbg(&s->dev, "could not map memory\n");
 157                        memset(ptr, 0xff, len);
 158                        return -1;
 159                }
 160
 161                writeb(flags, sys+CISREG_ICTRL0);
 162                writeb(addr & 0xff, sys+CISREG_IADDR0);
 163                writeb((addr>>8) & 0xff, sys+CISREG_IADDR1);
 164                writeb((addr>>16) & 0xff, sys+CISREG_IADDR2);
 165                writeb((addr>>24) & 0xff, sys+CISREG_IADDR3);
 166                for ( ; len > 0; len--, buf++)
 167                        *buf = readb(sys+CISREG_IDATA0);
 168        } else {
 169                u_int inc = 1, card_offset, flags;
 170
 171                if (addr > CISTPL_MAX_CIS_SIZE)
 172                        dev_dbg(&s->dev,
 173                                "attempt to read CIS mem at addr %#x", addr);
 174
 175                flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0);
 176                if (attr) {
 177                        flags |= MAP_ATTRIB;
 178                        inc++;
 179                        addr *= 2;
 180                }
 181
 182                card_offset = addr & ~(s->map_size-1);
 183                while (len) {
 184                        sys = set_cis_map(s, card_offset, flags);
 185                        if (!sys) {
 186                                dev_dbg(&s->dev, "could not map memory\n");
 187                                memset(ptr, 0xff, len);
 188                                return -1;
 189                        }
 190                        end = sys + s->map_size;
 191                        sys = sys + (addr & (s->map_size-1));
 192                        for ( ; len > 0; len--, buf++, sys += inc) {
 193                                if (sys == end)
 194                                        break;
 195                                *buf = readb(sys);
 196                        }
 197                        card_offset += s->map_size;
 198                        addr = 0;
 199                }
 200        }
 201        dev_dbg(&s->dev, "  %#2.2x %#2.2x %#2.2x %#2.2x ...\n",
 202                *(u_char *)(ptr+0), *(u_char *)(ptr+1),
 203                *(u_char *)(ptr+2), *(u_char *)(ptr+3));
 204        return 0;
 205}
 206
 207
 208/**
 209 * pcmcia_write_cis_mem() - low-level function to write CIS memory
 210 *
 211 * Probably only useful for writing one-byte registers. Must be called
 212 * with ops_mutex held.
 213 */
 214int pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
 215                   u_int len, void *ptr)
 216{
 217        void __iomem *sys, *end;
 218        unsigned char *buf = ptr;
 219
 220        dev_dbg(&s->dev,
 221                "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
 222
 223        if (attr & IS_INDIRECT) {
 224                /* Indirect accesses use a bunch of special registers at fixed
 225                   locations in common memory */
 226                u_char flags = ICTRL0_COMMON|ICTRL0_AUTOINC|ICTRL0_BYTEGRAN;
 227                if (attr & IS_ATTR) {
 228                        addr *= 2;
 229                        flags = ICTRL0_AUTOINC;
 230                }
 231
 232                sys = set_cis_map(s, 0, MAP_ACTIVE |
 233                                ((cis_width) ? MAP_16BIT : 0));
 234                if (!sys) {
 235                        dev_dbg(&s->dev, "could not map memory\n");
 236                        return -EINVAL;
 237                }
 238
 239                writeb(flags, sys+CISREG_ICTRL0);
 240                writeb(addr & 0xff, sys+CISREG_IADDR0);
 241                writeb((addr>>8) & 0xff, sys+CISREG_IADDR1);
 242                writeb((addr>>16) & 0xff, sys+CISREG_IADDR2);
 243                writeb((addr>>24) & 0xff, sys+CISREG_IADDR3);
 244                for ( ; len > 0; len--, buf++)
 245                        writeb(*buf, sys+CISREG_IDATA0);
 246        } else {
 247                u_int inc = 1, card_offset, flags;
 248
 249                flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0);
 250                if (attr & IS_ATTR) {
 251                        flags |= MAP_ATTRIB;
 252                        inc++;
 253                        addr *= 2;
 254                }
 255
 256                card_offset = addr & ~(s->map_size-1);
 257                while (len) {
 258                        sys = set_cis_map(s, card_offset, flags);
 259                        if (!sys) {
 260                                dev_dbg(&s->dev, "could not map memory\n");
 261                                return -EINVAL;
 262                        }
 263
 264                        end = sys + s->map_size;
 265                        sys = sys + (addr & (s->map_size-1));
 266                        for ( ; len > 0; len--, buf++, sys += inc) {
 267                                if (sys == end)
 268                                        break;
 269                                writeb(*buf, sys);
 270                        }
 271                        card_offset += s->map_size;
 272                        addr = 0;
 273                }
 274        }
 275        return 0;
 276}
 277
 278
 279/**
 280 * read_cis_cache() - read CIS memory or its associated cache
 281 *
 282 * This is a wrapper around read_cis_mem, with the same interface,
 283 * but which caches information, for cards whose CIS may not be
 284 * readable all the time.
 285 */
 286static int read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
 287                        size_t len, void *ptr)
 288{
 289        struct cis_cache_entry *cis;
 290        int ret = 0;
 291
 292        if (s->state & SOCKET_CARDBUS)
 293                return -EINVAL;
 294
 295        mutex_lock(&s->ops_mutex);
 296        if (s->fake_cis) {
 297                if (s->fake_cis_len >= addr+len)
 298                        memcpy(ptr, s->fake_cis+addr, len);
 299                else {
 300                        memset(ptr, 0xff, len);
 301                        ret = -EINVAL;
 302                }
 303                mutex_unlock(&s->ops_mutex);
 304                return ret;
 305        }
 306
 307        list_for_each_entry(cis, &s->cis_cache, node) {
 308                if (cis->addr == addr && cis->len == len && cis->attr == attr) {
 309                        memcpy(ptr, cis->cache, len);
 310                        mutex_unlock(&s->ops_mutex);
 311                        return 0;
 312                }
 313        }
 314
 315        ret = pcmcia_read_cis_mem(s, attr, addr, len, ptr);
 316
 317        if (ret == 0) {
 318                /* Copy data into the cache */
 319                cis = kmalloc(sizeof(struct cis_cache_entry) + len, GFP_KERNEL);
 320                if (cis) {
 321                        cis->addr = addr;
 322                        cis->len = len;
 323                        cis->attr = attr;
 324                        memcpy(cis->cache, ptr, len);
 325                        list_add(&cis->node, &s->cis_cache);
 326                }
 327        }
 328        mutex_unlock(&s->ops_mutex);
 329
 330        return ret;
 331}
 332
 333static void
 334remove_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, u_int len)
 335{
 336        struct cis_cache_entry *cis;
 337
 338        mutex_lock(&s->ops_mutex);
 339        list_for_each_entry(cis, &s->cis_cache, node)
 340                if (cis->addr == addr && cis->len == len && cis->attr == attr) {
 341                        list_del(&cis->node);
 342                        kfree(cis);
 343                        break;
 344                }
 345        mutex_unlock(&s->ops_mutex);
 346}
 347
 348/**
 349 * destroy_cis_cache() - destroy the CIS cache
 350 * @s:          pcmcia_socket for which CIS cache shall be destroyed
 351 *
 352 * This destroys the CIS cache but keeps any fake CIS alive. Must be
 353 * called with ops_mutex held.
 354 */
 355void destroy_cis_cache(struct pcmcia_socket *s)
 356{
 357        struct list_head *l, *n;
 358        struct cis_cache_entry *cis;
 359
 360        list_for_each_safe(l, n, &s->cis_cache) {
 361                cis = list_entry(l, struct cis_cache_entry, node);
 362                list_del(&cis->node);
 363                kfree(cis);
 364        }
 365}
 366
 367/**
 368 * verify_cis_cache() - does the CIS match what is in the CIS cache?
 369 */
 370int verify_cis_cache(struct pcmcia_socket *s)
 371{
 372        struct cis_cache_entry *cis;
 373        char *buf;
 374        int ret;
 375
 376        if (s->state & SOCKET_CARDBUS)
 377                return -EINVAL;
 378
 379        buf = kmalloc(256, GFP_KERNEL);
 380        if (buf == NULL) {
 381                dev_printk(KERN_WARNING, &s->dev,
 382                           "no memory for verifying CIS\n");
 383                return -ENOMEM;
 384        }
 385        mutex_lock(&s->ops_mutex);
 386        list_for_each_entry(cis, &s->cis_cache, node) {
 387                int len = cis->len;
 388
 389                if (len > 256)
 390                        len = 256;
 391
 392                ret = pcmcia_read_cis_mem(s, cis->attr, cis->addr, len, buf);
 393                if (ret || memcmp(buf, cis->cache, len) != 0) {
 394                        kfree(buf);
 395                        mutex_unlock(&s->ops_mutex);
 396                        return -1;
 397                }
 398        }
 399        kfree(buf);
 400        mutex_unlock(&s->ops_mutex);
 401        return 0;
 402}
 403
 404/**
 405 * pcmcia_replace_cis() - use a replacement CIS instead of the card's CIS
 406 *
 407 * For really bad cards, we provide a facility for uploading a
 408 * replacement CIS.
 409 */
 410int pcmcia_replace_cis(struct pcmcia_socket *s,
 411                       const u8 *data, const size_t len)
 412{
 413        if (len > CISTPL_MAX_CIS_SIZE) {
 414                dev_printk(KERN_WARNING, &s->dev, "replacement CIS 0v, ret || pcmcia/cistpl4.c#L315" id="L315" class4"line41name="L395"> 395                return -EINVAL;
 2ef">EINVAL;
 307        mutex_lock(&s->ops_mutex);
 338        kfree(s-> 399        s->buf = addr, len, GFP_KERNEL);
 380        if (s->buf == NULL) {
 321                dev_printk(KERN_WARNING, &s->dev, &toss="commy for verifying CIS\n");
 322 400        mutex_unlock(&s->ops_mutex);
 323                return -ENOMEM;
 384        }
 385        s->fa"sref">len = len;
 386        memcpy(s->len, size_t len;
 307        " clt whcode=dev_printk" clt whf">mutex_unlock(&s->dev, "r verifying CIS\n");
len)
{ = < pl.c#Ls->lennode) {
        }
 391
 352 */
 403
NULL) {
 385         400         386         400         307        " clref="+code=u_int" class="sref"2 400         338         400        memcpy(memcpy(cis->len)
memcpy(memcpy(cis->len)
memcpy(memcpy(cis->len)
memcpy(memcpy(cis->len)
 375
 410int (struct pcmcia_socket *s,
 287                         *len)
 288{
len)
 390                return -EINVAL;
 391
 292 !        if (s->state &         if (s->state & SOCKET_Cef">len)
 323                return -EINVAL;
 384 *s->len = s->ret = 0;
 375
 386 352 */
 307        " clcuplemcia_socket" clcuplereplsref">s->len = s->ret = 0;
 338        memcpy(s->len = memcpy(s-> 359
 380 >memcpy(s->">le1)ef">len !        if (s->state & NULL) {
 361                len = s->EINVAL;
 362                s->len = EINVAL;
 363     /a>        if (memcpy(size_t ret == 0) {
 394                        s->len = EINVAL;
 395             /a>        if (memcpy(size_t lenEINVAL;
 396                                return -EINVAL;
 397       elseEINVAL;
 318                        s->len = s->ret = 0;
 319                s->len =  = 0;
 380        }
 401           if (memcpy(size_t  = 0;
 402}
 403
 333           int (struct pcmcia_socket * *len)
 358   5tex);
es the CIS match what is in the 0="comme2ref="+co);
(size_t size_t                 return - 400                ofocket" clcuple_cofo370" id="L370" class="li4e" na47="L380"> 318    href="drivers/pcmcia/ci4tpl.c47ia_socket" cl;
4379  4      380  4     if (buf ==  381  4             dNK_Cs="cass=ess 0="commeGetl 382  4                        4span 4lass="string">"no;
s(struct s(strua>  383  4             return -s->len<= 0;
;
 384  4     }
 || ee" name="L358"> 358   5tex);385  4     4386  4      397                int len(s->len = /a>(  318    href="drivers/pcmcia/ci4tpl.c48ia_socket" clcuplerepdNK_Cs="cass=ess 0="commeMove/pcmrs/p">sil 379  4             if (len->ret = 0;
 390  4                      381  4 href="drivers/pcmcia/ci4tpl.c49printk" class"368" p || s-> 392  4             ret = ret = 0;
 383  4             if (ret(s->len =              384  4                     s-> 395  4                      396  4                     ret4rn -14
4397  4             }
4398  4     }
 || s->len =  379  4     len */a ent"onrivererrorrss pcm hHAmrs/plong#4357" id="L357" class="li4e" na45="L307">5400  5     5401  5     return 0;
s(struct s(strua> s->len = ;
5402}
5a href="drivers/pcmcia/c5stpl.50 class="sref">ret || ee" name="L358"> 358   5tex)5403
<5 href="drivers/pcmcia/ci5tpl.c50ode=ENOMEM" class="srcuplerepl.c#L397" id="L397" class="line" name="L397">5404/**
50ia_socket" clcuplerep/a>( ;
( 5454);
 358   5tex)5464
<505407 * Fo5 real50len" class="sref">len(s(struct s(strua> s->len = 54875497len->5410in5 5411  5                    cons5 s(struct s(strua> s->len = ;
5412{
5a href="drivers/pcmcia/c5stpl.51ss="sref">s-& || ee" name="L358"> 358   5tex)5413  5     if (5414  5             /a>( ;
( 5395  5             return -);
 358   5tex)52ef">EINV5L;
        ofocket" clcuple_cofo370" id="L370" class="li4e" na47="L380">5307  5     mutex_lock(removeef">s(struct s(strua> s->len = 5338  5     kfreel.c#L397" id="L397" class="line" name="L397">5497s id="L371" class="li4e" na47="L401">5380  5     if ((size_t pcmcia_socket *s,
5322 450        mutex_lock(uplemcia_socket" clcuplereplef">len)
 358   5tex)5323  5             return -5384  5     }
s->size_t 5385  5     s->s="sref">s,
s,
s,
cis53ef">EINV5     memc;
5307  5     " clt whcode=dev_pr5ntk" 52348" id="L348" class="line" name="L348">5ivers/pcm5ia/cistpl.c#L31istpl.c#L51istp52istpl.c#L399"a href="drivers/pcmcia/cistpl.c#4350" id="L350" class="li4e" na45="L390">5code=mute5_loc9dstplref="+code=mut5x_loc52len" class="sref">lenef">EINVAL;
5       }
5a href="drivers/pc4cia/c5stpl.53ss="sref">bufgt;state &         if (s->state & ENT="sre0||>      >)
5391
<5 href="drivers/pcmcia4ci5tpl.c53ocket" clrefass=_c"L3ef">EINVAL;
53525323  5 href="drivers/pcmcia/ci5tpl.c533ereplsref">s-> ret = 0;
5384  5     struct s->ret ->ret = 0;
5385  5      400        ode=cis" class="sref">ciss->len = 53ef">EINV5     5307  5     " clref="+code=u_in5" cla5s="sref"2 pcmcs->s,
CISTPLcia/vers/href="drivers/pccia/vers/h.c#4  ref">s,
5338  5      > 69"xff id="L353" class="li4e" na45="L323">53ode=mute5a hcuple_flaga href="+co5e=lec53len" class="sref">lenlsref">s-> 5tplref="+5ode=mutex_loc9dstplrefci5tpl.c54ode=len" class="sref"68" p id="L364" class="li4e" na46="L394">51"      s5ruct u8 61           s(struct s(strua> cis->;
51"      s5ruct a>-& || ee" name="L358"> 358   5tex)51"      s5ruct sl.c#L397" id="L397" class="line" name="L397">51"      s5ruct s > ) {
5185  5 href="drivers/pcmcia4ci5tpl.c54eal_get_next_cuplemcia_socketref">u8 61           51ef">EINV5 5107  5                     5288{
5a href="drivers/pcmcia4c5stpl.54ia_socket" clcuplerep id="L371" class="li4e" na47="L401">52ode=mute5cket *5390  5             return -5391
<5 href="drivers/pcmcia4ci5tpl.c55f="+code=u8" class="s > ) {
 id="L364" class="li4e" na46="L394">5292 !5       if (mutex_lock(ofocket" clcuple_cofo370"= 0;
5323  5             return -5384 *sssssssssef">EINVAL;
5375
<5 href="drivers/pcmcia4ci5tpl.c55ode=mutex_unlock" class="sref">mutex_unlockciss->len = 5386 352s(struct s(strua> cis->;
5307  5     " clcuplemcia_socke5" clc55mcia_socket" clcuple_cmcia_soa>-& || ee" name="L358"> 358   5tex)5338  5     sssssssssef">EINV" id="L397" class="line" name="L397">5359
<5 href="drivers/pcmcia4ci5tpl.c55len" class="sref">len id="L371" class="li4e" na47="L401">5380 >5emcpy(5362  5             s/a>( 5323  5  /a>        if (( 5384s/a>( ;
-&id="L357" class="li4e" na45="L307">5375
<5          /a>        if 5( ;
5386 35                        5    r5turn -( 5307  5    elseEINVAL;
(  id="L364" class="li4e" na46="L394">5318  5                     sswitchc/a>( 5359
<5             ssssssssscaspy(s5380  5     }
s->5401  5        if (u8 rrrrrrrr(cis5402}
5a href="drivers/pcmcia/c5stpl.57x_unlock" class="sref="sref">rrrrrrrr(s(struct s(strua> cis->5403
<5 href="drivers/pcmcia/ci5tpl.c57ode=ENOMEM" class="srcuplereplsref">sssssssssssssssss>lennode) "kOff="+code=memset" clLs"kOff="+plreff">ret = 0;
5333      5    int sssssssssa>-& || ee" name="L358"> 358   5tex)5
es the CIS m5tch w57eal_get_next_cuplemcia_socketref">u8         ef">EINV" id="L397" class="line" name="L397">5href="dri5s="mcpy(5h07  5             return -(s5318  5 href="drivers/pcmcia/ci5tpl.c57ia_socket" clcuplereplsref">sssssssss(s->5459
<5     sssssssssssssssss(cis5380  5     if (s(struct s(strua> cis->5381  5             >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>lennode) "kOff="+code=memset" clLs"kOff="+plreff">ret = 0;
5382  5                        5span 5lass="string">"noooooooooooooooooa>-& || ee" name="L358"> 358   5tex)5383  5             return -sssssssssef">EINV" id="L397" class="line" name="L397">5384  5     }
5385  5     5386  5     s->5397  5             int lenmmmmmmmmmmmmmmmm(5318  5 href="drivers/pcmcia/ci5tpl.c58ia_socket" clcuplerepref">lenmmmmmmmmmmmmmmmm(5359
<5             if (lenmmmmmmmmmmmmmmmm(ret = 0;
5390  5                     5381  5 href="drivers/pcmcia/ci5tpl.c59printk" class="sref">>>>>>>>>caspy(5392  5             retmmmmmmmmmmmmmmmm(ret = 0;
5383  5             if (retmmmmmmmmmmmmmmmm(cis5384  5                     ) {
5395  5                     u8         6NK_Cs="cass=ess 0="commeFcia_spallers/p0<0r+codsc.c#4357" id="L357" class="li4e" na45="L307">5396  5                     ret5rn -15
retmmmmmmmmmmmmmmmm(s(struct s(strua> cis->5397  5             }
lenmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1,>>lennode) "de=buf" class="srtdecpy<" id="L372" class="li4e" na47="L402">5398  5     }
lenmmmmmmmmmmmmmmmma>-& || ee" name="L358"> 358   5tex)5379  5     lennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnef">EINV" id="L397" class="line" name="L397">6400  6     6401  6     return 0;
6402}
6a href="drivers/pcmcia/c6stpl.60 class="sref">ret"""""""""""""""""""""""" NK_Cs="cass=ess 0="commeFcia_spexasrly on
6403
<6 href="drivers/pcmcia/ci6tpl.c60ode=ENOMEM" class="srcuplerep"""""""""""""""" || 6443
<6                     
60ia_socket" clcuplerepcuplerep"""""""""""""""" || ret = 0;
64546464
<606407 * Fo6 real60len" class="sref">lennnnnnnnncaspy(6487s->6497lenia/cistpppppppppbdesk id="L397" class="line" name="L397">6410in6 6411  6                    cons6 /a>(NULemcia_socket" clcupONKET_Cef>NULemcil.c#43lereplsrefid="L397" class="line" name="L397">6412{
6a href="drivers/pcmcia/c6stpl.61 class="sref">ret""""""""""""""""/a>( =  = =  || NULFIRST/vers/4353" id="L397" class="line" name="L397">6403
<6     if (6443
<6             6395  6             return - =  = =  || NULFIRST/vers/4353"id="L368" class="li4e" na46="L318">6364;
64076338  6      > ) {
 =  "id="L368" class="li4e" na46="L318">6397lenia/cistpbdesk id="L397" class="line" name="L397">6380  6     if () {
6311  6             6312{
60        s-& || ) {
 id="L364" class="li4e" na46="L394">6323  6             return -ret(s>lennode) =state" class="sref">state & size_t6384  6     }
EINVAL;
6385  6     s->"id="L397" class="line" name="L397">63646307  6     " clt whcode=dev_pr6ntk" 62class="sref">mutex_lock(pleLs"k+code=u_int" clTupleLs"ka"sref">ret = 0;
 =a_socket" clcupO;
 =375"= 0;
6338  6ia/cistpl.c#L31istpl.c#L61istp62istpl.c#L399"mutex_lock(pleLs"k+code=u_int" clTupleLs"ka"sref">ret = 0;
) {
6397ret = 6       }
6a href="drivers/pc4cia/c6stpl.63ss="sref">bufef">EIN" id="L358" class="li4e" na45="L338">6391
<6 href="drivers/pcmcia4ci6tpl.c63ocket"id="L397" class="line" name="L397">63526323  6 href="drivers/pcmcia/ci6tpl.c633erept" clasreal_get_first_cuplereplerepldatacket" clcuple_cst_cuplereplerepldataef">sss="sref">pcmcia_socket * *len)
 358   5tex)6384  6     struct 6385  6      400                lerivers/pcmcia/ciler367" id="L367" class="li4e" na46="L397">63ef">EINV6     memc;
6307  6     " clref="+code=u_in6" cla63348" id="L348" class="line" name="L348">6338  6     a href="drivers/pcmcia/cistpl.c#4350" id="L350" class="li4e" na45="L390">63ode=mute6a hcuple_flaga href="+co6e=lec63len" class="sref">lenef">EINVAL;
6tplref="+6ode=mutex_loc9dstplrefci6tpl.c64341" id="L341" class="li4e" na4e="L34#de61"      s6ruct a>(CISTPLaga href="+code=leFlagaplre)ef"   return -1;
61"      s6ruct EINVAL;
61"      s6ruct         lerivers/pcmcia/ciler367"e>s->ret = 0;
CISTPLaga href="+code=leFlagaplre)ef"   return -1;
6184  6ruct CISTPLaga href="+code=leFlagaplre)ef"   return -1;
s->ret = 0;
6185  6 href="drivers/pcmcia4ci6tpl.c64eal_get_next_ > =s" id="L366" class="li4e" na46="L396">61ef">EINV6 EIN" id="L358" class="li4e" na45="L338">6107  6                     mutex_lock(res/pcmcia/cistpl.c#L375"= 0;
s(struct s(strua> s->len = 6138  6a href="drivers/pcmcia4c6stpl.64ia_socket" clcuplerepclass="smutex_lock(pleLs"k+code=u_int" clTupleLs"ka"sref">ret = ->ret = 0;
61ode=mute6cket *lenlsref">s->s-> > CISTPLaga href="+code=leFlagaplre)ef"   return -1;
6390  6             return -CISTPLaga href="+code=leFlagaplre)ef"   return -1;
6391
<6 href="drivers/pcmcia4ci6tpl.c65f="+code=u8" a>(ee" name="L358"> 358   5tex)6292 !6       if (EINV" id="L397" class="line" name="L397">6323  6             return -EIN" id="L358" class="li4e" na45="L338">6384 *6375
<6 href="drivers/pcmcia4ci6tpl.c65ode=mid="L397" class="line" name="L397">63ef">EINV626307  6     " clcuplemcia_socke6" clc65mcia_ NK_Cs="cass=ess 0="commeParsing routlems pcmcindividual agaplsc.c#4357" id="L357" class="li4e" na45="L307">6338  6     63ode=mute6 href="drivers/pcmcia4ci6tpl.c65len" RDBUicc;
s->len)
len)
ee" name="L358"> 358   5tex)6380 >6emcpy(6361  6             ;
6362  6             size_tscavers/pcmcia/cistpscave370" id="L358" class="li4e" na45="L338">6323  6  /a>        if (        )
)
63846375
<6          /a>        if 6 400        e=buf" class="srp1nam= 0> > CISTPLaga href="+code=leFlagaplre)ef"   return -1;
63ef">EINV6                        6    r6turn -)
ret = 0;
6307  6    elseEINVAL;
6318  6                     (devichref="+code=leFldevichef">"ka"sref">ret = ndevref="drivers/pcndevis6359
<6             ->s,
CISTPLers/pcmcia/DEVIC/href="drivers/pcers/pcmcia/DEVIC/h367"  ref">s,
6380  6     }
6402}
6a href="drivers/pcmcia/c6stpl.67x_unlock" class="sref="sref">bdesk id="L397" class="line" name="L397">6403
<6 href="drivers/pcmcia/ci6tpl.c67ode=ENOMEM" class="srmutex_lock(devichref="+code=leFldevichef">"ka"sref">ret = devref="drivers/pcdeviss,
->n)
let" cl4e id="L358" class="li4e" na45="L338">6333      6    int (devichref="+code=leFldevichef">"ka"sref">ret = devref="drivers/pcdeviss,
->6
es the CIS m6tch w67eal_get_next_cuplemciswitchc/n)
63ef">EINV6s="mcpy(6h07  6             return -(devichref="+code=leFldevichef">"ka"sref">ret = devref="drivers/pcdeviss,
->6318  6 href="drivers/pcmcia/ci6tpl.c67ia_socket" clcuplereplsref">sbdesk id="L397" class="line" name="L397">6459
<6     scaspy1:id="L364" class="li4e" na46="L394">6380  6     if ("ka"sref">ret = devref="drivers/pcdeviss,
->6381  6             >>>>>>>>bdesk id="L397" class="line" name="L397">6382  6                        6span 6lass="string">"nocaspy2:id="L364" class="li4e" na46="L394">6303
<6             return -"ka"sref">ret = devref="drivers/pcdeviss,
->6333      6     }
6363ef">EINV6     "ka"sref">ret = devref="drivers/pcdeviss,
->6307  6             int lenmmmmmmmmbdesk id="L397" class="line" name="L397">6318  6 href="drivers/pcmcia/ci6tpl.c68ia_socket" clcuplerepcaspy4:id="L364" class="li4e" na46="L394">6359
<6             if (lenmmmmmmmmmutex_lock(devichref="+code=leFldevichef">"ka"sref">ret = devref="drivers/pcdeviss,
->6390  6                     6381  6 href="drivers/pcmcia/ci6tpl.c69printk" class="sref">caspy7:id="L364" class="li4e" na46="L394">6392  6             retmmmmmmmm++)
6383  6             if (retmmmmmmmmmmmmmmmmef">EINVAL;
6384  6                     "ka"sref">ret = devref="drivers/pcdeviss,
->sn)
6395  6                     6396  6                     ret6rn -16
retmmmmmmmm++)
6307  6             }
lenmmmmmmmmmmmmmmmmmmmmmmmmef">EINVAL;
6318  6     }
lenbdesk id="L397" class="line" name="L397">6359
<6     lendefault:id="L364" class="li4e" na46="L394">7400  7     EINVAL;
7401  7     return 0;
7402}
7a href="drivers/pcmcia/c7stpl.70ncpy7403
<7 href="drivers/pcmcia/ci7tpl.c70ode=ENOMEM" class="sr++)
7443
<7                     
70ia_socket" clcuplerepcuplerepef">EINVAL;
7453
<7                     n)
7464
<707407 * Fo7 real70len" class="sref">lenclass="">size_tscavers/pcmcia/cistpscave370"369n)
7487a>(7497lenia/cistpef">EINVAL;
7410in7 (devichref="+code=leFldevichef">"ka"sref">ret = devref="drivers/pcdeviss,
->>n)
let" cl3) + 1) * (512 &lla&llas>a>(7411  7                    cons7 (devichref="+code=leFldevichef">"ka"sref">ret = ndevref="drivers/pcndevis7412{
7a href="drivers/pcmcia/c7stpl.71 class="sref">ret++)
7403
<7     if (7443
<7             7395  7             return -7364;
EIN" id="L358" class="li4e" na45="L338">7407738773977380  7     if (;
s->len)
len)
 id="L353" class="li4e" na45="L323">7311  7             7312{
70        )
7323  7             return -7343
<7     }
EINVAL;
7385  7      400        e=buf" class="srp1nam= 0> > CISTPLaga href="+code=leFlagaplre)ef"   return -1;
7364)
f"   return -1;
ret = ->;
s->7307  7     " clt whcode=dev_pr7ntk" 72class="sref">mutex_lock(csum=buf" class="srcsumef">f"   return -1;
s->;
s->7338  7ia/cistpl.c#L31istpl.c#L71istp72istpl.c#L399"mutex_lock(csum=buf" class="srcsumef">f"   return -1;
369ns->7397EIN" id="L358" class="li4e" na45="L338">7       }
7a href="drivers/pc4cia/c7stpl.73ss="s"id="L397" class="line" name="L397">7391
<7 href="drivers/pcmcia4ci7tpl.c73ocketid="L397" class="line" name="L397">7312{
7an class/"come high-leve7repla7ancpy7323  7 href="drivers/pcmcia/ci7tpl.c733erepRDBUicc;
ef">s->len)
len)
7384  7     struct 7385  7      a>(7364EINVAL;
7307  7     " clref="+code=u_in7" cla73class="sref">mutex_lock(+/a> a>(7338  7     EIN" id="L358" class="li4e" na45="L338">7 977tplref="+7ode=mutex_loc9dstplrefci7tpl.c74341" id="L341" class="li4e" na4e="L34#de71"      s7ruct 71"      s7ruct ;
_mfcef">s->len)
len)
71"      s7ruct 7184  7ruct CISTPL)
7185  7 href="drivers/pcmcia4ci7tpl.c74eal_get_next_;
71ef">EINV7 7107  7                     mutex_lock(e=buf" class="srp1nam= 0> > CISTPLaga href="+code=leFlagaplre)ef"   return -1;
7138  7a href="drivers/pcmcia4c7stpl.74ia_soid="L357" class="li4e" na45="L307">71ode=mute7cket *)
s,
7390  7             return -a>() {
7391
<7 href="drivers/pcmcia4ci7tpl.c75ocket" clrefass=_c"L3ef">EINVAL;
7292 !7       if (->s,
CISTPL+/a> s,
7323  7             return -s,
->)
s,
7384  7/a> *(+/a> s,
->a>(7375
<7 href="drivers/pcmcia4ci7tpl.c75eal_get_next_cuplemci->73ef">EINV727307  7     " clcuplemcia_socke7" clc75class="sref">ef">EIN" id="L358" class="li4e" na45="L338">7338  7     73ode=mute7 href="drivers/pcmcia4ci7tpl.c75360" id="L360" class="li4e" na46="L380">7380 >7emcpy(a>()
()
;
7362  7             ret"""""""""+cod *)
 *)
7323  7  /a>        if (7384;
 * *7375
<7          /a>        if 773ef">EINV7                        7    r7turn -a>(7307  7    elseEINVAL;
lenef">EINVAL;
7318  7                     (nocket" clcuple_cns351"369"  ref">s,
7359
<7             ->s,
CISTPLmaxivers/pcmcia/cimaxINKr  ref">s,
7380  7     }
n)
7401  7        if (7402}
7a href="drivers/pcmcia/c7stpl.77x_unlock" class="sref)
s,
7423  7 href="drivers/pcmcia/ci7tpl.c77ode=ENOMEM" class="srmutex_lock(nocket" clcuple_cns351"++ id="L397" class="line" name="L397">7333      7    int 7375
<7_6" cl03es the CIS m7tch w77eal_get_next_cuplemcilass="srmutex_lock(ocket" clcuple_cmcia_[ref">s,
n)
-ing CIS\n")
73ef">EINV7s="mcpy(>n)
n)
7407  7             return -7418  7 href="drivers/pcmcia/ci7tpl.c77ia_socket" clcuplereplsref">s++)
7459
<7     sssssssssssssssssef">EINVAL;
7380  7     if (7381  7             >n)
++)
7382  7                        7span 7lass="string">"nossssssssbdesk id="L397" class="line" name="L397">7303
<7             return -7333      7     }
a>(7373ef">EINV7     EIN" id="L358" class="li4e" na45="L338">7307  7             int 7318  7 href="drivers/pcmcia/ci7tpl.c78ia_soid="L357" class="li4e" na45="L307">7359
<7             if (EIN>a>(0 : VAL;
7390  7                     7381  7 href="drivers/pcmcia/ci7tpl.c79ocketid="L397" class="line" name="L397">7392  7             7383  7             if (;
a>(len)
len)
7384  7                     7395  7                      400        )
)
7396  7                     ret7rn -179="sreid="L354" class="li4e" na45="L384">7307  7             }
mutex_lock(e=buf" class="srp1nam= 0> > CISTPLaga href="+code=leFlagaplre)ef"   return -1;
7318  7     }
(q=buf" class="srq370"= 0;
ret = 0;
7359
<7     8400  8     )
ret = majocode=buf" clsun4majoc370"369n)
s,
8401  8     return 0;
)
ret = minocode=buf" clsun4minoc370"369n)
s,
8421  8             s-& || le69)
8403
<8 href="drivers/pcmcia/ci8tpl.c80ode=ENOMEM" class="sref">EINVAL;
8443
<8                     
80ia_soid="L358" class="li4e" na45="L338">8453
<8                     EIN;
a>(((8464
<80ret = ot;cket" clcuple_cmtr370",ca>(ret = ofocket" clcuple_cofo370"so>lennode) ss="_1=buf" class="srss="_1cpy<"ka"sref">ret = nocket" clcuple_cns351"e id="L358" class="li4e" na45="L338">8407 * Fo8 real80348" "id="L397" class="line" name="L397">848784978410in8 a>(len)
len)
8411  8                    cons8 8412{
8a href="drivers/pcmcia/c8stpl.81t" clcuplerep > )
)
8403
<8     if (8443
<8             CISTPLe=buf" class="srp1nam= 0> > CISTPLaga href="+code=leFlagaplre)ef"   return -1;
8395  8             return - 400        q=buf" class="srq370"= 0;
ret = 0;
8364;
8407ef">EIN;
a>(((8387ret = ot;cket" clcuple_cmtr370",ca>(ret = ofocket" clcuple_cofo370"so>lennode) altot;cket" clcuple_caltot;cpy<"ka"sref">ret = nocket" clcuple_cns351"e id="L358" class="li4e" na45="L338">83978380  8     if (8312{
80        len)
len)
8323  8             return -8343
<8     }
CISTPL)
)
8385  8     83648307  8     " clt whcode=dev_pr8ntk" 82class="sref">mutex_lock(e=buf" class="srp1nam= 0> > CISTPLaga href="+code=leFlagaplre)ef"   return -1;
8338  8ia/cistpl.c#L31istpl.c#L81istp82istpl.c#L399"mutex_lock(q=buf" class="srq370"= 0;
ret = 0;
83978       }
8a href="drivers/pc4cia/c8stpl.83ode=len" claspcmcs->s,
CISTPLers/pcmcia/DEVIC/href="drivers/pcers/pcmcia/DEVIC/h367"  ref">s,
8391
<8 href="drivers/pcmcia4ci8tpl.c83printk" class="sref"> || le"mutex_lock(q=buf" class="srq370"-2 id="L353" class="li4e" na45="L323">8312{
8an class/"come high-leve8repla83ass="string">"nossssssssbdesk id="L397" class="line" name="L397">8323  8 href="drivers/pcmcia/ci8tpl.c83ode=ENOMEM" class="srmutex_lock(jedec ret = idrs/pcmcia/cistpid370"[ref">s,
->8343
<8     struct (jedec ret = idrs/pcmcia/cistpid370"[ref">s,
->8385  8     ->83648307  8     " clref="+code=u_in8" cla83class="sref">mutex_lock(jedec ret = nidrs/pcmcia/cistpnid370"369;
8338  8     EIN" id="L358" class="li4e" na45="L338">8 978tplref="+8ode=mutex_loc9dstplrefci8tpl.c84341" id="L341" class="li4e" na4e="L34#de81"      s8ruct 81"      s8ruct ;
len)
len)
 id="L353" class="li4e" na45="L323">81"      s8ruct 8184  8ruct a>(8185  8 href="drivers/pcmcia4ci8tpl.c84eal_get_next_cuplemcief">EINVAL;
81ef">EINV8 )
"ka"sref">ret = manf=buf" class="srmanf370"369;
s->8107  8                     mutex_lock(m=buf" class="srmef">"ka"sref">ret = cardrs/pcmcia/cistpcard370"369;
s->8138  8a href="drivers/pcmcia4c8stpl.84istpl.c#L399"ef">EIN" id="L358" class="li4e" na45="L338">81ode=mute8cket *8390  8             return -8292 !8       if (;
len)
len)
 id="L353" class="li4e" na45="L323">8323  8             return -8384  8/a> *CISTPL)
8375
<8 href="drivers/pcmcia4ci8tpl.c85eal_get_next_a>(83ef">EINV82EINVAL;
8307  8     " clcuplemcia_socke8" clc85class="sref">mutex_lock(e=buf" class="srp1nam= 0> > CISTPLaga href="+code=leFlagaplre)ef"   return -1;
8338  8     (f=buf" class="srfef">f"   return -1;
83ode=mute8 href="drivers/pcmcia4ci8tpl.c85len" class="smutex_lock(f=buf" class="srfef">f"   return -1;
8380 >8emcpy(EIN" id="L358" class="li4e" na45="L338">8361  8             8362  8             8323  8  /a>        if (8384;
a>(len)
len)
 id="L353" class="li4e" na45="L323">8375
<8          /a>        if 883ef">EINV8                        8    r86urn -)
)
8307  8    elseEINVAL;
8318  8                     a>(83ode=mute8             sef">EINVAL;
8380  8     }
)
CISTPLaga href="+code=leFlagaplre)ef"   return -1;
8401  8        if ()
f"   return -1;
8402}
8a href="drivers/pcmcia/c8stpl.87x_unlock" clapcmcs->s,
CISTPLpleLs"k+code=u_int" clTupleLs"ka"sref">ret = 0;
s,
8423  8 href="drivers/pcmcia/ci8tpl.c87ode=ENOMEM" class="srmutex_lock(f=buf" class="srfef">f"   return -1;
s,
s,
8484EIN" id="L358" class="li4e" na45="L338">8375
<8_6" cl03es the CIS m8tch w87eal_g"id="L397" class="line" name="L397">83ef">EINV8s="mcpy(8407  8             return -8418  8 href="drivers/pcmcia/ci8tpl.c87ia_soRDBUicc;
a>(len)
len)
84ode=mute8     8380  8     if (;
8381  8             )
)
8382  8                        8span 88ncpy8303
<8             return -)
CISTPLaga href="+code=leFlagaplre)ef"   return -1;
8333      8     }
CISTPLraszref="+code=leFlrasz1nam369n)
8375
<8      400        rmszref="+code=leFlrmsz1nam= 0>n)
let" cl2 id="L397" class="line" name="L397">83ef">EINV8     CISTPLraszref="+code=leFlrasz1nam+)
8307  8             int lenef">EINVAL;
8318  8 href="drivers/pcmcia/ci8tpl.c88istpl.c#L399"mutex_lock(configref="+code=leFlconfigcpy++)
8359
<8             if (8390  8                     )
8381  8 href="drivers/pcmcia/ci8tpl.c89ocket" clrefapcmcs->s,
s,
8392  8             s,
)
8383  8             if ()
8333      8                     ->s,
s,
8375
<8                      s,
83ef">EINV8                     ret8rn -1896cket" clrefapcmcs->s,
s,
8307  8             }
len-> s,
let" c2]3+69            s,
->8318  8     }
(configref="+code=leFlconfigcpy->8359
<8     EIN" id="L358" class="li4e" na45="L338">9400  9     9401  9     return 0;
9421  9             /* Theapcllowing rout 9431  9             if ( * config table entries.#4357" id="L397" class="line" name="L397">9441  9                     
90ia_so-ing CIS\n&qucomment"> */#4357" id="L397" class="line" name="L397">9451  9                     9464
<90)
)
a>()
()
)
9407 * Fo9 real90348"  id="L364" class="li4e" na46="L394">9487;
94979410in9 a>(9412{
9a href="drivers/pcmcia/c9stpl.91x_unlock" class="srefef">EIN;
9431  9     if ()
)
9441  9             CISTPLew;cket" clcuple_cpw;cpy9395  9             return - 400        e=buf" class="srp1nam++ id="L397" class="line" name="L397">9364;
->s,
s,
9407lena>()
93879497sssssssssssssssssef">EIN;
9380  9     if ()
s,
s,
n)
9311  9             s,
n)
9312{
90        "nosssssssswhile >n)
9323  9             return -++)
9343
<9     }
EIN;
9395  9     >n)
9364s,
9307n)
9387n)
9397ssssssssssssssssspppppppp)
)
9       }
9a href="drivers/pc4cia/c9stpl.93ode=EINVAL" class="srNOMEM" csssssssselse"n)
9391
<9 href="drivers/pcmcia4ci9tpl.c93printk" class="sref">sssssssssssssssspppppppp)
s,
9312{
9an class/"come high-leve9repla93ass="string">"nosssssssssssssssselse"n)
9323  9 href="drivers/pcmcia/ci9tpl.c93ode=ENOMEM" class="srsssssssssssssssspppppppp)
)
9 43
<9     struct 9 95  9     EIN;
93649307  9     " clref="+code=u_in9" cla93vers/pc4cia/cistpass=emset" c400        e=buf" class="srp1nam++ id="L397" class="line" name="L397">9338  9     9397EIN)
9tplref="+9ode=mutex_loc9dstplrefci9tpl.c94ss="s"id="L397" class="line" name="L397">91"      s9ruct 91"      s9ruct 91"      s9ruct )
)
a>()
()
)
9184  9ruct 9185  9 href="drivers/pcmcia4ci9tpl.c94="sref"2 400        91ef">EINV9 9107  9                     a>(9138  9a href="drivers/pcmcia4c9stpl.94ia_socket" clcuplerepef">EIN;
91ode=mute9cket *)
9390  9             return ->a>(9391
<9 href="drivers/pcmcia4ci9tpl.c95printk" class="sref">++)
9292 !9       if ("nossssssssef">EIN;
9323  9             return -s,
n)
9384  9/a> *(tims,
s,
9375
<9 href="drivers/pcmcia4ci9tpl.c95eal_get_next_}selseid="L358" class="li4e" na45="L338">93ef">EINV92(tim9307  9     " clcuplemcia_socke9" clc95class="sref">mutex_lock(sca href="+code=leFlsca h370" ">let" c= 2 id="L397" class="line" name="L397">9338  9     >a>(93ode=mute9 href="drivers/pcmcia4ci9tpl.c95t" clcuplereplsref">s++)
9380 >9emcpy(EIN;
9361  9             mutex_lock(tims,
n)
9362  9             s,
s,
9323  9  /a>        if (9384(tim9375
<9          /a>        if 9 400        sca href="+code=leFlsca h370" ">let" c= 3 id="L358" class="li4e" na45="L338">93ef">EINV9                        9    r96urn -a>(9307  9    elseEINVAL;
len++)
9338  9                     EIN;
93ode=mute9             smutex_lock(tims,
n)
9380  9     }
s,
s,
9401  9        if (9402}
9a href="drivers/pcmcia/c9stpl.97x_unlock" class="sref)
9423  9 href="drivers/pcmcia/ci9tpl.c97ode=ENOMEM" c)
9484EIN)
9375
<9_6" cl03es the CIS m9tch w97eal_g"id="L397" class="line" name="L397">93ef">EINV9s="mcpy(9407  9             return -9418  9 href="drivers/pcmcia/ci9tpl.c97ia_soRDBUicc)
)
)
()
)
94ode=mute9     9380  9     if (;
9301  9             9382  9                        9span 98x_unlock" claa>(9303
<9             return -EIN;
9333      9     }
CISTPLiors/pcmcia/cistpiocpy)
9375
<9     93ef">EINV9     9307  9             int lens="sref">CISTPLiors/pcmcia/cistpiocpy9318  9 href="drivers/pcmcia/ci9tpl.c98ia_socket" clcuplereps="sref">CISTPLiors/pcmcia/cistpiocpy->9359
<9             if (smutex_lock(iors/pcmcia/cistpiocpy->CISTPLiors/pcmcia/cistpiocpy9390  9                     EIN)
9381  9 href="drivers/pcmcia/ci9tpl.c99ocket" clrefa"id="L397" class="line" name="L397">9392  9             9383  9             if (++)
9333      9                     EIN;
9375
<9                      400        iors/pcmcia/cistpiocpyn)
93ef">EINV9                     ret9rn -199urn -)
n)
let" cl4 id="L358" class="li4e" na45="L338">9307  9             }
a>(9318  9     }
CISTPLbszref="+code=leFlbsz1nam++ id="L397" class="line" name="L397">9359
<9     n)
let" cl6 id="L397" class="line" name="L397">10400  10400< a>( b5/68/8e58de103c3eb93d2575cbd1913c307ea078_3/10400>d="L397" class="line" name="L397">10410  104href="drivers/pcmcia/ci104hr>104printk" class="sref">mutex_lock(lszref="+code=leFllsz1nam++ id="L397" class="line" name="L397">10420  104            10430  104            if (104ode=Eid="L358" class="li4e" na45="L338">10440  104                    1044cket" clrefapcmcs->s,
        iors/pcmcia/cistpiocpys,
10450  104                    104eal_get_next_cuplemci->s,
->10460  104                    ret104  >104urn -(iors/pcmcia/cistpiocpys,
->10470  104            }
lenpcmcs->s,
        bszref="+code=leFlbsz1nam  ref">s,
10480  104    }
10490  104    sssssssssssssssssef">EIN;
10100  10 sssssssssmutex_lock(iors/pcmcia/cistpiocpys,
->CISTPLjcket" clcuple_cj370"*8  id="L358" class="li4e" na45="L338">10 10  10                    cons10   >10 printk" class="sref">"id="L397" class="line" name="L397">10 20  10a href="drivers/pcmcia/c10a h>10 x_unlock" class="srefpcmcs->s,
        lszref="+code=leFllsz1nam  ref">s,
10130  10     if (10140  10             EIN;
10150  10             return -10 eal_get_next_cuplemciiiiiiiiimutex_lock(iors/pcmcia/cistpiocpys,
->)
CISTPLjcket" clcuple_cj370"*8  id="L358" class="li4e" na45="L338">10 60  10L;
10 70  10     10 80  10     EIN)
10 90  10     10 len" "id="L397" class="line" name="L397">10200  10     if (10210  10             10 20  100        )
a>()
()
)
10230  10             return -10 ode=E id="L364" class="li4e" na46="L394">10 40  10     }
;
10250  10     10 ="sref"2 400        10260  10     10 70  10     " clt whcode=dev_pr10   >10 class="sref">a>(10 80  10ia/cistpl.c#L31istpl.c#L10ia/>10 ia_socket" clcuplerepef">EIN;
10 90  10_loc9dstplref="+code=mut10_lo>10 9"sreid="L354" class="li4e" na45="L384">10300  10a href="drivers/pc4cia/c10a h>10a "sref"2 400        mem=buf" class="srmeme=s"f"   return -1;
n)
10a10  10 href="drivers/pcmcia4ci10 hr>10aocket" clrefa)
n)
let" cl3 id="L358" class="li4e" na45="L338">10a20  10an class/"come high-leve10an >10a2en" class="smutex_lock(aszref="+code=leFlasz1nam= 0>n)
let" cl5 id="L358" class="li4e" na45="L338">10a30  10 href="drivers/pcmcia/ci10 hr>10aode=ENOMEM" c)
10340  10     struct 10a4lass="sref">++)
10a50  10     EIN;
10360  10     10370  10     " clref="+code=u_in10   >10aclass="sref">pcmcs->s,
        mem=buf" class="srmeme=s"f"   return -1;
s,
10380  10     CISTPLlerivers/pcmcia/ciler1nam369            10390  10a hcuple_flaga href="+co10a h>10at" clcuplereplsref">spcmcs->s,
        lszref="+code=leFllsz1nam  ref">s,
10400  10ode=mutex_loc9dstplrefci10ode>10odde=ENOMEM" class="srssssssssa>(10410  10ruct 10oprintk" class="sref">ssssssssssssssssef">EIN;
10420  10ruct 10oass="string">"nossssssss->)
CISTPLjcket" clcuple_cj370"*8  id="L358" class="li4e" na45="L338">10430  10ruct 10oode=ENOMEM" class="sr"id="L397" class="line" name="L397">10440  10ruct 10oia_socket" clcuplereppcmcs->s,
        aszref="+code=leFlasz1nam  ref">s,
10450  10 href="drivers/pcmcia4ci10 hr>10oeal_get_next_cuplemciiiiiiiiia>(10460  10 10oEIN;
10470  10                     10overs/pc4cia/cistpass=emset" c400        4aivers/pcmcia/cica1nam3+69n)
CISTPLjcket" clcuple_cj370"*8  id="L358" class="li4e" na45="L338">10480  10a href="drivers/pcmcia4c10a h>10oia_socket" clcuplerep"id="L397" class="line" name="L397">10o90  10cket *s)
10500  10             return -10  ers/pc4cia/cistpass=emset" cpcmcs->s,
        aszref="+code=leFlasz1nam  ref">s,
10510  10 href="drivers/pcmcia4ci10 hr>10 printk" class="sref">ssssssssssssssssa>(10520  10       if ("nossssssssssssssssssssssssef">EIN;
10530  10             return -10 ode=ENOMEM" class="srssssssssssssssss            )
CISTPLjcket" clcuple_cj370"*8  id="L358" class="li4e" na45="L338">10540  10/a> *>10 ia_socket" clcuplerepssssssss"id="L397" class="line" name="L397">10550  10 href="drivers/pcmcia4ci10 hr>10 eal_get_next_cuplemci->s,
->->10560  10210 urn -(mem=buf" class="srmeme=s"f"   return -1;
s,
->10570  10     " clcuplemcia_socke10   >10 len" class="sref">lens="sref">CISTPLmem=buf" class="srmeme=s"f"   return -1;
s,
->10580  10     10 ia_socket" cl"id="L397" class="line" name="L397">10590  10 href="drivers/pcmcia4ci10 hr>10 len" class="sef">EIN)
10600  10emcpy(10610  10             10eocketid="L397" class="line" name="L397">10620  10             10encpy10e30  10  /a>        if (10e3erepRDBUicc)
)
a>()
()
)
10640  10                     10elerep id="L364" class="li4e" na46="L394">10e50  10          /a>        if 10   >10eeal_get_next_a>(10660  10                        10   >10eurn -EIN;
10670  10    elseEINVAL;
10eclass="sref">mutex_lock(irq=buf" class="srirqe=s"f"   return -1;
10680  10                     10eistpl.c#L399"mutex_lock(irq=buf" class="srirqe=s"f"   return -1;
10690  10             10et" clcuplereplsref">s)
le9)
10700  10     }
EIN;
10710  10        if (10 printk" class="sref">mutex_lock(irq=buf" class="srirqe=s"f"   return -1;
)
10 20  10a href="drivers/pcmcia/c10a h>10 x_unlock" class="sref)
10 30  10 href="drivers/pcmcia/ci10 hr>10 3al_get_next_}id="L397" class="line" name="L397">10 40  10    int 10 ia_socket" clef">EIN)
10 50  10_6" cl03es the CIS m10_6">10 eal_g"id="L397" class="line" name="L397">10 60  10s="mcpy(10 ="sreid="L354" class="li4e" na45="L384">10770  10             return -10 vers/id="L354" class="li4e" na45="L384">10 80  10 href="drivers/pcmcia/ci10 hr>10 ia_soRDBUicc;
a>()
10 90  10     10 t" clcuplereplsref">ssssssssssssssss            )
10800  10     if (10810  10             )
)
)
EeKr_each_safe" clfea">EeK1nam id="L358" class="li4e" na45="L338">10820  10                        10   >10 ncpy10830  10             return -10 ode=ENOMEM" c)
10840  10     }
CISTPLq=buf" class="srq370"369            10850  10      400        entrypket" clcuple_centrye=s"f"   return -1;
10860  10     10 70  10             int 10 class="sref">n)
10 80  10 href="drivers/pcmcia/ci10 hr>10 ia_socket" clcuplereps="sref">CISTPLentrypket" clcuple_centrye=s"f"   return -1;
)
10890  10             if (10 9lass="sref">n)
10900  10                     10  " clcuplereplsref">s++)
10910  10 href="drivers/pcmcia/ci10 hr>10 printk" class="sref">ssssssssef">EIN-)
10920  10             10930  10             if (10 ode=ENOMEM" class="srsssssssss="sref">CISTPLentrypket" clcuple_centrye=s"f"   return -1;
)
10940  10                     10 ia_socket" clcuplerepn)
10950  10                     10 eal_get_next_cuplemciiiiiiiiimutex_lock(entrypket" clcuple_centrye=s"f"   return -1;
)
10960  10                     ret10   >10 urn -n)
10970  10             }
        entrypket" clcuple_centrye=s"f"   return -1;
)
10980  10     }
n)
10990  10     sssssssss400        entrypket" clcuple_centrye=s"f"   return -1;
)
11400  11400< s400        entrypket" clcuple_centrye=s"f"   return -1;
)
11410  114href="drivers/pcmcia/ci114hr>114printk" class}selseid="L358" class="li4e" na45="L338">11420  114            11430  114            if (114ode=Eid="L358" class="li4e" na45="L338">11440  114                    1144cket" clrefa/* Process optional fea">EeK */11450  114                    110eal_get_next_++)
11460  114                    ret114  >114urn -EIN-)
11470  114            }
mutex_lock(fea">EeKr_each_safe" clfea">EeK1nam369n)
11480  114    }
11490  114    /* Power optionK */11100  11 >a>(EeKr_each_safe" clfea">EeK1nam3" clTU3) ">le904" id="L364" class="li4e" na46="L394">11 10  11                    cons11   >11 printk" class="sref">)
a>(()
11 20  11a href="drivers/pcmcia/c11a h>11 x_unlock" class="srefa>(11130  11     if (EIN-)
11140  11             11150  11             return -11 eal_get_next_cuplemci)
->11 60  11L;
EeKr_each_safe" clfea">EeK1nam3" clTU3) ">le914" id="L364" class="li4e" na46="L394">11 70  11     lens="sref">CISTPLe=buf" class="srp1nam369            a>(()
11 80  11     a>(11190  11     111t" clcuplereplsref">sssssssssef">EIN-)
11200  11     if (11210  11             )
->11 20  110        >a>(EeKr_each_safe" clfea">EeK1nam3" clTU3) ">le924" id="L364" class="li4e" na46="L394">11230  11             return -112ode=ENOMEM" class="srmutex_lock(e=buf" class="srp1nam369            a>(()
11 40  11     }
a>(11250  11     112eal_get_next_cuplemciiiiiiiiief">EIN-)
11260  11     11270  11     " clt whcode=dev_pr11   >112len" class="sref">lens="sref">CISTPLentrypket" clcuple_centrye=s"f"   return -1;
->11 80  11ia/cistpl.c#L31istpl.c#L11ia/>112ia_soid="L397" class="line" name="L397">11 90  11_loc9dstplref="+code=mut11_lo>112t" clcuplerep/* Tim11300  11a href="drivers/pc4cia/c11a h>113<" clcuplerepa>(EeKr_each_safe" clfea">EeK1nam3" clTU0x044" id="L364" class="li4e" na46="L394">11a10  11 href="drivers/pcmcia4ci11 hr>113printk" class="sref">)
a>(()
11a20  11an class/"come high-leve11an >113x_unlock" class="srefa>(11a30  11 href="drivers/pcmcia/ci11 hr>113ode=ENOMEM" class="srssssssssef">EIN-)
11340  11     struct 113ia_socket" cl}selse" id="L364" class="li4e" na46="L394">11a50  11     ->11360  11     ->11370  11     " clref="+code=u_in11   >113len" class="sref">lens="sref">CISTPLentrypket" clcuple_centrye=s"f"   return -1;
->11380  11     11390  11a hcuple_flaga href="+co11a h>1139"sreid="L354" class="li4e" na45="L384">11400  11ode=mutex_loc9dstplrefci11ode>11odde=ENOMEM" c/* I/O window optionK */11410  11ruct 11oprintk" classa>(EeKr_each_safe" clfea">EeK1nam3" clTU0x084" id="L364" class="li4e" na46="L394">11420  11ruct 11oass="string">"no)
()
11430  11ruct 11oode=ENOMEM" class="sra>(11440  11ruct 11oia_socket" clcuplerepssssssssef">EIN-)
11450  11 href="drivers/pcmcia4ci11 hr>11oeal_get_next_}selseid="L358" class="li4e" na45="L338">11460  11 11o->11470  11                     114vers/id="L354" class="li4e" na45="L384">11480  11a href="drivers/pcmcia4c11a h>11oia_socket" cl/* Interrupt optionK */11490  11cket *a>(EeKr_each_safe" clfea">EeK1nam3" clTU0x104" id="L364" class="li4e" na46="L394">11500  11             return -11  ers/pc4cia/cistpass=)
a>(()
11510  11 href="drivers/pcmcia4ci11 hr>11 printk" class="sref">a>(11520  11       if ("nossssssssef">EIN-)
11530  11             return -11 ode=ENOMEM" c}selseid="L358" class="li4e" na45="L338">11540  11/a> *>11 ia_socket" clcuplerep)
->11550  11 href="drivers/pcmcia4ci11 hr>115ode=mid="L397" class="line" name="L397">11560  11211 urn -a>(EeKr_each_safe" clfea">EeK1nam3" clTU0x604" id="L364" class="li4e" na46="L394">11570  11     " clcuplemcia_socke11   >11 len" class="scaseU0x00:id="L364" class="li4e" na46="L394">11580  11     115ia_socket" clcuplereps="sref">CISTPLentrypket" clcuple_centrye=s"f"   return -1;
->11590  11 href="drivers/pcmcia4ci11 hr>115t" clcuplereplsref">sbreak id="L358" class="li4e" na45="L338">11600  11emcpy(11610  11             116printk" class="sref">)
->11620  11             116x_unlock" class="sref)
->->->;
a>(11e30  11  /a>        if (116ode=ENOMEM" class="srmutex_lock(entrypket" clcuple_centrye=s"f"   return -1;
->->11640  11                     116ia_socket" clcuplerep)
->->11650  11          /a>        if 11   >116eal_get_next_cuplemci)
11660  11                        11   >11eurn -a>(le9)
11670  11    elseEINVAL;
116vers/pc4cia/cistpass=emset" cef">EIN-)
11680  11                     116ia_socket" clcuplerepbreak id="L358" class="li4e" na45="L338">11690  11             11et" clcuplerepcaseU0x40:id="L364" class="li4e" na46="L394">11700  11     }
)
->11710  11        if (11 printk" class="sref">mutex_lock(entrypket" clcuple_centrye=s"f"   return -1;
->->->;
a>(11 20  11a href="drivers/pcmcia/c11a h>11 x_unlock" class="sref)
->->;
a>(11 30  11 href="drivers/pcmcia/ci11 hr>117ode=ENOMEM" class="srmutex_lock(entrypket" clcuple_centrye=s"f"   return -1;
->->11 40  11    int 117ia_socket" clcuplerep)
11 50  11_6" cl03es the CIS m11_6">117eal_get_next_cuplemcia>(le9)
11 60  11s="mcpy(117EIN-)
11770  11             return -117vers/pc4cia/cistpass=break id="L358" class="li4e" na45="L338">11 80  11 href="drivers/pcmcia/ci11 hr>1178" clcuplerepcaseU0x60:id="L364" class="li4e" na46="L394">11790  11     11 t" clcuplereplsref">s)
a>(()
11800  11     if (sa>(11810  11             ssssssssef">EIN-)
11820  11                        11   >118x_unlock" class="srefbreak id="L358" class="li4e" na45="L338">11830  11             return -1183al_get_next_}id="L397" class="line" name="L397">11840  11     }
11850  11      4span        comme/ao>/* Misc fea">EeK */11860  11     EeKr_each_safe" clfea">EeK1nam3" clTU0x804" id="L364" class="li4e" na46="L394">11 70  11             int 118vers/pc4cia/cistpass=a>(11 80  11 href="drivers/pcmcia/ci11 hr>11 ia_socket" clcuplerepssssssssef">EIN-)
11890  11             if (118t" clcuplereplsref">s)
n)
11900  11                     11  " clcuplereplsref">swhilea>n)
11910  11 href="drivers/pcmcia/ci11 hr>11 printk" class="sref">ssssssss++)
11920  11             EIN-)
11930  11             if (11 ode=ENOMEM" class="sr)
11940  11                     11 ia_socket" cl}id="L397" class="line" name="L397">11950  11                     119ode=mid="L397" class="line" name="L397">11960  11                     ret11   >119urn -)
)
11970  11             }
11980  11     }
EIN0 id="L358" class="li4e" na45="L338">11990  11     12400  12400< 12410  124href="drivers/pcmcia/ci124hr>120ocketid="L397" class="line" name="L397">12420  124            a>()
)
12430  124            if (124ode=E id="L364" class="li4e" na46="L394">12440  124                    120ia_socket" cls="sref">CISTPL)
)
12450  124                    120eal_get_next_;
12460  124                    ret124  >120="sreid="L354" class="li4e" na45="L384">12470  124            }
mutex_lock(e=buf" class="srp1nam369>a>()
12480  124    }
mutex_lock(q=buf" class="srq370"369            12490  124    12100  12 ->s,
        ers/pcmMAX_DEVICEScket" clcuple_cers/pcmMAX_DEVICES1nam  ref">s,
12 10  12                    cons12   >12 printk" class="sref">a>(le9)
12 20  12a href="drivers/pcmcia/c12a h>12 x_unlock" class="srefffffffffbreak id="L358" class="li4e" na45="L338">12130  12     if (s,
->12140  12             )
s,
->CISTPLe=buf" class="srp1nam[1]-1  id="L358" class="li4e" na45="L338">12150  12             return -12 eal_get_next_cuplemci)
s,
->CISTPLe=buf" class="srp1nam[2]-1  id="L358" class="li4e" na45="L338">12160  12L;
)
s,
->CISTPLe=buf" class="srp1nam[3]-1  id="L358" class="li4e" na45="L338">12170  12     lens="sref">CISTPLgeors/pcmcia/cistpgeoe=s"f"   return -1;
s,
->CISTPLe=buf" class="srp1nam[4]-1  id="L358" class="li4e" na45="L338">12180  12     CISTPLgeors/pcmcia/cistpgeoe=s"f"   return -1;
s,
->CISTPLe=buf" class="srp1nam[5]-1  id="L358" class="li4e" na45="L338">12190  12     121t" clcuplereplsref">s)
12200  12     if (12210  12             CISTPLgeors/pcmcia/cistpgeoe=s"f"   return -1;
12 20  120        EIN0 id="L358" class="li4e" na45="L338">12230  12             return -122ode=E}id="L358" class="li4e" na45="L338">12240  12     }
12250  12     122ode=mid="L397" class="line" name="L397">12260  12     a>()
)
12270  12     " clt whcode=dev_pr12   >122len"  id="L364" class="li4e" na46="L394">12 80  12ia/cistpl.c#L31istpl.c#L12ia/>1228lass="sref">mutex_lock()
)
12 90  12_loc9dstplref="+code=mut12_lo>1229"sreid="L354" class="li4e" na45="L384">12300  12a href="drivers/pc4cia/c12a h>123<" clcuplerepa>(12a10  12 href="drivers/pcmcia4ci12 hr>123printk" class="sref">ef">EIN-)
12a20  12an class/"come high-leve12an >123ncpy12a30  12 href="drivers/pcmcia/ci12 hr>123ode=ENOMEM" cmutex_lock(e=buf" class="srp1nam369)
12340  12     struct 123ia_socket" cls="sref">CISTPLq=buf" class="srq370"369            12a50  12     12360  12     12370  12     " clref="+code=u_in12   >123class="sref">mutex_lock(v2=buf" class="srv2e=s"f"   return -1;
12380  12     mutex_lock(v2=buf" class="srv2e=s"f"   return -1;
CISTPLget_unaligned_leL;
a>(12390  12a hcuple_flaga href="+co12a h>1239rn -)
12400  12ode=mutex_loc9dstplrefci12ode>12odde=ENOMEM" c)
12410  12ruct 124printk" classs="sref">CISTPLv2=buf" class="srv2e=s"f"   return -1;
12420  12ruct 12oass="string">)
12430  12ruct 12oode=ENOMEM" cef">EIN)
a>((()
(12440  12ruct 12oia_so}id="L358" class="li4e" na45="L338">12450  12 href="drivers/pcmcia4ci12 hr>124ode=mid="L397" class="line" name="L397">12460  12 124="sreid="L354" class="li4e" na45="L384">12470  12                     124vers/RDBUicc;
a>()
)
12480  12a href="drivers/pcmcia4c12a h>12oia_so id="L364" class="li4e" na46="L394">12490  12cket *)
)
12500  12             return -12  ers/pc4cia/c;
12510  12 href="drivers/pcmcia4ci12 hr>125ocketid="L397" class="line" name="L397">12520  12       if ()
12530  12             return -125ode=ENOMEM" cmutex_lock(q=buf" class="srq370"369            12540  12/a> *>12 ia_socket" cla>(12550  12 href="drivers/pcmcia4ci12 hr>125eal_get_next_cuplemcief">EIN-)
12560  122125urn -)
)
12570  12     " clcuplemcia_socke12   >125class="sref">++)
12580  12     125ia_socket" clcuplerepef">EIN-)
12590  12 href="drivers/pcmcia4ci12 hr>125t" clcuplereppcmcs->s,
s,
12600  12emcpy(s,
)
12610  12             126printk" class="sref">n)
'\0'12620  12             126x_unlock" class="srefffffffffbreak id="L358" class="li4e" na45="L338">12e30  12  /a>        if (126ode=ENOMEM" class="sr++)
12640  12                     126ia_socket" clcuplerepcuplerepef">EIN-)
12650  12          /a>        if 12   >126eal_get_next_}id="L358" class="li4e" na45="L338">12660  12                        12   >12eurn -EIN0 id="L358" class="li4e" na45="L338">12670  12    elseEINVAL;
126vers/}id="L358" class="li4e" na45="L338">12680  12                     126ia_soid="L397" class="line" name="L397">12690  12             1269"sreid="L354" class="li4e" na45="L384">12700  12     }
a>()
)
12710  12        if (12 print id="L364" class="li4e" na46="L394">12 20  12a href="drivers/pcmcia/c12a h>127ass="string">)
)
12 30  12 href="drivers/pcmcia/ci12 hr>127ode=Eid="L358" class="li4e" na45="L338">12 40  12    int 127ia_socket" cla>(12 50  12_6" cl03es the CIS m12_6">127eal_get_next_cuplemcief">EIN-)
12 60  12s="mcpy(127="sreid="L354" class="li4e" na45="L384">12770  12             return -127class="sref">mutex_lock(e=buf" class="srp1nam369)
12 80  12 href="drivers/pcmcia/ci12 hr>127ia_soid="L397" class="line" name="L397">12790  12     1279rn -)
12800  12     if ()
12810  12             CISTPLfmia_socket" clcupfmi370"f"   return -1;
CISTPLget_unaligned_le32=buf" class="srget_unaligned_le32e=s">a>(12820  12                        12   >128ass="string">)
CISTPLget_unaligned_le32=buf" class="srget_unaligned_le32e=s">a>(12830  12             return -128ode=Eid="L358" class="li4e" na45="L338">12840  12     }
EIN0 id="L358" class="li4e" na45="L338">12850  12     12860  12     12 70  12             int 128vers/id="L354" class="li4e" na45="L384">12 80  12 href="drivers/pcmcia/ci12 hr>12 ia_so;
a>()
)
12890  12             if (128t" cl id="L364" class="li4e" na46="L394">12900  12                     129 ers/pc4cia/c;
12910  12 href="drivers/pcmcia/ci12 hr>129ocketid="L397" class="line" name="L397">12920  12             a>(le9)
12930  12             if (12 ode=ENOMEM" class="sref">EIN-)
12940  12                     12 ia_socket" clswitcha>a>(12950  12                     129eal_get_next_caseUreturn -1;
12960  12                     ret12   >129urn -12970  12             }
lens="sref">CISTPLreia_socket" clcuprei1nam369;
a>()
12980  12     }
12990  12     13400  13400< a>()
13410  134href="drivers/pcmcia/ci134hr>130printk" class="sref">break id="L358" class="li4e" na45="L338">13420  134            13430  134            if (1303" clcuplerepcaseUreturn -1;
13440  134                    130ia_socket" clcuplerep)
a>()
13450  134                    130eal_get_next_cuplemcibreak id="L358" class="li4e" na45="L338">13460  134                    ret134  >130urn -13470  134            }
lens="sref">CISTPLreia_socket" clcuprei1nam369;
a>()
13480  134    }
13490  134    13100  13 a>()
13 10  13                    cons13   >13 printk" class="sref">break id="L358" class="li4e" na45="L338">13 20  13a href="drivers/pcmcia/c13a h>1312" clcuplerepcaseUreturn -1;
13130  13     if (a>()
13 40  13             13 50  13             return -131eal_get_next_caseUreturn -1;
13160  13L;
13170  13     lens="sref">CISTPLreia_socket" clcuprei1nam369;
a>()
13 80  13     13 90  13     131t" clcuplerepcaseUreturn -1;
13200  13     if (a>()
13210  13             break id="L358" class="li4e" na45="L338">13 20  130        13230  13             return -132ode=ENOMEM" class="sr)
a>()
13240  13     }
13250  13     132eal_get_next_caseUreturn -1;
13260  13     )
a>()
13270  13     " clt whcode=dev_pr13   >132vers/pc4cia/cistpass=break id="L358" class="li4e" na45="L338">13 80  13ia/cistpl.c#L31istpl.c#L13ia/>1328" clcuplerepcaseUreturn -1;
13290  13_loc9dstplref="+code=mut13_lo>132t" clcuplereplsref">s)
a>()
13300  13a href="drivers/pc4cia/c13a h>1330en" class="s13a10  13 href="drivers/pcmcia4ci13 hr>133printk" classcaseUreturn -1;
13a20  13an class/"come high-leve13an >133x_unlock" class="sref)
a>()
13330  13 href="drivers/pcmcia/ci13 hr>133ode=ENOMEM" class="srbreak id="L358" class="li4e" na45="L338">13a40  13     struct 133ia_socket" clcaseUreturn -1;
13a50  13     13a60  13     )
a>()
13370  13     " clref="+code=u_in13   >133vers/pc4cia/cistpass=break id="L358" class="li4e" na45="L338">13380  13     13a90  13a hcuple_flaga href="+co13a h>133t" clcuplereplsref">s)
a>()
13400  13ode=mutex_loc9dstplrefci13ode>1340en" class="s13410  13ruct 134printk" classcaseUreturn -1;
13420  13ruct 134x_unlock" class="sref)
a>()
13430  13ruct 134ode=ENOMEM" class="srbreak id="L358" class="li4e" na45="L338">13440  13ruct 134ia_socket" clcaseUreturn -1;
13450  13 href="drivers/pcmcia4ci13 hr>134eal_get_next_caseUreturn -1;
13460  13 134a>()
13470  13                     134vers/pc4cia/cistpass=break id="L358" class="li4e" na45="L338">13480  13a href="drivers/pcmcia4c13a h>1348" clcuplerepcaseUreturn -1;
13490  13cket *13500  13             return -1350en" class="s)
13510  13 href="drivers/pcmcia4ci13 hr>135printk" class="sref">break id="L358" class="li4e" na45="L338">13520  13       if (default:id="L364" class="li4e" na46="L394">13530  13             return -135ode=ENOMEM" class="sr)
)
13540  13/a> *>135ia_socket" clcuplerepbreak id="L358" class="li4e" na45="L338">13550  13 href="drivers/pcmcia4ci13 hr>135eal_get_next_}id="L358" class="li4e" na45="L338">13560  132135urn -a>(13570  13     " clcuplemcia_socke13   >135len" class="sref">lens="sref">CISTPLpr_debuspket" clcuple_cer_debuse=s">aspan        strins">"earse_tuple failed %d\n"13580  13     135ia_socket" clef">EIN            13590  13 href="drivers/pcmcia4ci13 hr>135t" cl}id="L397" class="line" name="L397">13600  13emcpy()
a>(13610  13             136ocketid="L397" class="line" name="L397">13620  13             136ncpy13e30  13  /a>        if (136ode=Easpan        comment">/**13e40  13                     136ia_soaspan        comment"> * pccard_validate_45=() - check whether card has a sensible ers13e50  13          /a>        if 13   >136eal_gaspan        comment"> * @s:"sref">lenthe struct e4e" n_socket we are to check13e60  13                        13   >13eurn -aspan        comment"> * @info:ket" clef">EIsnthe number of tupleK innthe (valid) ers, or 013e70  13    elseEINVAL;
136vers/aspan        comment"> *13e80  13                     136ia_soaspan        comment"> * ThisntrieK to determ   S13e90  13             1369"sreaspan        comment"> * ef">EIsnthe number of tupleK innthe ers, or 0S13700  13     }
 * checks include makins sure sess=al critical tupleK are present and13710  13        if (13 printaspan        comment"> * valid; seeins 13720  13a href="drivers/pcmcia/c13a h>137ass="aspan        comment"> * lookins pcmctupleK that useUreserved le_fs.13730  13 href="drivers/pcmcia/ci13 hr>137ode=Easpan        comment"> *13 40  13    int 137ia_soaspan        comment"> * The function ef">EIsn0 on success.13750  13_6" cl03es the CIS m13_6">137eal_gaspan        comment"> */13760  13s="mcpy(137="sre;
struct a>()
n)
13770  13             return -137len"  id="L364" class="li4e" na46="L394">13 80  13 href="drivers/pcmcia/ci13 hr>1378lass="sref">mutex_lock(tuple_ia_socket" clcuptuple_ie=s" n)
13790  13     1379rn -)
)
13800  13     if (return -1;
13810  13             ;
13820  13                        13   >138ncpy13830  13             return -138ode=ENOMEM" c!)
13840  13     }
EIN-)
13850  13     13860  13     13 70  13             int 138len" class="sref">lens="sref">CISTPLWARN_ONa_socket" clcupWARN_ONe=s">1  id="L358" class="li4e" na45="L338">13 80  13 href="drivers/pcmcia/ci13 hr>138ia_socket" clcuplerepef">EIN-)
13890  13             if (1389rn -13900  13                     139 ers/id="L397" class="line" name="L397">13910  13 href="drivers/pcmcia/ci13 hr>139printk" classsspan        comment">/* We do not wa/a>to validateathe ers cache... */13920  13             )
" clT)
13930  13             if (139ode=ENOMEM" cmutex_lock(_fstroy_45=_cachepket" clcuple_cdestroy_45=_cachee=s">a>(13940  13                     13 ia_socket" cl)
" clT)
13950  13                     139ode=mid="L397" class="line" name="L397">13960  13                     ret13   >139urn -)
sizeof>n)
13970  13             }
)
13980  13     }
" clT)
"no memory>to validateaers\n"13990  13     sef">EIN-)
14400  14400< 14410  144href="drivers/pcmcia/ci144hr>140printk" classs="sref">CISTPLe=buf" class="srp1nam369)
sizeof>n)
14420  144            a>(14430  144            if (140ode=ENOMEM" class="sr)
a>(14440  144                    140ia_socket" clcuplerep)
" clT)
"no memory>to validateaers\n"14450  144                    140eal_get_next_cuplemcief">EIN-)
14460  144                    ret144  >140urn -14470  144            }
14480  144    }
mutex_lock(counta_socket" clcup4ount1nam369            14490  144    14100  14 )
14110  14                    cons14   >141printk" classs="sref">CISTPLreia_socket" clcuprei1nam369;
a>(14 20  14a href="drivers/pcmcia/c14a h>141x_unlock" claa>(14130  14     if (14140  14             14150  14             return -141eal_get_next_sspan        comment">/* Firstctuple should be DEVICE; we should really have either that14160  14L;
           or a CFTABLE_ENTRY of some sort */14170  14     >a>(69)
14180  14     !)
a>(14190  14     141t" clcuplereplsre>!)
a>(14200  14     if (14210  14             14 20  140        /* All cards should have a MANFIDctuple, and/or a VERS_1 or VERS_2alspanEid="L354" class="li4e" na45="L384">14230  14             return -142ode=Easpan        comment">           tuple, pcmccard identification.  Certain old D-Link and LinksysalspanEid="L354" class="li4e" na45="L384">14240  14     }
           cards have only a broken VERS_2 tuple; henceathe bogus te=t. */14250  14     142eal_get_next_>a>(a>(14260  14     a>(a>(14270  14     " clt whcode=dev_pr14   >142vers/pc4cia/cistp>a>(a>(14280  14ia/cistpl.c#L31istpl.c#L14ia/>142ia_socket" clcuplerep            14290  14_loc9dstplref="+code=mut14_lo>1429"sreid="L354" class="li4e" na45="L384">14300  14a href="drivers/pc4cia/c14a h>1430en" class="s!)
)
14a10  14 href="drivers/pcmcia4ci14 hr>143printk" class="sref">goto return -1;
14a20  14an class/"come high-leve14an >143ncpy14330  14 href="drivers/pcmcia/ci14 hr>143ode=ENOMEM" cpcmcs->)
)
)
14a40  14     struct 143ia_socket" clcuplerep)
a>(14a50  14     14a60  14     14370  14     " clref="+code=u_in14   >143vers/pc4cia/cistpass=>>a>(le90x23)3" clT" clT >a>(14380  14     >a>(le90x47)3" clT" clT >a>(14390  14a hcuple_flaga href="+co14a h>143t" clcuplereplsref">sistp>>a>(le90x90)3" clT" clT >a>(14400  14ode=mutex_loc9dstplrefci14ode>1440en" class="s)
14410  14ruct 144printk" class}id="L397" class="line" name="L397">14420  14ruct 144x_unlock" clas->a>(le95) ||id="L354" class="li4e" na45="L384">14430  14ruct 144ode=ENOMEM" class="sr(>!)
)
a>(14440  14ruct 144ia_socket" clcuplerep)
14450  14 href="drivers/pcmcia4ci14 hr>144ode=mid="L397" class="line" name="L397">14460  14 144urn -)
14470  14                     144vers/id="L354" class="li4e" na45="L384">14480  14a href="drivers/pcmcia4c14a h>1448" clreturn -1;
14490  14cket */* invalidateaers cache on failure */14500  14             return -1450en" class="s!)
)
)
14510  14 href="drivers/pcmcia4ci14 hr>145printk" class="sref">)
" clT)
14520  14       if (a>(14530  14             return -145ode=ENOMEM" class="sr)
" clT)
14540  14/a> *>145ia_socket" clcuplerep)
)
14550  14 href="drivers/pcmcia4ci14 hr>145eal_get_next_}id="L358" class="li4e" na45="L338">14560  142145urn -id="L358" class="li4e" na45="L338">14570  14     " clcuplemcia_socke14   >145class="sref">)
14580  14     145ia_socket" clcuplerepn)
14590  14 href="drivers/pcmcia4ci14 hr>1459rn -)
a>(14600  14emcpy()
a>(14610  14             146printk" classef">EIN            14620  14             146ncpy<}id="L358" class="li4e" na45="L338">14e30  14  /a>        if (146ode=Eid="L358" class="li4e" na45="L338">14e40  14                     146ia_soid="L358" class="li4e" na45="L338">14e50  14          /a>        if 14   >146eal_g#def   Sa>(a>(a>((14e60  14                        14   >146urn -id="L358" class="li4e" na45="L338">14e70  14    elseEINVAL;
146vers/statics            struct a>()
)
14e80  14                     146ia_socket" clcuplerepistpet" clcuplerep)
14e90  14             1469"sre id="L364" class="li4e" na46="L394">14700  14     }
)
(14710  14        if (147printk" class;
14720  14a href="drivers/pcmcia/c14a h>147ass="string">)
14730  14 href="drivers/pcmcia/ci14 hr>147ode=ENOMEM" cmutex_lock(ssize_ta_socket" clcupssize_trintk;
14 40  14    int 147ia_socket" cl)
)
14750  14_6" cl03es the CIS m14_6">1475a_socket" cl)
)
14760  14s="mcpy(147urn -id="L358" class="li4e" na45="L338">14770  14             return -1477de=ENOMEM" c)
)
sizeof>)
14 80  14 href="drivers/pcmcia/ci14 hr>1478lass="sref">!)
14790  14     147t" clcuplereplsref">sef">EIN-)
14800  14     if (14810  14             CISTPLtempbuffer=buf" class="srtempbuffer370"369)
sizeof>)
14820  14                        14   >148x_unlock" cla!)
14830  14             return -148ode=ENOMEM" class="sr)
)
14840  14     }
14850  14     14860  14     14 70  14             int 1487de=ENOMEM" c)
" clT)
)
14880  14 href="drivers/pcmcia/ci14 hr>148ia_soid="L358" class="li4e" na45="L338">14890  14             if (1489rn -)
)
14900  14                     149dde=ENOMEM" c)
)
14910  14 href="drivers/pcmcia/ci14 hr>149printk" classs="sref">CISTPLtuplea_socket" clcuptuple370".)
14920  14             14930  14             if (149ode=ENOMEM" cmutex_lock(statu=a_socket" clcupstatu=a_so369;
a>()
14940  14                     14 ia_socket" clwhilea>!)
14950  14                     149eal_get_next_cuplemcis="sref">CISTPLtuplea_socket" clcuptuple370".)
14960  14                     ret14   >149)
14970  14             }
lens="sref">CISTPLmemseia_socket" clcupmemseie=s">;
)
14980  14     }
14990  14     smutex_lock(statu=a_socket" clcupstatu=a_so369;
a>()
15400  15400< 15410  154href="drivers/pcmcia/ci154hr>150printk" class="sref">>>>>>>>>break id="L358" class="li4e" na45="L338">15420  154            15430  154            if (150ode=ENOMEM" class="sra>(a>()
15440  154                    150ia_socket" clcuplerepers/pcmc)
)
15450  154                    150eal_get_next_cuplemciers/pcmc)
)
15460  154                    ret154  >150)
)
15470  154            }
lencuplemciers/pcmc)
15480  154    }
15490  154    sistpccccpcmcs->)
)
15100  15 (15110  15                    cons15   >151printk" class="sref">>>>>>>>>>>>>>>>>>>>>>a>(((15120  15a href="drivers/pcmcia/c15a h>151x_unlock" class="srefref">lencuplemciers/pcmc)
15130  15     if (lencuplemciers/pcmc)
15140  15             15150  15             return -151eal_get_next_cuplemciers/pcmc}id="L358" class="li4e" na45="L338">15160  15L;
15170  15     15180  15     )
)
15190  15     1519"sreid="L354" class="li4e" na45="L384">15200  15     if ((15210  15             >>>>>>>>break id="L358" class="li4e" na45="L338">15 20  150        15230  15             return -152ode=ENOMEM" class="sra>()
69)
15240  15     }
15 50  15     152eal_get_next_cuplemcis="sref">CISTPLstatu=a_socket" clcupstatu=a_so369;
a>()
15yn5cuptuple370".)
15 20  150 ag>142705 14     " clt whcode=dev_5r14  52151vers/id="L354" class="li4e" na45="L384">142805 14ia/cistpl.c#L31istpl.c5L14ia521408lass="sref">mutex_locka>(15190  14_loc9dstplref="+code=m5t14_l5>1429"oto return -1;
)
a>(14a105 14 href="drivers/pcmcia45i14 h53142ocketid="L397" class="line" name="L3975>14a205 14an class/"come high-le5e14an53151x_unlock" assef">EIN            143odi4e" na45="L338">15 20  150 ag>14a405 14     struct 143struct a>()
struct a>()
struct a>()
143ia_socket" clcuplerepiiiiiiiiiiii",scharcn)
)
return -1;
a>(144505 14 href="drivers/pcmcia45i14 h54152eal_get_next_cuples">struct a>()
return -1;
a>((sistpcntk;
return -1;
145printk" class="sref">)
a>(a>(struct a>(145305 14             return -<5 14  5>145ode=ENOMEM" class=claa>(145405 14/a> *145ia_socket" clcupleeeeeeeee">sef">EIN-)
!)
a>()
14a605 142sef">EIN-)
)
sef">EIN-)
146005 14emcpy(return -1;
a>()
14e305 14  /a>        if (EIN            rivcounta_socket" clcup4ount1nam id="L358" class="li4e" na45="L3385>14e405 14                     <5 14  5>146iaass}id="L397" class="line" name="L3975>144505 14          /a>        i5 14  56144ode=mid="L397" class="line" name="L3975>14e605 14                      5 14  5>146urn -id="L358" class="li4e" na45="L3385>14e705 14    elseEINVAL;
146vers/statics            struct a>()
struct a>()
struct a>()
sistpccccccccc",scharcn)
)
147dd44  id="L364" class="li4e" na46="L394">147105 14        if (147printk" cls">struct a>()
147ass="strinedcreturn -1;
147ia_socket" cl)
a>(a>(struct a>(es the CIS5m14_657144ode=mid="L397" class="line" name="L3975>147605 14s="mcpy(a>(sef">EIN-)
147905 14     147t" clcupleclaa>(69)
sef">EIN-)
a>(148305 14             return -<5 14  5>148ode=ENOMEM" class=">sef">EIN-)
148eal_get_ne/a>return -1;
return -1;
a>()
14e705 14             int sef">EIN-)
148ia_soid="L358" class="li4e" na45="L3385>148905 14             if (1489rn -)
a>(EIN            rivcounta_socket" clcup4ount1nam id="L358" class="li4e" na45="L3385>149205 14             struct a>(149605 14                     r5t14  5>149)
)
ing">" na" */)
149len" class70".)
)
return -1;
149t" clcuple70".)
return -1;
1500e}nam id="L358" class="li4e" na45="L3386>154106 154href="drivers/pcmcia/6i154h6>150pr


Tcachriginal LXR software by thf Sa>(LXR cunityups370this expericommal clasion by Sa>(lx/@rivux.noups3.
lx/.rivux.no kindly hosted by Sa>(Redpill Livpro ASups370provider of Livux nsulting and operaicat_ presice_ pince 1995.