2 * Copyright 2003-2004, Waldemar Kornewald <wkornew@gmx.net>
3 * Distributed under the terms of the MIT License.
7 #include <KernelExport.h>
8 #include <driver_settings.h>
10 #include <KPPPInterface.h>
11 #include <KPPPModule.h>
13 #include "ModemDevice.h"
16 #define MODEM_MODULE_NAME NETWORK_MODULES_ROOT "ppp/modem"
18 net_stack_module_info
*gStackModule
= NULL
;
19 net_buffer_module_info
*gBufferModule
= NULL
;
20 status_t
std_ops(int32 op
, ...);
24 add_to(KPPPInterface
& mainInterface
, KPPPInterface
*subInterface
,
25 driver_parameter
*settings
, ppp_module_key_type type
)
27 if (mainInterface
.Mode() != PPP_CLIENT_MODE
|| type
!= PPP_DEVICE_KEY_TYPE
)
33 device
= new ModemDevice(*subInterface
, settings
);
34 success
= subInterface
->SetDevice(device
);
36 device
= new ModemDevice(mainInterface
, settings
);
37 success
= mainInterface
.SetDevice(device
);
40 TRACE("Modem: add_to(): %s\n",
41 success
&& device
&& device
->InitCheck() == B_OK
? "OK" : "ERROR");
43 return success
&& device
&& device
->InitCheck() == B_OK
;
47 static ppp_module_info modem_module
= {
60 std_ops(int32 op
, ...)
64 if (get_module(NET_STACK_MODULE_NAME
,
65 (module_info
**)&gStackModule
) != B_OK
)
67 if (get_module(NET_BUFFER_MODULE_NAME
,
68 (module_info
**)&gBufferModule
) != B_OK
) {
69 put_module(NET_STACK_MODULE_NAME
);
75 put_module(NET_BUFFER_MODULE_NAME
);
76 put_module(NET_STACK_MODULE_NAME
);
88 module_info
*modules
[] = {
89 (module_info
*) &modem_module
,