endian fixes for BIGENDIAN systems. capi_profile and messages have to be little endian by definition
This commit is contained in:
parent
2b7e0b8e84
commit
643710ddbf
|
@ -149,13 +149,13 @@ __u16 AppPlciCheckBprotocol(AppPlci_t *aplci, _cmsg *cmsg)
|
|||
struct capi_ctr *ctrl = aplci->contr->ctrl;
|
||||
u_long sprot;
|
||||
|
||||
sprot = ctrl->profile.support1;
|
||||
sprot = le32_to_cpu(ctrl->profile.support1);
|
||||
if (!test_bit(cmsg->B1protocol, &sprot))
|
||||
return CapiB1ProtocolNotSupported;
|
||||
sprot = ctrl->profile.support2;
|
||||
sprot = le32_to_cpu(ctrl->profile.support2);
|
||||
if (!test_bit(cmsg->B2protocol, &sprot))
|
||||
return CapiB2ProtocolNotSupported;
|
||||
sprot = ctrl->profile.support3;
|
||||
sprot = le32_to_cpu(ctrl->profile.support3);
|
||||
if (!test_bit(cmsg->B3protocol, &sprot))
|
||||
return CapiB3ProtocolNotSupported;
|
||||
aplci->Bprotocol.B1 = cmsg->B1protocol;
|
||||
|
|
|
@ -95,8 +95,8 @@ ControllerRun(Controller_t *contr)
|
|||
contr->ctrl->version.majormanuversion = 1;
|
||||
contr->ctrl->version.minormanuversion = 0;
|
||||
memset(&contr->ctrl->profile, 0, sizeof(struct capi_profile));
|
||||
contr->ctrl->profile.ncontroller = 1;
|
||||
contr->ctrl->profile.nbchannel = contr->nr_bc;
|
||||
contr->ctrl->profile.ncontroller = cpu_to_le16(1);
|
||||
contr->ctrl->profile.nbchannel = cpu_to_le16(contr->nr_bc);
|
||||
contrDebug(contr, CAPI_DBG_INFO, "%s: %s version(%s)",
|
||||
__FUNCTION__, contr->ctrl->manu, contr->ctrl->serial);
|
||||
// FIXME
|
||||
|
@ -138,6 +138,10 @@ ControllerRun(Controller_t *contr)
|
|||
contrDebug(contr, CAPI_DBG_INFO, "%s: GLOBAL(%08X) B1(%08X) B2(%08X) B3(%08X)",
|
||||
__FUNCTION__, contr->ctrl->profile.goptions, contr->ctrl->profile.support1,
|
||||
contr->ctrl->profile.support2, contr->ctrl->profile.support3);
|
||||
cpu_to_le32s(&contr->ctrl->profile.goptions);
|
||||
cpu_to_le32s(&contr->ctrl->profile.support1);
|
||||
cpu_to_le32s(&contr->ctrl->profile.support2);
|
||||
cpu_to_le32s(&contr->ctrl->profile.support3);
|
||||
#ifdef OLDCAPI_DRIVER_INTERFACE
|
||||
contr->ctrl->ready(contr->ctrl);
|
||||
#else
|
||||
|
|
|
@ -931,23 +931,23 @@ ncciDataInd(Ncci_t *ncci, int pr, struct sk_buff *skb)
|
|||
ncci->recv_skb_handles[i] = nskb;
|
||||
|
||||
skb_push(nskb, CAPI_B3_DATA_IND_HEADER_SIZE);
|
||||
*((__u16*) nskb->data) = CAPI_B3_DATA_IND_HEADER_SIZE;
|
||||
*((__u16*)(nskb->data+2)) = ncci->appl->ApplId;
|
||||
*((__u8*) (nskb->data+4)) = CAPI_DATA_B3;
|
||||
*((__u8*) (nskb->data+5)) = CAPI_IND;
|
||||
*((__u16*)(nskb->data+6)) = ncci->appl->MsgId++;
|
||||
*((__u32*)(nskb->data+8)) = ncci->addr;
|
||||
CAPIMSG_SETLEN(nskb->data, CAPI_B3_DATA_IND_HEADER_SIZE);
|
||||
CAPIMSG_SETAPPID(nskb->data, ncci->appl->ApplId);
|
||||
CAPIMSG_SETCOMMAND(nskb->data, CAPI_DATA_B3);
|
||||
CAPIMSG_SETSUBCOMMAND(nskb->data, CAPI_IND);
|
||||
CAPIMSG_SETMSGID(nskb->data, ncci->appl->MsgId++);
|
||||
CAPIMSG_SETCONTROL(nskb->data, ncci->addr);
|
||||
if (sizeof(nskb) == 4) {
|
||||
*((__u32*)(nskb->data+12)) = (__u32)(((u_long)nskb->data + CAPI_B3_DATA_IND_HEADER_SIZE) & 0xffffffff);
|
||||
*((__u64*)(nskb->data+22)) = 0;
|
||||
capimsg_setu32(nskb->data, 12, (__u32)(((u_long)nskb->data + CAPI_B3_DATA_IND_HEADER_SIZE) & 0xffffffff));
|
||||
*((__u64*)(nskb->data+22)) = cpu_to_le64(0);
|
||||
} else {
|
||||
*((__u32*)(nskb->data+12)) = 0;
|
||||
*((__u64*)(nskb->data+22)) = (u_long)(nskb->data + CAPI_B3_DATA_IND_HEADER_SIZE);
|
||||
capimsg_setu32(nskb->data, 12, 0);
|
||||
*((__u64*)(nskb->data+22)) = cpu_to_le64((__u64)nskb->data + CAPI_B3_DATA_IND_HEADER_SIZE);
|
||||
}
|
||||
*((__u16*)(nskb->data+16)) = nskb->len - CAPI_B3_DATA_IND_HEADER_SIZE;
|
||||
*((__u16*)(nskb->data+18)) = i;
|
||||
CAPIMSG_SETDATALEN(nskb->data, nskb->len - CAPI_B3_DATA_IND_HEADER_SIZE);
|
||||
capimsg_setu16(nskb->data, 18, i);
|
||||
// FIXME FLAGS
|
||||
*((__u16*)(nskb->data+20)) = 0;
|
||||
capimsg_setu16(nskb->data, 20, 0);
|
||||
#ifdef OLDCAPI_DRIVER_INTERFACE
|
||||
ncci->contr->ctrl->handle_capimsg(ncci->contr->ctrl, ncci->appl->ApplId, nskb);
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue