Lines Matching +full:filt +full:- +full:disable

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for Microchip MRF24J40 802.15.4 Wireless-PAN Networking controller
150 #define REG_WAKETIMEL 0x222 /* Wake-up Time Match Value Low */
151 #define REG_WAKETIMEH 0x223 /* Wake-up Time Match Value High */
184 /* Device configuration: Only channels 11-26 on page 0 are supported. */
188 - ((u32)1 << MRF24J40_CHAN_MIN))
256 #define printdev(X) (&X->spi->dev)
512 return -EINVAL; in mrf24j40_long_regmap_write()
543 __le16 fc = ieee802154_get_fc_from_skb(devrec->tx_skb); in write_tx_buf_complete()
553 devrec->tx_post_msg.complete = NULL; in write_tx_buf_complete()
554 devrec->tx_post_buf[0] = MRF24J40_WRITESHORT(REG_TXNCON); in write_tx_buf_complete()
555 devrec->tx_post_buf[1] = val; in write_tx_buf_complete()
557 ret = spi_async(devrec->spi, &devrec->tx_post_msg); in write_tx_buf_complete()
572 if (length > TX_FIFO_SIZE-2) { in write_tx_buf()
574 length = TX_FIFO_SIZE-2; in write_tx_buf()
578 devrec->tx_hdr_buf[0] = cmd >> 8 & 0xff; in write_tx_buf()
579 devrec->tx_hdr_buf[1] = cmd & 0xff; in write_tx_buf()
580 devrec->tx_len_buf[0] = 0x0; /* Header Length. Set to 0 for now. TODO */ in write_tx_buf()
581 devrec->tx_len_buf[1] = length; /* Total length */ in write_tx_buf()
582 devrec->tx_buf_trx.tx_buf = data; in write_tx_buf()
583 devrec->tx_buf_trx.len = length; in write_tx_buf()
585 ret = spi_async(devrec->spi, &devrec->tx_msg); in write_tx_buf()
594 struct mrf24j40 *devrec = hw->priv; in mrf24j40_tx()
596 dev_dbg(printdev(devrec), "tx packet of %d bytes\n", skb->len); in mrf24j40_tx()
597 devrec->tx_skb = skb; in mrf24j40_tx()
599 return write_tx_buf(devrec, 0x000, skb->data, skb->len); in mrf24j40_tx()
612 struct mrf24j40 *devrec = hw->priv; in mrf24j40_start()
617 return regmap_update_bits(devrec->regmap_short, REG_INTCON, in mrf24j40_start()
623 struct mrf24j40 *devrec = hw->priv; in mrf24j40_stop()
627 /* Set TXNIE and RXIE. Disable Interrupts */ in mrf24j40_stop()
628 regmap_update_bits(devrec->regmap_short, REG_INTCON, in mrf24j40_stop()
634 struct mrf24j40 *devrec = hw->priv; in mrf24j40_set_channel()
645 val = (channel - 11) << RFCON0_CH_SHIFT | RFOPT_RECOMMEND; in mrf24j40_set_channel()
646 ret = regmap_update_bits(devrec->regmap_long, REG_RFCON0, in mrf24j40_set_channel()
652 ret = regmap_update_bits(devrec->regmap_short, REG_RFCTL, BIT_RFRST, in mrf24j40_set_channel()
657 ret = regmap_update_bits(devrec->regmap_short, REG_RFCTL, BIT_RFRST, 0); in mrf24j40_set_channel()
665 struct ieee802154_hw_addr_filt *filt, in mrf24j40_filter() argument
668 struct mrf24j40 *devrec = hw->priv; in mrf24j40_filter()
676 addrh = le16_to_cpu(filt->short_addr) >> 8 & 0xff; in mrf24j40_filter()
677 addrl = le16_to_cpu(filt->short_addr) & 0xff; in mrf24j40_filter()
679 regmap_write(devrec->regmap_short, REG_SADRH, addrh); in mrf24j40_filter()
680 regmap_write(devrec->regmap_short, REG_SADRL, addrl); in mrf24j40_filter()
682 "Set short addr to %04hx\n", filt->short_addr); in mrf24j40_filter()
689 memcpy(addr, &filt->ieee_addr, 8); in mrf24j40_filter()
691 regmap_write(devrec->regmap_short, REG_EADR0 + i, in mrf24j40_filter()
697 pr_debug("%02hhx ", addr[7 - i]); in mrf24j40_filter()
706 panidh = le16_to_cpu(filt->pan_id) >> 8 & 0xff; in mrf24j40_filter()
707 panidl = le16_to_cpu(filt->pan_id) & 0xff; in mrf24j40_filter()
708 regmap_write(devrec->regmap_short, REG_PANIDH, panidh); in mrf24j40_filter()
709 regmap_write(devrec->regmap_short, REG_PANIDL, panidl); in mrf24j40_filter()
711 dev_dbg(printdev(devrec), "Set PANID to %04hx\n", filt->pan_id); in mrf24j40_filter()
719 if (filt->pan_coord) in mrf24j40_filter()
723 ret = regmap_update_bits(devrec->regmap_short, REG_RXMCR, in mrf24j40_filter()
728 /* REG_SLOTTED is maintained as default (unslotted/CSMA-CA). in mrf24j40_filter()
733 filt->pan_coord ? "on" : "off"); in mrf24j40_filter()
744 devrec->rx_msg.complete = NULL; in mrf24j40_handle_rx_read_buf_unlock()
745 devrec->rx_buf[0] = MRF24J40_WRITESHORT(REG_BBREG1); in mrf24j40_handle_rx_read_buf_unlock()
746 devrec->rx_buf[1] = 0x00; /* CLR RXDECINV */ in mrf24j40_handle_rx_read_buf_unlock()
747 ret = spi_async(devrec->spi, &devrec->rx_msg); in mrf24j40_handle_rx_read_buf_unlock()
755 u8 len = devrec->rx_buf[2]; in mrf24j40_handle_rx_read_buf_complete()
759 memcpy(rx_local_buf, devrec->rx_fifo_buf, len); in mrf24j40_handle_rx_read_buf_complete()
769 ieee802154_rx_irqsafe(devrec->hw, skb, 0); in mrf24j40_handle_rx_read_buf_complete()
775 devrec->rx_lqi_buf[0], devrec->rx_lqi_buf[1]); in mrf24j40_handle_rx_read_buf_complete()
786 if (!ieee802154_is_valid_psdu_len(devrec->rx_buf[2])) in mrf24j40_handle_rx_read_buf()
787 devrec->rx_buf[2] = IEEE802154_MTU; in mrf24j40_handle_rx_read_buf()
790 devrec->rx_addr_buf[0] = cmd >> 8 & 0xff; in mrf24j40_handle_rx_read_buf()
791 devrec->rx_addr_buf[1] = cmd & 0xff; in mrf24j40_handle_rx_read_buf()
792 devrec->rx_fifo_buf_trx.len = devrec->rx_buf[2]; in mrf24j40_handle_rx_read_buf()
793 ret = spi_async(devrec->spi, &devrec->rx_buf_msg); in mrf24j40_handle_rx_read_buf()
807 devrec->rx_msg.complete = mrf24j40_handle_rx_read_buf; in mrf24j40_handle_rx_read_len()
808 devrec->rx_trx.len = 3; in mrf24j40_handle_rx_read_len()
810 devrec->rx_buf[0] = cmd >> 8 & 0xff; in mrf24j40_handle_rx_read_len()
811 devrec->rx_buf[1] = cmd & 0xff; in mrf24j40_handle_rx_read_len()
813 ret = spi_async(devrec->spi, &devrec->rx_msg); in mrf24j40_handle_rx_read_len()
825 devrec->rx_msg.complete = mrf24j40_handle_rx_read_len; in mrf24j40_handle_rx()
826 devrec->rx_trx.len = 2; in mrf24j40_handle_rx()
827 devrec->rx_buf[0] = MRF24J40_WRITESHORT(REG_BBREG1); in mrf24j40_handle_rx()
828 devrec->rx_buf[1] = BIT_RXDECINV; /* SET RXDECINV */ in mrf24j40_handle_rx()
830 return spi_async(devrec->spi, &devrec->rx_msg); in mrf24j40_handle_rx()
837 struct mrf24j40 *devrec = hw->priv; in mrf24j40_csma_params()
845 return regmap_update_bits(devrec->regmap_short, REG_TXMCR, in mrf24j40_csma_params()
853 struct mrf24j40 *devrec = hw->priv; in mrf24j40_set_cca_mode()
857 switch (cca->mode) { in mrf24j40_set_cca_mode()
865 switch (cca->opt) { in mrf24j40_set_cca_mode()
870 return -EINVAL; in mrf24j40_set_cca_mode()
874 return -EINVAL; in mrf24j40_set_cca_mode()
877 return regmap_update_bits(devrec->regmap_short, REG_BBREG2, in mrf24j40_set_cca_mode()
884 -9000, -8900, -8800, -8700, -8600, -8500, -8400, -8300, -8200, -8100,
885 -8000, -7900, -7800, -7700, -7600, -7500, -7400, -7300, -7200, -7100,
886 -7000, -6900, -6800, -6700, -6600, -6500, -6400, -6300, -6200, -6100,
887 -6000, -5900, -5800, -5700, -5600, -5500, -5400, -5300, -5200, -5100,
888 -5000, -4900, -4800, -4700, -4600, -4500, -4400, -4300, -4200, -4100,
889 -4000, -3900, -3800, -3700, -3600, -3500
894 { -9000, 0 }, { -8900, 1 }, { -8800, 2 }, { -8700, 5 }, { -8600, 9 },
895 { -8500, 13 }, { -8400, 18 }, { -8300, 23 }, { -8200, 27 },
896 { -8100, 32 }, { -8000, 37 }, { -7900, 43 }, { -7800, 48 },
897 { -7700, 53 }, { -7600, 58 }, { -7500, 63 }, { -7400, 68 },
898 { -7300, 73 }, { -7200, 78 }, { -7100, 83 }, { -7000, 89 },
899 { -6900, 95 }, { -6800, 100 }, { -6700, 107 }, { -6600, 111 },
900 { -6500, 117 }, { -6400, 121 }, { -6300, 125 }, { -6200, 129 },
901 { -6100, 133 }, { -6000, 138 }, { -5900, 143 }, { -5800, 148 },
902 { -5700, 153 }, { -5600, 159 }, { -5500, 165 }, { -5400, 170 },
903 { -5300, 176 }, { -5200, 183 }, { -5100, 188 }, { -5000, 193 },
904 { -4900, 198 }, { -4800, 203 }, { -4700, 207 }, { -4600, 212 },
905 { -4500, 216 }, { -4400, 221 }, { -4300, 225 }, { -4200, 228 },
906 { -4100, 233 }, { -4000, 239 }, { -3900, 245 }, { -3800, 250 },
907 { -3700, 253 }, { -3600, 254 }, { -3500, 255 },
912 struct mrf24j40 *devrec = hw->priv; in mrf24j40_set_cca_ed_level()
917 return regmap_write(devrec->regmap_short, REG_CCAEDTH, in mrf24j40_set_cca_ed_level()
921 return -EINVAL; in mrf24j40_set_cca_ed_level()
925 0, -50, -120, -190, -280, -370, -490, -630, -1000, -1050, -1120, -1190,
926 -1280, -1370, -1490, -1630, -2000, -2050, -2120, -2190, -2280, -2370,
927 -2490, -2630, -3000, -3050, -3120, -3190, -3280, -3370, -3490, -3630,
932 struct mrf24j40 *devrec = hw->priv; in mrf24j40_set_txpower()
936 if (0 >= mbm && mbm > -1000) { in mrf24j40_set_txpower()
939 } else if (-1000 >= mbm && mbm > -2000) { in mrf24j40_set_txpower()
942 } else if (-2000 >= mbm && mbm > -3000) { in mrf24j40_set_txpower()
945 } else if (-3000 >= mbm && mbm > -4000) { in mrf24j40_set_txpower()
949 return -EINVAL; in mrf24j40_set_txpower()
956 case -50: in mrf24j40_set_txpower()
959 case -120: in mrf24j40_set_txpower()
962 case -190: in mrf24j40_set_txpower()
965 case -280: in mrf24j40_set_txpower()
968 case -370: in mrf24j40_set_txpower()
971 case -490: in mrf24j40_set_txpower()
974 case -630: in mrf24j40_set_txpower()
978 return -EINVAL; in mrf24j40_set_txpower()
981 return regmap_update_bits(devrec->regmap_long, REG_RFCON3, in mrf24j40_set_txpower()
987 struct mrf24j40 *devrec = hw->priv; in mrf24j40_set_promiscuous_mode()
992 ret = regmap_update_bits(devrec->regmap_short, REG_RXMCR, in mrf24j40_set_promiscuous_mode()
997 ret = regmap_update_bits(devrec->regmap_short, REG_RXMCR, in mrf24j40_set_promiscuous_mode()
1023 u8 intstat = devrec->irq_buf[1]; in mrf24j40_intstat_complete()
1025 enable_irq(devrec->spi->irq); in mrf24j40_intstat_complete()
1029 regmap_write_async(devrec->regmap_short, REG_SECCON0, in mrf24j40_intstat_complete()
1034 ieee802154_xmit_complete(devrec->hw, devrec->tx_skb, false); in mrf24j40_intstat_complete()
1048 devrec->irq_buf[0] = MRF24J40_READSHORT(REG_INTSTAT); in mrf24j40_isr()
1049 devrec->irq_buf[1] = 0; in mrf24j40_isr()
1052 ret = spi_async(devrec->spi, &devrec->irq_msg); in mrf24j40_isr()
1068 ret = regmap_write(devrec->regmap_short, REG_SOFTRST, 0x07); in mrf24j40_hw_init()
1072 ret = regmap_write(devrec->regmap_short, REG_PACON2, 0x98); in mrf24j40_hw_init()
1076 ret = regmap_write(devrec->regmap_short, REG_TXSTBL, 0x95); in mrf24j40_hw_init()
1080 ret = regmap_write(devrec->regmap_long, REG_RFCON0, 0x03); in mrf24j40_hw_init()
1084 ret = regmap_write(devrec->regmap_long, REG_RFCON1, 0x01); in mrf24j40_hw_init()
1088 ret = regmap_write(devrec->regmap_long, REG_RFCON2, 0x80); in mrf24j40_hw_init()
1092 ret = regmap_write(devrec->regmap_long, REG_RFCON6, 0x90); in mrf24j40_hw_init()
1096 ret = regmap_write(devrec->regmap_long, REG_RFCON7, 0x80); in mrf24j40_hw_init()
1100 ret = regmap_write(devrec->regmap_long, REG_RFCON8, 0x10); in mrf24j40_hw_init()
1104 ret = regmap_write(devrec->regmap_long, REG_SLPCON1, 0x21); in mrf24j40_hw_init()
1108 ret = regmap_write(devrec->regmap_short, REG_BBREG2, 0x80); in mrf24j40_hw_init()
1112 ret = regmap_write(devrec->regmap_short, REG_CCAEDTH, 0x60); in mrf24j40_hw_init()
1116 ret = regmap_write(devrec->regmap_short, REG_BBREG6, 0x40); in mrf24j40_hw_init()
1120 ret = regmap_write(devrec->regmap_short, REG_RFCTL, 0x04); in mrf24j40_hw_init()
1124 ret = regmap_write(devrec->regmap_short, REG_RFCTL, 0x0); in mrf24j40_hw_init()
1131 ret = regmap_update_bits(devrec->regmap_short, REG_RXMCR, 0x03, 0x00); in mrf24j40_hw_init()
1135 if (spi_get_device_id(devrec->spi)->driver_data == MRF24J40MC) { in mrf24j40_hw_init()
1139 regmap_update_bits(devrec->regmap_long, REG_TESTMODE, 0x07, in mrf24j40_hw_init()
1143 regmap_update_bits(devrec->regmap_short, REG_TRISGPIO, 0x08, in mrf24j40_hw_init()
1147 regmap_update_bits(devrec->regmap_short, REG_GPIO, 0x08, 0x08); in mrf24j40_hw_init()
1152 regmap_write(devrec->regmap_long, REG_RFCON3, 0x28); in mrf24j40_hw_init()
1155 irq_type = irq_get_trigger_type(devrec->spi->irq); in mrf24j40_hw_init()
1158 dev_warn(&devrec->spi->dev, in mrf24j40_hw_init()
1159 …ed irq's are not recommended, because it can cause races and result in a non-functional driver!\n"… in mrf24j40_hw_init()
1164 ret = regmap_update_bits(devrec->regmap_long, REG_SLPCON0, in mrf24j40_hw_init()
1183 spi_message_init(&devrec->tx_msg); in mrf24j40_setup_tx_spi_messages()
1184 devrec->tx_msg.context = devrec; in mrf24j40_setup_tx_spi_messages()
1185 devrec->tx_msg.complete = write_tx_buf_complete; in mrf24j40_setup_tx_spi_messages()
1186 devrec->tx_hdr_trx.len = 2; in mrf24j40_setup_tx_spi_messages()
1187 devrec->tx_hdr_trx.tx_buf = devrec->tx_hdr_buf; in mrf24j40_setup_tx_spi_messages()
1188 spi_message_add_tail(&devrec->tx_hdr_trx, &devrec->tx_msg); in mrf24j40_setup_tx_spi_messages()
1189 devrec->tx_len_trx.len = 2; in mrf24j40_setup_tx_spi_messages()
1190 devrec->tx_len_trx.tx_buf = devrec->tx_len_buf; in mrf24j40_setup_tx_spi_messages()
1191 spi_message_add_tail(&devrec->tx_len_trx, &devrec->tx_msg); in mrf24j40_setup_tx_spi_messages()
1192 spi_message_add_tail(&devrec->tx_buf_trx, &devrec->tx_msg); in mrf24j40_setup_tx_spi_messages()
1194 spi_message_init(&devrec->tx_post_msg); in mrf24j40_setup_tx_spi_messages()
1195 devrec->tx_post_msg.context = devrec; in mrf24j40_setup_tx_spi_messages()
1196 devrec->tx_post_trx.len = 2; in mrf24j40_setup_tx_spi_messages()
1197 devrec->tx_post_trx.tx_buf = devrec->tx_post_buf; in mrf24j40_setup_tx_spi_messages()
1198 spi_message_add_tail(&devrec->tx_post_trx, &devrec->tx_post_msg); in mrf24j40_setup_tx_spi_messages()
1204 spi_message_init(&devrec->rx_msg); in mrf24j40_setup_rx_spi_messages()
1205 devrec->rx_msg.context = devrec; in mrf24j40_setup_rx_spi_messages()
1206 devrec->rx_trx.len = 2; in mrf24j40_setup_rx_spi_messages()
1207 devrec->rx_trx.tx_buf = devrec->rx_buf; in mrf24j40_setup_rx_spi_messages()
1208 devrec->rx_trx.rx_buf = devrec->rx_buf; in mrf24j40_setup_rx_spi_messages()
1209 spi_message_add_tail(&devrec->rx_trx, &devrec->rx_msg); in mrf24j40_setup_rx_spi_messages()
1211 spi_message_init(&devrec->rx_buf_msg); in mrf24j40_setup_rx_spi_messages()
1212 devrec->rx_buf_msg.context = devrec; in mrf24j40_setup_rx_spi_messages()
1213 devrec->rx_buf_msg.complete = mrf24j40_handle_rx_read_buf_complete; in mrf24j40_setup_rx_spi_messages()
1214 devrec->rx_addr_trx.len = 2; in mrf24j40_setup_rx_spi_messages()
1215 devrec->rx_addr_trx.tx_buf = devrec->rx_addr_buf; in mrf24j40_setup_rx_spi_messages()
1216 spi_message_add_tail(&devrec->rx_addr_trx, &devrec->rx_buf_msg); in mrf24j40_setup_rx_spi_messages()
1217 devrec->rx_fifo_buf_trx.rx_buf = devrec->rx_fifo_buf; in mrf24j40_setup_rx_spi_messages()
1218 spi_message_add_tail(&devrec->rx_fifo_buf_trx, &devrec->rx_buf_msg); in mrf24j40_setup_rx_spi_messages()
1219 devrec->rx_lqi_trx.len = 2; in mrf24j40_setup_rx_spi_messages()
1220 devrec->rx_lqi_trx.rx_buf = devrec->rx_lqi_buf; in mrf24j40_setup_rx_spi_messages()
1221 spi_message_add_tail(&devrec->rx_lqi_trx, &devrec->rx_buf_msg); in mrf24j40_setup_rx_spi_messages()
1227 spi_message_init(&devrec->irq_msg); in mrf24j40_setup_irq_spi_messages()
1228 devrec->irq_msg.context = devrec; in mrf24j40_setup_irq_spi_messages()
1229 devrec->irq_msg.complete = mrf24j40_intstat_complete; in mrf24j40_setup_irq_spi_messages()
1230 devrec->irq_trx.len = 2; in mrf24j40_setup_irq_spi_messages()
1231 devrec->irq_trx.tx_buf = devrec->irq_buf; in mrf24j40_setup_irq_spi_messages()
1232 devrec->irq_trx.rx_buf = devrec->irq_buf; in mrf24j40_setup_irq_spi_messages()
1233 spi_message_add_tail(&devrec->irq_trx, &devrec->irq_msg); in mrf24j40_setup_irq_spi_messages()
1238 ieee802154_random_extended_addr(&devrec->hw->phy->perm_extended_addr); in mrf24j40_phy_setup()
1239 devrec->hw->phy->current_channel = 11; in mrf24j40_phy_setup()
1241 /* mrf24j40 supports max_minbe 0 - 3 */ in mrf24j40_phy_setup()
1242 devrec->hw->phy->supported.max_minbe = 3; in mrf24j40_phy_setup()
1246 devrec->hw->phy->supported.min_maxbe = 5; in mrf24j40_phy_setup()
1247 devrec->hw->phy->supported.max_maxbe = 5; in mrf24j40_phy_setup()
1249 devrec->hw->phy->cca.mode = NL802154_CCA_CARRIER; in mrf24j40_phy_setup()
1250 devrec->hw->phy->supported.cca_modes = BIT(NL802154_CCA_ENERGY) | in mrf24j40_phy_setup()
1253 devrec->hw->phy->supported.cca_opts = BIT(NL802154_CCA_OPT_ENERGY_CARRIER_AND); in mrf24j40_phy_setup()
1255 devrec->hw->phy->cca_ed_level = -6900; in mrf24j40_phy_setup()
1256 devrec->hw->phy->supported.cca_ed_levels = mrf24j40_ed_levels; in mrf24j40_phy_setup()
1257 devrec->hw->phy->supported.cca_ed_levels_size = ARRAY_SIZE(mrf24j40_ed_levels); in mrf24j40_phy_setup()
1259 switch (spi_get_device_id(devrec->spi)->driver_data) { in mrf24j40_phy_setup()
1262 devrec->hw->phy->supported.tx_powers = mrf24j40ma_powers; in mrf24j40_phy_setup()
1263 devrec->hw->phy->supported.tx_powers_size = ARRAY_SIZE(mrf24j40ma_powers); in mrf24j40_phy_setup()
1264 devrec->hw->phy->flags |= WPAN_PHY_FLAG_TXPOWER; in mrf24j40_phy_setup()
1273 int ret = -ENOMEM, irq_type; in mrf24j40_probe()
1277 dev_info(&spi->dev, "probe(). IRQ: %d\n", spi->irq); in mrf24j40_probe()
1285 devrec = hw->priv; in mrf24j40_probe()
1286 devrec->spi = spi; in mrf24j40_probe()
1288 devrec->hw = hw; in mrf24j40_probe()
1289 devrec->hw->parent = &spi->dev; in mrf24j40_probe()
1290 devrec->hw->phy->supported.channels[0] = CHANNEL_MASK; in mrf24j40_probe()
1291 devrec->hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | IEEE802154_HW_AFILT | in mrf24j40_probe()
1295 devrec->hw->phy->flags = WPAN_PHY_FLAG_CCA_MODE | in mrf24j40_probe()
1302 devrec->regmap_short = devm_regmap_init_spi(spi, in mrf24j40_probe()
1304 if (IS_ERR(devrec->regmap_short)) { in mrf24j40_probe()
1305 ret = PTR_ERR(devrec->regmap_short); in mrf24j40_probe()
1306 dev_err(&spi->dev, "Failed to allocate short register map: %d\n", in mrf24j40_probe()
1311 devrec->regmap_long = devm_regmap_init(&spi->dev, in mrf24j40_probe()
1314 if (IS_ERR(devrec->regmap_long)) { in mrf24j40_probe()
1315 ret = PTR_ERR(devrec->regmap_long); in mrf24j40_probe()
1316 dev_err(&spi->dev, "Failed to allocate long register map: %d\n", in mrf24j40_probe()
1321 if (spi->max_speed_hz > MAX_SPI_SPEED_HZ) { in mrf24j40_probe()
1322 dev_warn(&spi->dev, "spi clock above possible maximum: %d", in mrf24j40_probe()
1324 ret = -EINVAL; in mrf24j40_probe()
1335 irq_type = irq_get_trigger_type(spi->irq); in mrf24j40_probe()
1339 ret = devm_request_irq(&spi->dev, spi->irq, mrf24j40_isr, in mrf24j40_probe()
1340 irq_type, dev_name(&spi->dev), devrec); in mrf24j40_probe()
1347 ret = ieee802154_register_hw(devrec->hw); in mrf24j40_probe()
1354 ieee802154_free_hw(devrec->hw); in mrf24j40_probe()
1365 ieee802154_unregister_hw(devrec->hw); in mrf24j40_remove()
1366 ieee802154_free_hw(devrec->hw); in mrf24j40_remove()
1367 /* TODO: Will ieee802154_free_device() wait until ->xmit() is in mrf24j40_remove()