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
51 #define LEGACY_RFKILL_SUPPORT
53 * header file for ST provided by KIM
57 struct platform_device *kim_pdev;
58 struct completion kim_rcvd, ldisc_installed;
59 /* MAX len of the .bts firmware script name */
61 const struct firmware *fw_entry;
63 struct kobject *kim_kobj;
64 /* used by kim_int_recv to validate fw response */
65 unsigned long rx_state;
66 unsigned long rx_count;
67 struct sk_buff *rx_skb;
68 #ifdef LEGACY_RFKILL_SUPPORT
69 struct rfkill *rfkill[ST_MAX];
70 enum proto_type rf_protos[ST_MAX];
72 struct st_data_s *core_data;
75 long st_kim_start(void);
76 long st_kim_stop(void);
78 * called from st_tty_receive to authenticate fw_download
80 void st_kim_recv(void *, const unsigned char *, long count);
82 void st_kim_chip_toggle(enum proto_type, enum kim_gpio_state);
84 void st_kim_complete(void);
86 /* function called from ST KIM to ST Core, to
87 * list out the protocols registered
89 void kim_st_list_protocols(struct st_data_s *, char *);
94 #define ACTION_SEND_COMMAND 1
95 #define ACTION_WAIT_EVENT 2
96 #define ACTION_SERIAL 3
97 #define ACTION_DELAY 4
98 #define ACTION_RUN_SCRIPT 5
99 #define ACTION_REMARKS 6
102 * * BRF Firmware header
109 } __attribute__ ((packed));
112 * * BRF Actions structure
118 } __attribute__ ((packed));
120 struct bts_action_send {
122 } __attribute__ ((packed));
124 struct bts_action_wait {
128 } __attribute__ ((packed));
130 struct bts_action_delay {
132 } __attribute__ ((packed));
134 struct bts_action_serial {
136 uint32_t flow_control;
137 } __attribute__ ((packed));
139 /* for identifying the change speed HCI VS
147 } __attribute__ ((packed));
150 #endif /* ST_KIM_H */