This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/linux-dect@lists.osmocom.org/.
Patrick McHardy kaber at trash.netOn Wed, 8 Aug 2012, Patrick McHardy wrote: > On Tue, 7 Aug 2012, Frédéric LECAILLE wrote: > >> The driver seems to work but the issue is that I am trying to use it in USA >> for an American client, and I did not managed to make this card use the >> 1.9Mhz band (rf band 3 I guess). >> >> When I run this command: >> >> dect-transceiver-list --name trx2 I see that slot0 is scanning: >> >> DECT Transceiver trx2 at cell0: >> Type: sc1442x >> Features: slow-hopping,p64 >> RF-band: 00003 >> Events: busy: 0 late: 0 >> >> slot 0: <scanning> packet: P00 carrier: 5 (1888.704 MHz) >> RX: bytes 0 packets 0 a-crc-errors 1629 x-crc-errors 0 >> z-crc-errors 0 >> >> >> but it nevers uses RF band 3 channel. >> >> For you information I have patch the driver this way to set the default >> debt rf band to 3: > > Your patch looks fine. The problem is most likely that in all bands carriers > 0-9 use the same frequency, so I'm guessting that US-DECT > uses different carrier numbers. I wasn't able to find anything related > to that in the base specification. If you can find a document defining > the exact operation of US-DECT, I can modify the stack in order to > properly support it. Found it, its TS 102 497. I've implemented what I think is necessary to work with US-DECT in the 1920-1930 MHz band. The other bands are not supported by the Com-on-Air transceivers. Please back out your band-setting changes and try the attached patch. I've enabled debugging output in the patch. Please send me the resulting log, whether it works or not, I can't test this myself. Thanks. -------------- next part -------------- commit 1a068f5002e960e5beee101d75aa87a35008738e Author: Patrick McHardy <kaber at trash.net> Date: Wed Aug 8 19:18:21 2012 +0200 dect: csf: properly handle carriers outside of 0-9 Signed-off-by: Patrick McHardy <kaber at trash.net> diff --git a/include/net/dect/mac.h b/include/net/dect/mac.h index 74c0a9e..5e762da 100644 --- a/include/net/dect/mac.h +++ b/include/net/dect/mac.h @@ -191,7 +191,7 @@ struct dect_ssi { #define DECT_QT_ERFC_FREQ 8 #define DECT_QT_ERFC_RFCARS_MASK 0x000fffffe0000000ULL -#define DECT_QT_ERFC_RFCARS_SHIFT 1 +#define DECT_QT_ERFC_RFCARS_SHIFT 25 #define DECT_QT_ERFC_RFBAND_MASK 0x000000001f000000ULL #define DECT_QT_ERFC_RFBAND_SHIFT 24 @@ -672,6 +672,7 @@ enum dect_tail_msg_types { DECT_TM_TYPE_ID, DECT_TM_TYPE_SSI, DECT_TM_TYPE_ERFC, + DECT_TM_TYPE_ERFC2, DECT_TM_TYPE_FPC, DECT_TM_TYPE_EFPC, DECT_TM_TYPE_EFPC2, @@ -697,6 +698,7 @@ struct dect_tail_msg { struct dect_ssi ssi; struct dect_erfc erfc; struct dect_fpc fpc; + struct dect_erfc2 erfc2; struct dect_efpc efpc; struct dect_efpc2 efpc2; struct dect_sari sari; @@ -717,6 +719,7 @@ struct dect_si { u32 mask; struct dect_ssi ssi; struct dect_erfc erfc; + struct dect_erfc2 erfc2; struct dect_fpc fpc; struct dect_efpc efpc; struct dect_efpc2 efpc2; diff --git a/include/net/dect/mac_csf.h b/include/net/dect/mac_csf.h index 301fdc1..a8e443d 100644 --- a/include/net/dect/mac_csf.h +++ b/include/net/dect/mac_csf.h @@ -526,6 +526,7 @@ struct dect_cell { /* system information */ struct dect_si si; + u64 rfcars; u32 blind_full_slots; /* PP state maintenance */ diff --git a/net/dect/mac_csf.c b/net/dect/mac_csf.c index 469b901..83f1a28 100644 --- a/net/dect/mac_csf.c +++ b/net/dect/mac_csf.c @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - +#define DEBUG #ifdef CONFIG_DECT_DEBUG #define DEBUG #endif @@ -189,6 +189,16 @@ static void dect_timer_setup(struct dect_timer *timer, timer->data = data; } +static void dect_cell_update_rfcars(struct dect_cell *cell) +{ + cell->rfcars = cell->si.ssi.rfcars; + if (cell->si.ssi.mc) { + cell->rfcars |= cell->si.erfc.rfcars << 10; + if (cell->si.erfc.erfc2) + cell->rfcars |= (u64)cell->si.erfc2.rfcars << 33; + } +} + /* * Basic Channel lists * @@ -333,11 +343,12 @@ static void dect_chl_update_carrier(struct dect_cell *cell, u8 carrier) struct dect_channel_list *chl, *old; chl = cell->chl; - chl_debug(cell, chl, "update status %03llx rfcars %03x carrier %u\n", - (unsigned long long)chl->status, cell->si.ssi.rfcars, carrier); + chl_debug(cell, chl, "update status %016llx rfcars %016llx carrier %u\n", + (unsigned long long)chl->status, + (unsigned long long)cell->rfcars, carrier); chl->status |= 1ULL << carrier; - if (chl->status != cell->si.ssi.rfcars) + if (chl->status != cell->rfcars) return; cell->chl = NULL; @@ -380,7 +391,7 @@ static void dect_chl_flush(struct dect_cell *cell) static u8 dect_channel_delay(const struct dect_cell *cell, const struct dect_channel_desc *chd) { - u64 rfcars = cell->si.ssi.rfcars; + u64 rfcars = cell->rfcars; u8 i, txs, scn, frames; s8 d; @@ -642,12 +653,14 @@ static int dect_parse_static_system_information(struct dect_tail_msg *tm, u64 t) ssi->cn = (t & DECT_QT_SSI_CN_MASK) >> DECT_QT_SSI_CN_SHIFT; ssi->pscn = (t & DECT_QT_SSI_PSCN_MASK) >> DECT_QT_SSI_PSCN_SHIFT; - if (ssi->sn > 11 || ssi->cn > 9 || ssi->pscn > 9 || ssi->rfcars == 0) + if (ssi->sn > 11 || ssi->cn > 9 || ssi->pscn > 9 || + (ssi->rfcars == 0 && ssi->mc == 0)) return -1; tm->type = DECT_TM_TYPE_SSI; - pr_debug("static system information: nr: %u sn: %u cn: %u pscn: %u\n", - ssi->nr, ssi->sn, ssi->cn, ssi->pscn); + pr_debug("static system information: nr: %u sn: %u cn: %u pscn: %u " + "rfcars %03x mc: %u\n", ssi->nr, ssi->sn, ssi->cn, ssi->pscn, + ssi->rfcars, ssi->mc); return 0; } @@ -677,10 +690,12 @@ static int dect_parse_extended_rf_carrier_information(struct dect_tail_msg *tm, DECT_QT_ERFC_RFBAND_SHIFT; erfc->num_rfcars = (t & DECT_QT_ERFC_NUM_RFCARS_MASK) > DECT_QT_ERFC_NUM_RFCARS_SHIFT; + erfc->erfc2 = (t & DECT_QT_ERFC_ERFC2_FLAG); tm->type = DECT_TM_TYPE_ERFC; - pr_debug("extended rf carrier information: rfcars %.6x band %u num %u\n", - erfc->rfcars, erfc->band, erfc->num_rfcars); + pr_debug("extended rf carrier information: rfcars: %06x band: %u " + "num: %u erfc2: %u\n", erfc->rfcars, erfc->band, + erfc->num_rfcars, erfc->erfc2); return 0; } @@ -695,6 +710,28 @@ static u64 dect_build_extended_rf_carrier_information(const struct dect_erfc *er return t; } +static int dect_parse_extended_rf_carrier_information2(struct dect_tail_msg *tm, u64 t) +{ + struct dect_erfc2 *erfc2 = &tm->erfc2; + + erfc2->rfcars = (t & DECT_QT_ERFC2_RFCARS_MASK) >> + DECT_QT_ERFC2_RFCARS_SHIFT; + tm->type = DECT_TM_TYPE_ERFC2; + + pr_debug("extended rf carrier information 2: rfcars: %08x\n", + erfc2->rfcars); + return 0; +} + +static u64 dect_build_extended_rf_carrier_information2(const struct dect_erfc2 *erfc2) +{ + u64 t = 0; + + t |= (u64)erfc2->rfcars << DECT_QT_ERFC2_RFCARS_SHIFT; + t |= DECT_QT_SI_ERFC2; + return t; +} + static int dect_parse_fixed_part_capabilities(struct dect_tail_msg *tm, u64 t) { struct dect_fpc *fpc = &tm->fpc; @@ -822,6 +859,8 @@ static int dect_parse_system_information(struct dect_tail_msg *tm, u64 t) return dect_parse_static_system_information(tm, t); case DECT_QT_SI_ERFC: return dect_parse_extended_rf_carrier_information(tm, t); + case DECT_QT_SI_ERFC2: + return dect_parse_extended_rf_carrier_information2(tm, t); case DECT_QT_SI_FPC: return dect_parse_fixed_part_capabilities(tm, t); case DECT_QT_SI_EFPC: @@ -1275,6 +1314,10 @@ static struct sk_buff *dect_build_tail_msg(struct sk_buff *skb, t = dect_build_extended_rf_carrier_information(data); ti = DECT_TI_QT; break; + case DECT_TM_TYPE_ERFC2: + t = dect_build_extended_rf_carrier_information2(data); + ti = DECT_TI_QT; + break; case DECT_TM_TYPE_FPC: t = dect_build_fixed_part_capabilities(data); ti = DECT_TI_QT; @@ -1778,7 +1821,7 @@ static struct sk_buff *dect_bc_q_dequeue(struct dect_cell *cell, ssi.sn = bearer->chd.slot; ssi.cn = bearer->chd.carrier; ssi.sp = 0; - ssi.pscn = dect_next_carrier(ssi.rfcars, ssi.pscn); + ssi.pscn = dect_next_carrier(cell->rfcars, ssi.pscn); return dect_build_tail_msg(skb, DECT_TM_TYPE_SSI, &ssi); case DECT_QT_SI_ERFC: @@ -2019,6 +2062,10 @@ static bool dect_bc_update_si(struct dect_si *si, if (memcmp(&si->erfc, &tm->erfc, sizeof(si->erfc))) memcpy(&si->erfc, &tm->erfc, sizeof(si->erfc)); break; + case DECT_TM_TYPE_ERFC2: + if (memcmp(&si->erfc, &tm->erfc, sizeof(si->erfc))) + memcpy(&si->erfc, &tm->erfc, sizeof(si->erfc)); + break; case DECT_TM_TYPE_FPC: if (memcmp(&si->fpc, &tm->fpc, sizeof(si->fpc))) { memcpy(&si->fpc, &tm->fpc, sizeof(si->fpc)); @@ -2076,6 +2123,12 @@ static bool dect_bc_si_cycle_complete(struct dect_idi *idi, return false; } + if (si->erfc.erfc2 && + !(si->mask & (1 << DECT_TM_TYPE_ERFC2))) { + pr_debug("incomplete: ERFC2\n"); + return false; + } + if (!(si->mask & (1 << DECT_TM_TYPE_FPC))) { pr_debug("incomplete: FPC\n"); return false; @@ -2121,8 +2174,11 @@ static void dect_bc_rcv(struct dect_cell *cell, struct dect_bc *bc, dect_timer_synchronize_mfn(cell, tm->mfn.num); notify = dect_bc_update_si(&cell->si, tm); - if (dect_bc_si_cycle_complete(&cell->idi, &cell->si) && notify) - dect_cell_mac_info_ind(cell); + if (dect_bc_si_cycle_complete(&cell->idi, &cell->si)) { + dect_cell_update_rfcars(cell); + if (notify) + dect_cell_mac_info_ind(cell); + } } else if (ti == DECT_TI_PT) { if (tm->page.length == DECT_PT_ZERO_PAGE && tm->page.rfpi != dect_build_page_rfpi(cell)) @@ -4026,7 +4082,7 @@ static void dect_irc_tx_frame_timer(struct dect_cell *cell, void *data) struct dect_channel_desc chd; u8 end; - irc->tx_scn = dect_next_carrier(cell->si.ssi.rfcars, irc->tx_scn); + irc->tx_scn = dect_next_carrier(cell->rfcars, irc->tx_scn); /* Begin a pending channel list update: * @@ -4103,7 +4159,7 @@ static void dect_irc_rx_frame_timer(struct dect_cell *cell, void *data) chl_debug(cell, cell->chl, "begin update\n"); } - irc->rx_scn = dect_next_carrier(cell->si.ssi.rfcars, irc->rx_scn); + irc->rx_scn = dect_next_carrier(cell->rfcars, irc->rx_scn); dect_timer_add(cell, &irc->rx_frame_timer, DECT_TIMER_RX, 1, 23); } @@ -4136,7 +4192,7 @@ static void dect_irc_enable(struct dect_cell *cell, struct dect_irc *irc) return; scn_off = scn_off_tbl[trx->index]; - scn = dect_carrier_sub(cell->si.ssi.rfcars, cell->si.ssi.pscn, scn_off); + scn = dect_carrier_sub(cell->rfcars, cell->si.ssi.pscn, scn_off); irc->rx_scn = scn; irc->tx_scn = scn; @@ -4811,7 +4867,7 @@ void dect_mac_tx_tick(struct dect_transceiver_group *grp, u8 slot) if (cell->flags & DECT_CELL_MONITOR && slot >= DECT_HALF_FRAME_SIZE) - scn = dect_prev_carrier(cell->si.ssi.rfcars, scn); + scn = dect_prev_carrier(cell->rfcars, scn); dect_set_carrier(trx, slot, scn); break; @@ -4822,7 +4878,7 @@ void dect_mac_tx_tick(struct dect_transceiver_group *grp, u8 slot) } if (slot == DECT_FRAME_SIZE - 1) - cell->si.ssi.pscn = dect_next_carrier(cell->si.ssi.rfcars, + cell->si.ssi.pscn = dect_next_carrier(cell->rfcars, cell->si.ssi.pscn); } @@ -4862,7 +4918,6 @@ static int dect_cell_preload(const struct dect_cell_handle *ch, cell->idi.rpn = rpn; cell->fmid = dect_build_fmid(&cell->idi); - cell->si.ssi.rfcars = 0x3ff; memcpy(&cell->si.erfc, &si->erfc, sizeof(cell->si.erfc)); memcpy(&cell->si.fpc, &si->fpc, sizeof(cell->si.fpc)); memcpy(&cell->si.efpc, &si->efpc, sizeof(cell->si.efpc)); @@ -4871,6 +4926,15 @@ static int dect_cell_preload(const struct dect_cell_handle *ch, memcpy(cell->si.sari, si->sari, sizeof(cell->si.sari)); cell->si.num_saris = si->num_saris; dect_timer_synchronize_mfn(cell, cell->si.mfn.num); + + cell->si.ssi.rfcars = 0; + cell->si.ssi.mc = true; + cell->si.erfc.rfcars = 1 << (23 - 10) | + 1 << (24 - 10) | + 1 << (25 - 10) | + 1 << (26 - 10) | + 1 << (27 - 10); + dect_cell_update_rfcars(cell); spin_unlock_bh(&cell->lock); return 0; }