-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
staging: gdm7240: adding LTE USB driver
GCT Semiconductor GDM7240 is 4G LTE chip. This driver supports GCT reference platform as a USB device. Signed-off-by: Won Kang <wonkang@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- Loading branch information
Won Kang
authored and
Greg Kroah-Hartman
committed
Jul 24, 2013
1 parent
17dc159
commit 61e1210
Showing
20 changed files
with
3,916 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# GCT GDM724x LTE driver configuration | ||
# | ||
|
||
config LTE_GDM724X | ||
tristate "GCT GDM724x LTE support" | ||
depends on NET && USB | ||
help | ||
This driver supports GCT GDM724x LTE chip based USB modem devices. | ||
It exposes 4 network devices to be used per PDN and 2 tty devices to be | ||
used for AT commands and DM monitoring applications. | ||
The modules will be called gdmulte.ko and gdmtty.ko | ||
|
||
GCT-ATCx can be used for AT Commands | ||
GCT-DMx can be used for LTE protocol monitoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
obj-$(CONFIG_LTE_GDM724X) := gdmulte.o | ||
gdmulte-y += gdm_lte.o netlink_k.o | ||
gdmulte-y += gdm_usb.o gdm_endian.o | ||
|
||
obj-$(CONFIG_LTE_GDM724X) += gdmtty.o | ||
gdmtty-y := gdm_tty.o gdm_mux.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
TODO: | ||
- Clean up coding style to meet kernel standard. (80 line limit, netdev_err) | ||
- Remove test for host endian | ||
- Remove confusing macros (endian, hci_send, sdu_send, rcv_with_cb) | ||
- Fixes for every instances of function returning -1 | ||
- Check for skb->len in gdm_lte_emulate_arp() | ||
- Use ALIGN() macro for dummy_cnt in up_to_host() | ||
- Error handling in init_usb() | ||
- Explain reason for multiples of 512 bytes in alloc_tx_struct() | ||
- Review use of atomic allocation for tx structs | ||
- No error checking for alloc_tx_struct in do_tx() | ||
|
||
Patches to: | ||
Jonathan Kim <jonathankim@gctsemi.com> | ||
Dean ahn <deanahn@gctsemi.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved. | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
#include <linux/slab.h> | ||
#include "gdm_endian.h" | ||
|
||
void set_endian(struct gdm_endian *ed, u8 dev_endian) | ||
{ | ||
u8 a[2] = {0x12, 0x34}; | ||
u8 b[2] = {0, }; | ||
u16 c = 0x1234; | ||
|
||
if (dev_endian == ENDIANNESS_BIG) | ||
ed->dev_ed = ENDIANNESS_BIG; | ||
else | ||
ed->dev_ed = ENDIANNESS_LITTLE; | ||
|
||
memcpy(b, &c, 2); | ||
|
||
if (a[0] != b[0]) | ||
ed->host_ed = ENDIANNESS_LITTLE; | ||
else | ||
ed->host_ed = ENDIANNESS_BIG; | ||
|
||
} | ||
|
||
u16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x) | ||
{ | ||
if (ed->dev_ed == ed->host_ed) | ||
return x; | ||
|
||
return Endian16_Swap(x); | ||
} | ||
|
||
u16 gdm_dev16_to_cpu(struct gdm_endian *ed, u16 x) | ||
{ | ||
if (ed->dev_ed == ed->host_ed) | ||
return x; | ||
|
||
return Endian16_Swap(x); | ||
} | ||
|
||
u32 gdm_cpu_to_dev32(struct gdm_endian *ed, u32 x) | ||
{ | ||
if (ed->dev_ed == ed->host_ed) | ||
return x; | ||
|
||
return Endian32_Swap(x); | ||
} | ||
|
||
u32 gdm_dev32_to_cpu(struct gdm_endian *ed, u32 x) | ||
{ | ||
if (ed->dev_ed == ed->host_ed) | ||
return x; | ||
|
||
return Endian32_Swap(x); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved. | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
#ifndef __GDM_ENDIAN_H__ | ||
#define __GDM_ENDIAN_H__ | ||
|
||
#include <linux/types.h> | ||
|
||
#define Endian16_Swap(value) \ | ||
((((u16)((value) & 0x00FF)) << 8) | \ | ||
(((u16)((value) & 0xFF00)) >> 8)) | ||
|
||
#define Endian32_Swap(value) \ | ||
((((u32)((value) & 0x000000FF)) << 24) | \ | ||
(((u32)((value) & 0x0000FF00)) << 8) | \ | ||
(((u32)((value) & 0x00FF0000)) >> 8) | \ | ||
(((u32)((value) & 0xFF000000)) >> 24)) | ||
|
||
enum { | ||
ENDIANNESS_MIN = 0, | ||
ENDIANNESS_UNKNOWN, | ||
ENDIANNESS_LITTLE, | ||
ENDIANNESS_BIG, | ||
ENDIANNESS_MIDDLE, | ||
ENDIANNESS_MAX | ||
}; | ||
|
||
struct gdm_endian { | ||
u8 dev_ed; | ||
u8 host_ed; | ||
}; | ||
|
||
void set_endian(struct gdm_endian *ed, u8 dev_endian); | ||
u16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x); | ||
u16 gdm_dev16_to_cpu(struct gdm_endian *ed, u16 x); | ||
u32 gdm_cpu_to_dev32(struct gdm_endian *ed, u32 x); | ||
u32 gdm_dev32_to_cpu(struct gdm_endian *ed, u32 x); | ||
|
||
#endif /*__GDM_ENDIAN_H__*/ |
Oops, something went wrong.