2 * Shared Transport Line discipline driver Core
3 * Init Manager Module header file
4 * Copyright (C) 2009 Texas Instruments
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <linux/types.h>
28 #include <linux/rfkill.h>
30 /* time in msec to wait for
31 * line discipline to be installed
33 #define LDISC_TIME 500
34 #define CMD_RESP_TIME 500
35 #define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \
36 | ((unsigned short)((unsigned char)(b))) << 8))
41 /* the Power-On-Reset logic, requires to attempt
42 * to download firmware onto chip more than once
43 * since the self-test for chip takes a while
45 #define POR_RETRY_COUNT 5
47 * legacy rfkill support where-in 3 rfkill
48 * devices are created for the 3 gpios
49 * that ST has requested
52 /* chip version storage
57 unsigned short min_ver;
58 unsigned short maj_ver;
62 * header file for ST provided by KIM
66 struct platform_device *kim_pdev;
67 struct completion kim_rcvd, ldisc_installed;
68 /* MAX len of the .bts firmware script name */
70 const struct firmware *fw_entry;
72 /* used by kim_int_recv to validate fw response */
73 unsigned long rx_state;
74 unsigned long rx_count;
75 struct sk_buff *rx_skb;
76 struct rfkill *rfkill[ST_MAX];
77 enum proto_type rf_protos[ST_MAX];
78 struct st_data_s *core_data;
79 struct chip_version version;
82 long st_kim_start(void *);
83 long st_kim_stop(void *);
85 * called from st_tty_receive to authenticate fw_download
87 void st_kim_recv(void *, const unsigned char *, long count);
89 void st_kim_chip_toggle(enum proto_type, enum kim_gpio_state);
91 void st_kim_complete(void *);
93 /* function called from ST KIM to ST Core, to
94 * list out the protocols registered
96 void kim_st_list_protocols(struct st_data_s *, char *);
101 #define ACTION_SEND_COMMAND 1
102 #define ACTION_WAIT_EVENT 2
103 #define ACTION_SERIAL 3
104 #define ACTION_DELAY 4
105 #define ACTION_RUN_SCRIPT 5
106 #define ACTION_REMARKS 6
109 * * BRF Firmware header
116 } __attribute__ ((packed));
119 * * BRF Actions structure
125 } __attribute__ ((packed));
127 struct bts_action_send {
129 } __attribute__ ((packed));
131 struct bts_action_wait {
135 } __attribute__ ((packed));
137 struct bts_action_delay {
139 } __attribute__ ((packed));
141 struct bts_action_serial {
143 uint32_t flow_control;
144 } __attribute__ ((packed));
146 /* for identifying the change speed HCI VS
154 } __attribute__ ((packed));
157 #endif /* ST_KIM_H */