/* @rc: UWB Radio Controller @_addr: Pointer to address to write . @type: Type of address to set (UWB_ADDR_DEV or UWB_ADDR_MAC).  */
static int uwb_rc_addr_set(struct uwb_rc *rc, const void *_addr, enum uwb_addr_type type)
/* @rc: UWB Radio Controller @_addr: Pointer to address to write . @type: Type of address to set (UWB_ADDR_DEV or UWB_ADDR_MAC).  */
static int uwb_rc_addr_set(struct uwb_rc *rc, const void *_addr, enum uwb_addr_type type)
{
	int result;
	u8 bmOperationType = 0x1;
	const struct uwb_dev_addr *dev_addr = _addr;
	const struct uwb_mac_addr *mac_addr = _addr;
	struct uwb_rc_evt_dev_addr_mgmt reply;
	const u8 *baAddr;
	result = -EINVAL;
	switch (type) {
	case UWB_ADDR_DEV:
		baAddr = dev_addr->data;
		break;
	case UWB_ADDR_MAC:
		baAddr = mac_addr->data;
		bmOperationType |= 0x2;
		break;
	default:
		return result;
	}
	return uwb_rc_dev_addr_mgmt(rc, bmOperationType, baAddr, &reply);
}