Root/ks7010/src/ks7010_sdio.c

1/*
2 * Driver for KeyStream, KS7010 based SDIO cards.
3 *
4 * ks7010_sdio.c
5 * $Id: ks7010_sdio.c 996 2009-09-14 02:54:21Z sekine $
6 *
7 * Copyright (C) 2006-2008 KeyStream Corp.
8 * Copyright (C) 2009 Renesas Technology Corp.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it undr the terms of the GNU General Public License version 2 as
12 * published by the Free Sotware Foundation.
13 */
14
15#include <linux/workqueue.h>
16#include <asm/atomic.h>
17#include <linux/mmc/card.h>
18#include <linux/mmc/sdio_func.h>
19
20#include "ks_wlan.h"
21#include "ks_wlan_ioctl.h"
22#include "ks_debug.h"
23#include "ks_hostif.h"
24
25#include "ks7010_sdio.h"
26
27#define KS7010_FUNC_NUM 1
28#define KS7010_IO_BLOCK_SIZE 512
29#define KS7010_MAX_CLOCK 25000000
30
31static int reg_net = 0;
32
33static const struct sdio_device_id if_sdio_ids[] = {
34    { SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_A, SDIO_DEVICE_ID_KS_7010) },
35    { SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_B, SDIO_DEVICE_ID_KS_7010) },
36    { /* all zero */ }
37};
38
39struct ks_sdio_model {
40        int model;
41        const char *firmware;
42};
43
44static struct ks_sdio_model ks_sdio_models[] = {
45        {
46                /* ks7010 */
47                .model = 0x10,
48                .firmware = "ks7010sd.rom",
49        },
50};
51
52static int ks7910_sdio_probe(struct sdio_func *function, const struct sdio_device_id *device);
53static void ks7910_sdio_remove(struct sdio_func *function);
54static void ks7010_rw_function(struct work_struct *work);
55static int ks7010_sdio_read( ks_wlan_private *priv, unsigned int address,
56                 unsigned char *buffer, int length );
57static int ks7010_sdio_write( ks_wlan_private *priv, unsigned int address,
58                  unsigned char *buffer, int length );
59#ifdef NO_FIRMWARE_CLASS
60static char *romfile = ROM_FILE;
61module_param(romfile, charp, S_IRUGO);
62#endif
63/* macro */
64
65#define inc_txqhead(priv) \
66        ( priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE )
67#define inc_txqtail(priv) \
68        ( priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE )
69#define cnt_txqbody(priv) \
70        (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % TX_DEVICE_BUFF_SIZE )
71
72#define inc_rxqhead(priv) \
73        ( priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE )
74#define inc_rxqtail(priv) \
75        ( priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE )
76#define cnt_rxqbody(priv) \
77        (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE )
78
79void ks_wlan_hw_sleep_doze_request(ks_wlan_private *priv)
80{
81    unsigned char rw_data;
82    int retval;
83
84    DPRINTK(4, "\n");
85
86    /* clear request */
87    atomic_set(&priv->sleepstatus.doze_request,0);
88
89    if( atomic_read(&priv->sleepstatus.status) == 0){
90        rw_data = GCR_B_DOZE;
91        retval = ks7010_sdio_write(priv, GCR_B, &rw_data, sizeof(rw_data));
92        if(retval){
93            DPRINTK(1, " error : GCR_B=%02X\n", rw_data);
94            goto out;
95        }
96        DPRINTK(4, "PMG SET!! : GCR_B=%02X\n", rw_data);
97        DPRINTK(3,"sleep_mode=SLP_SLEEP\n");
98        atomic_set(&priv->sleepstatus.status, 1);
99         priv->last_doze = jiffies;
100    }
101    else{
102        DPRINTK(1,"sleep_mode=%d\n",priv->sleep_mode);
103    }
104
105out:
106    priv->sleep_mode = atomic_read(&priv->sleepstatus.status);
107    return;
108}
109
110void ks_wlan_hw_sleep_wakeup_request(ks_wlan_private *priv)
111{
112    unsigned char rw_data;
113    int retval;
114
115    DPRINTK(4, "\n");
116
117    /* clear request */
118    atomic_set(&priv->sleepstatus.wakeup_request,0);
119
120    if( atomic_read(&priv->sleepstatus.status) == 1){
121        rw_data = WAKEUP_REQ;
122        retval = ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
123        if(retval){
124            DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
125            goto out;
126        }
127        DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
128        atomic_set(&priv->sleepstatus.status, 0);
129         priv->last_wakeup = jiffies;
130        ++priv->wakeup_count;
131    }
132    else{
133        DPRINTK(1,"sleep_mode=%d\n",priv->sleep_mode);
134    }
135
136out:
137    priv->sleep_mode = atomic_read(&priv->sleepstatus.status);
138    return;
139}
140
141
142void ks_wlan_hw_wakeup_request(ks_wlan_private *priv)
143{
144    unsigned char rw_data;
145    int retval;
146
147    DPRINTK(4, "\n");
148    if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){
149        rw_data = WAKEUP_REQ;
150        retval = ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
151        if(retval){
152            DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
153        }
154        DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
155         priv->last_wakeup = jiffies;
156        ++priv->wakeup_count;
157    }
158    else{
159        DPRINTK(1,"psstatus=%d\n",atomic_read(&priv->psstatus.status));
160    }
161}
162
163int _ks_wlan_hw_power_save(ks_wlan_private *priv)
164{
165    int rc=0;
166    unsigned char rw_data;
167    int retval;
168
169    if(priv->reg.powermgt == POWMGT_ACTIVE_MODE)
170        return rc;
171
172    if(priv->reg.operation_mode == MODE_INFRASTRUCTURE &&
173       (priv->connect_status & CONNECT_STATUS_MASK)== CONNECT_STATUS){
174
175        //DPRINTK(1,"psstatus.status=%d\n",atomic_read(&priv->psstatus.status));
176    if (priv->dev_state == DEVICE_STATE_SLEEP) {
177        switch(atomic_read(&priv->psstatus.status)){
178        case PS_SNOOZE: /* 4 */
179            break;
180        default:
181            DPRINTK(5,"\n\
182                psstatus.status=%d\n\
183                psstatus.confirm_wait=%d\n\
184                psstatus.snooze_guard=%d\n\
185                cnt_txqbody=%d\n",
186                atomic_read(&priv->psstatus.status),
187                atomic_read(&priv->psstatus.confirm_wait),
188                atomic_read(&priv->psstatus.snooze_guard),
189                cnt_txqbody(priv));
190
191            if(!atomic_read(&priv->psstatus.confirm_wait)&&
192               !atomic_read(&priv->psstatus.snooze_guard)&&
193               !cnt_txqbody(priv)){
194                retval = ks7010_sdio_read(priv, INT_PENDING, &rw_data, sizeof(rw_data));
195                if(retval){
196                    DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
197                    queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
198                    break;
199                }
200                if(!rw_data){
201                    rw_data = GCR_B_DOZE;
202                    retval = ks7010_sdio_write(priv, GCR_B, &rw_data, sizeof(rw_data));
203                    if(retval){
204                        DPRINTK(1, " error : GCR_B=%02X\n", rw_data);
205                        queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
206                        break;
207                    }
208                    DPRINTK(4, "PMG SET!! : GCR_B=%02X\n", rw_data);
209                    atomic_set(&priv->psstatus.status, PS_SNOOZE);
210                    DPRINTK(3,"psstatus.status=PS_SNOOZE\n");
211                }
212                else{
213                    queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
214                }
215            }
216            else{
217                queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 0);
218            }
219            break;
220        }
221    }
222
223    }
224
225    return rc;
226}
227
228int ks_wlan_hw_power_save(ks_wlan_private *priv)
229{
230    queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
231    return 0;
232}
233
234static int ks7010_sdio_read(ks_wlan_private *priv, unsigned int address,
235                unsigned char *buffer, int length)
236{
237    int rc = -1;
238    struct ks_sdio_card *card;
239
240    card = priv->ks_wlan_hw.sdio_card;
241
242    if (length == 1) /* CMD52 */
243        *buffer = sdio_readb(card->func, address, &rc);
244    else /* CMD53 multi-block transfer */
245        rc = sdio_memcpy_fromio(card->func, buffer, address, length);
246
247    if(rc != 0){
248        printk("sdio error erorr=%d size=%d\n", rc, length);
249        ++priv->sdio_error_count;
250    }else{
251        priv->sdio_error_count=0;
252    }
253
254    return rc;
255}
256
257static int ks7010_sdio_write(ks_wlan_private *priv, unsigned int address,
258                 unsigned char *buffer, int length)
259{
260    int rc = -1;
261    struct ks_sdio_card *card;
262
263    card = priv->ks_wlan_hw.sdio_card;
264
265    if (length == 1) /* CMD52 */
266        sdio_writeb(card->func, *buffer, (unsigned int) address, &rc);
267    else /* CMD53 */
268        rc = sdio_memcpy_toio(card->func, (unsigned int) address, buffer, length);
269
270    if(rc != 0){
271        printk("sdio error erorr=%d size=%d\n", rc, length);
272        ++priv->sdio_error_count;
273    }else{
274        priv->sdio_error_count=0;
275    }
276
277    return rc;
278}
279
280static int enqueue_txdev(ks_wlan_private *priv, unsigned char *p, unsigned long size,
281          void (*complete_handler)(void *arg1, void *arg2),
282          void *arg1, void *arg2 )
283{
284    struct tx_device_buffer *sp;
285
286    if (priv->dev_state < DEVICE_STATE_BOOT) {
287        kfree(p);
288        if (complete_handler != NULL)
289            (*complete_handler)(arg1, arg2);
290        return 1;
291    }
292
293    if ((TX_DEVICE_BUFF_SIZE - 1) <= cnt_txqbody(priv)) {
294        /* in case of buffer overflow */
295        DPRINTK(1,"tx buffer overflow\n");
296        kfree(p);
297        if (complete_handler != NULL)
298            (*complete_handler)(arg1, arg2);
299        return 1;
300    }
301
302    sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qtail];
303    sp->sendp = p;
304    sp->size = size;
305    sp->complete_handler = complete_handler;
306    sp->arg1 = arg1;
307    sp->arg2 = arg2;
308    inc_txqtail(priv);
309
310    return 0;
311}
312
313/* write data */
314static int write_to_device(ks_wlan_private *priv, unsigned char *buffer, unsigned long size )
315{
316    int rc,retval;
317    unsigned char rw_data;
318    struct hostif_hdr *hdr;
319    hdr = (struct hostif_hdr *)buffer;
320    rc=0;
321
322    DPRINTK(4,"size=%d\n", hdr->size);
323    if(hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event){
324        DPRINTK(1,"unknown event=%04X\n",hdr->event);
325        return 0;
326    }
327
328    retval = ks7010_sdio_write(priv, DATA_WINDOW, buffer, size);
329    if(retval){
330        DPRINTK(1, " write error : retval=%d\n", retval);
331        return -4;
332    }
333
334    rw_data = WRITE_STATUS_BUSY;
335    retval = ks7010_sdio_write(priv, WRITE_STATUS, &rw_data, sizeof(rw_data));
336    if(retval){
337        DPRINTK(1, " error : WRITE_STATUS=%02X\n", rw_data);
338        return -3;
339    }
340
341    return 0;
342}
343
344static void tx_device_task(void *dev)
345{
346    ks_wlan_private *priv = (ks_wlan_private *)dev;
347    struct tx_device_buffer *sp;
348    int rc = 0;
349
350    DPRINTK(4, "\n");
351    if(cnt_txqbody(priv)>0 && atomic_read(&priv->psstatus.status) != PS_SNOOZE){
352        sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qhead];
353        if(priv->dev_state >= DEVICE_STATE_BOOT){
354            rc = write_to_device(priv, sp->sendp, sp->size);
355            if(rc){
356                DPRINTK(1, "write_to_device error !!(%d)\n", rc);
357                queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
358                return;
359            }
360
361        }
362        kfree(sp->sendp); /* allocated memory free */
363        if(sp->complete_handler != NULL) /* TX Complete */
364            (*sp->complete_handler)(sp->arg1, sp->arg2);
365        inc_txqhead(priv);
366
367        if(cnt_txqbody(priv)>0){
368            queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 0);
369        }
370    }
371    return;
372}
373
374int ks_wlan_hw_tx( ks_wlan_private *priv, void *p, unsigned long size,
375           void (*complete_handler)(void *arg1, void *arg2),
376           void *arg1, void *arg2 )
377{
378    int result=0;
379    struct hostif_hdr *hdr;
380    hdr = (struct hostif_hdr *)p;
381
382    if(hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event){
383        DPRINTK(1,"unknown event=%04X\n",hdr->event);
384        return 0;
385    }
386
387    /* add event to hostt buffer */
388    priv->hostt.buff[priv->hostt.qtail] = hdr->event;
389        priv->hostt.qtail = (priv->hostt.qtail + 1) % SME_EVENT_BUFF_SIZE;
390
391    DPRINTK(4, "event=%04X\n",hdr->event);
392    spin_lock(&priv->tx_dev.tx_dev_lock);
393    result = enqueue_txdev(priv, p, size, complete_handler, arg1, arg2);
394    spin_unlock(&priv->tx_dev.tx_dev_lock);
395
396    if(cnt_txqbody(priv)>0){
397        queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 0);
398    }
399    return result;
400}
401
402static void rx_event_task(unsigned long dev)
403{
404        ks_wlan_private *priv = (ks_wlan_private *)dev;
405    struct rx_device_buffer *rp;
406
407    DPRINTK(4,"\n");
408
409    if(cnt_rxqbody(priv) > 0 && priv->dev_state >= DEVICE_STATE_BOOT){
410        rp = &priv->rx_dev.rx_dev_buff[priv->rx_dev.qhead];
411        hostif_receive(priv, rp->data, rp->size);
412        inc_rxqhead(priv);
413
414        if(cnt_rxqbody(priv) > 0){
415            tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
416        }
417    }
418
419    return;
420}
421
422static void ks_wlan_hw_rx(void *dev, uint16_t size)
423{
424    ks_wlan_private *priv = (ks_wlan_private *)dev;
425    int retval;
426    struct rx_device_buffer *rx_buffer;
427    struct hostif_hdr *hdr;
428    unsigned char read_status;
429    unsigned short event=0;
430
431    DPRINTK(4,"\n");
432
433    /* receive data */
434    if (cnt_rxqbody(priv) >= (RX_DEVICE_BUFF_SIZE-1)) {
435        /* in case of buffer overflow */
436        DPRINTK(1,"rx buffer overflow \n");
437        goto error_out;
438    }
439    rx_buffer = &priv->rx_dev.rx_dev_buff[priv->rx_dev.qtail];
440
441    retval = ks7010_sdio_read(priv, DATA_WINDOW, &rx_buffer->data[0], hif_align_size(size));
442    if(retval){
443        goto error_out;
444    }
445
446    /* length check */
447    if(size > 2046 || size == 0){
448
449        DPRINTK(5,"-INVAILED DATA dump\n");
450        print_buffer(&rx_buffer->data[0],32);
451
452        /* rx_status update */
453        read_status = READ_STATUS_IDLE;
454        retval = ks7010_sdio_write(priv, READ_STATUS, &read_status, sizeof(read_status));
455        if(retval){
456            DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
457        }
458        goto error_out;
459    }
460
461    hdr = (struct hostif_hdr *)&rx_buffer->data[0];
462    rx_buffer->size = le16_to_cpu(hdr->size) + sizeof(hdr->size);
463    event = hdr->event;
464    inc_rxqtail(priv);
465
466    /* read status update */
467    read_status = READ_STATUS_IDLE;
468    retval = ks7010_sdio_write(priv, READ_STATUS, &read_status, sizeof(read_status));
469    if(retval){
470        DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
471    }
472    DPRINTK(4, "READ_STATUS=%02X\n", read_status);
473
474    if(atomic_read(&priv->psstatus.confirm_wait)){
475        if(IS_HIF_CONF(event)){
476            DPRINTK(4, "IS_HIF_CONF true !!\n");
477            atomic_dec(&priv->psstatus.confirm_wait);
478        }
479    }
480
481    /* rx_event_task((void *)priv); */
482    tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
483
484error_out:
485    return;
486}
487
488static void ks7010_rw_function(struct work_struct *work)
489{
490    struct hw_info_t *hw;
491    struct ks_wlan_private *priv;
492    unsigned char rw_data;
493    int retval;
494
495    hw = container_of(work, struct hw_info_t, rw_wq.work);
496    priv = container_of(hw, struct ks_wlan_private, ks_wlan_hw);
497
498    DPRINTK(4,"\n");
499
500
501     /* wiat after DOZE */
502     if(time_after(priv->last_doze + ((30*HZ)/1000), jiffies )){
503         DPRINTK(4, "wait after DOZE \n");
504        queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
505        return;
506    }
507
508    /* wiat after WAKEUP */
509    while(time_after(priv->last_wakeup + ((30*HZ)/1000), jiffies )){
510        DPRINTK(4, "wait after WAKEUP \n");
511/* queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq,
512        (priv->last_wakeup + ((30*HZ)/1000) - jiffies));*/
513        printk("wake: %lu %lu\n", priv->last_wakeup + (30* HZ)/1000, jiffies);
514        msleep(30);
515    }
516
517    sdio_claim_host(priv->ks_wlan_hw.sdio_card->func);
518
519    /* power save wakeup */
520    if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){
521        if(cnt_txqbody(priv)>0){
522            ks_wlan_hw_wakeup_request(priv);
523            queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 1);
524        }
525        goto err_out;
526    }
527
528    /* sleep mode doze */
529    if(atomic_read(&priv->sleepstatus.doze_request)==1){
530        ks_wlan_hw_sleep_doze_request(priv);
531        goto err_out;
532    }
533    /* sleep mode wakeup */
534    if(atomic_read(&priv->sleepstatus.wakeup_request)==1){
535        ks_wlan_hw_sleep_wakeup_request(priv);
536        goto err_out;
537    }
538
539    /* read (WriteStatus/ReadDataSize FN1:00_0014) */
540    retval = ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data, sizeof(rw_data));
541    if(retval){
542        DPRINTK(1, " error : WSTATUS_RSIZE=%02X psstatus=%d\n", rw_data,atomic_read(&priv->psstatus.status));
543        goto err_out;
544    }
545    DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
546
547    if(rw_data&RSIZE_MASK){ /* Read schedule */
548        ks_wlan_hw_rx((void *)priv, (uint16_t)(((rw_data&RSIZE_MASK)<<4)));
549    }
550    if((rw_data&WSTATUS_MASK)){
551        tx_device_task((void *)priv);
552    }
553    _ks_wlan_hw_power_save(priv);
554
555err_out:
556    sdio_release_host(priv->ks_wlan_hw.sdio_card->func);
557
558    return;
559}
560
561
562
563static void ks_sdio_interrupt(struct sdio_func *func)
564{
565    int retval;
566    struct ks_sdio_card *card;
567    ks_wlan_private *priv;
568    unsigned char status, rsize, rw_data;
569
570    card = sdio_get_drvdata(func);
571    priv = card->priv;
572    DPRINTK(4, "\n");
573
574    if(priv->dev_state >= DEVICE_STATE_BOOT){
575        retval = ks7010_sdio_read(priv, INT_PENDING, &status, sizeof(status));
576        if(retval){
577            DPRINTK(1, "read INT_PENDING Failed!!(%d)\n",retval);
578            goto intr_out;
579        }
580        DPRINTK(4, "INT_PENDING=%02X\n", rw_data);
581
582        /* schedule task for interrupt status */
583        /* bit7 -> Write General Communication B register */
584        /* read (General Communication B register) */
585        /* bit5 -> Write Status Idle */
586        /* bit2 -> Read Status Busy */
587        if(status&INT_GCR_B || atomic_read(&priv->psstatus.status)==PS_SNOOZE){
588            retval = ks7010_sdio_read(priv, GCR_B, &rw_data, sizeof(rw_data));
589            if(retval){
590                DPRINTK(1, " error : GCR_B=%02X\n", rw_data);
591                goto intr_out;
592            }
593            /* DPRINTK(1, "GCR_B=%02X\n", rw_data); */
594            if(rw_data == GCR_B_ACTIVE){
595                if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){
596                    atomic_set(&priv->psstatus.status, PS_WAKEUP);
597                    priv->wakeup_count=0;
598                }
599                complete(&priv->psstatus.wakeup_wait);
600            }
601
602
603        }
604
605        do{
606            /* read (WriteStatus/ReadDataSize FN1:00_0014) */
607            retval = ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data, sizeof(rw_data));
608            if(retval){
609                DPRINTK(1, " error : WSTATUS_RSIZE=%02X\n", rw_data);
610                goto intr_out;
611            }
612            DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
613            rsize=rw_data&RSIZE_MASK;
614            if(rsize){ /* Read schedule */
615                ks_wlan_hw_rx((void *)priv, (uint16_t)(((rsize)<<4)));
616            }
617            if(rw_data&WSTATUS_MASK){
618#if 0
619                if(status&INT_WRITE_STATUS && !cnt_txqbody(priv)){
620                    /* dummy write for interrupt clear */
621                    rw_data =0;
622                    retval = ks7010_sdio_write(priv, DATA_WINDOW, &rw_data, sizeof(rw_data));
623                    if (retval) {
624                        DPRINTK(1, "write DATA_WINDOW Failed!!(%d)\n",retval);
625                    }
626                    status &= ~INT_WRITE_STATUS;
627                }
628                else{
629#endif
630                    if(atomic_read(&priv->psstatus.status)==PS_SNOOZE){
631                        if(cnt_txqbody(priv)){
632                            ks_wlan_hw_wakeup_request(priv);
633                            queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq, &priv->ks_wlan_hw.rw_wq, 1);
634                            return;
635                        }
636                    }
637                    else{
638                        tx_device_task((void *)priv);
639                    }
640// }
641            }
642        }while(rsize);
643    }
644
645intr_out:
646    queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq, 0);
647    return;
648}
649
650static int trx_device_init( ks_wlan_private *priv )
651{
652    /* initialize values (tx) */
653    priv->tx_dev.qtail = priv->tx_dev.qhead = 0;
654
655    /* initialize values (rx) */
656    priv->rx_dev.qtail = priv->rx_dev.qhead = 0;
657
658    /* initialize spinLock (tx,rx) */
659    spin_lock_init(&priv->tx_dev.tx_dev_lock);
660    spin_lock_init(&priv->rx_dev.rx_dev_lock);
661
662    tasklet_init(&priv->ks_wlan_hw.rx_bh_task, rx_event_task, (unsigned long)priv);
663
664    return 0;
665}
666
667static void trx_device_exit( ks_wlan_private *priv )
668{
669    struct tx_device_buffer *sp;
670
671    /* tx buffer clear */
672    while (cnt_txqbody(priv)>0) {
673        sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qhead];
674        kfree(sp->sendp); /* allocated memory free */
675        if (sp->complete_handler != NULL) /* TX Complete */
676            (*sp->complete_handler)(sp->arg1, sp->arg2);
677        inc_txqhead(priv);
678    }
679
680    tasklet_kill(&priv->ks_wlan_hw.rx_bh_task);
681
682    return;
683}
684static int ks7010_sdio_update_index(ks_wlan_private *priv, u32 index)
685{
686    int rc=0;
687    int retval;
688    unsigned char *data_buf;
689    data_buf = NULL;
690
691    data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
692    if(!data_buf){ rc = 1; goto error_out; }
693
694    memcpy(data_buf, &index, sizeof(index));
695    retval = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
696    if(retval){ rc = 2; goto error_out; }
697
698    retval = ks7010_sdio_write(priv, READ_INDEX, data_buf, sizeof(index));
699    if(retval){ rc = 3; goto error_out; }
700error_out:
701    if(data_buf) kfree(data_buf);
702    return rc;
703}
704
705#define ROM_BUFF_SIZE (64*1024)
706static int ks7010_sdio_data_compare(ks_wlan_private *priv, u32 address,
707                    unsigned char *data, unsigned int size)
708{
709    int rc=0;
710    int retval;
711    unsigned char *read_buf;
712    read_buf = NULL;
713    read_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
714    if(!read_buf){ rc = 1; goto error_out; }
715    retval = ks7010_sdio_read(priv, address, read_buf, size);
716    if(retval){ rc = 2; goto error_out; }
717    retval = memcmp(data, read_buf, size);
718
719    if(retval){
720        DPRINTK(0, "data compare error (%d) \n",retval); rc = 3; goto error_out;
721    }
722error_out:
723    if(read_buf) kfree(read_buf);
724    return rc;
725}
726#ifndef NO_FIRMWARE_CLASS
727#include <linux/firmware.h>
728#endif
729static int ks79xx_upload_firmware(ks_wlan_private *priv, struct ks_sdio_card *card)
730{
731    unsigned int size, offset, n = 0;
732    unsigned char *rom_buf;
733    unsigned char rw_data =0;
734    int retval, rc=0;
735#ifndef NO_FIRMWARE_CLASS
736    int length;
737    const struct firmware *fw_entry = NULL;
738#else
739    int orgfsuid, orgfsgid;
740    struct file *srcf;
741    mm_segment_t orgfs;
742#endif
743
744    rom_buf = NULL;
745
746    /* buffer allocate */
747    rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
748    if(!rom_buf){ rc = 3; goto error_out0; }
749
750
751    sdio_claim_host(card->func);
752
753    /* Firmware running ? */
754    retval = ks7010_sdio_read(priv, GCR_A, &rw_data, sizeof(rw_data));
755    if(rw_data == GCR_A_RUN){
756        DPRINTK( 0, "MAC firmware running ...\n");
757        rc = 0;
758        goto error_out0;
759    }
760
761#ifndef NO_FIRMWARE_CLASS
762    if(request_firmware(&fw_entry, priv->reg.rom_file, &priv->ks_wlan_hw.sdio_card->func->dev)!=0){
763        DPRINTK(1,"error request_firmware() file=%s\n", priv->reg.rom_file);
764        return 1;
765    }
766    DPRINTK(4,"success request_firmware() file=%s size=%d\n", priv->reg.rom_file, fw_entry->size);
767    length = fw_entry->size;
768#else
769    orgfsuid=current->fsuid;
770    orgfsgid=current->fsgid;
771    current->fsuid=current->fsgid=0;
772    orgfs=get_fs();
773    set_fs(KERNEL_DS);
774
775    srcf = filp_open(romfile, O_RDONLY, 0);
776    if (IS_ERR(srcf)) {
777        DPRINTK(1, "error %ld opening %s\n", -PTR_ERR(srcf),romfile);
778        rc = 1;
779        goto error_out1;
780    }
781
782        if (!(srcf->f_op && srcf->f_op->read)) {
783                DPRINTK(1, "%s does not have a read method\n", romfile);
784                rc = 2;
785                goto error_out2;
786        }
787#endif
788
789    /* Load Program */
790    n = 0;
791        do {
792#ifndef NO_FIRMWARE_CLASS
793        if(length >= ROM_BUFF_SIZE){
794            size = ROM_BUFF_SIZE;
795            length = length - ROM_BUFF_SIZE;
796        }
797        else{
798            size=length;
799            length=0;
800        }
801        DPRINTK(4, "size = %d\n",size);
802        if(size == 0) break;
803        memcpy(rom_buf,fw_entry->data+n,size);
804#else
805        /* The object must have a read method */
806        size = srcf->f_op->read(srcf, rom_buf, ROM_BUFF_SIZE, &srcf->f_pos);
807        if (size < 0) {
808            DPRINTK(1, "Read %s error %d\n", priv->reg.rom_file, -retval);
809            rc = 5;
810            goto error_out2;
811        }
812        else if (size == 0) break;
813#endif
814        /* Update write index */
815        offset = n;
816        retval = ks7010_sdio_update_index(priv, KS7010_IRAM_ADDRESS+offset);
817        if(retval){ rc = 6; goto error_out1; }
818
819        /* Write data */
820        retval = ks7010_sdio_write(priv, DATA_WINDOW, rom_buf, size);
821        if(retval){ rc = 8; goto error_out1; }
822
823        /* compare */
824        retval = ks7010_sdio_data_compare(priv, DATA_WINDOW, rom_buf, size);
825        if(retval){ rc = 9; goto error_out1; }
826        n += size;
827
828       }while(size);
829
830    /* Remap request */
831    rw_data = GCR_A_REMAP;
832    retval = ks7010_sdio_write(priv, GCR_A, &rw_data, sizeof(rw_data));
833    if(retval){
834        rc = 11;
835        goto error_out1;
836    }
837    DPRINTK( 4, " REMAP Request : GCR_A=%02X\n", rw_data);
838
839    /* Firmware running check */
840    for (n = 0; n < 50; ++n) {
841        mdelay(10);/* wait_ms(10); */
842        retval = ks7010_sdio_read(priv, GCR_A, &rw_data, sizeof(rw_data));
843        if(retval){ rc = 11; goto error_out1; }
844        if(rw_data == GCR_A_RUN) break;
845    }
846    DPRINTK(4, "firmware wakeup (%d)!!!!\n",n);
847    if ((50) <= n) {
848        DPRINTK(1, "firmware can't start\n");
849                rc = 12;
850        goto error_out1;
851    }
852
853    rc = 0;
854
855#ifdef NO_FIRMWARE_CLASS
856 error_out2:
857    retval=filp_close(srcf ,NULL);
858    if (retval)
859        DPRINTK(1, "error %d closing %s\n", -retval,priv->reg.rom_file);
860
861 error_out1:
862    set_fs(orgfs);
863    current->fsuid=orgfsuid;
864    current->fsgid=orgfsgid;
865#else
866 error_out1:
867    release_firmware(fw_entry);
868#endif
869 error_out0:
870    sdio_release_host(card->func);
871    if(rom_buf)
872        kfree(rom_buf);
873    return rc;
874}
875
876static void card_init_task(struct work_struct *work)
877{
878    struct hw_info_t *hw;
879    struct ks_wlan_private *priv;
880
881    hw = container_of(work, struct hw_info_t, init_task);
882    priv = container_of(hw, struct ks_wlan_private, ks_wlan_hw);
883
884    DPRINTK(5,"\ncard_init_task()\n");
885
886    /* init_waitqueue_head(&priv->confirm_wait); */
887    init_completion(&priv->confirm_wait);
888
889    DPRINTK(5,"init_completion()\n");
890
891    /* get mac address & firmware version */
892    hostif_sme_enqueue(priv, SME_START);
893
894    DPRINTK(5,"hostif_sme_enqueu()\n");
895
896    if(!wait_for_completion_interruptible_timeout(&priv->confirm_wait,5*HZ)){
897        DPRINTK(1,"wait time out!! SME_START\n");
898    }
899
900    if(priv->mac_address_valid && priv->version_size){
901        priv->dev_state = DEVICE_STATE_PREINIT;
902    }
903
904    hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM);
905
906    /* load initial wireless parameter */
907    hostif_sme_enqueue(priv, SME_STOP_REQUEST);
908
909    hostif_sme_enqueue(priv, SME_RTS_THRESHOLD_REQUEST);
910    hostif_sme_enqueue(priv, SME_FRAGMENTATION_THRESHOLD_REQUEST);
911
912    hostif_sme_enqueue(priv, SME_WEP_INDEX_REQUEST);
913    hostif_sme_enqueue(priv, SME_WEP_KEY1_REQUEST);
914    hostif_sme_enqueue(priv, SME_WEP_KEY2_REQUEST);
915    hostif_sme_enqueue(priv, SME_WEP_KEY3_REQUEST);
916    hostif_sme_enqueue(priv, SME_WEP_KEY4_REQUEST);
917
918    hostif_sme_enqueue(priv, SME_WEP_FLAG_REQUEST);
919    hostif_sme_enqueue(priv, SME_RSN_ENABLED_REQUEST);
920    hostif_sme_enqueue(priv, SME_MODE_SET_REQUEST);
921    hostif_sme_enqueue(priv, SME_START_REQUEST);
922
923    if(!wait_for_completion_interruptible_timeout(&priv->confirm_wait,5*HZ)){
924        DPRINTK(1,"wait time out!! wireless parameter set\n");
925    }
926
927    if(priv->dev_state >= DEVICE_STATE_PREINIT){
928        DPRINTK(1, "DEVICE READY!!\n");
929        priv->dev_state = DEVICE_STATE_READY;
930        reg_net = register_netdev (priv->net_dev);
931        DPRINTK(3, "register_netdev=%d\n",reg_net);
932    }
933    else {
934        DPRINTK(1, "dev_state=%d\n",priv->dev_state);
935    }
936}
937
938static struct sdio_driver ks7010_sdio_driver = {
939    .name = "ks7910_sdio",
940    .id_table = if_sdio_ids,
941    .probe = ks7910_sdio_probe,
942    .remove = ks7910_sdio_remove,
943};
944
945
946extern int ks_wlan_net_start(struct net_device *dev);
947extern int ks_wlan_net_stop(struct net_device *dev);
948
949static int ks7910_sdio_probe(struct sdio_func *func, const struct sdio_device_id *device)
950{
951    ks_wlan_private *priv;
952    struct ks_sdio_card *card;
953    struct net_device *netdev;
954    unsigned char rw_data;
955    int i=0, ret;
956
957    DPRINTK(5, "ks7910_sdio_probe()\n");
958
959    priv = NULL;
960    netdev=NULL;
961
962
963    /* initilize ks_sdio_card */
964    card = kzalloc(sizeof(struct ks_sdio_card), GFP_KERNEL);
965    if (!card)
966        return -ENOMEM;
967
968    card->func = func;
969    card->model = 0x10;
970    spin_lock_init(&card->lock);
971
972    /* select model */
973    for (i = 0;i < ARRAY_SIZE(ks_sdio_models);i++) {
974        if (card->model == ks_sdio_models[i].model)
975            break;
976    }
977
978    if (i == ARRAY_SIZE(ks_sdio_models)) {
979        DPRINTK(5, "unkown card model 0x%x\n", card->model);
980        goto error;
981    }
982
983    card->firmware = ks_sdio_models[i].firmware;
984
985
986    /*** Initialize SDIO ***/
987    sdio_claim_host(func);
988
989    /* bus setting */
990    /* Issue config request to override clock rate */
991
992    /* function blocksize set */
993    ret = sdio_set_block_size(func, KS7010_IO_BLOCK_SIZE);
994    DPRINTK(5, "multi_block=%d sdio_set_block_size()=%d %d\n", func->card->cccr.multi_block, func->cur_blksize, ret);
995
996    /* Allocate the slot current */
997
998    /* function enable */
999    ret = sdio_enable_func(func);
1000    DPRINTK(5, "sdio_enable_func() %d\n", ret);
1001    if (ret)
1002        goto error_free_card;
1003
1004    /* interrupt disable */
1005    sdio_writeb(func, 0, INT_ENABLE, &ret);
1006    if (ret)
1007        goto error_free_card;
1008    sdio_writeb(func, 0xff, INT_PENDING, &ret);
1009    if (ret)
1010        goto error_disable_func;
1011
1012    /* setup interrupt handler */
1013    ret = sdio_claim_irq(func, ks_sdio_interrupt);
1014    if (ret)
1015        goto error_disable_func;
1016
1017    sdio_release_host(func);
1018
1019    sdio_set_drvdata(func, card);
1020
1021    DPRINTK(5, "class = 0x%X, vendor = 0x%X, "
1022        "device = 0x%X\n",
1023        func->class, func->vendor, func->device);
1024
1025
1026    /* private memory allocate */
1027    netdev = alloc_etherdev(sizeof(*priv));
1028    if (netdev == NULL) {
1029        printk (KERN_ERR "ks79xx : Unable to alloc new net device\n");
1030        goto error_release_irq;
1031    }
1032    if (dev_alloc_name(netdev, netdev->name) < 0) {
1033        printk (KERN_ERR "ks79xx : Couldn't get name!\n");
1034        goto error_free_netdev;
1035    }
1036
1037    priv = netdev_priv(netdev);
1038
1039    card->priv = priv;
1040    SET_NETDEV_DEV(netdev, &card->func->dev); /* for create sysfs symlinks */
1041
1042    /* private memory initialize */
1043    priv->ks_wlan_hw.sdio_card = card;
1044    init_completion(&priv->ks_wlan_hw.ks7010_sdio_wait);
1045    priv->ks_wlan_hw.read_buf = NULL;
1046    priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
1047    if(!priv->ks_wlan_hw.read_buf){
1048        goto error_free_netdev;
1049    }
1050    priv->dev_state = DEVICE_STATE_PREBOOT;
1051    priv->net_dev = netdev;
1052    priv->firmware_version[0] = '\0';
1053    priv->version_size = 0;
1054    priv->last_doze = jiffies; /* set current jiffies */
1055    priv->last_wakeup = jiffies;
1056    memset(&priv->nstats, 0, sizeof(priv->nstats));
1057    memset(&priv->wstats, 0, sizeof(priv->wstats));
1058
1059    /* sleep mode */
1060    atomic_set(&priv->sleepstatus.doze_request,0);
1061    atomic_set(&priv->sleepstatus.wakeup_request,0);
1062    atomic_set(&priv->sleepstatus.wakeup_request,0);
1063
1064    trx_device_init(priv);
1065    hostif_init(priv);
1066        ks_wlan_net_start(netdev);
1067
1068    /* Read config file */
1069    ret = ks_wlan_read_config_file(priv);
1070    if (ret) {
1071        printk(KERN_ERR "ks79xx: read configuration file failed !! retern code = %d\n", ret);
1072        goto error_free_read_buf;
1073    }
1074
1075    /* Upload firmware */
1076    ret = ks79xx_upload_firmware(priv, card); /* firmware load */
1077    if(ret){
1078        printk(KERN_ERR "ks79xx: firmware load failed !! retern code = %d\n", ret);
1079        goto error_free_read_buf;
1080    }
1081
1082    /* interrupt setting */
1083    /* clear Interrupt status write (ARMtoSD_InterruptPending FN1:00_0024) */
1084    rw_data = 0xff;
1085    sdio_claim_host(func);
1086    ret = ks7010_sdio_write(priv, INT_PENDING, &rw_data, sizeof(rw_data));
1087    sdio_release_host(func);
1088    if(ret){
1089        DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
1090    }
1091    DPRINTK(4, " clear Interrupt : INT_PENDING=%02X\n", rw_data);
1092
1093
1094    /* enable ks7010sdio interrupt (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS) */
1095    rw_data = (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS);
1096    sdio_claim_host(func);
1097    ret = ks7010_sdio_write(priv, INT_ENABLE, &rw_data, sizeof(rw_data));
1098    sdio_release_host(func);
1099    if(ret){
1100        DPRINTK(1, " error : INT_ENABLE=%02X\n", rw_data);
1101    }
1102    DPRINTK(4, " enable Interrupt : INT_ENABLE=%02X\n", rw_data);
1103    priv->dev_state = DEVICE_STATE_BOOT;
1104
1105    priv->ks_wlan_hw.ks7010sdio_wq = create_workqueue("ks7010sdio_wq");
1106    if(!priv->ks_wlan_hw.ks7010sdio_wq){
1107        DPRINTK(1, "create_workqueue failed !!\n");
1108        goto error_free_read_buf;
1109    }
1110
1111    priv->ks_wlan_hw.ks7010sdio_init = create_singlethread_workqueue("ks7010sdio_init");
1112    if(!priv->ks_wlan_hw.ks7010sdio_init){
1113        DPRINTK(1, "create_workqueue failed !!\n");
1114        goto error_free_sdio_wq;
1115    }
1116
1117    INIT_WORK(&priv->ks_wlan_hw.init_task, card_init_task);
1118    INIT_DELAYED_WORK(&priv->ks_wlan_hw.rw_wq, ks7010_rw_function);
1119
1120    queue_work(priv->ks_wlan_hw.ks7010sdio_init, &priv->ks_wlan_hw.init_task);
1121
1122    return 0;
1123
1124error_free_sdio_wq:
1125    flush_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
1126    destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
1127    priv->ks_wlan_hw.ks7010sdio_wq = NULL;
1128error_free_read_buf:
1129    kfree(priv->ks_wlan_hw.read_buf);
1130    priv->ks_wlan_hw.read_buf = NULL;
1131error_free_netdev:
1132    free_netdev(priv->net_dev);
1133    card->priv = NULL;
1134error_release_irq:
1135    sdio_claim_host(func);
1136    sdio_release_irq(func);
1137error_disable_func:
1138    sdio_disable_func(func);
1139error_free_card:
1140    sdio_release_host(func);
1141    sdio_set_drvdata(func, NULL);
1142    kfree(card);
1143error:
1144    return -ENODEV;
1145}
1146
1147static void ks7910_sdio_remove(struct sdio_func *func)
1148{
1149    int ret;
1150    struct ks_sdio_card *card;
1151    struct ks_wlan_private *priv;
1152    struct net_device *netdev;
1153    DPRINTK(1, "ks7910_sdio_remove()\n");
1154
1155    card = sdio_get_drvdata(func);
1156
1157    if(card == NULL)
1158        return;
1159
1160    DPRINTK(1, "priv = card->priv\n");
1161    priv = card->priv;
1162    netdev = priv->net_dev;
1163    if(priv){
1164        ks_wlan_net_stop(netdev);
1165        DPRINTK(1, "ks_wlan_net_stop\n");
1166
1167        /* interrupt disable */
1168        sdio_claim_host(func);
1169        sdio_writeb(func, 0, INT_ENABLE, &ret);
1170        sdio_writeb(func, 0xff, INT_PENDING, &ret);
1171        sdio_release_host(func);
1172        DPRINTK(1, "interrupt disable\n");
1173
1174        /* send stop request to MAC */
1175        {
1176            struct hostif_stop_request_t *pp;
1177            pp = (struct hostif_stop_request_t *)kzalloc(hif_align_size(sizeof(*pp)), GFP_KERNEL );
1178            if (pp==NULL) {
1179                DPRINTK(3,"allocate memory failed..\n");
1180                return; /* to do goto ni suru*/
1181            }
1182            pp->header.size = cpu_to_le16((uint16_t)(sizeof(*pp)-sizeof(pp->header.size)));
1183            pp->header.event = cpu_to_le16((uint16_t)HIF_STOP_REQ);
1184
1185            sdio_claim_host(func);
1186            write_to_device(priv, (unsigned char *) pp, hif_align_size(sizeof(*pp)));
1187            sdio_release_host(func);
1188            kfree(pp);
1189        }
1190        DPRINTK(1, "STOP Req\n");
1191
1192        if(priv->ks_wlan_hw.ks7010sdio_wq){
1193            flush_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
1194            destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
1195        }
1196        DPRINTK(1, "destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);\n");
1197
1198        if(priv->ks_wlan_hw.ks7010sdio_init){
1199            flush_workqueue(priv->ks_wlan_hw.ks7010sdio_init);
1200            destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_init);
1201        }
1202        DPRINTK(1, "destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_init);\n");
1203
1204        hostif_exit(priv);
1205        DPRINTK(1, "hostif_exit\n");
1206
1207        if(!reg_net)
1208            unregister_netdev(netdev);
1209        DPRINTK(1, "unregister_netdev\n");
1210
1211        trx_device_exit(priv);
1212        if(priv->ks_wlan_hw.read_buf){
1213            kfree(priv->ks_wlan_hw.read_buf);
1214        }
1215        free_netdev(priv->net_dev);
1216        card->priv = NULL;
1217    }
1218
1219    sdio_claim_host(func);
1220    sdio_release_irq(func);
1221    DPRINTK(1, "sdio_release_irq()\n");
1222    sdio_disable_func(func);
1223    DPRINTK(1, "sdio_disable_func()\n");
1224    sdio_release_host(func);
1225
1226    sdio_set_drvdata(func, NULL);
1227
1228    kfree(card);
1229    DPRINTK(1, "kfree()\n");
1230
1231
1232    DPRINTK(5," Bye !!\n");
1233    return;
1234}
1235
1236static int __init ks7010_sdio_init( void )
1237{
1238    int status;
1239    printk(KERN_INFO "ks7010_sdio : %s %s\n" ,__DATE__,__TIME__);
1240
1241    /* register with bus driver core */
1242    status = sdio_register_driver(&ks7010_sdio_driver);
1243    if(status != 0){
1244        DPRINTK(1,"ks79xx_sdio : failed to register with bus driver, %d\n", status );
1245    }
1246    return status;
1247}
1248
1249static void __exit ks7010_sdio_exit( void )
1250{
1251    DPRINTK(5," \n");
1252    sdio_unregister_driver(&ks7010_sdio_driver);
1253    return;
1254}
1255
1256module_init(ks7010_sdio_init);
1257module_exit(ks7010_sdio_exit);
1258
1259MODULE_AUTHOR("Qi-Hardware based on KeyStream driver");
1260MODULE_DESCRIPTION("Driver for KeyStream, KS7010 based SDIO cards. ");
1261#ifdef MODULE_LICENSE
1262MODULE_LICENSE("GPL");
1263#endif
1264MODULE_SUPPORTED_DEVICE("KS7910");
1265

Archive Download this file



interactive