1c15ecd98SOliver Ruiz Dorantes /* 2c15ecd98SOliver Ruiz Dorantes * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com 3c15ecd98SOliver Ruiz Dorantes * All rights reserved. Distributed under the terms of the MIT License. 4c15ecd98SOliver Ruiz Dorantes * 5c15ecd98SOliver Ruiz Dorantes */ 6c15ecd98SOliver Ruiz Dorantes 7c15ecd98SOliver Ruiz Dorantes /*- 8c15ecd98SOliver Ruiz Dorantes * Copyright (c) Maksim Yevmenkin <m_evmenkin@yahoo.com> 9c15ecd98SOliver Ruiz Dorantes * All rights reserved. 10c15ecd98SOliver Ruiz Dorantes * 11c15ecd98SOliver Ruiz Dorantes * Redistribution and use in source and binary forms, with or without 12c15ecd98SOliver Ruiz Dorantes * modification, are permitted provided that the following conditions 13c15ecd98SOliver Ruiz Dorantes * are met: 14c15ecd98SOliver Ruiz Dorantes * 1. Redistributions of source code must retain the above copyright 15c15ecd98SOliver Ruiz Dorantes * notice, this list of conditions and the following disclaimer. 16c15ecd98SOliver Ruiz Dorantes * 2. Redistributions in binary form must reproduce the above copyright 17c15ecd98SOliver Ruiz Dorantes * notice, this list of conditions and the following disclaimer in the 18c15ecd98SOliver Ruiz Dorantes * documentation and/or other materials provided with the distribution. 19c15ecd98SOliver Ruiz Dorantes */ 20c15ecd98SOliver Ruiz Dorantes 213e248012SOliver Ruiz Dorantes #include <net_datalink.h> 223e248012SOliver Ruiz Dorantes #include <net_protocol.h> 233e248012SOliver Ruiz Dorantes #include <net_stack.h> 243e248012SOliver Ruiz Dorantes #include <NetBufferUtilities.h> 253e248012SOliver Ruiz Dorantes 263e248012SOliver Ruiz Dorantes #include <KernelExport.h> 273e248012SOliver Ruiz Dorantes #include <util/list.h> 28b9b8d43cSOliver Ruiz Dorantes #include <util/DoublyLinkedList.h> 293e248012SOliver Ruiz Dorantes 303e248012SOliver Ruiz Dorantes #include <new> 313e248012SOliver Ruiz Dorantes #include <stdlib.h> 323e248012SOliver Ruiz Dorantes #include <string.h> 333e248012SOliver Ruiz Dorantes 34c61dc72fSOliver Ruiz Dorantes #include "l2cap_address.h" 35b9b8d43cSOliver Ruiz Dorantes #include "l2cap_internal.h" 36b9b8d43cSOliver Ruiz Dorantes #include "l2cap_lower.h" 37b9b8d43cSOliver Ruiz Dorantes #include "L2capEndpoint.h" 38c61dc72fSOliver Ruiz Dorantes 39b9b8d43cSOliver Ruiz Dorantes #include <bluetooth/HCI/btHCI_acl.h> 40b9b8d43cSOliver Ruiz Dorantes #include <btModules.h> 41c61dc72fSOliver Ruiz Dorantes 42c61dc72fSOliver Ruiz Dorantes #define BT_DEBUG_THIS_MODULE 43b9b8d43cSOliver Ruiz Dorantes #define SUBMODULE_NAME "L2cap" 44b9b8d43cSOliver Ruiz Dorantes #define SUBMODULE_COLOR 32 453e248012SOliver Ruiz Dorantes #include <btDebug.h> 463e248012SOliver Ruiz Dorantes 473e248012SOliver Ruiz Dorantes 48c61dc72fSOliver Ruiz Dorantes typedef NetBufferField<uint16, offsetof(hci_acl_header, alen)> AclLenField; 49b9b8d43cSOliver Ruiz Dorantes DoublyLinkedList<L2capEndpoint> EndpointList; 503e248012SOliver Ruiz Dorantes 51c61dc72fSOliver Ruiz Dorantes extern net_protocol_module_info gL2CAPModule; 52c61dc72fSOliver Ruiz Dorantes 53b9b8d43cSOliver Ruiz Dorantes // module references 54b9b8d43cSOliver Ruiz Dorantes bluetooth_core_data_module_info* btCoreData; 557cc7cadaSOliver Ruiz Dorantes 563e248012SOliver Ruiz Dorantes net_buffer_module_info* gBufferModule; 577cc7cadaSOliver Ruiz Dorantes net_stack_module_info* gStackModule; 58b9b8d43cSOliver Ruiz Dorantes net_socket_module_info* gSocketModule; 593e248012SOliver Ruiz Dorantes 60c61dc72fSOliver Ruiz Dorantes static struct net_domain* sDomain; 613e248012SOliver Ruiz Dorantes 623e248012SOliver Ruiz Dorantes net_protocol* 633e248012SOliver Ruiz Dorantes l2cap_init_protocol(net_socket* socket) 643e248012SOliver Ruiz Dorantes { 65b9b8d43cSOliver Ruiz Dorantes L2capEndpoint* protocol = new(std::nothrow) L2capEndpoint(socket); 663e248012SOliver Ruiz Dorantes if (protocol == NULL) 673e248012SOliver Ruiz Dorantes return NULL; 683e248012SOliver Ruiz Dorantes 69b9b8d43cSOliver Ruiz Dorantes EndpointList.Add(protocol); 70a5bf1237SOliver Ruiz Dorantes debugf("Prococol created %p\n", protocol); 71b9b8d43cSOliver Ruiz Dorantes 723e248012SOliver Ruiz Dorantes return protocol; 733e248012SOliver Ruiz Dorantes } 743e248012SOliver Ruiz Dorantes 753e248012SOliver Ruiz Dorantes 763e248012SOliver Ruiz Dorantes status_t 773e248012SOliver Ruiz Dorantes l2cap_uninit_protocol(net_protocol* protocol) 783e248012SOliver Ruiz Dorantes { 79c61dc72fSOliver Ruiz Dorantes flowf("\n"); 80c61dc72fSOliver Ruiz Dorantes 8131f87630SOliver Ruiz Dorantes L2capEndpoint* endpoint = static_cast<L2capEndpoint*>(protocol); 82b9b8d43cSOliver Ruiz Dorantes 8331f87630SOliver Ruiz Dorantes // TODO: Some more checkins / uninit 8431f87630SOliver Ruiz Dorantes EndpointList.Remove(endpoint); 8531f87630SOliver Ruiz Dorantes 8631f87630SOliver Ruiz Dorantes delete endpoint; 8731f87630SOliver Ruiz Dorantes 883e248012SOliver Ruiz Dorantes return B_OK; 893e248012SOliver Ruiz Dorantes } 903e248012SOliver Ruiz Dorantes 913e248012SOliver Ruiz Dorantes 923e248012SOliver Ruiz Dorantes status_t 933e248012SOliver Ruiz Dorantes l2cap_open(net_protocol* protocol) 943e248012SOliver Ruiz Dorantes { 95c61dc72fSOliver Ruiz Dorantes flowf("\n"); 96c61dc72fSOliver Ruiz Dorantes 973e248012SOliver Ruiz Dorantes return B_OK; 983e248012SOliver Ruiz Dorantes } 993e248012SOliver Ruiz Dorantes 1003e248012SOliver Ruiz Dorantes 1013e248012SOliver Ruiz Dorantes status_t 1023e248012SOliver Ruiz Dorantes l2cap_close(net_protocol* protocol) 1033e248012SOliver Ruiz Dorantes { 104c61dc72fSOliver Ruiz Dorantes flowf("\n"); 105c61dc72fSOliver Ruiz Dorantes 1063e248012SOliver Ruiz Dorantes return B_OK; 1073e248012SOliver Ruiz Dorantes } 1083e248012SOliver Ruiz Dorantes 1093e248012SOliver Ruiz Dorantes 1103e248012SOliver Ruiz Dorantes status_t 1113e248012SOliver Ruiz Dorantes l2cap_free(net_protocol* protocol) 1123e248012SOliver Ruiz Dorantes { 113c61dc72fSOliver Ruiz Dorantes flowf("\n"); 114c61dc72fSOliver Ruiz Dorantes 1153e248012SOliver Ruiz Dorantes return B_OK; 1163e248012SOliver Ruiz Dorantes } 1173e248012SOliver Ruiz Dorantes 1183e248012SOliver Ruiz Dorantes 1193e248012SOliver Ruiz Dorantes status_t 1203e248012SOliver Ruiz Dorantes l2cap_connect(net_protocol* protocol, const struct sockaddr* address) 1213e248012SOliver Ruiz Dorantes { 122a5bf1237SOliver Ruiz Dorantes debugf("from %p, with %p\n", protocol, address); 123c61dc72fSOliver Ruiz Dorantes 124a5bf1237SOliver Ruiz Dorantes if (address == NULL) 125a5bf1237SOliver Ruiz Dorantes return EINVAL; 126a5bf1237SOliver Ruiz Dorantes 127a5bf1237SOliver Ruiz Dorantes if (address->sa_family != AF_BLUETOOTH) 128a5bf1237SOliver Ruiz Dorantes return EAFNOSUPPORT; 129a5bf1237SOliver Ruiz Dorantes 130a5bf1237SOliver Ruiz Dorantes 131a5bf1237SOliver Ruiz Dorantes return ((L2capEndpoint*)protocol)->Connect(address);; 1323e248012SOliver Ruiz Dorantes } 1333e248012SOliver Ruiz Dorantes 1343e248012SOliver Ruiz Dorantes 1353e248012SOliver Ruiz Dorantes status_t 1363e248012SOliver Ruiz Dorantes l2cap_accept(net_protocol* protocol, struct net_socket** _acceptedSocket) 1373e248012SOliver Ruiz Dorantes { 138a58b3b32SOliver Ruiz Dorantes return ((L2capEndpoint*)protocol)->Accept(_acceptedSocket); 1393e248012SOliver Ruiz Dorantes } 1403e248012SOliver Ruiz Dorantes 1413e248012SOliver Ruiz Dorantes 1423e248012SOliver Ruiz Dorantes status_t 1433e248012SOliver Ruiz Dorantes l2cap_control(net_protocol* protocol, int level, int option, void* value, 1443e248012SOliver Ruiz Dorantes size_t* _length) 1453e248012SOliver Ruiz Dorantes { 146c61dc72fSOliver Ruiz Dorantes flowf("\n"); 147c61dc72fSOliver Ruiz Dorantes 148a5bf1237SOliver Ruiz Dorantes return EOPNOTSUPP; 1493e248012SOliver Ruiz Dorantes } 1503e248012SOliver Ruiz Dorantes 1513e248012SOliver Ruiz Dorantes 1523e248012SOliver Ruiz Dorantes status_t 1533e248012SOliver Ruiz Dorantes l2cap_getsockopt(net_protocol* protocol, int level, int option, 1543e248012SOliver Ruiz Dorantes void* value, int* length) 1553e248012SOliver Ruiz Dorantes { 156c61dc72fSOliver Ruiz Dorantes flowf("\n"); 157c61dc72fSOliver Ruiz Dorantes 158*ef36d964SOliver Ruiz Dorantes return B_OK; 1593e248012SOliver Ruiz Dorantes } 1603e248012SOliver Ruiz Dorantes 1613e248012SOliver Ruiz Dorantes 1623e248012SOliver Ruiz Dorantes status_t 1633e248012SOliver Ruiz Dorantes l2cap_setsockopt(net_protocol* protocol, int level, int option, 1643e248012SOliver Ruiz Dorantes const void* value, int length) 1653e248012SOliver Ruiz Dorantes { 166c61dc72fSOliver Ruiz Dorantes flowf("\n"); 167c61dc72fSOliver Ruiz Dorantes 168a58b3b32SOliver Ruiz Dorantes ((L2capEndpoint*)protocol)->fConfigurationSet = true; 1697cc7cadaSOliver Ruiz Dorantes 170*ef36d964SOliver Ruiz Dorantes return B_OK; 1713e248012SOliver Ruiz Dorantes } 1723e248012SOliver Ruiz Dorantes 1733e248012SOliver Ruiz Dorantes 1743e248012SOliver Ruiz Dorantes status_t 1753e248012SOliver Ruiz Dorantes l2cap_bind(net_protocol* protocol, const struct sockaddr* address) 1763e248012SOliver Ruiz Dorantes { 177a5bf1237SOliver Ruiz Dorantes debugf("from %p, with %p\n", protocol, address); 178a5bf1237SOliver Ruiz Dorantes 179b9b8d43cSOliver Ruiz Dorantes return ((L2capEndpoint*)protocol)->Bind(address); 1803e248012SOliver Ruiz Dorantes } 1813e248012SOliver Ruiz Dorantes 1823e248012SOliver Ruiz Dorantes 1833e248012SOliver Ruiz Dorantes status_t 1843e248012SOliver Ruiz Dorantes l2cap_unbind(net_protocol* protocol, struct sockaddr* address) 1853e248012SOliver Ruiz Dorantes { 186c61dc72fSOliver Ruiz Dorantes flowf("\n"); 187c61dc72fSOliver Ruiz Dorantes 1883e248012SOliver Ruiz Dorantes return B_ERROR; 1893e248012SOliver Ruiz Dorantes } 1903e248012SOliver Ruiz Dorantes 1913e248012SOliver Ruiz Dorantes 1923e248012SOliver Ruiz Dorantes status_t 1933e248012SOliver Ruiz Dorantes l2cap_listen(net_protocol* protocol, int count) 1943e248012SOliver Ruiz Dorantes { 195b9b8d43cSOliver Ruiz Dorantes return ((L2capEndpoint*)protocol)->Listen(count); 1963e248012SOliver Ruiz Dorantes } 1973e248012SOliver Ruiz Dorantes 1983e248012SOliver Ruiz Dorantes 1993e248012SOliver Ruiz Dorantes status_t 2003e248012SOliver Ruiz Dorantes l2cap_shutdown(net_protocol* protocol, int direction) 2013e248012SOliver Ruiz Dorantes { 202c61dc72fSOliver Ruiz Dorantes flowf("\n"); 203c61dc72fSOliver Ruiz Dorantes 2043e248012SOliver Ruiz Dorantes return EOPNOTSUPP; 2053e248012SOliver Ruiz Dorantes } 2063e248012SOliver Ruiz Dorantes 2073e248012SOliver Ruiz Dorantes 2083e248012SOliver Ruiz Dorantes status_t 2093e248012SOliver Ruiz Dorantes l2cap_send_data(net_protocol* protocol, net_buffer* buffer) 2103e248012SOliver Ruiz Dorantes { 211c61dc72fSOliver Ruiz Dorantes flowf("\n"); 212c61dc72fSOliver Ruiz Dorantes 213*ef36d964SOliver Ruiz Dorantes return EOPNOTSUPP; 2143e248012SOliver Ruiz Dorantes } 2153e248012SOliver Ruiz Dorantes 2163e248012SOliver Ruiz Dorantes 2173e248012SOliver Ruiz Dorantes status_t 2183e248012SOliver Ruiz Dorantes l2cap_send_routed_data(net_protocol* protocol, struct net_route* route, 2193e248012SOliver Ruiz Dorantes net_buffer* buffer) 2203e248012SOliver Ruiz Dorantes { 221c61dc72fSOliver Ruiz Dorantes flowf("\n"); 222c61dc72fSOliver Ruiz Dorantes 223*ef36d964SOliver Ruiz Dorantes return EOPNOTSUPP; 2243e248012SOliver Ruiz Dorantes } 2253e248012SOliver Ruiz Dorantes 2263e248012SOliver Ruiz Dorantes 2273e248012SOliver Ruiz Dorantes ssize_t 2283e248012SOliver Ruiz Dorantes l2cap_send_avail(net_protocol* protocol) 2293e248012SOliver Ruiz Dorantes { 230c61dc72fSOliver Ruiz Dorantes flowf("\n"); 231c61dc72fSOliver Ruiz Dorantes 2323e248012SOliver Ruiz Dorantes return B_ERROR; 2333e248012SOliver Ruiz Dorantes } 2343e248012SOliver Ruiz Dorantes 2353e248012SOliver Ruiz Dorantes 2363e248012SOliver Ruiz Dorantes status_t 2373e248012SOliver Ruiz Dorantes l2cap_read_data(net_protocol* protocol, size_t numBytes, uint32 flags, 2383e248012SOliver Ruiz Dorantes net_buffer** _buffer) 2393e248012SOliver Ruiz Dorantes { 240c61dc72fSOliver Ruiz Dorantes flowf("\n"); 241c61dc72fSOliver Ruiz Dorantes 2427cc7cadaSOliver Ruiz Dorantes return ((L2capEndpoint*)protocol)->ReadData(numBytes, flags, _buffer); 2433e248012SOliver Ruiz Dorantes } 2443e248012SOliver Ruiz Dorantes 2453e248012SOliver Ruiz Dorantes 2463e248012SOliver Ruiz Dorantes ssize_t 2473e248012SOliver Ruiz Dorantes l2cap_read_avail(net_protocol* protocol) 2483e248012SOliver Ruiz Dorantes { 249c61dc72fSOliver Ruiz Dorantes flowf("\n"); 250c61dc72fSOliver Ruiz Dorantes 2513e248012SOliver Ruiz Dorantes return B_ERROR; 2523e248012SOliver Ruiz Dorantes } 2533e248012SOliver Ruiz Dorantes 2543e248012SOliver Ruiz Dorantes 2553e248012SOliver Ruiz Dorantes struct net_domain* 2563e248012SOliver Ruiz Dorantes l2cap_get_domain(net_protocol* protocol) 2573e248012SOliver Ruiz Dorantes { 258c61dc72fSOliver Ruiz Dorantes flowf("\n"); 259c61dc72fSOliver Ruiz Dorantes 260c61dc72fSOliver Ruiz Dorantes return sDomain; 2613e248012SOliver Ruiz Dorantes } 2623e248012SOliver Ruiz Dorantes 2633e248012SOliver Ruiz Dorantes 2643e248012SOliver Ruiz Dorantes size_t 2653e248012SOliver Ruiz Dorantes l2cap_get_mtu(net_protocol* protocol, const struct sockaddr* address) 2663e248012SOliver Ruiz Dorantes { 267c61dc72fSOliver Ruiz Dorantes flowf("\n"); 268c61dc72fSOliver Ruiz Dorantes 2693e248012SOliver Ruiz Dorantes return protocol->next->module->get_mtu(protocol->next, address); 2703e248012SOliver Ruiz Dorantes } 2713e248012SOliver Ruiz Dorantes 2723e248012SOliver Ruiz Dorantes 2733e248012SOliver Ruiz Dorantes status_t 2743e248012SOliver Ruiz Dorantes l2cap_receive_data(net_buffer* buffer) 2753e248012SOliver Ruiz Dorantes { 276b9b8d43cSOliver Ruiz Dorantes HciConnection* conn = (HciConnection*)buffer; 277b9b8d43cSOliver Ruiz Dorantes debugf("received some data, buffer length %lu\n", conn->currentRxPacket->size); 2783e248012SOliver Ruiz Dorantes 279b9b8d43cSOliver Ruiz Dorantes l2cap_receive(conn, conn->currentRxPacket); 2803e248012SOliver Ruiz Dorantes 2813e248012SOliver Ruiz Dorantes return B_OK; 2823e248012SOliver Ruiz Dorantes } 2833e248012SOliver Ruiz Dorantes 2843e248012SOliver Ruiz Dorantes 2853e248012SOliver Ruiz Dorantes status_t 2863e248012SOliver Ruiz Dorantes l2cap_error(uint32 code, net_buffer* data) 2873e248012SOliver Ruiz Dorantes { 288c61dc72fSOliver Ruiz Dorantes flowf("\n"); 289c61dc72fSOliver Ruiz Dorantes 2903e248012SOliver Ruiz Dorantes return B_ERROR; 2913e248012SOliver Ruiz Dorantes } 2923e248012SOliver Ruiz Dorantes 2933e248012SOliver Ruiz Dorantes 2943e248012SOliver Ruiz Dorantes status_t 2953e248012SOliver Ruiz Dorantes l2cap_error_reply(net_protocol* protocol, net_buffer* causedError, uint32 code, 2963e248012SOliver Ruiz Dorantes void* errorData) 2973e248012SOliver Ruiz Dorantes { 298c61dc72fSOliver Ruiz Dorantes flowf("\n"); 299c61dc72fSOliver Ruiz Dorantes 3003e248012SOliver Ruiz Dorantes return B_ERROR; 3013e248012SOliver Ruiz Dorantes } 3023e248012SOliver Ruiz Dorantes 3033e248012SOliver Ruiz Dorantes 304c61dc72fSOliver Ruiz Dorantes #if 0 305c61dc72fSOliver Ruiz Dorantes #pragma mark - 306c61dc72fSOliver Ruiz Dorantes #endif 3073e248012SOliver Ruiz Dorantes 3083e248012SOliver Ruiz Dorantes static status_t 3093e248012SOliver Ruiz Dorantes l2cap_std_ops(int32 op, ...) 3103e248012SOliver Ruiz Dorantes { 311b9b8d43cSOliver Ruiz Dorantes status_t error; 312b9b8d43cSOliver Ruiz Dorantes 313c61dc72fSOliver Ruiz Dorantes flowf("\n"); 314c61dc72fSOliver Ruiz Dorantes 3153e248012SOliver Ruiz Dorantes switch (op) { 3163e248012SOliver Ruiz Dorantes case B_MODULE_INIT: 3173e248012SOliver Ruiz Dorantes { 318a5bf1237SOliver Ruiz Dorantes error = gStackModule->register_domain_protocols(AF_BLUETOOTH, 319a5bf1237SOliver Ruiz Dorantes SOCK_STREAM, BLUETOOTH_PROTO_L2CAP, 3203e248012SOliver Ruiz Dorantes "network/protocols/l2cap/v1", 3213e248012SOliver Ruiz Dorantes NULL); 322a5bf1237SOliver Ruiz Dorantes if (error != B_OK) 323c61dc72fSOliver Ruiz Dorantes return error; 3243e248012SOliver Ruiz Dorantes 325a5bf1237SOliver Ruiz Dorantes error = gStackModule->register_domain_receiving_protocol(AF_BLUETOOTH, 326a5bf1237SOliver Ruiz Dorantes BLUETOOTH_PROTO_L2CAP, 3273e248012SOliver Ruiz Dorantes "network/protocols/l2cap/v1"); 328a5bf1237SOliver Ruiz Dorantes if (error != B_OK) 329c61dc72fSOliver Ruiz Dorantes return error; 330c61dc72fSOliver Ruiz Dorantes 3317cc7cadaSOliver Ruiz Dorantes error = gStackModule->register_domain(AF_BLUETOOTH, "l2cap", &gL2CAPModule, 332c61dc72fSOliver Ruiz Dorantes &gL2cap4AddressModule, &sDomain); 333a5bf1237SOliver Ruiz Dorantes if (error != B_OK) 334c61dc72fSOliver Ruiz Dorantes return error; 335c61dc72fSOliver Ruiz Dorantes 336b9b8d43cSOliver Ruiz Dorantes new (&EndpointList) DoublyLinkedList<L2capEndpoint>; 337b9b8d43cSOliver Ruiz Dorantes 338b9b8d43cSOliver Ruiz Dorantes error = InitializeConnectionPurgeThread(); 339c61dc72fSOliver Ruiz Dorantes 3403e248012SOliver Ruiz Dorantes return B_OK; 3413e248012SOliver Ruiz Dorantes } 3423e248012SOliver Ruiz Dorantes 3433e248012SOliver Ruiz Dorantes case B_MODULE_UNINIT: 344c61dc72fSOliver Ruiz Dorantes 345b9b8d43cSOliver Ruiz Dorantes error = QuitConnectionPurgeThread(); 3467cc7cadaSOliver Ruiz Dorantes gStackModule->unregister_domain(sDomain); 347b9b8d43cSOliver Ruiz Dorantes 3483e248012SOliver Ruiz Dorantes return B_OK; 3493e248012SOliver Ruiz Dorantes 3503e248012SOliver Ruiz Dorantes default: 3513e248012SOliver Ruiz Dorantes return B_ERROR; 3523e248012SOliver Ruiz Dorantes } 3533e248012SOliver Ruiz Dorantes } 3543e248012SOliver Ruiz Dorantes 3553e248012SOliver Ruiz Dorantes 356c61dc72fSOliver Ruiz Dorantes net_protocol_module_info gL2CAPModule = { 3573e248012SOliver Ruiz Dorantes { 358b9b8d43cSOliver Ruiz Dorantes NET_BLUETOOTH_L2CAP_NAME, 359b9b8d43cSOliver Ruiz Dorantes B_KEEP_LOADED, 3603e248012SOliver Ruiz Dorantes l2cap_std_ops 3613e248012SOliver Ruiz Dorantes }, 3623e248012SOliver Ruiz Dorantes NET_PROTOCOL_ATOMIC_MESSAGES, 3633e248012SOliver Ruiz Dorantes 3643e248012SOliver Ruiz Dorantes l2cap_init_protocol, 3653e248012SOliver Ruiz Dorantes l2cap_uninit_protocol, 3663e248012SOliver Ruiz Dorantes l2cap_open, 3673e248012SOliver Ruiz Dorantes l2cap_close, 3683e248012SOliver Ruiz Dorantes l2cap_free, 3693e248012SOliver Ruiz Dorantes l2cap_connect, 3703e248012SOliver Ruiz Dorantes l2cap_accept, 3713e248012SOliver Ruiz Dorantes l2cap_control, 3723e248012SOliver Ruiz Dorantes l2cap_getsockopt, 3733e248012SOliver Ruiz Dorantes l2cap_setsockopt, 3743e248012SOliver Ruiz Dorantes l2cap_bind, 3753e248012SOliver Ruiz Dorantes l2cap_unbind, 3763e248012SOliver Ruiz Dorantes l2cap_listen, 3773e248012SOliver Ruiz Dorantes l2cap_shutdown, 3783e248012SOliver Ruiz Dorantes l2cap_send_data, 3793e248012SOliver Ruiz Dorantes l2cap_send_routed_data, 3803e248012SOliver Ruiz Dorantes l2cap_send_avail, 3813e248012SOliver Ruiz Dorantes l2cap_read_data, 3823e248012SOliver Ruiz Dorantes l2cap_read_avail, 3833e248012SOliver Ruiz Dorantes l2cap_get_domain, 3843e248012SOliver Ruiz Dorantes l2cap_get_mtu, 3853e248012SOliver Ruiz Dorantes l2cap_receive_data, 3869871124eSAxel Dörfler NULL, // deliver_data() 3873e248012SOliver Ruiz Dorantes l2cap_error, 3883e248012SOliver Ruiz Dorantes l2cap_error_reply, 3899871124eSAxel Dörfler NULL, // add_ancillary_data() 3909871124eSAxel Dörfler NULL, // process_ancillary_data() 39178888c44SAxel Dörfler NULL, // process_ancillary_data_no_container() 3929871124eSAxel Dörfler NULL, // send_data_no_buffer() 3939871124eSAxel Dörfler NULL // read_data_no_buffer() 3943e248012SOliver Ruiz Dorantes }; 3953e248012SOliver Ruiz Dorantes 3963e248012SOliver Ruiz Dorantes module_dependency module_dependencies[] = { 3977cc7cadaSOliver Ruiz Dorantes {NET_STACK_MODULE_NAME, (module_info**)&gStackModule}, 3983e248012SOliver Ruiz Dorantes {NET_BUFFER_MODULE_NAME, (module_info**)&gBufferModule}, 399b9b8d43cSOliver Ruiz Dorantes {BT_CORE_DATA_MODULE_NAME, (module_info**)&btCoreData}, 400b9b8d43cSOliver Ruiz Dorantes {NET_SOCKET_MODULE_NAME, (module_info**)&gSocketModule}, 4013e248012SOliver Ruiz Dorantes {} 4023e248012SOliver Ruiz Dorantes }; 4033e248012SOliver Ruiz Dorantes 4043e248012SOliver Ruiz Dorantes module_info* modules[] = { 405c61dc72fSOliver Ruiz Dorantes (module_info*)&gL2CAPModule, 4063e248012SOliver Ruiz Dorantes NULL 4073e248012SOliver Ruiz Dorantes }; 408