summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/xproto.h
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-01-11 15:22:46 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-01-11 15:22:46 +0000
commitdc228a61f57f12f036ae8b993aa3dc286493de67 (patch)
tree23c098b100a3b7b2a1630fc08e5790ae97060f00 /drivers/dahdi/xpp/xproto.h
parentf968cd418bf89bd1c5e97bb2655b76c74f45541c (diff)
xpp: style - Run Lindent
* Here it is: KERNEL_STYLE="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" TYPEDEFS=' -T gfp_t -T __user -T u_char -T __u8 -T byte -T bool -T charp -T xusb_t -T xbus_t -T xpd_t -T xproto_table_t -T xproto_entry_t -T xframe_t -T xpacket_t -T reg_cmd_t ' indent $TYPEDEFS $KERNEL_STYLE \ --ignore-newlines \ --indent-label0 \ --no-space-after-function-call-names \ "$@" Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10428 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/xproto.h')
-rw-r--r--drivers/dahdi/xpp/xproto.h148
1 files changed, 74 insertions, 74 deletions
diff --git a/drivers/dahdi/xpp/xproto.h b/drivers/dahdi/xpp/xproto.h
index 9bc38b0..b67bbfd 100644
--- a/drivers/dahdi/xpp/xproto.h
+++ b/drivers/dahdi/xpp/xproto.h
@@ -35,10 +35,10 @@
#define XPP_PROTOCOL_VERSION 30
struct xpd_addr {
- uint8_t subunit:SUBUNIT_BITS;
- uint8_t reserved:1;
- uint8_t unit:UNIT_BITS;
- uint8_t sync_master:1;
+ uint8_t subunit:SUBUNIT_BITS;
+ uint8_t reserved:1;
+ uint8_t unit:UNIT_BITS;
+ uint8_t sync_master:1;
} PACKED;
#define MKADDR(p, u, s) do { \
@@ -48,12 +48,12 @@ struct xpd_addr {
} while (0)
struct xpacket_header {
- uint16_t packet_len:10;
- uint16_t reserved:1;
- uint16_t is_pcm:1;
- uint16_t pcmslot:4;
- uint8_t opcode;
- struct xpd_addr addr;
+ uint16_t packet_len:10;
+ uint16_t reserved:1;
+ uint16_t is_pcm:1;
+ uint16_t pcmslot:4;
+ uint8_t opcode;
+ struct xpd_addr addr;
} PACKED;
#define XPACKET_OP(p) ((p)->head.opcode)
@@ -81,7 +81,7 @@ struct xpacket_header {
#define XPD_TYPE_ECHO 5 // Octasic echo canceller
#define XPD_TYPE_NOMODULE 7
-typedef byte xpd_type_t;
+typedef byte xpd_type_t;
#define XPD_TYPE_PREFIX "xpd-type-"
@@ -167,25 +167,25 @@ bool valid_xpd_addr(const struct xpd_addr *addr);
#define MULTIBYTE_MAX_LEN 5 /* FPGA firmware limitation */
typedef struct reg_cmd {
- byte bytes:3; /* Length (for Multibyte) */
- __u8 eoframe:1; /* For BRI -- end of frame */
- __u8 portnum:3; /* For port specific registers */
- __u8 is_multibyte:1;
+ byte bytes:3; /* Length (for Multibyte) */
+ __u8 eoframe:1; /* For BRI -- end of frame */
+ __u8 portnum:3; /* For port specific registers */
+ __u8 is_multibyte:1;
union {
struct {
- __u8 reserved:4;
- __u8 do_datah:1;
- __u8 do_subreg:1;
- __u8 read_request:1;
- __u8 all_ports_broadcast:1;
- __u8 regnum;
- __u8 subreg;
- __u8 data_low;
- __u8 data_high;
+ __u8 reserved:4;
+ __u8 do_datah:1;
+ __u8 do_subreg:1;
+ __u8 read_request:1;
+ __u8 all_ports_broadcast:1;
+ __u8 regnum;
+ __u8 subreg;
+ __u8 data_low;
+ __u8 data_high;
} PACKED r;
/* For Write-Multibyte commands in BRI */
struct {
- __u8 xdata[MULTIBYTE_MAX_LEN];
+ __u8 xdata[MULTIBYTE_MAX_LEN];
} PACKED d;
} PACKED alt;
} PACKED reg_cmd_t;
@@ -197,18 +197,16 @@ typedef struct reg_cmd {
#ifdef __KERNEL__
/*--------------------------- protocol tables ----------------------------------*/
-typedef struct xproto_entry xproto_entry_t;
-typedef struct xproto_table xproto_table_t;
+typedef struct xproto_entry xproto_entry_t;
+typedef struct xproto_table xproto_table_t;
-typedef int (*xproto_handler_t)(
- xbus_t *xbus,
- xpd_t *xpd,
- const xproto_entry_t *cmd,
- xpacket_t *pack);
+typedef int (*xproto_handler_t) (xbus_t *xbus, xpd_t *xpd,
+ const xproto_entry_t *cmd, xpacket_t *pack);
const xproto_table_t *xproto_get(xpd_type_t cardtype);
void xproto_put(const xproto_table_t *xtable);
-const xproto_entry_t *xproto_card_entry(const xproto_table_t *table, __u8 opcode);
+const xproto_entry_t *xproto_card_entry(const xproto_table_t *table,
+ __u8 opcode);
xproto_handler_t xproto_card_handler(const xproto_table_t *table, __u8 opcode);
const xproto_entry_t *xproto_global_entry(__u8 opcode);
@@ -231,49 +229,50 @@ xproto_handler_t xproto_global_handler(__u8 opcode);
(PHONE_METHOD(name, (xpd))((xpd), ## __VA_ARGS__ ))
struct phoneops {
- void (*card_pcm_recompute)(xpd_t *xpd, xpp_line_t pcm_mask);
- void (*card_pcm_fromspan)(xpd_t *xpd, xpacket_t *pack);
- void (*card_pcm_tospan)(xpd_t *xpd, xpacket_t *pack);
- int (*echocancel_timeslot)(xpd_t *xpd, int pos);
- int (*echocancel_setmask)(xpd_t *xpd, xpp_line_t ec_mask);
- int (*card_timing_priority)(xpd_t *xpd);
- int (*card_dahdi_preregistration)(xpd_t *xpd, bool on);
- int (*card_dahdi_postregistration)(xpd_t *xpd, bool on);
- int (*card_hooksig)(xpd_t *xpd, int pos, enum dahdi_txsig txsig);
- int (*card_ioctl)(xpd_t *xpd, int pos, unsigned int cmd, unsigned long arg);
- int (*card_open)(xpd_t *xpd, lineno_t pos);
- int (*card_close)(xpd_t *xpd, lineno_t pos);
- int (*card_state)(xpd_t *xpd, bool on);
+ void (*card_pcm_recompute) (xpd_t *xpd, xpp_line_t pcm_mask);
+ void (*card_pcm_fromspan) (xpd_t *xpd, xpacket_t *pack);
+ void (*card_pcm_tospan) (xpd_t *xpd, xpacket_t *pack);
+ int (*echocancel_timeslot) (xpd_t *xpd, int pos);
+ int (*echocancel_setmask) (xpd_t *xpd, xpp_line_t ec_mask);
+ int (*card_timing_priority) (xpd_t *xpd);
+ int (*card_dahdi_preregistration) (xpd_t *xpd, bool on);
+ int (*card_dahdi_postregistration) (xpd_t *xpd, bool on);
+ int (*card_hooksig) (xpd_t *xpd, int pos, enum dahdi_txsig txsig);
+ int (*card_ioctl) (xpd_t *xpd, int pos, unsigned int cmd,
+ unsigned long arg);
+ int (*card_open) (xpd_t *xpd, lineno_t pos);
+ int (*card_close) (xpd_t *xpd, lineno_t pos);
+ int (*card_state) (xpd_t *xpd, bool on);
};
struct xops {
- xpd_t *(*card_new)(xbus_t *xbus, int unit, int subunit,
- const xproto_table_t *proto_table, __u8 subtype,
- int subunits, int subunit_ports, bool to_phone);
- int (*card_init)(xbus_t *xbus, xpd_t *xpd);
- int (*card_remove)(xbus_t *xbus, xpd_t *xpd);
- int (*card_tick)(xbus_t *xbus, xpd_t *xpd);
- int (*card_register_reply)(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *reg);
+ xpd_t *(*card_new) (xbus_t *xbus, int unit, int subunit,
+ const xproto_table_t *proto_table, __u8 subtype,
+ int subunits, int subunit_ports, bool to_phone);
+ int (*card_init) (xbus_t *xbus, xpd_t *xpd);
+ int (*card_remove) (xbus_t *xbus, xpd_t *xpd);
+ int (*card_tick) (xbus_t *xbus, xpd_t *xpd);
+ int (*card_register_reply) (xbus_t *xbus, xpd_t *xpd, reg_cmd_t *reg);
};
struct xproto_entry {
- xproto_handler_t handler;
- int datalen;
- const char *name;
- xproto_table_t *table;
+ xproto_handler_t handler;
+ int datalen;
+ const char *name;
+ xproto_table_t *table;
};
struct xproto_table {
- struct module *owner;
- xproto_entry_t entries[256]; /* Indexed by opcode */
- const struct xops *xops; /* Card level operations */
- const struct phoneops *phoneops; /* DAHDI operations */
- const struct echoops *echoops; /* Echo Canceller operations */
- xpd_type_t type;
- __u8 ports_per_subunit;
- const char *name;
- bool (*packet_is_valid)(xpacket_t *pack);
- void (*packet_dump)(const char *msg, xpacket_t *pack);
+ struct module *owner;
+ xproto_entry_t entries[256]; /* Indexed by opcode */
+ const struct xops *xops; /* Card level operations */
+ const struct phoneops *phoneops; /* DAHDI operations */
+ const struct echoops *echoops; /* Echo Canceller operations */
+ xpd_type_t type;
+ __u8 ports_per_subunit;
+ const char *name;
+ bool (*packet_is_valid) (xpacket_t *pack);
+ void (*packet_dump) (const char *msg, xpacket_t *pack);
};
#include "card_global.h"
@@ -282,11 +281,10 @@ struct xproto_table {
#include "card_bri.h"
#include "card_pri.h"
-
#define MEMBER(card, op) RPACKET_TYPE(card, op) RPACKET_NAME(card, op)
struct xpacket {
- struct xpacket_header head;
+ struct xpacket_header head;
union {
MEMBER(GLOBAL, NULL_REPLY);
MEMBER(GLOBAL, PCM_WRITE);
@@ -297,20 +295,22 @@ struct xpacket {
MEMBER(FXS, SIG_CHANGED);
MEMBER(FXO, SIG_CHANGED);
- __u8 data[0];
+ __u8 data[0];
};
/* Last byte is chksum */
} PACKED;
void dump_packet(const char *msg, const xpacket_t *packet, bool debug);
-void dump_reg_cmd(const char msg[], bool writing, xbus_t *xbus, __u8 unit, xportno_t port, const reg_cmd_t *regcmd);
+void dump_reg_cmd(const char msg[], bool writing, xbus_t *xbus, __u8 unit,
+ xportno_t port, const reg_cmd_t *regcmd);
int xframe_receive(xbus_t *xbus, xframe_t *xframe);
-void notify_bad_xpd(const char *funcname, xbus_t *xbus, const struct xpd_addr addr, const char *msg);
+void notify_bad_xpd(const char *funcname, xbus_t *xbus,
+ const struct xpd_addr addr, const char *msg);
int xproto_register(const xproto_table_t *proto_table);
void xproto_unregister(const xproto_table_t *proto_table);
const xproto_entry_t *xproto_global_entry(__u8 opcode);
const char *xproto_name(xpd_type_t xpd_type);
-#endif /* __KERNEL__ */
+#endif /* __KERNEL__ */
-#endif /* XPROTO_H */
+#endif /* XPROTO_H */