xpp: style - manual whitespace/line-breaks cleanup
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@10435 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
parent
0244106553
commit
a28ffb3af5
@ -1611,12 +1611,18 @@ static const struct phoneops bri_phoneops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static xproto_table_t PROTO_TABLE(BRI) = {
|
static xproto_table_t PROTO_TABLE(BRI) = {
|
||||||
.owner = THIS_MODULE,.entries = {
|
.owner = THIS_MODULE,
|
||||||
|
.entries = {
|
||||||
/* Table Card Opcode */
|
/* Table Card Opcode */
|
||||||
},.name = "BRI", /* protocol name */
|
},
|
||||||
.ports_per_subunit = 1,.type = XPD_TYPE_BRI,.xops =
|
.name = "BRI", /* protocol name */
|
||||||
&bri_xops,.phoneops = &bri_phoneops,.packet_is_valid =
|
.ports_per_subunit = 1,
|
||||||
bri_packet_is_valid,.packet_dump = bri_packet_dump,};
|
.type = XPD_TYPE_BRI,
|
||||||
|
.xops = &bri_xops,
|
||||||
|
.phoneops = &bri_phoneops,
|
||||||
|
.packet_is_valid = bri_packet_is_valid,
|
||||||
|
.packet_dump = bri_packet_dump,
|
||||||
|
};
|
||||||
|
|
||||||
static bool bri_packet_is_valid(xpacket_t *pack)
|
static bool bri_packet_is_valid(xpacket_t *pack)
|
||||||
{
|
{
|
||||||
|
@ -272,12 +272,19 @@ static const struct echoops echoops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static xproto_table_t PROTO_TABLE(ECHO) = {
|
static xproto_table_t PROTO_TABLE(ECHO) = {
|
||||||
.owner = THIS_MODULE,.entries = {
|
.owner = THIS_MODULE,
|
||||||
|
.entries = {
|
||||||
/* Table Card Opcode */
|
/* Table Card Opcode */
|
||||||
XENTRY(ECHO, ECHO, SET_REPLY),},.name = "ECHO",.ports_per_subunit =
|
XENTRY( ECHO, ECHO, SET_REPLY ),
|
||||||
1,.type = XPD_TYPE_ECHO,.xops = &echo_xops,.echoops =
|
},
|
||||||
&echoops,.packet_is_valid =
|
.name = "ECHO",
|
||||||
echo_packet_is_valid,.packet_dump = echo_packet_dump,};
|
.ports_per_subunit = 1,
|
||||||
|
.type = XPD_TYPE_ECHO,
|
||||||
|
.xops = &echo_xops,
|
||||||
|
.echoops = &echoops,
|
||||||
|
.packet_is_valid = echo_packet_is_valid,
|
||||||
|
.packet_dump = echo_packet_dump,
|
||||||
|
};
|
||||||
|
|
||||||
static bool echo_packet_is_valid(xpacket_t *pack)
|
static bool echo_packet_is_valid(xpacket_t *pack)
|
||||||
{
|
{
|
||||||
|
@ -1219,12 +1219,19 @@ static const struct phoneops fxo_phoneops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static xproto_table_t PROTO_TABLE(FXO) = {
|
static xproto_table_t PROTO_TABLE(FXO) = {
|
||||||
.owner = THIS_MODULE,.entries = {
|
.owner = THIS_MODULE,
|
||||||
|
.entries = {
|
||||||
/* Prototable Card Opcode */
|
/* Prototable Card Opcode */
|
||||||
XENTRY(FXO, FXO, SIG_CHANGED),},.name = "FXO", /* protocol name */
|
XENTRY( FXO, FXO, SIG_CHANGED ),
|
||||||
.ports_per_subunit = 8,.type = XPD_TYPE_FXO,.xops =
|
},
|
||||||
&fxo_xops,.phoneops = &fxo_phoneops,.packet_is_valid =
|
.name = "FXO", /* protocol name */
|
||||||
fxo_packet_is_valid,.packet_dump = fxo_packet_dump,};
|
.ports_per_subunit = 8,
|
||||||
|
.type = XPD_TYPE_FXO,
|
||||||
|
.xops = &fxo_xops,
|
||||||
|
.phoneops = &fxo_phoneops,
|
||||||
|
.packet_is_valid = fxo_packet_is_valid,
|
||||||
|
.packet_dump = fxo_packet_dump,
|
||||||
|
};
|
||||||
|
|
||||||
static bool fxo_packet_is_valid(xpacket_t *pack)
|
static bool fxo_packet_is_valid(xpacket_t *pack)
|
||||||
{
|
{
|
||||||
|
@ -1641,12 +1641,19 @@ static const struct phoneops fxs_phoneops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static xproto_table_t PROTO_TABLE(FXS) = {
|
static xproto_table_t PROTO_TABLE(FXS) = {
|
||||||
.owner = THIS_MODULE,.entries = {
|
.owner = THIS_MODULE,
|
||||||
|
.entries = {
|
||||||
/* Prototable Card Opcode */
|
/* Prototable Card Opcode */
|
||||||
XENTRY(FXS, FXS, SIG_CHANGED),},.name = "FXS", /* protocol name */
|
XENTRY( FXS, FXS, SIG_CHANGED ),
|
||||||
.ports_per_subunit = 8,.type = XPD_TYPE_FXS,.xops =
|
},
|
||||||
&fxs_xops,.phoneops = &fxs_phoneops,.packet_is_valid =
|
.name = "FXS", /* protocol name */
|
||||||
fxs_packet_is_valid,.packet_dump = fxs_packet_dump,};
|
.ports_per_subunit = 8,
|
||||||
|
.type = XPD_TYPE_FXS,
|
||||||
|
.xops = &fxs_xops,
|
||||||
|
.phoneops = &fxs_phoneops,
|
||||||
|
.packet_is_valid = fxs_packet_is_valid,
|
||||||
|
.packet_dump = fxs_packet_dump,
|
||||||
|
};
|
||||||
|
|
||||||
static bool fxs_packet_is_valid(xpacket_t *pack)
|
static bool fxs_packet_is_valid(xpacket_t *pack)
|
||||||
{
|
{
|
||||||
|
@ -268,7 +268,7 @@ static int execute_chip_command(xpd_t *xpd, const int argc, char *argv[])
|
|||||||
writing, /* writing */
|
writing, /* writing */
|
||||||
regnum, do_subreg, /* use subreg */
|
regnum, do_subreg, /* use subreg */
|
||||||
subreg, /* subreg */
|
subreg, /* subreg */
|
||||||
data_low, do_datah, /* use data_high */
|
data_low, do_datah, /* use data_high */
|
||||||
data_high);
|
data_high);
|
||||||
#endif
|
#endif
|
||||||
ret = xpp_register_request(xpd->xbus, xpd, portno,
|
ret = xpp_register_request(xpd->xbus, xpd, portno,
|
||||||
@ -627,14 +627,17 @@ HANDLER_DEF(GLOBAL, ERROR_CODE)
|
|||||||
|
|
||||||
xproto_table_t PROTO_TABLE(GLOBAL) = {
|
xproto_table_t PROTO_TABLE(GLOBAL) = {
|
||||||
.entries = {
|
.entries = {
|
||||||
/* Prototable Card Opcode */
|
/* Prototable Card Opcode */
|
||||||
XENTRY(GLOBAL, GLOBAL, NULL_REPLY), XENTRY(GLOBAL, GLOBAL,
|
XENTRY( GLOBAL, GLOBAL, NULL_REPLY ),
|
||||||
AB_DESCRIPTION),
|
XENTRY( GLOBAL, GLOBAL, AB_DESCRIPTION ),
|
||||||
XENTRY(GLOBAL, GLOBAL, SYNC_REPLY),
|
XENTRY( GLOBAL, GLOBAL, SYNC_REPLY ),
|
||||||
XENTRY(GLOBAL, GLOBAL, ERROR_CODE),
|
XENTRY( GLOBAL, GLOBAL, ERROR_CODE ),
|
||||||
XENTRY(GLOBAL, GLOBAL, REGISTER_REPLY),},.name =
|
XENTRY( GLOBAL, GLOBAL, REGISTER_REPLY ),
|
||||||
"GLOBAL",.packet_is_valid =
|
},
|
||||||
global_packet_is_valid,.packet_dump = global_packet_dump,};
|
.name = "GLOBAL",
|
||||||
|
.packet_is_valid = global_packet_is_valid,
|
||||||
|
.packet_dump = global_packet_dump,
|
||||||
|
};
|
||||||
|
|
||||||
static bool global_packet_is_valid(xpacket_t *pack)
|
static bool global_packet_is_valid(xpacket_t *pack)
|
||||||
{
|
{
|
||||||
|
@ -2266,12 +2266,18 @@ static const struct phoneops pri_phoneops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static xproto_table_t PROTO_TABLE(PRI) = {
|
static xproto_table_t PROTO_TABLE(PRI) = {
|
||||||
.owner = THIS_MODULE,.entries = {
|
.owner = THIS_MODULE,
|
||||||
|
.entries = {
|
||||||
/* Table Card Opcode */
|
/* Table Card Opcode */
|
||||||
},.name = "PRI", /* protocol name */
|
},
|
||||||
.ports_per_subunit = 1,.type = XPD_TYPE_PRI,.xops =
|
.name = "PRI", /* protocol name */
|
||||||
&pri_xops,.phoneops = &pri_phoneops,.packet_is_valid =
|
.ports_per_subunit = 1,
|
||||||
pri_packet_is_valid,.packet_dump = pri_packet_dump,};
|
.type = XPD_TYPE_PRI,
|
||||||
|
.xops = &pri_xops,
|
||||||
|
.phoneops = &pri_phoneops,
|
||||||
|
.packet_is_valid = pri_packet_is_valid,
|
||||||
|
.packet_dump = pri_packet_dump,
|
||||||
|
};
|
||||||
|
|
||||||
static bool pri_packet_is_valid(xpacket_t *pack)
|
static bool pri_packet_is_valid(xpacket_t *pack)
|
||||||
{
|
{
|
||||||
|
@ -465,11 +465,11 @@ static int __init xpp_mmap_load_fpga(u8 * data, size_t size)
|
|||||||
*/
|
*/
|
||||||
for (j = 0; j < 8; j++)
|
for (j = 0; j < 8; j++)
|
||||||
{
|
{
|
||||||
if (__u8 &1)
|
if (__u8 & 1)
|
||||||
bfin_write_PORTGIO_SET(DATA);
|
bfin_write_PORTGIO_SET(DATA);
|
||||||
else
|
else
|
||||||
bfin_write_PORTGIO_CLEAR(DATA);
|
bfin_write_PORTGIO_CLEAR(DATA);
|
||||||
__u8 >>=1;
|
__u8 >>= 1;
|
||||||
bfin_write_PORTGIO_SET(DCLK);
|
bfin_write_PORTGIO_SET(DCLK);
|
||||||
bfin_write_PORTGIO_CLEAR(DCLK);
|
bfin_write_PORTGIO_CLEAR(DCLK);
|
||||||
}
|
}
|
||||||
|
@ -1813,7 +1813,8 @@ static int proc_xbus_command_write(struct file *file,
|
|||||||
int val;
|
int val;
|
||||||
char hexdigit[3];
|
char hexdigit[3];
|
||||||
|
|
||||||
while (*p && isspace(*p)) // skip whitespace
|
/* skip whitespace */
|
||||||
|
while (*p && isspace(*p))
|
||||||
p++;
|
p++;
|
||||||
if (!(*p))
|
if (!(*p))
|
||||||
break;
|
break;
|
||||||
|
@ -291,20 +291,18 @@ static DEVICE_ATTR_READER(driftinfo_show, dev, buf)
|
|||||||
static ssize_t \
|
static ssize_t \
|
||||||
field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
|
field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
|
||||||
{ \
|
{ \
|
||||||
xbus_t *xbus; \
|
xbus_t *xbus; \
|
||||||
\
|
xbus = dev_to_xbus(dev); \
|
||||||
xbus = dev_to_xbus(dev); \
|
return sprintf(buf, format_string, xbus->field); \
|
||||||
return sprintf (buf, format_string, xbus->field); \
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define xbus_attr(field, format_string) \
|
#define xbus_attr(field, format_string) \
|
||||||
static ssize_t \
|
static ssize_t \
|
||||||
field##_show(struct device *dev, char *buf) \
|
field##_show(struct device *dev, char *buf) \
|
||||||
{ \
|
{ \
|
||||||
xbus_t *xbus; \
|
xbus_t *xbus; \
|
||||||
\
|
xbus = dev_to_xbus(dev); \
|
||||||
xbus = dev_to_xbus(dev); \
|
return sprintf(buf, format_string, xbus->field); \
|
||||||
return sprintf (buf, format_string, xbus->field); \
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ typedef char *charp;
|
|||||||
/* Also don't define this for later RHEL >= 5.2 . hex_asc is from the
|
/* Also don't define this for later RHEL >= 5.2 . hex_asc is from the
|
||||||
* same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch
|
* same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch
|
||||||
* as is the bool typedef. */
|
* as is the bool typedef. */
|
||||||
#if LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 18) || ! defined(hex_asc)
|
#if LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 18) || !defined(hex_asc)
|
||||||
typedef int bool;
|
typedef int bool;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -510,20 +510,23 @@ static const struct xusb_model_info {
|
|||||||
struct xusb_endpoint out;
|
struct xusb_endpoint out;
|
||||||
} model_table[] = {
|
} model_table[] = {
|
||||||
[MODEL_FPGA_XPD] = {
|
[MODEL_FPGA_XPD] = {
|
||||||
.iface_num = 0,.in = {
|
.iface_num = 0,
|
||||||
.ep_addr = 0x86},.out = {
|
.in = { .ep_addr = 0x86 },
|
||||||
.ep_addr = 0x02},.desc = "FPGA_XPD"},};
|
.out = { .ep_addr = 0x02 },
|
||||||
|
.desc = "FPGA_XPD"
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
/* table of devices that work with this driver */
|
/* table of devices that work with this driver */
|
||||||
static const struct usb_device_id xusb_table[] = {
|
static const struct usb_device_id xusb_table[] = {
|
||||||
/* FPGA_FXS */ {USB_DEVICE(0xE4E4, 0x1132),
|
/* FPGA_FXS */ {USB_DEVICE(0xE4E4, 0x1132),
|
||||||
.driver_info = (kernel_ulong_t) & model_table[MODEL_FPGA_XPD]},
|
.driver_info = (kernel_ulong_t)&model_table[MODEL_FPGA_XPD]},
|
||||||
/* FPGA_1141 */ {USB_DEVICE(0xE4E4, 0x1142),
|
/* FPGA_1141 */ {USB_DEVICE(0xE4E4, 0x1142),
|
||||||
.driver_info = (kernel_ulong_t) & model_table[MODEL_FPGA_XPD]},
|
.driver_info = (kernel_ulong_t)&model_table[MODEL_FPGA_XPD]},
|
||||||
/* FPGA_1151 */ {USB_DEVICE(0xE4E4, 0x1152),
|
/* FPGA_1151 */ {USB_DEVICE(0xE4E4, 0x1152),
|
||||||
.driver_info = (kernel_ulong_t) & model_table[MODEL_FPGA_XPD]},
|
.driver_info = (kernel_ulong_t)&model_table[MODEL_FPGA_XPD]},
|
||||||
/* FPGA_1161 */ {USB_DEVICE(0xE4E4, 0x1162),
|
/* FPGA_1161 */ {USB_DEVICE(0xE4E4, 0x1162),
|
||||||
.driver_info = (kernel_ulong_t) & model_table[MODEL_FPGA_XPD]},
|
.driver_info = (kernel_ulong_t)&model_table[MODEL_FPGA_XPD]},
|
||||||
/* Terminate */ {}
|
/* Terminate */ {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -640,7 +643,7 @@ static int set_endpoints(xusb_t *xusb, struct usb_host_interface *iface_desc,
|
|||||||
ep_addr, endpoint->bmAttributes);
|
ep_addr, endpoint->bmAttributes);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (usb_pipein(ep_addr)) { // Input
|
if (usb_pipein(ep_addr)) { /* Input */
|
||||||
if (ep_addr == model_info->in.ep_addr) {
|
if (ep_addr == model_info->in.ep_addr) {
|
||||||
if (!check_usb1(endpoint))
|
if (!check_usb1(endpoint))
|
||||||
return 0;
|
return 0;
|
||||||
@ -649,7 +652,7 @@ static int set_endpoints(xusb_t *xusb, struct usb_host_interface *iface_desc,
|
|||||||
xusb_ep->max_size = endpoint->wMaxPacketSize;
|
xusb_ep->max_size = endpoint->wMaxPacketSize;
|
||||||
xusb_ep->callback = xpp_receive_callback;
|
xusb_ep->callback = xpp_receive_callback;
|
||||||
}
|
}
|
||||||
} else { // Output
|
} else { /* Output */
|
||||||
if (ep_addr == model_info->out.ep_addr) {
|
if (ep_addr == model_info->out.ep_addr) {
|
||||||
if (!check_usb1(endpoint))
|
if (!check_usb1(endpoint))
|
||||||
return 0;
|
return 0;
|
||||||
@ -832,7 +835,7 @@ probe_failed:
|
|||||||
ERR("Failed to initialize xpp usb bus: %d\n", retval);
|
ERR("Failed to initialize xpp usb bus: %d\n", retval);
|
||||||
usb_set_intfdata(interface, NULL);
|
usb_set_intfdata(interface, NULL);
|
||||||
if (xusb) {
|
if (xusb) {
|
||||||
if (xusb->minor) { // passed registration phase
|
if (xusb->minor) { /* passed registration phase */
|
||||||
ERR("Calling usb_deregister_dev()\n");
|
ERR("Calling usb_deregister_dev()\n");
|
||||||
usb_deregister_dev(interface, &xusb_class);
|
usb_deregister_dev(interface, &xusb_class);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ typedef __u8 xpd_type_t;
|
|||||||
|
|
||||||
#define XPD_TYPE_PREFIX "xpd-type-"
|
#define XPD_TYPE_PREFIX "xpd-type-"
|
||||||
|
|
||||||
#define MODULE_ALIAS_XPD(type) \
|
#define MODULE_ALIAS_XPD(type) \
|
||||||
MODULE_ALIAS(XPD_TYPE_PREFIX __stringify(type))
|
MODULE_ALIAS(XPD_TYPE_PREFIX __stringify(type))
|
||||||
|
|
||||||
#define PCM_CHUNKSIZE (CHANNELS_PERXPD * 8) /* samples of 8 bytes */
|
#define PCM_CHUNKSIZE (CHANNELS_PERXPD * 8) /* samples of 8 bytes */
|
||||||
@ -96,26 +96,26 @@ bool valid_xpd_addr(const struct xpd_addr *addr);
|
|||||||
#define XPROTO_HANDLER(card, op) XPROTO_NAME(card, op ## _handler)
|
#define XPROTO_HANDLER(card, op) XPROTO_NAME(card, op ## _handler)
|
||||||
#define XPROTO_CALLER(card, op) XPROTO_NAME(card, op ## _send)
|
#define XPROTO_CALLER(card, op) XPROTO_NAME(card, op ## _send)
|
||||||
|
|
||||||
#define HANDLER_DEF(card, op) \
|
#define HANDLER_DEF(card, op) \
|
||||||
static int XPROTO_HANDLER(card, op) ( \
|
static int XPROTO_HANDLER(card, op) ( \
|
||||||
xbus_t *xbus, \
|
xbus_t *xbus, \
|
||||||
xpd_t *xpd, \
|
xpd_t *xpd, \
|
||||||
const xproto_entry_t *cmd, \
|
const xproto_entry_t *cmd, \
|
||||||
xpacket_t *pack)
|
xpacket_t *pack)
|
||||||
|
|
||||||
#define CALL_PROTO(card, op, ...) XPROTO_CALLER(card, op)( __VA_ARGS__ )
|
#define CALL_PROTO(card, op, ...) XPROTO_CALLER(card, op)(__VA_ARGS__)
|
||||||
|
|
||||||
#define DECLARE_CMD(card, op, ...) \
|
#define DECLARE_CMD(card, op, ...) \
|
||||||
int CALL_PROTO(card, op, xbus_t *xbus, xpd_t *xpd, ## __VA_ARGS__ )
|
int CALL_PROTO(card, op, xbus_t *xbus, xpd_t *xpd, ## __VA_ARGS__)
|
||||||
|
|
||||||
#define HOSTCMD(card, op, ...) \
|
#define HOSTCMD(card, op, ...) \
|
||||||
DECLARE_CMD(card, op, ## __VA_ARGS__ )
|
DECLARE_CMD(card, op, ## __VA_ARGS__)
|
||||||
|
|
||||||
#define RPACKET_NAME(card, op) XPROTO_NAME(RPACKET_ ## card, op)
|
#define RPACKET_NAME(card, op) XPROTO_NAME(RPACKET_ ## card, op)
|
||||||
#define RPACKET_TYPE(card, op) struct RPACKET_NAME(card, op)
|
#define RPACKET_TYPE(card, op) struct RPACKET_NAME(card, op)
|
||||||
|
|
||||||
#define DEF_RPACKET_DATA(card, op, ...) \
|
#define DEF_RPACKET_DATA(card, op, ...) \
|
||||||
RPACKET_TYPE(card, op) { \
|
RPACKET_TYPE(card, op) { \
|
||||||
struct xpacket_header head; \
|
struct xpacket_header head; \
|
||||||
__VA_ARGS__ \
|
__VA_ARGS__ \
|
||||||
} PACKED
|
} PACKED
|
||||||
@ -124,7 +124,7 @@ bool valid_xpd_addr(const struct xpd_addr *addr);
|
|||||||
(((RPACKET_TYPE(card, op) *)(p))->field)
|
(((RPACKET_TYPE(card, op) *)(p))->field)
|
||||||
#define RPACKET_SIZE(card, op) sizeof(RPACKET_TYPE(card, op))
|
#define RPACKET_SIZE(card, op) sizeof(RPACKET_TYPE(card, op))
|
||||||
|
|
||||||
#define XENTRY(prototab, module, op) \
|
#define XENTRY(prototab, module, op) \
|
||||||
[ XPROTO_NAME(module, op) ] = { \
|
[ XPROTO_NAME(module, op) ] = { \
|
||||||
.handler = XPROTO_HANDLER(module, op), \
|
.handler = XPROTO_HANDLER(module, op), \
|
||||||
.datalen = RPACKET_SIZE(module, op), \
|
.datalen = RPACKET_SIZE(module, op), \
|
||||||
@ -132,7 +132,7 @@ bool valid_xpd_addr(const struct xpd_addr *addr);
|
|||||||
.table = &PROTO_TABLE(prototab) \
|
.table = &PROTO_TABLE(prototab) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define XPACKET_INIT(p, card, op, to, pcm, pcmslot) \
|
#define XPACKET_INIT(p, card, op, to, pcm, pcmslot) \
|
||||||
do { \
|
do { \
|
||||||
XPACKET_OP(p) = XPROTO_NAME(card, op); \
|
XPACKET_OP(p) = XPROTO_NAME(card, op); \
|
||||||
XPACKET_LEN(p) = RPACKET_SIZE(card, op); \
|
XPACKET_LEN(p) = RPACKET_SIZE(card, op); \
|
||||||
@ -145,9 +145,9 @@ bool valid_xpd_addr(const struct xpd_addr *addr);
|
|||||||
XPACKET_ADDR_RESERVED(p) = 0; \
|
XPACKET_ADDR_RESERVED(p) = 0; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define XFRAME_NEW_CMD(frm, p, xbus, card, op, to) \
|
#define XFRAME_NEW_CMD(frm, p, xbus, card, op, to) \
|
||||||
do { \
|
do { \
|
||||||
int pack_len = RPACKET_SIZE(card, op); \
|
int pack_len = RPACKET_SIZE(card, op); \
|
||||||
\
|
\
|
||||||
if (!XBUS_FLAGS(xbus, CONNECTED)) \
|
if (!XBUS_FLAGS(xbus, CONNECTED)) \
|
||||||
return -ENODEV; \
|
return -ENODEV; \
|
||||||
@ -219,16 +219,16 @@ xproto_handler_t xproto_global_handler(__u8 opcode);
|
|||||||
* CALL_XMETHOD() calls the method, passing mandatory arguments
|
* CALL_XMETHOD() calls the method, passing mandatory arguments
|
||||||
*/
|
*/
|
||||||
#define XMETHOD(name, xpd) ((xpd)->xops->name)
|
#define XMETHOD(name, xpd) ((xpd)->xops->name)
|
||||||
#define CALL_XMETHOD(name, xpd, ...) \
|
#define CALL_XMETHOD(name, xpd, ...) \
|
||||||
(XMETHOD(name, (xpd))((xpd)->xbus, (xpd), ## __VA_ARGS__ ))
|
(XMETHOD(name, (xpd))((xpd)->xbus, (xpd), ## __VA_ARGS__))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PHONE_METHOD() resolve to method pointer (NULL for optional methods)
|
* PHONE_METHOD() resolve to method pointer (NULL for optional methods)
|
||||||
* CALL_PHONE_METHOD() calls the method, passing mandatory arguments
|
* CALL_PHONE_METHOD() calls the method, passing mandatory arguments
|
||||||
*/
|
*/
|
||||||
#define PHONE_METHOD(name, xpd) (PHONEDEV(xpd).phoneops->name)
|
#define PHONE_METHOD(name, xpd) (PHONEDEV(xpd).phoneops->name)
|
||||||
#define CALL_PHONE_METHOD(name, xpd, ...) \
|
#define CALL_PHONE_METHOD(name, xpd, ...) \
|
||||||
(PHONE_METHOD(name, (xpd))((xpd), ## __VA_ARGS__ ))
|
(PHONE_METHOD(name, (xpd))((xpd), ## __VA_ARGS__))
|
||||||
|
|
||||||
struct phoneops {
|
struct phoneops {
|
||||||
void (*card_pcm_recompute) (xpd_t *xpd, xpp_line_t pcm_mask);
|
void (*card_pcm_recompute) (xpd_t *xpd, xpp_line_t pcm_mask);
|
||||||
|
Loading…
Reference in New Issue
Block a user