dect
/
linux-2.6
Archived
13
0
Fork 0

dect: coa: add P640j support

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2011-06-29 12:16:27 +02:00
parent d3f79dd6ed
commit 477bd356e8
7 changed files with 113 additions and 43 deletions

View File

@ -36,3 +36,10 @@ config DECT_COA_FIRMWARE
is required for this.
If unsure, say N.
config DECT_COA_P64
depends on DECT_COA_PCI && !DECT_COA_CS && DECT_COA_FIRMWARE
bool "Enable P640 (wideband) support"
help
This option enables support for P640j packets, which are used for
wideband audio. This does not work with the PCMCIA devices.

View File

@ -15,13 +15,16 @@ clean-files += sc1442x_firmware.h.tmp
hostprogs-$(CONFIG_DECT_COA_FIRMWARE) += bin2c
ifeq ($(CONFIG_DECT_COA_FIRMWARE),y)
ifeq ($(CONFIG_DECT_COA_P64),y)
ASL_FLAGS = -D ENABLE_P64
endif
ASL = asl
P2BIN = p2bin
BIN2C = $(obj)/bin2c
quiet_cmd_asl = ASL $<
cmd_asl = $(ASL) -q -c $< -o $(<:.asm=.p) -shareout $(<:.asm=.h.tmp); \
cmd_asl = $(ASL) -q -c $< -o $(<:.asm=.p) $(ASL_FLAGS) -shareout $(<:.asm=.h.tmp); \
$(P2BIN) $(<:.asm=.p) $(<:.asm=.bin) -r 0-509; \
$(BIN2C) $(<:.asm=.bin) $(NAME)_firmware > $@; \
( \

View File

@ -247,12 +247,16 @@ static const u8 sc1442x_rx_funcs[DECT_PACKET_MAX + 1][DECT_B_MAX + 1][2][2] = {
[DECT_PACKET_P00][DECT_B_NONE][0][1] = RX_P00_Sync,
[DECT_PACKET_P32][DECT_B_UNPROTECTED][0][0] = RX_P32U,
[DECT_PACKET_P32][DECT_B_UNPROTECTED][1][0] = RX_P32U_Enc,
[DECT_PACKET_P640j][DECT_B_UNPROTECTED][0][0] = RX_P640j,
[DECT_PACKET_P640j][DECT_B_UNPROTECTED][1][0] = RX_P640j_Enc,
};
static const u8 sc1442x_tx_funcs[DECT_PACKET_MAX + 1][DECT_B_MAX + 1][2] = {
[DECT_PACKET_P00][DECT_B_NONE][0] = TX_P00,
[DECT_PACKET_P32][DECT_B_UNPROTECTED][0] = TX_P32U,
[DECT_PACKET_P32][DECT_B_UNPROTECTED][1] = TX_P32U_Enc,
[DECT_PACKET_P640j][DECT_B_UNPROTECTED][0] = TX_P640j,
[DECT_PACKET_P640j][DECT_B_UNPROTECTED][1] = TX_P640j_Enc,
};
/*
@ -524,6 +528,8 @@ static void sc1442x_enable(const struct dect_transceiver *trx)
sc1442x_write_cmd(dev, TX_P32U_Enc, JMP, LoadEncKey);
sc1442x_write_cmd(dev, RX_P32U_Enc, JMP, LoadEncState);
sc1442x_write_cmd(dev, TX_P640j_Enc, JMP, LoadEncKey);
sc1442x_write_cmd(dev, RX_P640j_Enc, JMP, LoadEncState);
} else {
sc1442x_write_cmd(dev, ClockSyncOn, P_SC, PSC_S_SYNC_ON);
sc1442x_write_cmd(dev, ClockAdjust, EN_SL_ADJ, 1);
@ -531,6 +537,8 @@ static void sc1442x_enable(const struct dect_transceiver *trx)
sc1442x_write_cmd(dev, RX_P32U_Enc, JMP, LoadEncKey);
sc1442x_write_cmd(dev, TX_P32U_Enc, JMP, LoadEncState);
sc1442x_write_cmd(dev, RX_P640j_Enc, JMP, LoadEncKey);
sc1442x_write_cmd(dev, TX_P640j_Enc, JMP, LoadEncState);
}
if (trx->mode == DECT_TRANSCEIVER_MASTER)
@ -723,7 +731,11 @@ static void sc1442x_tx(const struct dect_transceiver *trx, struct sk_buff *skb)
const struct dect_transceiver_ops sc1442x_transceiver_ops = {
.name = "sc1442x",
.features = DECT_TRANSCEIVER_SLOW_HOPPING,
.features = DECT_TRANSCEIVER_SLOW_HOPPING |
#ifdef CONFIG_DECT_COA_P64
DECT_TRANSCEIVER_PACKET_P64 |
#endif
0,
.eventrate = 6,
.latency = 6,
.disable = sc1442x_disable,

View File

@ -155,6 +155,15 @@ RX_P32U: JMP Receive
JMP RX_P32U_BZ ; Receive B-field | p: 96 B: 0
BR WriteBMC2
RX_P640j_Enc: JMP LoadEncKey
RX_P640j: JMP Receive
B_BR SD_B_FIELD_OFF
JMP Transfer_P640j
WT 14 ; 15 - 1 (RTN)
B_XR
JMP ReceiveEnd
BR WriteBMC2
;-------------------------------------------------------------------------------
; Transmit a P00 packet
;
@ -171,6 +180,37 @@ TX_P32U: JMP Transmit ; Transmit S- and beginning of A-field |
JMP TX_P32U_BZ ; Transmit the B- and Z-fields | p: 96 B: 0
BR label_54 ;
TX_P640j_Enc: JMP LoadEncKey
TX_P640j: JMP Transmit
B_BT SD_B_FIELD_OFF
WT 3 ; B_BT has 3 bits of latency
JMP Transfer_P640j
WT 11 ; 15 - 1 (RTN) - 3 (latency)
B_XT
WT 13 ; 8 (X/Z-Field) + 5
B_RST
JMP TransmitEnd
BR label_58
Transfer_B: WT 45 ; 47 - 2 (JMP/JMP, JMP/RTN)
B_XON
WT 15
B_XOFF
RTN
Transfer_P640j: JMP Transfer_B
JMP Transfer_B
JMP Transfer_B
JMP Transfer_B
JMP Transfer_B
JMP Transfer_B
JMP Transfer_B
JMP Transfer_B
JMP Transfer_B
WT 46 ; 47 - 1 (RTN)
B_XON
RTN
;-------------------------------------------------------------------------------
WriteBMC1: B_WRS SD_BASE_OFF ; write status
WT 6
@ -297,10 +337,12 @@ RFInit: RFEN ; Enable RF-clock
P_LDL 0x20
WT 10
IFNDEF ENABLE_P64
MEN2
WT 182
MEN2N
WT 16
ENDIF
RTN
;--------------------------------------------------------------
;
@ -363,7 +405,7 @@ InitDIP: ;B_RST
WT 10
P_EN
P_LD 0x04
RCK_INT
;RCK_INT
RFEN
RFStart: BR SyncInit
;-------------------------------------------------------------
@ -382,8 +424,8 @@ RFStart: BR SyncInit
SHARED ClockSyncOn,ClockSyncOff,ClockAdjust
SHARED PSC_ARPD1,PSC_S_SYNC,PSC_S_SYNC_ON,PSC_EOPSM
SHARED RX_P00,RX_P00_Sync,RX_P32U,RX_P32U_Enc
SHARED TX_P00,TX_P32U,TX_P32U_Enc
SHARED RX_P00,RX_P00_Sync,RX_P32U,RX_P32U_Enc,RX_P640j,RX_P640j_Enc
SHARED TX_P00,TX_P32U,TX_P32U_Enc,TX_P640j,TX_P640j_Enc
SHARED DCS_IV,DCS_CK,DCS_STATE,DCS_STATE_SIZE
SHARED LoadEncKey,LoadEncState

View File

@ -7,7 +7,7 @@
#include "sc1442x_firmware.h"
const unsigned char sc1442x_firmware[] = {
0x01, 0x01, 0x01, 0xd4, 0x0d, 0x00, 0x09, 0x01,
0x01, 0x01, 0x01, 0xf4, 0x0d, 0x00, 0x09, 0x01,
0x08, 0x01, 0x09, 0x01, 0x08, 0x01, 0x09, 0x01,
0x08, 0x01, 0x09, 0x01, 0x08, 0x01, 0x09, 0x01,
0x08, 0x01, 0x09, 0x01, 0x08, 0x01, 0x61, 0x00,
@ -21,11 +21,20 @@ const unsigned char sc1442x_firmware[] = {
0x09, 0x01, 0x08, 0x01, 0x09, 0x01, 0x08, 0x01,
0x09, 0x01, 0x08, 0x01, 0x09, 0x01, 0x08, 0x01,
0x09, 0x01, 0x08, 0x01, 0x6f, 0x00, 0x01, 0x02,
0x02, 0x57, 0x2d, 0x0e, 0x02, 0x83, 0x01, 0x4b,
0x02, 0x6c, 0x01, 0x39, 0x02, 0xac, 0x02, 0x57,
0x2d, 0x0e, 0x02, 0x81, 0x01, 0x52, 0x02, 0x86,
0x02, 0x95, 0x01, 0x4d, 0x02, 0xac, 0x02, 0x86,
0x25, 0x0e, 0x02, 0x92, 0x01, 0x4e, 0x39, 0x00,
0x02, 0x7b, 0x2d, 0x0e, 0x02, 0xa7, 0x01, 0x6f,
0x02, 0x90, 0x01, 0x39, 0x02, 0xcc, 0x02, 0x7b,
0x2d, 0x0e, 0x02, 0xa5, 0x01, 0x76, 0x02, 0xcc,
0x02, 0x7b, 0x3c, 0x0e, 0x02, 0x63, 0x09, 0x0e,
0x2b, 0x00, 0x02, 0xa7, 0x01, 0x76, 0x02, 0xaa,
0x02, 0xb9, 0x01, 0x71, 0x02, 0xcc, 0x02, 0xaa,
0x25, 0x0e, 0x02, 0xb6, 0x01, 0x72, 0x02, 0xcc,
0x02, 0xaa, 0x34, 0x0e, 0x09, 0x03, 0x02, 0x63,
0x09, 0x0b, 0x24, 0x00, 0x09, 0x0d, 0x20, 0x00,
0x02, 0xb9, 0x01, 0x78, 0x09, 0x2d, 0x27, 0x00,
0x09, 0x0f, 0x26, 0x00, 0x04, 0x00, 0x02, 0x5e,
0x02, 0x5e, 0x02, 0x5e, 0x02, 0x5e, 0x02, 0x5e,
0x02, 0x5e, 0x02, 0x5e, 0x02, 0x5e, 0x02, 0x5e,
0x09, 0x2e, 0x27, 0x00, 0x04, 0x00, 0x39, 0x00,
0x09, 0x06, 0x20, 0x00, 0xec, 0x50, 0x09, 0x05,
0x08, 0x01, 0x04, 0x00, 0x39, 0x00, 0x09, 0x06,
0x20, 0x00, 0xec, 0x50, 0x04, 0x00, 0x20, 0x00,
@ -40,34 +49,25 @@ const unsigned char sc1442x_firmware[] = {
0x29, 0x00, 0x2c, 0x00, 0x09, 0x0c, 0xec, 0x02,
0x09, 0x20, 0xea, 0x00, 0x3f, 0x06, 0x09, 0x3d,
0x04, 0x00, 0x09, 0xf9, 0x09, 0x4f, 0xed, 0x01,
0xec, 0x40, 0x01, 0xb4, 0xed, 0x00, 0x09, 0x28,
0xec, 0x40, 0x01, 0xd4, 0xed, 0x00, 0x09, 0x28,
0x20, 0x00, 0x33, 0x69, 0x08, 0x01, 0x31, 0x00,
0x09, 0x01, 0xed, 0x10, 0x09, 0x25, 0x37, 0x06,
0x09, 0x3e, 0x04, 0x00, 0x09, 0xf9, 0x09, 0x54,
0x20, 0x00, 0xec, 0x10, 0x09, 0x08, 0xec, 0x00,
0x01, 0xb4, 0x0b, 0x00, 0x09, 0x02, 0xa4, 0x00,
0x01, 0xd4, 0x0b, 0x00, 0x09, 0x02, 0xa4, 0x00,
0xb9, 0x65, 0x09, 0x19, 0xa9, 0x00, 0xa5, 0x00,
0xa4, 0x00, 0xb9, 0x68, 0x09, 0x0a, 0xa9, 0x00,
0xa5, 0x00, 0xec, 0x20, 0x09, 0x0a, 0xa7, 0x00,
0x09, 0xb6, 0xa6, 0x00, 0x09, 0x10, 0x04, 0x00,
0xa5, 0x00, 0xec, 0x20, 0x09, 0x0a, 0x04, 0x00,
0x40, 0x00, 0x50, 0x70, 0x09, 0x10, 0x50, 0x00,
0x44, 0x00, 0x09, 0x27, 0x44, 0x00, 0x04, 0x00,
0x5f, 0x70, 0x09, 0x0b, 0x5f, 0x00, 0x40, 0x00,
0x04, 0x00, 0x40, 0x00, 0x57, 0x70, 0x09, 0x0b,
0x57, 0x00, 0x04, 0x00, 0x0f, 0x20, 0x02, 0x99,
0x57, 0x00, 0x04, 0x00, 0x0f, 0x20, 0x02, 0xbd,
0x09, 0xfa, 0xea, 0x20, 0xed, 0x42, 0x28, 0x00,
0x09, 0x40, 0x26, 0x00, 0x29, 0x00, 0x08, 0x14,
0x03, 0xcd, 0x20, 0x00, 0x6b, 0x00, 0x08, 0x17,
0x01, 0xbf, 0x08, 0x17, 0xea, 0x00, 0x02, 0x99,
0x02, 0x38, 0x61, 0x00, 0x08, 0x16, 0x01, 0xbf,
0x03, 0xed, 0x20, 0x00, 0x6b, 0x00, 0x08, 0x17,
0x01, 0xdf, 0x08, 0x17, 0xea, 0x00, 0x02, 0xbd,
0x02, 0x38, 0x61, 0x00, 0x08, 0x16, 0x01, 0xdf,
0x0f, 0x00, 0xfa, 0x10, 0x09, 0x0a, 0x20, 0x00,
0x09, 0x0a, 0xe9, 0x00, 0xe8, 0x04, 0x62, 0x00,
0x0b, 0x00, 0x01, 0xbe, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
0x09, 0x0a, 0xe9, 0x00, 0xe8, 0x04, 0x0b, 0x00,
0x01, 0xde, 0xff, 0xff, 0xff, 0xff};

View File

@ -36,15 +36,15 @@ extern const unsigned char sc1442x_firmware[510];
#define Slot21 0x30
#define Slot22 0x32
#define Slot23 0x34
#define RFStart 0xDD
#define RFInit 0x99
#define SyncInit 0xBE
#define Sync 0xBF
#define SyncLock 0xCF
#define SyncLoop 0xD3
#define ClockSyncOn 0x60
#define ClockSyncOff 0x68
#define ClockAdjust 0x64
#define RFStart 0xFC
#define RFInit 0xBD
#define SyncInit 0xDE
#define Sync 0xDF
#define SyncLock 0xEF
#define SyncLoop 0xF3
#define ClockSyncOn 0x84
#define ClockSyncOff 0x8C
#define ClockAdjust 0x88
#define PSC_ARPD1 0x80
#define PSC_S_SYNC 0x40
#define PSC_S_SYNC_ON 0x20
@ -53,14 +53,18 @@ extern const unsigned char sc1442x_firmware[510];
#define RX_P00_Sync 0x3C
#define RX_P32U 0x3F
#define RX_P32U_Enc 0x3E
#define TX_P00 0x43
#define TX_P32U 0x47
#define TX_P32U_Enc 0x46
#define RX_P640j 0x44
#define RX_P640j_Enc 0x43
#define TX_P00 0x4B
#define TX_P32U 0x4F
#define TX_P32U_Enc 0x4E
#define TX_P640j 0x54
#define TX_P640j_Enc 0x53
#define DCS_IV 0x70
#define DCS_CK 0x78
#define DCS_STATE 0x70
#define DCS_STATE_SIZE 0xB
#define LoadEncKey 0xAC
#define LoadEncState 0xB9
#define LoadEncKey 0xCC
#define LoadEncState 0xD9
#endif /* SC1442X_FIRMWARE */

View File

@ -106,9 +106,11 @@ enum dect_transceiver_stats_attrs {
/**
* @DECT_TRANSCEIVER_SLOW_HOPPING: transceiver has slow hopping radio
* @DECT_TRANSCEIVER_PACKET_P64: transceiver supports packet P640j
*/
enum dect_transceiver_features {
DECT_TRANSCEIVER_SLOW_HOPPING = 0x1,
DECT_TRANSCEIVER_PACKET_P64 = 0x2,
};
enum dect_transceiver_attrs {