2017-03-26 17:42:53 +02:00
|
|
|
/****************************************************************************
|
2021-03-08 22:39:04 +01:00
|
|
|
* drivers/wireless/ieee80211/bcm43xxx/bcmf_core.h
|
2017-03-26 17:42:53 +02:00
|
|
|
*
|
2021-05-27 11:12:43 +02:00
|
|
|
* 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
|
2017-03-26 17:42:53 +02:00
|
|
|
*
|
2021-05-27 11:12:43 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2017-03-26 17:42:53 +02:00
|
|
|
*
|
2021-05-27 11:12:43 +02:00
|
|
|
* 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.
|
2017-03-26 17:42:53 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2022-01-15 03:44:35 +01:00
|
|
|
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CORE_H
|
|
|
|
#define __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CORE_H
|
2017-03-26 17:42:53 +02:00
|
|
|
|
2021-04-04 11:58:11 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
2017-03-26 17:42:53 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
#include "bcmf_sdio.h"
|
2017-03-26 17:42:53 +02:00
|
|
|
|
2021-04-04 11:58:11 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
|
2017-03-26 17:42:53 +02:00
|
|
|
uint8_t *reg, unsigned int len);
|
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
int bcmf_write_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
|
2017-03-26 17:42:53 +02:00
|
|
|
uint8_t *reg, unsigned int len);
|
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
bool bcmf_core_isup(FAR struct bcmf_sdio_dev_s *sbus, unsigned int core);
|
2017-03-26 17:42:53 +02:00
|
|
|
|
2021-12-29 15:02:46 +01:00
|
|
|
void bcmf_core_disable(FAR struct bcmf_sdio_dev_s *sbus,
|
|
|
|
unsigned int core,
|
|
|
|
uint32_t prereset,
|
|
|
|
uint32_t reset);
|
|
|
|
|
|
|
|
void bcmf_core_reset(FAR struct bcmf_sdio_dev_s *sbus,
|
|
|
|
unsigned int core,
|
|
|
|
uint32_t prereset,
|
|
|
|
uint32_t reset,
|
|
|
|
uint32_t postreset);
|
2017-03-26 17:42:53 +02:00
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus);
|
2017-03-26 17:42:53 +02:00
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
static inline int bcmf_read_sbregb(FAR struct bcmf_sdio_dev_s *sbus,
|
2017-03-26 17:42:53 +02:00
|
|
|
uint32_t address, uint8_t *reg)
|
|
|
|
{
|
2017-04-23 22:17:43 +02:00
|
|
|
return bcmf_read_sbreg(sbus, address, reg, 1);
|
2017-03-26 17:42:53 +02:00
|
|
|
}
|
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
static inline int bcmf_read_sbregw(FAR struct bcmf_sdio_dev_s *sbus,
|
2017-03-26 17:42:53 +02:00
|
|
|
uint32_t address, uint32_t *reg)
|
|
|
|
{
|
2017-05-04 02:20:57 +02:00
|
|
|
return bcmf_read_sbreg(sbus, address, (uint8_t *)reg, 4);
|
2017-03-26 17:42:53 +02:00
|
|
|
}
|
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
static inline int bcmf_write_sbregb(FAR struct bcmf_sdio_dev_s *sbus,
|
2017-03-26 17:42:53 +02:00
|
|
|
uint32_t address, uint8_t reg)
|
|
|
|
{
|
2017-04-23 22:17:43 +02:00
|
|
|
return bcmf_write_sbreg(sbus, address, ®, 1);
|
2017-03-26 17:42:53 +02:00
|
|
|
}
|
|
|
|
|
2017-04-23 22:17:43 +02:00
|
|
|
static inline int bcmf_write_sbregw(FAR struct bcmf_sdio_dev_s *sbus,
|
2017-03-26 17:42:53 +02:00
|
|
|
uint32_t address, uint32_t reg)
|
|
|
|
{
|
2017-05-04 02:20:57 +02:00
|
|
|
return bcmf_write_sbreg(sbus, address, (uint8_t *)®, 4);
|
2017-03-26 17:42:53 +02:00
|
|
|
}
|
|
|
|
|
2022-01-15 03:44:35 +01:00
|
|
|
#endif /* __DRIVERS_WIRELESS_IEEE80211_BCM43XXX_BCMF_CORE_H */
|