Version:  2.0.40 2.2.26 2.4.37 2.6.39 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15

Linux/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                 spin_lock_irqsave(&tx->lock, flags);
514                 tx->can_send = 1;
515 
516                 if (!list_empty(&tx->sdu_list) || !list_empty(&tx->hci_list))
517                         schedule_work(&sdev->ws);
518                 spin_unlock_irqrestore(&tx->lock, flags);
519                 dev_dbg(&func->dev, "Ack... %0x\n", ntohl(*ack_seq));
520                 goto done;
521         }
522 
523         memcpy(rx->rx_buf, hdr + TYPE_A_HEADER_SIZE,
524                         TYPE_A_LOOKAHEAD_SIZE - TYPE_A_HEADER_SIZE);
525 
526         buf = rx->rx_buf + TYPE_A_LOOKAHEAD_SIZE - TYPE_A_HEADER_SIZE;
527         remain = len - TYPE_A_LOOKAHEAD_SIZE + TYPE_A_HEADER_SIZE;
528         if (remain <= 0)
529                 goto end_io;
530 
531         blocks = remain / func->cur_blksize;
532 
533         if (blocks) {
534                 n = blocks * func->cur_blksize;
535                 ret = sdio_memcpy_fromio(func, buf, 0x0, n);
536                 if (ret) {
537                         dev_err(&func->dev,
538                                 "Cannot read from function %d\n", func->num);
539                         goto done;
540                 }
541                 buf += n;
542                 remain -= n;
543         }
544 
545         if (remain) {
546                 ret = sdio_memcpy_fromio(func, buf, 0x0, remain);
547                 if (ret) {
548                         dev_err(&func->dev,
549                                 "Cannot read from function %d\n", func->num);
550                         goto done;
551                 }
552         }
553 
554 end_io:
555         print_hex_dump_debug("sdio_receive: ", DUMP_PREFIX_NONE, 16, 1,
556                              rx->rx_buf, len, false);
557         len = control_sdu_tx_flow(sdev, rx->rx_buf, len);
558 
559         spin_lock_irqsave(&rx->lock, flags);
560 
561         if (!list_empty(&rx->req_list)) {
562                 r = list_entry(rx->req_list.next, struct sdio_rx, list);
563                 spin_unlock_irqrestore(&rx->lock, flags);
564                 if (r->callback)
565                         r->callback(r->cb_data, rx->rx_buf, len);
566                 spin_lock_irqsave(&rx->lock, flags);
567                 list_del(&r->list);
568                 put_rx_struct(rx, r);
569         }
570 
571         spin_unlock_irqrestore(&rx->lock, flags);
572 
573 done:
574         sdio_writeb(func, 0x00, 0x10, &ret);    /* PCRRT */
575         if (!phy_dev->netdev)
576                 register_wimax_device(phy_dev, &func->dev);
577 }
578 
579 static int gdm_sdio_receive(void *priv_dev,
580                                 void (*cb)(void *cb_data, void *data, int len),
581                                 void *cb_data)
582 {
583         struct sdiowm_dev *sdev = priv_dev;
584         struct rx_cxt *rx = &sdev->rx;
585         struct sdio_rx *r;
586         unsigned long flags;
587 
588         spin_lock_irqsave(&rx->lock, flags);
589         r = get_rx_struct(rx);
590         if (r == NULL) {
591                 spin_unlock_irqrestore(&rx->lock, flags);
592                 return -ENOMEM;
593         }
594 
595         r->callback = cb;
596         r->cb_data = cb_data;
597 
598         list_add_tail(&r->list, &rx->req_list);
599         spin_unlock_irqrestore(&rx->lock, flags);
600 
601         return 0;
602 }
603 
604 static int sdio_wimax_probe(struct sdio_func *func,
605                                 const struct sdio_device_id *id)
606 {
607         int ret;
608         struct phy_dev *phy_dev = NULL;
609         struct sdiowm_dev *sdev = NULL;
610 
611         dev_info(&func->dev, "Found GDM SDIO VID = 0x%04x PID = 0x%04x...\n",
612                  func->vendor, func->device);
613         dev_info(&func->dev, "GCT WiMax driver version %s\n", DRIVER_VERSION);
614 
615         sdio_claim_host(func);
616         sdio_enable_func(func);
617         sdio_claim_irq(func, gdm_sdio_irq);
618 
619         ret = sdio_boot(func);
620         if (ret)
621                 return ret;
622 
623         phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
624         if (phy_dev == NULL) {
625                 ret = -ENOMEM;
626                 goto out;
627         }
628         sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
629         if (sdev == NULL) {
630                 ret = -ENOMEM;
631                 goto out;
632         }
633 
634         phy_dev->priv_dev = (void *)sdev;
635         phy_dev->send_func = gdm_sdio_send;
636         phy_dev->rcv_func = gdm_sdio_receive;
637 
638         ret = init_sdio(sdev);
639         if (ret < 0)
640                 goto out;
641 
642         sdev->func = func;
643 
644         sdio_writeb(func, 1, 0x14, &ret);       /* Enable interrupt */
645         sdio_release_host(func);
646 
647         INIT_WORK(&sdev->ws, do_tx);
648 
649         sdio_set_drvdata(func, phy_dev);
650 out:
651         if (ret) {
652                 kfree(phy_dev);
653                 kfree(sdev);
654         }
655 
656         return ret;
657 }
658 
659 static void sdio_wimax_remove(struct sdio_func *func)
660 {
661         struct phy_dev *phy_dev = sdio_get_drvdata(func);
662         struct sdiowm_dev *sdev = phy_dev->priv_dev;
663 
664         cancel_work_sync(&sdev->ws);
665         if (phy_dev->netdev)
666                 unregister_wimax_device(phy_dev);
667         sdio_claim_host(func);
668         sdio_release_irq(func);
669         sdio_disable_func(func);
670         sdio_release_host(func);
671         release_sdio(sdev);
672 
673         kfree(sdev);
674         kfree(phy_dev);
675 }
676 
677 static const struct sdio_device_id sdio_wimax_ids[] = {
678         { SDIO_DEVICE(0x0296, 0x5347) },
679         {0}
680 };
681 
682 MODULE_DEVICE_TABLE(sdio, sdio_wimax_ids);
683 
684 static struct sdio_driver sdio_wimax_driver = {
685         .probe          = sdio_wimax_probe,
686         .remove         = sdio_wimax_remove,
687         .name           = "sdio_wimax",
688         .id_table       = sdio_wimax_ids,
689 };
690 
691 static int __init sdio_gdm_wimax_init(void)
692 {
693         return sdio_register_driver(&sdio_wimax_driver);
694 }
695 
696 static void __exit sdio_gdm_wimax_exit(void)
697 {
698         sdio_unregister_driver(&sdio_wimax_driver);
699 }
700 
701 module_init(sdio_gdm_wimax_init);
702 module_exit(sdio_gdm_wimax_exit);
703 
704 MODULE_VERSION(DRIVER_VERSION);
705 MODULE_DESCRIPTION("GCT WiMax SDIO Device Driver");
706 MODULE_AUTHOR("Ethan Park");
707 MODULE_LICENSE("GPL");
708 

This page was automatically generated by LXR 0.3.1 (source).  •  Linux is a registered trademark of Linus Torvalds  •  Contact us