| /****************************************************************************** |
| *(C) Copyright 2014 Marvell International Ltd. |
| * All Rights Reserved |
| ******************************************************************************/ |
| /* ------------------------------------------------------------------------------------------------------------------- |
| * |
| * Filename: mbim_ubus.h |
| * |
| * Authors: Boaz Sommer |
| * |
| * Description: mbim interface to ubus |
| * |
| * HISTORY: |
| * Nov 23, 2014 - Initial Version |
| * |
| * Notes: |
| * |
| ******************************************************************************/ |
| #ifndef MBIM_UBUS_H |
| #define MBIM_UBUS_H |
| |
| #include <libubox/ustream.h> |
| #include <libubus.h> |
| |
| |
| #define MbimSendToRil(a) Mbim_uBusSendToRil(a) |
| #define MbimSendToCm(a) Mbim_uBusSendToCM(a) |
| #define MbimSendAT(a,b) Mbim_uBusSendAT(a,b) |
| #define MbimEnableRilNotifications(a) Mbim_uBusSubscribeEvents(a) |
| |
| #define MBIM_COMMON_AT_SET 1 |
| #define MBIM_COMMON_AT_GET 2 |
| |
| |
| typedef struct _mbimUbusDbS |
| { |
| struct ubus_context *ctx; |
| struct ubus_subscriber ind_event; |
| char ind_enabled; |
| pthread_t tid; |
| uint32_t id; |
| uint32_t cm_id; |
| }mbimUbusDbS; |
| |
| |
| typedef struct _MBIMRequest_S |
| { |
| unsigned int cmdid; |
| unsigned int errcode; |
| void *data; |
| int dataLen; |
| } MBIMRequest_S; |
| |
| |
| int Mbim_uBusInit (void); |
| int Mbim_uBusDeinit (void); |
| |
| int Mbim_uBusSendToRil (MbimRilRequestS *req); |
| int Mbim_uBusSendToCM (MbimCmRequestS *cm_req); |
| int Mbim_uBusSendAT (char *atcmd, void *req); |
| |
| void Mbim_uBusUloopRun (void); |
| void Mbim_uBusFdAdd (int fd); |
| int Mbim_uBusSubscribeEvents(char isSubscribe); |
| |
| #endif //MBIM_UBUS_H |
| |