aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-10-28 12:44:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-28 12:44:56 -0400
commite4c5bf8e3dca827a1b3a6fac494eae8c74b7e1e7 (patch)
treeea51b391f7d74ca695dcb9f5e46eb02688a92ed9 /include
parent81280572ca6f54009edfa4deee563e8678784218 (diff)
parenta4ac0d847af9dd34d5953a5e264400326144b6b2 (diff)
Merge 'staging-next' to Linus's tree
This merges the staging-next tree to Linus's tree and resolves some conflicts that were present due to changes in other trees that were affected by files here. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/smb.h118
-rw-r--r--include/linux/smb_fs.h153
-rw-r--r--include/linux/smb_fs_i.h37
-rw-r--r--include/linux/smb_fs_sb.h100
-rw-r--r--include/linux/smb_mount.h65
-rw-r--r--include/linux/smbno.h363
-rw-r--r--include/linux/ti_wilink_st.h400
-rw-r--r--include/linux/tty.h1
9 files changed, 401 insertions, 840 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 831c4634162..9c1683e473c 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -326,10 +326,6 @@ header-y += serio.h
326header-y += shm.h 326header-y += shm.h
327header-y += signal.h 327header-y += signal.h
328header-y += signalfd.h 328header-y += signalfd.h
329header-y += smb.h
330header-y += smb_fs.h
331header-y += smb_mount.h
332header-y += smbno.h
333header-y += snmp.h 329header-y += snmp.h
334header-y += socket.h 330header-y += socket.h
335header-y += sockios.h 331header-y += sockios.h
diff --git a/include/linux/smb.h b/include/linux/smb.h
deleted file mode 100644
index 82fefddc598..00000000000
--- a/include/linux/smb.h
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * smb.h
3 *
4 * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_H
10#define _LINUX_SMB_H
11
12#include <linux/types.h>
13#include <linux/magic.h>
14#ifdef __KERNEL__
15#include <linux/time.h>
16#endif
17
18enum smb_protocol {
19 SMB_PROTOCOL_NONE,
20 SMB_PROTOCOL_CORE,
21 SMB_PROTOCOL_COREPLUS,
22 SMB_PROTOCOL_LANMAN1,
23 SMB_PROTOCOL_LANMAN2,
24 SMB_PROTOCOL_NT1
25};
26
27enum smb_case_hndl {
28 SMB_CASE_DEFAULT,
29 SMB_CASE_LOWER,
30 SMB_CASE_UPPER
31};
32
33struct smb_dskattr {
34 __u16 total;
35 __u16 allocblocks;
36 __u16 blocksize;
37 __u16 free;
38};
39
40struct smb_conn_opt {
41
42 /* The socket */
43 unsigned int fd;
44
45 enum smb_protocol protocol;
46 enum smb_case_hndl case_handling;
47
48 /* Connection-Options */
49
50 __u32 max_xmit;
51 __u16 server_uid;
52 __u16 tid;
53
54 /* The following are LANMAN 1.0 options */
55 __u16 secmode;
56 __u16 maxmux;
57 __u16 maxvcs;
58 __u16 rawmode;
59 __u32 sesskey;
60
61 /* The following are NT LM 0.12 options */
62 __u32 maxraw;
63 __u32 capabilities;
64 __s16 serverzone;
65};
66
67#ifdef __KERNEL__
68
69#define SMB_NLS_MAXNAMELEN 20
70struct smb_nls_codepage {
71 char local_name[SMB_NLS_MAXNAMELEN];
72 char remote_name[SMB_NLS_MAXNAMELEN];
73};
74
75
76#define SMB_MAXNAMELEN 255
77#define SMB_MAXPATHLEN 1024
78
79/*
80 * Contains all relevant data on a SMB networked file.
81 */
82struct smb_fattr {
83 __u16 attr;
84
85 unsigned long f_ino;
86 umode_t f_mode;
87 nlink_t f_nlink;
88 uid_t f_uid;
89 gid_t f_gid;
90 dev_t f_rdev;
91 loff_t f_size;
92 struct timespec f_atime;
93 struct timespec f_mtime;
94 struct timespec f_ctime;
95 unsigned long f_blocks;
96 int f_unix;
97};
98
99enum smb_conn_state {
100 CONN_VALID, /* everything's fine */
101 CONN_INVALID, /* Something went wrong, but did not
102 try to reconnect yet. */
103 CONN_RETRIED, /* Tried a reconnection, but was refused */
104 CONN_RETRYING /* Currently trying to reconnect */
105};
106
107#define SMB_HEADER_LEN 37 /* includes everything up to, but not
108 * including smb_bcc */
109
110#define SMB_INITIAL_PACKET_SIZE 4000
111#define SMB_MAX_PACKET_SIZE 32768
112
113/* reserve this much space for trans2 parameters. Shouldn't have to be more
114 than 10 or so, but OS/2 seems happier like this. */
115#define SMB_TRANS2_MAX_PARAM 64
116
117#endif
118#endif
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
deleted file mode 100644
index 923cd8a247b..00000000000
--- a/include/linux/smb_fs.h
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * smb_fs.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_FS_H
10#define _LINUX_SMB_FS_H
11
12#include <linux/smb.h>
13
14/*
15 * ioctl commands
16 */
17#define SMB_IOC_GETMOUNTUID _IOR('u', 1, __kernel_old_uid_t)
18#define SMB_IOC_NEWCONN _IOW('u', 2, struct smb_conn_opt)
19
20/* __kernel_uid_t can never change, so we have to use __kernel_uid32_t */
21#define SMB_IOC_GETMOUNTUID32 _IOR('u', 3, __kernel_uid32_t)
22
23
24#ifdef __KERNEL__
25#include <linux/smb_fs_i.h>
26#include <linux/smb_fs_sb.h>
27
28#include <linux/fs.h>
29#include <linux/pagemap.h>
30#include <linux/vmalloc.h>
31#include <linux/smb_mount.h>
32#include <linux/jiffies.h>
33#include <asm/unaligned.h>
34
35static inline struct smb_sb_info *SMB_SB(struct super_block *sb)
36{
37 return sb->s_fs_info;
38}
39
40static inline struct smb_inode_info *SMB_I(struct inode *inode)
41{
42 return container_of(inode, struct smb_inode_info, vfs_inode);
43}
44
45/* macro names are short for word, double-word, long value (?) */
46#define WVAL(buf, pos) (get_unaligned_le16((u8 *)(buf) + (pos)))
47#define DVAL(buf, pos) (get_unaligned_le32((u8 *)(buf) + (pos)))
48#define LVAL(buf, pos) (get_unaligned_le64((u8 *)(buf) + (pos)))
49
50#define WSET(buf, pos, val) put_unaligned_le16((val), (u8 *)(buf) + (pos))
51#define DSET(buf, pos, val) put_unaligned_le32((val), (u8 *)(buf) + (pos))
52#define LSET(buf, pos, val) put_unaligned_le64((val), (u8 *)(buf) + (pos))
53
54/* where to find the base of the SMB packet proper */
55#define smb_base(buf) ((u8 *)(((u8 *)(buf))+4))
56
57/*
58 * Flags for the in-memory inode
59 */
60#define SMB_F_LOCALWRITE 0x02 /* file modified locally */
61
62
63/* NT1 protocol capability bits */
64#define SMB_CAP_RAW_MODE 0x00000001
65#define SMB_CAP_MPX_MODE 0x00000002
66#define SMB_CAP_UNICODE 0x00000004
67#define SMB_CAP_LARGE_FILES 0x00000008
68#define SMB_CAP_NT_SMBS 0x00000010
69#define SMB_CAP_RPC_REMOTE_APIS 0x00000020
70#define SMB_CAP_STATUS32 0x00000040
71#define SMB_CAP_LEVEL_II_OPLOCKS 0x00000080
72#define SMB_CAP_LOCK_AND_READ 0x00000100
73#define SMB_CAP_NT_FIND 0x00000200
74#define SMB_CAP_DFS 0x00001000
75#define SMB_CAP_LARGE_READX 0x00004000
76#define SMB_CAP_LARGE_WRITEX 0x00008000
77#define SMB_CAP_UNIX 0x00800000 /* unofficial ... */
78
79
80/*
81 * This is the time we allow an inode, dentry or dir cache to live. It is bad
82 * for performance to have shorter ttl on an inode than on the cache. It can
83 * cause refresh on each inode for a dir listing ... one-by-one
84 */
85#define SMB_MAX_AGE(server) (((server)->mnt->ttl * HZ) / 1000)
86
87static inline void
88smb_age_dentry(struct smb_sb_info *server, struct dentry *dentry)
89{
90 dentry->d_time = jiffies - SMB_MAX_AGE(server);
91}
92
93struct smb_cache_head {
94 time_t mtime; /* unused */
95 unsigned long time; /* cache age */
96 unsigned long end; /* last valid fpos in cache */
97 int eof;
98};
99
100#define SMB_DIRCACHE_SIZE ((int)(PAGE_CACHE_SIZE/sizeof(struct dentry *)))
101union smb_dir_cache {
102 struct smb_cache_head head;
103 struct dentry *dentry[SMB_DIRCACHE_SIZE];
104};
105
106#define SMB_FIRSTCACHE_SIZE ((int)((SMB_DIRCACHE_SIZE * \
107 sizeof(struct dentry *) - sizeof(struct smb_cache_head)) / \
108 sizeof(struct dentry *)))
109
110#define SMB_DIRCACHE_START (SMB_DIRCACHE_SIZE - SMB_FIRSTCACHE_SIZE)
111
112struct smb_cache_control {
113 struct smb_cache_head head;
114 struct page *page;
115 union smb_dir_cache *cache;
116 unsigned long fpos, ofs;
117 int filled, valid, idx;
118};
119
120#define SMB_OPS_NUM_STATIC 5
121struct smb_ops {
122 int (*read)(struct inode *inode, loff_t offset, int count,
123 char *data);
124 int (*write)(struct inode *inode, loff_t offset, int count, const
125 char *data);
126 int (*readdir)(struct file *filp, void *dirent, filldir_t filldir,
127 struct smb_cache_control *ctl);
128
129 int (*getattr)(struct smb_sb_info *server, struct dentry *dir,
130 struct smb_fattr *fattr);
131 /* int (*setattr)(...); */ /* setattr is really icky! */
132
133 int (*truncate)(struct inode *inode, loff_t length);
134
135
136 /* --- --- --- end of "static" entries --- --- --- */
137
138 int (*convert)(unsigned char *output, int olen,
139 const unsigned char *input, int ilen,
140 struct nls_table *nls_from,
141 struct nls_table *nls_to);
142};
143
144static inline int
145smb_is_open(struct inode *i)
146{
147 return (SMB_I(i)->open == server_from_inode(i)->generation);
148}
149
150extern void smb_install_null_ops(struct smb_ops *);
151#endif /* __KERNEL__ */
152
153#endif /* _LINUX_SMB_FS_H */
diff --git a/include/linux/smb_fs_i.h b/include/linux/smb_fs_i.h
deleted file mode 100644
index 8ccf4eca2c3..00000000000
--- a/include/linux/smb_fs_i.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * smb_fs_i.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_FS_I
10#define _LINUX_SMB_FS_I
11
12#include <linux/types.h>
13#include <linux/fs.h>
14
15/*
16 * smb fs inode data (in memory only)
17 */
18struct smb_inode_info {
19
20 /*
21 * file handles are local to a connection. A file is open if
22 * (open == generation).
23 */
24 unsigned int open; /* open generation */
25 __u16 fileid; /* What id to handle a file with? */
26 __u16 attr; /* Attribute fields, DOS value */
27
28 __u16 access; /* Access mode */
29 __u16 flags;
30 unsigned long oldmtime; /* last time refreshed */
31 unsigned long closed; /* timestamp when closed */
32 unsigned openers; /* number of fileid users */
33
34 struct inode vfs_inode; /* must be at the end */
35};
36
37#endif
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
deleted file mode 100644
index bb947dd1fba..00000000000
--- a/include/linux/smb_fs_sb.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * smb_fs_sb.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _SMB_FS_SB
10#define _SMB_FS_SB
11
12#include <linux/types.h>
13#include <linux/backing-dev.h>
14#include <linux/smb.h>
15
16/*
17 * Upper limit on the total number of active smb_request structs.
18 */
19#define MAX_REQUEST_HARD 256
20
21enum smb_receive_state {
22 SMB_RECV_START, /* No data read, looking for length + sig */
23 SMB_RECV_HEADER, /* Reading the header data */
24 SMB_RECV_HCOMPLETE, /* Done with the header */
25 SMB_RECV_PARAM, /* Reading parameter words */
26 SMB_RECV_DATA, /* Reading data bytes */
27 SMB_RECV_END, /* End of request */
28 SMB_RECV_DROP, /* Dropping this SMB */
29 SMB_RECV_REQUEST, /* Received a request and not a reply */
30};
31
32/* structure access macros */
33#define server_from_inode(inode) SMB_SB((inode)->i_sb)
34#define server_from_dentry(dentry) SMB_SB((dentry)->d_sb)
35#define SB_of(server) ((server)->super_block)
36
37struct smb_sb_info {
38 /* List of all smbfs superblocks */
39 struct list_head entry;
40
41 enum smb_conn_state state;
42 struct file * sock_file;
43 int conn_error;
44 enum smb_receive_state rstate;
45
46 atomic_t nr_requests;
47 struct list_head xmitq;
48 struct list_head recvq;
49 u16 mid;
50
51 struct smb_mount_data_kernel *mnt;
52
53 /* Connections are counted. Each time a new socket arrives,
54 * generation is incremented.
55 */
56 unsigned int generation;
57 struct pid *conn_pid;
58 struct smb_conn_opt opt;
59 wait_queue_head_t conn_wq;
60 int conn_complete;
61 struct semaphore sem;
62
63 unsigned char header[SMB_HEADER_LEN + 20*2 + 2];
64 u32 header_len;
65 u32 smb_len;
66 u32 smb_read;
67
68 /* We use our own data_ready callback, but need the original one */
69 void *data_ready;
70
71 /* nls pointers for codepage conversions */
72 struct nls_table *remote_nls;
73 struct nls_table *local_nls;
74
75 struct smb_ops *ops;
76
77 struct super_block *super_block;
78
79 struct backing_dev_info bdi;
80};
81
82static inline int
83smb_lock_server_interruptible(struct smb_sb_info *server)
84{
85 return down_interruptible(&(server->sem));
86}
87
88static inline void
89smb_lock_server(struct smb_sb_info *server)
90{
91 down(&(server->sem));
92}
93
94static inline void
95smb_unlock_server(struct smb_sb_info *server)
96{
97 up(&(server->sem));
98}
99
100#endif
diff --git a/include/linux/smb_mount.h b/include/linux/smb_mount.h
deleted file mode 100644
index d10f00cb570..00000000000
--- a/include/linux/smb_mount.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * smb_mount.h
3 *
4 * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_MOUNT_H
10#define _LINUX_SMB_MOUNT_H
11
12#include <linux/types.h>
13
14#define SMB_MOUNT_VERSION 6
15
16struct smb_mount_data {
17 int version;
18 __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
19 __kernel_uid_t uid;
20 __kernel_gid_t gid;
21 __kernel_mode_t file_mode;
22 __kernel_mode_t dir_mode;
23};
24
25
26#ifdef __KERNEL__
27
28/* "vers" in big-endian */
29#define SMB_MOUNT_ASCII 0x76657273
30
31#define SMB_MOUNT_OLDVERSION 6
32#undef SMB_MOUNT_VERSION
33#define SMB_MOUNT_VERSION 7
34
35/* flags */
36#define SMB_MOUNT_WIN95 0x0001 /* Win 95 server */
37#define SMB_MOUNT_OLDATTR 0x0002 /* Use core getattr (Win 95 speedup) */
38#define SMB_MOUNT_DIRATTR 0x0004 /* Use find_first for getattr */
39#define SMB_MOUNT_CASE 0x0008 /* Be case sensitive */
40#define SMB_MOUNT_UNICODE 0x0010 /* Server talks unicode */
41#define SMB_MOUNT_UID 0x0020 /* Use user specified uid */
42#define SMB_MOUNT_GID 0x0040 /* Use user specified gid */
43#define SMB_MOUNT_FMODE 0x0080 /* Use user specified file mode */
44#define SMB_MOUNT_DMODE 0x0100 /* Use user specified dir mode */
45
46struct smb_mount_data_kernel {
47 int version;
48
49 uid_t mounted_uid; /* Who may umount() this filesystem? */
50 uid_t uid;
51 gid_t gid;
52 mode_t file_mode;
53 mode_t dir_mode;
54
55 u32 flags;
56
57 /* maximum age in jiffies (inode, dentry and dircache) */
58 int ttl;
59
60 struct smb_nls_codepage codepage;
61};
62
63#endif
64
65#endif
diff --git a/include/linux/smbno.h b/include/linux/smbno.h
deleted file mode 100644
index f99e02d9ffe..00000000000
--- a/include/linux/smbno.h
+++ /dev/null
@@ -1,363 +0,0 @@
1#ifndef _SMBNO_H_
2#define _SMBNO_H_
3
4/* these define the attribute byte as seen by DOS */
5#define aRONLY (1L<<0)
6#define aHIDDEN (1L<<1)
7#define aSYSTEM (1L<<2)
8#define aVOLID (1L<<3)
9#define aDIR (1L<<4)
10#define aARCH (1L<<5)
11
12/* error classes */
13#define SUCCESS 0 /* The request was successful. */
14#define ERRDOS 0x01 /* Error is from the core DOS operating system set. */
15#define ERRSRV 0x02 /* Error is generated by the server network file manager.*/
16#define ERRHRD 0x03 /* Error is an hardware error. */
17#define ERRCMD 0xFF /* Command was not in the "SMB" format. */
18
19/* SMB X/Open error codes for the ERRdos error class */
20
21#define ERRbadfunc 1 /* Invalid function (or system call) */
22#define ERRbadfile 2 /* File not found (pathname error) */
23#define ERRbadpath 3 /* Directory not found */
24#define ERRnofids 4 /* Too many open files */
25#define ERRnoaccess 5 /* Access denied */
26#define ERRbadfid 6 /* Invalid fid */
27#define ERRbadmcb 7 /* Memory control blocks destroyed */
28#define ERRnomem 8 /* Out of memory */
29#define ERRbadmem 9 /* Invalid memory block address */
30#define ERRbadenv 10 /* Invalid environment */
31#define ERRbadformat 11 /* Invalid format */
32#define ERRbadaccess 12 /* Invalid open mode */
33#define ERRbaddata 13 /* Invalid data (only from ioctl call) */
34#define ERRres 14 /* reserved */
35#define ERRbaddrive 15 /* Invalid drive */
36#define ERRremcd 16 /* Attempt to delete current directory */
37#define ERRdiffdevice 17 /* rename/move across different filesystems */
38#define ERRnofiles 18 /* no more files found in file search */
39#define ERRbadshare 32 /* Share mode on file conflict with open mode */
40#define ERRlock 33 /* Lock request conflicts with existing lock */
41#define ERRfilexists 80 /* File in operation already exists */
42#define ERRbadpipe 230 /* Named pipe invalid */
43#define ERRpipebusy 231 /* All instances of pipe are busy */
44#define ERRpipeclosing 232 /* named pipe close in progress */
45#define ERRnotconnected 233 /* No process on other end of named pipe */
46#define ERRmoredata 234 /* More data to be returned */
47
48#define ERROR_INVALID_PARAMETER 87
49#define ERROR_DISK_FULL 112
50#define ERROR_INVALID_NAME 123
51#define ERROR_DIR_NOT_EMPTY 145
52#define ERROR_NOT_LOCKED 158
53#define ERROR_ALREADY_EXISTS 183 /* see also 80 ? */
54#define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */
55#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */
56
57/* Error codes for the ERRSRV class */
58
59#define ERRerror 1 /* Non specific error code */
60#define ERRbadpw 2 /* Bad password */
61#define ERRbadtype 3 /* reserved */
62#define ERRaccess 4 /* No permissions to do the requested operation */
63#define ERRinvnid 5 /* tid invalid */
64#define ERRinvnetname 6 /* Invalid servername */
65#define ERRinvdevice 7 /* Invalid device */
66#define ERRqfull 49 /* Print queue full */
67#define ERRqtoobig 50 /* Queued item too big */
68#define ERRinvpfid 52 /* Invalid print file in smb_fid */
69#define ERRsmbcmd 64 /* Unrecognised command */
70#define ERRsrverror 65 /* smb server internal error */
71#define ERRfilespecs 67 /* fid and pathname invalid combination */
72#define ERRbadlink 68 /* reserved */
73#define ERRbadpermits 69 /* Access specified for a file is not valid */
74#define ERRbadpid 70 /* reserved */
75#define ERRsetattrmode 71 /* attribute mode invalid */
76#define ERRpaused 81 /* Message server paused */
77#define ERRmsgoff 82 /* Not receiving messages */
78#define ERRnoroom 83 /* No room for message */
79#define ERRrmuns 87 /* too many remote usernames */
80#define ERRtimeout 88 /* operation timed out */
81#define ERRnoresource 89 /* No resources currently available for request. */
82#define ERRtoomanyuids 90 /* too many userids */
83#define ERRbaduid 91 /* bad userid */
84#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
85#define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */
86#define ERRcontMPX 252 /* resume MPX mode */
87#define ERRbadPW /* reserved */
88#define ERRnosupport 0xFFFF
89
90/* Error codes for the ERRHRD class */
91
92#define ERRnowrite 19 /* read only media */
93#define ERRbadunit 20 /* Unknown device */
94#define ERRnotready 21 /* Drive not ready */
95#define ERRbadcmd 22 /* Unknown command */
96#define ERRdata 23 /* Data (CRC) error */
97#define ERRbadreq 24 /* Bad request structure length */
98#define ERRseek 25
99#define ERRbadmedia 26
100#define ERRbadsector 27
101#define ERRnopaper 28
102#define ERRwrite 29 /* write fault */
103#define ERRread 30 /* read fault */
104#define ERRgeneral 31 /* General hardware failure */
105#define ERRwrongdisk 34
106#define ERRFCBunavail 35
107#define ERRsharebufexc 36 /* share buffer exceeded */
108#define ERRdiskfull 39
109
110/*
111 * Access modes when opening a file
112 */
113#define SMB_ACCMASK 0x0003
114#define SMB_O_RDONLY 0x0000
115#define SMB_O_WRONLY 0x0001
116#define SMB_O_RDWR 0x0002
117
118/* offsets into message for common items */
119#define smb_com 8
120#define smb_rcls 9
121#define smb_reh 10
122#define smb_err 11
123#define smb_flg 13
124#define smb_flg2 14
125#define smb_reb 13
126#define smb_tid 28
127#define smb_pid 30
128#define smb_uid 32
129#define smb_mid 34
130#define smb_wct 36
131#define smb_vwv 37
132#define smb_vwv0 37
133#define smb_vwv1 39
134#define smb_vwv2 41
135#define smb_vwv3 43
136#define smb_vwv4 45
137#define smb_vwv5 47
138#define smb_vwv6 49
139#define smb_vwv7 51
140#define smb_vwv8 53
141#define smb_vwv9 55
142#define smb_vwv10 57
143#define smb_vwv11 59
144#define smb_vwv12 61
145#define smb_vwv13 63
146#define smb_vwv14 65
147
148/* these are the trans2 sub fields for primary requests */
149#define smb_tpscnt smb_vwv0
150#define smb_tdscnt smb_vwv1
151#define smb_mprcnt smb_vwv2
152#define smb_mdrcnt smb_vwv3
153#define smb_msrcnt smb_vwv4
154#define smb_flags smb_vwv5
155#define smb_timeout smb_vwv6
156#define smb_pscnt smb_vwv9
157#define smb_psoff smb_vwv10
158#define smb_dscnt smb_vwv11
159#define smb_dsoff smb_vwv12
160#define smb_suwcnt smb_vwv13
161#define smb_setup smb_vwv14
162#define smb_setup0 smb_setup
163#define smb_setup1 (smb_setup+2)
164#define smb_setup2 (smb_setup+4)
165
166/* these are for the secondary requests */
167#define smb_spscnt smb_vwv2
168#define smb_spsoff smb_vwv3
169#define smb_spsdisp smb_vwv4
170#define smb_sdscnt smb_vwv5
171#define smb_sdsoff smb_vwv6
172#define smb_sdsdisp smb_vwv7
173#define smb_sfid smb_vwv8
174
175/* and these for responses */
176#define smb_tprcnt smb_vwv0
177#define smb_tdrcnt smb_vwv1
178#define smb_prcnt smb_vwv3
179#define smb_proff smb_vwv4
180#define smb_prdisp smb_vwv5
181#define smb_drcnt smb_vwv6
182#define smb_droff smb_vwv7
183#define smb_drdisp smb_vwv8
184
185/* the complete */
186#define SMBmkdir 0x00 /* create directory */
187#define SMBrmdir 0x01 /* delete directory */
188#define SMBopen 0x02 /* open file */
189#define SMBcreate 0x03 /* create file */
190#define SMBclose 0x04 /* close file */
191#define SMBflush 0x05 /* flush file */
192#define SMBunlink 0x06 /* delete file */
193#define SMBmv 0x07 /* rename file */
194#define SMBgetatr 0x08 /* get file attributes */
195#define SMBsetatr 0x09 /* set file attributes */
196#define SMBread 0x0A /* read from file */
197#define SMBwrite 0x0B /* write to file */
198#define SMBlock 0x0C /* lock byte range */
199#define SMBunlock 0x0D /* unlock byte range */
200#define SMBctemp 0x0E /* create temporary file */
201#define SMBmknew 0x0F /* make new file */
202#define SMBchkpth 0x10 /* check directory path */
203#define SMBexit 0x11 /* process exit */
204#define SMBlseek 0x12 /* seek */
205#define SMBtcon 0x70 /* tree connect */
206#define SMBtconX 0x75 /* tree connect and X*/
207#define SMBtdis 0x71 /* tree disconnect */
208#define SMBnegprot 0x72 /* negotiate protocol */
209#define SMBdskattr 0x80 /* get disk attributes */
210#define SMBsearch 0x81 /* search directory */
211#define SMBsplopen 0xC0 /* open print spool file */
212#define SMBsplwr 0xC1 /* write to print spool file */
213#define SMBsplclose 0xC2 /* close print spool file */
214#define SMBsplretq 0xC3 /* return print queue */
215#define SMBsends 0xD0 /* send single block message */
216#define SMBsendb 0xD1 /* send broadcast message */
217#define SMBfwdname 0xD2 /* forward user name */
218#define SMBcancelf 0xD3 /* cancel forward */
219#define SMBgetmac 0xD4 /* get machine name */
220#define SMBsendstrt 0xD5 /* send start of multi-block message */
221#define SMBsendend 0xD6 /* send end of multi-block message */
222#define SMBsendtxt 0xD7 /* send text of multi-block message */
223
224/* Core+ protocol */
225#define SMBlockread 0x13 /* Lock a range and read */
226#define SMBwriteunlock 0x14 /* Unlock a range then write */
227#define SMBreadbraw 0x1a /* read a block of data with no smb header */
228#define SMBwritebraw 0x1d /* write a block of data with no smb header */
229#define SMBwritec 0x20 /* secondary write request */
230#define SMBwriteclose 0x2c /* write a file then close it */
231
232/* dos extended protocol */
233#define SMBreadBraw 0x1A /* read block raw */
234#define SMBreadBmpx 0x1B /* read block multiplexed */
235#define SMBreadBs 0x1C /* read block (secondary response) */
236#define SMBwriteBraw 0x1D /* write block raw */
237#define SMBwriteBmpx 0x1E /* write block multiplexed */
238#define SMBwriteBs 0x1F /* write block (secondary request) */
239#define SMBwriteC 0x20 /* write complete response */
240#define SMBsetattrE 0x22 /* set file attributes expanded */
241#define SMBgetattrE 0x23 /* get file attributes expanded */
242#define SMBlockingX 0x24 /* lock/unlock byte ranges and X */
243#define SMBtrans 0x25 /* transaction - name, bytes in/out */
244#define SMBtranss 0x26 /* transaction (secondary request/response) */
245#define SMBioctl 0x27 /* IOCTL */
246#define SMBioctls 0x28 /* IOCTL (secondary request/response) */
247#define SMBcopy 0x29 /* copy */
248#define SMBmove 0x2A /* move */
249#define SMBecho 0x2B /* echo */
250#define SMBopenX 0x2D /* open and X */
251#define SMBreadX 0x2E /* read and X */
252#define SMBwriteX 0x2F /* write and X */
253#define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */
254#define SMBtconX 0x75 /* tree connect and X */
255#define SMBffirst 0x82 /* find first */
256#define SMBfunique 0x83 /* find unique */
257#define SMBfclose 0x84 /* find close */
258#define SMBinvalid 0xFE /* invalid command */
259
260
261/* Extended 2.0 protocol */
262#define SMBtrans2 0x32 /* TRANS2 protocol set */
263#define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */
264#define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */
265#define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */
266#define SMBulogoffX 0x74 /* user logoff */
267
268/* these are the TRANS2 sub commands */
269#define TRANSACT2_OPEN 0
270#define TRANSACT2_FINDFIRST 1
271#define TRANSACT2_FINDNEXT 2
272#define TRANSACT2_QFSINFO 3
273#define TRANSACT2_SETFSINFO 4
274#define TRANSACT2_QPATHINFO 5
275#define TRANSACT2_SETPATHINFO 6
276#define TRANSACT2_QFILEINFO 7
277#define TRANSACT2_SETFILEINFO 8
278#define TRANSACT2_FSCTL 9
279#define TRANSACT2_IOCTL 10
280#define TRANSACT2_FINDNOTIFYFIRST 11
281#define TRANSACT2_FINDNOTIFYNEXT 12
282#define TRANSACT2_MKDIR 13
283
284/* Information Levels - Shared? */
285#define SMB_INFO_STANDARD 1
286#define SMB_INFO_QUERY_EA_SIZE 2
287#define SMB_INFO_QUERY_EAS_FROM_LIST 3
288#define SMB_INFO_QUERY_ALL_EAS 4
289#define SMB_INFO_IS_NAME_VALID 6
290
291/* Information Levels - TRANSACT2_FINDFIRST */
292#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
293#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
294#define SMB_FIND_FILE_NAMES_INFO 0x103
295#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
296
297/* Information Levels - TRANSACT2_QPATHINFO */
298#define SMB_QUERY_FILE_BASIC_INFO 0x101
299#define SMB_QUERY_FILE_STANDARD_INFO 0x102
300#define SMB_QUERY_FILE_EA_INFO 0x103
301#define SMB_QUERY_FILE_NAME_INFO 0x104
302#define SMB_QUERY_FILE_ALL_INFO 0x107
303#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
304#define SMB_QUERY_FILE_STREAM_INFO 0x109
305#define SMB_QUERY_FILE_COMPRESSION_INFO 0x10b
306
307/* Information Levels - TRANSACT2_SETFILEINFO */
308#define SMB_SET_FILE_BASIC_INFO 0x101
309#define SMB_SET_FILE_DISPOSITION_INFO 0x102
310#define SMB_SET_FILE_ALLOCATION_INFO 0x103
311#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
312
313/* smb_flg field flags */
314#define SMB_FLAGS_SUPPORT_LOCKREAD 0x01
315#define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02
316#define SMB_FLAGS_RESERVED 0x04
317#define SMB_FLAGS_CASELESS_PATHNAMES 0x08
318#define SMB_FLAGS_CANONICAL_PATHNAMES 0x10
319#define SMB_FLAGS_REQUEST_OPLOCK 0x20
320#define SMB_FLAGS_REQUEST_BATCH_OPLOCK 0x40
321#define SMB_FLAGS_REPLY 0x80
322
323/* smb_flg2 field flags (samba-2.2.0/source/include/smb.h) */
324#define SMB_FLAGS2_LONG_PATH_COMPONENTS 0x0001
325#define SMB_FLAGS2_EXTENDED_ATTRIBUTES 0x0002
326#define SMB_FLAGS2_DFS_PATHNAMES 0x1000
327#define SMB_FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000
328#define SMB_FLAGS2_32_BIT_ERROR_CODES 0x4000
329#define SMB_FLAGS2_UNICODE_STRINGS 0x8000
330
331
332/*
333 * UNIX stuff (from samba trans2.h)
334 */
335#define MIN_UNIX_INFO_LEVEL 0x200
336#define MAX_UNIX_INFO_LEVEL 0x2FF
337#define SMB_FIND_FILE_UNIX 0x202
338#define SMB_QUERY_FILE_UNIX_BASIC 0x200
339#define SMB_QUERY_FILE_UNIX_LINK 0x201
340#define SMB_QUERY_FILE_UNIX_HLINK 0x202
341#define SMB_SET_FILE_UNIX_BASIC 0x200
342#define SMB_SET_FILE_UNIX_LINK 0x201
343#define SMB_SET_FILE_UNIX_HLINK 0x203
344#define SMB_QUERY_CIFS_UNIX_INFO 0x200
345
346/* values which means "don't change it" */
347#define SMB_MODE_NO_CHANGE 0xFFFFFFFF
348#define SMB_UID_NO_CHANGE 0xFFFFFFFF
349#define SMB_GID_NO_CHANGE 0xFFFFFFFF
350#define SMB_TIME_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
351#define SMB_SIZE_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
352
353/* UNIX filetype mappings. */
354#define UNIX_TYPE_FILE 0
355#define UNIX_TYPE_DIR 1
356#define UNIX_TYPE_SYMLINK 2
357#define UNIX_TYPE_CHARDEV 3
358#define UNIX_TYPE_BLKDEV 4
359#define UNIX_TYPE_FIFO 5
360#define UNIX_TYPE_SOCKET 6
361#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
362
363#endif /* _SMBNO_H_ */
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
new file mode 100644
index 00000000000..4c7be226301
--- /dev/null
+++ b/include/linux/ti_wilink_st.h
@@ -0,0 +1,400 @@
1/*
2 * Shared Transport Header file
3 * To be included by the protocol stack drivers for
4 * Texas Instruments BT,FM and GPS combo chip drivers
5 * and also serves the sub-modules of the shared transport driver.
6 *
7 * Copyright (C) 2009-2010 Texas Instruments
8 * Author: Pavan Savoy <pavan_savoy@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#ifndef TI_WILINK_ST_H
26#define TI_WILINK_ST_H
27
28/**
29 * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW
30 * gpio states for their chip/core enable gpios
31 */
32enum kim_gpio_state {
33 KIM_GPIO_INACTIVE,
34 KIM_GPIO_ACTIVE,
35};
36
37/**
38 * enum proto-type - The protocol on WiLink chips which share a
39 * common physical interface like UART.
40 */
41enum proto_type {
42 ST_BT,
43 ST_FM,
44 ST_GPS,
45 ST_MAX,
46};
47
48/**
49 * struct st_proto_s - Per Protocol structure from BT/FM/GPS to ST
50 * @type: type of the protocol being registered among the
51 * available proto_type(BT, FM, GPS the protocol which share TTY).
52 * @recv: the receiver callback pointing to a function in the
53 * protocol drivers called by the ST driver upon receiving
54 * relevant data.
55 * @match_packet: reserved for future use, to make ST more generic
56 * @reg_complete_cb: callback handler pointing to a function in protocol
57 * handler called by ST when the pending registrations are complete.
58 * The registrations are marked pending, in situations when fw
59 * download is in progress.
60 * @write: pointer to function in ST provided to protocol drivers from ST,
61 * to be made use when protocol drivers have data to send to TTY.
62 * @priv_data: privdate data holder for the protocol drivers, sent
63 * from the protocol drivers during registration, and sent back on
64 * reg_complete_cb and recv.
65 */
66struct st_proto_s {
67 enum proto_type type;
68 long (*recv) (void *, struct sk_buff *);
69 unsigned char (*match_packet) (const unsigned char *data);
70 void (*reg_complete_cb) (void *, char data);
71 long (*write) (struct sk_buff *skb);
72 void *priv_data;
73};
74
75extern long st_register(struct st_proto_s *);
76extern long st_unregister(enum proto_type);
77
78
79/*
80 * header information used by st_core.c
81 */
82
83/* states of protocol list */
84#define ST_NOTEMPTY 1
85#define ST_EMPTY 0
86
87/*
88 * possible st_states
89 */
90#define ST_INITIALIZING 1
91#define ST_REG_IN_PROGRESS 2
92#define ST_REG_PENDING 3
93#define ST_WAITING_FOR_RESP 4
94
95/**
96 * struct st_data_s - ST core internal structure
97 * @st_state: different states of ST like initializing, registration
98 * in progress, this is mainly used to return relevant err codes
99 * when protocol drivers are registering. It is also used to track
100 * the recv function, as in during fw download only HCI events
101 * can occur , where as during other times other events CH8, CH9
102 * can occur.
103 * @tty: tty provided by the TTY core for line disciplines.
104 * @tx_skb: If for some reason the tty's write returns lesser bytes written
105 * then to maintain the rest of data to be written on next instance.
106 * This needs to be protected, hence the lock inside wakeup func.
107 * @tx_state: if the data is being written onto the TTY and protocol driver
108 * wants to send more, queue up data and mark that there is
109 * more data to send.
110 * @list: the list of protocols registered, only MAX can exist, one protocol
111 * can register only once.
112 * @rx_state: states to be maintained inside st's tty receive
113 * @rx_count: count to be maintained inside st's tty receieve
114 * @rx_skb: the skb where all data for a protocol gets accumulated,
115 * since tty might not call receive when a complete event packet
116 * is received, the states, count and the skb needs to be maintained.
117 * @txq: the list of skbs which needs to be sent onto the TTY.
118 * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued
119 * up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs
120 * from waitq can be moved onto the txq.
121 * Needs locking too.
122 * @lock: the lock to protect skbs, queues, and ST states.
123 * @protos_registered: count of the protocols registered, also when 0 the
124 * chip enable gpio can be toggled, and when it changes to 1 the fw
125 * needs to be downloaded to initialize chip side ST.
126 * @ll_state: the various PM states the chip can be, the states are notified
127 * to us, when the chip sends relevant PM packets(SLEEP_IND, WAKE_IND).
128 * @kim_data: reference to the parent encapsulating structure.
129 *
130 */
131struct st_data_s {
132 unsigned long st_state;
133 struct tty_struct *tty;
134 struct sk_buff *tx_skb;
135#define ST_TX_SENDING 1
136#define ST_TX_WAKEUP 2
137 unsigned long tx_state;
138 struct st_proto_s *list[ST_MAX];
139 unsigned long rx_state;
140 unsigned long rx_count;
141 struct sk_buff *rx_skb;
142 struct sk_buff_head txq, tx_waitq;
143 spinlock_t lock;
144 unsigned char protos_registered;
145 unsigned long ll_state;
146 void *kim_data;
147};
148
149/**
150 * st_int_write -
151 * point this to tty->driver->write or tty->ops->write
152 * depending upon the kernel version
153 */
154int st_int_write(struct st_data_s*, const unsigned char*, int);
155
156/**
157 * st_write -
158 * internal write function, passed onto protocol drivers
159 * via the write function ptr of protocol struct
160 */
161long st_write(struct sk_buff *);
162
163/* function to be called from ST-LL */
164void st_ll_send_frame(enum proto_type, struct sk_buff *);
165
166/* internal wake up function */
167void st_tx_wakeup(struct st_data_s *st_data);
168
169/* init, exit entry funcs called from KIM */
170int st_core_init(struct st_data_s **);
171void st_core_exit(struct st_data_s *);
172
173/* ask for reference from KIM */
174void st_kim_ref(struct st_data_s **, int);
175
176#define GPS_STUB_TEST
177#ifdef GPS_STUB_TEST
178int gps_chrdrv_stub_write(const unsigned char*, int);
179void gps_chrdrv_stub_init(void);
180#endif
181
182/*
183 * header information used by st_kim.c
184 */
185
186/* time in msec to wait for
187 * line discipline to be installed
188 */
189#define LDISC_TIME 500
190#define CMD_RESP_TIME 500
191#define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \
192 | ((unsigned short)((unsigned char)(b))) << 8))
193
194#define GPIO_HIGH 1
195#define GPIO_LOW 0
196
197/* the Power-On-Reset logic, requires to attempt
198 * to download firmware onto chip more than once
199 * since the self-test for chip takes a while
200 */
201#define POR_RETRY_COUNT 5
202
203/**
204 * struct chip_version - save the chip version
205 */
206struct chip_version {
207 unsigned short full;
208 unsigned short chip;
209 unsigned short min_ver;
210 unsigned short maj_ver;
211};
212
213/**
214 * struct kim_data_s - the KIM internal data, embedded as the
215 * platform's drv data. One for each ST device in the system.
216 * @uim_pid: KIM needs to communicate with UIM to request to install
217 * the ldisc by opening UART when protocol drivers register.
218 * @kim_pdev: the platform device added in one of the board-XX.c file
219 * in arch/XX/ directory, 1 for each ST device.
220 * @kim_rcvd: completion handler to notify when data was received,
221 * mainly used during fw download, which involves multiple send/wait
222 * for each of the HCI-VS commands.
223 * @ldisc_installed: completion handler to notify that the UIM accepted
224 * the request to install ldisc, notify from tty_open which suggests
225 * the ldisc was properly installed.
226 * @resp_buffer: data buffer for the .bts fw file name.
227 * @fw_entry: firmware class struct to request/release the fw.
228 * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores.
229 * @rx_state: the rx state for kim's receive func during fw download.
230 * @rx_count: the rx count for the kim's receive func during fw download.
231 * @rx_skb: all of fw data might not come at once, and hence data storage for
232 * whole of the fw response, only HCI_EVENTs and hence diff from ST's
233 * response.
234 * @rfkill: rfkill data for each of the cores to be registered with rfkill.
235 * @rf_protos: proto types of the data registered with rfkill sub-system.
236 * @core_data: ST core's data, which mainly is the tty's disc_data
237 * @version: chip version available via a sysfs entry.
238 *
239 */
240struct kim_data_s {
241 long uim_pid;
242 struct platform_device *kim_pdev;
243 struct completion kim_rcvd, ldisc_installed;
244 char resp_buffer[30];
245 const struct firmware *fw_entry;
246 long gpios[ST_MAX];
247 unsigned long rx_state;
248 unsigned long rx_count;
249 struct sk_buff *rx_skb;
250 struct rfkill *rfkill[ST_MAX];
251 enum proto_type rf_protos[ST_MAX];
252 struct st_data_s *core_data;
253 struct chip_version version;
254};
255
256/**
257 * functions called when 1 of the protocol drivers gets
258 * registered, these need to communicate with UIM to request
259 * ldisc installed, read chip_version, download relevant fw
260 */
261long st_kim_start(void *);
262long st_kim_stop(void *);
263
264void st_kim_recv(void *, const unsigned char *, long count);
265void st_kim_chip_toggle(enum proto_type, enum kim_gpio_state);
266void st_kim_complete(void *);
267void kim_st_list_protocols(struct st_data_s *, void *);
268
269/*
270 * BTS headers
271 */
272#define ACTION_SEND_COMMAND 1
273#define ACTION_WAIT_EVENT 2
274#define ACTION_SERIAL 3
275#define ACTION_DELAY 4
276#define ACTION_RUN_SCRIPT 5
277#define ACTION_REMARKS 6
278
279/**
280 * struct bts_header - the fw file is NOT binary which can
281 * be sent onto TTY as is. The .bts is more a script
282 * file which has different types of actions.
283 * Each such action needs to be parsed by the KIM and
284 * relevant procedure to be called.
285 */
286struct bts_header {
287 u32 magic;
288 u32 version;
289 u8 future[24];
290 u8 actions[0];
291} __attribute__ ((packed));
292
293/**
294 * struct bts_action - Each .bts action has its own type of
295 * data.
296 */
297struct bts_action {
298 u16 type;
299 u16 size;
300 u8 data[0];
301} __attribute__ ((packed));
302
303struct bts_action_send {
304 u8 data[0];
305} __attribute__ ((packed));
306
307struct bts_action_wait {
308 u32 msec;
309 u32 size;
310 u8 data[0];
311} __attribute__ ((packed));
312
313struct bts_action_delay {
314 u32 msec;
315} __attribute__ ((packed));
316
317struct bts_action_serial {
318 u32 baud;
319 u32 flow_control;
320} __attribute__ ((packed));
321
322/**
323 * struct hci_command - the HCI-VS for intrepreting
324 * the change baud rate of host-side UART, which
325 * needs to be ignored, since UIM would do that
326 * when it receives request from KIM for ldisc installation.
327 */
328struct hci_command {
329 u8 prefix;
330 u16 opcode;
331 u8 plen;
332 u32 speed;
333} __attribute__ ((packed));
334
335/*
336 * header information used by st_ll.c
337 */
338
339/* ST LL receiver states */
340#define ST_W4_PACKET_TYPE 0
341#define ST_BT_W4_EVENT_HDR 1
342#define ST_BT_W4_ACL_HDR 2
343#define ST_BT_W4_SCO_HDR 3
344#define ST_BT_W4_DATA 4
345#define ST_FM_W4_EVENT_HDR 5
346#define ST_GPS_W4_EVENT_HDR 6
347
348/* ST LL state machines */
349#define ST_LL_ASLEEP 0
350#define ST_LL_ASLEEP_TO_AWAKE 1
351#define ST_LL_AWAKE 2
352#define ST_LL_AWAKE_TO_ASLEEP 3
353#define ST_LL_INVALID 4
354
355/* different PM notifications coming from chip */
356#define LL_SLEEP_IND 0x30
357#define LL_SLEEP_ACK 0x31
358#define LL_WAKE_UP_IND 0x32
359#define LL_WAKE_UP_ACK 0x33
360
361/* initialize and de-init ST LL */
362long st_ll_init(struct st_data_s *);
363long st_ll_deinit(struct st_data_s *);
364
365/**
366 * enable/disable ST LL along with KIM start/stop
367 * called by ST Core
368 */
369void st_ll_enable(struct st_data_s *);
370void st_ll_disable(struct st_data_s *);
371
372/**
373 * various funcs used by ST core to set/get the various PM states
374 * of the chip.
375 */
376unsigned long st_ll_getstate(struct st_data_s *);
377unsigned long st_ll_sleep_state(struct st_data_s *, unsigned char);
378void st_ll_wakeup(struct st_data_s *);
379
380/*
381 * header information used by st_core.c for FM and GPS
382 * packet parsing, the bluetooth headers are already available
383 * at net/bluetooth/
384 */
385
386struct fm_event_hdr {
387 u8 plen;
388} __attribute__ ((packed));
389
390#define FM_MAX_FRAME_SIZE 0xFF /* TODO: */
391#define FM_EVENT_HDR_SIZE 1 /* size of fm_event_hdr */
392#define ST_FM_CH8_PKT 0x8
393
394/* gps stuff */
395struct gps_event_hdr {
396 u8 opcode;
397 u16 plen;
398} __attribute__ ((packed));
399
400#endif /* TI_WILINK_ST_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 86be0cdeb11..e500171c745 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -50,6 +50,7 @@
50#define N_V253 19 /* Codec control over voice modem */ 50#define N_V253 19 /* Codec control over voice modem */
51#define N_CAIF 20 /* CAIF protocol for talking to modems */ 51#define N_CAIF 20 /* CAIF protocol for talking to modems */
52#define N_GSM0710 21 /* GSM 0710 Mux */ 52#define N_GSM0710 21 /* GSM 0710 Mux */
53#define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */
53 54
54/* 55/*
55 * This character is the same as _POSIX_VDISABLE: it cannot be used as 56 * This character is the same as _POSIX_VDISABLE: it cannot be used as