Reduce the size by merging the Receive- and ReceiveSync paths and
re-enable a few instructions necessary for the PCMCIA device.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Use atomic writes to make sure the DIP doesn't read the new
opcode before the operand has been written to memory.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Commit e783777 (dect: coa: write BMC configuration when setting
channel mode) moved writing the BMC configuration to the mode
setting callback.
The MAC CSF layer however didn't set the channel mode to SCANNING
when initiating a scan since BMC configuration was done during
initialization and mode setting in dect_transceiver_enable(). With
the above mentioned commit the BMC is never properly configured,
meaning the scan fails.
Properly set the mode of DECT_SCAN_SLOT to DECT_MODE_SCANNING when
initiating a scan to fix this.
Additionally get rid of the unnecessary BMC initialization when
initializing the DIP, this is done immediately afterwards anyways.
Signed-off-by: Patrick McHardy <kaber@trash.net>
The SyncLoop needs to manually reinitialize the radio since the
individual receive functions don't do this anymore.
Signed-off-by: Patrick McHardy <kaber@trash.net>
- merge DCS state and DCS IV/Key space: the IV and key are reinialized
on every slot, so we can re-use their space for the DCS state at the
end of the slot.
- pack radio configuration and BMC control data and move adjacent to
the DCS space.
This results in 87 bytes of free space for the B-Field data.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Write the BMC configuration when setting the channel mode. This allows
to reserve memory for only a single configuration for both RX and TX.
Additionally it will in the future be used to configure S-field error
parameters dynamically.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Support operation on uneven slot numbers. The firmware is rewritten to
follow the following scheme:
- each slot has an entry in the SlotTable consisting of two
intructions
- idle slots use WT 1 + WNT 1
- for active slots the previous slot is programmed to switch
to the proper memory bank and initialize the BMC/radio
- the actual slot is programmed to jump to one the receive or
transmit functions
The transceiver layer takes care of scheduling operation only
on slots that are surrounded by idle slots based on the
DECT_TRANSCEIVER_SLOW_HOPPING feature flag.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Move RX BMC configuration from the radio initialization to the
receive functions to avoid double configuration on TX.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Copy sc1442x_base to a local variable to unmap it since we have to
free the transceiver that contains the pointer before that.
Additionally (in case of the PCMCIA driver) call pcmcia_disable_device()
before freeing the transceiver since we may still receive interrupts until
that point.
Signed-off- by: Patrick McHardy <kaber@gtrash.net>ZZ
Save a couple of instructions by moving the protected B-field transmission
and reception code directly into the calling functions. With this change all
receive and transmit functions call their respective B-field processing
functions in a similar fashion, allowing to remove the WT 1 for the last
A-field bit after Receive/Transmit, saving a total of 6 instructions.
Signed-off-by: Patrick McHardy <kaber@trash.net>
This reverts commit 3253b4dd51.
Accidentally committed, code is not ready yet and only works
occasionaly.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Trigger handover based on indicated slot errors as per ETSI EN 300 175-3
section 11.4.5. Sliding collision indications based on the Q1/Q2 bits is
currently ignores since there appears to be a bug in the sc1442x firmware
in transmitting the Z-field. Additionally bearer-reattempt rate-limiting
is currently missing.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Occasionally after an error the card will deliver spurious interrupts when
reloading the driver. Clear all pending interrupts to avoid this.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Ciphering and synchronization options are similar to the primary
transceiver (the sync bearer is handled seperately), only the
entry points of primary and secondaries differ.
Signed-off-by: Patrick McHardy <kaber@gw.localnet>
Apparently the sc1442x doesn't properly update the BMC status information unless
reception of the B-field is begun. This causes P00 slots to be incorrectly detected
as out of sync.
Add two (otherwise unnecessary) commands to finish the A-field and begin reception
of the B-field before disabling the receiver.
Signed-off-by: Patrick McHardy <kaber@trash.net>
- rename Receive and Transmit functions to RX_ and TX_
- add P00 receive function. This is necessary for channel measurement,
which should measure only over the real packet length.
Signed-off-by: Patrick McHardy <kaber@trash.net>
There's no need to reinitialize the radio configuration when changing
channel modes, just initialize it once in sc1442x_init_slot().
Signed-off-by: Patrick McHardy <kaber@trash.net>