I found the driver for dw3000 from the Android kernel and ported it to my own kernel, which generated a network card node and many sys nodes. I used the buildroot file system, but without the Android HAL layer, how should I operate these nodes to achieve localization
src:
/*
* This file is part of the UWB stack for linux.
*
* Copyright (c) 2020-2021 Qorvo US, Inc.
*
* This software is provided under the GNU General Public License, version 2
* (GPLv2), as well as under a Qorvo commercial license.
*
* You may choose to use this software under the terms of the GPLv2 License,
* version 2 ("GPLv2"), as published by the Free Software Foundation.
* You should have received a copy of the GPLv2 along with this program. If
* not, see <http://www.gnu.org/licenses/>.
*
* This program is distributed under the GPLv2 in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GPLv2 for more
* details.
*
* If you cannot meet the requirements of the GPLv2, you may not use this
* software for any purpose without first obtaining a commercial license from
This file has been truncated. show original
screenshot:
/sys/devices/platform/spi2-gpio/spi_master/spi5/spi5.0# tree
├── driver -> ../../../../../../bus/spi/drivers/dw3000
├── driver_override
├── ieee802154
│ └── phy2
│ ├── device -> ../../../spi5.0
│ ├── index
│ ├── name
│ ├── net
│ │ └── wpan0
│ │ ├── addr_assign_type
│ │ ├── addr_len
│ │ ├── address
│ │ ├── broadcast
│ │ ├── carrier
│ │ ├── carrier_changes
│ │ ├── carrier_down_count
│ │ ├── carrier_up_count
│ │ ├── dev_id
│ │ ├── dev_port
│ │ ├── device -> ../../../phy2
│ │ ├── dormant
│ │ ├── duplex
│ │ ├── flags
│ │ ├── gro_flush_timeout
│ │ ├── ifalias
│ │ ├── ifindex
│ │ ├── iflink
│ │ ├── link_mode
│ │ ├── mtu
│ │ ├── name_assign_type
│ │ ├── napi_defer_hard_irqs
│ │ ├── netdev_group
│ │ ├── operstate
│ │ ├── phys_port_id
│ │ ├── phys_port_name
│ │ ├── phys_switch_id
│ │ ├── power
│ │ │ ├── async
│ │ │ ├── autosuspend_delay_ms
│ │ │ ├── control
│ │ │ ├── runtime_active_kids
│ │ │ ├── runtime_active_time
│ │ │ ├── runtime_enabled
│ │ │ ├── runtime_status
│ │ │ ├── runtime_suspended_time
│ │ │ └── runtime_usage
│ │ ├── proto_down
│ │ ├── queues
│ │ │ ├── rx-0
│ │ │ │ ├── rps_cpus
│ │ │ │ └── rps_flow_cnt
│ │ │ └── tx-0
│ │ │ ├── byte_queue_limits
│ │ │ │ ├── hold_time
│ │ │ │ ├── inflight
│ │ │ │ ├── limit
│ │ │ │ ├── limit_max
│ │ │ │ └── limit_min
│ │ │ ├── traffic_class
│ │ │ ├── tx_maxrate
│ │ │ ├── tx_timeout
│ │ │ ├── xps_cpus
│ │ │ └── xps_rxqs
│ │ ├── speed
│ │ ├── statistics
│ │ │ ├── collisions
│ │ │ ├── multicast
│ │ │ ├── rx_bytes
│ │ │ ├── rx_compressed
│ │ │ ├── rx_crc_errors
│ │ │ ├── rx_dropped
│ │ │ ├── rx_errors
│ │ │ ├── rx_fifo_errors
│ │ │ ├── rx_frame_errors
│ │ │ ├── rx_length_errors
│ │ │ ├── rx_missed_errors
│ │ │ ├── rx_nohandler
│ │ │ ├── rx_over_errors
│ │ │ ├── rx_packets
│ │ │ ├── tx_aborted_errors
│ │ │ ├── tx_bytes
│ │ │ ├── tx_carrier_errors
│ │ │ ├── tx_compressed
│ │ │ ├── tx_dropped
│ │ │ ├── tx_errors
│ │ │ ├── tx_fifo_errors
│ │ │ ├── tx_heartbeat_errors
│ │ │ ├── tx_packets
│ │ │ └── tx_window_errors
│ │ ├── subsystem -> ../../../../../../../../../../class/net
│ │ ├── testing
│ │ ├── tx_queue_len
│ │ ├── type
│ │ └── uevent
│ ├── power
│ │ ├── async
│ │ ├── autosuspend_delay_ms
│ │ ├── control
│ │ ├── runtime_active_kids
│ │ ├── runtime_active_time
│ │ ├── runtime_enabled
│ │ ├── runtime_status
│ │ ├── runtime_suspended_time
│ │ └── runtime_usage
│ ├── subsystem -> ../../../../../../../../class/ieee802154
│ └── uevent
├── modalias
├── of_node -> ../../../../../../firmware/devicetree/base/spi2-gpio/dw3000@0
├── power
│ ├── async
│ ├── autosuspend_delay_ms
│ ├── control
│ ├── runtime_active_kids
│ ├── runtime_active_time
│ ├── runtime_enabled
│ ├── runtime_status
│ ├── runtime_suspended_time
│ └── runtime_usage
├── statistics
│ ├── bytes
│ ├── bytes_rx
│ ├── bytes_tx
│ ├── errors
│ ├── messages
│ ├── spi_async
│ ├── spi_sync
│ ├── spi_sync_immediate
│ ├── timedout
│ ├── transfer_bytes_histo_0-1
│ ├── transfer_bytes_histo_1024-2047
│ ├── transfer_bytes_histo_128-255
│ ├── transfer_bytes_histo_16-31
│ ├── transfer_bytes_histo_16384-32767
│ ├── transfer_bytes_histo_2-3
│ ├── transfer_bytes_histo_2048-4095
│ ├── transfer_bytes_histo_256-511
│ ├── transfer_bytes_histo_32-63
│ ├── transfer_bytes_histo_32768-65535
│ ├── transfer_bytes_histo_4-7
│ ├── transfer_bytes_histo_4096-8191
│ ├── transfer_bytes_histo_512-1023
│ ├── transfer_bytes_histo_64-127
│ ├── transfer_bytes_histo_65536+
│ ├── transfer_bytes_histo_8-15
│ ├── transfer_bytes_histo_8192-16383
│ ├── transfers
│ └── transfers_split_maxsize
├── subsystem -> ../../../../../../bus/spi
├── uevent
└── uwb
└── power_stats
Hi @wangyuan
I’m sorry to say that we don’t support this driver. The easiest would to take a look at the android HAL which is in charge of the UWB and then understand how the driver is used. The main takeover here is that the mounted network interface is more or less useless “as is”, and the main interface of the driver is through netlink. This is all what I know about this driver.
Dear @simon.desfarges :
Thank you for your reply
I have also tried to find the HAL layer for Android, but I did not find it in AOSP. Based on my experience, it may be located in a similar position as/vendor/xxx/interface/uwbservice. cpp, but this part is usually provided by chip manufacturers and is not open source
I will continue to collect information to view the methods of calling network cards, and also try to find a way to directly call SPI without going through the network card
Thank you.