mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 10:32:47 +08:00
drivers: modem: update altair modem
update Altair modem with the ALT1250 implementation Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
committed by
Xiang Xiao
parent
2b0ce033d7
commit
06c8e43df9
@@ -91,6 +91,7 @@
|
||||
#define _MMCSDIOBASE (0x3300) /* MMCSD device ioctl commands */
|
||||
#define _BLUETOOTHBASE (0x3400) /* Bluetooth ioctl commands */
|
||||
#define _PKTRADIOBASE (0x3500) /* Packet radio ioctl commands */
|
||||
#define _LTEBASE (0x3600) /* LTE device ioctl commands */
|
||||
#define _WLIOCBASE (0x8b00) /* Wireless modules ioctl network commands */
|
||||
|
||||
/* boardctl() commands share the same number space */
|
||||
@@ -593,6 +594,11 @@
|
||||
#define _PKRADIOIOCVALID(c) (_IOC_TYPE(c)==_PKTRADIOBASE)
|
||||
#define _PKRADIOIOC(nr) _IOC(_PKTRADIOBASE,nr)
|
||||
|
||||
/* LTE device ioctl definitions *********************************************/
|
||||
|
||||
#define _LTEIOCVALID(c) (_IOC_TYPE(c)==_LTEBASE)
|
||||
#define _LTEIOC(nr) _IOC(_LTEBASE,nr)
|
||||
|
||||
/* Wireless driver network ioctl definitions ********************************/
|
||||
|
||||
/* (see nuttx/include/wireless/wireless.h */
|
||||
|
||||
@@ -0,0 +1,394 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/modem/alt1250.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_MODEM_ALT1250_H
|
||||
#define __INCLUDE_NUTTX_MODEM_ALT1250_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/fs/ioctl.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/queue.h>
|
||||
#include <semaphore.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/irq.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
/* Non-standard debug that may be enabled just for testing the modem driver */
|
||||
|
||||
#ifdef CONFIG_MODEM_ALT1250_DEBUG
|
||||
# define m_err _err
|
||||
# define m_warn _warn
|
||||
# define m_info _info
|
||||
#else
|
||||
# define m_err(...)
|
||||
# define m_warn(...)
|
||||
# define m_info(...)
|
||||
#endif
|
||||
|
||||
#define ALT1250_IOC_POWER _MODEMIOC(1)
|
||||
#define ALT1250_IOC_SEND _MODEMIOC(2)
|
||||
#define ALT1250_IOC_SETEVTBUFF _MODEMIOC(3)
|
||||
#define ALT1250_IOC_EXCHGCONTAINER _MODEMIOC(4)
|
||||
|
||||
#define ALT1250_EVTBIT_RESET (1ULL << 63)
|
||||
#define ALT1250_EVTBIT_REPLY (1ULL << 62)
|
||||
|
||||
/* Number of sockets */
|
||||
|
||||
#define ALTCOM_NSOCKET 10
|
||||
|
||||
/* Macros for fcntl */
|
||||
|
||||
#define ALTCOM_GETFL 3
|
||||
#define ALTCOM_SETFL 4
|
||||
|
||||
#define ALTCOM_O_NONBLOCK 0x01
|
||||
|
||||
#define ALTCOM_FD_SETSIZE ALTCOM_NSOCKET
|
||||
|
||||
#define ALTCOM_FDSETSAFESET(s, code) \
|
||||
do { \
|
||||
if (((s) < ALTCOM_FD_SETSIZE) && ((int)(s) >= 0)) \
|
||||
{ \
|
||||
code; \
|
||||
} \
|
||||
} while(0)
|
||||
#define ALTCOM_FDSETSAFEGET(s, code) \
|
||||
(((s) < ALTCOM_FD_SETSIZE) && ((int)(s) >= 0) ? (code) : 0)
|
||||
|
||||
#define ALTCOM_FD_SET(s, set) ALTCOM_FDSETSAFESET(s, (set)->fd_bits[(s)/8] |= (1 << ((s) & 7)))
|
||||
#define ALTCOM_FD_CLR(s, set) ALTCOM_FDSETSAFESET(s, (set)->fd_bits[(s)/8] &= ~(1 << ((s) & 7)))
|
||||
#define ALTCOM_FD_ISSET(s, set) ALTCOM_FDSETSAFEGET(s, (set)->fd_bits[(s)/8] & (1 << ((s) & 7)))
|
||||
#define ALTCOM_FD_ZERO(set) memset((void*)(set), 0, sizeof(*(set)))
|
||||
|
||||
#define ALTCOM_DNS_SERVERS (4)
|
||||
#define ALTCOM_REPEVT_FLAG_SIMSTAT (1 << 0)
|
||||
#define ALTCOM_REPEVT_FLAG_LTIME (1 << 1)
|
||||
|
||||
#define ALTCOM_VERX (0)
|
||||
#define ALTCOM_VER1 (1)
|
||||
#define ALTCOM_VER4 (4)
|
||||
|
||||
#define APICMDID_UNKNOWN (0x0000)
|
||||
#define APICMDID_POWER_ON (0x0001)
|
||||
#define ALTCOM_CMDID_POWER_ON_V1 (0x0001)
|
||||
#define ALTCOM_CMDID_POWER_ON_V4 (0x0311)
|
||||
#define APICMDID_GET_VERSION (0x000C)
|
||||
#define APICMDID_GET_PHONENO (0x000D)
|
||||
#define APICMDID_GET_IMSI (0x000E)
|
||||
#define APICMDID_GET_IMEI (0x000F)
|
||||
#define APICMDID_GET_PINSET (0x0010)
|
||||
#define APICMDID_SET_PIN_LOCK (0x0011)
|
||||
#define APICMDID_SET_PIN_CODE (0x0012)
|
||||
#define APICMDID_ENTER_PIN (0x0013)
|
||||
#define APICMDID_GET_LTIME (0x0014)
|
||||
#define APICMDID_GET_OPERATOR (0x0015)
|
||||
#define APICMDID_SET_REP_EVT (0x0019)
|
||||
#define APICMDID_SET_REP_QUALITY (0x001A)
|
||||
#define APICMDID_SET_REP_CELLINFO (0x001B)
|
||||
#define APICMDID_REPORT_EVT (0x001D)
|
||||
#define APICMDID_REPORT_QUALITY (0x001E)
|
||||
#define APICMDID_REPORT_CELLINFO (0x001F)
|
||||
#define APICMDID_GET_EDRX (0x0020)
|
||||
#define APICMDID_SET_EDRX (0x0021)
|
||||
#define APICMDID_GET_PSM (0x0022)
|
||||
#define APICMDID_SET_PSM (0x0023)
|
||||
#define APICMDID_GET_CE (0x0024)
|
||||
#define APICMDID_SET_CE (0x0025)
|
||||
#define APICMDID_RADIO_ON (0x0026)
|
||||
#define APICMDID_RADIO_OFF (0x0027)
|
||||
#define APICMDID_ACTIVATE_PDN (0x0028)
|
||||
#define APICMDID_DEACTIVATE_PDN (0x0029)
|
||||
#define APICMDID_DATA_ALLOW (0x002A)
|
||||
#define APICMDID_GET_NETINFO (0x002B)
|
||||
#define APICMDID_GET_IMS_CAP (0x002C)
|
||||
#define APICMDID_SETREP_NETINFO (0x002D)
|
||||
#define APICMDID_REPORT_NETINFO (0x002E)
|
||||
#define APICMDID_REPORT_RESTART (0x002F)
|
||||
#define APICMDID_ERRINFO (0x0030)
|
||||
#define APICMDID_SET_REP_EVT_LTIME (0x0031)
|
||||
#define APICMDID_SET_REP_EVT_SIMSTATE (0x0032)
|
||||
#define APICMDID_POWER_OFF (0x0033)
|
||||
#define APICMDID_GET_SIMINFO (0x0034)
|
||||
#define APICMDID_GET_DYNAMICEDRX (0x0035)
|
||||
#define APICMDID_GET_DYNAMICPSM (0x0036)
|
||||
#define APICMDID_GET_QUALITY (0x0037)
|
||||
#define APICMDID_ACTIVATE_PDN_CANCEL (0x0038)
|
||||
#define APICMDID_FW_INJECTDELTAIMG (0x1040)
|
||||
#define APICMDID_FW_GETDELTAIMGLEN (0x1041)
|
||||
#define APICMDID_FW_EXECDELTAUPDATE (0x1042)
|
||||
#define APICMDID_FW_GETUPDATERESULT (0x1043)
|
||||
#define APICMDID_CLOGS (0x1023)
|
||||
#define APICMDID_LOGLIST (0x1024)
|
||||
#define APICMDID_LOGOPEN (0x1030)
|
||||
#define APICMDID_LOGCLOSE (0x1031)
|
||||
#define APICMDID_LOGREAD (0x1033)
|
||||
#define APICMDID_LOGREMOVE (0x1034)
|
||||
#define APICMDID_LOGLSEEK (0x1035)
|
||||
|
||||
/* dummy ID because not support V1 */
|
||||
|
||||
#define APICMDID_GET_CELLINFO (0x0039)
|
||||
#define APICMDID_GET_RAT (0x00A0)
|
||||
#define APICMDID_SET_RAT (0x00A1)
|
||||
#define APICMDID_SEND_ATCMD (0x00B0)
|
||||
#define APICMDID_URC_EVENT (0x00B2)
|
||||
|
||||
#define APICMDID_GET_VERSION_V4 (0x000B)
|
||||
#define APICMDID_GET_PHONENO_V4 (0x000C)
|
||||
#define APICMDID_GET_IMSI_V4 (0x000D)
|
||||
#define APICMDID_GET_IMEI_V4 (0x000E)
|
||||
#define APICMDID_GET_PINSET_V4 (0x000F)
|
||||
#define APICMDID_SET_PIN_LOCK_V4 (0x0010)
|
||||
#define APICMDID_SET_PIN_CODE_V4 (0x0011)
|
||||
#define APICMDID_ENTER_PIN_V4 (0x0012)
|
||||
#define APICMDID_GET_LTIME_V4 (0x0013)
|
||||
#define APICMDID_GET_OPERATOR_V4 (0x0014)
|
||||
#define APICMDID_GET_SLPMODESET_V4 (0x0015)
|
||||
#define APICMDID_SET_SLPMODESET_V4 (0x0016)
|
||||
#define APICMDID_SET_REP_NETSTAT_V4 (0x0017)
|
||||
#define APICMDID_SET_REP_EVT_V4 (0x0018)
|
||||
#define APICMDID_SET_REP_QUALITY_V4 (0x0019)
|
||||
#define APICMDID_SET_REP_CELLINFO_V4 (0x001A)
|
||||
#define APICMDID_REPORT_NETSTAT_V4 (0x001B)
|
||||
#define APICMDID_REPORT_EVT_V4 (0x001C)
|
||||
#define APICMDID_REPORT_QUALITY_V4 (0x001D)
|
||||
#define APICMDID_REPORT_CELLINFO_V4 (0x001E)
|
||||
#define APICMDID_GET_EDRX_V4 (0x001F)
|
||||
#define APICMDID_SET_EDRX_V4 (0x0020)
|
||||
#define APICMDID_GET_PSM_V4 (0x0021)
|
||||
#define APICMDID_SET_PSM_V4 (0x0022)
|
||||
#define APICMDID_GET_CELLINFO_V4 (0x0024)
|
||||
#define APICMDID_GET_QUALITY_V4 (0x0025)
|
||||
#define APICMDID_GET_SIMINFO_V4 (0x0310)
|
||||
#define APICMDID_POWER_ON_V4 (0x0311)
|
||||
#define APICMDID_RADIO_ON_V4 (0x0312)
|
||||
#define APICMDID_RADIO_OFF_V4 (0x0313)
|
||||
#define APICMDID_ACTIVATE_PDN_V4 (0x0314)
|
||||
#define APICMDID_ACTIVATE_PDN_CANCEL_V4 (0x0315)
|
||||
#define APICMDID_DEACTIVATE_PDN_V4 (0x0316)
|
||||
#define APICMDID_DATA_ALLOW_V4 (0x0317)
|
||||
#define APICMDID_GET_NETINFO_V4 (0x0318)
|
||||
#define APICMDID_GET_IMS_CAP_V4 (0x0319)
|
||||
#define APICMDID_SETREP_NETINFO_V4 (0x031A)
|
||||
#define APICMDID_REPORT_NETINFO_V4 (0x031B)
|
||||
#define APICMDID_ERRINFO_V4 (0xFFFD)
|
||||
#define APICMDID_GET_RAT_V4 (0x00A0)
|
||||
#define APICMDID_SET_RAT_V4 (0x00A1)
|
||||
#define APICMDID_SEND_ATCMD_V4 (0x0030)
|
||||
#define APICMDID_URC_EVENT_V4 (0x0032)
|
||||
#define APICMDID_FW_INJECTDELTAIMG_V4 (0x0270)
|
||||
#define APICMDID_FW_GETDELTAIMGLEN_V4 (0x0271)
|
||||
#define APICMDID_FW_EXECDELTAUPDATE_V4 (0x0272)
|
||||
#define APICMDID_FW_GETUPDATERESULT_V4 (0x0273)
|
||||
#define APICMDID_CLOGS_V4 (0x0300)
|
||||
#define APICMDID_LOGLIST_V4 (0x0301)
|
||||
#define APICMDID_LOGOPEN_V4 (0x0280)
|
||||
#define APICMDID_LOGCLOSE_V4 (0x0281)
|
||||
#define APICMDID_LOGREAD_V4 (0x0283)
|
||||
#define APICMDID_LOGREMOVE_V4 (0x0284)
|
||||
#define APICMDID_LOGLSEEK_V4 (0x0285)
|
||||
|
||||
#define APICMDID_SOCK_ACCEPT (0x0080)
|
||||
#define APICMDID_SOCK_BIND (0x0081)
|
||||
#define APICMDID_SOCK_CLOSE (0x0082)
|
||||
#define APICMDID_SOCK_CONNECT (0x0083)
|
||||
#define APICMDID_SOCK_FCNTL (0x0084)
|
||||
#define APICMDID_SOCK_GETADDRINFO (0x0085)
|
||||
#define APICMDID_SOCK_GETHOSTBYNAME (0x0086)
|
||||
#define APICMDID_SOCK_GETHOSTBYNAMER (0x0087)
|
||||
#define APICMDID_SOCK_GETSOCKNAME (0x0088)
|
||||
#define APICMDID_SOCK_GETSOCKOPT (0x0089)
|
||||
#define APICMDID_SOCK_LISTEN (0x008A)
|
||||
#define APICMDID_SOCK_RECV (0x008B)
|
||||
#define APICMDID_SOCK_RECVFROM (0x008C)
|
||||
#define APICMDID_SOCK_SELECT (0x008D)
|
||||
#define APICMDID_SOCK_SEND (0x008E)
|
||||
#define APICMDID_SOCK_SENDTO (0x008F)
|
||||
#define APICMDID_SOCK_SHUTDOWN (0x0090)
|
||||
#define APICMDID_SOCK_SOCKET (0x0091)
|
||||
#define APICMDID_SOCK_SETSOCKOPT (0x0092)
|
||||
|
||||
#define APICMDID_TLS_CONFIG_VERIFY_CALLBACK (0x0129)
|
||||
#define APICMDID_TLS_CONFIG_VERIFY_CALLBACK_V4 (0x0161)
|
||||
|
||||
#define APICMDID_SMS_INIT (0x0330)
|
||||
#define APICMDID_SMS_FIN (0x0331)
|
||||
#define APICMDID_SMS_SEND (0x0332)
|
||||
#define APICMDID_SMS_REPORT_RECV (0x0333)
|
||||
#define APICMDID_SMS_DELETE (0x0334)
|
||||
|
||||
#define ALTCOM_CMDID_ERRIND (0xFFFF)
|
||||
|
||||
#define ALTCOM_CMDID_REPLY_BIT (0x8000)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct alt_power_s
|
||||
{
|
||||
uint32_t cmdid;
|
||||
};
|
||||
|
||||
typedef struct alt_container_s
|
||||
{
|
||||
sq_entry_t node;
|
||||
int sock;
|
||||
unsigned long priv;
|
||||
uint32_t cmdid;
|
||||
uint16_t altcid;
|
||||
uint16_t alttid;
|
||||
int result;
|
||||
FAR void **inparam;
|
||||
size_t inparamlen;
|
||||
FAR void **outparam;
|
||||
size_t outparamlen;
|
||||
} alt_container_t;
|
||||
|
||||
typedef enum alt_evtbuf_state_e
|
||||
{
|
||||
ALTEVTBUF_ST_WRITABLE = 0,
|
||||
ALTEVTBUF_ST_NOTWRITABLE = 1,
|
||||
} alt_evtbuf_state_t;
|
||||
|
||||
typedef struct alt_evtbuf_inst_s
|
||||
{
|
||||
uint32_t cmdid;
|
||||
uint16_t altcid;
|
||||
FAR void **outparam;
|
||||
size_t outparamlen;
|
||||
sem_t stat_lock;
|
||||
alt_evtbuf_state_t stat;
|
||||
} alt_evtbuf_inst_t;
|
||||
|
||||
struct alt_evtbuffer_s
|
||||
{
|
||||
unsigned int ninst;
|
||||
alt_evtbuf_inst_t *inst;
|
||||
};
|
||||
|
||||
struct alt_readdata_s
|
||||
{
|
||||
uint64_t evtbitmap;
|
||||
FAR struct alt_container_s *head;
|
||||
};
|
||||
|
||||
struct alt1250_lower_s
|
||||
{
|
||||
FAR struct spi_dev_s * (*poweron)(void);
|
||||
void (*poweroff)(void);
|
||||
void (*reset)(void);
|
||||
void (*irqattach)(xcpt_t handler);
|
||||
void (*irqenable)(bool enable);
|
||||
bool (*get_sready)(void);
|
||||
void (*set_mready)(bool on);
|
||||
void (*set_wakeup)(bool on);
|
||||
};
|
||||
|
||||
struct altcom_fd_set_s
|
||||
{
|
||||
unsigned char fd_bits[(ALTCOM_FD_SETSIZE + 7) / 8];
|
||||
};
|
||||
|
||||
typedef struct altcom_fd_set_s altcom_fd_set;
|
||||
|
||||
struct alt_queue_s
|
||||
{
|
||||
sq_queue_t queue;
|
||||
sem_t lock;
|
||||
};
|
||||
|
||||
struct alt1250_dev_s
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
FAR const struct alt1250_lower_s *lower;
|
||||
sem_t refslock;
|
||||
uint8_t crefs;
|
||||
struct alt_queue_s waitlist;
|
||||
struct alt_queue_s replylist;
|
||||
uint64_t evtbitmap;
|
||||
sem_t evtmaplock;
|
||||
sem_t pfdlock;
|
||||
FAR struct pollfd *pfd;
|
||||
pthread_t recvthread;
|
||||
FAR struct alt_evtbuffer_s *evtbuff;
|
||||
uint32_t discardcnt;
|
||||
sem_t senddisablelock;
|
||||
bool senddisable;
|
||||
FAR alt_container_t *select_container;
|
||||
struct alt_evtbuf_inst_s select_inst;
|
||||
};
|
||||
|
||||
typedef int32_t (*compose_handler_t)(FAR void **arg, size_t arglen,
|
||||
uint8_t altver, FAR uint8_t *pktbuf, const size_t pktsz,
|
||||
FAR uint16_t *altcid);
|
||||
typedef int32_t (*parse_handler_t)(FAR struct alt1250_dev_s *dev,
|
||||
FAR uint8_t *pktbuf, size_t pktsz, uint8_t altver, FAR void **arg,
|
||||
size_t arglen, FAR uint64_t *bitmap);
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: alt1250_register
|
||||
*
|
||||
* Description:
|
||||
* Register the ALT1250 character device as 'devpath'.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/alt1250".
|
||||
* dev - An instance of the SPI interface to use to communicate with
|
||||
* ALT1250.
|
||||
* lower - An instance of the lower interface.
|
||||
*
|
||||
* Returned Value:
|
||||
* Not NULL on success; NULL on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR void *alt1250_register(FAR const char *devpath,
|
||||
FAR struct spi_dev_s *dev, FAR const struct alt1250_lower_s *lower);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_MODEM_ALT1250_H */
|
||||
@@ -1,151 +0,0 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/modem/altmdm.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_MODEM_ALTMDM_H
|
||||
#define __INCLUDE_NUTTX_MODEM_ALTMDM_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/fs/ioctl.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/queue.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
/* Non-standard debug that may be enabled just for testing the modem driver */
|
||||
|
||||
#ifdef CONFIG_MODEM_ALTMDM_DEBUG
|
||||
# define m_err _err
|
||||
# define m_info _info
|
||||
#else
|
||||
# define m_err(x...)
|
||||
# define m_info(x...)
|
||||
#endif
|
||||
|
||||
#define MODEM_IOC_POWERON _MODEMIOC(1)
|
||||
#define MODEM_IOC_POWEROFF _MODEMIOC(2)
|
||||
#define MODEM_IOC_READABORT _MODEMIOC(3)
|
||||
#define MODEM_IOC_SLEEP _MODEMIOC(4)
|
||||
#define MODEM_IOC_PM_REGISTERCB _MODEMIOC(5)
|
||||
#define MODEM_IOC_PM_DEREGISTERCB _MODEMIOC(6)
|
||||
#define MODEM_IOC_PM_GETSTATE _MODEMIOC(7)
|
||||
#define MODEM_IOC_PM_INITWAKELOCK _MODEMIOC(8)
|
||||
#define MODEM_IOC_PM_ACQUIREWAKELOCK _MODEMIOC(9)
|
||||
#define MODEM_IOC_PM_RELEASEWAKELOCK _MODEMIOC(10)
|
||||
#define MODEM_IOC_PM_GETNUMOFWAKELOCK _MODEMIOC(11)
|
||||
#define MODEM_IOC_PM_GETWAKELOCKSTATE _MODEMIOC(12)
|
||||
#define MODEM_IOC_PM_ERR_REGISTERCB _MODEMIOC(13)
|
||||
#define MODEM_IOC_PM_ERR_DEREGISTERCB _MODEMIOC(14)
|
||||
|
||||
#define MODEM_PM_CB_TYPE_NORMAL 0
|
||||
#define MODEM_PM_CB_TYPE_ERROR 1
|
||||
#define MODEM_PM_STATE_SLEEP 0
|
||||
#define MODEM_PM_STATE_WAKE 1
|
||||
#define MODEM_PM_ERR_RESET_BOOTSTAT_NONE 0x00
|
||||
#define MODEM_PM_ERR_RESET_BOOTSTAT_BOOTING 0x01
|
||||
#define MODEM_PM_ERR_RESET_BOOTSTAT_UPDATING 0x02
|
||||
#define MODEM_PM_ERR_RESET_BOOTSTAT_DONE 0x10
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct altmdm_pm_wakelock_s
|
||||
{
|
||||
sq_entry_t queue;
|
||||
int count;
|
||||
};
|
||||
|
||||
struct altmdm_lower_s
|
||||
{
|
||||
void (*poweron)(void);
|
||||
void (*poweroff)(void);
|
||||
void (*sready_irqattach)(bool attach, xcpt_t handler);
|
||||
void (*sready_irqenable)(bool enable);
|
||||
bool (*sready)(void);
|
||||
void (*master_request)(bool request);
|
||||
void (*wakeup)(bool wakeup);
|
||||
uint32_t (*spi_maxfreq)(void);
|
||||
};
|
||||
|
||||
typedef void (*altmdm_pm_cbfunc_t) (uint32_t state);
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: altmdm_register
|
||||
*
|
||||
* Description:
|
||||
* Register the ALTMDM character device as 'devpath'.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/altmdm".
|
||||
* dev - An instance of the SPI interface to use to communicate with
|
||||
* ALTMDM.
|
||||
* lower - An instance of the lower interface.
|
||||
*
|
||||
* Returned Value:
|
||||
* Not NULL on success; NULL on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR void *altmdm_register(FAR const char *devpath, FAR struct spi_dev_s *dev,
|
||||
FAR const struct altmdm_lower_s *lower);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: altmdm_unregister
|
||||
*
|
||||
* Description:
|
||||
* Unregister the ALTMDM character device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* handle - The pointer that getting from altmdm_register.
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void altmdm_unregister(FAR void *handle);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_MODEM_ALTMDM_H */
|
||||
@@ -0,0 +1,163 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/net/sms.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_NET_SMS_H
|
||||
#define __INCLUDE_NUTTX_NET_SMS_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define SMS_MAX_ADDRLEN 16 /* 16 characters in USC2 format: 32byte */
|
||||
#define SMS_MAX_DATALEN 670 /* 670 characters in USC2 format: 1340byte */
|
||||
|
||||
#define SMS_MSG_TYPE_DELIVER 0
|
||||
#define SMS_MSG_TYPE_STATUS_REPORT 1
|
||||
|
||||
#define SMS_STATUS_SUCCESS 0
|
||||
#define SMS_STATUS_FAILED 1
|
||||
#define SMS_STATUS_PENDING 2
|
||||
|
||||
#define SMS_CHSET_UCS2 0
|
||||
#define SMS_CHSET_GSM7 1
|
||||
#define SMS_CHSET_BINARY 2
|
||||
|
||||
#define SMS_CONCATENATE_MAX 10
|
||||
|
||||
/* Nature of Address Indicator */
|
||||
|
||||
#define SMS_NAI_UNKNOWN 0x0 /* Unknown */
|
||||
#define SMS_NAI_INTERNATIONAL 0x1 /* International number */
|
||||
#define SMS_NAI_NATIONAL 0x2 /* National number */
|
||||
#define SMS_NAI_NETWORK_SPEC 0x3 /* Network specific number */
|
||||
#define SMS_NAI_SUBSCRIBER 0x4 /* Subscriber number */
|
||||
#define SMS_NAI_ALPANUMERIC 0x5 /* Alphanumeric */
|
||||
#define SMS_NAI_ABBREVIATED 0x6 /* Abbreviated number */
|
||||
#define SMS_NAI_RESERVED 0x7 /* Reserved for extension */
|
||||
|
||||
/* Numbering Plan Indicator */
|
||||
|
||||
#define SMS_NPI_UNKNOWN 0x0 /* Unknown */
|
||||
#define SMS_NPI_ISDN 0x1 /* ISDN/telephone numbering plan */
|
||||
#define SMS_NPI_DATA 0x3 /* Data numbering plan */
|
||||
#define SMS_NPI_TELEX 0x4 /* Telex numbering plan */
|
||||
#define SMS_NPI_SERVICE_CENTRE_SPEC 0x5 /* Service Centre Specific plan 1) */
|
||||
#define SMS_NPI_SERVICE_CENTRE_SPEC2 0x6 /* Service Centre Specific plan 1) */
|
||||
#define SMS_NPI_NATIONAL 0x8 /* National numbering plan */
|
||||
#define SMS_NPI_PRIVATE 0x9 /* Private numbering plan */
|
||||
#define SMS_NPI_ERMES 0xa /* ERMES numbering plan */
|
||||
#define SMS_NPI_RESERVED 0xf /* Reserved for extension */
|
||||
|
||||
#define SMS_NAI_SHIFT(a) ((a) << 4)
|
||||
#define SMS_SET_TOA(a, p) (SMS_NAI_SHIFT(a) | (p))
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct sms_timestamp_s
|
||||
{
|
||||
unsigned char year; /* Years (0-99) */
|
||||
unsigned char mon; /* Month (1-12) */
|
||||
unsigned char mday; /* Day of the month (1-31) */
|
||||
unsigned char hour; /* Hours (0-23) */
|
||||
unsigned char min; /* Minutes (0-59) */
|
||||
unsigned char sec; /* Seconds (0-59) */
|
||||
signed char tz; /* Time zone (-24-24) */
|
||||
};
|
||||
|
||||
/* This is the data structure used when sending SMS */
|
||||
|
||||
struct sms_send_msg_header_s
|
||||
{
|
||||
unsigned char destaddrlen;
|
||||
unsigned char reserve;
|
||||
unsigned short datalen;
|
||||
unsigned short destaddr[SMS_MAX_ADDRLEN];
|
||||
};
|
||||
|
||||
struct sms_send_msg_s
|
||||
{
|
||||
struct sms_send_msg_header_s header;
|
||||
|
||||
unsigned short data[0]; /* payload data in USC2 format */
|
||||
};
|
||||
|
||||
/* This is the data structure used when receiving SMS */
|
||||
|
||||
struct sms_recv_msg_header_s
|
||||
{
|
||||
unsigned char msgtype;
|
||||
struct sms_timestamp_s send_time;
|
||||
unsigned char srcaddrlen;
|
||||
unsigned char reserve;
|
||||
unsigned short datalen;
|
||||
unsigned short srcaddr[SMS_MAX_ADDRLEN];
|
||||
};
|
||||
|
||||
struct sms_deliver_msg_s
|
||||
{
|
||||
struct sms_recv_msg_header_s header;
|
||||
|
||||
unsigned short data[0]; /* payload data in USC2 format */
|
||||
};
|
||||
|
||||
struct sms_deliver_msg_max_s
|
||||
{
|
||||
struct sms_recv_msg_header_s header;
|
||||
|
||||
unsigned short data[SMS_MAX_DATALEN]; /* payload data in USC2 format */
|
||||
};
|
||||
|
||||
struct sms_status_report_s
|
||||
{
|
||||
unsigned char refid;
|
||||
unsigned char status;
|
||||
unsigned char reserve;
|
||||
struct sms_timestamp_s discharge_time;
|
||||
};
|
||||
|
||||
struct sms_status_report_msg_s
|
||||
{
|
||||
struct sms_recv_msg_header_s header;
|
||||
|
||||
struct sms_status_report_s status_report;
|
||||
};
|
||||
|
||||
struct sms_refids_s
|
||||
{
|
||||
unsigned char nrefid;
|
||||
unsigned char refid[SMS_CONCATENATE_MAX];
|
||||
};
|
||||
|
||||
struct sms_sc_addr_s
|
||||
{
|
||||
unsigned char toa;
|
||||
unsigned char addrlen;
|
||||
unsigned short addr[SMS_MAX_ADDRLEN];
|
||||
};
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_NET_SMS_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,371 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/wireless/lte/lte_ioctl.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_WIRELESS_LTE_LTE_IOCTL_H
|
||||
#define __INCLUDE_NUTTX_WIRELESS_LTE_LTE_IOCTL_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <nuttx/wireless/wireless.h>
|
||||
#include <nuttx/net/sms.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* LTE network device IOCTL commands. */
|
||||
|
||||
/* SIOCLTECMD
|
||||
* Description: Perform LTE command
|
||||
*/
|
||||
|
||||
#define SIOCLTECMD _LTEIOC(0)
|
||||
|
||||
/* SIOCSMSENSTREP
|
||||
* Description: Enable or disable the function to confirm whether or not
|
||||
* the SMS has been delivered to the destination device.
|
||||
*/
|
||||
|
||||
#define SIOCSMSENSTREP _LTEIOC(1)
|
||||
|
||||
/* SIOCSMSGREFID
|
||||
* Description: Obtain the ID associated with the submitted SMS.
|
||||
* If the submitted SMS is a concatenated SMS, multiple IDs
|
||||
* will be obtained;
|
||||
* otherwise, a single ID will be obtained.
|
||||
*/
|
||||
|
||||
#define SIOCSMSGREFID _LTEIOC(2)
|
||||
|
||||
/* SIOCSMSSSCA
|
||||
* Description: Set the service center address of the destination.
|
||||
*/
|
||||
|
||||
#define SIOCSMSSSCA _LTEIOC(3)
|
||||
|
||||
/* for cmdid */
|
||||
|
||||
#define _CMDOPT_LSB (28)
|
||||
#define _CMDOPT_MASK (0xf << (_CMDOPT_LSB))
|
||||
#define _CMDGRP_LSB (24)
|
||||
#define _CMDGRP_MASK (0xf << (_CMDGRP_LSB))
|
||||
#define _CMDGRP_SHIFT(nr) ((nr) << (_CMDGRP_LSB))
|
||||
#define _CMDGRP_NORMAL(nr) (_CMDGRP_SHIFT(0) | (nr))
|
||||
#define _CMDGRP_EVENT(nr) (_CMDGRP_SHIFT(1) | (nr))
|
||||
#define _CMDGRP_NOMDM(nr) (_CMDGRP_SHIFT(2) | (nr))
|
||||
#define _CMDGRP_POWER(nr) (_CMDGRP_SHIFT(3) | (nr))
|
||||
#define _CMDGRP_FWUPDATE(nr) (_CMDGRP_SHIFT(4) | (nr))
|
||||
#define _CMDGRP_EXTEND(nr) (_CMDGRP_SHIFT(5) | (nr))
|
||||
#define _CMDGRP_LWM2M(nr) (_CMDGRP_SHIFT(6) | (nr))
|
||||
#define LTE_CMDOPT_ASYNC_BIT (0x1 << (_CMDOPT_LSB))
|
||||
#define LTE_IS_ASYNC_CMD(cid) ((cid) & LTE_CMDOPT_ASYNC_BIT)
|
||||
#define LTE_PURE_CMDID(cid) ((cid) & ~LTE_CMDOPT_ASYNC_BIT)
|
||||
#define LTE_ISCMDGRP_NORMAL(cmd) ((cmd & _CMDGRP_MASK) == _CMDGRP_NORMAL(0))
|
||||
#define LTE_ISCMDGRP_EVENT(cmd) ((cmd & _CMDGRP_MASK) == _CMDGRP_EVENT(0))
|
||||
#define LTE_ISCMDGRP_NOMDM(cmd) ((cmd & _CMDGRP_MASK) == _CMDGRP_NOMDM(0))
|
||||
#define LTE_ISCMDGRP_POWER(cmd) ((cmd & _CMDGRP_MASK) == _CMDGRP_POWER(0))
|
||||
#define LTE_ISCMDGRP_FWUPDATE(cmd) ((cmd & _CMDGRP_MASK) == _CMDGRP_FWUPDATE(0))
|
||||
#define LTE_ISCMDGRP_EXTEND(cmd) ((cmd & _CMDGRP_MASK) == _CMDGRP_EXTEND(0))
|
||||
#define LTE_ISCMDGRP_LWM2M(cmd) ((cmd & _CMDGRP_MASK) == _CMDGRP_LWM2M(0))
|
||||
|
||||
#define LTE_CMDID_POWERON _CMDGRP_POWER(0x00)
|
||||
#define LTE_CMDID_POWEROFF _CMDGRP_POWER(0x01)
|
||||
#define LTE_CMDID_FIN _CMDGRP_POWER(0x02)
|
||||
#define LTE_CMDID_SETEVTCTX _CMDGRP_NOMDM(0x03)
|
||||
#define LTE_CMDID_SETRESTART _CMDGRP_NOMDM(0x04)
|
||||
#define LTE_CMDID_GETERRINFO _CMDGRP_NOMDM(0x05)
|
||||
#define LTE_CMDID_GETVER _CMDGRP_NORMAL(0x06)
|
||||
#define LTE_CMDID_RADIOON _CMDGRP_NORMAL(0x07)
|
||||
#define LTE_CMDID_RADIOOFF _CMDGRP_NORMAL(0x08)
|
||||
#define LTE_CMDID_ACTPDN _CMDGRP_NORMAL(0x09)
|
||||
#define LTE_CMDID_ACTPDNCAN _CMDGRP_NORMAL(0x0a)
|
||||
#define LTE_CMDID_DEACTPDN _CMDGRP_NORMAL(0x0b)
|
||||
#define LTE_CMDID_GETNETINFO _CMDGRP_NORMAL(0x0c)
|
||||
#define LTE_CMDID_IMSCAP _CMDGRP_NORMAL(0x0d)
|
||||
#define LTE_CMDID_GETPHONE _CMDGRP_NORMAL(0x0e)
|
||||
#define LTE_CMDID_GETIMSI _CMDGRP_NORMAL(0x0f)
|
||||
#define LTE_CMDID_GETIMEI _CMDGRP_NORMAL(0x10)
|
||||
#define LTE_CMDID_GETPINSET _CMDGRP_NORMAL(0x11)
|
||||
#define LTE_CMDID_PINENABLE _CMDGRP_NORMAL(0x12)
|
||||
#define LTE_CMDID_CHANGEPIN _CMDGRP_NORMAL(0x13)
|
||||
#define LTE_CMDID_ENTERPIN _CMDGRP_NORMAL(0x14)
|
||||
#define LTE_CMDID_GETLTIME _CMDGRP_NORMAL(0x15)
|
||||
#define LTE_CMDID_GETOPER _CMDGRP_NORMAL(0x16)
|
||||
#define LTE_CMDID_GETEDRX _CMDGRP_NORMAL(0x17)
|
||||
#define LTE_CMDID_SETEDRX _CMDGRP_NORMAL(0x18)
|
||||
#define LTE_CMDID_GETPSM _CMDGRP_NORMAL(0x19)
|
||||
#define LTE_CMDID_SETPSM _CMDGRP_NORMAL(0x1a)
|
||||
#define LTE_CMDID_GETCE _CMDGRP_NORMAL(0x1b)
|
||||
#define LTE_CMDID_SETCE _CMDGRP_NORMAL(0x1c)
|
||||
#define LTE_CMDID_GETSIMINFO _CMDGRP_NORMAL(0x1d)
|
||||
#define LTE_CMDID_GETCEDRX _CMDGRP_NORMAL(0x1e)
|
||||
#define LTE_CMDID_GETCPSM _CMDGRP_NORMAL(0x1f)
|
||||
#define LTE_CMDID_GETQUAL _CMDGRP_NORMAL(0x20)
|
||||
#define LTE_CMDID_GETCELL _CMDGRP_NORMAL(0x21)
|
||||
#define LTE_CMDID_GETRAT _CMDGRP_NORMAL(0x22)
|
||||
#define LTE_CMDID_SETRAT _CMDGRP_NORMAL(0x23)
|
||||
#define LTE_CMDID_GETRATINFO _CMDGRP_NORMAL(0x24)
|
||||
#define LTE_CMDID_REPNETINFO _CMDGRP_EVENT(0x25)
|
||||
#define LTE_CMDID_REPSIMSTAT _CMDGRP_EVENT(0x26)
|
||||
#define LTE_CMDID_REPLTIME _CMDGRP_EVENT(0x27)
|
||||
#define LTE_CMDID_REPQUAL _CMDGRP_EVENT(0x28)
|
||||
#define LTE_CMDID_REPCELL _CMDGRP_EVENT(0x29)
|
||||
#define LTE_CMDID_SAVEAPN _CMDGRP_NOMDM(0x2a)
|
||||
#define LTE_CMDID_GETAPN _CMDGRP_NOMDM(0x2b)
|
||||
#define LTE_CMDID_TAKEWLOCK _CMDGRP_POWER(0x2c)
|
||||
#define LTE_CMDID_GIVEWLOCK _CMDGRP_POWER(0x2d)
|
||||
#define LTE_CMDID_SENDATCMD _CMDGRP_NORMAL(0x2e)
|
||||
#define LTE_CMDID_INJECTIMAGE _CMDGRP_FWUPDATE(0x2f)
|
||||
#define LTE_CMDID_GETIMAGELEN _CMDGRP_FWUPDATE(0x30)
|
||||
#define LTE_CMDID_EXEUPDATE _CMDGRP_FWUPDATE(0x31)
|
||||
#define LTE_CMDID_GETUPDATERES _CMDGRP_NORMAL(0x32)
|
||||
#define LTE_CMDID_FACTORY_RESET _CMDGRP_EXTEND(0x33)
|
||||
#define LTE_CMDID_SAVE_LOG _CMDGRP_NORMAL(0x34)
|
||||
#define LTE_CMDID_GET_LOGLIST _CMDGRP_NORMAL(0x35)
|
||||
#define LTE_CMDID_LOGOPEN _CMDGRP_NORMAL(0x36)
|
||||
#define LTE_CMDID_LOGCLOSE _CMDGRP_NORMAL(0x37)
|
||||
#define LTE_CMDID_LOGREAD _CMDGRP_NORMAL(0x38)
|
||||
#define LTE_CMDID_LOGLSEEK _CMDGRP_NORMAL(0x39)
|
||||
#define LTE_CMDID_LOGREMOVE _CMDGRP_NORMAL(0x3a)
|
||||
|
||||
#define LTE_CMDID_ACCEPT _CMDGRP_NORMAL(0x50)
|
||||
#define LTE_CMDID_BIND _CMDGRP_NORMAL(0x51)
|
||||
#define LTE_CMDID_CLOSE _CMDGRP_NORMAL(0x52)
|
||||
#define LTE_CMDID_CONNECT _CMDGRP_NORMAL(0x53)
|
||||
#define LTE_CMDID_FCNTL _CMDGRP_NORMAL(0x54)
|
||||
#define LTE_CMDID_GETADDRINFO _CMDGRP_NORMAL(0x55)
|
||||
#define LTE_CMDID_GETHOSTBYNAME _CMDGRP_NORMAL(0x56)
|
||||
#define LTE_CMDID_GETHOSTBYNAMER _CMDGRP_NORMAL(0x57)
|
||||
#define LTE_CMDID_GETSOCKNAME _CMDGRP_NORMAL(0x58)
|
||||
#define LTE_CMDID_GETSOCKOPT _CMDGRP_NORMAL(0x59)
|
||||
#define LTE_CMDID_LISTEN _CMDGRP_NORMAL(0x5a)
|
||||
#define LTE_CMDID_RECV _CMDGRP_NORMAL(0x5b)
|
||||
#define LTE_CMDID_RECVFROM _CMDGRP_NORMAL(0x5c)
|
||||
#define LTE_CMDID_SELECT _CMDGRP_NORMAL(0x5d)
|
||||
#define LTE_CMDID_SEND _CMDGRP_NORMAL(0x5e)
|
||||
#define LTE_CMDID_SENDTO _CMDGRP_NORMAL(0x5f)
|
||||
#define LTE_CMDID_SHUTDOWN _CMDGRP_NORMAL(0x60)
|
||||
#define LTE_CMDID_SOCKET _CMDGRP_NORMAL(0x61)
|
||||
#define LTE_CMDID_SETSOCKOPT _CMDGRP_NORMAL(0x62)
|
||||
|
||||
#define LTE_CMDID_SMS_INIT _CMDGRP_NORMAL(0x65)
|
||||
#define LTE_CMDID_SMS_FIN _CMDGRP_NORMAL(0x66)
|
||||
#define LTE_CMDID_SMS_SEND _CMDGRP_NORMAL(0x67)
|
||||
#define LTE_CMDID_SMS_DELETE _CMDGRP_NORMAL(0x68)
|
||||
#define LTE_CMDID_SMS_REPORT_RECV _CMDGRP_EVENT(0x69)
|
||||
|
||||
#define LTE_CMDID_TLS_SSL_INIT _CMDGRP_NORMAL(0x80)
|
||||
#define LTE_CMDID_TLS_SSL_FREE _CMDGRP_NORMAL(0x81)
|
||||
#define LTE_CMDID_TLS_SSL_SETUP _CMDGRP_NORMAL(0x82)
|
||||
#define LTE_CMDID_TLS_SSL_HOSTNAME _CMDGRP_NORMAL(0x83)
|
||||
#define LTE_CMDID_TLS_SSL_BIO _CMDGRP_NORMAL(0x84)
|
||||
#define LTE_CMDID_TLS_SSL_HANDSHAKE _CMDGRP_NORMAL(0x85)
|
||||
#define LTE_CMDID_TLS_SSL_WRITE _CMDGRP_NORMAL(0x86)
|
||||
#define LTE_CMDID_TLS_SSL_READ _CMDGRP_NORMAL(0x87)
|
||||
#define LTE_CMDID_TLS_SSL_CLOSE_NOTIFY _CMDGRP_NORMAL(0x88)
|
||||
#define LTE_CMDID_TLS_SSL_VERSION _CMDGRP_NORMAL(0x89)
|
||||
#define LTE_CMDID_TLS_SSL_CIPHERSUITE _CMDGRP_NORMAL(0x8a)
|
||||
#define LTE_CMDID_TLS_SSL_CIPHERSUITE_ID _CMDGRP_NORMAL(0x8b)
|
||||
#define LTE_CMDID_TLS_SSL_RECORD_EXPANSION _CMDGRP_NORMAL(0x8c)
|
||||
#define LTE_CMDID_TLS_SSL_VERIFY_RESULT _CMDGRP_NORMAL(0x8d)
|
||||
#define LTE_CMDID_TLS_SSL_TIMER_CB _CMDGRP_NORMAL(0x8e)
|
||||
#define LTE_CMDID_TLS_SSL_PEER_CERT _CMDGRP_NORMAL(0x8f)
|
||||
#define LTE_CMDID_TLS_SSL_BYTES_AVAIL _CMDGRP_NORMAL(0x90)
|
||||
#define LTE_CMDID_TLS_CONFIG_INIT _CMDGRP_NORMAL(0x91)
|
||||
#define LTE_CMDID_TLS_CONFIG_FREE _CMDGRP_NORMAL(0x92)
|
||||
#define LTE_CMDID_TLS_CONFIG_DEFAULTS _CMDGRP_NORMAL(0x93)
|
||||
#define LTE_CMDID_TLS_CONFIG_AUTHMODE _CMDGRP_NORMAL(0x94)
|
||||
#define LTE_CMDID_TLS_CONFIG_RNG _CMDGRP_NORMAL(0x95)
|
||||
#define LTE_CMDID_TLS_CONFIG_CA_CHAIN _CMDGRP_NORMAL(0x96)
|
||||
#define LTE_CMDID_TLS_CONFIG_OWN_CERT _CMDGRP_NORMAL(0x97)
|
||||
#define LTE_CMDID_TLS_CONFIG_READ_TIMEOUT _CMDGRP_NORMAL(0x98)
|
||||
#define LTE_CMDID_TLS_CONFIG_VERIFY _CMDGRP_EVENT(0x99)
|
||||
#define LTE_CMDID_TLS_CONFIG_VERIFY_CALLBACK _CMDGRP_NORMAL(0x9a)
|
||||
#define LTE_CMDID_TLS_CONFIG_ALPN_PROTOCOLS _CMDGRP_NORMAL(0x9b)
|
||||
#define LTE_CMDID_TLS_CONFIG_CIPHERSUITES _CMDGRP_NORMAL(0x9c)
|
||||
#define LTE_CMDID_TLS_SESSION_INIT _CMDGRP_NORMAL(0x9d)
|
||||
#define LTE_CMDID_TLS_SESSION_FREE _CMDGRP_NORMAL(0x9e)
|
||||
#define LTE_CMDID_TLS_SESSION_GET _CMDGRP_NORMAL(0x9f)
|
||||
#define LTE_CMDID_TLS_SESSION_SET _CMDGRP_NORMAL(0xa0)
|
||||
#define LTE_CMDID_TLS_SESSION_RESET _CMDGRP_NORMAL(0xa1)
|
||||
#define LTE_CMDID_TLS_X509_CRT_INIT _CMDGRP_NORMAL(0xa2)
|
||||
#define LTE_CMDID_TLS_X509_CRT_FREE _CMDGRP_NORMAL(0xa3)
|
||||
#define LTE_CMDID_TLS_X509_CRT_PARSE_FILE _CMDGRP_NORMAL(0xa4)
|
||||
#define LTE_CMDID_TLS_X509_CRT_PARSE_DER _CMDGRP_NORMAL(0xa5)
|
||||
#define LTE_CMDID_TLS_X509_CRT_PARSE _CMDGRP_NORMAL(0xa6)
|
||||
#define LTE_CMDID_TLS_X509_CRT_INFO _CMDGRP_NORMAL(0xa7)
|
||||
#define LTE_CMDID_TLS_X509_CRT_VERIFY_INFO _CMDGRP_NORMAL(0xa8)
|
||||
#define LTE_CMDID_TLS_PK_INIT _CMDGRP_NORMAL(0xa9)
|
||||
#define LTE_CMDID_TLS_PK_FREE _CMDGRP_NORMAL(0xaa)
|
||||
#define LTE_CMDID_TLS_PK_PARSE_KEYFILE _CMDGRP_NORMAL(0xab)
|
||||
#define LTE_CMDID_TLS_PK_PARSE_KEY _CMDGRP_NORMAL(0xac)
|
||||
#define LTE_CMDID_TLS_PK_CHECK_PAIR _CMDGRP_NORMAL(0xad)
|
||||
#define LTE_CMDID_TLS_PK_SETUP _CMDGRP_NORMAL(0xae)
|
||||
#define LTE_CMDID_TLS_PK_INFO_FROM_TYPE _CMDGRP_NORMAL(0xaf)
|
||||
#define LTE_CMDID_TLS_PK_WRITE_KEY_PEM _CMDGRP_NORMAL(0xb0)
|
||||
#define LTE_CMDID_TLS_PK_WRITE_KEY_DER _CMDGRP_NORMAL(0xb1)
|
||||
#define LTE_CMDID_TLS_PK_RSA _CMDGRP_NORMAL(0xb2)
|
||||
#define LTE_CMDID_TLS_CTR_DRBG_INIT _CMDGRP_NORMAL(0xb3)
|
||||
#define LTE_CMDID_TLS_CTR_DRBG_FREE _CMDGRP_NORMAL(0xb4)
|
||||
#define LTE_CMDID_TLS_CTR_DRBG_SEED _CMDGRP_NORMAL(0xb5)
|
||||
#define LTE_CMDID_TLS_ENTROPY_INIT _CMDGRP_NORMAL(0xb6)
|
||||
#define LTE_CMDID_TLS_ENTROPY_FREE _CMDGRP_NORMAL(0xb7)
|
||||
#define LTE_CMDID_TLS_CIPHER_INIT _CMDGRP_NORMAL(0xb8)
|
||||
#define LTE_CMDID_TLS_CIPHER_FREE _CMDGRP_NORMAL(0xb9)
|
||||
#define LTE_CMDID_TLS_CIPHER_INFO_FROM_STRING _CMDGRP_NORMAL(0xba)
|
||||
#define LTE_CMDID_TLS_CIPHER_SETUP _CMDGRP_NORMAL(0xbb)
|
||||
#define LTE_CMDID_TLS_CIPHER_SETKEY _CMDGRP_NORMAL(0xbc)
|
||||
#define LTE_CMDID_TLS_CIPHER_SET_IV _CMDGRP_NORMAL(0xbd)
|
||||
#define LTE_CMDID_TLS_CIPHER_UPDATE _CMDGRP_NORMAL(0xbe)
|
||||
#define LTE_CMDID_TLS_MD_INFO_FROM_TYPE _CMDGRP_NORMAL(0xbf)
|
||||
#define LTE_CMDID_TLS_MD_GET_SIZE _CMDGRP_NORMAL(0xc0)
|
||||
#define LTE_CMDID_TLS_MD _CMDGRP_NORMAL(0xc1)
|
||||
#define LTE_CMDID_TLS_MD_DIGEST _CMDGRP_NORMAL(0xc2)
|
||||
#define LTE_CMDID_TLS_BASE64_ENCODE _CMDGRP_NORMAL(0xc3)
|
||||
#define LTE_CMDID_TLS_SHA1 _CMDGRP_NORMAL(0xc4)
|
||||
#define LTE_CMDID_TLS_SSL_EXPORT_SRTP_KEYS _CMDGRP_NORMAL(0xc5)
|
||||
#define LTE_CMDID_TLS_SSL_USE_SRTP _CMDGRP_NORMAL(0xc6)
|
||||
#define LTE_CMDID_TLS_SSL_SRTP_PROFILE _CMDGRP_NORMAL(0xc7)
|
||||
#define LTE_CMDID_TLS_SSL_TURN _CMDGRP_NORMAL(0xc8)
|
||||
#define LTE_CMDID_TLS_MPI_INIT _CMDGRP_NORMAL(0xc9)
|
||||
#define LTE_CMDID_TLS_MPI_FREE _CMDGRP_NORMAL(0xca)
|
||||
#define LTE_CMDID_TLS_MPI_READ_STRING _CMDGRP_NORMAL(0xcb)
|
||||
#define LTE_CMDID_TLS_MPI_WRITE_STRING _CMDGRP_NORMAL(0xcc)
|
||||
#define LTE_CMDID_TLS_X509_CSR_INIT _CMDGRP_NORMAL(0xcd)
|
||||
#define LTE_CMDID_TLS_X509_CSR_FREE _CMDGRP_NORMAL(0xce)
|
||||
#define LTE_CMDID_TLS_X509_CSR_PARSE_FILE _CMDGRP_NORMAL(0xcf)
|
||||
#define LTE_CMDID_TLS_X509_CSR_PARSE_DER _CMDGRP_NORMAL(0xd0)
|
||||
#define LTE_CMDID_TLS_X509_CSR_PARSE _CMDGRP_NORMAL(0xd1)
|
||||
#define LTE_CMDID_TLS_X509_DN_GETS_CRT _CMDGRP_NORMAL(0xd2)
|
||||
#define LTE_CMDID_TLS_X509_DN_GETS_CSR _CMDGRP_NORMAL(0xd3)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_INIT _CMDGRP_NORMAL(0xd4)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_FREE _CMDGRP_NORMAL(0xd5)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_DER _CMDGRP_NORMAL(0xd6)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_PEM _CMDGRP_NORMAL(0xd7)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_SUBJECT_KEY _CMDGRP_NORMAL(0xd8)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_ISSUER_KEY _CMDGRP_NORMAL(0xd9)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_SUBJECT_NAME _CMDGRP_NORMAL(0xda)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_ISSUER_NAME _CMDGRP_NORMAL(0xdb)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_VERSION _CMDGRP_NORMAL(0xdc)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_MD_ALG _CMDGRP_NORMAL(0xdd)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_SERIAL _CMDGRP_NORMAL(0xde)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_VALIDITY _CMDGRP_NORMAL(0xdf)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_CONSTRAINTS _CMDGRP_NORMAL(0xe0)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_SUBJECT_ID _CMDGRP_NORMAL(0xe1)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_AUTHORITY_ID _CMDGRP_NORMAL(0xe2)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_KEY_USAGE _CMDGRP_NORMAL(0xe3)
|
||||
#define LTE_CMDID_TLS_X509WRITE_CRT_NS_CERT_TYPE _CMDGRP_NORMAL(0xe4)
|
||||
#define LTE_CMDID_TLS_RSA_INIT _CMDGRP_NORMAL(0xe5)
|
||||
#define LTE_CMDID_TLS_RSA_FREE _CMDGRP_NORMAL(0xe6)
|
||||
#define LTE_CMDID_TLS_RSA_GEN_KEY _CMDGRP_NORMAL(0xe7)
|
||||
|
||||
/* for LwM2M stub */
|
||||
|
||||
#define LTE_CMDID_LWM2M_URC_DUMMY _CMDGRP_EVENT(0x0101)
|
||||
#define LTE_CMDID_LWM2M_READ_EVT _CMDGRP_EVENT(0x0102)
|
||||
#define LTE_CMDID_LWM2M_WRITE_EVT _CMDGRP_EVENT(0x0103)
|
||||
#define LTE_CMDID_LWM2M_EXEC_EVT _CMDGRP_EVENT(0x0104)
|
||||
#define LTE_CMDID_LWM2M_OVSTART_EVT _CMDGRP_EVENT(0x0105)
|
||||
#define LTE_CMDID_LWM2M_OVSTOP_EVT _CMDGRP_EVENT(0x0106)
|
||||
#define LTE_CMDID_LWM2M_SERVEROP_EVT _CMDGRP_EVENT(0x0107)
|
||||
#define LTE_CMDID_LWM2M_FWUP_EVT _CMDGRP_EVENT(0x0108)
|
||||
|
||||
#define LTE_CMDID_LWM2M_GETEP _CMDGRP_LWM2M(0x0109)
|
||||
#define LTE_CMDID_LWM2M_SETEP _CMDGRP_LWM2M(0x010A)
|
||||
#define LTE_CMDID_LWM2M_GETSRVNUM _CMDGRP_LWM2M(0x010B)
|
||||
#define LTE_CMDID_LWM2M_GETSRVINFO _CMDGRP_LWM2M(0x010C)
|
||||
#define LTE_CMDID_LWM2M_SETSRVINFO _CMDGRP_LWM2M(0x010D)
|
||||
#define LTE_CMDID_LWM2M_GETACTIVEOBJNUM _CMDGRP_LWM2M(0x010E)
|
||||
#define LTE_CMDID_LWM2M_GETACTIVEOBJ _CMDGRP_LWM2M(0x010F)
|
||||
#define LTE_CMDID_LWM2M_SETACTIVEOBJ _CMDGRP_LWM2M(0x0110)
|
||||
#define LTE_CMDID_LWM2M_APPLY_SETTING _CMDGRP_LWM2M(0x0111)
|
||||
#define LTE_CMDID_LWM2M_GETOBJRESNUM _CMDGRP_LWM2M(0x0112)
|
||||
#define LTE_CMDID_LWM2M_GETOBJRESOURCE _CMDGRP_LWM2M(0x0113)
|
||||
#define LTE_CMDID_LWM2M_SETOBJRESOURCE _CMDGRP_LWM2M(0x0114)
|
||||
|
||||
#define LTE_CMDID_LWM2M_CONNECT _CMDGRP_LWM2M(0x0115)
|
||||
#define LTE_CMDID_LWM2M_READRESP _CMDGRP_LWM2M(0x0116)
|
||||
#define LTE_CMDID_LWM2M_WRITERESP _CMDGRP_LWM2M(0x0117)
|
||||
#define LTE_CMDID_LWM2M_OBSERVERESP _CMDGRP_LWM2M(0x0118)
|
||||
#define LTE_CMDID_LWM2M_EXECRESP _CMDGRP_LWM2M(0x0119)
|
||||
#define LTE_CMDID_LWM2M_OBSERVEUPDATE _CMDGRP_LWM2M(0x011A)
|
||||
|
||||
#define IS_LWM2M_EVENT(cid) (\
|
||||
((cid) == LTE_CMDID_LWM2M_READ_EVT) || \
|
||||
((cid) == LTE_CMDID_LWM2M_WRITE_EVT) || \
|
||||
((cid) == LTE_CMDID_LWM2M_EXEC_EVT) || \
|
||||
((cid) == LTE_CMDID_LWM2M_OVSTART_EVT) || \
|
||||
((cid) == LTE_CMDID_LWM2M_OVSTOP_EVT) || \
|
||||
((cid) == LTE_CMDID_LWM2M_SERVEROP_EVT) || \
|
||||
((cid) == LTE_CMDID_LWM2M_FWUP_EVT) )
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
typedef void (*lte_evthndl_t)(uint64_t evtbitmap);
|
||||
|
||||
/* for SIOCLTECMD IOCTL command */
|
||||
|
||||
struct lte_ioctl_data_s
|
||||
{
|
||||
uint32_t cmdid; /* Command ID */
|
||||
FAR void **inparam; /* Pointer to input parameter */
|
||||
size_t inparamlen; /* Length of input parameter */
|
||||
FAR void **outparam; /* Pointer to output parameter */
|
||||
size_t outparamlen; /* Length of output parameter */
|
||||
FAR void *cb; /* Pointer to callback function */
|
||||
};
|
||||
|
||||
struct lte_evtctx_in_s
|
||||
{
|
||||
FAR const char *mqname;
|
||||
};
|
||||
|
||||
struct lte_evtctx_out_s
|
||||
{
|
||||
lte_evthndl_t handle;
|
||||
};
|
||||
|
||||
/* for IOCTL related SMS */
|
||||
|
||||
struct lte_smsreq_s
|
||||
{
|
||||
union
|
||||
{
|
||||
/* Using for SIOCSMSENSTREP command */
|
||||
|
||||
bool enable;
|
||||
|
||||
/* Using for SIOCSMSGREFID command */
|
||||
|
||||
struct sms_refids_s refid;
|
||||
|
||||
/* Using for SIOCSMSSSCA command */
|
||||
|
||||
struct sms_sc_addr_s scaddr;
|
||||
} smsru;
|
||||
};
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_WIRELESS_LTE_LTE_IOCTL_H */
|
||||
Reference in New Issue
Block a user