2 * Copyright 2003-2004, Waldemar Kornewald <wkornew@gmx.net>
3 * Distributed under the terms of the MIT License.
6 #include <KernelExport.h>
7 #include <driver_settings.h>
8 #include <core_funcs.h>
9 #include <net_module.h>
11 #include <KPPPInterface.h>
12 #include <KPPPModule.h>
14 #include "ModemDevice.h"
17 #define MODEM_MODULE_NAME NETWORK_MODULES_ROOT "ppp/modem"
19 struct core_module_info
*core
= NULL
;
20 status_t
std_ops(int32 op
, ...);
25 add_to(KPPPInterface
& mainInterface
, KPPPInterface
*subInterface
,
26 driver_parameter
*settings
, ppp_module_key_type type
)
28 if(mainInterface
.Mode() != PPP_CLIENT_MODE
|| type
!= PPP_DEVICE_KEY_TYPE
)
34 device
= new ModemDevice(*subInterface
, settings
);
35 success
= subInterface
->SetDevice(device
);
37 device
= new ModemDevice(mainInterface
, settings
);
38 success
= mainInterface
.SetDevice(device
);
41 TRACE("Modem: add_to(): %s\n",
42 success
&& device
&& device
->InitCheck() == B_OK
? "OK" : "ERROR");
44 return success
&& device
&& device
->InitCheck() == B_OK
;
48 static ppp_module_info modem_module
= {
61 std_ops(int32 op
, ...)
65 if(get_module(NET_CORE_MODULE_NAME
, (module_info
**)&core
) != B_OK
)
70 put_module(NET_CORE_MODULE_NAME
);
82 module_info
*modules
[] = {
83 (module_info
*) &modem_module
,