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)
|
||||||
{
|
{
|
||||||
|
@ -628,13 +628,16 @@ 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;
|
||||||
|
@ -292,9 +292,8 @@ 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) \
|
||||||
@ -302,9 +301,8 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -103,13 +103,13 @@ bool valid_xpd_addr(const struct xpd_addr *addr);
|
|||||||
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)
|
||||||
@ -220,7 +220,7 @@ xproto_handler_t xproto_global_handler(__u8 opcode);
|
|||||||
*/
|
*/
|
||||||
#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)
|
||||||
@ -228,7 +228,7 @@ xproto_handler_t xproto_global_handler(__u8 opcode);
|
|||||||
*/
|
*/
|
||||||
#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