diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-04-18 05:39:10 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-04-18 05:39:10 -0400 |
commit | b2b4b9a7c09ad66e095b13c97946a96f2dc8284e (patch) | |
tree | fb856b5998df266bd83e6e64b8884287e812845a /include | |
parent | 875999c5539999f61a45620aae0c3e5fb1d2b035 (diff) | |
parent | 4741c336d27dec3ea68a35659abb8dc82b142388 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'include')
36 files changed, 605 insertions, 3178 deletions
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index 65ac305c2d45..ee8dfea549bc 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h | |||
@@ -360,6 +360,24 @@ | |||
360 | #define __ARM_NR_usr32 (__ARM_NR_BASE+4) | 360 | #define __ARM_NR_usr32 (__ARM_NR_BASE+4) |
361 | #define __ARM_NR_set_tls (__ARM_NR_BASE+5) | 361 | #define __ARM_NR_set_tls (__ARM_NR_BASE+5) |
362 | 362 | ||
363 | /* | ||
364 | * The following syscalls are obsolete and no longer available for EABI. | ||
365 | */ | ||
366 | #if defined(__ARM_EABI__) | ||
367 | #undef __NR_time | ||
368 | #undef __NR_umount | ||
369 | #undef __NR_stime | ||
370 | #undef __NR_alarm | ||
371 | #undef __NR_utime | ||
372 | #undef __NR_getrlimit | ||
373 | #undef __NR_select | ||
374 | #undef __NR_readdir | ||
375 | #undef __NR_mmap | ||
376 | #undef __NR_socketcall | ||
377 | #undef __NR_syscall | ||
378 | #undef __NR_ipc | ||
379 | #endif | ||
380 | |||
363 | #define __sys2(x) #x | 381 | #define __sys2(x) #x |
364 | #define __sys1(x) __sys2(x) | 382 | #define __sys1(x) __sys2(x) |
365 | 383 | ||
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index 6a8dd83c350f..d81d6cfc1bb4 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -320,8 +320,9 @@ | |||
320 | #define __NR_get_robust_list 312 | 320 | #define __NR_get_robust_list 312 |
321 | #define __NR_splice 313 | 321 | #define __NR_splice 313 |
322 | #define __NR_sync_file_range 314 | 322 | #define __NR_sync_file_range 314 |
323 | #define __NR_tee 315 | ||
323 | 324 | ||
324 | #define NR_syscalls 315 | 325 | #define NR_syscalls 316 |
325 | 326 | ||
326 | /* | 327 | /* |
327 | * user-visible error numbers are in the range -1 - -128: see | 328 | * user-visible error numbers are in the range -1 - -128: see |
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index 1c749acca021..a40ebec6aeeb 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
@@ -289,12 +289,13 @@ | |||
289 | #define __NR_set_robust_list 1298 | 289 | #define __NR_set_robust_list 1298 |
290 | #define __NR_get_robust_list 1299 | 290 | #define __NR_get_robust_list 1299 |
291 | #define __NR_sync_file_range 1300 | 291 | #define __NR_sync_file_range 1300 |
292 | #define __NR_tee 1301 | ||
292 | 293 | ||
293 | #ifdef __KERNEL__ | 294 | #ifdef __KERNEL__ |
294 | 295 | ||
295 | #include <linux/config.h> | 296 | #include <linux/config.h> |
296 | 297 | ||
297 | #define NR_syscalls 277 /* length of syscall table */ | 298 | #define NR_syscalls 278 /* length of syscall table */ |
298 | 299 | ||
299 | #define __ARCH_WANT_SYS_RT_SIGACTION | 300 | #define __ARCH_WANT_SYS_RT_SIGACTION |
300 | 301 | ||
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 536ba0873052..c612f1a62772 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -302,8 +302,9 @@ | |||
302 | #define __NR_ppoll 281 | 302 | #define __NR_ppoll 281 |
303 | #define __NR_unshare 282 | 303 | #define __NR_unshare 282 |
304 | #define __NR_splice 283 | 304 | #define __NR_splice 283 |
305 | #define __NR_tee 284 | ||
305 | 306 | ||
306 | #define __NR_syscalls 284 | 307 | #define __NR_syscalls 285 |
307 | 308 | ||
308 | #ifdef __KERNEL__ | 309 | #ifdef __KERNEL__ |
309 | #define __NR__exit __NR_exit | 310 | #define __NR__exit __NR_exit |
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 264f0ebeaedc..2a911aa4cae9 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -296,7 +296,7 @@ | |||
296 | #define __NR_mq_notify 277 | 296 | #define __NR_mq_notify 277 |
297 | #define __NR_mq_getsetattr 278 | 297 | #define __NR_mq_getsetattr 278 |
298 | #define __NR_waitid 279 | 298 | #define __NR_waitid 279 |
299 | #define __NR_sys_setaltroot 280 | 299 | #define __NR_tee 280 |
300 | #define __NR_add_key 281 | 300 | #define __NR_add_key 281 |
301 | #define __NR_request_key 282 | 301 | #define __NR_request_key 282 |
302 | #define __NR_keyctl 283 | 302 | #define __NR_keyctl 283 |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index d0544b4f47b7..6ada6a871cc8 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -298,7 +298,7 @@ | |||
298 | #define __NR_mq_notify 277 | 298 | #define __NR_mq_notify 277 |
299 | #define __NR_mq_getsetattr 278 | 299 | #define __NR_mq_getsetattr 278 |
300 | #define __NR_waitid 279 | 300 | #define __NR_waitid 279 |
301 | /*#define __NR_sys_setaltroot 280 available (was setaltroot) */ | 301 | #define __NR_tee 280 |
302 | #define __NR_add_key 281 | 302 | #define __NR_add_key 281 |
303 | #define __NR_request_key 282 | 303 | #define __NR_request_key 282 |
304 | #define __NR_keyctl 283 | 304 | #define __NR_keyctl 283 |
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index f21ff2c1e960..d86494e23b63 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h | |||
@@ -611,8 +611,10 @@ __SYSCALL(__NR_set_robust_list, sys_set_robust_list) | |||
611 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) | 611 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) |
612 | #define __NR_splice 275 | 612 | #define __NR_splice 275 |
613 | __SYSCALL(__NR_splice, sys_splice) | 613 | __SYSCALL(__NR_splice, sys_splice) |
614 | #define __NR_tee 276 | ||
615 | __SYSCALL(__NR_tee, sys_tee) | ||
614 | 616 | ||
615 | #define __NR_syscall_max __NR_splice | 617 | #define __NR_syscall_max __NR_tee |
616 | 618 | ||
617 | #ifndef __NO_STUBS | 619 | #ifndef __NO_STUBS |
618 | 620 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d0cac8b58de7..59e1259b1c40 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -17,6 +17,8 @@ | |||
17 | 17 | ||
18 | #include <asm/scatterlist.h> | 18 | #include <asm/scatterlist.h> |
19 | 19 | ||
20 | struct scsi_ioctl_command; | ||
21 | |||
20 | struct request_queue; | 22 | struct request_queue; |
21 | typedef struct request_queue request_queue_t; | 23 | typedef struct request_queue request_queue_t; |
22 | struct elevator_queue; | 24 | struct elevator_queue; |
@@ -611,6 +613,8 @@ extern void blk_plug_device(request_queue_t *); | |||
611 | extern int blk_remove_plug(request_queue_t *); | 613 | extern int blk_remove_plug(request_queue_t *); |
612 | extern void blk_recount_segments(request_queue_t *, struct bio *); | 614 | extern void blk_recount_segments(request_queue_t *, struct bio *); |
613 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); | 615 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); |
616 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, | ||
617 | struct gendisk *, struct scsi_ioctl_command __user *); | ||
614 | extern void blk_start_queue(request_queue_t *q); | 618 | extern void blk_start_queue(request_queue_t *q); |
615 | extern void blk_stop_queue(request_queue_t *q); | 619 | extern void blk_stop_queue(request_queue_t *q); |
616 | extern void blk_sync_queue(struct request_queue *q); | 620 | extern void blk_sync_queue(struct request_queue *q); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 162c6e57307a..3de2bfb2410f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1039,8 +1039,8 @@ struct file_operations { | |||
1039 | int (*check_flags)(int); | 1039 | int (*check_flags)(int); |
1040 | int (*dir_notify)(struct file *filp, unsigned long arg); | 1040 | int (*dir_notify)(struct file *filp, unsigned long arg); |
1041 | int (*flock) (struct file *, int, struct file_lock *); | 1041 | int (*flock) (struct file *, int, struct file_lock *); |
1042 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int); | 1042 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); |
1043 | ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); | 1043 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); |
1044 | }; | 1044 | }; |
1045 | 1045 | ||
1046 | struct inode_operations { | 1046 | struct inode_operations { |
@@ -1613,13 +1613,13 @@ extern void do_generic_mapping_read(struct address_space *mapping, | |||
1613 | loff_t *, read_descriptor_t *, read_actor_t); | 1613 | loff_t *, read_descriptor_t *, read_actor_t); |
1614 | 1614 | ||
1615 | /* fs/splice.c */ | 1615 | /* fs/splice.c */ |
1616 | extern ssize_t generic_file_splice_read(struct file *, | 1616 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, |
1617 | struct pipe_inode_info *, size_t, unsigned int); | 1617 | struct pipe_inode_info *, size_t, unsigned int); |
1618 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | 1618 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, |
1619 | struct file *, size_t, unsigned int); | 1619 | struct file *, loff_t *, size_t, unsigned int); |
1620 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | 1620 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, |
1621 | struct file *out, size_t len, unsigned int flags); | 1621 | struct file *out, loff_t *, size_t len, unsigned int flags); |
1622 | extern long do_splice_direct(struct file *in, struct file *out, | 1622 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, |
1623 | size_t len, unsigned int flags); | 1623 | size_t len, unsigned int flags); |
1624 | 1624 | ||
1625 | extern void | 1625 | extern void |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 10a27f29d692..2ef845b35175 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -105,6 +105,7 @@ struct gendisk { | |||
105 | * disks that can't be partitioned. */ | 105 | * disks that can't be partitioned. */ |
106 | char disk_name[32]; /* name of major driver */ | 106 | char disk_name[32]; /* name of major driver */ |
107 | struct hd_struct **part; /* [indexed by minor] */ | 107 | struct hd_struct **part; /* [indexed by minor] */ |
108 | int part_uevent_suppress; | ||
108 | struct block_device_operations *fops; | 109 | struct block_device_operations *fops; |
109 | struct request_queue *queue; | 110 | struct request_queue *queue; |
110 | void *private_data; | 111 | void *private_data; |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 4cb1214ec290..dcd0623be892 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/rwsem.h> | 24 | #include <linux/rwsem.h> |
25 | #include <linux/kref.h> | 25 | #include <linux/kref.h> |
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/wait.h> | ||
27 | #include <asm/atomic.h> | 28 | #include <asm/atomic.h> |
28 | 29 | ||
29 | #define KOBJ_NAME_LEN 20 | 30 | #define KOBJ_NAME_LEN 20 |
@@ -56,6 +57,7 @@ struct kobject { | |||
56 | struct kset * kset; | 57 | struct kset * kset; |
57 | struct kobj_type * ktype; | 58 | struct kobj_type * ktype; |
58 | struct dentry * dentry; | 59 | struct dentry * dentry; |
60 | wait_queue_head_t poll; | ||
59 | }; | 61 | }; |
60 | 62 | ||
61 | extern int kobject_set_name(struct kobject *, const char *, ...) | 63 | extern int kobject_set_name(struct kobject *, const char *, ...) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 0aad5a378e95..3a6a4e37a482 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -97,7 +97,13 @@ enum pci_channel_state { | |||
97 | 97 | ||
98 | typedef unsigned short __bitwise pci_bus_flags_t; | 98 | typedef unsigned short __bitwise pci_bus_flags_t; |
99 | enum pci_bus_flags { | 99 | enum pci_bus_flags { |
100 | PCI_BUS_FLAGS_NO_MSI = (pci_bus_flags_t) 1, | 100 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, |
101 | }; | ||
102 | |||
103 | struct pci_cap_saved_state { | ||
104 | struct hlist_node next; | ||
105 | char cap_nr; | ||
106 | u32 data[0]; | ||
101 | }; | 107 | }; |
102 | 108 | ||
103 | /* | 109 | /* |
@@ -159,6 +165,7 @@ struct pci_dev { | |||
159 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 165 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ |
160 | 166 | ||
161 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 167 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
168 | struct hlist_head saved_cap_space; | ||
162 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ | 169 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ |
163 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ | 170 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ |
164 | struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ | 171 | struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ |
@@ -169,6 +176,30 @@ struct pci_dev { | |||
169 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 176 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
170 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 177 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
171 | 178 | ||
179 | static inline struct pci_cap_saved_state *pci_find_saved_cap( | ||
180 | struct pci_dev *pci_dev,char cap) | ||
181 | { | ||
182 | struct pci_cap_saved_state *tmp; | ||
183 | struct hlist_node *pos; | ||
184 | |||
185 | hlist_for_each_entry(tmp, pos, &pci_dev->saved_cap_space, next) { | ||
186 | if (tmp->cap_nr == cap) | ||
187 | return tmp; | ||
188 | } | ||
189 | return NULL; | ||
190 | } | ||
191 | |||
192 | static inline void pci_add_saved_cap(struct pci_dev *pci_dev, | ||
193 | struct pci_cap_saved_state *new_cap) | ||
194 | { | ||
195 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); | ||
196 | } | ||
197 | |||
198 | static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap) | ||
199 | { | ||
200 | hlist_del(&cap->next); | ||
201 | } | ||
202 | |||
172 | /* | 203 | /* |
173 | * For PCI devices, the region numbers are assigned this way: | 204 | * For PCI devices, the region numbers are assigned this way: |
174 | * | 205 | * |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 870fe38378b1..8d03e10212f5 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -497,7 +497,8 @@ | |||
497 | #define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b | 497 | #define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b |
498 | #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d | 498 | #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d |
499 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 | 499 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 |
500 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 | 500 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
501 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | ||
501 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 502 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
502 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 503 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
503 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 | 504 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 |
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 123a7c24bc72..ef7f33c0be19 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -21,6 +21,7 @@ struct pipe_buf_operations { | |||
21 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); | 21 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); |
22 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); | 22 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); |
23 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); | 23 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); |
24 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); | ||
24 | }; | 25 | }; |
25 | 26 | ||
26 | struct pipe_inode_info { | 27 | struct pipe_inode_info { |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 6df2585c0169..66be58902b17 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -199,6 +199,12 @@ extern int device_suspend(pm_message_t state); | |||
199 | 199 | ||
200 | extern int dpm_runtime_suspend(struct device *, pm_message_t); | 200 | extern int dpm_runtime_suspend(struct device *, pm_message_t); |
201 | extern void dpm_runtime_resume(struct device *); | 201 | extern void dpm_runtime_resume(struct device *); |
202 | extern void __suspend_report_result(const char *function, void *fn, int ret); | ||
203 | |||
204 | #define suspend_report_result(fn, ret) \ | ||
205 | do { \ | ||
206 | __suspend_report_result(__FUNCTION__, fn, ret); \ | ||
207 | } while (0) | ||
202 | 208 | ||
203 | #else /* !CONFIG_PM */ | 209 | #else /* !CONFIG_PM */ |
204 | 210 | ||
@@ -219,6 +225,8 @@ static inline void dpm_runtime_resume(struct device * dev) | |||
219 | { | 225 | { |
220 | } | 226 | } |
221 | 227 | ||
228 | #define suspend_report_result(fn, ret) do { } while (0) | ||
229 | |||
222 | #endif | 230 | #endif |
223 | 231 | ||
224 | /* changes to device_may_wakeup take effect on the next pm state change. | 232 | /* changes to device_may_wakeup take effect on the next pm state change. |
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h index 1252b45face1..008932d73c35 100644 --- a/include/linux/pm_legacy.h +++ b/include/linux/pm_legacy.h | |||
@@ -16,11 +16,6 @@ struct pm_dev __deprecated * | |||
16 | pm_register(pm_dev_t type, unsigned long id, pm_callback callback); | 16 | pm_register(pm_dev_t type, unsigned long id, pm_callback callback); |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Unregister a device with power management | ||
20 | */ | ||
21 | void __deprecated pm_unregister(struct pm_dev *dev); | ||
22 | |||
23 | /* | ||
24 | * Unregister all devices with matching callback | 19 | * Unregister all devices with matching callback |
25 | */ | 20 | */ |
26 | void __deprecated pm_unregister_all(pm_callback callback); | 21 | void __deprecated pm_unregister_all(pm_callback callback); |
@@ -41,8 +36,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type, | |||
41 | return NULL; | 36 | return NULL; |
42 | } | 37 | } |
43 | 38 | ||
44 | static inline void pm_unregister(struct pm_dev *dev) {} | ||
45 | |||
46 | static inline void pm_unregister_all(pm_callback callback) {} | 39 | static inline void pm_unregister_all(pm_callback callback) {} |
47 | 40 | ||
48 | static inline int pm_send_all(pm_request_t rqst, void *data) | 41 | static inline int pm_send_all(pm_request_t rqst, void *data) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index e3539c14e47e..b7d31e2e1729 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -911,7 +911,6 @@ static inline int pid_alive(struct task_struct *p) | |||
911 | extern void free_task(struct task_struct *tsk); | 911 | extern void free_task(struct task_struct *tsk); |
912 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 912 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
913 | 913 | ||
914 | extern void __put_task_struct_cb(struct rcu_head *rhp); | ||
915 | extern void __put_task_struct(struct task_struct *t); | 914 | extern void __put_task_struct(struct task_struct *t); |
916 | 915 | ||
917 | static inline void put_task_struct(struct task_struct *t) | 916 | static inline void put_task_struct(struct task_struct *t) |
diff --git a/include/linux/sdla_asy.h b/include/linux/sdla_asy.h deleted file mode 100644 index f62242537c86..000000000000 --- a/include/linux/sdla_asy.h +++ /dev/null | |||
@@ -1,226 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdla_asy.h Header file for the Sangoma S508/S514 asynchronous code API | ||
3 | * | ||
4 | * Author: Gideon Hack | ||
5 | * | ||
6 | * Copyright: (c) 2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * | ||
14 | * Jan 28, 2000 Gideon Hack Initial Version | ||
15 | * | ||
16 | *****************************************************************************/ | ||
17 | |||
18 | |||
19 | #ifndef _WANPIPE_ASYNC_H | ||
20 | #define _WANPIPE_ASYNC_H | ||
21 | |||
22 | /* ---------------------------------------------------------------------------- | ||
23 | * Interface commands | ||
24 | * --------------------------------------------------------------------------*/ | ||
25 | |||
26 | #define SET_ASY_CONFIGURATION 0xE2 /* set the asychronous operational configuration */ | ||
27 | #define READ_ASY_CONFIGURATION 0xE3 /* read the current asychronous operational configuration */ | ||
28 | #define ENABLE_ASY_COMMUNICATIONS 0xE4 /* enable asychronous communications */ | ||
29 | #define DISABLE_ASY_COMMUNICATIONS 0xE5 /* disable asychronous communications */ | ||
30 | #define READ_ASY_OPERATIONAL_STATS 0xE7 /* retrieve the asychronous operational statistics */ | ||
31 | #define FLUSH_ASY_OPERATIONAL_STATS 0xE8 /* flush the asychronous operational statistics */ | ||
32 | #define TRANSMIT_ASY_BREAK_SIGNAL 0xEC /* transmit an asychronous break signal */ | ||
33 | |||
34 | |||
35 | |||
36 | /* ---------------------------------------------------------------------------- | ||
37 | * Return codes from interface commands | ||
38 | * --------------------------------------------------------------------------*/ | ||
39 | |||
40 | #define COMMAND_INVALID_FOR_PORT 0x50 /* the command is invalid for the selected port */ | ||
41 | #define DISABLE_ASY_COMMS_BEFORE_CFG 0xE1 /* communications must be disabled before setting the configuration */ | ||
42 | #define ASY_COMMS_ENABLED 0xE1 /* communications are currently enabled */ | ||
43 | #define ASY_COMMS_DISABLED 0xE1 /* communications are currently disabled */ | ||
44 | #define ASY_CFG_BEFORE_COMMS_ENABLED 0xE2 /* perform a SET_ASY_CONFIGURATION before enabling comms */ | ||
45 | #define LGTH_ASY_CFG_DATA_INVALID 0xE2 /* the length of the passed configuration data is invalid */ | ||
46 | #define INVALID_ASY_CFG_DATA 0xE3 /* the passed configuration data is invalid */ | ||
47 | #define ASY_BREAK_SIGNAL_BUSY 0xEC /* a break signal is being transmitted */ | ||
48 | |||
49 | |||
50 | |||
51 | /* ---------------------------------------------------------------------------- | ||
52 | * Constants for the SET_ASY_CONFIGURATION/READ_ASY_CONFIGURATION command | ||
53 | * --------------------------------------------------------------------------*/ | ||
54 | |||
55 | /* the asynchronous configuration structure */ | ||
56 | typedef struct { | ||
57 | unsigned long baud_rate PACKED; /* the baud rate */ | ||
58 | unsigned short line_config_options PACKED; /* line configuration options */ | ||
59 | unsigned short modem_config_options PACKED; /* modem configuration options */ | ||
60 | unsigned short asy_API_options PACKED; /* asynchronous API options */ | ||
61 | unsigned short asy_protocol_options PACKED; /* asynchronous protocol options */ | ||
62 | unsigned short Tx_bits_per_char PACKED; /* number of bits per tx character */ | ||
63 | unsigned short Rx_bits_per_char PACKED; /* number of bits per received character */ | ||
64 | unsigned short stop_bits PACKED; /* number of stop bits per character */ | ||
65 | unsigned short parity PACKED; /* parity definition */ | ||
66 | unsigned short break_timer PACKED; /* the break signal timer */ | ||
67 | unsigned short asy_Rx_inter_char_timer PACKED; /* the receive inter-character timer */ | ||
68 | unsigned short asy_Rx_complete_length PACKED; /* the receive 'buffer complete' length */ | ||
69 | unsigned short XON_char PACKED; /* the XON character */ | ||
70 | unsigned short XOFF_char PACKED; /* the XOFF character */ | ||
71 | unsigned short asy_statistics_options PACKED; /* async operational stat options */ | ||
72 | unsigned long ptr_shared_mem_info_struct PACKED;/* ptr to the shared memory area information structure */ | ||
73 | unsigned long ptr_asy_Tx_stat_el_cfg_struct PACKED;/* ptr to the transmit status element configuration structure */ | ||
74 | unsigned long ptr_asy_Rx_stat_el_cfg_struct PACKED;/* ptr to the receive status element configuration structure */ | ||
75 | } ASY_CONFIGURATION_STRUCT; | ||
76 | |||
77 | /* permitted minimum and maximum values for setting the asynchronous configuration */ | ||
78 | #define MIN_ASY_BAUD_RATE 50 /* maximum baud rate */ | ||
79 | #define MAX_ASY_BAUD_RATE 250000 /* minimum baud rate */ | ||
80 | #define MIN_ASY_BITS_PER_CHAR 5 /* minimum number of bits per character */ | ||
81 | #define MAX_ASY_BITS_PER_CHAR 8 /* maximum number of bits per character */ | ||
82 | #define MIN_BREAK_TMR_VAL 0 /* minimum break signal timer */ | ||
83 | #define MAX_BREAK_TMR_VAL 5000 /* maximum break signal timer */ | ||
84 | #define MIN_ASY_RX_INTER_CHAR_TMR 0 /* minimum receive inter-character timer */ | ||
85 | #define MAX_ASY_RX_INTER_CHAR_TMR 30000 /* maximum receive inter-character timer */ | ||
86 | #define MIN_ASY_RX_CPLT_LENGTH 0 /* minimum receive 'length complete' value */ | ||
87 | #define MAX_ASY_RX_CPLT_LENGTH 2000 /* maximum receive 'length complete' value */ | ||
88 | |||
89 | /* bit settings for the 'asy_API_options' */ | ||
90 | #define ASY_RX_DATA_TRANSPARENT 0x0001 /* do not strip parity and unused bits from received characters */ | ||
91 | |||
92 | /* bit settings for the 'asy_protocol_options' */ | ||
93 | #define ASY_RTS_HS_FOR_RX 0x0001 /* RTS handshaking is used for reception control */ | ||
94 | #define ASY_XON_XOFF_HS_FOR_RX 0x0002 /* XON/XOFF handshaking is used for reception control */ | ||
95 | #define ASY_XON_XOFF_HS_FOR_TX 0x0004 /* XON/XOFF handshaking is used for transmission control */ | ||
96 | #define ASY_DCD_HS_FOR_TX 0x0008 /* DCD handshaking is used for transmission control */ | ||
97 | #define ASY_CTS_HS_FOR_TX 0x0020 /* CTS handshaking is used for transmission control */ | ||
98 | |||
99 | /* bit settings for the 'stop_bits' definition */ | ||
100 | #define ONE_STOP_BIT 1 /* representation for 1 stop bit */ | ||
101 | #define TWO_STOP_BITS 2 /* representation for 2 stop bits */ | ||
102 | #define ONE_AND_A_HALF_STOP_BITS 3 /* representation for 1.5 stop bits */ | ||
103 | |||
104 | /* bit settings for the 'parity' definition */ | ||
105 | #define NO_PARITY 0 /* representation for no parity */ | ||
106 | #define ODD_PARITY 1 /* representation for odd parity */ | ||
107 | #define EVEN_PARITY 2 /* representation for even parity */ | ||
108 | |||
109 | |||
110 | |||
111 | /* ---------------------------------------------------------------------------- | ||
112 | * Constants for the READ_COMMS_ERROR_STATS command (asynchronous mode) | ||
113 | * --------------------------------------------------------------------------*/ | ||
114 | |||
115 | /* the communications error statistics structure */ | ||
116 | typedef struct { | ||
117 | unsigned short Rx_overrun_err_count PACKED; /* receiver overrun error count */ | ||
118 | unsigned short Rx_parity_err_count PACKED; /* parity errors received count */ | ||
119 | unsigned short Rx_framing_err_count PACKED; /* framing errors received count */ | ||
120 | unsigned short comms_err_stat_reserved_1 PACKED;/* reserved for later use */ | ||
121 | unsigned short comms_err_stat_reserved_2 PACKED;/* reserved for later use */ | ||
122 | unsigned short comms_err_stat_reserved_3 PACKED;/* reserved for later use */ | ||
123 | unsigned short comms_err_stat_reserved_4 PACKED;/* reserved for later use */ | ||
124 | unsigned short comms_err_stat_reserved_5 PACKED;/* reserved for later use */ | ||
125 | unsigned short DCD_state_change_count PACKED; /* DCD state change count */ | ||
126 | unsigned short CTS_state_change_count PACKED; /* CTS state change count */ | ||
127 | } ASY_COMMS_ERROR_STATS_STRUCT; | ||
128 | |||
129 | |||
130 | |||
131 | /* ---------------------------------------------------------------------------- | ||
132 | * Constants for the READ_ASY_OPERATIONAL_STATS command | ||
133 | * --------------------------------------------------------------------------*/ | ||
134 | |||
135 | /* the asynchronous operational statistics structure */ | ||
136 | typedef struct { | ||
137 | |||
138 | /* Data transmission statistics */ | ||
139 | unsigned long Data_blocks_Tx_count PACKED;/* number of blocks transmitted */ | ||
140 | unsigned long Data_bytes_Tx_count PACKED;/* number of bytes transmitted */ | ||
141 | unsigned long Data_Tx_throughput PACKED;/* transmit throughput */ | ||
142 | unsigned long no_ms_for_Data_Tx_thruput_comp PACKED;/* millisecond time used for the Tx throughput computation */ | ||
143 | unsigned long Tx_Data_discard_lgth_err_count PACKED;/* number of Data blocks discarded (length error) */ | ||
144 | unsigned long reserved_Data_frm_Tx_stat1 PACKED;/* reserved for later use */ | ||
145 | unsigned long reserved_Data_frm_Tx_stat2 PACKED;/* reserved for later use */ | ||
146 | unsigned long reserved_Data_frm_Tx_stat3 PACKED;/* reserved for later use */ | ||
147 | |||
148 | /* Data reception statistics */ | ||
149 | unsigned long Data_blocks_Rx_count PACKED;/* number of blocks received */ | ||
150 | unsigned long Data_bytes_Rx_count PACKED;/* number of bytes received */ | ||
151 | unsigned long Data_Rx_throughput PACKED;/* receive throughput */ | ||
152 | unsigned long no_ms_for_Data_Rx_thruput_comp PACKED;/* millisecond time used for the Rx throughput computation */ | ||
153 | unsigned long Rx_Data_bytes_discard_count PACKED;/* received Data bytes discarded */ | ||
154 | unsigned long reserved_Data_frm_Rx_stat1 PACKED;/* reserved for later use */ | ||
155 | |||
156 | /* handshaking protocol statistics */ | ||
157 | unsigned short XON_chars_Tx_count PACKED; /* number of XON characters transmitted */ | ||
158 | unsigned short XOFF_chars_Tx_count PACKED; /* number of XOFF characters transmitted */ | ||
159 | unsigned short XON_chars_Rx_count PACKED; /* number of XON characters received */ | ||
160 | unsigned short XOFF_chars_Rx_count PACKED; /* number of XOFF characters received */ | ||
161 | unsigned short Tx_halt_modem_low_count PACKED; /* number of times Tx halted (modem line low) */ | ||
162 | unsigned short Rx_halt_RTS_low_count PACKED; /* number of times Rx halted by setting RTS low */ | ||
163 | unsigned long reserved_handshaking_stat1 PACKED;/* reserved for later use */ | ||
164 | |||
165 | /* break statistics */ | ||
166 | unsigned short break_Tx_count PACKED; /* number of break sequences transmitted */ | ||
167 | unsigned short break_Rx_count PACKED; /* number of break sequences received */ | ||
168 | unsigned long reserved_break_stat1 PACKED;/* reserved for later use */ | ||
169 | |||
170 | /* miscellaneous statistics */ | ||
171 | unsigned long reserved_misc_stat1 PACKED; /* reserved for later use */ | ||
172 | unsigned long reserved_misc_stat2 PACKED; /* reserved for later use */ | ||
173 | |||
174 | } ASY_OPERATIONAL_STATS_STRUCT; | ||
175 | |||
176 | |||
177 | |||
178 | /* ---------------------------------------------------------------------------- | ||
179 | * Constants for Data transmission | ||
180 | * --------------------------------------------------------------------------*/ | ||
181 | |||
182 | /* the Data block transmit status element configuration structure */ | ||
183 | typedef struct { | ||
184 | unsigned short number_Tx_status_elements PACKED; /* number of transmit status elements */ | ||
185 | unsigned long base_addr_Tx_status_elements PACKED; /* base address of the transmit element list */ | ||
186 | unsigned long next_Tx_status_element_to_use PACKED; /* pointer to the next transmit element to be used */ | ||
187 | } ASY_TX_STATUS_EL_CFG_STRUCT; | ||
188 | |||
189 | |||
190 | /* the Data block transmit status element structure */ | ||
191 | typedef struct { | ||
192 | unsigned char opp_flag PACKED; /* opp flag */ | ||
193 | unsigned short data_length PACKED; /* length of the block to be transmitted */ | ||
194 | unsigned char reserved_1 PACKED; /* reserved for internal use */ | ||
195 | unsigned long reserved_2 PACKED; /* reserved for internal use */ | ||
196 | unsigned long reserved_3 PACKED; /* reserved for internal use */ | ||
197 | unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ | ||
198 | } ASY_DATA_TX_STATUS_EL_STRUCT; | ||
199 | |||
200 | |||
201 | |||
202 | /* ---------------------------------------------------------------------------- | ||
203 | * Constants for Data reception | ||
204 | * --------------------------------------------------------------------------*/ | ||
205 | |||
206 | /* the Data block receive status element configuration structure */ | ||
207 | typedef struct { | ||
208 | unsigned short number_Rx_status_elements PACKED;/* number of receive status elements */ | ||
209 | unsigned long base_addr_Rx_status_elements PACKED;/* base address of the receive element list */ | ||
210 | unsigned long next_Rx_status_element_to_use PACKED;/* pointer to the next receive element to be used */ | ||
211 | unsigned long base_addr_Rx_buffer PACKED;/* base address of the receive data buffer */ | ||
212 | unsigned long end_addr_Rx_buffer PACKED;/* end address of the receive data buffer */ | ||
213 | } ASY_RX_STATUS_EL_CFG_STRUCT; | ||
214 | |||
215 | /* the Data block receive status element structure */ | ||
216 | typedef struct { | ||
217 | unsigned char opp_flag PACKED; /* opp flag */ | ||
218 | unsigned short data_length PACKED; /* length of the received data block */ | ||
219 | unsigned char reserved_1 PACKED; /* reserved for internal use */ | ||
220 | unsigned short time_stamp PACKED; /* receive time stamp (HDLC_STREAMING_MODE) */ | ||
221 | unsigned short data_buffered PACKED; /* the number of data bytes still buffered */ | ||
222 | unsigned long reserved_2 PACKED; /* reserved for internal use */ | ||
223 | unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ | ||
224 | } ASY_DATA_RX_STATUS_EL_STRUCT; | ||
225 | |||
226 | #endif | ||
diff --git a/include/linux/sdla_chdlc.h b/include/linux/sdla_chdlc.h deleted file mode 100644 index d2e35a299034..000000000000 --- a/include/linux/sdla_chdlc.h +++ /dev/null | |||
@@ -1,813 +0,0 @@ | |||
1 | /************************************************************************* | ||
2 | sdla_chdlc.h Sangoma Cisco HDLC firmware API definitions | ||
3 | |||
4 | Author: Gideon Hack | ||
5 | Nenad Corbic <ncorbic@sangoma.com> | ||
6 | |||
7 | Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
8 | |||
9 | This program is free software; you can redistribute it and/or | ||
10 | modify it under the term of the GNU General Public License | ||
11 | as published by the Free Software Foundation; either version | ||
12 | 2 of the License, or (at your option) any later version. | ||
13 | |||
14 | =========================================================================== | ||
15 | Oct 04, 1999 Nenad Corbic Updated API support | ||
16 | Jun 02, 1999 Gideon Hack Changes for S514 usage. | ||
17 | Oct 28, 1998 Jaspreet Singh Made changes for Dual Port CHDLC. | ||
18 | Jun 11, 1998 David Fong Initial version. | ||
19 | =========================================================================== | ||
20 | |||
21 | Organization | ||
22 | - Compatibility notes | ||
23 | - Constants defining the shared memory control block (mailbox) | ||
24 | - Interface commands | ||
25 | - Return code from interface commands | ||
26 | - Constants for the commands (structures for casting data) | ||
27 | - UDP Management constants and structures | ||
28 | |||
29 | *************************************************************************/ | ||
30 | |||
31 | #ifndef _SDLA_CHDLC_H | ||
32 | # define _SDLC_CHDLC_H | ||
33 | |||
34 | /*------------------------------------------------------------------------ | ||
35 | Notes: | ||
36 | |||
37 | All structres defined in this file are byte-aligned. | ||
38 | |||
39 | Compiler Platform | ||
40 | ------------------------ | ||
41 | GNU C Linux | ||
42 | |||
43 | ------------------------------------------------------------------------*/ | ||
44 | |||
45 | #ifndef PACKED | ||
46 | #define PACKED __attribute__((packed)) | ||
47 | #endif /* PACKED */ | ||
48 | |||
49 | |||
50 | /* ---------------------------------------------------------------------------- | ||
51 | * Constants defining the shared memory control block (mailbox) | ||
52 | * --------------------------------------------------------------------------*/ | ||
53 | |||
54 | #define PRI_BASE_ADDR_MB_STRUCT 0xE000 /* the base address of the mailbox structure on the adapter */ | ||
55 | #define SEC_BASE_ADDR_MB_STRUCT 0xE800 /* the base address of the mailbox structure on the adapter */ | ||
56 | #define SIZEOF_MB_DATA_BFR 2032 /* the size of the actual mailbox data area */ | ||
57 | #define NUMBER_MB_RESERVED_BYTES 0x0B /* the number of reserved bytes in the mailbox header area */ | ||
58 | |||
59 | |||
60 | #define MIN_LGTH_CHDLC_DATA_CFG 300 /* min length of the CHDLC data field (for configuration purposes) */ | ||
61 | #define PRI_MAX_NO_DATA_BYTES_IN_FRAME 15354 /* PRIMARY - max length of the CHDLC data field */ | ||
62 | |||
63 | typedef struct { | ||
64 | unsigned char opp_flag PACKED; /* the opp flag */ | ||
65 | unsigned char command PACKED; /* the user command */ | ||
66 | unsigned short buffer_length PACKED; /* the data length */ | ||
67 | unsigned char return_code PACKED; /* the return code */ | ||
68 | unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; /* reserved for later */ | ||
69 | unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; /* the data area */ | ||
70 | } CHDLC_MAILBOX_STRUCT; | ||
71 | |||
72 | typedef struct { | ||
73 | pid_t pid_num PACKED; | ||
74 | CHDLC_MAILBOX_STRUCT cmdarea PACKED; | ||
75 | |||
76 | } CMDBLOCK_STRUCT; | ||
77 | |||
78 | |||
79 | |||
80 | |||
81 | /* ---------------------------------------------------------------------------- | ||
82 | * Interface commands | ||
83 | * --------------------------------------------------------------------------*/ | ||
84 | |||
85 | /* global interface commands */ | ||
86 | #define READ_GLOBAL_EXCEPTION_CONDITION 0x01 | ||
87 | #define SET_GLOBAL_CONFIGURATION 0x02 | ||
88 | #define READ_GLOBAL_CONFIGURATION 0x03 | ||
89 | #define READ_GLOBAL_STATISTICS 0x04 | ||
90 | #define FLUSH_GLOBAL_STATISTICS 0x05 | ||
91 | #define SET_MODEM_STATUS 0x06 /* set status of DTR or RTS */ | ||
92 | #define READ_MODEM_STATUS 0x07 /* read status of CTS and DCD */ | ||
93 | #define READ_COMMS_ERROR_STATS 0x08 | ||
94 | #define FLUSH_COMMS_ERROR_STATS 0x09 | ||
95 | #define SET_TRACE_CONFIGURATION 0x0A /* set the line trace config */ | ||
96 | #define READ_TRACE_CONFIGURATION 0x0B /* read the line trace config */ | ||
97 | #define READ_TRACE_STATISTICS 0x0C /* read the trace statistics */ | ||
98 | #define FLUSH_TRACE_STATISTICS 0x0D /* flush the trace statistics */ | ||
99 | #define FT1_MONITOR_STATUS_CTRL 0x1C /* set the status of the S508/FT1 monitoring */ | ||
100 | #define SET_FT1_CONFIGURATION 0x18 /* set the FT1 configuration */ | ||
101 | #define READ_FT1_CONFIGURATION 0x19 /* read the FT1 configuration */ | ||
102 | #define TRANSMIT_ASYNC_DATA_TO_FT1 0x1A /* output asynchronous data to the FT1 */ | ||
103 | #define RECEIVE_ASYNC_DATA_FROM_FT1 0x1B /* receive asynchronous data from the FT1 */ | ||
104 | #define FT1_MONITOR_STATUS_CTRL 0x1C /* set the status of the FT1 monitoring */ | ||
105 | |||
106 | #define READ_FT1_OPERATIONAL_STATS 0x1D /* read the S508/FT1 operational statistics */ | ||
107 | #define SET_FT1_MODE 0x1E /* set the operational mode of the S508/FT1 module */ | ||
108 | |||
109 | /* CHDLC-level interface commands */ | ||
110 | #define READ_CHDLC_CODE_VERSION 0x20 | ||
111 | #define READ_CHDLC_EXCEPTION_CONDITION 0x21 /* read exception condition from the adapter */ | ||
112 | #define SET_CHDLC_CONFIGURATION 0x22 | ||
113 | #define READ_CHDLC_CONFIGURATION 0x23 | ||
114 | #define ENABLE_CHDLC_COMMUNICATIONS 0x24 | ||
115 | #define DISABLE_CHDLC_COMMUNICATIONS 0x25 | ||
116 | #define READ_CHDLC_LINK_STATUS 0x26 | ||
117 | #define READ_CHDLC_OPERATIONAL_STATS 0x27 | ||
118 | #define FLUSH_CHDLC_OPERATIONAL_STATS 0x28 | ||
119 | #define SET_CHDLC_INTERRUPT_TRIGGERS 0x30 /* set application interrupt triggers */ | ||
120 | #define READ_CHDLC_INTERRUPT_TRIGGERS 0x31 /* read application interrupt trigger configuration */ | ||
121 | |||
122 | /* Special UDP drivers management commands */ | ||
123 | #define CPIPE_ENABLE_TRACING 0x50 | ||
124 | #define CPIPE_DISABLE_TRACING 0x51 | ||
125 | #define CPIPE_GET_TRACE_INFO 0x52 | ||
126 | #define CPIPE_GET_IBA_DATA 0x53 | ||
127 | #define CPIPE_FT1_READ_STATUS 0x54 | ||
128 | #define CPIPE_DRIVER_STAT_IFSEND 0x55 | ||
129 | #define CPIPE_DRIVER_STAT_INTR 0x56 | ||
130 | #define CPIPE_DRIVER_STAT_GEN 0x57 | ||
131 | #define CPIPE_FLUSH_DRIVER_STATS 0x58 | ||
132 | #define CPIPE_ROUTER_UP_TIME 0x59 | ||
133 | |||
134 | /* Driver specific commands for API */ | ||
135 | #define CHDLC_READ_TRACE_DATA 0xE4 /* read trace data */ | ||
136 | #define TRACE_ALL 0x00 | ||
137 | #define TRACE_PROT 0x01 | ||
138 | #define TRACE_DATA 0x02 | ||
139 | |||
140 | #define DISCARD_RX_ERROR_FRAMES 0x0001 | ||
141 | |||
142 | /* ---------------------------------------------------------------------------- | ||
143 | * Return codes from interface commands | ||
144 | * --------------------------------------------------------------------------*/ | ||
145 | |||
146 | #define COMMAND_OK 0x00 | ||
147 | |||
148 | /* return codes from global interface commands */ | ||
149 | #define NO_GLOBAL_EXCEP_COND_TO_REPORT 0x01 /* there is no CHDLC exception condition to report */ | ||
150 | #define LGTH_GLOBAL_CFG_DATA_INVALID 0x01 /* the length of the passed global configuration data is invalid */ | ||
151 | #define LGTH_TRACE_CFG_DATA_INVALID 0x01 /* the length of the passed trace configuration data is invalid */ | ||
152 | #define IRQ_TIMEOUT_VALUE_INVALID 0x02 /* an invalid application IRQ timeout value was selected */ | ||
153 | #define TRACE_CONFIG_INVALID 0x02 /* the passed line trace configuration is invalid */ | ||
154 | #define ADAPTER_OPERATING_FREQ_INVALID 0x03 /* an invalid adapter operating frequency was selected */ | ||
155 | #define TRC_DEAC_TMR_INVALID 0x03 /* the trace deactivation timer is invalid */ | ||
156 | #define S508_FT1_ADPTR_NOT_PRESENT 0x0C /* the S508/FT1 adapter is not present */ | ||
157 | #define INVALID_FT1_STATUS_SELECTION 0x0D /* the S508/FT1 status selection is invalid */ | ||
158 | #define FT1_OP_STATS_NOT_ENABLED 0x0D /* the FT1 operational statistics have not been enabled */ | ||
159 | #define FT1_OP_STATS_NOT_AVAILABLE 0x0E /* the FT1 operational statistics are not currently available */ | ||
160 | #define S508_FT1_MODE_SELECTION_BUSY 0x0E /* the S508/FT1 adapter is busy selecting the operational mode */ | ||
161 | |||
162 | /* return codes from command READ_GLOBAL_EXCEPTION_CONDITION */ | ||
163 | #define EXCEP_MODEM_STATUS_CHANGE 0x10 /* a modem status change occurred */ | ||
164 | #define EXCEP_TRC_DISABLED 0x11 /* the trace has been disabled */ | ||
165 | #define EXCEP_IRQ_TIMEOUT 0x12 /* IRQ timeout */ | ||
166 | |||
167 | /* return codes from CHDLC-level interface commands */ | ||
168 | #define NO_CHDLC_EXCEP_COND_TO_REPORT 0x21 /* there is no CHDLC exception condition to report */ | ||
169 | #define CHDLC_COMMS_DISABLED 0x21 /* communications are not currently enabled */ | ||
170 | #define CHDLC_COMMS_ENABLED 0x21 /* communications are currently enabled */ | ||
171 | #define DISABLE_CHDLC_COMMS_BEFORE_CFG 0x21 /* CHDLC communications must be disabled before setting the configuration */ | ||
172 | #define ENABLE_CHDLC_COMMS_BEFORE_CONN 0x21 /* communications must be enabled before using the CHDLC_CONNECT conmmand */ | ||
173 | #define CHDLC_CFG_BEFORE_COMMS_ENABLED 0x22 /* perform a SET_CHDLC_CONFIGURATION before enabling comms */ | ||
174 | #define LGTH_CHDLC_CFG_DATA_INVALID 0x22 /* the length of the passed CHDLC configuration data is invalid */ | ||
175 | #define LGTH_INT_TRIGGERS_DATA_INVALID 0x22 /* the length of the passed interrupt trigger data is invalid */ | ||
176 | #define INVALID_IRQ_SELECTED 0x23 /* in invalid IRQ was selected in the SET_CHDLC_INTERRUPT_TRIGGERS */ | ||
177 | #define INVALID_CHDLC_CFG_DATA 0x23 /* the passed CHDLC configuration data is invalid */ | ||
178 | #define IRQ_TMR_VALUE_INVALID 0x24 /* an invalid application IRQ timer value was selected */ | ||
179 | #define LARGER_PERCENT_TX_BFR_REQUIRED 0x24 /* a larger Tx buffer percentage is required */ | ||
180 | #define LARGER_PERCENT_RX_BFR_REQUIRED 0x25 /* a larger Rx buffer percentage is required */ | ||
181 | #define S514_BOTH_PORTS_SAME_CLK_MODE 0x26 /* S514 - both ports must have same clock mode */ | ||
182 | #define INVALID_CMND_HDLC_STREAM_MODE 0x4E /* the CHDLC interface command is invalid for HDLC streaming mode */ | ||
183 | #define INVALID_CHDLC_COMMAND 0x4F /* the defined CHDLC interface command is invalid */ | ||
184 | |||
185 | /* return codes from command READ_CHDLC_EXCEPTION_CONDITION */ | ||
186 | #define EXCEP_LINK_ACTIVE 0x30 /* the CHDLC link has become active */ | ||
187 | #define EXCEP_LINK_INACTIVE_MODEM 0x31 /* the CHDLC link has become inactive (modem status) */ | ||
188 | #define EXCEP_LINK_INACTIVE_KPALV 0x32 /* the CHDLC link has become inactive (keepalive status) */ | ||
189 | #define EXCEP_IP_ADDRESS_DISCOVERED 0x33 /* the IP address has been discovered */ | ||
190 | #define EXCEP_LOOPBACK_CONDITION 0x34 /* a loopback condition has occurred */ | ||
191 | |||
192 | |||
193 | /* return code from command CHDLC_SEND_WAIT and CHDLC_SEND_NO_WAIT */ | ||
194 | #define LINK_DISCONNECTED 0x21 | ||
195 | #define NO_TX_BFRS_AVAIL 0x24 | ||
196 | |||
197 | |||
198 | /* ---------------------------------------------------------------------------- | ||
199 | * Constants for the SET_GLOBAL_CONFIGURATION/READ_GLOBAL_CONFIGURATION commands | ||
200 | * --------------------------------------------------------------------------*/ | ||
201 | |||
202 | /* the global configuration structure */ | ||
203 | typedef struct { | ||
204 | unsigned short adapter_config_options PACKED; /* adapter config options */ | ||
205 | unsigned short app_IRQ_timeout PACKED; /* application IRQ timeout */ | ||
206 | unsigned long adapter_operating_frequency PACKED; /* adapter operating frequency */ | ||
207 | } GLOBAL_CONFIGURATION_STRUCT; | ||
208 | |||
209 | /* settings for the 'app_IRQ_timeout' */ | ||
210 | #define MAX_APP_IRQ_TIMEOUT_VALUE 5000 /* the maximum permitted IRQ timeout */ | ||
211 | |||
212 | |||
213 | |||
214 | /* ---------------------------------------------------------------------------- | ||
215 | * Constants for the READ_GLOBAL_STATISTICS command | ||
216 | * --------------------------------------------------------------------------*/ | ||
217 | |||
218 | /* the global statistics structure */ | ||
219 | typedef struct { | ||
220 | unsigned short app_IRQ_timeout_count PACKED; | ||
221 | } GLOBAL_STATS_STRUCT; | ||
222 | |||
223 | |||
224 | |||
225 | /* ---------------------------------------------------------------------------- | ||
226 | * Constants for the READ_COMMS_ERROR_STATS command | ||
227 | * --------------------------------------------------------------------------*/ | ||
228 | |||
229 | /* the communications error statistics structure */ | ||
230 | typedef struct { | ||
231 | unsigned short Rx_overrun_err_count PACKED; | ||
232 | unsigned short CRC_err_count PACKED; /* receiver CRC error count */ | ||
233 | unsigned short Rx_abort_count PACKED; /* abort frames recvd count */ | ||
234 | unsigned short Rx_dis_pri_bfrs_full_count PACKED;/* receiver disabled */ | ||
235 | unsigned short comms_err_stat_reserved_1 PACKED;/* reserved for later */ | ||
236 | unsigned short sec_Tx_abort_msd_Tx_int_count PACKED; /* secondary - abort frames transmitted count (missed Tx interrupt) */ | ||
237 | unsigned short missed_Tx_und_int_count PACKED; /* missed tx underrun interrupt count */ | ||
238 | unsigned short sec_Tx_abort_count PACKED; /*secondary-abort frames tx count */ | ||
239 | unsigned short DCD_state_change_count PACKED; /* DCD state change */ | ||
240 | unsigned short CTS_state_change_count PACKED; /* CTS state change */ | ||
241 | } COMMS_ERROR_STATS_STRUCT; | ||
242 | |||
243 | |||
244 | |||
245 | /* ---------------------------------------------------------------------------- | ||
246 | * Constants used for line tracing | ||
247 | * --------------------------------------------------------------------------*/ | ||
248 | |||
249 | /* the trace configuration structure (SET_TRACE_CONFIGURATION/READ_TRACE_CONFIGURATION commands) */ | ||
250 | typedef struct { | ||
251 | unsigned char trace_config PACKED; /* trace configuration */ | ||
252 | unsigned short trace_deactivation_timer PACKED; /* trace deactivation timer */ | ||
253 | unsigned long ptr_trace_stat_el_cfg_struct PACKED; /* a pointer to the line trace element configuration structure */ | ||
254 | } LINE_TRACE_CONFIG_STRUCT; | ||
255 | |||
256 | /* 'trace_config' bit settings */ | ||
257 | #define TRACE_INACTIVE 0x00 /* trace is inactive */ | ||
258 | #define TRACE_ACTIVE 0x01 /* trace is active */ | ||
259 | #define TRACE_DELAY_MODE 0x04 /* operate the trace in delay mode */ | ||
260 | #define TRACE_DATA_FRAMES 0x08 /* trace Data frames */ | ||
261 | #define TRACE_SLARP_FRAMES 0x10 /* trace SLARP frames */ | ||
262 | #define TRACE_CDP_FRAMES 0x20 /* trace CDP frames */ | ||
263 | |||
264 | /* the line trace status element configuration structure */ | ||
265 | typedef struct { | ||
266 | unsigned short number_trace_status_elements PACKED; /* number of line trace elements */ | ||
267 | unsigned long base_addr_trace_status_elements PACKED; /* base address of the trace element list */ | ||
268 | unsigned long next_trace_element_to_use PACKED; /* pointer to the next trace element to be used */ | ||
269 | unsigned long base_addr_trace_buffer PACKED; /* base address of the trace data buffer */ | ||
270 | unsigned long end_addr_trace_buffer PACKED; /* end address of the trace data buffer */ | ||
271 | } TRACE_STATUS_EL_CFG_STRUCT; | ||
272 | |||
273 | /* the line trace status element structure */ | ||
274 | typedef struct { | ||
275 | unsigned char opp_flag PACKED; /* opp flag */ | ||
276 | unsigned short trace_length PACKED; /* trace length */ | ||
277 | unsigned char trace_type PACKED; /* trace type */ | ||
278 | unsigned short trace_time_stamp PACKED; /* time stamp */ | ||
279 | unsigned short trace_reserved_1 PACKED; /* reserved for later use */ | ||
280 | unsigned long trace_reserved_2 PACKED; /* reserved for later use */ | ||
281 | unsigned long ptr_data_bfr PACKED; /* ptr to the trace data buffer */ | ||
282 | } TRACE_STATUS_ELEMENT_STRUCT; | ||
283 | |||
284 | /* "trace_type" bit settings */ | ||
285 | #define TRACE_INCOMING 0x00 | ||
286 | #define TRACE_OUTGOINGING 0x01 | ||
287 | #define TRACE_INCOMING_ABORTED 0x10 | ||
288 | #define TRACE_INCOMING_CRC_ERROR 0x20 | ||
289 | #define TRACE_INCOMING_OVERRUN_ERROR 0x40 | ||
290 | |||
291 | |||
292 | |||
293 | /* the line trace statistics structure */ | ||
294 | typedef struct { | ||
295 | unsigned long frames_traced_count PACKED; /* number of frames traced */ | ||
296 | unsigned long trc_frms_not_recorded_count PACKED; /* number of trace frames discarded */ | ||
297 | } LINE_TRACE_STATS_STRUCT; | ||
298 | |||
299 | |||
300 | /* ---------------------------------------------------------------------------- | ||
301 | * Constants for the FT1_MONITOR_STATUS_CTRL command | ||
302 | * --------------------------------------------------------------------------*/ | ||
303 | |||
304 | #define DISABLE_FT1_STATUS_STATISTICS 0x00 /* disable the FT1 status and statistics monitoring */ | ||
305 | #define ENABLE_READ_FT1_STATUS 0x01 /* read the FT1 operational status */ | ||
306 | #define ENABLE_READ_FT1_OP_STATS 0x02 /* read the FT1 operational statistics */ | ||
307 | #define FLUSH_FT1_OP_STATS 0x04 /* flush the FT1 operational statistics */ | ||
308 | |||
309 | |||
310 | |||
311 | |||
312 | /* ---------------------------------------------------------------------------- | ||
313 | * Constants for the SET_CHDLC_CONFIGURATION command | ||
314 | * --------------------------------------------------------------------------*/ | ||
315 | |||
316 | /* the CHDLC configuration structure */ | ||
317 | typedef struct { | ||
318 | unsigned long baud_rate PACKED; /* the baud rate */ | ||
319 | unsigned short line_config_options PACKED; /* line configuration options */ | ||
320 | unsigned short modem_config_options PACKED; /* modem configration options */ | ||
321 | unsigned short modem_status_timer PACKED; /* timer for monitoring modem status changes */ | ||
322 | unsigned short CHDLC_API_options PACKED; /* CHDLC API options */ | ||
323 | unsigned short CHDLC_protocol_options PACKED; /* CHDLC protocol options */ | ||
324 | unsigned short percent_data_buffer_for_Tx PACKED; /* percentage data buffering used for Tx */ | ||
325 | unsigned short CHDLC_statistics_options PACKED; /* CHDLC operational statistics options */ | ||
326 | unsigned short max_CHDLC_data_field_length PACKED; /* the maximum length of the CHDLC Data field */ | ||
327 | unsigned short transmit_keepalive_timer PACKED; /* the transmit keepalive timer */ | ||
328 | unsigned short receive_keepalive_timer PACKED; /* the receive keepalive timer */ | ||
329 | unsigned short keepalive_error_tolerance PACKED; /* the receive keepalive error tolerance */ | ||
330 | unsigned short SLARP_request_timer PACKED; /* the SLARP request timer */ | ||
331 | unsigned long IP_address PACKED; /* the IP address */ | ||
332 | unsigned long IP_netmask PACKED; /* the IP netmask */ | ||
333 | unsigned long ptr_shared_mem_info_struct PACKED; /* a pointer to the shared memory area information structure */ | ||
334 | unsigned long ptr_CHDLC_Tx_stat_el_cfg_struct PACKED; /* a pointer to the transmit status element configuration structure */ | ||
335 | unsigned long ptr_CHDLC_Rx_stat_el_cfg_struct PACKED; /* a pointer to the receive status element configuration structure */ | ||
336 | } CHDLC_CONFIGURATION_STRUCT; | ||
337 | |||
338 | /* settings for the 'line_config_options' */ | ||
339 | #define INTERFACE_LEVEL_V35 0x0000 /* V.35 interface level */ | ||
340 | #define INTERFACE_LEVEL_RS232 0x0001 /* RS-232 interface level */ | ||
341 | |||
342 | /* settings for the 'modem_config_options' */ | ||
343 | |||
344 | #define DONT_RAISE_DTR_RTS_ON_EN_COMMS 0x0001 | ||
345 | /* don't automatically raise DTR and RTS when performing an | ||
346 | ENABLE_CHDLC_COMMUNICATIONS command */ | ||
347 | |||
348 | #define DONT_REPORT_CHG_IN_MODEM_STAT 0x0002 | ||
349 | /* don't report changes in modem status to the application */ | ||
350 | |||
351 | |||
352 | /* bit settings for the 'CHDLC_protocol_options' byte */ | ||
353 | |||
354 | #define IGNORE_DCD_FOR_LINK_STAT 0x0001 | ||
355 | /* ignore DCD in determining the CHDLC link status */ | ||
356 | |||
357 | #define IGNORE_CTS_FOR_LINK_STAT 0x0002 | ||
358 | /* ignore CTS in determining the CHDLC link status */ | ||
359 | |||
360 | #define IGNORE_KPALV_FOR_LINK_STAT 0x0004 | ||
361 | /* ignore keepalive frames in determining the CHDLC link status */ | ||
362 | |||
363 | #define SINGLE_TX_BUFFER 0x4000 | ||
364 | /* configure a single transmit buffer */ | ||
365 | |||
366 | #define HDLC_STREAMING_MODE 0x8000 | ||
367 | |||
368 | /* settings for the 'CHDLC_statistics_options' */ | ||
369 | |||
370 | #define CHDLC_TX_DATA_BYTE_COUNT_STAT 0x0001 | ||
371 | /* record the number of Data bytes transmitted */ | ||
372 | |||
373 | #define CHDLC_RX_DATA_BYTE_COUNT_STAT 0x0002 | ||
374 | /* record the number of Data bytes received */ | ||
375 | |||
376 | #define CHDLC_TX_THROUGHPUT_STAT 0x0004 | ||
377 | /* compute the Data frame transmit throughput */ | ||
378 | |||
379 | #define CHDLC_RX_THROUGHPUT_STAT 0x0008 | ||
380 | /* compute the Data frame receive throughput */ | ||
381 | |||
382 | |||
383 | /* permitted minimum and maximum values for setting the CHDLC configuration */ | ||
384 | #define PRI_MAX_BAUD_RATE_S508 2666666 /* PRIMARY - maximum baud rate (S508) */ | ||
385 | #define SEC_MAX_BAUD_RATE_S508 258064 /* SECONDARY - maximum baud rate (S508) */ | ||
386 | #define PRI_MAX_BAUD_RATE_S514 2750000 /* PRIMARY - maximum baud rate (S508) */ | ||
387 | #define SEC_MAX_BAUD_RATE_S514 515625 /* SECONDARY - maximum baud rate (S508) */ | ||
388 | |||
389 | #define MIN_MODEM_TIMER 0 /* minimum modem status timer */ | ||
390 | #define MAX_MODEM_TIMER 5000 /* maximum modem status timer */ | ||
391 | |||
392 | #define SEC_MAX_NO_DATA_BYTES_IN_FRAME 2048 /* SECONDARY - max length of the CHDLC data field */ | ||
393 | |||
394 | #define MIN_Tx_KPALV_TIMER 0 /* minimum transmit keepalive timer */ | ||
395 | #define MAX_Tx_KPALV_TIMER 60000 /* maximum transmit keepalive timer */ | ||
396 | #define DEFAULT_Tx_KPALV_TIMER 10000 /* default transmit keepalive timer */ | ||
397 | |||
398 | #define MIN_Rx_KPALV_TIMER 10 /* minimum receive keepalive timer */ | ||
399 | #define MAX_Rx_KPALV_TIMER 60000 /* maximum receive keepalive timer */ | ||
400 | #define DEFAULT_Rx_KPALV_TIMER 10000 /* default receive keepalive timer */ | ||
401 | |||
402 | #define MIN_KPALV_ERR_TOL 1 /* min kpalv error tolerance count */ | ||
403 | #define MAX_KPALV_ERR_TOL 20 /* max kpalv error tolerance count */ | ||
404 | #define DEFAULT_KPALV_ERR_TOL 3 /* default value */ | ||
405 | |||
406 | #define MIN_SLARP_REQ_TIMER 0 /* min transmit SLARP Request timer */ | ||
407 | #define MAX_SLARP_REQ_TIMER 60000 /* max transmit SLARP Request timer */ | ||
408 | #define DEFAULT_SLARP_REQ_TIMER 0 /* default value -- no SLARP */ | ||
409 | |||
410 | |||
411 | |||
412 | /* ---------------------------------------------------------------------------- | ||
413 | * Constants for the READ_CHDLC_LINK_STATUS command | ||
414 | * --------------------------------------------------------------------------*/ | ||
415 | |||
416 | /* the CHDLC status structure */ | ||
417 | typedef struct { | ||
418 | unsigned char CHDLC_link_status PACKED; /* CHDLC link status */ | ||
419 | unsigned char no_Data_frms_for_app PACKED; /* number of Data frames available for the application */ | ||
420 | unsigned char receiver_status PACKED; /* enabled/disabled */ | ||
421 | unsigned char SLARP_state PACKED; /* internal SLARP state */ | ||
422 | } CHDLC_LINK_STATUS_STRUCT; | ||
423 | |||
424 | /* settings for the 'CHDLC_link_status' variable */ | ||
425 | #define CHDLC_LINK_INACTIVE 0x00 /* the CHDLC link is inactive */ | ||
426 | #define CHDLC_LINK_ACTIVE 0x01 /* the CHDLC link is active */ | ||
427 | |||
428 | |||
429 | |||
430 | /* ---------------------------------------------------------------------------- | ||
431 | * Constants for the READ_CHDLC_OPERATIONAL_STATS command | ||
432 | * --------------------------------------------------------------------------*/ | ||
433 | |||
434 | /* the CHDLC operational statistics structure */ | ||
435 | typedef struct { | ||
436 | |||
437 | /* Data frame transmission statistics */ | ||
438 | unsigned long Data_frames_Tx_count PACKED; /* # of frames transmitted */ | ||
439 | unsigned long Data_bytes_Tx_count PACKED; /* # of bytes transmitted */ | ||
440 | unsigned long Data_Tx_throughput PACKED; /* transmit throughput */ | ||
441 | unsigned long no_ms_for_Data_Tx_thruput_comp PACKED; /* millisecond time used for the Tx throughput computation */ | ||
442 | unsigned long Tx_Data_discard_lgth_err_count PACKED; /* number of Data frames discarded (length error) */ | ||
443 | unsigned long reserved_Data_frm_Tx_stat1 PACKED; /* reserved for later */ | ||
444 | unsigned long reserved_Data_frm_Tx_stat2 PACKED; /* reserved for later */ | ||
445 | unsigned long reserved_Data_frm_Tx_stat3 PACKED; /* reserved for later */ | ||
446 | |||
447 | /* Data frame reception statistics */ | ||
448 | unsigned long Data_frames_Rx_count PACKED; /* number of frames received */ | ||
449 | unsigned long Data_bytes_Rx_count PACKED; /* number of bytes received */ | ||
450 | unsigned long Data_Rx_throughput PACKED; /* receive throughput */ | ||
451 | unsigned long no_ms_for_Data_Rx_thruput_comp PACKED; /* millisecond time used for the Rx throughput computation */ | ||
452 | unsigned long Rx_Data_discard_short_count PACKED; /* received Data frames discarded (too short) */ | ||
453 | unsigned long Rx_Data_discard_long_count PACKED; /* received Data frames discarded (too long) */ | ||
454 | unsigned long Rx_Data_discard_inactive_count PACKED; /* received Data frames discarded (link inactive) */ | ||
455 | unsigned long reserved_Data_frm_Rx_stat1 PACKED; /* reserved for later */ | ||
456 | |||
457 | /* SLARP frame transmission/reception statistics */ | ||
458 | unsigned long CHDLC_SLARP_REQ_Tx_count PACKED; /* number of SLARP Request frames transmitted */ | ||
459 | unsigned long CHDLC_SLARP_REQ_Rx_count PACKED; /* number of SLARP Request frames received */ | ||
460 | unsigned long CHDLC_SLARP_REPLY_Tx_count PACKED; /* number of SLARP Reply frames transmitted */ | ||
461 | unsigned long CHDLC_SLARP_REPLY_Rx_count PACKED; /* number of SLARP Reply frames received */ | ||
462 | unsigned long CHDLC_SLARP_KPALV_Tx_count PACKED; /* number of SLARP keepalive frames transmitted */ | ||
463 | unsigned long CHDLC_SLARP_KPALV_Rx_count PACKED; /* number of SLARP keepalive frames received */ | ||
464 | unsigned long reserved_SLARP_stat1 PACKED; /* reserved for later */ | ||
465 | unsigned long reserved_SLARP_stat2 PACKED; /* reserved for later */ | ||
466 | |||
467 | /* CDP frame transmission/reception statistics */ | ||
468 | unsigned long CHDLC_CDP_Tx_count PACKED; /* number of CDP frames transmitted */ | ||
469 | unsigned long CHDLC_CDP_Rx_count PACKED; /* number of CDP frames received */ | ||
470 | unsigned long reserved_CDP_stat1 PACKED; /* reserved for later */ | ||
471 | unsigned long reserved_CDP_stat2 PACKED; /* reserved for later */ | ||
472 | unsigned long reserved_CDP_stat3 PACKED; /* reserved for later */ | ||
473 | unsigned long reserved_CDP_stat4 PACKED; /* reserved for later */ | ||
474 | unsigned long reserved_CDP_stat5 PACKED; /* reserved for later */ | ||
475 | unsigned long reserved_CDP_stat6 PACKED; /* reserved for later */ | ||
476 | |||
477 | /* Incoming frames with a format error statistics */ | ||
478 | unsigned short Rx_frm_incomp_CHDLC_hdr_count PACKED; /* frames received of with incomplete Cisco HDLC header */ | ||
479 | unsigned short Rx_frms_too_long_count PACKED; /* frames received of excessive length count */ | ||
480 | unsigned short Rx_invalid_CHDLC_addr_count PACKED; /* frames received with an invalid CHDLC address count */ | ||
481 | unsigned short Rx_invalid_CHDLC_ctrl_count PACKED; /* frames received with an invalid CHDLC control field count */ | ||
482 | unsigned short Rx_invalid_CHDLC_type_count PACKED; /* frames received of an invalid CHDLC frame type count */ | ||
483 | unsigned short Rx_SLARP_invalid_code_count PACKED; /* SLARP frame received with an invalid packet code */ | ||
484 | unsigned short Rx_SLARP_Reply_bad_IP_addr PACKED; /* SLARP Reply received - bad IP address */ | ||
485 | unsigned short Rx_SLARP_Reply_bad_netmask PACKED; /* SLARP Reply received - bad netmask */ | ||
486 | unsigned long reserved_frm_format_err1 PACKED; /* reserved for later */ | ||
487 | unsigned long reserved_frm_format_err2 PACKED; /* reserved for later */ | ||
488 | unsigned long reserved_frm_format_err3 PACKED; /* reserved for later */ | ||
489 | unsigned long reserved_frm_format_err4 PACKED; /* reserved for later */ | ||
490 | |||
491 | /* CHDLC timeout/retry statistics */ | ||
492 | unsigned short SLARP_Rx_keepalive_TO_count PACKED; /* timeout count for incoming SLARP frames */ | ||
493 | unsigned short SLARP_Request_TO_count PACKED; /* timeout count for SLARP Request frames */ | ||
494 | unsigned long To_retry_reserved_stat1 PACKED; /* reserved for later */ | ||
495 | unsigned long To_retry_reserved_stat2 PACKED; /* reserved for later */ | ||
496 | unsigned long To_retry_reserved_stat3 PACKED; /* reserved for later */ | ||
497 | |||
498 | /* CHDLC link active/inactive and loopback statistics */ | ||
499 | unsigned short link_active_count PACKED; /* number of times that the link went active */ | ||
500 | unsigned short link_inactive_modem_count PACKED; /* number of times that the link went inactive (modem failure) */ | ||
501 | unsigned short link_inactive_keepalive_count PACKED; /* number of times that the link went inactive (keepalive failure) */ | ||
502 | unsigned short link_looped_count PACKED; /* link looped count */ | ||
503 | unsigned long link_status_reserved_stat1 PACKED; /* reserved for later use */ | ||
504 | unsigned long link_status_reserved_stat2 PACKED; /* reserved for later use */ | ||
505 | |||
506 | /* miscellaneous statistics */ | ||
507 | unsigned long reserved_misc_stat1 PACKED; /* reserved for later */ | ||
508 | unsigned long reserved_misc_stat2 PACKED; /* reserved for later */ | ||
509 | unsigned long reserved_misc_stat3 PACKED; /* reserved for later */ | ||
510 | unsigned long reserved_misc_stat4 PACKED; /* reserved for later */ | ||
511 | |||
512 | } CHDLC_OPERATIONAL_STATS_STRUCT; | ||
513 | |||
514 | |||
515 | |||
516 | /* ---------------------------------------------------------------------------- | ||
517 | * Constants for using application interrupts | ||
518 | * --------------------------------------------------------------------------*/ | ||
519 | |||
520 | /* the structure used for the SET_CHDLC_INTERRUPT_TRIGGERS/READ_CHDLC_INTERRUPT_TRIGGERS command */ | ||
521 | typedef struct { | ||
522 | unsigned char CHDLC_interrupt_triggers PACKED; /* CHDLC interrupt trigger configuration */ | ||
523 | unsigned char IRQ PACKED; /* IRQ to be used */ | ||
524 | unsigned short interrupt_timer PACKED; /* interrupt timer */ | ||
525 | unsigned short misc_interrupt_bits PACKED; /* miscellaneous bits */ | ||
526 | } CHDLC_INT_TRIGGERS_STRUCT; | ||
527 | |||
528 | /* 'CHDLC_interrupt_triggers' bit settings */ | ||
529 | #define APP_INT_ON_RX_FRAME 0x01 /* interrupt on Data frame reception */ | ||
530 | #define APP_INT_ON_TX_FRAME 0x02 /* interrupt when an Data frame may be transmitted */ | ||
531 | #define APP_INT_ON_COMMAND_COMPLETE 0x04 /* interrupt when an interface command is complete */ | ||
532 | #define APP_INT_ON_TIMER 0x08 /* interrupt on a defined millisecond timeout */ | ||
533 | #define APP_INT_ON_GLOBAL_EXCEP_COND 0x10 /* interrupt on a global exception condition */ | ||
534 | #define APP_INT_ON_CHDLC_EXCEP_COND 0x20 /* interrupt on an CHDLC exception condition */ | ||
535 | #define APP_INT_ON_TRACE_DATA_AVAIL 0x80 /* interrupt when trace data is available */ | ||
536 | |||
537 | /* interrupt types indicated at 'interrupt_type' byte of the INTERRUPT_INFORMATION_STRUCT */ | ||
538 | #define NO_APP_INTS_PEND 0x00 /* no interrups are pending */ | ||
539 | #define RX_APP_INT_PEND 0x01 /* a receive interrupt is pending */ | ||
540 | #define TX_APP_INT_PEND 0x02 /* a transmit interrupt is pending */ | ||
541 | #define COMMAND_COMPLETE_APP_INT_PEND 0x04 /* a 'command complete' interrupt is pending */ | ||
542 | #define TIMER_APP_INT_PEND 0x08 /* a timer interrupt is pending */ | ||
543 | #define GLOBAL_EXCEP_COND_APP_INT_PEND 0x10 /* a global exception condition interrupt is pending */ | ||
544 | #define CHDLC_EXCEP_COND_APP_INT_PEND 0x20 /* an CHDLC exception condition interrupt is pending */ | ||
545 | #define TRACE_DATA_AVAIL_APP_INT_PEND 0x80 /* a trace data available interrupt is pending */ | ||
546 | |||
547 | |||
548 | /* modem status changes */ | ||
549 | #define DCD_HIGH 0x08 | ||
550 | #define CTS_HIGH 0x20 | ||
551 | |||
552 | |||
553 | /* ---------------------------------------------------------------------------- | ||
554 | * Constants for Data frame transmission | ||
555 | * --------------------------------------------------------------------------*/ | ||
556 | |||
557 | /* the Data frame transmit status element configuration structure */ | ||
558 | typedef struct { | ||
559 | unsigned short number_Tx_status_elements PACKED; /* number of transmit status elements */ | ||
560 | unsigned long base_addr_Tx_status_elements PACKED; /* base address of the transmit element list */ | ||
561 | unsigned long next_Tx_status_element_to_use PACKED; /* pointer to the next transmit element to be used */ | ||
562 | } CHDLC_TX_STATUS_EL_CFG_STRUCT; | ||
563 | |||
564 | /* the Data frame transmit status element structure */ | ||
565 | typedef struct { | ||
566 | unsigned char opp_flag PACKED; /* opp flag */ | ||
567 | unsigned short frame_length PACKED; /* length of the frame to be transmitted */ | ||
568 | unsigned char reserved_1 PACKED; /* reserved for internal use */ | ||
569 | unsigned long reserved_2 PACKED; /* reserved for internal use */ | ||
570 | unsigned long reserved_3 PACKED; /* reserved for internal use */ | ||
571 | unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ | ||
572 | } CHDLC_DATA_TX_STATUS_EL_STRUCT; | ||
573 | |||
574 | |||
575 | |||
576 | /* ---------------------------------------------------------------------------- | ||
577 | * Constants for Data frame reception | ||
578 | * --------------------------------------------------------------------------*/ | ||
579 | |||
580 | /* the Data frame receive status element configuration structure */ | ||
581 | typedef struct { | ||
582 | unsigned short number_Rx_status_elements PACKED; /* number of receive status elements */ | ||
583 | unsigned long base_addr_Rx_status_elements PACKED; /* base address of the receive element list */ | ||
584 | unsigned long next_Rx_status_element_to_use PACKED; /* pointer to the next receive element to be used */ | ||
585 | unsigned long base_addr_Rx_buffer PACKED; /* base address of the receive data buffer */ | ||
586 | unsigned long end_addr_Rx_buffer PACKED; /* end address of the receive data buffer */ | ||
587 | } CHDLC_RX_STATUS_EL_CFG_STRUCT; | ||
588 | |||
589 | /* the Data frame receive status element structure */ | ||
590 | typedef struct { | ||
591 | unsigned char opp_flag PACKED; /* opp flag */ | ||
592 | unsigned short frame_length PACKED; /* length of the received frame */ | ||
593 | unsigned char error_flag PACKED; /* frame errors (HDLC_STREAMING_MODE)*/ | ||
594 | unsigned short time_stamp PACKED; /* receive time stamp (HDLC_STREAMING_MODE) */ | ||
595 | unsigned long reserved_1 PACKED; /* reserved for internal use */ | ||
596 | unsigned short reserved_2 PACKED; /* reserved for internal use */ | ||
597 | unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ | ||
598 | } CHDLC_DATA_RX_STATUS_EL_STRUCT; | ||
599 | |||
600 | |||
601 | |||
602 | /* ---------------------------------------------------------------------------- | ||
603 | * Constants defining the shared memory information area | ||
604 | * --------------------------------------------------------------------------*/ | ||
605 | |||
606 | /* the global information structure */ | ||
607 | typedef struct { | ||
608 | unsigned char global_status PACKED; /* global status */ | ||
609 | unsigned char modem_status PACKED; /* current modem status */ | ||
610 | unsigned char global_excep_conditions PACKED; /* global exception conditions */ | ||
611 | unsigned char glob_info_reserved[5] PACKED; /* reserved */ | ||
612 | unsigned char codename[4] PACKED; /* Firmware name */ | ||
613 | unsigned char codeversion[4] PACKED; /* Firmware version */ | ||
614 | } GLOBAL_INFORMATION_STRUCT; | ||
615 | |||
616 | /* the CHDLC information structure */ | ||
617 | typedef struct { | ||
618 | unsigned char CHDLC_status PACKED; /* CHDLC status */ | ||
619 | unsigned char CHDLC_excep_conditions PACKED; /* CHDLC exception conditions */ | ||
620 | unsigned char CHDLC_info_reserved[14] PACKED; /* reserved */ | ||
621 | } CHDLC_INFORMATION_STRUCT; | ||
622 | |||
623 | /* the interrupt information structure */ | ||
624 | typedef struct { | ||
625 | unsigned char interrupt_type PACKED; /* type of interrupt triggered */ | ||
626 | unsigned char interrupt_permission PACKED; /* interrupt permission mask */ | ||
627 | unsigned char int_info_reserved[14] PACKED; /* reserved */ | ||
628 | } INTERRUPT_INFORMATION_STRUCT; | ||
629 | |||
630 | /* the S508/FT1 information structure */ | ||
631 | typedef struct { | ||
632 | unsigned char parallel_port_A_input PACKED; /* input - parallel port A */ | ||
633 | unsigned char parallel_port_B_input PACKED; /* input - parallel port B */ | ||
634 | unsigned char FT1_info_reserved[14] PACKED; /* reserved */ | ||
635 | } FT1_INFORMATION_STRUCT; | ||
636 | |||
637 | /* the shared memory area information structure */ | ||
638 | typedef struct { | ||
639 | GLOBAL_INFORMATION_STRUCT global_info_struct PACKED; /* the global information structure */ | ||
640 | CHDLC_INFORMATION_STRUCT CHDLC_info_struct PACKED; /* the CHDLC information structure */ | ||
641 | INTERRUPT_INFORMATION_STRUCT interrupt_info_struct PACKED; /* the interrupt information structure */ | ||
642 | FT1_INFORMATION_STRUCT FT1_info_struct PACKED; /* the S508/FT1 information structure */ | ||
643 | } SHARED_MEMORY_INFO_STRUCT; | ||
644 | |||
645 | /* ---------------------------------------------------------------------------- | ||
646 | * UDP Management constants and structures | ||
647 | * --------------------------------------------------------------------------*/ | ||
648 | |||
649 | /* The embedded control block for UDP mgmt | ||
650 | This is essentially a mailbox structure, without the large data field */ | ||
651 | |||
652 | typedef struct { | ||
653 | unsigned char opp_flag PACKED; /* the opp flag */ | ||
654 | unsigned char command PACKED; /* the user command */ | ||
655 | unsigned short buffer_length PACKED; /* the data length */ | ||
656 | unsigned char return_code PACKED; /* the return code */ | ||
657 | unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; /* reserved for later */ | ||
658 | } cblock_t; | ||
659 | |||
660 | |||
661 | /* UDP management packet layout (data area of ip packet) */ | ||
662 | /* | ||
663 | typedef struct { | ||
664 | unsigned char signature[8] PACKED; | ||
665 | unsigned char request_reply PACKED; | ||
666 | unsigned char id PACKED; | ||
667 | unsigned char reserved[6] PACKED; | ||
668 | cblock_t cblock PACKED; | ||
669 | unsigned char num_frames PACKED; | ||
670 | unsigned char ismoredata PACKED; | ||
671 | unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; | ||
672 | } udp_management_packet_t; | ||
673 | |||
674 | */ | ||
675 | |||
676 | typedef struct { | ||
677 | unsigned char num_frames PACKED; | ||
678 | unsigned char ismoredata PACKED; | ||
679 | } trace_info_t; | ||
680 | |||
681 | typedef struct { | ||
682 | ip_pkt_t ip_pkt PACKED; | ||
683 | udp_pkt_t udp_pkt PACKED; | ||
684 | wp_mgmt_t wp_mgmt PACKED; | ||
685 | cblock_t cblock PACKED; | ||
686 | trace_info_t trace_info PACKED; | ||
687 | unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; | ||
688 | } chdlc_udp_pkt_t; | ||
689 | |||
690 | typedef struct ft1_exec_cmd{ | ||
691 | unsigned char command PACKED; /* the user command */ | ||
692 | unsigned short buffer_length PACKED; /* the data length */ | ||
693 | unsigned char return_code PACKED; /* the return code */ | ||
694 | unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; | ||
695 | } ft1_exec_cmd_t; | ||
696 | |||
697 | typedef struct { | ||
698 | unsigned char opp_flag PACKED; | ||
699 | ft1_exec_cmd_t cmd PACKED; | ||
700 | unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; | ||
701 | } ft1_exec_t; | ||
702 | |||
703 | #define UDPMGMT_SIGNATURE "CTPIPEAB" | ||
704 | |||
705 | |||
706 | /* UDP/IP packet (for UDP management) layout */ | ||
707 | /* | ||
708 | typedef struct { | ||
709 | unsigned char reserved[2] PACKED; | ||
710 | unsigned short ip_length PACKED; | ||
711 | unsigned char reserved2[4] PACKED; | ||
712 | unsigned char ip_ttl PACKED; | ||
713 | unsigned char ip_protocol PACKED; | ||
714 | unsigned short ip_checksum PACKED; | ||
715 | unsigned long ip_src_address PACKED; | ||
716 | unsigned long ip_dst_address PACKED; | ||
717 | unsigned short udp_src_port PACKED; | ||
718 | unsigned short udp_dst_port PACKED; | ||
719 | unsigned short udp_length PACKED; | ||
720 | unsigned short udp_checksum PACKED; | ||
721 | udp_management_packet_t um_packet PACKED; | ||
722 | } ip_packet_t; | ||
723 | */ | ||
724 | |||
725 | /* valid ip_protocol for UDP management */ | ||
726 | #define UDPMGMT_UDP_PROTOCOL 0x11 | ||
727 | |||
728 | |||
729 | typedef struct { | ||
730 | unsigned char status PACKED; | ||
731 | unsigned char data_avail PACKED; | ||
732 | unsigned short real_length PACKED; | ||
733 | unsigned short time_stamp PACKED; | ||
734 | unsigned char data[1] PACKED; | ||
735 | } trace_pkt_t; | ||
736 | |||
737 | typedef struct { | ||
738 | unsigned char error_flag PACKED; | ||
739 | unsigned short time_stamp PACKED; | ||
740 | unsigned char reserved[13] PACKED; | ||
741 | } api_rx_hdr_t; | ||
742 | |||
743 | typedef struct { | ||
744 | api_rx_hdr_t api_rx_hdr PACKED; | ||
745 | void * data PACKED; | ||
746 | } api_rx_element_t; | ||
747 | |||
748 | typedef struct { | ||
749 | unsigned char attr PACKED; | ||
750 | unsigned char reserved[15] PACKED; | ||
751 | } api_tx_hdr_t; | ||
752 | |||
753 | typedef struct { | ||
754 | api_tx_hdr_t api_tx_hdr PACKED; | ||
755 | void * data PACKED; | ||
756 | } api_tx_element_t; | ||
757 | |||
758 | /* ---------------------------------------------------------------------------- | ||
759 | * Constants for the SET_FT1_CONFIGURATION/READ_FT1_CONFIGURATION command | ||
760 | * --------------------------------------------------------------------------*/ | ||
761 | |||
762 | /* the FT1 configuration structure */ | ||
763 | typedef struct { | ||
764 | unsigned short framing_mode; | ||
765 | unsigned short encoding_mode; | ||
766 | unsigned short line_build_out; | ||
767 | unsigned short channel_base; | ||
768 | unsigned short baud_rate_kbps; /* the baud rate (in kbps) */ | ||
769 | unsigned short clock_mode; | ||
770 | } ft1_config_t; | ||
771 | |||
772 | /* settings for the 'framing_mode' */ | ||
773 | #define ESF_FRAMING 0x00 /* ESF framing */ | ||
774 | #define D4_FRAMING 0x01 /* D4 framing */ | ||
775 | |||
776 | /* settings for the 'encoding_mode' */ | ||
777 | #define B8ZS_ENCODING 0x00 /* B8ZS encoding */ | ||
778 | #define AMI_ENCODING 0x01 /* AMI encoding */ | ||
779 | |||
780 | /* settings for the 'line_build_out' */ | ||
781 | #define LN_BLD_CSU_0dB_DSX1_0_to_133 0x00 /* set build out to CSU (0db) or DSX-1 (0-133ft) */ | ||
782 | #define LN_BLD_DSX1_133_to_266 0x01 /* set build out DSX-1 (133-266ft) */ | ||
783 | #define LN_BLD_DSX1_266_to_399 0x02 /* set build out DSX-1 (266-399ft) */ | ||
784 | #define LN_BLD_DSX1_399_to_533 0x03 /* set build out DSX-1 (399-533ft) */ | ||
785 | #define LN_BLD_DSX1_533_to_655 0x04 /* set build out DSX-1 (533-655ft) */ | ||
786 | #define LN_BLD_CSU_NEG_7dB 0x05 /* set build out to CSU (-7.5db) */ | ||
787 | #define LN_BLD_CSU_NEG_15dB 0x06 /* set build out to CSU (-15db) */ | ||
788 | #define LN_BLD_CSU_NEG_22dB 0x07 /* set build out to CSU (-22.5db) */ | ||
789 | |||
790 | /* settings for the 'channel_base' */ | ||
791 | #define MIN_CHANNEL_BASE_VALUE 1 /* the minimum permitted channel base value */ | ||
792 | #define MAX_CHANNEL_BASE_VALUE 24 /* the maximum permitted channel base value */ | ||
793 | |||
794 | /* settings for the 'baud_rate_kbps' */ | ||
795 | #define MIN_BAUD_RATE_KBPS 0 /* the minimum permitted baud rate (kbps) */ | ||
796 | #define MAX_BAUD_RATE_KBPS 1536 /* the maximum permitted baud rate (kbps) */ | ||
797 | #define BAUD_RATE_FT1_AUTO_CONFIG 0xFFFF /* the baud rate used to trigger an automatic FT1 configuration */ | ||
798 | |||
799 | /* settings for the 'clock_mode' */ | ||
800 | #define CLOCK_MODE_NORMAL 0x00 /* clock mode set to normal (slave) */ | ||
801 | #define CLOCK_MODE_MASTER 0x01 /* clock mode set to master */ | ||
802 | |||
803 | |||
804 | #define BAUD_RATE_FT1_AUTO_CONFIG 0xFFFF | ||
805 | #define AUTO_FT1_CONFIG_NOT_COMPLETE 0x08 | ||
806 | #define AUTO_FT1_CFG_FAIL_OP_MODE 0x0C | ||
807 | #define AUTO_FT1_CFG_FAIL_INVALID_LINE 0x0D | ||
808 | |||
809 | |||
810 | #ifdef _MSC_ | ||
811 | # pragma pack() | ||
812 | #endif | ||
813 | #endif /* _SDLA_CHDLC_H */ | ||
diff --git a/include/linux/sdla_ppp.h b/include/linux/sdla_ppp.h deleted file mode 100644 index 6f3923179c29..000000000000 --- a/include/linux/sdla_ppp.h +++ /dev/null | |||
@@ -1,575 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdla_ppp.h Sangoma PPP firmware API definitions. | ||
3 | * | ||
4 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
5 | * | ||
6 | * Copyright: (c) 1995-1997 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * Feb 24, 2000 Nenad Corbic v2.1.2 | ||
14 | * Jan 06, 1997 Gene Kozin v2.0 | ||
15 | * Apr 11, 1996 Gene Kozin Initial version. | ||
16 | *****************************************************************************/ | ||
17 | #ifndef _SDLA_PPP_H | ||
18 | #define _SDLA_PPP_H | ||
19 | |||
20 | /*---------------------------------------------------------------------------- | ||
21 | * Notes: | ||
22 | * ------ | ||
23 | * 1. All structures defined in this file are byte-alined. | ||
24 | * | ||
25 | * Compiler Platform | ||
26 | * -------- -------- | ||
27 | * GNU C Linux | ||
28 | */ | ||
29 | |||
30 | #ifndef PACKED | ||
31 | # define PACKED __attribute__((packed)) | ||
32 | #endif /* PACKED */ | ||
33 | |||
34 | /* Adapter memory layout and important constants */ | ||
35 | #define PPP508_MB_VECT 0xE000 /* mailbox window vector */ | ||
36 | #define PPP508_MB_OFFS 0 /* mailbox offset */ | ||
37 | #define PPP508_FLG_OFFS 0x1000 /* status flags offset */ | ||
38 | #define PPP508_BUF_OFFS 0x1100 /* buffer info block offset */ | ||
39 | #define PPP514_MB_OFFS 0xE000 /* mailbox offset */ | ||
40 | #define PPP514_FLG_OFFS 0xF000 /* status flags offset */ | ||
41 | #define PPP514_BUF_OFFS 0xF100 /* buffer info block offset */ | ||
42 | |||
43 | #define PPP_MAX_DATA 1008 /* command block data buffer length */ | ||
44 | |||
45 | /****** Data Structures *****************************************************/ | ||
46 | |||
47 | /*---------------------------------------------------------------------------- | ||
48 | * PPP Command Block. | ||
49 | */ | ||
50 | typedef struct ppp_cmd{ | ||
51 | unsigned char command PACKED; /* command code */ | ||
52 | unsigned short length PACKED; /* length of data buffer */ | ||
53 | unsigned char result PACKED; /* return code */ | ||
54 | unsigned char rsrv[11] PACKED; /* reserved for future use */ | ||
55 | } ppp_cmd_t; | ||
56 | |||
57 | typedef struct cblock{ | ||
58 | unsigned char opp_flag PACKED; | ||
59 | unsigned char command PACKED; /* command code */ | ||
60 | unsigned short length PACKED; /* length of data buffer */ | ||
61 | unsigned char result PACKED; /* return code */ | ||
62 | unsigned char rsrv[11] PACKED; /* reserved for future use */ | ||
63 | } cblock_t; | ||
64 | |||
65 | typedef struct ppp_udp_pkt{ | ||
66 | ip_pkt_t ip_pkt PACKED; | ||
67 | udp_pkt_t udp_pkt PACKED; | ||
68 | wp_mgmt_t wp_mgmt PACKED; | ||
69 | cblock_t cblock PACKED; | ||
70 | unsigned char data[MAX_LGTH_UDP_MGNT_PKT] PACKED; | ||
71 | } ppp_udp_pkt_t; | ||
72 | |||
73 | typedef struct { | ||
74 | unsigned char status PACKED; | ||
75 | unsigned char data_avail PACKED; | ||
76 | unsigned short real_length PACKED; | ||
77 | unsigned short time_stamp PACKED; | ||
78 | unsigned char data[1] PACKED; | ||
79 | } trace_pkt_t; | ||
80 | |||
81 | |||
82 | typedef struct { | ||
83 | unsigned char opp_flag PACKED; | ||
84 | unsigned char trace_type PACKED; | ||
85 | unsigned short trace_length PACKED; | ||
86 | unsigned short trace_data_ptr PACKED; | ||
87 | unsigned short trace_time_stamp PACKED; | ||
88 | } trace_element_t; | ||
89 | |||
90 | /* 'command' field defines */ | ||
91 | #define PPP_READ_CODE_VERSION 0x10 /* configuration commands */ | ||
92 | #define PPP_SET_CONFIG 0x05 | ||
93 | #define PPP_READ_CONFIG 0x06 | ||
94 | #define PPP_SET_INTR_FLAGS 0x20 | ||
95 | #define PPP_READ_INTR_FLAGS 0x21 | ||
96 | #define PPP_SET_INBOUND_AUTH 0x30 | ||
97 | #define PPP_SET_OUTBOUND_AUTH 0x31 | ||
98 | #define PPP_GET_CONNECTION_INFO 0x32 | ||
99 | |||
100 | #define PPP_COMM_ENABLE 0x03 /* operational commands */ | ||
101 | #define PPP_COMM_DISABLE 0x04 | ||
102 | #define PPP_SEND_SIGN_FRAME 0x23 | ||
103 | #define PPP_READ_SIGN_RESPONSE 0x24 | ||
104 | #define PPP_DATALINE_MONITOR 0x33 | ||
105 | |||
106 | #define PPP_READ_STATISTICS 0x07 /* statistics commands */ | ||
107 | #define PPP_FLUSH_STATISTICS 0x08 | ||
108 | #define PPP_READ_ERROR_STATS 0x09 | ||
109 | #define PPP_FLUSH_ERROR_STATS 0x0A | ||
110 | #define PPP_READ_PACKET_STATS 0x12 | ||
111 | #define PPP_FLUSH_PACKET_STATS 0x13 | ||
112 | #define PPP_READ_LCP_STATS 0x14 | ||
113 | #define PPP_FLUSH_LCP_STATS 0x15 | ||
114 | #define PPP_READ_LPBK_STATS 0x16 | ||
115 | #define PPP_FLUSH_LPBK_STATS 0x17 | ||
116 | #define PPP_READ_IPCP_STATS 0x18 | ||
117 | #define PPP_FLUSH_IPCP_STATS 0x19 | ||
118 | #define PPP_READ_IPXCP_STATS 0x1A | ||
119 | #define PPP_FLUSH_IPXCP_STATS 0x1B | ||
120 | #define PPP_READ_PAP_STATS 0x1C | ||
121 | #define PPP_FLUSH_PAP_STATS 0x1D | ||
122 | #define PPP_READ_CHAP_STATS 0x1E | ||
123 | #define PPP_FLUSH_CHAP_STATS 0x1F | ||
124 | |||
125 | /* 'result' field defines */ | ||
126 | #define PPPRES_OK 0x00 /* command executed successfully */ | ||
127 | #define PPPRES_INVALID_STATE 0x09 /* invalid command in this context */ | ||
128 | |||
129 | /*---------------------------------------------------------------------------- | ||
130 | * PPP Mailbox. | ||
131 | * This structure is located at offset PPP???_MB_OFFS into PPP???_MB_VECT | ||
132 | */ | ||
133 | typedef struct ppp_mbox | ||
134 | { | ||
135 | unsigned char flag PACKED; /* 00h: command execution flag */ | ||
136 | ppp_cmd_t cmd PACKED; /* 01h: command block */ | ||
137 | unsigned char data[1] PACKED; /* 10h: variable length data buffer */ | ||
138 | } ppp_mbox_t; | ||
139 | |||
140 | /*---------------------------------------------------------------------------- | ||
141 | * PPP Status Flags. | ||
142 | * This structure is located at offset PPP???_FLG_OFFS into | ||
143 | * PPP???_MB_VECT. | ||
144 | */ | ||
145 | typedef struct ppp_flags | ||
146 | { | ||
147 | unsigned char iflag PACKED; /* 00: interrupt flag */ | ||
148 | unsigned char imask PACKED; /* 01: interrupt mask */ | ||
149 | unsigned char resrv PACKED; | ||
150 | unsigned char mstatus PACKED; /* 03: modem status */ | ||
151 | unsigned char lcp_state PACKED; /* 04: LCP state */ | ||
152 | unsigned char ppp_phase PACKED; /* 05: PPP phase */ | ||
153 | unsigned char ip_state PACKED; /* 06: IPCP state */ | ||
154 | unsigned char ipx_state PACKED; /* 07: IPXCP state */ | ||
155 | unsigned char pap_state PACKED; /* 08: PAP state */ | ||
156 | unsigned char chap_state PACKED; /* 09: CHAP state */ | ||
157 | unsigned short disc_cause PACKED; /* 0A: disconnection cause */ | ||
158 | } ppp_flags_t; | ||
159 | |||
160 | /* 'iflag' defines */ | ||
161 | #define PPP_INTR_RXRDY 0x01 /* Rx ready */ | ||
162 | #define PPP_INTR_TXRDY 0x02 /* Tx ready */ | ||
163 | #define PPP_INTR_MODEM 0x04 /* modem status change (DCD, CTS) */ | ||
164 | #define PPP_INTR_CMD 0x08 /* interface command completed */ | ||
165 | #define PPP_INTR_DISC 0x10 /* data link disconnected */ | ||
166 | #define PPP_INTR_OPEN 0x20 /* data link open */ | ||
167 | #define PPP_INTR_DROP_DTR 0x40 /* DTR drop timeout expired */ | ||
168 | #define PPP_INTR_TIMER 0x80 /* timer interrupt */ | ||
169 | |||
170 | |||
171 | /* 'mstatus' defines */ | ||
172 | #define PPP_MDM_DCD 0x08 /* mdm_status: DCD */ | ||
173 | #define PPP_MDM_CTS 0x20 /* mdm_status: CTS */ | ||
174 | |||
175 | /* 'disc_cause' defines */ | ||
176 | #define PPP_LOCAL_TERMINATION 0x0001 /* Local Request by PPP termination phase */ | ||
177 | #define PPP_DCD_CTS_DROP 0x0002 /* DCD and/or CTS dropped. Link down */ | ||
178 | #define PPP_REMOTE_TERMINATION 0x0800 /* Remote Request by PPP termination phase */ | ||
179 | |||
180 | /* 'misc_config_bits' defines */ | ||
181 | #define DONT_RE_TX_ABORTED_I_FRAMES 0x01 | ||
182 | #define TX_FRM_BYTE_COUNT_STATS 0x02 | ||
183 | #define RX_FRM_BYTE_COUNT_STATS 0x04 | ||
184 | #define TIME_STAMP_IN_RX_FRAMES 0x08 | ||
185 | #define NON_STD_ADPTR_FREQ 0x10 | ||
186 | #define INTERFACE_LEVEL_RS232 0x20 | ||
187 | #define AUTO_LINK_RECOVERY 0x100 | ||
188 | #define DONT_TERMINATE_LNK_MAX_CONFIG 0x200 | ||
189 | |||
190 | /* 'authentication options' defines */ | ||
191 | #define NO_AUTHENTICATION 0x00 | ||
192 | #define INBOUND_AUTH 0x80 | ||
193 | #define PAP_AUTH 0x01 | ||
194 | #define CHAP_AUTH 0x02 | ||
195 | |||
196 | /* 'ip options' defines */ | ||
197 | #define L_AND_R_IP_NO_ASSIG 0x00 | ||
198 | #define L_IP_LOCAL_ASSIG 0x01 | ||
199 | #define L_IP_REMOTE_ASSIG 0x02 | ||
200 | #define R_IP_LOCAL_ASSIG 0x04 | ||
201 | #define R_IP_REMOTE_ASSIG 0x08 | ||
202 | #define ENABLE_IP 0x80 | ||
203 | |||
204 | /* 'ipx options' defines */ | ||
205 | #define ROUTING_PROT_DEFAULT 0x20 | ||
206 | #define ENABLE_IPX 0x80 | ||
207 | #define DISABLE_IPX 0x00 | ||
208 | |||
209 | /*---------------------------------------------------------------------------- | ||
210 | * PPP Buffer Info. | ||
211 | * This structure is located at offset PPP508_BUF_OFFS into | ||
212 | * PPP508_MB_VECT. | ||
213 | */ | ||
214 | typedef struct ppp508_buf_info | ||
215 | { | ||
216 | unsigned short txb_num PACKED; /* 00: number of transmit buffers */ | ||
217 | unsigned long txb_ptr PACKED; /* 02: pointer to the buffer ctl. */ | ||
218 | unsigned long txb_nxt PACKED; | ||
219 | unsigned char rsrv1[22] PACKED; | ||
220 | unsigned short rxb_num PACKED; /* 20: number of receive buffers */ | ||
221 | unsigned long rxb_ptr PACKED; /* 22: pointer to the buffer ctl. */ | ||
222 | unsigned long rxb1_ptr PACKED; /* 26: pointer to the first buf.ctl. */ | ||
223 | unsigned long rxb_base PACKED; /* 2A: pointer to the buffer base */ | ||
224 | unsigned char rsrv2[2] PACKED; | ||
225 | unsigned long rxb_end PACKED; /* 30: pointer to the buffer end */ | ||
226 | } ppp508_buf_info_t; | ||
227 | |||
228 | /*---------------------------------------------------------------------------- | ||
229 | * Transmit/Receive Buffer Control Block. | ||
230 | */ | ||
231 | typedef struct ppp_buf_ctl | ||
232 | { | ||
233 | unsigned char flag PACKED; /* 00: 'buffer ready' flag */ | ||
234 | unsigned short length PACKED; /* 01: length of data */ | ||
235 | unsigned char reserved1[1] PACKED; /* 03: */ | ||
236 | unsigned char proto PACKED; /* 04: protocol */ | ||
237 | unsigned short timestamp PACKED; /* 05: time stamp (Rx only) */ | ||
238 | unsigned char reserved2[5] PACKED; /* 07: */ | ||
239 | union | ||
240 | { | ||
241 | unsigned short o_p[2]; /* 1C: buffer offset & page (S502) */ | ||
242 | unsigned long ptr; /* 1C: buffer pointer (S508) */ | ||
243 | } buf PACKED; | ||
244 | } ppp_buf_ctl_t; | ||
245 | |||
246 | /*---------------------------------------------------------------------------- | ||
247 | * S508 Adapter Configuration Block (passed to the PPP_SET_CONFIG command). | ||
248 | */ | ||
249 | typedef struct ppp508_conf | ||
250 | { | ||
251 | unsigned long line_speed PACKED; /* 00: baud rate, bps */ | ||
252 | unsigned short txbuf_percent PACKED; /* 04: % of Tx buffer */ | ||
253 | unsigned short conf_flags PACKED; /* 06: configuration bits */ | ||
254 | unsigned short mtu_local PACKED; /* 08: local MTU */ | ||
255 | unsigned short mtu_remote PACKED; /* 0A: remote MTU */ | ||
256 | unsigned short restart_tmr PACKED; /* 0C: restart timer */ | ||
257 | unsigned short auth_rsrt_tmr PACKED; /* 0E: authentication timer */ | ||
258 | unsigned short auth_wait_tmr PACKED; /* 10: authentication timer */ | ||
259 | unsigned short mdm_fail_tmr PACKED; /* 12: modem failure timer */ | ||
260 | unsigned short dtr_drop_tmr PACKED; /* 14: DTR drop timer */ | ||
261 | unsigned short connect_tmout PACKED; /* 16: connection timeout */ | ||
262 | unsigned short conf_retry PACKED; /* 18: max. retry */ | ||
263 | unsigned short term_retry PACKED; /* 1A: max. retry */ | ||
264 | unsigned short fail_retry PACKED; /* 1C: max. retry */ | ||
265 | unsigned short auth_retry PACKED; /* 1E: max. retry */ | ||
266 | unsigned char auth_options PACKED; /* 20: authentication opt. */ | ||
267 | unsigned char ip_options PACKED; /* 21: IP options */ | ||
268 | unsigned long ip_local PACKED; /* 22: local IP address */ | ||
269 | unsigned long ip_remote PACKED; /* 26: remote IP address */ | ||
270 | unsigned char ipx_options PACKED; /* 2A: IPX options */ | ||
271 | unsigned char ipx_netno[4] PACKED; /* 2B: IPX net number */ | ||
272 | unsigned char ipx_local[6] PACKED; /* 2F: local IPX node number*/ | ||
273 | unsigned char ipx_remote[6] PACKED; /* 35: remote IPX node num.*/ | ||
274 | unsigned char ipx_router[48] PACKED; /* 3B: IPX router name*/ | ||
275 | unsigned long alt_cpu_clock PACKED; /* 6B: */ | ||
276 | } ppp508_conf_t; | ||
277 | |||
278 | /*---------------------------------------------------------------------------- | ||
279 | * S508 Adapter Read Connection Information Block | ||
280 | * Returned by the PPP_GET_CONNECTION_INFO command | ||
281 | */ | ||
282 | typedef struct ppp508_connect_info | ||
283 | { | ||
284 | unsigned short mru PACKED; /* 00-01 Remote Max Rec' Unit */ | ||
285 | unsigned char ip_options PACKED; /* 02: Negotiated ip options */ | ||
286 | unsigned long ip_local PACKED; /* 03-06: local IP address */ | ||
287 | unsigned long ip_remote PACKED; /* 07-0A: remote IP address */ | ||
288 | unsigned char ipx_options PACKED; /* 0B: Negotiated ipx options */ | ||
289 | unsigned char ipx_netno[4] PACKED; /* 0C-0F: IPX net number */ | ||
290 | unsigned char ipx_local[6] PACKED; /* 10-1F: local IPX node # */ | ||
291 | unsigned char ipx_remote[6] PACKED; /* 16-1B: remote IPX node # */ | ||
292 | unsigned char ipx_router[48] PACKED; /* 1C-4B: IPX router name */ | ||
293 | unsigned char auth_status PACKED; /* 4C: Authentication Status */ | ||
294 | unsigned char inbd_auth_peerID[1] PACKED; /* 4D: variable length inbound authenticated peer ID */ | ||
295 | } ppp508_connect_info_t; | ||
296 | |||
297 | /* 'line_speed' field */ | ||
298 | #define PPP_BITRATE_1200 0x01 | ||
299 | #define PPP_BITRATE_2400 0x02 | ||
300 | #define PPP_BITRATE_4800 0x03 | ||
301 | #define PPP_BITRATE_9600 0x04 | ||
302 | #define PPP_BITRATE_19200 0x05 | ||
303 | #define PPP_BITRATE_38400 0x06 | ||
304 | #define PPP_BITRATE_45000 0x07 | ||
305 | #define PPP_BITRATE_56000 0x08 | ||
306 | #define PPP_BITRATE_64000 0x09 | ||
307 | #define PPP_BITRATE_74000 0x0A | ||
308 | #define PPP_BITRATE_112000 0x0B | ||
309 | #define PPP_BITRATE_128000 0x0C | ||
310 | #define PPP_BITRATE_156000 0x0D | ||
311 | |||
312 | /* Defines for the 'conf_flags' field */ | ||
313 | #define PPP_IGNORE_TX_ABORT 0x01 /* don't re-transmit aborted frames */ | ||
314 | #define PPP_ENABLE_TX_STATS 0x02 /* enable Tx statistics */ | ||
315 | #define PPP_ENABLE_RX_STATS 0x04 /* enable Rx statistics */ | ||
316 | #define PPP_ENABLE_TIMESTAMP 0x08 /* enable timestamp */ | ||
317 | |||
318 | /* 'ip_options' defines */ | ||
319 | #define PPP_LOCAL_IP_LOCAL 0x01 | ||
320 | #define PPP_LOCAL_IP_REMOTE 0x02 | ||
321 | #define PPP_REMOTE_IP_LOCAL 0x04 | ||
322 | #define PPP_REMOTE_IP_REMOTE 0x08 | ||
323 | |||
324 | /* 'ipx_options' defines */ | ||
325 | #define PPP_REMOTE_IPX_NETNO 0x01 | ||
326 | #define PPP_REMOTE_IPX_LOCAL 0x02 | ||
327 | #define PPP_REMOTE_IPX_REMOTE 0x04 | ||
328 | #define PPP_IPX_ROUTE_RIP_SAP 0x08 | ||
329 | #define PPP_IPX_ROUTE_NLSP 0x10 | ||
330 | #define PPP_IPX_ROUTE_DEFAULT 0x20 | ||
331 | #define PPP_IPX_CONF_COMPLETE 0x40 | ||
332 | #define PPP_IPX_ENABLE 0x80 | ||
333 | |||
334 | /*---------------------------------------------------------------------------- | ||
335 | * S508 Adapter Configuration Block (returned by the PPP_READ_CONFIG command). | ||
336 | */ | ||
337 | typedef struct ppp508_get_conf | ||
338 | { | ||
339 | unsigned long bps PACKED; /* 00: baud rate, bps */ | ||
340 | ppp508_conf_t conf PACKED; /* 04: requested config. */ | ||
341 | unsigned short txb_num PACKED; /* 6F: number of Tx buffers */ | ||
342 | unsigned short rxb_num PACKED; /* 71: number of Rx buffers */ | ||
343 | } ppp508_get_conf_t; | ||
344 | |||
345 | /*---------------------------------------------------------------------------- | ||
346 | * S508 Operational Statistics (returned by the PPP_READ_STATISTIC command). | ||
347 | */ | ||
348 | typedef struct ppp508_stats | ||
349 | { | ||
350 | unsigned short reserved1 PACKED; /* 00: */ | ||
351 | unsigned short rx_bad_len PACKED; /* 02: */ | ||
352 | unsigned short reserved2 PACKED; /* 04: */ | ||
353 | unsigned long tx_frames PACKED; /* 06: */ | ||
354 | unsigned long tx_bytes PACKED; /* 0A: */ | ||
355 | unsigned long rx_frames PACKED; /* 0E: */ | ||
356 | unsigned long rx_bytes PACKED; /* 12: */ | ||
357 | } ppp508_stats_t; | ||
358 | |||
359 | /*---------------------------------------------------------------------------- | ||
360 | * Adapter Error Statistics (returned by the PPP_READ_ERROR_STATS command). | ||
361 | */ | ||
362 | typedef struct ppp_err_stats | ||
363 | { | ||
364 | unsigned char rx_overrun PACKED; /* 00: Rx overrun errors */ | ||
365 | unsigned char rx_bad_crc PACKED; /* 01: Rx CRC errors */ | ||
366 | unsigned char rx_abort PACKED; /* 02: Rx aborted frames */ | ||
367 | unsigned char rx_lost PACKED; /* 03: Rx frames lost */ | ||
368 | unsigned char tx_abort PACKED; /* 04: Tx aborted frames */ | ||
369 | unsigned char tx_underrun PACKED; /* 05: Tx underrun errors */ | ||
370 | unsigned char tx_missed_intr PACKED; /* 06: Tx underruns missed */ | ||
371 | unsigned char reserved PACKED; /* 07: Tx underruns missed */ | ||
372 | unsigned char dcd_trans PACKED; /* 08: DCD transitions */ | ||
373 | unsigned char cts_trans PACKED; /* 09: CTS transitions */ | ||
374 | } ppp_err_stats_t; | ||
375 | |||
376 | /*---------------------------------------------------------------------------- | ||
377 | * Packet Statistics (returned by the PPP_READ_PACKET_STATS command). | ||
378 | */ | ||
379 | typedef struct ppp_pkt_stats | ||
380 | { | ||
381 | unsigned short rx_bad_header PACKED; /* 00: */ | ||
382 | unsigned short rx_prot_unknwn PACKED; /* 02: */ | ||
383 | unsigned short rx_too_large PACKED; /* 04: */ | ||
384 | unsigned short rx_lcp PACKED; /* 06: */ | ||
385 | unsigned short tx_lcp PACKED; /* 08: */ | ||
386 | unsigned short rx_ipcp PACKED; /* 0A: */ | ||
387 | unsigned short tx_ipcp PACKED; /* 0C: */ | ||
388 | unsigned short rx_ipxcp PACKED; /* 0E: */ | ||
389 | unsigned short tx_ipxcp PACKED; /* 10: */ | ||
390 | unsigned short rx_pap PACKED; /* 12: */ | ||
391 | unsigned short tx_pap PACKED; /* 14: */ | ||
392 | unsigned short rx_chap PACKED; /* 16: */ | ||
393 | unsigned short tx_chap PACKED; /* 18: */ | ||
394 | unsigned short rx_lqr PACKED; /* 1A: */ | ||
395 | unsigned short tx_lqr PACKED; /* 1C: */ | ||
396 | unsigned short rx_ip PACKED; /* 1E: */ | ||
397 | unsigned short tx_ip PACKED; /* 20: */ | ||
398 | unsigned short rx_ipx PACKED; /* 22: */ | ||
399 | unsigned short tx_ipx PACKED; /* 24: */ | ||
400 | } ppp_pkt_stats_t; | ||
401 | |||
402 | /*---------------------------------------------------------------------------- | ||
403 | * LCP Statistics (returned by the PPP_READ_LCP_STATS command). | ||
404 | */ | ||
405 | typedef struct ppp_lcp_stats | ||
406 | { | ||
407 | unsigned short rx_unknown PACKED; /* 00: unknown LCP type */ | ||
408 | unsigned short rx_conf_rqst PACKED; /* 02: Configure-Request */ | ||
409 | unsigned short rx_conf_ack PACKED; /* 04: Configure-Ack */ | ||
410 | unsigned short rx_conf_nak PACKED; /* 06: Configure-Nak */ | ||
411 | unsigned short rx_conf_rej PACKED; /* 08: Configure-Reject */ | ||
412 | unsigned short rx_term_rqst PACKED; /* 0A: Terminate-Request */ | ||
413 | unsigned short rx_term_ack PACKED; /* 0C: Terminate-Ack */ | ||
414 | unsigned short rx_code_rej PACKED; /* 0E: Code-Reject */ | ||
415 | unsigned short rx_proto_rej PACKED; /* 10: Protocol-Reject */ | ||
416 | unsigned short rx_echo_rqst PACKED; /* 12: Echo-Request */ | ||
417 | unsigned short rx_echo_reply PACKED; /* 14: Echo-Reply */ | ||
418 | unsigned short rx_disc_rqst PACKED; /* 16: Discard-Request */ | ||
419 | unsigned short tx_conf_rqst PACKED; /* 18: Configure-Request */ | ||
420 | unsigned short tx_conf_ack PACKED; /* 1A: Configure-Ack */ | ||
421 | unsigned short tx_conf_nak PACKED; /* 1C: Configure-Nak */ | ||
422 | unsigned short tx_conf_rej PACKED; /* 1E: Configure-Reject */ | ||
423 | unsigned short tx_term_rqst PACKED; /* 20: Terminate-Request */ | ||
424 | unsigned short tx_term_ack PACKED; /* 22: Terminate-Ack */ | ||
425 | unsigned short tx_code_rej PACKED; /* 24: Code-Reject */ | ||
426 | unsigned short tx_proto_rej PACKED; /* 26: Protocol-Reject */ | ||
427 | unsigned short tx_echo_rqst PACKED; /* 28: Echo-Request */ | ||
428 | unsigned short tx_echo_reply PACKED; /* 2A: Echo-Reply */ | ||
429 | unsigned short tx_disc_rqst PACKED; /* 2E: Discard-Request */ | ||
430 | unsigned short rx_too_large PACKED; /* 30: packets too large */ | ||
431 | unsigned short rx_ack_inval PACKED; /* 32: invalid Conf-Ack */ | ||
432 | unsigned short rx_rej_inval PACKED; /* 34: invalid Conf-Reject */ | ||
433 | unsigned short rx_rej_badid PACKED; /* 36: Conf-Reject w/bad ID */ | ||
434 | } ppp_lcp_stats_t; | ||
435 | |||
436 | /*---------------------------------------------------------------------------- | ||
437 | * Loopback Error Statistics (returned by the PPP_READ_LPBK_STATS command). | ||
438 | */ | ||
439 | typedef struct ppp_lpbk_stats | ||
440 | { | ||
441 | unsigned short conf_magic PACKED; /* 00: */ | ||
442 | unsigned short loc_echo_rqst PACKED; /* 02: */ | ||
443 | unsigned short rem_echo_rqst PACKED; /* 04: */ | ||
444 | unsigned short loc_echo_reply PACKED; /* 06: */ | ||
445 | unsigned short rem_echo_reply PACKED; /* 08: */ | ||
446 | unsigned short loc_disc_rqst PACKED; /* 0A: */ | ||
447 | unsigned short rem_disc_rqst PACKED; /* 0C: */ | ||
448 | unsigned short echo_tx_collsn PACKED; /* 0E: */ | ||
449 | unsigned short echo_rx_collsn PACKED; /* 10: */ | ||
450 | } ppp_lpbk_stats_t; | ||
451 | |||
452 | /*---------------------------------------------------------------------------- | ||
453 | * Protocol Statistics (returned by the PPP_READ_IPCP_STATS and | ||
454 | * PPP_READ_IPXCP_STATS commands). | ||
455 | */ | ||
456 | typedef struct ppp_prot_stats | ||
457 | { | ||
458 | unsigned short rx_unknown PACKED; /* 00: unknown type */ | ||
459 | unsigned short rx_conf_rqst PACKED; /* 02: Configure-Request */ | ||
460 | unsigned short rx_conf_ack PACKED; /* 04: Configure-Ack */ | ||
461 | unsigned short rx_conf_nak PACKED; /* 06: Configure-Nak */ | ||
462 | unsigned short rx_conf_rej PACKED; /* 08: Configure-Reject */ | ||
463 | unsigned short rx_term_rqst PACKED; /* 0A: Terminate-Request */ | ||
464 | unsigned short rx_term_ack PACKED; /* 0C: Terminate-Ack */ | ||
465 | unsigned short rx_code_rej PACKED; /* 0E: Code-Reject */ | ||
466 | unsigned short reserved PACKED; /* 10: */ | ||
467 | unsigned short tx_conf_rqst PACKED; /* 12: Configure-Request */ | ||
468 | unsigned short tx_conf_ack PACKED; /* 14: Configure-Ack */ | ||
469 | unsigned short tx_conf_nak PACKED; /* 16: Configure-Nak */ | ||
470 | unsigned short tx_conf_rej PACKED; /* 18: Configure-Reject */ | ||
471 | unsigned short tx_term_rqst PACKED; /* 1A: Terminate-Request */ | ||
472 | unsigned short tx_term_ack PACKED; /* 1C: Terminate-Ack */ | ||
473 | unsigned short tx_code_rej PACKED; /* 1E: Code-Reject */ | ||
474 | unsigned short rx_too_large PACKED; /* 20: packets too large */ | ||
475 | unsigned short rx_ack_inval PACKED; /* 22: invalid Conf-Ack */ | ||
476 | unsigned short rx_rej_inval PACKED; /* 24: invalid Conf-Reject */ | ||
477 | unsigned short rx_rej_badid PACKED; /* 26: Conf-Reject w/bad ID */ | ||
478 | } ppp_prot_stats_t; | ||
479 | |||
480 | /*---------------------------------------------------------------------------- | ||
481 | * PAP Statistics (returned by the PPP_READ_PAP_STATS command). | ||
482 | */ | ||
483 | typedef struct ppp_pap_stats | ||
484 | { | ||
485 | unsigned short rx_unknown PACKED; /* 00: unknown type */ | ||
486 | unsigned short rx_auth_rqst PACKED; /* 02: Authenticate-Request */ | ||
487 | unsigned short rx_auth_ack PACKED; /* 04: Authenticate-Ack */ | ||
488 | unsigned short rx_auth_nak PACKED; /* 06: Authenticate-Nak */ | ||
489 | unsigned short reserved PACKED; /* 08: */ | ||
490 | unsigned short tx_auth_rqst PACKED; /* 0A: Authenticate-Request */ | ||
491 | unsigned short tx_auth_ack PACKED; /* 0C: Authenticate-Ack */ | ||
492 | unsigned short tx_auth_nak PACKED; /* 0E: Authenticate-Nak */ | ||
493 | unsigned short rx_too_large PACKED; /* 10: packets too large */ | ||
494 | unsigned short rx_bad_peerid PACKED; /* 12: invalid peer ID */ | ||
495 | unsigned short rx_bad_passwd PACKED; /* 14: invalid password */ | ||
496 | } ppp_pap_stats_t; | ||
497 | |||
498 | /*---------------------------------------------------------------------------- | ||
499 | * CHAP Statistics (returned by the PPP_READ_CHAP_STATS command). | ||
500 | */ | ||
501 | typedef struct ppp_chap_stats | ||
502 | { | ||
503 | unsigned short rx_unknown PACKED; /* 00: unknown type */ | ||
504 | unsigned short rx_challenge PACKED; /* 02: Authenticate-Request */ | ||
505 | unsigned short rx_response PACKED; /* 04: Authenticate-Ack */ | ||
506 | unsigned short rx_success PACKED; /* 06: Authenticate-Nak */ | ||
507 | unsigned short rx_failure PACKED; /* 08: Authenticate-Nak */ | ||
508 | unsigned short reserved PACKED; /* 0A: */ | ||
509 | unsigned short tx_challenge PACKED; /* 0C: Authenticate-Request */ | ||
510 | unsigned short tx_response PACKED; /* 0E: Authenticate-Ack */ | ||
511 | unsigned short tx_success PACKED; /* 10: Authenticate-Nak */ | ||
512 | unsigned short tx_failure PACKED; /* 12: Authenticate-Nak */ | ||
513 | unsigned short rx_too_large PACKED; /* 14: packets too large */ | ||
514 | unsigned short rx_bad_peerid PACKED; /* 16: invalid peer ID */ | ||
515 | unsigned short rx_bad_passwd PACKED; /* 18: invalid password */ | ||
516 | unsigned short rx_bad_md5 PACKED; /* 1A: invalid MD5 format */ | ||
517 | unsigned short rx_bad_resp PACKED; /* 1C: invalid response */ | ||
518 | } ppp_chap_stats_t; | ||
519 | |||
520 | /*---------------------------------------------------------------------------- | ||
521 | * Connection Information (returned by the PPP_GET_CONNECTION_INFO command). | ||
522 | */ | ||
523 | typedef struct ppp_conn_info | ||
524 | { | ||
525 | unsigned short remote_mru PACKED; /* 00: */ | ||
526 | unsigned char ip_options PACKED; /* 02: */ | ||
527 | unsigned char ip_local[4] PACKED; /* 03: */ | ||
528 | unsigned char ip_remote[4] PACKED; /* 07: */ | ||
529 | unsigned char ipx_options PACKED; /* 0B: */ | ||
530 | unsigned char ipx_network[4] PACKED; /* 0C: */ | ||
531 | unsigned char ipx_local[6] PACKED; /* 10: */ | ||
532 | unsigned char ipx_remote[6] PACKED; /* 16: */ | ||
533 | unsigned char ipx_router[48] PACKED; /* 1C: */ | ||
534 | unsigned char auth_status PACKED; /* 4C: */ | ||
535 | unsigned char peer_id[0] PACKED; /* 4D: */ | ||
536 | } ppp_conn_info_t; | ||
537 | |||
538 | /* Data structure for SET_TRIGGER_INTR command | ||
539 | */ | ||
540 | |||
541 | typedef struct ppp_intr_info{ | ||
542 | unsigned char i_enable PACKED; /* 0 Interrupt enable bits */ | ||
543 | unsigned char irq PACKED; /* 1 Irq number */ | ||
544 | unsigned short timer_len PACKED; /* 2 Timer delay */ | ||
545 | } ppp_intr_info_t; | ||
546 | |||
547 | |||
548 | #define FT1_MONITOR_STATUS_CTRL 0x80 | ||
549 | #define SET_FT1_MODE 0x81 | ||
550 | |||
551 | |||
552 | |||
553 | /* Special UDP drivers management commands */ | ||
554 | #define PPIPE_ENABLE_TRACING 0x20 | ||
555 | #define PPIPE_DISABLE_TRACING 0x21 | ||
556 | #define PPIPE_GET_TRACE_INFO 0x22 | ||
557 | #define PPIPE_GET_IBA_DATA 0x23 | ||
558 | #define PPIPE_KILL_BOARD 0x24 | ||
559 | #define PPIPE_FT1_READ_STATUS 0x25 | ||
560 | #define PPIPE_DRIVER_STAT_IFSEND 0x26 | ||
561 | #define PPIPE_DRIVER_STAT_INTR 0x27 | ||
562 | #define PPIPE_DRIVER_STAT_GEN 0x28 | ||
563 | #define PPIPE_FLUSH_DRIVER_STATS 0x29 | ||
564 | #define PPIPE_ROUTER_UP_TIME 0x30 | ||
565 | |||
566 | #define DISABLE_TRACING 0x00 | ||
567 | #define TRACE_SIGNALLING_FRAMES 0x01 | ||
568 | #define TRACE_DATA_FRAMES 0x02 | ||
569 | |||
570 | |||
571 | |||
572 | #ifdef _MSC_ | ||
573 | # pragma pack() | ||
574 | #endif | ||
575 | #endif /* _SDLA_PPP_H */ | ||
diff --git a/include/linux/sdla_x25.h b/include/linux/sdla_x25.h deleted file mode 100644 index 57db980e27ad..000000000000 --- a/include/linux/sdla_x25.h +++ /dev/null | |||
@@ -1,772 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdla_x25.h Sangoma X.25 firmware API definitions. | ||
3 | * | ||
4 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
5 | * | ||
6 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * Feb 28, 2000 Nenad Corbic Updated for socket based x25api | ||
14 | * Dec 13, 1996 Gene Kozin Initial version | ||
15 | *****************************************************************************/ | ||
16 | #ifndef _SDLA_X25_H | ||
17 | #define _SDLA_X25_H | ||
18 | |||
19 | /*---------------------------------------------------------------------------- | ||
20 | * Notes: | ||
21 | * ------ | ||
22 | * 1. All structures defined in this file are byte-alined. | ||
23 | * Compiler Platform | ||
24 | * -------- -------- | ||
25 | * GNU C Linux | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | #ifndef PACKED | ||
30 | # define PACKED __attribute__((packed)) | ||
31 | #endif /* PACKED */ | ||
32 | |||
33 | /****** CONSTANTS DEFINITIONS ***********************************************/ | ||
34 | |||
35 | #define X25_MAX_CHAN 255 /* max number of open X.25 circuits */ | ||
36 | #define X25_MAX_DATA 1024 /* max length of X.25 data buffer */ | ||
37 | /* | ||
38 | * X.25 shared memory layout. | ||
39 | */ | ||
40 | #define X25_MBOX_OFFS 0x16B0 /* general mailbox block */ | ||
41 | #define X25_RXMBOX_OFFS 0x1AD0 /* receive mailbox */ | ||
42 | #define X25_STATUS_OFFS 0x1EF0 /* X.25 status structure */ | ||
43 | #define X25_MB_VECTOR 0xE000 /* S514 mailbox window vecotr */ | ||
44 | #define X25_MISC_HDLC_BITS 0x1F00 /*X.25 miscallaneous HDLC bits */ | ||
45 | |||
46 | /* code levels */ | ||
47 | #define HDLC_LEVEL 0x01 | ||
48 | #define X25_LEVEL 0x02 | ||
49 | #define X25_AND_HDLC_LEVEL 0x03 | ||
50 | #define DO_HDLC_LEVEL_ERROR_CHECKING 0x04 | ||
51 | |||
52 | /****** DATA STRUCTURES *****************************************************/ | ||
53 | |||
54 | /*---------------------------------------------------------------------------- | ||
55 | * X.25 Command Block. | ||
56 | */ | ||
57 | typedef struct X25Cmd | ||
58 | { | ||
59 | unsigned char command PACKED; /* command code */ | ||
60 | unsigned short length PACKED; /* transfer data length */ | ||
61 | unsigned char result PACKED; /* return code */ | ||
62 | unsigned char pf PACKED; /* P/F bit */ | ||
63 | unsigned short lcn PACKED; /* logical channel */ | ||
64 | unsigned char qdm PACKED; /* Q/D/M bits */ | ||
65 | unsigned char cause PACKED; /* cause field */ | ||
66 | unsigned char diagn PACKED; /* diagnostics */ | ||
67 | unsigned char pktType PACKED; /* packet type */ | ||
68 | unsigned char resrv[4] PACKED; /* reserved */ | ||
69 | } TX25Cmd; | ||
70 | |||
71 | /* | ||
72 | * Defines for the 'command' field. | ||
73 | */ | ||
74 | /*----- General commands --------------*/ | ||
75 | #define X25_SET_GLOBAL_VARS 0x0B /* set global variables */ | ||
76 | #define X25_READ_MODEM_STATUS 0x0C /* read modem status */ | ||
77 | #define X25_READ_CODE_VERSION 0x15 /* read firmware version number */ | ||
78 | #define X25_TRACE_CONFIGURE 0x14 /* configure trace facility */ | ||
79 | #define X25_READ_TRACE_DATA 0x16 /* read trace data */ | ||
80 | #define X25_SET_INTERRUPT_MODE 0x17 /* set interrupt generation mode */ | ||
81 | #define X25_READ_INTERRUPT_MODE 0x18 /* read interrupt generation mode */ | ||
82 | /*----- HDLC-level commands -----------*/ | ||
83 | #define X25_HDLC_LINK_CONFIGURE 0x01 /* configure HDLC link level */ | ||
84 | #define X25_HDLC_LINK_OPEN 0x02 /* open HDLC link */ | ||
85 | #define X25_HDLC_LINK_CLOSE 0x03 /* close HDLC link */ | ||
86 | #define X25_HDLC_LINK_SETUP 0x04 /* set up HDLC link */ | ||
87 | #define X25_HDLC_LINK_DISC 0x05 /* disconnect DHLC link */ | ||
88 | #define X25_HDLC_LINK_STATUS 0x06 /* read DHLC link status */ | ||
89 | #define X25_HDLC_READ_STATS 0x07 /* read operational statistics */ | ||
90 | #define X25_HDLC_FLUSH_STATS 0x08 /* flush operational statistics */ | ||
91 | #define X25_HDLC_READ_COMM_ERR 0x09 /* read error statistics */ | ||
92 | #define X25_HDLC_FLUSH_COMM_ERR 0x0A /* flush error statistics */ | ||
93 | #define X25_HDLC_FLUSH_BUFFERS 0x0D /* flush HDLC-level data buffers */ | ||
94 | #define X25_HDLC_SPRVS_CNT_STAT 0x0F /* read surervisory count status */ | ||
95 | #define X25_HDLC_SEND_UI_FRAME 0x10 /* send unnumbered information frame */ | ||
96 | #define X25_HDLC_WRITE 0x11 /* send HDLC information frame */ | ||
97 | #define X25_HDLC_READ 0x21 /* read HDLC information frame */ | ||
98 | #define X25_HDLC_READ_CONFIG 0x12 /* read HDLC configuration */ | ||
99 | #define X25_HDLC_SET_CONFIG 0x13 /* set HDLC configuration */ | ||
100 | #define SET_PROTOCOL_LEVEL 0x1F /* set protocol level */ | ||
101 | /*----- X.25-level commands -----------*/ | ||
102 | #define X25_READ 0x22 /* read X.25 packet */ | ||
103 | #define X25_WRITE 0x23 /* send X.25 packet */ | ||
104 | #define X25_PLACE_CALL 0x30 /* place a call on SVC */ | ||
105 | #define X25_ACCEPT_CALL 0x31 /* accept incomming call */ | ||
106 | #define X25_CLEAR_CALL 0x32 /* clear call */ | ||
107 | #define X25_CLEAR_CONFRM 0x33 /* send clear confirmation packet */ | ||
108 | #define X25_RESET 0x34 /* send reset request packet */ | ||
109 | #define X25_RESET_CONFRM 0x35 /* send reset confirmation packet */ | ||
110 | #define X25_RESTART 0x36 /* send restart request packet */ | ||
111 | #define X25_RESTART_CONFRM 0x37 /* send restart confirmation packet */ | ||
112 | #define X25_INTERRUPT 0x38 /* send interrupt request packet */ | ||
113 | #define X25_INTERRUPT_CONFRM 0x39 /* send interrupt confirmation pkt */ | ||
114 | #define X25_REGISTRATION_RQST 0x3A /* send registration request packet */ | ||
115 | #define X25_REGISTRATION_CONFRM 0x3B /* send registration confirmation */ | ||
116 | #define X25_IS_DATA_AVAILABLE 0x40 /* querry receive queue */ | ||
117 | #define X25_INCOMMING_CALL_CTL 0x41 /* select incomming call options */ | ||
118 | #define X25_CONFIGURE_PVC 0x42 /* configure PVC */ | ||
119 | #define X25_GET_ACTIVE_CHANNELS 0x43 /* get a list of active circuits */ | ||
120 | #define X25_READ_CHANNEL_CONFIG 0x44 /* read virt. circuit configuration */ | ||
121 | #define X25_FLUSH_DATA_BUFFERS 0x45 /* flush X.25-level data buffers */ | ||
122 | #define X25_READ_HISTORY_TABLE 0x46 /* read asynchronous event log */ | ||
123 | #define X25_HISTORY_TABLE_CTL 0x47 /* control asynchronous event log */ | ||
124 | #define X25_GET_TX_D_BIT_STATUS 0x48 /* is packet with D-bit acknowleged */ | ||
125 | #define X25_READ_STATISTICS 0x49 /* read X.25-level statistics */ | ||
126 | #define X25_FLUSH_STATISTICS 0x4A /* flush X.25-level statistics */ | ||
127 | #define X25_READ_CONFIGURATION 0x50 /* read HDLC & X.25 configuration */ | ||
128 | #define X25_SET_CONFIGURATION 0x51 /* set HDLC & X.25 configuration */ | ||
129 | |||
130 | /* | ||
131 | * Defines for the 'result' field. | ||
132 | */ | ||
133 | /*----- General results ---------------*/ | ||
134 | #define X25RES_OK 0x00 | ||
135 | #define X25RES_ERROR 0x01 | ||
136 | #define X25RES_LINK_NOT_IN_ABM 0x02 /* link is not in ABM mode */ | ||
137 | #define X25RES_LINK_CLOSED 0x03 | ||
138 | #define X25RES_INVAL_LENGTH 0x04 | ||
139 | #define X25RES_INVAL_CMD 0x05 | ||
140 | #define X25RES_UNNUMBERED_FRAME 0x06 /* unnunbered frame received */ | ||
141 | #define X25RES_FRM_REJECT_MODE 0x07 /* link is in Frame Reject mode */ | ||
142 | #define X25RES_MODEM_FAILURE 0x08 /* DCD and/or CTS dropped */ | ||
143 | #define X25RES_N2_RETRY_LIMIT 0x09 /* N2 retry limit has been exceeded */ | ||
144 | #define X25RES_INVAL_LCN 0x30 /* invalid logical channel number */ | ||
145 | #define X25RES_INVAL_STATE 0x31 /* channel is not in data xfer mode */ | ||
146 | #define X25RES_INVAL_DATA_LEN 0x32 /* invalid data length */ | ||
147 | #define X25RES_NOT_READY 0x33 /* no data available / buffers full */ | ||
148 | #define X25RES_NETWORK_DOWN 0x34 | ||
149 | #define X25RES_CHANNEL_IN_USE 0x35 /* there is data queued on this LCN */ | ||
150 | #define X25RES_REGST_NOT_SUPPRT 0x36 /* registration not supported */ | ||
151 | #define X25RES_INVAL_FORMAT 0x37 /* invalid packet format */ | ||
152 | #define X25RES_D_BIT_NOT_SUPPRT 0x38 /* D-bit pragmatics not supported */ | ||
153 | #define X25RES_FACIL_NOT_SUPPRT 0x39 /* Call facility not supported */ | ||
154 | #define X25RES_INVAL_CALL_ARG 0x3A /* errorneous call arguments */ | ||
155 | #define X25RES_INVAL_CALL_DATA 0x3B /* errorneous call user data */ | ||
156 | #define X25RES_ASYNC_PACKET 0x40 /* asynchronous packet received */ | ||
157 | #define X25RES_PROTO_VIOLATION 0x41 /* protocol violation occurred */ | ||
158 | #define X25RES_PKT_TIMEOUT 0x42 /* X.25 packet time out */ | ||
159 | #define X25RES_PKT_RETRY_LIMIT 0x43 /* X.25 packet retry limit exceeded */ | ||
160 | /*----- Command-dependent results -----*/ | ||
161 | #define X25RES_LINK_DISC 0x00 /* HDLC_LINK_STATUS */ | ||
162 | #define X25RES_LINK_IN_ABM 0x01 /* HDLC_LINK_STATUS */ | ||
163 | #define X25RES_NO_DATA 0x01 /* HDLC_READ/READ_TRACE_DATA*/ | ||
164 | #define X25RES_TRACE_INACTIVE 0x02 /* READ_TRACE_DATA */ | ||
165 | #define X25RES_LINK_IS_OPEN 0x01 /* HDLC_LINK_OPEN */ | ||
166 | #define X25RES_LINK_IS_DISC 0x02 /* HDLC_LINK_DISC */ | ||
167 | #define X25RES_LINK_IS_CLOSED 0x03 /* HDLC_LINK_CLOSE */ | ||
168 | #define X25RES_INVAL_PARAM 0x31 /* INCOMMING_CALL_CTL */ | ||
169 | #define X25RES_INVAL_CONFIG 0x35 /* REGISTR_RQST/CONFRM */ | ||
170 | |||
171 | /* | ||
172 | * Defines for the 'qdm_bits' field. | ||
173 | */ | ||
174 | #define X25CMD_Q_BIT_MASK 0x04 | ||
175 | #define X25CMD_D_BIT_MASK 0x02 | ||
176 | #define X25CMD_M_BIT_MASK 0x01 | ||
177 | |||
178 | /* | ||
179 | * Defines for the 'pkt_type' field. | ||
180 | */ | ||
181 | /*----- Asynchronous events ------*/ | ||
182 | #define ASE_CLEAR_RQST 0x02 | ||
183 | #define ASE_RESET_RQST 0x04 | ||
184 | #define ASE_RESTART_RQST 0x08 | ||
185 | #define ASE_INTERRUPT 0x10 | ||
186 | #define ASE_DTE_REGISTR_RQST 0x20 | ||
187 | #define ASE_CALL_RQST 0x30 | ||
188 | #define ASE_CALL_ACCEPTED 0x31 | ||
189 | #define ASE_CLEAR_CONFRM 0x32 | ||
190 | #define ASE_RESET_CONFRM 0x33 | ||
191 | #define ASE_RESTART_CONFRM 0x34 | ||
192 | #define ASE_INTERRUPT_CONFRM 0x35 | ||
193 | #define ASE_DCE_REGISTR_CONFRM 0x36 | ||
194 | #define ASE_DIAGNOSTIC 0x37 | ||
195 | #define ASE_CALL_AUTO_CLEAR 0x38 | ||
196 | #define AUTO_RESPONSE_FLAG 0x80 | ||
197 | /*----- Time-Out events ----------*/ | ||
198 | #define TOE_RESTART_RQST 0x03 | ||
199 | #define TOE_CALL_RQST 0x05 | ||
200 | #define TOE_CLEAR_RQST 0x08 | ||
201 | #define TOE_RESET_RQST 0x0A | ||
202 | /*----- Protocol Violation events */ | ||
203 | #define PVE_CLEAR_RQST 0x32 | ||
204 | #define PVE_RESET_RQST 0x33 | ||
205 | #define PVE_RESTART_RQST 0x34 | ||
206 | #define PVE_DIAGNOSTIC 0x37 | ||
207 | |||
208 | #define INTR_ON_RX_FRAME 0x01 | ||
209 | #define INTR_ON_TX_FRAME 0x02 | ||
210 | #define INTR_ON_MODEM_STATUS_CHANGE 0x04 | ||
211 | #define INTR_ON_COMMAND_COMPLETE 0x08 | ||
212 | #define INTR_ON_X25_ASY_TRANSACTION 0x10 | ||
213 | #define INTR_ON_TIMER 0x40 | ||
214 | #define DIRECT_RX_INTR_USAGE 0x80 | ||
215 | |||
216 | #define NO_INTR_PENDING 0x00 | ||
217 | #define RX_INTR_PENDING 0x01 | ||
218 | #define TX_INTR_PENDING 0x02 | ||
219 | #define MODEM_INTR_PENDING 0x04 | ||
220 | #define COMMAND_COMPLETE_INTR_PENDING 0x08 | ||
221 | #define X25_ASY_TRANS_INTR_PENDING 0x10 | ||
222 | #define TIMER_INTR_PENDING 0x40 | ||
223 | |||
224 | /*---------------------------------------------------------------------------- | ||
225 | * X.25 Mailbox. | ||
226 | * This structure is located at offsets X25_MBOX_OFFS and X25_RXMBOX_OFFS | ||
227 | * into shared memory window. | ||
228 | */ | ||
229 | typedef struct X25Mbox | ||
230 | { | ||
231 | unsigned char opflag PACKED; /* 00h: execution flag */ | ||
232 | TX25Cmd cmd PACKED; /* 01h: command block */ | ||
233 | unsigned char data[1] PACKED; /* 10h: data buffer */ | ||
234 | } TX25Mbox; | ||
235 | |||
236 | /*---------------------------------------------------------------------------- | ||
237 | * X.25 Time Stamp Structure. | ||
238 | */ | ||
239 | typedef struct X25TimeStamp | ||
240 | { | ||
241 | unsigned char month PACKED; | ||
242 | unsigned char date PACKED; | ||
243 | unsigned char sec PACKED; | ||
244 | unsigned char min PACKED; | ||
245 | unsigned char hour PACKED; | ||
246 | } TX25TimeStamp; | ||
247 | |||
248 | /*---------------------------------------------------------------------------- | ||
249 | * X.25 Status Block. | ||
250 | * This structure is located at offset X25_STATUS_OFF into shared memory | ||
251 | * window. | ||
252 | */ | ||
253 | typedef struct X25Status | ||
254 | { | ||
255 | unsigned short pvc_map PACKED; /* 00h: PVC map */ | ||
256 | unsigned short icc_map PACKED; /* 02h: Incomming Chan. map */ | ||
257 | unsigned short twc_map PACKED; /* 04h: Two-way Cnan. map */ | ||
258 | unsigned short ogc_map PACKED; /* 06h: Outgoing Chan. map */ | ||
259 | TX25TimeStamp tstamp PACKED; /* 08h: timestamp (BCD) */ | ||
260 | unsigned char iflags PACKED; /* 0Dh: interrupt flags */ | ||
261 | unsigned char imask PACKED; /* 0Eh: interrupt mask */ | ||
262 | unsigned char resrv PACKED; /* 0Eh: */ | ||
263 | unsigned char gflags PACKED; /* 10h: misc. HDLC/X25 flags */ | ||
264 | unsigned char cflags[X25_MAX_CHAN] PACKED; /* channel status bytes */ | ||
265 | } TX25Status; | ||
266 | |||
267 | /* | ||
268 | * Bitmasks for the 'iflags' field. | ||
269 | */ | ||
270 | #define X25_RX_INTR 0x01 /* receive interrupt */ | ||
271 | #define X25_TX_INTR 0x02 /* transmit interrupt */ | ||
272 | #define X25_MODEM_INTR 0x04 /* modem status interrupt (CTS/DCD) */ | ||
273 | #define X25_EVENT_INTR 0x10 /* asyncronous event encountered */ | ||
274 | #define X25_CMD_INTR 0x08 /* interface command complete */ | ||
275 | |||
276 | /* | ||
277 | * Bitmasks for the 'gflags' field. | ||
278 | */ | ||
279 | #define X25_HDLC_ABM 0x01 /* HDLC is in ABM mode */ | ||
280 | #define X25_RX_READY 0x02 /* X.25 data available */ | ||
281 | #define X25_TRACE_READY 0x08 /* trace data available */ | ||
282 | #define X25_EVENT_IND 0x20 /* asynchronous event indicator */ | ||
283 | #define X25_TX_READY 0x40 /* space is available in Tx buf.*/ | ||
284 | |||
285 | /* | ||
286 | * Bitmasks for the 'cflags' field. | ||
287 | */ | ||
288 | #define X25_XFER_MODE 0x80 /* channel is in data transfer mode */ | ||
289 | #define X25_TXWIN_OPEN 0x40 /* transmit window open */ | ||
290 | #define X25_RXBUF_MASK 0x3F /* number of data buffers available */ | ||
291 | |||
292 | /***************************************************************************** | ||
293 | * Following definitions structurize contents of the TX25Mbox.data field for | ||
294 | * different X.25 interface commands. | ||
295 | ****************************************************************************/ | ||
296 | |||
297 | /* --------------------------------------------------------------------------- | ||
298 | * X25_SET_GLOBAL_VARS Command. | ||
299 | */ | ||
300 | typedef struct X25GlobalVars | ||
301 | { | ||
302 | unsigned char resrv PACKED; /* 00h: reserved */ | ||
303 | unsigned char dtrCtl PACKED; /* 01h: DTR control code */ | ||
304 | unsigned char resErr PACKED; /* 01h: '1' - reset modem error */ | ||
305 | } TX25GlobalVars; | ||
306 | |||
307 | /* | ||
308 | * Defines for the 'dtrCtl' field. | ||
309 | */ | ||
310 | #define X25_RAISE_DTR 0x01 | ||
311 | #define X25_DROP_DTR 0x02 | ||
312 | |||
313 | /* --------------------------------------------------------------------------- | ||
314 | * X25_READ_MODEM_STATUS Command. | ||
315 | */ | ||
316 | typedef struct X25ModemStatus | ||
317 | { | ||
318 | unsigned char status PACKED; /* 00h: modem status */ | ||
319 | } TX25ModemStatus; | ||
320 | |||
321 | /* | ||
322 | * Defines for the 'status' field. | ||
323 | */ | ||
324 | #define X25_CTS_MASK 0x20 | ||
325 | #define X25_DCD_MASK 0x08 | ||
326 | |||
327 | /* --------------------------------------------------------------------------- | ||
328 | * X25_HDLC_LINK_STATUS Command. | ||
329 | */ | ||
330 | typedef struct X25LinkStatus | ||
331 | { | ||
332 | unsigned char txQueued PACKED; /* 00h: queued Tx I-frames*/ | ||
333 | unsigned char rxQueued PACKED; /* 01h: queued Rx I-frames*/ | ||
334 | unsigned char station PACKED; /* 02h: DTE/DCE config. */ | ||
335 | unsigned char reserved PACKED; /* 03h: reserved */ | ||
336 | unsigned char sfTally PACKED; /* 04h: supervisory frame tally */ | ||
337 | } TX25LinkStatus; | ||
338 | |||
339 | /* | ||
340 | * Defines for the 'station' field. | ||
341 | */ | ||
342 | #define X25_STATION_DTE 0x01 /* station configured as DTE */ | ||
343 | #define X25_STATION_DCE 0x02 /* station configured as DCE */ | ||
344 | |||
345 | /* --------------------------------------------------------------------------- | ||
346 | * X25_HDLC_READ_STATS Command. | ||
347 | */ | ||
348 | typedef struct HdlcStats | ||
349 | { /* a number of ... */ | ||
350 | unsigned short rxIFrames PACKED; /* 00h: ready Rx I-frames */ | ||
351 | unsigned short rxNoseq PACKED; /* 02h: frms out-of-sequence */ | ||
352 | unsigned short rxNodata PACKED; /* 04h: I-frms without data */ | ||
353 | unsigned short rxDiscarded PACKED; /* 06h: discarded frames */ | ||
354 | unsigned short rxTooLong PACKED; /* 08h: frames too long */ | ||
355 | unsigned short rxBadAddr PACKED; /* 0Ah: frms with inval.addr*/ | ||
356 | unsigned short txAcked PACKED; /* 0Ch: acknowledged I-frms */ | ||
357 | unsigned short txRetransm PACKED; /* 0Eh: re-transmit. I-frms */ | ||
358 | unsigned short t1Timeout PACKED; /* 10h: T1 timeouts */ | ||
359 | unsigned short rxSABM PACKED; /* 12h: received SABM frames */ | ||
360 | unsigned short rxDISC PACKED; /* 14h: received DISC frames */ | ||
361 | unsigned short rxDM PACKED; /* 16h: received DM frames */ | ||
362 | unsigned short rxFRMR PACKED; /* 18h: FRMR frames received */ | ||
363 | unsigned short txSABM PACKED; /* 1Ah: transm. SABM frames*/ | ||
364 | unsigned short txDISC PACKED; /* 1Ch: transm. DISC frames*/ | ||
365 | unsigned short txDM PACKED; /* 1Eh: transm. DM frames */ | ||
366 | unsigned short txFRMR PACKED; /* 20h: transm. FRMR frames*/ | ||
367 | } THdlcStats; | ||
368 | |||
369 | /* --------------------------------------------------------------------------- | ||
370 | * X25_HDLC_READ_COMM_ERR Command. | ||
371 | */ | ||
372 | typedef struct HdlcCommErr | ||
373 | { /* a number of ... */ | ||
374 | unsigned char rxOverrun PACKED; /* 00h: Rx overrun errors */ | ||
375 | unsigned char rxBadCrc PACKED; /* 01h: Rx CRC errors */ | ||
376 | unsigned char rxAborted PACKED; /* 02h: Rx aborted frames */ | ||
377 | unsigned char rxDropped PACKED; /* 03h: frames lost */ | ||
378 | unsigned char txAborted PACKED; /* 04h: Tx aborted frames */ | ||
379 | unsigned char txUnderrun PACKED; /* 05h: Tx underrun errors */ | ||
380 | unsigned char txMissIntr PACKED; /* 06h: missed underrun ints */ | ||
381 | unsigned char reserved PACKED; /* 07h: reserved */ | ||
382 | unsigned char droppedDCD PACKED; /* 08h: times DCD dropped */ | ||
383 | unsigned char droppedCTS PACKED; /* 09h: times CTS dropped */ | ||
384 | } THdlcCommErr; | ||
385 | |||
386 | /* --------------------------------------------------------------------------- | ||
387 | * X25_SET_CONFIGURATION & X25_READ_CONFIGURATION Commands. | ||
388 | */ | ||
389 | typedef struct X25Config | ||
390 | { | ||
391 | unsigned char baudRate PACKED; /* 00h: */ | ||
392 | unsigned char t1 PACKED; /* 01h: */ | ||
393 | unsigned char t2 PACKED; /* 02h: */ | ||
394 | unsigned char n2 PACKED; /* 03h: */ | ||
395 | unsigned short hdlcMTU PACKED; /* 04h: */ | ||
396 | unsigned char hdlcWindow PACKED; /* 06h: */ | ||
397 | unsigned char t4 PACKED; /* 07h: */ | ||
398 | unsigned char autoModem PACKED; /* 08h: */ | ||
399 | unsigned char autoHdlc PACKED; /* 09h: */ | ||
400 | unsigned char hdlcOptions PACKED; /* 0Ah: */ | ||
401 | unsigned char station PACKED; /* 0Bh: */ | ||
402 | unsigned char pktWindow PACKED; /* 0Ch: */ | ||
403 | unsigned short defPktSize PACKED; /* 0Dh: */ | ||
404 | unsigned short pktMTU PACKED; /* 0Fh: */ | ||
405 | unsigned short loPVC PACKED; /* 11h: */ | ||
406 | unsigned short hiPVC PACKED; /* 13h: */ | ||
407 | unsigned short loIncommingSVC PACKED; /* 15h: */ | ||
408 | unsigned short hiIncommingSVC PACKED; /* 17h: */ | ||
409 | unsigned short loTwoWaySVC PACKED; /* 19h: */ | ||
410 | unsigned short hiTwoWaySVC PACKED; /* 1Bh: */ | ||
411 | unsigned short loOutgoingSVC PACKED; /* 1Dh: */ | ||
412 | unsigned short hiOutgoingSVC PACKED; /* 1Fh: */ | ||
413 | unsigned short options PACKED; /* 21h: */ | ||
414 | unsigned char responseOpt PACKED; /* 23h: */ | ||
415 | unsigned short facil1 PACKED; /* 24h: */ | ||
416 | unsigned short facil2 PACKED; /* 26h: */ | ||
417 | unsigned short ccittFacil PACKED; /* 28h: */ | ||
418 | unsigned short otherFacil PACKED; /* 2Ah: */ | ||
419 | unsigned short ccittCompat PACKED; /* 2Ch: */ | ||
420 | unsigned char t10t20 PACKED; /* 2Eh: */ | ||
421 | unsigned char t11t21 PACKED; /* 2Fh: */ | ||
422 | unsigned char t12t22 PACKED; /* 30h: */ | ||
423 | unsigned char t13t23 PACKED; /* 31h: */ | ||
424 | unsigned char t16t26 PACKED; /* 32H: */ | ||
425 | unsigned char t28 PACKED; /* 33h: */ | ||
426 | unsigned char r10r20 PACKED; /* 34h: */ | ||
427 | unsigned char r12r22 PACKED; /* 35h: */ | ||
428 | unsigned char r13r23 PACKED; /* 36h: */ | ||
429 | } TX25Config; | ||
430 | |||
431 | /* --------------------------------------------------------------------------- | ||
432 | * X25_READ_CHANNEL_CONFIG Command. | ||
433 | */ | ||
434 | typedef struct X25ChanAlloc /*----- Channel allocation -*/ | ||
435 | { | ||
436 | unsigned short loPVC PACKED; /* 00h: lowest PVC number */ | ||
437 | unsigned short hiPVC PACKED; /* 02h: highest PVC number */ | ||
438 | unsigned short loIncommingSVC PACKED; /* 04h: lowest incoming SVC */ | ||
439 | unsigned short hiIncommingSVC PACKED; /* 06h: highest incoming SVC */ | ||
440 | unsigned short loTwoWaySVC PACKED; /* 08h: lowest two-way SVC */ | ||
441 | unsigned short hiTwoWaySVC PACKED; /* 0Ah: highest two-way SVC */ | ||
442 | unsigned short loOutgoingSVC PACKED; /* 0Ch: lowest outgoing SVC */ | ||
443 | unsigned short hiOutgoingSVC PACKED; /* 0Eh: highest outgoing SVC */ | ||
444 | } TX25ChanAlloc; | ||
445 | |||
446 | typedef struct X25ChanCfg /*------ Channel configuration -----*/ | ||
447 | { | ||
448 | unsigned char type PACKED; /* 00h: channel type */ | ||
449 | unsigned char txConf PACKED; /* 01h: Tx packet and window sizes */ | ||
450 | unsigned char rxConf PACKED; /* 01h: Rx packet and window sizes */ | ||
451 | } TX25ChanCfg; | ||
452 | |||
453 | /* | ||
454 | * Defines for the 'type' field. | ||
455 | */ | ||
456 | #define X25_PVC 0x01 /* PVC */ | ||
457 | #define X25_SVC_IN 0x03 /* Incoming SVC */ | ||
458 | #define X25_SVC_TWOWAY 0x07 /* Two-way SVC */ | ||
459 | #define X25_SVC_OUT 0x0B /* Outgoing SVC */ | ||
460 | |||
461 | /*---------------------------------------------------------------------------- | ||
462 | * X25_READ_STATISTICS Command. | ||
463 | */ | ||
464 | typedef struct X25Stats | ||
465 | { /* number of packets Tx/Rx'ed */ | ||
466 | unsigned short txRestartRqst PACKED; /* 00h: Restart Request */ | ||
467 | unsigned short rxRestartRqst PACKED; /* 02h: Restart Request */ | ||
468 | unsigned short txRestartConf PACKED; /* 04h: Restart Confirmation */ | ||
469 | unsigned short rxRestartConf PACKED; /* 06h: Restart Confirmation */ | ||
470 | unsigned short txResetRqst PACKED; /* 08h: Reset Request */ | ||
471 | unsigned short rxResetRqst PACKED; /* 0Ah: Reset Request */ | ||
472 | unsigned short txResetConf PACKED; /* 0Ch: Reset Confirmation */ | ||
473 | unsigned short rxResetConf PACKED; /* 0Eh: Reset Confirmation */ | ||
474 | unsigned short txCallRequest PACKED; /* 10h: Call Request */ | ||
475 | unsigned short rxCallRequest PACKED; /* 12h: Call Request */ | ||
476 | unsigned short txCallAccept PACKED; /* 14h: Call Accept */ | ||
477 | unsigned short rxCallAccept PACKED; /* 16h: Call Accept */ | ||
478 | unsigned short txClearRqst PACKED; /* 18h: Clear Request */ | ||
479 | unsigned short rxClearRqst PACKED; /* 1Ah: Clear Request */ | ||
480 | unsigned short txClearConf PACKED; /* 1Ch: Clear Confirmation */ | ||
481 | unsigned short rxClearConf PACKED; /* 1Eh: Clear Confirmation */ | ||
482 | unsigned short txDiagnostic PACKED; /* 20h: Diagnostic */ | ||
483 | unsigned short rxDiagnostic PACKED; /* 22h: Diagnostic */ | ||
484 | unsigned short txRegRqst PACKED; /* 24h: Registration Request */ | ||
485 | unsigned short rxRegRqst PACKED; /* 26h: Registration Request */ | ||
486 | unsigned short txRegConf PACKED; /* 28h: Registration Confirm.*/ | ||
487 | unsigned short rxRegConf PACKED; /* 2Ah: Registration Confirm.*/ | ||
488 | unsigned short txInterrupt PACKED; /* 2Ch: Interrupt */ | ||
489 | unsigned short rxInterrupt PACKED; /* 2Eh: Interrupt */ | ||
490 | unsigned short txIntrConf PACKED; /* 30h: Interrupt Confirm. */ | ||
491 | unsigned short rxIntrConf PACKED; /* 32h: Interrupt Confirm. */ | ||
492 | unsigned short txData PACKED; /* 34h: Data */ | ||
493 | unsigned short rxData PACKED; /* 36h: Data */ | ||
494 | unsigned short txRR PACKED; /* 38h: RR */ | ||
495 | unsigned short rxRR PACKED; /* 3Ah: RR */ | ||
496 | unsigned short txRNR PACKED; /* 3Ch: RNR */ | ||
497 | unsigned short rxRNR PACKED; /* 3Eh: RNR */ | ||
498 | } TX25Stats; | ||
499 | |||
500 | /*---------------------------------------------------------------------------- | ||
501 | * X25_READ_HISTORY_TABLE Command. | ||
502 | */ | ||
503 | typedef struct X25EventLog | ||
504 | { | ||
505 | unsigned char type PACKED; /* 00h: transaction type */ | ||
506 | unsigned short lcn PACKED; /* 01h: logical channel num */ | ||
507 | unsigned char packet PACKED; /* 03h: async packet type */ | ||
508 | unsigned char cause PACKED; /* 04h: X.25 cause field */ | ||
509 | unsigned char diag PACKED; /* 05h: X.25 diag field */ | ||
510 | TX25TimeStamp ts PACKED; /* 06h: time stamp */ | ||
511 | } TX25EventLog; | ||
512 | |||
513 | /* | ||
514 | * Defines for the 'type' field. | ||
515 | */ | ||
516 | #define X25LOG_INCOMMING 0x00 | ||
517 | #define X25LOG_APPLICATION 0x01 | ||
518 | #define X25LOG_AUTOMATIC 0x02 | ||
519 | #define X25LOG_ERROR 0x04 | ||
520 | #define X25LOG_TIMEOUT 0x08 | ||
521 | #define X25LOG_RECOVERY 0x10 | ||
522 | |||
523 | /* | ||
524 | * Defines for the 'packet' field. | ||
525 | */ | ||
526 | #define X25LOG_CALL_RQST 0x0B | ||
527 | #define X25LOG_CALL_ACCEPTED 0x0F | ||
528 | #define X25LOG_CLEAR_RQST 0x13 | ||
529 | #define X25LOG_CLEAR_CONFRM 0x17 | ||
530 | #define X25LOG_RESET_RQST 0x1B | ||
531 | #define X25LOG_RESET_CONFRM 0x1F | ||
532 | #define X25LOG_RESTART_RQST 0xFB | ||
533 | #define X25LOG_RESTART_COMFRM 0xFF | ||
534 | #define X25LOG_DIAGNOSTIC 0xF1 | ||
535 | #define X25LOG_DTE_REG_RQST 0xF3 | ||
536 | #define X25LOG_DTE_REG_COMFRM 0xF7 | ||
537 | |||
538 | /* --------------------------------------------------------------------------- | ||
539 | * X25_TRACE_CONFIGURE Command. | ||
540 | */ | ||
541 | typedef struct X25TraceCfg | ||
542 | { | ||
543 | unsigned char flags PACKED; /* 00h: trace configuration flags */ | ||
544 | unsigned char timeout PACKED; /* 01h: timeout for trace delay mode*/ | ||
545 | } TX25TraceCfg; | ||
546 | |||
547 | /* | ||
548 | * Defines for the 'flags' field. | ||
549 | */ | ||
550 | #define X25_TRC_ENABLE 0x01 /* bit0: '1' - trace enabled */ | ||
551 | #define X25_TRC_TIMESTAMP 0x02 /* bit1: '1' - time stamping enabled*/ | ||
552 | #define X25_TRC_DELAY 0x04 /* bit2: '1' - trace delay enabled */ | ||
553 | #define X25_TRC_DATA 0x08 /* bit3: '1' - trace data packets */ | ||
554 | #define X25_TRC_SUPERVISORY 0x10 /* bit4: '1' - trace suprvisory pkts*/ | ||
555 | #define X25_TRC_ASYNCHRONOUS 0x20 /* bit5: '1' - trace asynch. packets*/ | ||
556 | #define X25_TRC_HDLC 0x40 /* bit6: '1' - trace all packets */ | ||
557 | #define X25_TRC_READ 0x80 /* bit7: '1' - get current config. */ | ||
558 | |||
559 | /* --------------------------------------------------------------------------- | ||
560 | * X25_READ_TRACE_DATA Command. | ||
561 | */ | ||
562 | typedef struct X25Trace /*----- Trace data structure -------*/ | ||
563 | { | ||
564 | unsigned short length PACKED; /* 00h: trace data length */ | ||
565 | unsigned char type PACKED; /* 02h: trace type */ | ||
566 | unsigned char lost_cnt PACKED; /* 03h: N of traces lost */ | ||
567 | TX25TimeStamp tstamp PACKED; /* 04h: mon/date/sec/min/hour */ | ||
568 | unsigned short millisec PACKED; /* 09h: ms time stamp */ | ||
569 | unsigned char data[0] PACKED; /* 0Bh: traced frame */ | ||
570 | } TX25Trace; | ||
571 | |||
572 | /* | ||
573 | * Defines for the 'type' field. | ||
574 | */ | ||
575 | #define X25_TRC_TYPE_MASK 0x0F /* bits 0..3: trace type */ | ||
576 | #define X25_TRC_TYPE_RX_FRAME 0x00 /* received frame trace */ | ||
577 | #define X25_TRC_TYPE_TX_FRAME 0x01 /* transmitted frame */ | ||
578 | #define X25_TRC_TYPE_ERR_FRAME 0x02 /* error frame */ | ||
579 | |||
580 | #define X25_TRC_ERROR_MASK 0xF0 /* bits 4..7: error code */ | ||
581 | #define X25_TRCERR_RX_ABORT 0x10 /* receive abort error */ | ||
582 | #define X25_TRCERR_RX_BADCRC 0x20 /* receive CRC error */ | ||
583 | #define X25_TRCERR_RX_OVERRUN 0x30 /* receiver overrun error */ | ||
584 | #define X25_TRCERR_RX_TOO_LONG 0x40 /* excessive frame length error */ | ||
585 | #define X25_TRCERR_TX_ABORT 0x70 /* aborted frame transmittion error */ | ||
586 | #define X25_TRCERR_TX_UNDERRUN 0x80 /* transmit underrun error */ | ||
587 | |||
588 | /***************************************************************************** | ||
589 | * Following definitions describe HDLC frame and X.25 packet formats. | ||
590 | ****************************************************************************/ | ||
591 | |||
592 | typedef struct HDLCFrame /*----- DHLC Frame Format ----------*/ | ||
593 | { | ||
594 | unsigned char addr PACKED; /* address field */ | ||
595 | unsigned char cntl PACKED; /* control field */ | ||
596 | unsigned char data[0] PACKED; | ||
597 | } THDLCFrame; | ||
598 | |||
599 | typedef struct X25Pkt /*----- X.25 Paket Format ----------*/ | ||
600 | { | ||
601 | unsigned char lcn_hi PACKED; /* 4 MSB of Logical Channel Number */ | ||
602 | unsigned char lcn_lo PACKED; /* 8 LSB of Logical Channel Number */ | ||
603 | unsigned char type PACKED; | ||
604 | unsigned char data[0] PACKED; | ||
605 | } TX25Pkt; | ||
606 | |||
607 | /* | ||
608 | * Defines for the 'lcn_hi' field. | ||
609 | */ | ||
610 | #define X25_Q_BIT_MASK 0x80 /* Data Qualifier Bit mask */ | ||
611 | #define X25_D_BIT_MASK 0x40 /* Delivery Confirmation Bit mask */ | ||
612 | #define X25_M_BITS_MASK 0x30 /* Modulo Bits mask */ | ||
613 | #define X25_LCN_MSB_MASK 0x0F /* LCN most significant bits mask */ | ||
614 | |||
615 | /* | ||
616 | * Defines for the 'type' field. | ||
617 | */ | ||
618 | #define X25PKT_DATA 0x01 /* Data packet mask */ | ||
619 | #define X25PKT_SUPERVISORY 0x02 /* Supervisory packet mask */ | ||
620 | #define X25PKT_CALL_RQST 0x0B /* Call Request/Incoming */ | ||
621 | #define X25PKT_CALL_ACCEPTED 0x0F /* Call Accepted/Connected */ | ||
622 | #define X25PKT_CLEAR_RQST 0x13 /* Clear Request/Indication */ | ||
623 | #define X25PKT_CLEAR_CONFRM 0x17 /* Clear Confirmation */ | ||
624 | #define X25PKT_RESET_RQST 0x1B /* Reset Request/Indication */ | ||
625 | #define X25PKT_RESET_CONFRM 0x1F /* Reset Confirmation */ | ||
626 | #define X25PKT_RESTART_RQST 0xFB /* Restart Request/Indication */ | ||
627 | #define X25PKT_RESTART_CONFRM 0xFF /* Restart Confirmation */ | ||
628 | #define X25PKT_INTERRUPT 0x23 /* Interrupt */ | ||
629 | #define X25PKT_INTERRUPT_CONFRM 0x27 /* Interrupt Confirmation */ | ||
630 | #define X25PKT_DIAGNOSTIC 0xF1 /* Diagnostic */ | ||
631 | #define X25PKT_REGISTR_RQST 0xF3 /* Registration Request */ | ||
632 | #define X25PKT_REGISTR_CONFRM 0xF7 /* Registration Confirmation */ | ||
633 | #define X25PKT_RR_MASKED 0x01 /* Receive Ready packet after masking */ | ||
634 | #define X25PKT_RNR_MASKED 0x05 /* Receive Not Ready after masking */ | ||
635 | |||
636 | |||
637 | typedef struct { | ||
638 | TX25Cmd cmd PACKED; | ||
639 | char data[X25_MAX_DATA] PACKED; | ||
640 | } mbox_cmd_t; | ||
641 | |||
642 | |||
643 | typedef struct { | ||
644 | unsigned char qdm PACKED; /* Q/D/M bits */ | ||
645 | unsigned char cause PACKED; /* cause field */ | ||
646 | unsigned char diagn PACKED; /* diagnostics */ | ||
647 | unsigned char pktType PACKED; | ||
648 | unsigned short length PACKED; | ||
649 | unsigned char result PACKED; | ||
650 | unsigned short lcn PACKED; | ||
651 | char reserved[7] PACKED; | ||
652 | }x25api_hdr_t; | ||
653 | |||
654 | |||
655 | typedef struct { | ||
656 | x25api_hdr_t hdr PACKED; | ||
657 | char data[X25_MAX_DATA] PACKED; | ||
658 | }x25api_t; | ||
659 | |||
660 | |||
661 | /* | ||
662 | * XPIPEMON Definitions | ||
663 | */ | ||
664 | |||
665 | /* valid ip_protocol for UDP management */ | ||
666 | #define UDPMGMT_UDP_PROTOCOL 0x11 | ||
667 | #define UDPMGMT_XPIPE_SIGNATURE "XLINK8ND" | ||
668 | #define UDPMGMT_DRVRSTATS_SIGNATURE "DRVSTATS" | ||
669 | |||
670 | /* values for request/reply byte */ | ||
671 | #define UDPMGMT_REQUEST 0x01 | ||
672 | #define UDPMGMT_REPLY 0x02 | ||
673 | #define UDP_OFFSET 12 | ||
674 | |||
675 | |||
676 | typedef struct { | ||
677 | unsigned char opp_flag PACKED; /* the opp flag */ | ||
678 | unsigned char command PACKED; /* command code */ | ||
679 | unsigned short length PACKED; /* transfer data length */ | ||
680 | unsigned char result PACKED; /* return code */ | ||
681 | unsigned char pf PACKED; /* P/F bit */ | ||
682 | unsigned short lcn PACKED; /* logical channel */ | ||
683 | unsigned char qdm PACKED; /* Q/D/M bits */ | ||
684 | unsigned char cause PACKED; /* cause field */ | ||
685 | unsigned char diagn PACKED; /* diagnostics */ | ||
686 | unsigned char pktType PACKED; /* packet type */ | ||
687 | unsigned char resrv[4] PACKED; /* reserved */ | ||
688 | } cblock_t; | ||
689 | |||
690 | typedef struct { | ||
691 | ip_pkt_t ip_pkt PACKED; | ||
692 | udp_pkt_t udp_pkt PACKED; | ||
693 | wp_mgmt_t wp_mgmt PACKED; | ||
694 | cblock_t cblock PACKED; | ||
695 | unsigned char data[4080] PACKED; | ||
696 | } x25_udp_pkt_t; | ||
697 | |||
698 | |||
699 | typedef struct read_hdlc_stat { | ||
700 | unsigned short inf_frames_rx_ok PACKED; | ||
701 | unsigned short inf_frames_rx_out_of_seq PACKED; | ||
702 | unsigned short inf_frames_rx_no_data PACKED; | ||
703 | unsigned short inf_frames_rx_dropped PACKED; | ||
704 | unsigned short inf_frames_rx_data_too_long PACKED; | ||
705 | unsigned short inf_frames_rx_invalid_addr PACKED; | ||
706 | unsigned short inf_frames_tx_ok PACKED; | ||
707 | unsigned short inf_frames_tx_retransmit PACKED; | ||
708 | unsigned short T1_timeouts PACKED; | ||
709 | unsigned short SABM_frames_rx PACKED; | ||
710 | unsigned short DISC_frames_rx PACKED; | ||
711 | unsigned short DM_frames_rx PACKED; | ||
712 | unsigned short FRMR_frames_rx PACKED; | ||
713 | unsigned short SABM_frames_tx PACKED; | ||
714 | unsigned short DISC_frames_tx PACKED; | ||
715 | unsigned short DM_frames_tx PACKED; | ||
716 | unsigned short FRMR_frames_tx PACKED; | ||
717 | } read_hdlc_stat_t; | ||
718 | |||
719 | typedef struct read_comms_err_stats{ | ||
720 | unsigned char overrun_err_rx PACKED; | ||
721 | unsigned char CRC_err PACKED; | ||
722 | unsigned char abort_frames_rx PACKED; | ||
723 | unsigned char frames_dropped_buf_full PACKED; | ||
724 | unsigned char abort_frames_tx PACKED; | ||
725 | unsigned char transmit_underruns PACKED; | ||
726 | unsigned char missed_tx_underruns_intr PACKED; | ||
727 | unsigned char reserved PACKED; | ||
728 | unsigned char DCD_drop PACKED; | ||
729 | unsigned char CTS_drop PACKED; | ||
730 | } read_comms_err_stats_t; | ||
731 | |||
732 | typedef struct trace_data { | ||
733 | unsigned short length PACKED; | ||
734 | unsigned char type PACKED; | ||
735 | unsigned char trace_dropped PACKED; | ||
736 | unsigned char reserved[5] PACKED; | ||
737 | unsigned short timestamp PACKED; | ||
738 | unsigned char data PACKED; | ||
739 | } trace_data_t; | ||
740 | |||
741 | enum {UDP_XPIPE_TYPE}; | ||
742 | |||
743 | #define XPIPE_ENABLE_TRACING 0x14 | ||
744 | #define XPIPE_DISABLE_TRACING 0x14 | ||
745 | #define XPIPE_GET_TRACE_INFO 0x16 | ||
746 | #define XPIPE_FT1_READ_STATUS 0x74 | ||
747 | #define XPIPE_DRIVER_STAT_IFSEND 0x75 | ||
748 | #define XPIPE_DRIVER_STAT_INTR 0x76 | ||
749 | #define XPIPE_DRIVER_STAT_GEN 0x77 | ||
750 | #define XPIPE_FLUSH_DRIVER_STATS 0x78 | ||
751 | #define XPIPE_ROUTER_UP_TIME 0x79 | ||
752 | #define XPIPE_SET_FT1_MODE 0x81 | ||
753 | #define XPIPE_FT1_STATUS_CTRL 0x80 | ||
754 | |||
755 | |||
756 | /* error messages */ | ||
757 | #define NO_BUFFS_OR_CLOSED_WIN 0x33 | ||
758 | #define DATA_LENGTH_TOO_BIG 0x32 | ||
759 | #define NO_DATA_AVAILABLE 0x33 | ||
760 | #define Z80_TIMEOUT_ERROR 0x0a | ||
761 | #define NO_BUFFS 0x08 | ||
762 | |||
763 | |||
764 | /* Trace options */ | ||
765 | #define TRACE_DEFAULT 0x03 | ||
766 | #define TRACE_SUPERVISOR_FRMS 0x10 | ||
767 | #define TRACE_ASYNC_FRMS 0x20 | ||
768 | #define TRACE_ALL_HDLC_FRMS 0x40 | ||
769 | #define TRACE_DATA_FRMS 0x08 | ||
770 | |||
771 | |||
772 | #endif /* _SDLA_X25_H */ | ||
diff --git a/include/linux/sdladrv.h b/include/linux/sdladrv.h deleted file mode 100644 index c85e103d5e7b..000000000000 --- a/include/linux/sdladrv.h +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdladrv.h SDLA Support Module. Kernel API Definitions. | ||
3 | * | ||
4 | * Author: Gideon Hack | ||
5 | * | ||
6 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * Jun 02, 1999 Gideon Hack Added support for the S514 PCI adapter. | ||
14 | * Dec 11, 1996 Gene Kozin Complete overhaul. | ||
15 | * Oct 17, 1996 Gene Kozin Minor bug fixes. | ||
16 | * Jun 12, 1996 Gene Kozin Added support for S503 card. | ||
17 | * Dec 06, 1995 Gene Kozin Initial version. | ||
18 | *****************************************************************************/ | ||
19 | #ifndef _SDLADRV_H | ||
20 | #define _SDLADRV_H | ||
21 | |||
22 | |||
23 | #define SDLA_MAXIORANGE 4 /* maximum I/O port range */ | ||
24 | #define SDLA_WINDOWSIZE 0x2000 /* default dual-port memory window size */ | ||
25 | /****** Data Structures *****************************************************/ | ||
26 | |||
27 | /*---------------------------------------------------------------------------- | ||
28 | * Adapter hardware configuration. Pointer to this structure is passed to all | ||
29 | * APIs. | ||
30 | */ | ||
31 | typedef struct sdlahw | ||
32 | { | ||
33 | unsigned type; /* adapter type */ | ||
34 | unsigned fwid; /* firmware ID */ | ||
35 | unsigned port; /* adapter I/O port base */ | ||
36 | int irq; /* interrupt request level */ | ||
37 | char S514_cpu_no[1]; /* PCI CPU Number */ | ||
38 | unsigned char S514_slot_no; /* PCI Slot Number */ | ||
39 | char auto_pci_cfg; /* Autodetect PCI Slot */ | ||
40 | struct pci_dev *pci_dev; /* PCI device */ | ||
41 | void * dpmbase; /* dual-port memory base */ | ||
42 | unsigned dpmsize; /* dual-port memory size */ | ||
43 | unsigned pclk; /* CPU clock rate, kHz */ | ||
44 | unsigned long memory; /* memory size */ | ||
45 | unsigned long vector; /* local offset of the DPM window */ | ||
46 | unsigned io_range; /* I/O port range */ | ||
47 | unsigned char regs[SDLA_MAXIORANGE]; /* was written to registers */ | ||
48 | unsigned reserved[5]; | ||
49 | } sdlahw_t; | ||
50 | |||
51 | /****** Function Prototypes *************************************************/ | ||
52 | |||
53 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); | ||
54 | extern int sdla_down (sdlahw_t* hw); | ||
55 | extern void S514_intack (sdlahw_t* hw, u32 int_status); | ||
56 | extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); | ||
57 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); | ||
58 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, | ||
59 | unsigned len); | ||
60 | extern int sdla_poke (sdlahw_t* hw, unsigned long addr, void* buf, | ||
61 | unsigned len); | ||
62 | extern int sdla_exec (void* opflag); | ||
63 | |||
64 | extern unsigned wanpipe_hw_probe(void); | ||
65 | |||
66 | #endif /* _SDLADRV_H */ | ||
diff --git a/include/linux/sdlapci.h b/include/linux/sdlapci.h deleted file mode 100644 index 6f7c904f188d..000000000000 --- a/include/linux/sdlapci.h +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdlapci.h WANPIPE(tm) Multiprotocol WAN Link Driver. | ||
3 | * Definitions for the SDLA PCI adapter. | ||
4 | * | ||
5 | * Author: Gideon Hack <ghack@sangoma.com> | ||
6 | * | ||
7 | * Copyright: (c) 1999-2000 Sangoma Technologies Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | * ============================================================================ | ||
14 | * Jun 02, 1999 Gideon Hack Initial version. | ||
15 | *****************************************************************************/ | ||
16 | #ifndef _SDLAPCI_H | ||
17 | #define _SDLAPCI_H | ||
18 | |||
19 | /****** Defines *************************************************************/ | ||
20 | |||
21 | /* Definitions for identifying and finding S514 PCI adapters */ | ||
22 | #define V3_VENDOR_ID 0x11B0 /* V3 vendor ID number */ | ||
23 | #define V3_DEVICE_ID 0x0002 /* V3 device ID number */ | ||
24 | #define SANGOMA_SUBSYS_VENDOR 0x4753 /* ID for Sangoma */ | ||
25 | #define PCI_DEV_SLOT_MASK 0x1F /* mask for slot numbering */ | ||
26 | #define PCI_IRQ_NOT_ALLOCATED 0xFF /* interrupt line for no IRQ */ | ||
27 | |||
28 | /* Local PCI register offsets */ | ||
29 | #define PCI_VENDOR_ID_WORD 0x00 /* vendor ID */ | ||
30 | #define PCI_IO_BASE_DWORD 0x10 /* IO base */ | ||
31 | #define PCI_MEM_BASE0_DWORD 0x14 /* memory base - apperture 0 */ | ||
32 | #define PCI_MEM_BASE1_DWORD 0x18 /* memory base - apperture 1 */ | ||
33 | #define PCI_SUBSYS_VENDOR_WORD 0x2C /* subsystem vendor ID */ | ||
34 | #define PCI_INT_LINE_BYTE 0x3C /* interrupt line */ | ||
35 | #define PCI_INT_PIN_BYTE 0x3D /* interrupt pin */ | ||
36 | #define PCI_MAP0_DWORD 0x40 /* PCI to local bus address 0 */ | ||
37 | #define PCI_MAP1_DWORD 0x44 /* PCI to local bus address 1 */ | ||
38 | #define PCI_INT_STATUS 0x48 /* interrupt status */ | ||
39 | #define PCI_INT_CONFIG 0x4C /* interrupt configuration */ | ||
40 | |||
41 | /* Local PCI register usage */ | ||
42 | #define PCI_MEMORY_ENABLE 0x00000003 /* enable PCI memory */ | ||
43 | #define PCI_CPU_A_MEM_DISABLE 0x00000002 /* disable CPU A memory */ | ||
44 | #define PCI_CPU_B_MEM_DISABLE 0x00100002 /* disable CPU B memory */ | ||
45 | #define PCI_ENABLE_IRQ_CPU_A 0x005A0004 /* enable IRQ for CPU A */ | ||
46 | #define PCI_ENABLE_IRQ_CPU_B 0x005A0008 /* enable IRQ for CPU B */ | ||
47 | #define PCI_DISABLE_IRQ_CPU_A 0x00000004 /* disable IRQ for CPU A */ | ||
48 | #define PCI_DISABLE_IRQ_CPU_B 0x00000008 /* disable IRQ for CPU B */ | ||
49 | |||
50 | /* Setting for the Interrupt Status register */ | ||
51 | #define IRQ_CPU_A 0x04 /* IRQ for CPU A */ | ||
52 | #define IRQ_CPU_B 0x08 /* IRQ for CPU B */ | ||
53 | |||
54 | /* The maximum size of the S514 memory */ | ||
55 | #define MAX_SIZEOF_S514_MEMORY (256 * 1024) | ||
56 | |||
57 | /* S514 control register offsets within the memory address space */ | ||
58 | #define S514_CTRL_REG_BYTE 0x80000 | ||
59 | |||
60 | /* S514 adapter control bytes */ | ||
61 | #define S514_CPU_HALT 0x00 | ||
62 | #define S514_CPU_START 0x01 | ||
63 | |||
64 | /* The maximum number of S514 adapters supported */ | ||
65 | #define MAX_S514_CARDS 20 | ||
66 | |||
67 | #define PCI_CARD_TYPE 0x2E | ||
68 | #define S514_DUAL_CPU 0x12 | ||
69 | #define S514_SINGLE_CPU 0x11 | ||
70 | |||
71 | #endif /* _SDLAPCI_H */ | ||
72 | |||
diff --git a/include/linux/sdlasfm.h b/include/linux/sdlasfm.h deleted file mode 100644 index 94aaa8ada667..000000000000 --- a/include/linux/sdlasfm.h +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdlasfm.h WANPIPE(tm) Multiprotocol WAN Link Driver. | ||
3 | * Definitions for the SDLA Firmware Module (SFM). | ||
4 | * | ||
5 | * Author: Gideon Hack | ||
6 | * | ||
7 | * Copyright: (c) 1995-1999 Sangoma Technologies Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | * ============================================================================ | ||
14 | * Jun 02, 1999 Gideon Hack Added support for the S514 adapter. | ||
15 | * Dec 11, 1996 Gene Kozin Cosmetic changes | ||
16 | * Apr 16, 1996 Gene Kozin Changed adapter & firmware IDs. Version 2 | ||
17 | * Dec 15, 1995 Gene Kozin Structures chaned | ||
18 | * Nov 09, 1995 Gene Kozin Initial version. | ||
19 | *****************************************************************************/ | ||
20 | #ifndef _SDLASFM_H | ||
21 | #define _SDLASFM_H | ||
22 | |||
23 | /****** Defines *************************************************************/ | ||
24 | |||
25 | #define SFM_VERSION 2 | ||
26 | #define SFM_SIGNATURE "SFM - Sangoma SDLA Firmware Module" | ||
27 | |||
28 | /* min/max */ | ||
29 | #define SFM_IMAGE_SIZE 0x8000 /* max size of SDLA code image file */ | ||
30 | #define SFM_DESCR_LEN 256 /* max length of description string */ | ||
31 | #define SFM_MAX_SDLA 16 /* max number of compatible adapters */ | ||
32 | |||
33 | /* Adapter types */ | ||
34 | #define SDLA_S502A 5020 | ||
35 | #define SDLA_S502E 5021 | ||
36 | #define SDLA_S503 5030 | ||
37 | #define SDLA_S508 5080 | ||
38 | #define SDLA_S507 5070 | ||
39 | #define SDLA_S509 5090 | ||
40 | #define SDLA_S514 5140 | ||
41 | |||
42 | /* S514 PCI adapter CPU numbers */ | ||
43 | #define S514_CPU_A 'A' | ||
44 | #define S514_CPU_B 'B' | ||
45 | |||
46 | |||
47 | /* Firmware identification numbers: | ||
48 | * 0 .. 999 Test & Diagnostics | ||
49 | * 1000 .. 1999 Streaming HDLC | ||
50 | * 2000 .. 2999 Bisync | ||
51 | * 3000 .. 3999 SDLC | ||
52 | * 4000 .. 4999 HDLC | ||
53 | * 5000 .. 5999 X.25 | ||
54 | * 6000 .. 6999 Frame Relay | ||
55 | * 7000 .. 7999 PPP | ||
56 | * 8000 .. 8999 Cisco HDLC | ||
57 | */ | ||
58 | #define SFID_CALIB502 200 | ||
59 | #define SFID_STRM502 1200 | ||
60 | #define SFID_STRM508 1800 | ||
61 | #define SFID_BSC502 2200 | ||
62 | #define SFID_SDLC502 3200 | ||
63 | #define SFID_HDLC502 4200 | ||
64 | #define SFID_HDLC508 4800 | ||
65 | #define SFID_X25_502 5200 | ||
66 | #define SFID_X25_508 5800 | ||
67 | #define SFID_FR502 6200 | ||
68 | #define SFID_FR508 6800 | ||
69 | #define SFID_PPP502 7200 | ||
70 | #define SFID_PPP508 7800 | ||
71 | #define SFID_PPP514 7140 | ||
72 | #define SFID_CHDLC508 8800 | ||
73 | #define SFID_CHDLC514 8140 | ||
74 | |||
75 | /****** Data Types **********************************************************/ | ||
76 | |||
77 | typedef struct sfm_info /* firmware module information */ | ||
78 | { | ||
79 | unsigned short codeid; /* firmware ID */ | ||
80 | unsigned short version; /* firmaware version number */ | ||
81 | unsigned short adapter[SFM_MAX_SDLA]; /* compatible adapter types */ | ||
82 | unsigned long memsize; /* minimum memory size */ | ||
83 | unsigned short reserved[2]; /* reserved */ | ||
84 | unsigned short startoffs; /* entry point offset */ | ||
85 | unsigned short winoffs; /* dual-port memory window offset */ | ||
86 | unsigned short codeoffs; /* code load offset */ | ||
87 | unsigned short codesize; /* code size */ | ||
88 | unsigned short dataoffs; /* configuration data load offset */ | ||
89 | unsigned short datasize; /* configuration data size */ | ||
90 | } sfm_info_t; | ||
91 | |||
92 | typedef struct sfm /* SDLA firmware file structire */ | ||
93 | { | ||
94 | char signature[80]; /* SFM file signature */ | ||
95 | unsigned short version; /* file format version */ | ||
96 | unsigned short checksum; /* info + image */ | ||
97 | unsigned short reserved[6]; /* reserved */ | ||
98 | char descr[SFM_DESCR_LEN]; /* description string */ | ||
99 | sfm_info_t info; /* firmware module info */ | ||
100 | unsigned char image[1]; /* code image (variable size) */ | ||
101 | } sfm_t; | ||
102 | |||
103 | #endif /* _SDLASFM_H */ | ||
104 | |||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index f001bad28d9a..d3ebc0e68b2b 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -574,6 +574,8 @@ asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, | |||
574 | int fd_out, loff_t __user *off_out, | 574 | int fd_out, loff_t __user *off_out, |
575 | size_t len, unsigned int flags); | 575 | size_t len, unsigned int flags); |
576 | 576 | ||
577 | asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); | ||
578 | |||
577 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | 579 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, |
578 | unsigned int flags); | 580 | unsigned int flags); |
579 | 581 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 392da5a6dacb..1ea5d3cda6ae 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -74,6 +74,7 @@ struct sysfs_dirent { | |||
74 | umode_t s_mode; | 74 | umode_t s_mode; |
75 | struct dentry * s_dentry; | 75 | struct dentry * s_dentry; |
76 | struct iattr * s_iattr; | 76 | struct iattr * s_iattr; |
77 | atomic_t s_event; | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | #define SYSFS_ROOT 0x0001 | 80 | #define SYSFS_ROOT 0x0001 |
@@ -117,6 +118,7 @@ int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); | |||
117 | 118 | ||
118 | int sysfs_create_group(struct kobject *, const struct attribute_group *); | 119 | int sysfs_create_group(struct kobject *, const struct attribute_group *); |
119 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | 120 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); |
121 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | ||
120 | 122 | ||
121 | #else /* CONFIG_SYSFS */ | 123 | #else /* CONFIG_SYSFS */ |
122 | 124 | ||
@@ -185,6 +187,10 @@ static inline void sysfs_remove_group(struct kobject * k, const struct attribute | |||
185 | ; | 187 | ; |
186 | } | 188 | } |
187 | 189 | ||
190 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) | ||
191 | { | ||
192 | } | ||
193 | |||
188 | #endif /* CONFIG_SYSFS */ | 194 | #endif /* CONFIG_SYSFS */ |
189 | 195 | ||
190 | #endif /* _SYSFS_H_ */ | 196 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/usb/net2280.h b/include/linux/usb/net2280.h new file mode 100644 index 000000000000..c602f884f182 --- /dev/null +++ b/include/linux/usb/net2280.h | |||
@@ -0,0 +1,444 @@ | |||
1 | /* | ||
2 | * NetChip 2280 high/full speed USB device controller. | ||
3 | * Unlike many such controllers, this one talks PCI. | ||
4 | */ | ||
5 | #ifndef __LINUX_USB_NET2280_H | ||
6 | #define __LINUX_USB_NET2280_H | ||
7 | |||
8 | /* | ||
9 | * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com) | ||
10 | * Copyright (C) 2003 David Brownell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License as published by | ||
14 | * the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | */ | ||
26 | |||
27 | /*-------------------------------------------------------------------------*/ | ||
28 | |||
29 | /* NET2280 MEMORY MAPPED REGISTERS | ||
30 | * | ||
31 | * The register layout came from the chip documentation, and the bit | ||
32 | * number definitions were extracted from chip specification. | ||
33 | * | ||
34 | * Use the shift operator ('<<') to build bit masks, with readl/writel | ||
35 | * to access the registers through PCI. | ||
36 | */ | ||
37 | |||
38 | /* main registers, BAR0 + 0x0000 */ | ||
39 | struct net2280_regs { | ||
40 | // offset 0x0000 | ||
41 | u32 devinit; | ||
42 | #define LOCAL_CLOCK_FREQUENCY 8 | ||
43 | #define FORCE_PCI_RESET 7 | ||
44 | #define PCI_ID 6 | ||
45 | #define PCI_ENABLE 5 | ||
46 | #define FIFO_SOFT_RESET 4 | ||
47 | #define CFG_SOFT_RESET 3 | ||
48 | #define PCI_SOFT_RESET 2 | ||
49 | #define USB_SOFT_RESET 1 | ||
50 | #define M8051_RESET 0 | ||
51 | u32 eectl; | ||
52 | #define EEPROM_ADDRESS_WIDTH 23 | ||
53 | #define EEPROM_CHIP_SELECT_ACTIVE 22 | ||
54 | #define EEPROM_PRESENT 21 | ||
55 | #define EEPROM_VALID 20 | ||
56 | #define EEPROM_BUSY 19 | ||
57 | #define EEPROM_CHIP_SELECT_ENABLE 18 | ||
58 | #define EEPROM_BYTE_READ_START 17 | ||
59 | #define EEPROM_BYTE_WRITE_START 16 | ||
60 | #define EEPROM_READ_DATA 8 | ||
61 | #define EEPROM_WRITE_DATA 0 | ||
62 | u32 eeclkfreq; | ||
63 | u32 _unused0; | ||
64 | // offset 0x0010 | ||
65 | |||
66 | u32 pciirqenb0; /* interrupt PCI master ... */ | ||
67 | #define SETUP_PACKET_INTERRUPT_ENABLE 7 | ||
68 | #define ENDPOINT_F_INTERRUPT_ENABLE 6 | ||
69 | #define ENDPOINT_E_INTERRUPT_ENABLE 5 | ||
70 | #define ENDPOINT_D_INTERRUPT_ENABLE 4 | ||
71 | #define ENDPOINT_C_INTERRUPT_ENABLE 3 | ||
72 | #define ENDPOINT_B_INTERRUPT_ENABLE 2 | ||
73 | #define ENDPOINT_A_INTERRUPT_ENABLE 1 | ||
74 | #define ENDPOINT_0_INTERRUPT_ENABLE 0 | ||
75 | u32 pciirqenb1; | ||
76 | #define PCI_INTERRUPT_ENABLE 31 | ||
77 | #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 | ||
78 | #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 | ||
79 | #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 | ||
80 | #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 | ||
81 | #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 | ||
82 | #define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18 | ||
83 | #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 | ||
84 | #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 | ||
85 | #define GPIO_INTERRUPT_ENABLE 13 | ||
86 | #define DMA_D_INTERRUPT_ENABLE 12 | ||
87 | #define DMA_C_INTERRUPT_ENABLE 11 | ||
88 | #define DMA_B_INTERRUPT_ENABLE 10 | ||
89 | #define DMA_A_INTERRUPT_ENABLE 9 | ||
90 | #define EEPROM_DONE_INTERRUPT_ENABLE 8 | ||
91 | #define VBUS_INTERRUPT_ENABLE 7 | ||
92 | #define CONTROL_STATUS_INTERRUPT_ENABLE 6 | ||
93 | #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 | ||
94 | #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 | ||
95 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 | ||
96 | #define RESUME_INTERRUPT_ENABLE 1 | ||
97 | #define SOF_INTERRUPT_ENABLE 0 | ||
98 | u32 cpu_irqenb0; /* ... or onboard 8051 */ | ||
99 | #define SETUP_PACKET_INTERRUPT_ENABLE 7 | ||
100 | #define ENDPOINT_F_INTERRUPT_ENABLE 6 | ||
101 | #define ENDPOINT_E_INTERRUPT_ENABLE 5 | ||
102 | #define ENDPOINT_D_INTERRUPT_ENABLE 4 | ||
103 | #define ENDPOINT_C_INTERRUPT_ENABLE 3 | ||
104 | #define ENDPOINT_B_INTERRUPT_ENABLE 2 | ||
105 | #define ENDPOINT_A_INTERRUPT_ENABLE 1 | ||
106 | #define ENDPOINT_0_INTERRUPT_ENABLE 0 | ||
107 | u32 cpu_irqenb1; | ||
108 | #define CPU_INTERRUPT_ENABLE 31 | ||
109 | #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 | ||
110 | #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 | ||
111 | #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 | ||
112 | #define PCI_INTA_INTERRUPT_ENABLE 24 | ||
113 | #define PCI_PME_INTERRUPT_ENABLE 23 | ||
114 | #define PCI_SERR_INTERRUPT_ENABLE 22 | ||
115 | #define PCI_PERR_INTERRUPT_ENABLE 21 | ||
116 | #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 | ||
117 | #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 | ||
118 | #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 | ||
119 | #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 | ||
120 | #define GPIO_INTERRUPT_ENABLE 13 | ||
121 | #define DMA_D_INTERRUPT_ENABLE 12 | ||
122 | #define DMA_C_INTERRUPT_ENABLE 11 | ||
123 | #define DMA_B_INTERRUPT_ENABLE 10 | ||
124 | #define DMA_A_INTERRUPT_ENABLE 9 | ||
125 | #define EEPROM_DONE_INTERRUPT_ENABLE 8 | ||
126 | #define VBUS_INTERRUPT_ENABLE 7 | ||
127 | #define CONTROL_STATUS_INTERRUPT_ENABLE 6 | ||
128 | #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 | ||
129 | #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 | ||
130 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 | ||
131 | #define RESUME_INTERRUPT_ENABLE 1 | ||
132 | #define SOF_INTERRUPT_ENABLE 0 | ||
133 | |||
134 | // offset 0x0020 | ||
135 | u32 _unused1; | ||
136 | u32 usbirqenb1; | ||
137 | #define USB_INTERRUPT_ENABLE 31 | ||
138 | #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 | ||
139 | #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 | ||
140 | #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 | ||
141 | #define PCI_INTA_INTERRUPT_ENABLE 24 | ||
142 | #define PCI_PME_INTERRUPT_ENABLE 23 | ||
143 | #define PCI_SERR_INTERRUPT_ENABLE 22 | ||
144 | #define PCI_PERR_INTERRUPT_ENABLE 21 | ||
145 | #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 | ||
146 | #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 | ||
147 | #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 | ||
148 | #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 | ||
149 | #define GPIO_INTERRUPT_ENABLE 13 | ||
150 | #define DMA_D_INTERRUPT_ENABLE 12 | ||
151 | #define DMA_C_INTERRUPT_ENABLE 11 | ||
152 | #define DMA_B_INTERRUPT_ENABLE 10 | ||
153 | #define DMA_A_INTERRUPT_ENABLE 9 | ||
154 | #define EEPROM_DONE_INTERRUPT_ENABLE 8 | ||
155 | #define VBUS_INTERRUPT_ENABLE 7 | ||
156 | #define CONTROL_STATUS_INTERRUPT_ENABLE 6 | ||
157 | #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 | ||
158 | #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 | ||
159 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 | ||
160 | #define RESUME_INTERRUPT_ENABLE 1 | ||
161 | #define SOF_INTERRUPT_ENABLE 0 | ||
162 | u32 irqstat0; | ||
163 | #define INTA_ASSERTED 12 | ||
164 | #define SETUP_PACKET_INTERRUPT 7 | ||
165 | #define ENDPOINT_F_INTERRUPT 6 | ||
166 | #define ENDPOINT_E_INTERRUPT 5 | ||
167 | #define ENDPOINT_D_INTERRUPT 4 | ||
168 | #define ENDPOINT_C_INTERRUPT 3 | ||
169 | #define ENDPOINT_B_INTERRUPT 2 | ||
170 | #define ENDPOINT_A_INTERRUPT 1 | ||
171 | #define ENDPOINT_0_INTERRUPT 0 | ||
172 | u32 irqstat1; | ||
173 | #define POWER_STATE_CHANGE_INTERRUPT 27 | ||
174 | #define PCI_ARBITER_TIMEOUT_INTERRUPT 26 | ||
175 | #define PCI_PARITY_ERROR_INTERRUPT 25 | ||
176 | #define PCI_INTA_INTERRUPT 24 | ||
177 | #define PCI_PME_INTERRUPT 23 | ||
178 | #define PCI_SERR_INTERRUPT 22 | ||
179 | #define PCI_PERR_INTERRUPT 21 | ||
180 | #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20 | ||
181 | #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19 | ||
182 | #define PCI_RETRY_ABORT_INTERRUPT 17 | ||
183 | #define PCI_MASTER_CYCLE_DONE_INTERRUPT 16 | ||
184 | #define SOF_DOWN_INTERRUPT 14 | ||
185 | #define GPIO_INTERRUPT 13 | ||
186 | #define DMA_D_INTERRUPT 12 | ||
187 | #define DMA_C_INTERRUPT 11 | ||
188 | #define DMA_B_INTERRUPT 10 | ||
189 | #define DMA_A_INTERRUPT 9 | ||
190 | #define EEPROM_DONE_INTERRUPT 8 | ||
191 | #define VBUS_INTERRUPT 7 | ||
192 | #define CONTROL_STATUS_INTERRUPT 6 | ||
193 | #define ROOT_PORT_RESET_INTERRUPT 4 | ||
194 | #define SUSPEND_REQUEST_INTERRUPT 3 | ||
195 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT 2 | ||
196 | #define RESUME_INTERRUPT 1 | ||
197 | #define SOF_INTERRUPT 0 | ||
198 | // offset 0x0030 | ||
199 | u32 idxaddr; | ||
200 | u32 idxdata; | ||
201 | u32 fifoctl; | ||
202 | #define PCI_BASE2_RANGE 16 | ||
203 | #define IGNORE_FIFO_AVAILABILITY 3 | ||
204 | #define PCI_BASE2_SELECT 2 | ||
205 | #define FIFO_CONFIGURATION_SELECT 0 | ||
206 | u32 _unused2; | ||
207 | // offset 0x0040 | ||
208 | u32 memaddr; | ||
209 | #define START 28 | ||
210 | #define DIRECTION 27 | ||
211 | #define FIFO_DIAGNOSTIC_SELECT 24 | ||
212 | #define MEMORY_ADDRESS 0 | ||
213 | u32 memdata0; | ||
214 | u32 memdata1; | ||
215 | u32 _unused3; | ||
216 | // offset 0x0050 | ||
217 | u32 gpioctl; | ||
218 | #define GPIO3_LED_SELECT 12 | ||
219 | #define GPIO3_INTERRUPT_ENABLE 11 | ||
220 | #define GPIO2_INTERRUPT_ENABLE 10 | ||
221 | #define GPIO1_INTERRUPT_ENABLE 9 | ||
222 | #define GPIO0_INTERRUPT_ENABLE 8 | ||
223 | #define GPIO3_OUTPUT_ENABLE 7 | ||
224 | #define GPIO2_OUTPUT_ENABLE 6 | ||
225 | #define GPIO1_OUTPUT_ENABLE 5 | ||
226 | #define GPIO0_OUTPUT_ENABLE 4 | ||
227 | #define GPIO3_DATA 3 | ||
228 | #define GPIO2_DATA 2 | ||
229 | #define GPIO1_DATA 1 | ||
230 | #define GPIO0_DATA 0 | ||
231 | u32 gpiostat; | ||
232 | #define GPIO3_INTERRUPT 3 | ||
233 | #define GPIO2_INTERRUPT 2 | ||
234 | #define GPIO1_INTERRUPT 1 | ||
235 | #define GPIO0_INTERRUPT 0 | ||
236 | } __attribute__ ((packed)); | ||
237 | |||
238 | /* usb control, BAR0 + 0x0080 */ | ||
239 | struct net2280_usb_regs { | ||
240 | // offset 0x0080 | ||
241 | u32 stdrsp; | ||
242 | #define STALL_UNSUPPORTED_REQUESTS 31 | ||
243 | #define SET_TEST_MODE 16 | ||
244 | #define GET_OTHER_SPEED_CONFIGURATION 15 | ||
245 | #define GET_DEVICE_QUALIFIER 14 | ||
246 | #define SET_ADDRESS 13 | ||
247 | #define ENDPOINT_SET_CLEAR_HALT 12 | ||
248 | #define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11 | ||
249 | #define GET_STRING_DESCRIPTOR_2 10 | ||
250 | #define GET_STRING_DESCRIPTOR_1 9 | ||
251 | #define GET_STRING_DESCRIPTOR_0 8 | ||
252 | #define GET_SET_INTERFACE 6 | ||
253 | #define GET_SET_CONFIGURATION 5 | ||
254 | #define GET_CONFIGURATION_DESCRIPTOR 4 | ||
255 | #define GET_DEVICE_DESCRIPTOR 3 | ||
256 | #define GET_ENDPOINT_STATUS 2 | ||
257 | #define GET_INTERFACE_STATUS 1 | ||
258 | #define GET_DEVICE_STATUS 0 | ||
259 | u32 prodvendid; | ||
260 | #define PRODUCT_ID 16 | ||
261 | #define VENDOR_ID 0 | ||
262 | u32 relnum; | ||
263 | u32 usbctl; | ||
264 | #define SERIAL_NUMBER_INDEX 16 | ||
265 | #define PRODUCT_ID_STRING_ENABLE 13 | ||
266 | #define VENDOR_ID_STRING_ENABLE 12 | ||
267 | #define USB_ROOT_PORT_WAKEUP_ENABLE 11 | ||
268 | #define VBUS_PIN 10 | ||
269 | #define TIMED_DISCONNECT 9 | ||
270 | #define SUSPEND_IMMEDIATELY 7 | ||
271 | #define SELF_POWERED_USB_DEVICE 6 | ||
272 | #define REMOTE_WAKEUP_SUPPORT 5 | ||
273 | #define PME_POLARITY 4 | ||
274 | #define USB_DETECT_ENABLE 3 | ||
275 | #define PME_WAKEUP_ENABLE 2 | ||
276 | #define DEVICE_REMOTE_WAKEUP_ENABLE 1 | ||
277 | #define SELF_POWERED_STATUS 0 | ||
278 | // offset 0x0090 | ||
279 | u32 usbstat; | ||
280 | #define HIGH_SPEED 7 | ||
281 | #define FULL_SPEED 6 | ||
282 | #define GENERATE_RESUME 5 | ||
283 | #define GENERATE_DEVICE_REMOTE_WAKEUP 4 | ||
284 | u32 xcvrdiag; | ||
285 | #define FORCE_HIGH_SPEED_MODE 31 | ||
286 | #define FORCE_FULL_SPEED_MODE 30 | ||
287 | #define USB_TEST_MODE 24 | ||
288 | #define LINE_STATE 16 | ||
289 | #define TRANSCEIVER_OPERATION_MODE 2 | ||
290 | #define TRANSCEIVER_SELECT 1 | ||
291 | #define TERMINATION_SELECT 0 | ||
292 | u32 setup0123; | ||
293 | u32 setup4567; | ||
294 | // offset 0x0090 | ||
295 | u32 _unused0; | ||
296 | u32 ouraddr; | ||
297 | #define FORCE_IMMEDIATE 7 | ||
298 | #define OUR_USB_ADDRESS 0 | ||
299 | u32 ourconfig; | ||
300 | } __attribute__ ((packed)); | ||
301 | |||
302 | /* pci control, BAR0 + 0x0100 */ | ||
303 | struct net2280_pci_regs { | ||
304 | // offset 0x0100 | ||
305 | u32 pcimstctl; | ||
306 | #define PCI_ARBITER_PARK_SELECT 13 | ||
307 | #define PCI_MULTI LEVEL_ARBITER 12 | ||
308 | #define PCI_RETRY_ABORT_ENABLE 11 | ||
309 | #define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10 | ||
310 | #define DMA_READ_MULTIPLE_ENABLE 9 | ||
311 | #define DMA_READ_LINE_ENABLE 8 | ||
312 | #define PCI_MASTER_COMMAND_SELECT 6 | ||
313 | #define MEM_READ_OR_WRITE 0 | ||
314 | #define IO_READ_OR_WRITE 1 | ||
315 | #define CFG_READ_OR_WRITE 2 | ||
316 | #define PCI_MASTER_START 5 | ||
317 | #define PCI_MASTER_READ_WRITE 4 | ||
318 | #define PCI_MASTER_WRITE 0 | ||
319 | #define PCI_MASTER_READ 1 | ||
320 | #define PCI_MASTER_BYTE_WRITE_ENABLES 0 | ||
321 | u32 pcimstaddr; | ||
322 | u32 pcimstdata; | ||
323 | u32 pcimststat; | ||
324 | #define PCI_ARBITER_CLEAR 2 | ||
325 | #define PCI_EXTERNAL_ARBITER 1 | ||
326 | #define PCI_HOST_MODE 0 | ||
327 | } __attribute__ ((packed)); | ||
328 | |||
329 | /* dma control, BAR0 + 0x0180 ... array of four structs like this, | ||
330 | * for channels 0..3. see also struct net2280_dma: descriptor | ||
331 | * that can be loaded into some of these registers. | ||
332 | */ | ||
333 | struct net2280_dma_regs { /* [11.7] */ | ||
334 | // offset 0x0180, 0x01a0, 0x01c0, 0x01e0, | ||
335 | u32 dmactl; | ||
336 | #define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25 | ||
337 | #define DMA_CLEAR_COUNT_ENABLE 21 | ||
338 | #define DESCRIPTOR_POLLING_RATE 19 | ||
339 | #define POLL_CONTINUOUS 0 | ||
340 | #define POLL_1_USEC 1 | ||
341 | #define POLL_100_USEC 2 | ||
342 | #define POLL_1_MSEC 3 | ||
343 | #define DMA_VALID_BIT_POLLING_ENABLE 18 | ||
344 | #define DMA_VALID_BIT_ENABLE 17 | ||
345 | #define DMA_SCATTER_GATHER_ENABLE 16 | ||
346 | #define DMA_OUT_AUTO_START_ENABLE 4 | ||
347 | #define DMA_PREEMPT_ENABLE 3 | ||
348 | #define DMA_FIFO_VALIDATE 2 | ||
349 | #define DMA_ENABLE 1 | ||
350 | #define DMA_ADDRESS_HOLD 0 | ||
351 | u32 dmastat; | ||
352 | #define DMA_ABORT_DONE_INTERRUPT 27 | ||
353 | #define DMA_SCATTER_GATHER_DONE_INTERRUPT 25 | ||
354 | #define DMA_TRANSACTION_DONE_INTERRUPT 24 | ||
355 | #define DMA_ABORT 1 | ||
356 | #define DMA_START 0 | ||
357 | u32 _unused0 [2]; | ||
358 | // offset 0x0190, 0x01b0, 0x01d0, 0x01f0, | ||
359 | u32 dmacount; | ||
360 | #define VALID_BIT 31 | ||
361 | #define DMA_DIRECTION 30 | ||
362 | #define DMA_DONE_INTERRUPT_ENABLE 29 | ||
363 | #define END_OF_CHAIN 28 | ||
364 | #define DMA_BYTE_COUNT_MASK ((1<<24)-1) | ||
365 | #define DMA_BYTE_COUNT 0 | ||
366 | u32 dmaaddr; | ||
367 | u32 dmadesc; | ||
368 | u32 _unused1; | ||
369 | } __attribute__ ((packed)); | ||
370 | |||
371 | /* dedicated endpoint registers, BAR0 + 0x0200 */ | ||
372 | |||
373 | struct net2280_dep_regs { /* [11.8] */ | ||
374 | // offset 0x0200, 0x0210, 0x220, 0x230, 0x240 | ||
375 | u32 dep_cfg; | ||
376 | // offset 0x0204, 0x0214, 0x224, 0x234, 0x244 | ||
377 | u32 dep_rsp; | ||
378 | u32 _unused [2]; | ||
379 | } __attribute__ ((packed)); | ||
380 | |||
381 | /* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs | ||
382 | * like this, for ep0 then the configurable endpoints A..F | ||
383 | * ep0 reserved for control; E and F have only 64 bytes of fifo | ||
384 | */ | ||
385 | struct net2280_ep_regs { /* [11.9] */ | ||
386 | // offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 | ||
387 | u32 ep_cfg; | ||
388 | #define ENDPOINT_BYTE_COUNT 16 | ||
389 | #define ENDPOINT_ENABLE 10 | ||
390 | #define ENDPOINT_TYPE 8 | ||
391 | #define ENDPOINT_DIRECTION 7 | ||
392 | #define ENDPOINT_NUMBER 0 | ||
393 | u32 ep_rsp; | ||
394 | #define SET_NAK_OUT_PACKETS 15 | ||
395 | #define SET_EP_HIDE_STATUS_PHASE 14 | ||
396 | #define SET_EP_FORCE_CRC_ERROR 13 | ||
397 | #define SET_INTERRUPT_MODE 12 | ||
398 | #define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11 | ||
399 | #define SET_NAK_OUT_PACKETS_MODE 10 | ||
400 | #define SET_ENDPOINT_TOGGLE 9 | ||
401 | #define SET_ENDPOINT_HALT 8 | ||
402 | #define CLEAR_NAK_OUT_PACKETS 7 | ||
403 | #define CLEAR_EP_HIDE_STATUS_PHASE 6 | ||
404 | #define CLEAR_EP_FORCE_CRC_ERROR 5 | ||
405 | #define CLEAR_INTERRUPT_MODE 4 | ||
406 | #define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3 | ||
407 | #define CLEAR_NAK_OUT_PACKETS_MODE 2 | ||
408 | #define CLEAR_ENDPOINT_TOGGLE 1 | ||
409 | #define CLEAR_ENDPOINT_HALT 0 | ||
410 | u32 ep_irqenb; | ||
411 | #define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6 | ||
412 | #define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5 | ||
413 | #define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3 | ||
414 | #define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2 | ||
415 | #define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1 | ||
416 | #define DATA_IN_TOKEN_INTERRUPT_ENABLE 0 | ||
417 | u32 ep_stat; | ||
418 | #define FIFO_VALID_COUNT 24 | ||
419 | #define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22 | ||
420 | #define TIMEOUT 21 | ||
421 | #define USB_STALL_SENT 20 | ||
422 | #define USB_IN_NAK_SENT 19 | ||
423 | #define USB_IN_ACK_RCVD 18 | ||
424 | #define USB_OUT_PING_NAK_SENT 17 | ||
425 | #define USB_OUT_ACK_SENT 16 | ||
426 | #define FIFO_OVERFLOW 13 | ||
427 | #define FIFO_UNDERFLOW 12 | ||
428 | #define FIFO_FULL 11 | ||
429 | #define FIFO_EMPTY 10 | ||
430 | #define FIFO_FLUSH 9 | ||
431 | #define SHORT_PACKET_OUT_DONE_INTERRUPT 6 | ||
432 | #define SHORT_PACKET_TRANSFERRED_INTERRUPT 5 | ||
433 | #define NAK_OUT_PACKETS 4 | ||
434 | #define DATA_PACKET_RECEIVED_INTERRUPT 3 | ||
435 | #define DATA_PACKET_TRANSMITTED_INTERRUPT 2 | ||
436 | #define DATA_OUT_PING_TOKEN_INTERRUPT 1 | ||
437 | #define DATA_IN_TOKEN_INTERRUPT 0 | ||
438 | // offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 | ||
439 | u32 ep_avail; | ||
440 | u32 ep_data; | ||
441 | u32 _unused0 [2]; | ||
442 | } __attribute__ ((packed)); | ||
443 | |||
444 | #endif /* __LINUX_USB_NET2280_H */ | ||
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h deleted file mode 100644 index dae9860091dd..000000000000 --- a/include/linux/wanpipe.h +++ /dev/null | |||
@@ -1,483 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * wanpipe.h WANPIPE(tm) Multiprotocol WAN Link Driver. | ||
3 | * User-level API definitions. | ||
4 | * | ||
5 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
6 | * Gideon Hack | ||
7 | * | ||
8 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | * ============================================================================ | ||
15 | * Nov 3, 2000 Nenad Corbic Added config_id to sdla_t structure. | ||
16 | * Used to determine the protocol running. | ||
17 | * Jul 13, 2000 Nenad Corbic Added SyncPPP Support | ||
18 | * Feb 24, 2000 Nenad Corbic Added support for x25api driver | ||
19 | * Oct 04, 1999 Nenad Corbic New CHDLC and FRAME RELAY code, SMP support | ||
20 | * Jun 02, 1999 Gideon Hack Added 'update_call_count' for Cisco HDLC | ||
21 | * support | ||
22 | * Jun 26, 1998 David Fong Added 'ip_mode' in sdla_t.u.p for dynamic IP | ||
23 | * routing mode configuration | ||
24 | * Jun 12, 1998 David Fong Added Cisco HDLC union member in sdla_t | ||
25 | * Dec 08, 1997 Jaspreet Singh Added 'authenticator' in union of 'sdla_t' | ||
26 | * Nov 26, 1997 Jaspreet Singh Added 'load_sharing' structure. Also added | ||
27 | * 'devs_struct','dev_to_devtint_next' to 'sdla_t' | ||
28 | * Nov 24, 1997 Jaspreet Singh Added 'irq_dis_if_send_count', | ||
29 | * 'irq_dis_poll_count' to 'sdla_t'. | ||
30 | * Nov 06, 1997 Jaspreet Singh Added a define called 'INTR_TEST_MODE' | ||
31 | * Oct 20, 1997 Jaspreet Singh Added 'buff_intr_mode_unbusy' and | ||
32 | * 'dlci_intr_mode_unbusy' to 'sdla_t' | ||
33 | * Oct 18, 1997 Jaspreet Singh Added structure to maintain global driver | ||
34 | * statistics. | ||
35 | * Jan 15, 1997 Gene Kozin Version 3.1.0 | ||
36 | * o added UDP management stuff | ||
37 | * Jan 02, 1997 Gene Kozin Version 3.0.0 | ||
38 | *****************************************************************************/ | ||
39 | #ifndef _WANPIPE_H | ||
40 | #define _WANPIPE_H | ||
41 | |||
42 | #include <linux/wanrouter.h> | ||
43 | |||
44 | /* Defines */ | ||
45 | |||
46 | #ifndef PACKED | ||
47 | #define PACKED __attribute__((packed)) | ||
48 | #endif | ||
49 | |||
50 | #define WANPIPE_MAGIC 0x414C4453L /* signature: 'SDLA' reversed */ | ||
51 | |||
52 | /* IOCTL numbers (up to 16) */ | ||
53 | #define WANPIPE_DUMP (ROUTER_USER+0) /* dump adapter's memory */ | ||
54 | #define WANPIPE_EXEC (ROUTER_USER+1) /* execute firmware command */ | ||
55 | |||
56 | #define TRACE_ALL 0x00 | ||
57 | #define TRACE_PROT 0x01 | ||
58 | #define TRACE_DATA 0x02 | ||
59 | |||
60 | /* values for request/reply byte */ | ||
61 | #define UDPMGMT_REQUEST 0x01 | ||
62 | #define UDPMGMT_REPLY 0x02 | ||
63 | #define UDP_OFFSET 12 | ||
64 | |||
65 | #define MAX_CMD_BUFF 10 | ||
66 | #define MAX_X25_LCN 255 /* Maximum number of x25 channels */ | ||
67 | #define MAX_LCN_NUM 4095 /* Maximum lcn number */ | ||
68 | #define MAX_FT1_RETRY 100 | ||
69 | |||
70 | #ifndef AF_WANPIPE | ||
71 | #define AF_WANPIPE 25 | ||
72 | #ifndef PF_WANPIPE | ||
73 | #define PF_WANPIPE AF_WANPIPE | ||
74 | #endif | ||
75 | #endif | ||
76 | |||
77 | |||
78 | #define TX_TIMEOUT 5*HZ | ||
79 | |||
80 | /* General Critical Flags */ | ||
81 | #define SEND_CRIT 0x00 | ||
82 | #define PERI_CRIT 0x01 | ||
83 | |||
84 | /* Chdlc and PPP polling critical flag */ | ||
85 | #define POLL_CRIT 0x03 | ||
86 | |||
87 | /* Frame Relay Tx IRQ send critical flag */ | ||
88 | #define SEND_TXIRQ_CRIT 0x02 | ||
89 | |||
90 | /* Frame Relay ARP critical flag */ | ||
91 | #define ARP_CRIT 0x03 | ||
92 | |||
93 | /* Bit maps for dynamic interface configuration | ||
94 | * DYN_OPT_ON : turns this option on/off | ||
95 | * DEV_DOWN : device was shutdown by the driver not | ||
96 | * by user | ||
97 | */ | ||
98 | #define DYN_OPT_ON 0x00 | ||
99 | #define DEV_DOWN 0x01 | ||
100 | |||
101 | /* | ||
102 | * Data structures for IOCTL calls. | ||
103 | */ | ||
104 | |||
105 | typedef struct sdla_dump /* WANPIPE_DUMP */ | ||
106 | { | ||
107 | unsigned long magic; /* for verification */ | ||
108 | unsigned long offset; /* absolute adapter memory address */ | ||
109 | unsigned long length; /* block length */ | ||
110 | void* ptr; /* -> buffer */ | ||
111 | } sdla_dump_t; | ||
112 | |||
113 | typedef struct sdla_exec /* WANPIPE_EXEC */ | ||
114 | { | ||
115 | unsigned long magic; /* for verification */ | ||
116 | void* cmd; /* -> command structure */ | ||
117 | void* data; /* -> data buffer */ | ||
118 | } sdla_exec_t; | ||
119 | |||
120 | /* UDP management stuff */ | ||
121 | |||
122 | typedef struct wum_header | ||
123 | { | ||
124 | unsigned char signature[8]; /* 00h: signature */ | ||
125 | unsigned char type; /* 08h: request/reply */ | ||
126 | unsigned char command; /* 09h: commnand */ | ||
127 | unsigned char reserved[6]; /* 0Ah: reserved */ | ||
128 | } wum_header_t; | ||
129 | |||
130 | /************************************************************************* | ||
131 | Data Structure for global statistics | ||
132 | *************************************************************************/ | ||
133 | |||
134 | typedef struct global_stats | ||
135 | { | ||
136 | unsigned long isr_entry; | ||
137 | unsigned long isr_already_critical; | ||
138 | unsigned long isr_rx; | ||
139 | unsigned long isr_tx; | ||
140 | unsigned long isr_intr_test; | ||
141 | unsigned long isr_spurious; | ||
142 | unsigned long isr_enable_tx_int; | ||
143 | unsigned long rx_intr_corrupt_rx_bfr; | ||
144 | unsigned long rx_intr_on_orphaned_DLCI; | ||
145 | unsigned long rx_intr_dev_not_started; | ||
146 | unsigned long tx_intr_dev_not_started; | ||
147 | unsigned long poll_entry; | ||
148 | unsigned long poll_already_critical; | ||
149 | unsigned long poll_processed; | ||
150 | unsigned long poll_tbusy_bad_status; | ||
151 | unsigned long poll_host_disable_irq; | ||
152 | unsigned long poll_host_enable_irq; | ||
153 | |||
154 | } global_stats_t; | ||
155 | |||
156 | |||
157 | typedef struct{ | ||
158 | unsigned short udp_src_port PACKED; | ||
159 | unsigned short udp_dst_port PACKED; | ||
160 | unsigned short udp_length PACKED; | ||
161 | unsigned short udp_checksum PACKED; | ||
162 | } udp_pkt_t; | ||
163 | |||
164 | |||
165 | typedef struct { | ||
166 | unsigned char ver_inet_hdr_length PACKED; | ||
167 | unsigned char service_type PACKED; | ||
168 | unsigned short total_length PACKED; | ||
169 | unsigned short identifier PACKED; | ||
170 | unsigned short flags_frag_offset PACKED; | ||
171 | unsigned char ttl PACKED; | ||
172 | unsigned char protocol PACKED; | ||
173 | unsigned short hdr_checksum PACKED; | ||
174 | unsigned long ip_src_address PACKED; | ||
175 | unsigned long ip_dst_address PACKED; | ||
176 | } ip_pkt_t; | ||
177 | |||
178 | |||
179 | typedef struct { | ||
180 | unsigned char signature[8] PACKED; | ||
181 | unsigned char request_reply PACKED; | ||
182 | unsigned char id PACKED; | ||
183 | unsigned char reserved[6] PACKED; | ||
184 | } wp_mgmt_t; | ||
185 | |||
186 | /************************************************************************* | ||
187 | Data Structure for if_send statistics | ||
188 | *************************************************************************/ | ||
189 | typedef struct if_send_stat{ | ||
190 | unsigned long if_send_entry; | ||
191 | unsigned long if_send_skb_null; | ||
192 | unsigned long if_send_broadcast; | ||
193 | unsigned long if_send_multicast; | ||
194 | unsigned long if_send_critical_ISR; | ||
195 | unsigned long if_send_critical_non_ISR; | ||
196 | unsigned long if_send_tbusy; | ||
197 | unsigned long if_send_tbusy_timeout; | ||
198 | unsigned long if_send_PIPE_request; | ||
199 | unsigned long if_send_wan_disconnected; | ||
200 | unsigned long if_send_dlci_disconnected; | ||
201 | unsigned long if_send_no_bfrs; | ||
202 | unsigned long if_send_adptr_bfrs_full; | ||
203 | unsigned long if_send_bfr_passed_to_adptr; | ||
204 | unsigned long if_send_protocol_error; | ||
205 | unsigned long if_send_bfr_not_passed_to_adptr; | ||
206 | unsigned long if_send_tx_int_enabled; | ||
207 | unsigned long if_send_consec_send_fail; | ||
208 | } if_send_stat_t; | ||
209 | |||
210 | typedef struct rx_intr_stat{ | ||
211 | unsigned long rx_intr_no_socket; | ||
212 | unsigned long rx_intr_dev_not_started; | ||
213 | unsigned long rx_intr_PIPE_request; | ||
214 | unsigned long rx_intr_bfr_not_passed_to_stack; | ||
215 | unsigned long rx_intr_bfr_passed_to_stack; | ||
216 | } rx_intr_stat_t; | ||
217 | |||
218 | typedef struct pipe_mgmt_stat{ | ||
219 | unsigned long UDP_PIPE_mgmt_kmalloc_err; | ||
220 | unsigned long UDP_PIPE_mgmt_direction_err; | ||
221 | unsigned long UDP_PIPE_mgmt_adptr_type_err; | ||
222 | unsigned long UDP_PIPE_mgmt_adptr_cmnd_OK; | ||
223 | unsigned long UDP_PIPE_mgmt_adptr_cmnd_timeout; | ||
224 | unsigned long UDP_PIPE_mgmt_adptr_send_passed; | ||
225 | unsigned long UDP_PIPE_mgmt_adptr_send_failed; | ||
226 | unsigned long UDP_PIPE_mgmt_not_passed_to_stack; | ||
227 | unsigned long UDP_PIPE_mgmt_passed_to_stack; | ||
228 | unsigned long UDP_PIPE_mgmt_no_socket; | ||
229 | unsigned long UDP_PIPE_mgmt_passed_to_adptr; | ||
230 | } pipe_mgmt_stat_t; | ||
231 | |||
232 | |||
233 | typedef struct { | ||
234 | struct sk_buff *skb; | ||
235 | } bh_data_t, cmd_data_t; | ||
236 | |||
237 | #define MAX_LGTH_UDP_MGNT_PKT 2000 | ||
238 | |||
239 | |||
240 | /* This is used for interrupt testing */ | ||
241 | #define INTR_TEST_MODE 0x02 | ||
242 | |||
243 | #define WUM_SIGNATURE_L 0x50495046 | ||
244 | #define WUM_SIGNATURE_H 0x444E3845 | ||
245 | |||
246 | #define WUM_KILL 0x50 | ||
247 | #define WUM_EXEC 0x51 | ||
248 | |||
249 | #define WANPIPE 0x00 | ||
250 | #define API 0x01 | ||
251 | #define BRIDGE 0x02 | ||
252 | #define BRIDGE_NODE 0x03 | ||
253 | |||
254 | #ifdef __KERNEL__ | ||
255 | /****** Kernel Interface ****************************************************/ | ||
256 | |||
257 | #include <linux/sdladrv.h> /* SDLA support module API definitions */ | ||
258 | #include <linux/sdlasfm.h> /* SDLA firmware module definitions */ | ||
259 | #include <linux/workqueue.h> | ||
260 | #include <linux/serial.h> | ||
261 | #include <linux/serialP.h> | ||
262 | #include <linux/serial_reg.h> | ||
263 | #include <asm/serial.h> | ||
264 | #include <linux/tty.h> | ||
265 | #include <linux/tty_driver.h> | ||
266 | #include <linux/tty_flip.h> | ||
267 | |||
268 | /****** Data Structures *****************************************************/ | ||
269 | |||
270 | /* Adapter Data Space. | ||
271 | * This structure is needed because we handle multiple cards, otherwise | ||
272 | * static data would do it. | ||
273 | */ | ||
274 | typedef struct sdla | ||
275 | { | ||
276 | char devname[WAN_DRVNAME_SZ+1]; /* card name */ | ||
277 | sdlahw_t hw; /* hardware configuration */ | ||
278 | struct wan_device wandev; /* WAN device data space */ | ||
279 | |||
280 | unsigned open_cnt; /* number of open interfaces */ | ||
281 | unsigned long state_tick; /* link state timestamp */ | ||
282 | unsigned intr_mode; /* Type of Interrupt Mode */ | ||
283 | char in_isr; /* interrupt-in-service flag */ | ||
284 | char buff_int_mode_unbusy; /* flag for carrying out dev_tint */ | ||
285 | char dlci_int_mode_unbusy; /* flag for carrying out dev_tint */ | ||
286 | long configured; /* flag for previous configurations */ | ||
287 | |||
288 | unsigned short irq_dis_if_send_count; /* Disabling irqs in if_send*/ | ||
289 | unsigned short irq_dis_poll_count; /* Disabling irqs in poll routine*/ | ||
290 | unsigned short force_enable_irq; | ||
291 | char TracingEnabled; /* flag for enabling trace */ | ||
292 | global_stats_t statistics; /* global statistics */ | ||
293 | void* mbox; /* -> mailbox */ | ||
294 | void* rxmb; /* -> receive mailbox */ | ||
295 | void* flags; /* -> adapter status flags */ | ||
296 | void (*isr)(struct sdla* card); /* interrupt service routine */ | ||
297 | void (*poll)(struct sdla* card); /* polling routine */ | ||
298 | int (*exec)(struct sdla* card, void* u_cmd, void* u_data); | ||
299 | /* Used by the listen() system call */ | ||
300 | /* Wanpipe Socket Interface */ | ||
301 | int (*func) (struct sk_buff *, struct sock *); | ||
302 | struct sock *sk; | ||
303 | |||
304 | /* Shutdown function */ | ||
305 | void (*disable_comm) (struct sdla *card); | ||
306 | |||
307 | /* Secondary Port Device: Piggibacking */ | ||
308 | struct sdla *next; | ||
309 | |||
310 | /* TTY driver variables */ | ||
311 | unsigned char tty_opt; | ||
312 | struct tty_struct *tty; | ||
313 | unsigned int tty_minor; | ||
314 | unsigned int tty_open; | ||
315 | unsigned char *tty_buf; | ||
316 | unsigned char *tty_rx; | ||
317 | struct work_struct tty_work; | ||
318 | |||
319 | union | ||
320 | { | ||
321 | struct | ||
322 | { /****** X.25 specific data **********/ | ||
323 | u32 lo_pvc; | ||
324 | u32 hi_pvc; | ||
325 | u32 lo_svc; | ||
326 | u32 hi_svc; | ||
327 | struct net_device *svc_to_dev_map[MAX_X25_LCN]; | ||
328 | struct net_device *pvc_to_dev_map[MAX_X25_LCN]; | ||
329 | struct net_device *tx_dev; | ||
330 | struct net_device *cmd_dev; | ||
331 | u32 no_dev; | ||
332 | volatile u8 *hdlc_buf_status; | ||
333 | u32 tx_interrupts_pending; | ||
334 | u16 timer_int_enabled; | ||
335 | struct net_device *poll_device; | ||
336 | atomic_t command_busy; | ||
337 | |||
338 | u16 udp_pkt_lgth; | ||
339 | u32 udp_type; | ||
340 | u8 udp_pkt_src; | ||
341 | u32 udp_lcn; | ||
342 | struct net_device *udp_dev; | ||
343 | s8 udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT]; | ||
344 | |||
345 | u8 LAPB_hdlc; /* Option to turn off X25 and run only LAPB */ | ||
346 | u8 logging; /* Option to log call messages */ | ||
347 | u8 oob_on_modem; /* Option to send modem status to the api */ | ||
348 | u16 num_of_ch; /* Number of channels configured by the user */ | ||
349 | |||
350 | struct work_struct x25_poll_work; | ||
351 | struct timer_list x25_timer; | ||
352 | } x; | ||
353 | struct | ||
354 | { /****** frame relay specific data ***/ | ||
355 | void* rxmb_base; /* -> first Rx buffer */ | ||
356 | void* rxmb_last; /* -> last Rx buffer */ | ||
357 | unsigned rx_base; /* S508 receive buffer base */ | ||
358 | unsigned rx_top; /* S508 receive buffer end */ | ||
359 | unsigned short node_dlci[100]; | ||
360 | unsigned short dlci_num; | ||
361 | struct net_device *dlci_to_dev_map[991 + 1]; | ||
362 | unsigned tx_interrupts_pending; | ||
363 | unsigned short timer_int_enabled; | ||
364 | unsigned short udp_pkt_lgth; | ||
365 | int udp_type; | ||
366 | char udp_pkt_src; | ||
367 | unsigned udp_dlci; | ||
368 | char udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT]; | ||
369 | void* trc_el_base; /* first trace element */ | ||
370 | void* trc_el_last; /* last trace element */ | ||
371 | void *curr_trc_el; /* current trace element */ | ||
372 | unsigned short trc_bfr_space; /* trace buffer space */ | ||
373 | unsigned char update_comms_stats; | ||
374 | struct net_device *arp_dev; | ||
375 | spinlock_t if_send_lock; | ||
376 | } f; | ||
377 | struct /****** PPP-specific data ***********/ | ||
378 | { | ||
379 | char if_name[WAN_IFNAME_SZ+1]; /* interface name */ | ||
380 | void* txbuf; /* -> current Tx buffer */ | ||
381 | void* txbuf_base; /* -> first Tx buffer */ | ||
382 | void* txbuf_last; /* -> last Tx buffer */ | ||
383 | void* rxbuf_base; /* -> first Rx buffer */ | ||
384 | void* rxbuf_last; /* -> last Rx buffer */ | ||
385 | unsigned rx_base; /* S508 receive buffer base */ | ||
386 | unsigned rx_top; /* S508 receive buffer end */ | ||
387 | char ip_mode; /* STATIC/HOST/PEER IP Mode */ | ||
388 | char authenticator; /* Authenticator for PAP/CHAP */ | ||
389 | unsigned char comm_enabled; /* Is comm enabled or not */ | ||
390 | unsigned char peer_route; /* Process Peer Route */ | ||
391 | unsigned long *txbuf_next; /* Next Tx buffer to use */ | ||
392 | unsigned long *rxbuf_next; /* Next Rx buffer to use */ | ||
393 | } p; | ||
394 | struct /* Cisco HDLC-specific data */ | ||
395 | { | ||
396 | char if_name[WAN_IFNAME_SZ+1]; /* interface name */ | ||
397 | unsigned char comm_port;/* Communication Port O or 1 */ | ||
398 | unsigned char usedby; /* Used by WANPIPE or API */ | ||
399 | void* rxmb; /* Receive mail box */ | ||
400 | void* flags; /* flags */ | ||
401 | void* tx_status; /* Tx status element */ | ||
402 | void* rx_status; /* Rx status element */ | ||
403 | void* txbuf; /* -> current Tx buffer */ | ||
404 | void* txbuf_base; /* -> first Tx buffer */ | ||
405 | void* txbuf_last; /* -> last Tx buffer */ | ||
406 | void* rxbuf_base; /* -> first Rx buffer */ | ||
407 | void* rxbuf_last; /* -> last Rx buffer */ | ||
408 | unsigned rx_base; /* S508 receive buffer base */ | ||
409 | unsigned rx_top; /* S508 receive buffer end */ | ||
410 | unsigned char receive_only; /* high speed receivers */ | ||
411 | unsigned short protocol_options; | ||
412 | unsigned short kpalv_tx; /* Tx kpalv timer */ | ||
413 | unsigned short kpalv_rx; /* Rx kpalv timer */ | ||
414 | unsigned short kpalv_err; /* Error tolerance */ | ||
415 | unsigned short slarp_timer; /* SLARP req timer */ | ||
416 | unsigned state; /* state of the link */ | ||
417 | unsigned char api_status; | ||
418 | unsigned char update_call_count; | ||
419 | unsigned short api_options; /* for async config */ | ||
420 | unsigned char async_mode; | ||
421 | unsigned short tx_bits_per_char; | ||
422 | unsigned short rx_bits_per_char; | ||
423 | unsigned short stop_bits; | ||
424 | unsigned short parity; | ||
425 | unsigned short break_timer; | ||
426 | unsigned short inter_char_timer; | ||
427 | unsigned short rx_complete_length; | ||
428 | unsigned short xon_char; | ||
429 | unsigned short xoff_char; | ||
430 | unsigned char comm_enabled; /* Is comm enabled or not */ | ||
431 | unsigned char backup; | ||
432 | } c; | ||
433 | struct | ||
434 | { | ||
435 | void* tx_status; /* Tx status element */ | ||
436 | void* rx_status; /* Rx status element */ | ||
437 | void* trace_status; /* Trace status element */ | ||
438 | void* txbuf; /* -> current Tx buffer */ | ||
439 | void* txbuf_base; /* -> first Tx buffer */ | ||
440 | void* txbuf_last; /* -> last Tx buffer */ | ||
441 | void* rxbuf_base; /* -> first Rx buffer */ | ||
442 | void* rxbuf_last; /* -> last Rx buffer */ | ||
443 | void* tracebuf; /* -> current Trace buffer */ | ||
444 | void* tracebuf_base; /* -> current Trace buffer */ | ||
445 | void* tracebuf_last; /* -> current Trace buffer */ | ||
446 | unsigned rx_base; /* receive buffer base */ | ||
447 | unsigned rx_end; /* receive buffer end */ | ||
448 | unsigned trace_base; /* trace buffer base */ | ||
449 | unsigned trace_end; /* trace buffer end */ | ||
450 | |||
451 | } h; | ||
452 | } u; | ||
453 | } sdla_t; | ||
454 | |||
455 | /****** Public Functions ****************************************************/ | ||
456 | |||
457 | void wanpipe_open (sdla_t* card); /* wpmain.c */ | ||
458 | void wanpipe_close (sdla_t* card); /* wpmain.c */ | ||
459 | void wanpipe_set_state (sdla_t* card, int state); /* wpmain.c */ | ||
460 | |||
461 | int wpx_init (sdla_t* card, wandev_conf_t* conf); /* wpx.c */ | ||
462 | int wpf_init (sdla_t* card, wandev_conf_t* conf); /* wpf.c */ | ||
463 | int wpp_init (sdla_t* card, wandev_conf_t* conf); /* wpp.c */ | ||
464 | int wpc_init (sdla_t* card, wandev_conf_t* conf); /* Cisco HDLC */ | ||
465 | int bsc_init (sdla_t* card, wandev_conf_t* conf); /* BSC streaming */ | ||
466 | int hdlc_init(sdla_t* card, wandev_conf_t* conf); /* HDLC support */ | ||
467 | int wpft1_init (sdla_t* card, wandev_conf_t* conf); /* FT1 Config support */ | ||
468 | int wsppp_init (sdla_t* card, wandev_conf_t* conf); /* Sync PPP on top of RAW CHDLC */ | ||
469 | |||
470 | extern sdla_t * wanpipe_find_card(char *); | ||
471 | extern sdla_t * wanpipe_find_card_num (int); | ||
472 | |||
473 | extern void wanpipe_queue_work (struct work_struct *); | ||
474 | extern void wanpipe_mark_bh (void); | ||
475 | extern void wakeup_sk_bh(struct net_device *dev); | ||
476 | extern int change_dev_flags(struct net_device *dev, unsigned flags); | ||
477 | extern unsigned long get_ip_address(struct net_device *dev, int option); | ||
478 | extern void add_gateway(sdla_t *card, struct net_device *dev); | ||
479 | |||
480 | |||
481 | #endif /* __KERNEL__ */ | ||
482 | #endif /* _WANPIPE_H */ | ||
483 | |||
diff --git a/include/net/arp.h b/include/net/arp.h index a13e30c35f42..643bded9f557 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
@@ -10,8 +10,6 @@ | |||
10 | extern struct neigh_table arp_tbl; | 10 | extern struct neigh_table arp_tbl; |
11 | 11 | ||
12 | extern void arp_init(void); | 12 | extern void arp_init(void); |
13 | extern int arp_rcv(struct sk_buff *skb, struct net_device *dev, | ||
14 | struct packet_type *pt, struct net_device *orig_dev); | ||
15 | extern int arp_find(unsigned char *haddr, struct sk_buff *skb); | 13 | extern int arp_find(unsigned char *haddr, struct sk_buff *skb); |
16 | extern int arp_ioctl(unsigned int cmd, void __user *arg); | 14 | extern int arp_ioctl(unsigned int cmd, void __user *arg); |
17 | extern void arp_send(int type, int ptype, u32 dest_ip, | 15 | extern void arp_send(int type, int ptype, u32 dest_ip, |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 0d5529c382e8..afa508d92c93 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -143,6 +143,11 @@ struct xfrm_state | |||
143 | /* Replay detection state at the time we sent the last notification */ | 143 | /* Replay detection state at the time we sent the last notification */ |
144 | struct xfrm_replay_state preplay; | 144 | struct xfrm_replay_state preplay; |
145 | 145 | ||
146 | /* internal flag that only holds state for delayed aevent at the | ||
147 | * moment | ||
148 | */ | ||
149 | u32 xflags; | ||
150 | |||
146 | /* Replay detection notification settings */ | 151 | /* Replay detection notification settings */ |
147 | u32 replay_maxage; | 152 | u32 replay_maxage; |
148 | u32 replay_maxdiff; | 153 | u32 replay_maxdiff; |
@@ -168,6 +173,9 @@ struct xfrm_state | |||
168 | void *data; | 173 | void *data; |
169 | }; | 174 | }; |
170 | 175 | ||
176 | /* xflags - make enum if more show up */ | ||
177 | #define XFRM_TIME_DEFER 1 | ||
178 | |||
171 | enum { | 179 | enum { |
172 | XFRM_STATE_VOID, | 180 | XFRM_STATE_VOID, |
173 | XFRM_STATE_ACQ, | 181 | XFRM_STATE_ACQ, |
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index f404fe21cc21..ad63c215efe5 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h | |||
@@ -91,34 +91,6 @@ enum ib_sa_selector { | |||
91 | IB_SA_BEST = 3 | 91 | IB_SA_BEST = 3 |
92 | }; | 92 | }; |
93 | 93 | ||
94 | enum ib_sa_rate { | ||
95 | IB_SA_RATE_2_5_GBPS = 2, | ||
96 | IB_SA_RATE_5_GBPS = 5, | ||
97 | IB_SA_RATE_10_GBPS = 3, | ||
98 | IB_SA_RATE_20_GBPS = 6, | ||
99 | IB_SA_RATE_30_GBPS = 4, | ||
100 | IB_SA_RATE_40_GBPS = 7, | ||
101 | IB_SA_RATE_60_GBPS = 8, | ||
102 | IB_SA_RATE_80_GBPS = 9, | ||
103 | IB_SA_RATE_120_GBPS = 10 | ||
104 | }; | ||
105 | |||
106 | static inline int ib_sa_rate_enum_to_int(enum ib_sa_rate rate) | ||
107 | { | ||
108 | switch (rate) { | ||
109 | case IB_SA_RATE_2_5_GBPS: return 1; | ||
110 | case IB_SA_RATE_5_GBPS: return 2; | ||
111 | case IB_SA_RATE_10_GBPS: return 4; | ||
112 | case IB_SA_RATE_20_GBPS: return 8; | ||
113 | case IB_SA_RATE_30_GBPS: return 12; | ||
114 | case IB_SA_RATE_40_GBPS: return 16; | ||
115 | case IB_SA_RATE_60_GBPS: return 24; | ||
116 | case IB_SA_RATE_80_GBPS: return 32; | ||
117 | case IB_SA_RATE_120_GBPS: return 48; | ||
118 | default: return -1; | ||
119 | } | ||
120 | } | ||
121 | |||
122 | /* | 94 | /* |
123 | * Structures for SA records are named "struct ib_sa_xxx_rec." No | 95 | * Structures for SA records are named "struct ib_sa_xxx_rec." No |
124 | * attempt is made to pack structures to match the physical layout of | 96 | * attempt is made to pack structures to match the physical layout of |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index c1ad6273ac6c..6bbf1b364400 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -314,6 +314,34 @@ enum ib_ah_flags { | |||
314 | IB_AH_GRH = 1 | 314 | IB_AH_GRH = 1 |
315 | }; | 315 | }; |
316 | 316 | ||
317 | enum ib_rate { | ||
318 | IB_RATE_PORT_CURRENT = 0, | ||
319 | IB_RATE_2_5_GBPS = 2, | ||
320 | IB_RATE_5_GBPS = 5, | ||
321 | IB_RATE_10_GBPS = 3, | ||
322 | IB_RATE_20_GBPS = 6, | ||
323 | IB_RATE_30_GBPS = 4, | ||
324 | IB_RATE_40_GBPS = 7, | ||
325 | IB_RATE_60_GBPS = 8, | ||
326 | IB_RATE_80_GBPS = 9, | ||
327 | IB_RATE_120_GBPS = 10 | ||
328 | }; | ||
329 | |||
330 | /** | ||
331 | * ib_rate_to_mult - Convert the IB rate enum to a multiple of the | ||
332 | * base rate of 2.5 Gbit/sec. For example, IB_RATE_5_GBPS will be | ||
333 | * converted to 2, since 5 Gbit/sec is 2 * 2.5 Gbit/sec. | ||
334 | * @rate: rate to convert. | ||
335 | */ | ||
336 | int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; | ||
337 | |||
338 | /** | ||
339 | * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate | ||
340 | * enum. | ||
341 | * @mult: multiple to convert. | ||
342 | */ | ||
343 | enum ib_rate mult_to_ib_rate(int mult) __attribute_const__; | ||
344 | |||
317 | struct ib_ah_attr { | 345 | struct ib_ah_attr { |
318 | struct ib_global_route grh; | 346 | struct ib_global_route grh; |
319 | u16 dlid; | 347 | u16 dlid; |
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h index 174101b2069b..d31b16d25a09 100644 --- a/include/scsi/scsi_devinfo.h +++ b/include/scsi/scsi_devinfo.h | |||
@@ -28,4 +28,5 @@ | |||
28 | #define BLIST_NO_ULD_ATTACH 0x100000 /* device is actually for RAID config */ | 28 | #define BLIST_NO_ULD_ATTACH 0x100000 /* device is actually for RAID config */ |
29 | #define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */ | 29 | #define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */ |
30 | #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ | 30 | #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ |
31 | #define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ | ||
31 | #endif | 32 | #endif |
diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h index d4be4d92d586..edb9525386da 100644 --- a/include/scsi/scsi_ioctl.h +++ b/include/scsi/scsi_ioctl.h | |||
@@ -41,8 +41,6 @@ typedef struct scsi_fctargaddress { | |||
41 | } Scsi_FCTargAddress; | 41 | } Scsi_FCTargAddress; |
42 | 42 | ||
43 | extern int scsi_ioctl(struct scsi_device *, int, void __user *); | 43 | extern int scsi_ioctl(struct scsi_device *, int, void __user *); |
44 | extern int scsi_ioctl_send_command(struct scsi_device *, | ||
45 | struct scsi_ioctl_command __user *); | ||
46 | extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, | 44 | extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, |
47 | void __user *arg, struct file *filp); | 45 | void __user *arg, struct file *filp); |
48 | 46 | ||
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index cf3fec8be1e3..5626225bd3ae 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -202,12 +202,19 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
202 | /* internal data */ | 202 | /* internal data */ |
203 | unsigned int channel; | 203 | unsigned int channel; |
204 | u32 number; | 204 | u32 number; |
205 | u8 flags; | ||
205 | struct list_head peers; | 206 | struct list_head peers; |
206 | struct device dev; | 207 | struct device dev; |
207 | struct work_struct dev_loss_work; | 208 | struct work_struct dev_loss_work; |
208 | struct work_struct scan_work; | 209 | struct work_struct scan_work; |
210 | struct work_struct stgt_delete_work; | ||
211 | struct work_struct rport_delete_work; | ||
209 | } __attribute__((aligned(sizeof(unsigned long)))); | 212 | } __attribute__((aligned(sizeof(unsigned long)))); |
210 | 213 | ||
214 | /* bit field values for struct fc_rport "flags" field: */ | ||
215 | #define FC_RPORT_DEVLOSS_PENDING 0x01 | ||
216 | #define FC_RPORT_SCAN_PENDING 0x02 | ||
217 | |||
211 | #define dev_to_rport(d) \ | 218 | #define dev_to_rport(d) \ |
212 | container_of(d, struct fc_rport, dev) | 219 | container_of(d, struct fc_rport, dev) |
213 | #define transport_class_to_rport(classdev) \ | 220 | #define transport_class_to_rport(classdev) \ |
@@ -327,13 +334,16 @@ struct fc_host_attrs { | |||
327 | struct list_head rport_bindings; | 334 | struct list_head rport_bindings; |
328 | u32 next_rport_number; | 335 | u32 next_rport_number; |
329 | u32 next_target_id; | 336 | u32 next_target_id; |
330 | u8 flags; | ||
331 | struct work_struct rport_del_work; | ||
332 | }; | ||
333 | 337 | ||
334 | /* values for struct fc_host_attrs "flags" field: */ | 338 | /* work queues for rport state manipulation */ |
335 | #define FC_SHOST_RPORT_DEL_SCHEDULED 0x01 | 339 | char work_q_name[KOBJ_NAME_LEN]; |
340 | struct workqueue_struct *work_q; | ||
341 | char devloss_work_q_name[KOBJ_NAME_LEN]; | ||
342 | struct workqueue_struct *devloss_work_q; | ||
343 | }; | ||
336 | 344 | ||
345 | #define shost_to_fc_host(x) \ | ||
346 | ((struct fc_host_attrs *)(x)->shost_data) | ||
337 | 347 | ||
338 | #define fc_host_node_name(x) \ | 348 | #define fc_host_node_name(x) \ |
339 | (((struct fc_host_attrs *)(x)->shost_data)->node_name) | 349 | (((struct fc_host_attrs *)(x)->shost_data)->node_name) |
@@ -375,10 +385,14 @@ struct fc_host_attrs { | |||
375 | (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) | 385 | (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) |
376 | #define fc_host_next_target_id(x) \ | 386 | #define fc_host_next_target_id(x) \ |
377 | (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) | 387 | (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) |
378 | #define fc_host_flags(x) \ | 388 | #define fc_host_work_q_name(x) \ |
379 | (((struct fc_host_attrs *)(x)->shost_data)->flags) | 389 | (((struct fc_host_attrs *)(x)->shost_data)->work_q_name) |
380 | #define fc_host_rport_del_work(x) \ | 390 | #define fc_host_work_q(x) \ |
381 | (((struct fc_host_attrs *)(x)->shost_data)->rport_del_work) | 391 | (((struct fc_host_attrs *)(x)->shost_data)->work_q) |
392 | #define fc_host_devloss_work_q_name(x) \ | ||
393 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name) | ||
394 | #define fc_host_devloss_work_q(x) \ | ||
395 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q) | ||
382 | 396 | ||
383 | 397 | ||
384 | /* The functions by which the transport class and the driver communicate */ | 398 | /* The functions by which the transport class and the driver communicate */ |
@@ -461,10 +475,15 @@ fc_remote_port_chkready(struct fc_rport *rport) | |||
461 | 475 | ||
462 | switch (rport->port_state) { | 476 | switch (rport->port_state) { |
463 | case FC_PORTSTATE_ONLINE: | 477 | case FC_PORTSTATE_ONLINE: |
464 | result = 0; | 478 | if (rport->roles & FC_RPORT_ROLE_FCP_TARGET) |
479 | result = 0; | ||
480 | else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) | ||
481 | result = DID_IMM_RETRY << 16; | ||
482 | else | ||
483 | result = DID_NO_CONNECT << 16; | ||
465 | break; | 484 | break; |
466 | case FC_PORTSTATE_BLOCKED: | 485 | case FC_PORTSTATE_BLOCKED: |
467 | result = DID_BUS_BUSY << 16; | 486 | result = DID_IMM_RETRY << 16; |
468 | break; | 487 | break; |
469 | default: | 488 | default: |
470 | result = DID_NO_CONNECT << 16; | 489 | result = DID_NO_CONNECT << 16; |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 66b1f08b42b9..df70e7592ab5 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -367,7 +367,7 @@ struct snd_pcm_substream { | |||
367 | struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ | 367 | struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ |
368 | struct snd_pcm_group *group; /* pointer to current group */ | 368 | struct snd_pcm_group *group; /* pointer to current group */ |
369 | /* -- assigned files -- */ | 369 | /* -- assigned files -- */ |
370 | struct snd_pcm_file *file; | 370 | void *file; |
371 | struct file *ffile; | 371 | struct file *ffile; |
372 | void (*pcm_release)(struct snd_pcm_substream *); | 372 | void (*pcm_release)(struct snd_pcm_substream *); |
373 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 373 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
@@ -898,7 +898,6 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); | |||
898 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); | 898 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); |
899 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); | 899 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); |
900 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); | 900 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); |
901 | const char *snd_pcm_format_name(snd_pcm_format_t format); | ||
902 | 901 | ||
903 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); | 902 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); |
904 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); | 903 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); |