From 1b9e61ad870cb487d0dd04a14aa08ba9450fc7ec Mon Sep 17 00:00:00 2001 From: Oliver Ruiz Dorantes Date: Thu, 12 Jun 2008 19:53:06 +0000 Subject: [PATCH] Remove some reference code Replace bsd types for haiku ones -ve-This line, and those below, will be ignored-- M l2cap/l2cap_command.cpp M l2cap/l2cap.h git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25945 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/network/protocols/l2cap/l2cap.h | 14 ++-- .../network/protocols/l2cap/l2cap_command.cpp | 68 ++----------------- 2 files changed, 13 insertions(+), 69 deletions(-) diff --git a/src/add-ons/kernel/network/protocols/l2cap/l2cap.h b/src/add-ons/kernel/network/protocols/l2cap/l2cap.h index 3321f45802..4ea917f9df 100644 --- a/src/add-ons/kernel/network/protocols/l2cap/l2cap.h +++ b/src/add-ons/kernel/network/protocols/l2cap/l2cap.h @@ -178,7 +178,7 @@ typedef struct { #define L2CAP_CMD_REJ 0x01 typedef struct { uint16 reason; /* reason to reject command */ -/* u_int8_t data[]; -- optional data (depends on reason) */ +/* uint8 data[]; -- optional data (depends on reason) */ } __attribute__ ((packed)) l2cap_cmd_rej_cp; /* CommandReject data */ @@ -216,7 +216,7 @@ typedef struct { typedef struct { uint16 dcid; /* destination channel ID */ uint16 flags; /* flags */ -/* u_int8_t options[] -- options */ +/* uint8 options[] -- options */ } __attribute__ ((packed)) l2cap_cfg_req_cp; /* L2CAP Configuration Response */ @@ -225,14 +225,14 @@ typedef struct { uint16 scid; /* source channel ID */ uint16 flags; /* flags */ uint16 result; /* 0x00 - success */ -/* u_int8_t options[] -- options */ +/* uint8 options[] -- options */ } __attribute__ ((packed)) l2cap_cfg_rsp_cp; /* L2CAP configuration option */ typedef struct { - u_int8_t type; - u_int8_t length; -/* u_int8_t value[] -- option value (depends on type) */ + uint8 type; + uint8 length; +/* uint8 value[] -- option value (depends on type) */ } __attribute__ ((packed)) l2cap_cfg_opt_t; typedef l2cap_cfg_opt_t * l2cap_cfg_opt_p; @@ -276,7 +276,7 @@ typedef struct { typedef struct { uint16 type; /* requested information type */ uint16 result; /* 0x00 - success */ -/* u_int8_t info[] -- info data (depends on type) +/* uint8 info[] -- info data (depends on type) * * L2CAP_CONNLESS_MTU - 2 bytes connectionless MTU */ diff --git a/src/add-ons/kernel/network/protocols/l2cap/l2cap_command.cpp b/src/add-ons/kernel/network/protocols/l2cap/l2cap_command.cpp index 049ef74fcf..13549ca85e 100644 --- a/src/add-ons/kernel/network/protocols/l2cap/l2cap_command.cpp +++ b/src/add-ons/kernel/network/protocols/l2cap/l2cap_command.cpp @@ -419,69 +419,13 @@ l2cap_info_rsp(uint8 _ident, uint16 _type, uint16 _result, uint16 _mtu) #pragma mark - #endif -/* Build configuration options + +/* Build configuration options */ static inline net_buffer* -l2cap_build_cfg_options(_m, * _mtu, * _flush_timo, _flow) +l2cap_build_cfg_options(uint16* _mtu, uint16* _flush_timo, l2cap_flow_t* _flow) { - u_int8_t *p = NULL; + //TODO: - MGETHDR((_m), M_DONTWAIT, MT_DATA); - if ((_m) == NULL) - break; - - (_m)->m_pkthdr.len = (_m)->m_len = 0; - p = mtod((_m), u_int8_t *); - - if ((_mtu) != NULL) { - struct _cfg_opt_mtu { - l2cap_cfg_opt_t hdr; - u_int16_t val; - } __attribute__ ((packed)) *o = NULL; - - o = (struct _cfg_opt_mtu *) p; - o->hdr.type = L2CAP_OPT_MTU; - o->hdr.length = sizeof(o->val); - o->val = htole16(*(u_int16_t *)(_mtu)); - - (_m)->m_pkthdr.len += sizeof(*o); - p += sizeof(*o); - } - - if ((_flush_timo) != NULL) { - struct _cfg_opt_flush { - l2cap_cfg_opt_t hdr; - u_int16_t val; - } __attribute__ ((packed)) *o = NULL; - - o = (struct _cfg_opt_flush *) p; - o->hdr.type = L2CAP_OPT_FLUSH_TIMO; - o->hdr.length = sizeof(o->val); - o->val = htole16(*(u_int16_t *)(_flush_timo)); - - (_m)->m_pkthdr.len += sizeof(*o); - p += sizeof(*o); - } - - if ((_flow) != NULL) { - struct _cfg_opt_flow { - l2cap_cfg_opt_t hdr; - l2cap_flow_t val; - } __attribute__ ((packed)) *o = NULL; - - o = (struct _cfg_opt_flow *) p; - o->hdr.type = L2CAP_OPT_QOS; - o->hdr.length = sizeof(o->val); - o->val.flags = ((l2cap_flow_p)(_flow))->flags; - o->val.service_type = ((l2cap_flow_p) (_flow))->service_type; - o->val.token_rate = htole32(((l2cap_flow_p)(_flow))->token_rate); - o->val.token_bucket_size = htole32(((l2cap_flow_p) (_flow))->token_bucket_size); - o->val.peak_bandwidth = htole32(((l2cap_flow_p) (_flow))->peak_bandwidth); - o->val.latency = htole32(((l2cap_flow_p) (_flow))->latency); - o->val.delay_variation = htole32(((l2cap_flow_p) (_flow))->delay_variation); - - (_m)->m_pkthdr.len += sizeof(*o); - } - - (_m)->m_len = (_m)->m_pkthdr.len; + return NULL; } -*/ +