Merge commit 'ccbf62d8a284cf181ac28c8e8407dd077d90dd4b' into for-next
[cascardo/linux.git] / drivers / staging / gdm72xx / gdm_sdio.c
1 /*
2  * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved.
3  *
4  * This software is licensed under the terms of the GNU General Public
5  * License version 2, as published by the Free Software Foundation, and
6  * may be copied, distributed, and modified under those terms.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  */
13
14 #include <linux/module.h>
15 #include <linux/init.h>
16 #include <linux/kernel.h>
17
18 #include <linux/mmc/core.h>
19 #include <linux/mmc/card.h>
20 #include <linux/mmc/sdio_func.h>
21 #include <linux/mmc/sdio_ids.h>
22
23 #include "gdm_sdio.h"
24 #include "gdm_wimax.h"
25 #include "sdio_boot.h"
26 #include "hci.h"
27
28 #define TYPE_A_HEADER_SIZE      4
29 #define TYPE_A_LOOKAHEAD_SIZE   16
30
31 #define MAX_NR_RX_BUF   4
32
33 #define SDU_TX_BUF_SIZE 2048
34 #define TX_BUF_SIZE     2048
35 #define TX_CHUNK_SIZE   (2048 - TYPE_A_HEADER_SIZE)
36 #define RX_BUF_SIZE     (25*1024)
37
38 #define TX_HZ           2000
39 #define TX_INTERVAL     (1000000/TX_HZ)
40
41 static int init_sdio(struct sdiowm_dev *sdev);
42 static void release_sdio(struct sdiowm_dev *sdev);
43
44 static struct sdio_tx *alloc_tx_struct(struct tx_cxt *tx)
45 {
46         struct sdio_tx *t = kzalloc(sizeof(*t), GFP_ATOMIC);
47
48         if (!t)
49                 return NULL;
50
51         t->buf = kmalloc(TX_BUF_SIZE, GFP_ATOMIC);
52         if (!t->buf) {
53                 kfree(t);
54                 return NULL;
55         }
56
57         t->tx_cxt = tx;
58
59         return t;
60 }
61
62 static void free_tx_struct(struct sdio_tx *t)
63 {
64         if (t) {
65                 kfree(t->buf);
66                 kfree(t);
67         }
68 }
69
70 static struct sdio_rx *alloc_rx_struct(struct rx_cxt *rx)
71 {
72         struct sdio_rx *r = kzalloc(sizeof(*r), GFP_ATOMIC);
73
74         if (r)
75                 r->rx_cxt = rx;
76
77         return r;
78 }
79
80 static void free_rx_struct(struct sdio_rx *r)
81 {
82         kfree(r);
83 }
84
85 /* Before this function is called, spin lock should be locked. */
86 static struct sdio_tx *get_tx_struct(struct tx_cxt *tx, int *no_spc)
87 {
88         struct sdio_tx *t;
89
90         if (list_empty(&tx->free_list))
91                 return NULL;
92
93         t = list_entry(tx->free_list.prev, struct sdio_tx, list);
94         list_del(&t->list);
95
96         *no_spc = list_empty(&tx->free_list) ? 1 : 0;
97
98         return t;
99 }
100
101 /* Before this function is called, spin lock should be locked. */
102 static void put_tx_struct(struct tx_cxt *tx, struct sdio_tx *t)
103 {
104         list_add_tail(&t->list, &tx->free_list);
105 }
106
107 /* Before this function is called, spin lock should be locked. */
108 static struct sdio_rx *get_rx_struct(struct rx_cxt *rx)
109 {
110         struct sdio_rx *r;
111
112         if (list_empty(&rx->free_list))
113                 return NULL;
114
115         r = list_entry(rx->free_list.prev, struct sdio_rx, list);
116         list_del(&r->list);
117
118         return r;
119 }
120
121 /* Before this function is called, spin lock should be locked. */
122 static void put_rx_struct(struct rx_cxt *rx, struct sdio_rx *r)
123 {
124         list_add_tail(&r->list, &rx->free_list);
125 }
126
127 static int init_sdio(struct sdiowm_dev *sdev)
128 {
129         int ret = 0, i;
130         struct tx_cxt *tx = &sdev->tx;
131         struct rx_cxt *rx = &sdev->rx;
132         struct sdio_tx *t;
133         struct sdio_rx *r;
134
135         INIT_LIST_HEAD(&tx->free_list);
136         INIT_LIST_HEAD(&tx->sdu_list);
137         INIT_LIST_HEAD(&tx->hci_list);
138
139         spin_lock_init(&tx->lock);
140
141         tx->sdu_buf = kmalloc(SDU_TX_BUF_SIZE, GFP_KERNEL);
142         if (tx->sdu_buf == NULL)
143                 goto fail;
144
145         for (i = 0; i < MAX_NR_SDU_BUF; i++) {
146                 t = alloc_tx_struct(tx);
147                 if (t == NULL) {
148                         ret = -ENOMEM;
149                         goto fail;
150                 }
151                 list_add(&t->list, &tx->free_list);
152         }
153
154         INIT_LIST_HEAD(&rx->free_list);
155         INIT_LIST_HEAD(&rx->req_list);
156
157         spin_lock_init(&rx->lock);
158
159         for (i = 0; i < MAX_NR_RX_BUF; i++) {
160                 r = alloc_rx_struct(rx);
161                 if (r == NULL) {
162                         ret = -ENOMEM;
163                         goto fail;
164                 }
165                 list_add(&r->list, &rx->free_list);
166         }
167
168         rx->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL);
169         if (rx->rx_buf == NULL)
170                 goto fail;
171
172         return 0;
173
174 fail:
175         release_sdio(sdev);
176         return ret;
177 }
178
179 static void release_sdio(struct sdiowm_dev *sdev)
180 {
181         struct tx_cxt   *tx = &sdev->tx;
182         struct rx_cxt   *rx = &sdev->rx;
183         struct sdio_tx  *t, *t_next;
184         struct sdio_rx  *r, *r_next;
185
186         kfree(tx->sdu_buf);
187
188         list_for_each_entry_safe(t, t_next, &tx->free_list, list) {
189                 list_del(&t->list);
190                 free_tx_struct(t);
191         }
192
193         list_for_each_entry_safe(t, t_next, &tx->sdu_list, list) {
194                 list_del(&t->list);
195                 free_tx_struct(t);
196         }
197
198         list_for_each_entry_safe(t, t_next, &tx->hci_list, list) {
199                 list_del(&t->list);
200                 free_tx_struct(t);
201         }
202
203         kfree(rx->rx_buf);
204
205         list_for_each_entry_safe(r, r_next, &rx->free_list, list) {
206                 list_del(&r->list);
207                 free_rx_struct(r);
208         }
209
210         list_for_each_entry_safe(r, r_next, &rx->req_list, list) {
211                 list_del(&r->list);
212                 free_rx_struct(r);
213         }
214 }
215
216 static void send_sdio_pkt(struct sdio_func *func, u8 *data, int len)
217 {
218         int n, blocks, ret, remain;
219
220         sdio_claim_host(func);
221
222         blocks = len / func->cur_blksize;
223         n = blocks * func->cur_blksize;
224         if (blocks) {
225                 ret = sdio_memcpy_toio(func, 0, data, n);
226                 if (ret < 0) {
227                         if (ret != -ENOMEDIUM)
228                                 dev_err(&func->dev,
229                                         "gdmwms: %s error: ret = %d\n",
230                                         __func__, ret);
231                         goto end_io;
232                 }
233         }
234
235         remain = len - n;
236         remain = (remain + 3) & ~3;
237
238         if (remain) {
239                 ret = sdio_memcpy_toio(func, 0, data + n, remain);
240                 if (ret < 0) {
241                         if (ret != -ENOMEDIUM)
242                                 dev_err(&func->dev,
243                                         "gdmwms: %s error: ret = %d\n",
244                                         __func__, ret);
245                         goto end_io;
246                 }
247         }
248
249 end_io:
250         sdio_release_host(func);
251 }
252
253 static void send_sdu(struct sdio_func *func, struct tx_cxt *tx)
254 {
255         struct list_head *l, *next;
256         struct hci_s *hci;
257         struct sdio_tx *t;
258         int pos, len, i, estlen, aggr_num = 0, aggr_len;
259         u8 *buf;
260         unsigned long flags;
261
262         spin_lock_irqsave(&tx->lock, flags);
263
264         pos = TYPE_A_HEADER_SIZE + HCI_HEADER_SIZE;
265         list_for_each_entry(t, &tx->sdu_list, list) {
266                 estlen = ((t->len + 3) & ~3) + 4;
267                 if ((pos + estlen) > SDU_TX_BUF_SIZE)
268                         break;
269
270                 aggr_num++;
271                 memcpy(tx->sdu_buf + pos, t->buf, t->len);
272                 memset(tx->sdu_buf + pos + t->len, 0, estlen - t->len);
273                 pos += estlen;
274         }
275         aggr_len = pos;
276
277         hci = (struct hci_s *)(tx->sdu_buf + TYPE_A_HEADER_SIZE);
278         hci->cmd_evt = H2B(WIMAX_TX_SDU_AGGR);
279         hci->length = H2B(aggr_len - TYPE_A_HEADER_SIZE - HCI_HEADER_SIZE);
280
281         spin_unlock_irqrestore(&tx->lock, flags);
282
283         print_hex_dump_debug("sdio_send: ", DUMP_PREFIX_NONE, 16, 1,
284                              tx->sdu_buf + TYPE_A_HEADER_SIZE,
285                              aggr_len - TYPE_A_HEADER_SIZE, false);
286
287         for (pos = TYPE_A_HEADER_SIZE; pos < aggr_len; pos += TX_CHUNK_SIZE) {
288                 len = aggr_len - pos;
289                 len = len > TX_CHUNK_SIZE ? TX_CHUNK_SIZE : len;
290                 buf = tx->sdu_buf + pos - TYPE_A_HEADER_SIZE;
291
292                 buf[0] = len & 0xff;
293                 buf[1] = (len >> 8) & 0xff;
294                 buf[2] = (len >> 16) & 0xff;
295                 buf[3] = (pos + len) >= aggr_len ? 0 : 1;
296                 send_sdio_pkt(func, buf, len + TYPE_A_HEADER_SIZE);
297         }
298
299         spin_lock_irqsave(&tx->lock, flags);
300
301         for (l = tx->sdu_list.next, i = 0; i < aggr_num; i++, l = next) {
302                 next = l->next;
303                 t = list_entry(l, struct sdio_tx, list);
304                 if (t->callback)
305                         t->callback(t->cb_data);
306
307                 list_del(l);
308                 put_tx_struct(t->tx_cxt, t);
309         }
310
311         do_gettimeofday(&tx->sdu_stamp);
312         spin_unlock_irqrestore(&tx->lock, flags);
313 }
314
315 static void send_hci(struct sdio_func *func, struct tx_cxt *tx,
316                      struct sdio_tx *t)
317 {
318         unsigned long flags;
319
320         print_hex_dump_debug("sdio_send: ", DUMP_PREFIX_NONE, 16, 1,
321                              t->buf + TYPE_A_HEADER_SIZE,
322                              t->len - TYPE_A_HEADER_SIZE, false);
323         send_sdio_pkt(func, t->buf, t->len);
324
325         spin_lock_irqsave(&tx->lock, flags);
326         if (t->callback)
327                 t->callback(t->cb_data);
328         free_tx_struct(t);
329         spin_unlock_irqrestore(&tx->lock, flags);
330 }
331
332 static void do_tx(struct work_struct *work)
333 {
334         struct sdiowm_dev *sdev = container_of(work, struct sdiowm_dev, ws);
335         struct sdio_func *func = sdev->func;
336         struct tx_cxt *tx = &sdev->tx;
337         struct sdio_tx *t = NULL;
338         struct timeval now, *before;
339         int is_sdu = 0;
340         long diff;
341         unsigned long flags;
342
343         spin_lock_irqsave(&tx->lock, flags);
344         if (!tx->can_send) {
345                 spin_unlock_irqrestore(&tx->lock, flags);
346                 return;
347         }
348
349         if (!list_empty(&tx->hci_list)) {
350                 t = list_entry(tx->hci_list.next, struct sdio_tx, list);
351                 list_del(&t->list);
352                 is_sdu = 0;
353         } else if (!tx->stop_sdu_tx && !list_empty(&tx->sdu_list)) {
354                 do_gettimeofday(&now);
355                 before = &tx->sdu_stamp;
356
357                 diff = (now.tv_sec - before->tv_sec) * 1000000 +
358                         (now.tv_usec - before->tv_usec);
359                 if (diff >= 0 && diff < TX_INTERVAL) {
360                         schedule_work(&sdev->ws);
361                         spin_unlock_irqrestore(&tx->lock, flags);
362                         return;
363                 }
364                 is_sdu = 1;
365         }
366
367         if (!is_sdu && t == NULL) {
368                 spin_unlock_irqrestore(&tx->lock, flags);
369                 return;
370         }
371
372         tx->can_send = 0;
373
374         spin_unlock_irqrestore(&tx->lock, flags);
375
376         if (is_sdu)
377                 send_sdu(func, tx);
378         else
379                 send_hci(func, tx, t);
380 }
381
382 static int gdm_sdio_send(void *priv_dev, void *data, int len,
383                          void (*cb)(void *data), void *cb_data)
384 {
385         struct sdiowm_dev *sdev = priv_dev;
386         struct tx_cxt *tx = &sdev->tx;
387         struct sdio_tx *t;
388         u8 *pkt = data;
389         int no_spc = 0;
390         u16 cmd_evt;
391         unsigned long flags;
392
393         BUG_ON(len > TX_BUF_SIZE - TYPE_A_HEADER_SIZE);
394
395         spin_lock_irqsave(&tx->lock, flags);
396
397         cmd_evt = (pkt[0] << 8) | pkt[1];
398         if (cmd_evt == WIMAX_TX_SDU) {
399                 t = get_tx_struct(tx, &no_spc);
400                 if (t == NULL) {
401                         /* This case must not happen. */
402                         spin_unlock_irqrestore(&tx->lock, flags);
403                         return -ENOSPC;
404                 }
405                 list_add_tail(&t->list, &tx->sdu_list);
406
407                 memcpy(t->buf, data, len);
408
409                 t->len = len;
410                 t->callback = cb;
411                 t->cb_data = cb_data;
412         } else {
413                 t = alloc_tx_struct(tx);
414                 if (t == NULL) {
415                         spin_unlock_irqrestore(&tx->lock, flags);
416                         return -ENOMEM;
417                 }
418                 list_add_tail(&t->list, &tx->hci_list);
419
420                 t->buf[0] = len & 0xff;
421                 t->buf[1] = (len >> 8) & 0xff;
422                 t->buf[2] = (len >> 16) & 0xff;
423                 t->buf[3] = 2;
424                 memcpy(t->buf + TYPE_A_HEADER_SIZE, data, len);
425
426                 t->len = len + TYPE_A_HEADER_SIZE;
427                 t->callback = cb;
428                 t->cb_data = cb_data;
429         }
430
431         if (tx->can_send)
432                 schedule_work(&sdev->ws);
433
434         spin_unlock_irqrestore(&tx->lock, flags);
435
436         if (no_spc)
437                 return -ENOSPC;
438
439         return 0;
440 }
441
442 /*
443  * Handle the HCI, WIMAX_SDU_TX_FLOW.
444  */
445 static int control_sdu_tx_flow(struct sdiowm_dev *sdev, u8 *hci_data, int len)
446 {
447         struct tx_cxt *tx = &sdev->tx;
448         u16 cmd_evt;
449         unsigned long flags;
450
451         spin_lock_irqsave(&tx->lock, flags);
452
453         cmd_evt = (hci_data[0] << 8) | (hci_data[1]);
454         if (cmd_evt != WIMAX_SDU_TX_FLOW)
455                 goto out;
456
457         if (hci_data[4] == 0) {
458                 dev_dbg(&sdev->func->dev, "WIMAX ==> STOP SDU TX\n");
459                 tx->stop_sdu_tx = 1;
460         } else if (hci_data[4] == 1) {
461                 dev_dbg(&sdev->func->dev, "WIMAX ==> START SDU TX\n");
462                 tx->stop_sdu_tx = 0;
463                 if (tx->can_send)
464                         schedule_work(&sdev->ws);
465                 /*
466                  * If free buffer for sdu tx doesn't exist, then tx queue
467                  * should not be woken. For this reason, don't pass the command,
468                  * START_SDU_TX.
469                  */
470                 if (list_empty(&tx->free_list))
471                         len = 0;
472         }
473
474 out:
475         spin_unlock_irqrestore(&tx->lock, flags);
476         return len;
477 }
478
479 static void gdm_sdio_irq(struct sdio_func *func)
480 {
481         struct phy_dev *phy_dev = sdio_get_drvdata(func);
482         struct sdiowm_dev *sdev = phy_dev->priv_dev;
483         struct tx_cxt *tx = &sdev->tx;
484         struct rx_cxt *rx = &sdev->rx;
485         struct sdio_rx *r;
486         unsigned long flags;
487         u8 val, hdr[TYPE_A_LOOKAHEAD_SIZE], *buf;
488         u32 len, blocks, n;
489         int ret, remain;
490
491         /* Check interrupt */
492         val = sdio_readb(func, 0x13, &ret);
493         if (val & 0x01)
494                 sdio_writeb(func, 0x01, 0x13, &ret);    /* clear interrupt */
495         else
496                 return;
497
498         ret = sdio_memcpy_fromio(func, hdr, 0x0, TYPE_A_LOOKAHEAD_SIZE);
499         if (ret) {
500                 dev_err(&func->dev,
501                         "Cannot read from function %d\n", func->num);
502                 goto done;
503         }
504
505         len = (hdr[2] << 16) | (hdr[1] << 8) | hdr[0];
506         if (len > (RX_BUF_SIZE - TYPE_A_HEADER_SIZE)) {
507                 dev_err(&func->dev, "Too big Type-A size: %d\n", len);
508                 goto done;
509         }
510
511         if (hdr[3] == 1) {      /* Ack */
512                 u32 *ack_seq = (u32 *)&hdr[4];
513
514                 spin_lock_irqsave(&tx->lock, flags);
515                 tx->can_send = 1;
516
517                 if (!list_empty(&tx->sdu_list) || !list_empty(&tx->hci_list))
518                         schedule_work(&sdev->ws);
519                 spin_unlock_irqrestore(&tx->lock, flags);
520                 dev_dbg(&func->dev, "Ack... %0x\n", ntohl(*ack_seq));
521                 goto done;
522         }
523
524         memcpy(rx->rx_buf, hdr + TYPE_A_HEADER_SIZE,
525                TYPE_A_LOOKAHEAD_SIZE - TYPE_A_HEADER_SIZE);
526
527         buf = rx->rx_buf + TYPE_A_LOOKAHEAD_SIZE - TYPE_A_HEADER_SIZE;
528         remain = len - TYPE_A_LOOKAHEAD_SIZE + TYPE_A_HEADER_SIZE;
529         if (remain <= 0)
530                 goto end_io;
531
532         blocks = remain / func->cur_blksize;
533
534         if (blocks) {
535                 n = blocks * func->cur_blksize;
536                 ret = sdio_memcpy_fromio(func, buf, 0x0, n);
537                 if (ret) {
538                         dev_err(&func->dev,
539                                 "Cannot read from function %d\n", func->num);
540                         goto done;
541                 }
542                 buf += n;
543                 remain -= n;
544         }
545
546         if (remain) {
547                 ret = sdio_memcpy_fromio(func, buf, 0x0, remain);
548                 if (ret) {
549                         dev_err(&func->dev,
550                                 "Cannot read from function %d\n", func->num);
551                         goto done;
552                 }
553         }
554
555 end_io:
556         print_hex_dump_debug("sdio_receive: ", DUMP_PREFIX_NONE, 16, 1,
557                              rx->rx_buf, len, false);
558         len = control_sdu_tx_flow(sdev, rx->rx_buf, len);
559
560         spin_lock_irqsave(&rx->lock, flags);
561
562         if (!list_empty(&rx->req_list)) {
563                 r = list_entry(rx->req_list.next, struct sdio_rx, list);
564                 spin_unlock_irqrestore(&rx->lock, flags);
565                 if (r->callback)
566                         r->callback(r->cb_data, rx->rx_buf, len);
567                 spin_lock_irqsave(&rx->lock, flags);
568                 list_del(&r->list);
569                 put_rx_struct(rx, r);
570         }
571
572         spin_unlock_irqrestore(&rx->lock, flags);
573
574 done:
575         sdio_writeb(func, 0x00, 0x10, &ret);    /* PCRRT */
576         if (!phy_dev->netdev)
577                 register_wimax_device(phy_dev, &func->dev);
578 }
579
580 static int gdm_sdio_receive(void *priv_dev,
581                             void (*cb)(void *cb_data, void *data, int len),
582                             void *cb_data)
583 {
584         struct sdiowm_dev *sdev = priv_dev;
585         struct rx_cxt *rx = &sdev->rx;
586         struct sdio_rx *r;
587         unsigned long flags;
588
589         spin_lock_irqsave(&rx->lock, flags);
590         r = get_rx_struct(rx);
591         if (r == NULL) {
592                 spin_unlock_irqrestore(&rx->lock, flags);
593                 return -ENOMEM;
594         }
595
596         r->callback = cb;
597         r->cb_data = cb_data;
598
599         list_add_tail(&r->list, &rx->req_list);
600         spin_unlock_irqrestore(&rx->lock, flags);
601
602         return 0;
603 }
604
605 static int sdio_wimax_probe(struct sdio_func *func,
606                             const struct sdio_device_id *id)
607 {
608         int ret;
609         struct phy_dev *phy_dev = NULL;
610         struct sdiowm_dev *sdev = NULL;
611
612         dev_info(&func->dev, "Found GDM SDIO VID = 0x%04x PID = 0x%04x...\n",
613                  func->vendor, func->device);
614         dev_info(&func->dev, "GCT WiMax driver version %s\n", DRIVER_VERSION);
615
616         sdio_claim_host(func);
617         sdio_enable_func(func);
618         sdio_claim_irq(func, gdm_sdio_irq);
619
620         ret = sdio_boot(func);
621         if (ret)
622                 return ret;
623
624         phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
625         if (phy_dev == NULL) {
626                 ret = -ENOMEM;
627                 goto out;
628         }
629         sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
630         if (sdev == NULL) {
631                 ret = -ENOMEM;
632                 goto out;
633         }
634
635         phy_dev->priv_dev = (void *)sdev;
636         phy_dev->send_func = gdm_sdio_send;
637         phy_dev->rcv_func = gdm_sdio_receive;
638
639         ret = init_sdio(sdev);
640         if (ret < 0)
641                 goto out;
642
643         sdev->func = func;
644
645         sdio_writeb(func, 1, 0x14, &ret);       /* Enable interrupt */
646         sdio_release_host(func);
647
648         INIT_WORK(&sdev->ws, do_tx);
649
650         sdio_set_drvdata(func, phy_dev);
651 out:
652         if (ret) {
653                 kfree(phy_dev);
654                 kfree(sdev);
655         }
656
657         return ret;
658 }
659
660 static void sdio_wimax_remove(struct sdio_func *func)
661 {
662         struct phy_dev *phy_dev = sdio_get_drvdata(func);
663         struct sdiowm_dev *sdev = phy_dev->priv_dev;
664
665         cancel_work_sync(&sdev->ws);
666         if (phy_dev->netdev)
667                 unregister_wimax_device(phy_dev);
668         sdio_claim_host(func);
669         sdio_release_irq(func);
670         sdio_disable_func(func);
671         sdio_release_host(func);
672         release_sdio(sdev);
673
674         kfree(sdev);
675         kfree(phy_dev);
676 }
677
678 static const struct sdio_device_id sdio_wimax_ids[] = {
679         { SDIO_DEVICE(0x0296, 0x5347) },
680         {0}
681 };
682
683 MODULE_DEVICE_TABLE(sdio, sdio_wimax_ids);
684
685 static struct sdio_driver sdio_wimax_driver = {
686         .probe          = sdio_wimax_probe,
687         .remove         = sdio_wimax_remove,
688         .name           = "sdio_wimax",
689         .id_table       = sdio_wimax_ids,
690 };
691
692 static int __init sdio_gdm_wimax_init(void)
693 {
694         return sdio_register_driver(&sdio_wimax_driver);
695 }
696
697 static void __exit sdio_gdm_wimax_exit(void)
698 {
699         sdio_unregister_driver(&sdio_wimax_driver);
700 }
701
702 module_init(sdio_gdm_wimax_init);
703 module_exit(sdio_gdm_wimax_exit);
704
705 MODULE_VERSION(DRIVER_VERSION);
706 MODULE_DESCRIPTION("GCT WiMax SDIO Device Driver");
707 MODULE_AUTHOR("Ethan Park");
708 MODULE_LICENSE("GPL");