Merged in masayuki2009/nuttx.nuttx/add_wireless_gs2200m (pull request #908)

Add wireless gs2200m

* include/nuttx/wireless: Add gs2200m.h

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* drivers/wireless: Add support for Telit GS2200M Wi-Fi module

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Masayuki Ishikawa 2019-06-18 12:44:03 +00:00 committed by Gregory Nutt
parent f50080b251
commit 9c8b36ea81
5 changed files with 2850 additions and 0 deletions

View File

@ -23,6 +23,12 @@ config CC1101_SPIDEV
endif
config WL_GS2200M
bool "Telit GS2200M Wi-Fi support"
default n
select SPI
select LIBC_SCANSET
source drivers/wireless/spirit/Kconfig
menuconfig DRIVERS_IEEE802154

View File

@ -66,6 +66,10 @@ CSRCS += cc1101.c ISM1_868MHzGFSK100kbps.c ISM2_905MHzGFSK250kbps.c
CSRCS += ISM2_433MHzMSK500kbps.c
endif
ifeq ($(CONFIG_WL_GS2200M),y)
CSRCS += gs2200m.c
endif
ifeq ($(CONFIG_WL_SPIRIT),y)
include wireless$(DELIM)spirit$(DELIM)Make.defs
endif

2694
drivers/wireless/gs2200m.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,141 @@
/****************************************************************************
* include/nuttx/wireless/gs2200m.h
*
* Copyright 2019 Sony Home Entertainment & Sound Products Inc.
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_WIRELESS_GS2200M_H
#define __INCLUDE_NUTTX_WIRELESS_GS2200M_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h>
#include <sys/ioctl.h>
#include <nuttx/config.h>
#include <nuttx/irq.h>
#include <nuttx/wireless/ioctl.h>
/****************************************************************************
* Public Data Types
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
# define EXTERN extern "C"
extern "C"
{
#else
# define EXTERN extern
#endif
#define GS2200M_IOC_CONNECT _WLCIOC(GS2200M_FIRST + 0)
#define GS2200M_IOC_SEND _WLCIOC(GS2200M_FIRST + 1)
#define GS2200M_IOC_RECV _WLCIOC(GS2200M_FIRST + 2)
#define GS2200M_IOC_CLOSE _WLCIOC(GS2200M_FIRST + 3)
#define GS2200M_IOC_BIND _WLCIOC(GS2200M_FIRST + 4)
#define GS2200M_IOC_ACCEPT _WLCIOC(GS2200M_FIRST + 5)
#define GS2200M_IOC_ASSOC _WLCIOC(GS2200M_FIRST + 6)
struct gs2200m_connect_msg
{
char cid;
uint8_t type;
char addr[17];
char port[6];
};
struct gs2200m_bind_msg
{
char cid;
uint8_t type;
char port[6];
};
struct gs2200m_accept_msg
{
char cid;
uint8_t type;
};
struct gs2200m_send_msg
{
char cid;
uint8_t type;
FAR uint8_t *buf;
uint16_t len;
};
struct gs2200m_recv_msg
{
char cid;
uint8_t type;
FAR uint8_t *buf;
uint16_t len; /* actual buffer length */
uint16_t reqlen; /* requested size */
};
struct gs2200m_close_msg
{
char cid;
uint8_t type;
};
struct gs2200m_assoc_msg
{
FAR char *ssid;
FAR char *key;
uint8_t mode;
};
struct gs2200m_lower_s
{
int (*attach)(xcpt_t handler, FAR void *arg);
void (*enable)(void);
void (*disable)(void);
uint32_t (*dready)(int *);
};
FAR void *gs2200m_register(FAR const char *devpath,
FAR struct spi_dev_s *dev,
FAR const struct gs2200m_lower_s *lower);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __INCLUDE_NUTTX_WIRELESS_GS2200M_H */

View File

@ -97,6 +97,11 @@
#define SX127X_FIRST (NRF24L01_FIRST + NRF24L01_NCMDS)
#define SX127X_NCMDS 11
/* See include/nuttx/wireless/gs2200m.h */
#define GS2200M_FIRST (SX127X_FIRST + SX127X_NCMDS)
#define GS2200M_NCMDS 7
/************************************************************************************
* Public Types
************************************************************************************/