Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 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 | |
Ben Chan | bbd500d | 2014-06-30 22:13:17 -0700 | [diff] [blame] | 14 | #ifndef __GDM72XX_WM_IOCTL_H__ |
| 15 | #define __GDM72XX_WM_IOCTL_H__ |
| 16 | |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 17 | #if !defined(__KERNEL__) |
| 18 | #include <net/if.h> |
| 19 | #endif |
| 20 | |
| 21 | #define NETLINK_WIMAX 31 |
| 22 | |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 23 | #define SIOCWMIOCTL SIOCDEVPRIVATE |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 24 | |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 25 | #define SIOCG_DATA 0x8D10 |
| 26 | #define SIOCS_DATA 0x8D11 |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 27 | |
| 28 | enum { |
| 29 | SIOC_DATA_FSM, |
| 30 | SIOC_DATA_NETLIST, |
| 31 | SIOC_DATA_CONNNSP, |
| 32 | SIOC_DATA_CONNCOMP, |
| 33 | SIOC_DATA_PROFILEID, |
| 34 | |
| 35 | SIOC_DATA_END |
| 36 | }; |
| 37 | |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 38 | #define SIOC_DATA_MAX 16 |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 39 | |
| 40 | /* FSM */ |
| 41 | enum { |
| 42 | M_INIT = 0, |
| 43 | M_OPEN_OFF, |
| 44 | M_OPEN_ON, |
| 45 | M_SCAN, |
| 46 | M_CONNECTING, |
| 47 | M_CONNECTED, |
| 48 | M_FSM_END, |
| 49 | |
| 50 | C_INIT = 0, |
| 51 | C_CONNSTART, |
| 52 | C_ASSOCSTART, |
| 53 | C_RNG, |
| 54 | C_SBC, |
| 55 | C_AUTH, |
| 56 | C_REG, |
| 57 | C_DSX, |
| 58 | C_ASSOCCOMPLETE, |
| 59 | C_CONNCOMPLETE, |
| 60 | C_FSM_END, |
| 61 | |
| 62 | D_INIT = 0, |
| 63 | D_READY, |
| 64 | D_LISTEN, |
| 65 | D_IPACQUISITION, |
| 66 | |
| 67 | END_FSM |
| 68 | }; |
| 69 | |
| 70 | struct fsm_s { |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 71 | int m_status; /*main status*/ |
| 72 | int c_status; /*connection status*/ |
| 73 | int d_status; /*oma-dm status*/ |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | struct data_s { |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 77 | int size; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 78 | void *buf; |
| 79 | }; |
| 80 | |
| 81 | struct wm_req_s { |
| 82 | union { |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 83 | char ifrn_name[IFNAMSIZ]; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 84 | } ifr_ifrn; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 85 | unsigned short cmd; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 86 | unsigned short data_id; |
| 87 | struct data_s data; |
| 88 | |
| 89 | /* NOTE: sizeof(struct wm_req_s) must be less than sizeof(struct ifreq). */ |
| 90 | }; |
| 91 | |
| 92 | #ifndef ifr_name |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 93 | #define ifr_name ifr_ifrn.ifrn_name |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 94 | #endif |
| 95 | |
Ben Chan | bbd500d | 2014-06-30 22:13:17 -0700 | [diff] [blame] | 96 | #endif /* __GDM72XX_WM_IOCTL_H__ */ |