summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bluetooth/hccontrol
diff options
context:
space:
mode:
authoremax <emax@FreeBSD.org>2004-04-09 23:58:53 +0000
committeremax <emax@FreeBSD.org>2004-04-09 23:58:53 +0000
commit96b75c2267d1d5caf4783f60f78743070ccfa0c8 (patch)
treefbab8941576e06ad6a4b5170cdafecdb37babc6e /usr.sbin/bluetooth/hccontrol
parent16d558884f1b7517e234363d9fffb2d781c2ef1b (diff)
downloadFreeBSD-src-96b75c2267d1d5caf4783f60f78743070ccfa0c8.zip
FreeBSD-src-96b75c2267d1d5caf4783f60f78743070ccfa0c8.tar.gz
Use uint instead of u_int
Diffstat (limited to 'usr.sbin/bluetooth/hccontrol')
-rw-r--r--usr.sbin/bluetooth/hccontrol/hccontrol.h2
-rw-r--r--usr.sbin/bluetooth/hccontrol/host_controller_baseband.c44
-rw-r--r--usr.sbin/bluetooth/hccontrol/link_control.c30
-rw-r--r--usr.sbin/bluetooth/hccontrol/link_policy.c8
-rw-r--r--usr.sbin/bluetooth/hccontrol/send_recv.c4
-rw-r--r--usr.sbin/bluetooth/hccontrol/status.c8
-rw-r--r--usr.sbin/bluetooth/hccontrol/util.c2
7 files changed, 49 insertions, 49 deletions
diff --git a/usr.sbin/bluetooth/hccontrol/hccontrol.h b/usr.sbin/bluetooth/hccontrol/hccontrol.h
index 001ca71..4424f76 100644
--- a/usr.sbin/bluetooth/hccontrol/hccontrol.h
+++ b/usr.sbin/bluetooth/hccontrol/hccontrol.h
@@ -66,7 +66,7 @@ char const * const hci_vdata2str (int);
char const * const hci_hmode2str (int, char *, int);
char const * const hci_ver2str (int);
char const * const hci_manufacturer2str(int);
-char const * const hci_features2str (u_int8_t *, char *, int);
+char const * const hci_features2str (uint8_t *, char *, int);
char const * const hci_cc2str (int);
char const * const hci_con_state2str (int);
char const * const hci_status2str (int);
diff --git a/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c b/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
index fd4d60e..c8e03d2 100644
--- a/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
+++ b/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
@@ -64,9 +64,9 @@ hci_hexa2int8(const char *a)
return ((hi << 4) | lo);
}
-/* Convert ascii hex string to the u_int8_t[] */
+/* Convert ascii hex string to the uint8_t[] */
static int
-hci_hexstring2array(char const *s, u_int8_t *a, int asize)
+hci_hexstring2array(char const *s, uint8_t *a, int asize)
{
int i, l, b;
@@ -145,7 +145,7 @@ hci_write_pin_type(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 1)
return (USAGE);
- cp.pin_type = (u_int8_t) n;
+ cp.pin_type = (uint8_t) n;
break;
default:
@@ -183,7 +183,7 @@ hci_read_stored_link_key(int s, int argc, char **argv)
union {
ng_hci_command_compl_ep cc;
ng_hci_return_link_keys_ep key;
- u_int8_t b[NG_HCI_EVENT_PKT_SIZE];
+ uint8_t b[NG_HCI_EVENT_PKT_SIZE];
} ep;
} __attribute__ ((packed)) event;
@@ -257,7 +257,7 @@ again:
case NG_HCI_EVENT_RETURN_LINK_KEYS: {
struct _key {
bdaddr_t bdaddr;
- u_int8_t key[NG_HCI_KEY_SIZE];
+ uint8_t key[NG_HCI_KEY_SIZE];
} __attribute__ ((packed)) *k = NULL;
fprintf(stdout, "Event: Number of keys: %d\n",
@@ -293,7 +293,7 @@ hci_write_stored_link_key(int s, int argc, char **argv)
struct {
ng_hci_write_stored_link_key_cp p;
bdaddr_t bdaddr;
- u_int8_t key[NG_HCI_KEY_SIZE];
+ uint8_t key[NG_HCI_KEY_SIZE];
} cp;
ng_hci_write_stored_link_key_rp rp;
int32_t n;
@@ -489,7 +489,7 @@ hci_write_connection_accept_timeout(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 1 || n > 0xb540)
return (USAGE);
- cp.timeout = (u_int16_t) n;
+ cp.timeout = (uint16_t) n;
cp.timeout = htole16(cp.timeout);
break;
@@ -554,7 +554,7 @@ hci_write_page_timeout(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 1 || n > 0xffff)
return (USAGE);
- cp.timeout = (u_int16_t) n;
+ cp.timeout = (uint16_t) n;
cp.timeout = htole16(cp.timeout);
break;
@@ -618,7 +618,7 @@ hci_write_scan_enable(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 3)
return (USAGE);
- cp.scan_enable = (u_int8_t) n;
+ cp.scan_enable = (uint8_t) n;
break;
default:
@@ -686,13 +686,13 @@ hci_write_page_scan_activity(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0x12 || n > 0x1000)
return (USAGE);
- cp.page_scan_interval = (u_int16_t) n;
+ cp.page_scan_interval = (uint16_t) n;
/* page scan window */
if (sscanf(argv[0], "%d", &n) != 1 || n < 0x12 || n > 0x1000)
return (USAGE);
- cp.page_scan_window = (u_int16_t) n;
+ cp.page_scan_window = (uint16_t) n;
if (cp.page_scan_window > cp.page_scan_interval)
return (USAGE);
@@ -767,13 +767,13 @@ hci_write_inquiry_scan_activity(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0x12 || n > 0x1000)
return (USAGE);
- cp.inquiry_scan_interval = (u_int16_t) n;
+ cp.inquiry_scan_interval = (uint16_t) n;
/* inquiry scan window */
if (sscanf(argv[0], "%d", &n) != 1 || n < 0x12 || n > 0x1000)
return (USAGE);
- cp.inquiry_scan_window = (u_int16_t) n;
+ cp.inquiry_scan_window = (uint16_t) n;
if (cp.inquiry_scan_window > cp.inquiry_scan_interval)
return (USAGE);
@@ -843,7 +843,7 @@ hci_write_authentication_enable(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 1)
return (USAGE);
- cp.auth_enable = (u_int8_t) n;
+ cp.auth_enable = (uint8_t) n;
break;
default:
@@ -906,7 +906,7 @@ hci_write_encryption_mode(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 2)
return (USAGE);
- cp.encryption_mode = (u_int8_t) n;
+ cp.encryption_mode = (uint8_t) n;
break;
default:
@@ -1050,7 +1050,7 @@ hci_write_voice_settings(int s, int argc, char **argv)
if (sscanf(argv[0], "%x", &n) != 1)
return (USAGE);
- cp.settings = (u_int16_t) n;
+ cp.settings = (uint16_t) n;
cp.settings = htole16(cp.settings);
break;
@@ -1114,7 +1114,7 @@ hci_write_number_broadcast_retransmissions(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 0xff)
return (USAGE);
- cp.counter = (u_int8_t) n;
+ cp.counter = (uint8_t) n;
break;
default:
@@ -1184,7 +1184,7 @@ hci_write_hold_mode_activity(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 4)
return (USAGE);
- cp.hold_mode_activity = (u_int8_t) n;
+ cp.hold_mode_activity = (uint8_t) n;
break;
default:
@@ -1247,7 +1247,7 @@ hci_write_sco_flow_control_enable(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n < 0 || n > 1)
return (USAGE);
- cp.flow_control = (u_int8_t) n;
+ cp.flow_control = (uint8_t) n;
break;
default:
@@ -1285,7 +1285,7 @@ hci_read_link_supervision_timeout(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
@@ -1330,14 +1330,14 @@ hci_write_link_supervision_timeout(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
/* link supervision timeout */
if (sscanf(argv[1], "%d", &n) != 1 || n < 0 || n > 0xeff)
return (USAGE);
- cp.timeout = (u_int16_t) (n & 0x0fff);
+ cp.timeout = (uint16_t) (n & 0x0fff);
cp.timeout = htole16(cp.timeout);
break;
diff --git a/usr.sbin/bluetooth/hccontrol/link_control.c b/usr.sbin/bluetooth/hccontrol/link_control.c
index eaf7e8d..c8e5cb1 100644
--- a/usr.sbin/bluetooth/hccontrol/link_control.c
+++ b/usr.sbin/bluetooth/hccontrol/link_control.c
@@ -35,14 +35,14 @@
#include <string.h>
#include "hccontrol.h"
-static void hci_inquiry_response (int n, u_int8_t **b);
+static void hci_inquiry_response (int n, uint8_t **b);
/* Send Inquiry command to the unit */
static int
hci_inquiry(int s, int argc, char **argv)
{
int n0, n1, n2, timo;
- u_int8_t b[512];
+ uint8_t b[512];
ng_hci_inquiry_cp cp;
ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b;
@@ -117,7 +117,7 @@ wait_for_more:
case NG_HCI_EVENT_INQUIRY_RESULT: {
ng_hci_inquiry_result_ep *ir =
(ng_hci_inquiry_result_ep *)(e + 1);
- u_int8_t *r = (u_int8_t *)(ir + 1);
+ uint8_t *r = (uint8_t *)(ir + 1);
fprintf(stdout, "Inquiry result, num_responses=%d\n",
ir->num_responses);
@@ -144,15 +144,15 @@ wait_for_more:
/* Print Inquiry_Result event */
static void
-hci_inquiry_response(int n, u_int8_t **b)
+hci_inquiry_response(int n, uint8_t **b)
{
struct inquiry_response {
bdaddr_t bdaddr;
- u_int8_t page_scan_rep_mode;
- u_int8_t page_scan_period_mode;
- u_int8_t page_scan_mode;
- u_int8_t class[NG_HCI_CLASS_SIZE];
- u_int16_t clock_offset;
+ uint8_t page_scan_rep_mode;
+ uint8_t page_scan_period_mode;
+ uint8_t page_scan_mode;
+ uint8_t class[NG_HCI_CLASS_SIZE];
+ uint16_t clock_offset;
} *ir = (struct inquiry_response *)(*b);
fprintf(stdout, "Inquiry result #%d\n", n);
@@ -312,14 +312,14 @@ hci_disconnect(int s, int argc, char **argv)
if (sscanf(argv[1], "%d", &n) != 1 || n <= 0x00 || n > 0xff)
return (USAGE);
- cp.reason = (u_int8_t) (n & 0xff);
+ cp.reason = (uint8_t) (n & 0xff);
case 1:
/* connection handle */
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
@@ -390,7 +390,7 @@ hci_add_sco_connection(int s, int argc, char **argv)
if (n == 0)
return (USAGE);
- cp.pkt_type = (u_int16_t) (n & 0x0fff);
+ cp.pkt_type = (uint16_t) (n & 0x0fff);
cp.pkt_type = htole16(cp.pkt_type);
case 1:
@@ -398,7 +398,7 @@ hci_add_sco_connection(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
@@ -462,14 +462,14 @@ hci_change_connection_packet_type(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
/* packet type */
if (sscanf(argv[1], "%x", &n) != 1)
return (USAGE);
- cp.pkt_type = (u_int16_t) (n & 0xffff);
+ cp.pkt_type = (uint16_t) (n & 0xffff);
cp.pkt_type = htole16(cp.pkt_type);
break;
diff --git a/usr.sbin/bluetooth/hccontrol/link_policy.c b/usr.sbin/bluetooth/hccontrol/link_policy.c
index 0c482d6..e00bac5 100644
--- a/usr.sbin/bluetooth/hccontrol/link_policy.c
+++ b/usr.sbin/bluetooth/hccontrol/link_policy.c
@@ -50,7 +50,7 @@ hci_role_discovery(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
@@ -166,7 +166,7 @@ hci_read_link_policy_settings(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
@@ -209,14 +209,14 @@ hci_write_link_policy_settings(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
/* link policy settings */
if (sscanf(argv[1], "%x", &n) != 1)
return (USAGE);
- cp.settings = (u_int16_t) (n & 0x0ffff);
+ cp.settings = (uint16_t) (n & 0x0ffff);
cp.settings = htole16(cp.settings);
break;
diff --git a/usr.sbin/bluetooth/hccontrol/send_recv.c b/usr.sbin/bluetooth/hccontrol/send_recv.c
index 12ea8cc..5c2aea9 100644
--- a/usr.sbin/bluetooth/hccontrol/send_recv.c
+++ b/usr.sbin/bluetooth/hccontrol/send_recv.c
@@ -54,13 +54,13 @@ hci_request(int s, int opcode, char const *cp, int cp_size, char *rp, int *rp_si
assert(*rp_size > 0);
c->type = NG_HCI_CMD_PKT;
- c->opcode = (u_int16_t) opcode;
+ c->opcode = (uint16_t) opcode;
c->opcode = htole16(c->opcode);
if (cp != NULL) {
assert(0 < cp_size && cp_size <= NG_HCI_CMD_PKT_SIZE);
- c->length = (u_int8_t) cp_size;
+ c->length = (uint8_t) cp_size;
memcpy(buffer + sizeof(*c), cp, cp_size);
} else
c->length = 0;
diff --git a/usr.sbin/bluetooth/hccontrol/status.c b/usr.sbin/bluetooth/hccontrol/status.c
index 86dd8c9..3364576 100644
--- a/usr.sbin/bluetooth/hccontrol/status.c
+++ b/usr.sbin/bluetooth/hccontrol/status.c
@@ -50,7 +50,7 @@ hci_read_failed_contact_counter(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
@@ -92,7 +92,7 @@ hci_reset_failed_contact_counter(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
@@ -131,7 +131,7 @@ hci_get_link_quality(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
@@ -173,7 +173,7 @@ hci_read_rssi(int s, int argc, char **argv)
if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff)
return (USAGE);
- cp.con_handle = (u_int16_t) (n & 0x0fff);
+ cp.con_handle = (uint16_t) (n & 0x0fff);
cp.con_handle = htole16(cp.con_handle);
break;
diff --git a/usr.sbin/bluetooth/hccontrol/util.c b/usr.sbin/bluetooth/hccontrol/util.c
index 7cc4326..d4c1687 100644
--- a/usr.sbin/bluetooth/hccontrol/util.c
+++ b/usr.sbin/bluetooth/hccontrol/util.c
@@ -213,7 +213,7 @@ hci_manufacturer2str(int m)
} /* hci_manufacturer2str */
char const * const
-hci_features2str(u_int8_t *features, char *buffer, int size)
+hci_features2str(uint8_t *features, char *buffer, int size)
{
static char const * const t[][8] = {
{ /* byte 0 */
OpenPOWER on IntegriCloud