summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/bluetooth/socket
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-11-09 13:29:16 +0000
committerru <ru@FreeBSD.org>2005-11-09 13:29:16 +0000
commitdcace5669d81e83aea7a22539593b0f158eb224c (patch)
tree54d0f8642eec5f374a08d8a2b18c53a66b4ba269 /sys/netgraph/bluetooth/socket
parenteba5310ce5792d913219b571cd4890c26fea82d8 (diff)
downloadFreeBSD-src-dcace5669d81e83aea7a22539593b0f158eb224c.zip
FreeBSD-src-dcace5669d81e83aea7a22539593b0f158eb224c.tar.gz
Use sparse initializers for "struct domain" and "struct protosw",
so they are easier to follow for the human being.
Diffstat (limited to 'sys/netgraph/bluetooth/socket')
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket.c86
1 files changed, 31 insertions, 55 deletions
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket.c b/sys/netgraph/bluetooth/socket/ng_btsocket.c
index 9b8fdd6..16b9a20 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket.c
@@ -140,56 +140,39 @@ static struct pr_usrreqs ng_btsocket_rfcomm_usrreqs = {
static struct protosw ng_btsocket_protosw[] = {
{
- SOCK_RAW, /* protocol type */
- &ng_btsocket_domain, /* backpointer to domain */
- BLUETOOTH_PROTO_HCI, /* protocol */
- PR_ATOMIC | PR_ADDR, /* flags */
- NULL, NULL, NULL, /* input, output, ctlinput */
- ng_btsocket_hci_raw_ctloutput, /* ctloutput */
- NULL, /* ousrreq() */
- ng_btsocket_hci_raw_init, /* init */
- NULL, NULL, NULL, /* fasttimeo, slowtimo, drain */
- &ng_btsocket_hci_raw_usrreqs, /* usrreq table (above) */
- /* { NULL } */ /* pfh (protocol filter head?) */
+ .pr_type = SOCK_RAW,
+ .pr_domain = &ng_btsocket_domain,
+ .pr_protocol = BLUETOOTH_PROTO_HCI,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_ctloutput = ng_btsocket_hci_raw_ctloutput,
+ .pr_init = ng_btsocket_hci_raw_init,
+ .pr_usrreqs = &ng_btsocket_hci_raw_usrreqs,
},
{
- SOCK_RAW, /* protocol type */
- &ng_btsocket_domain, /* backpointer to domain */
- BLUETOOTH_PROTO_L2CAP, /* protocol */
- PR_ATOMIC | PR_ADDR, /* flags */
- NULL, NULL, NULL, /* input, output, ctlinput */
- NULL, /* ctloutput */
- NULL, /* ousrreq() */
- ng_btsocket_l2cap_raw_init, /* init */
- NULL, NULL, NULL, /* fasttimeo, slowtimo, drain */
- &ng_btsocket_l2cap_raw_usrreqs, /* usrreq table (above) */
- /* { NULL } */ /* pfh (protocol filter head?) */
+ .pr_type = SOCK_RAW,
+ .pr_domain = &ng_btsocket_domain,
+ .pr_protocol = BLUETOOTH_PROTO_L2CAP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_init = ng_btsocket_l2cap_raw_init,
+ .pr_usrreqs = &ng_btsocket_l2cap_raw_usrreqs,
},
{
- SOCK_SEQPACKET, /* protocol type */
- &ng_btsocket_domain, /* backpointer to domain */
- BLUETOOTH_PROTO_L2CAP, /* protocol */
- PR_ATOMIC | PR_CONNREQUIRED, /* flags */
- NULL, NULL, NULL, /* input, output, ctlinput */
- ng_btsocket_l2cap_ctloutput, /* ctloutput */
- NULL, /* ousrreq() */
- ng_btsocket_l2cap_init, /* init */
- NULL, NULL, NULL, /* fasttimeo, slowtimo, drain */
- &ng_btsocket_l2cap_usrreqs, /* usrreq table (above) */
- /* { NULL } */ /* pfh (protocol filter head?) */
+ .pr_type = SOCK_SEQPACKET,
+ .pr_domain = &ng_btsocket_domain,
+ .pr_protocol = BLUETOOTH_PROTO_L2CAP,
+ .pr_flags = PR_ATOMIC|PR_CONNREQUIRED,
+ .pr_ctloutput = ng_btsocket_l2cap_ctloutput,
+ .pr_init = ng_btsocket_l2cap_init,
+ .pr_usrreqs = &ng_btsocket_l2cap_usrreqs,
},
{
- SOCK_STREAM, /* protocol type */
- &ng_btsocket_domain, /* backpointer to domain */
- BLUETOOTH_PROTO_RFCOMM, /* protocol */
- PR_CONNREQUIRED, /* flags */
- NULL, NULL, NULL, /* input, output, ctlinput */
- ng_btsocket_rfcomm_ctloutput, /* ctloutput */
- NULL, /* ousrreq() */
- ng_btsocket_rfcomm_init, /* init */
- NULL, NULL, NULL, /* fasttimeo, slowtimo, drain */
- &ng_btsocket_rfcomm_usrreqs, /* usrreq table (above) */
- /* { NULL } */ /* pfh (protocol filter head?) */
+ .pr_type = SOCK_STREAM,
+ .pr_domain = &ng_btsocket_domain,
+ .pr_protocol = BLUETOOTH_PROTO_RFCOMM,
+ .pr_flags = PR_CONNREQUIRED,
+ .pr_ctloutput = ng_btsocket_rfcomm_ctloutput,
+ .pr_init = ng_btsocket_rfcomm_init,
+ .pr_usrreqs = &ng_btsocket_rfcomm_usrreqs,
}
};
#define ng_btsocket_protosw_size \
@@ -202,17 +185,10 @@ static struct protosw ng_btsocket_protosw[] = {
*/
struct domain ng_btsocket_domain = {
- AF_BLUETOOTH, /* family */
- "bluetooth", /* domain name */
- NULL, /* init() */
- NULL, /* externalize() */
- NULL, /* dispose() */
- ng_btsocket_protosw, /* protosw entry */
- ng_btsocket_protosw_end, /* end of protosw entries */
- NULL, /* next domain in list */
- NULL, /* rtattach() */
- 0, /* arg to rtattach in bits */
- 0 /* maxrtkey */
+ .dom_family = AF_BLUETOOTH,
+ .dom_name = "bluetooth",
+ .dom_protosw = ng_btsocket_protosw,
+ .dom_protoswNPROTOSW = ng_btsocket_protosw_end
};
/*
OpenPOWER on IntegriCloud