--- zzzz-none-000/linux-2.4.17/net/irda/irlap_frame.c 2001-11-09 22:22:17.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/net/irda/irlap_frame.c 2004-11-24 13:22:05.000000000 +0000 @@ -18,7 +18,7 @@ * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * - * Neither Dag Brattli nor University of Tromsų admit liability nor + * Neither Dag Brattli nor University of Troms° admit liability nor * provide warranty for any of this software. This material is * provided "AS-IS" and at no charge. * @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -134,8 +135,8 @@ */ if (qos) { skb_put(skb, 9); /* 21 left */ - frame->saddr = cpu_to_le32(self->saddr); - frame->daddr = cpu_to_le32(self->daddr); + put_unaligned(cpu_to_le32(self->saddr), &frame->saddr); + put_unaligned(cpu_to_le32(self->daddr), &frame->daddr); frame->ncaddr = self->caddr; @@ -173,8 +174,8 @@ } /* Copy peer device address */ - info->daddr = le32_to_cpu(frame->saddr); - info->saddr = le32_to_cpu(frame->daddr); + info->daddr = le32_to_cpu(get_unaligned(&frame->saddr)); + info->saddr = le32_to_cpu(get_unaligned(&frame->daddr)); /* Only accept if addressed directly to us */ if (info->saddr != self->saddr) { @@ -218,8 +219,8 @@ frame->caddr = self->caddr; frame->control = UA_RSP | PF_BIT; - frame->saddr = cpu_to_le32(self->saddr); - frame->daddr = cpu_to_le32(self->daddr); + put_unaligned(cpu_to_le32(self->saddr), &frame->saddr); + put_unaligned(cpu_to_le32(self->daddr), &frame->daddr); /* Should we send QoS negotiation parameters? */ if (qos) { @@ -303,7 +304,7 @@ { struct sk_buff *skb = NULL; struct xid_frame *frame; - __u32 bcast = BROADCAST; + __u32 bcast = BROADCAST, daddr; __u8 *info; IRDA_DEBUG(4, __FUNCTION__ "(), s=%d, S=%d, command=%d\n", s, S, @@ -329,12 +330,13 @@ } frame->ident = XID_FORMAT; - frame->saddr = cpu_to_le32(self->saddr); - if (command) - frame->daddr = cpu_to_le32(bcast); + daddr = bcast; else - frame->daddr = cpu_to_le32(discovery->daddr); + daddr = discovery->daddr; + + put_unaligned(cpu_to_le32(self->saddr), &frame->saddr); + put_unaligned(cpu_to_le32(daddr), &frame->daddr); switch (S) { case 1: @@ -405,8 +407,8 @@ xid = (struct xid_frame *) skb->data; - info->daddr = le32_to_cpu(xid->saddr); - info->saddr = le32_to_cpu(xid->daddr); + info->daddr = le32_to_cpu(get_unaligned(&xid->saddr)); + info->saddr = le32_to_cpu(get_unaligned(&xid->daddr)); /* Make sure frame is addressed to us */ if ((info->saddr != self->saddr) && (info->saddr != BROADCAST)) { @@ -471,8 +473,8 @@ xid = (struct xid_frame *) skb->data; - info->daddr = le32_to_cpu(xid->saddr); - info->saddr = le32_to_cpu(xid->daddr); + info->daddr = le32_to_cpu(get_unaligned(&xid->saddr)); + info->saddr = le32_to_cpu(get_unaligned(&xid->daddr)); /* Make sure frame is addressed to us */ if ((info->saddr != self->saddr) && (info->saddr != BROADCAST)) { @@ -1236,8 +1238,8 @@ } /* Read and swap addresses */ - info->daddr = le32_to_cpu(frame->saddr); - info->saddr = le32_to_cpu(frame->daddr); + info->daddr = le32_to_cpu(get_unaligned(&frame->saddr)); + info->saddr = le32_to_cpu(get_unaligned(&frame->daddr)); /* Make sure frame is addressed to us */ if ((info->saddr != self->saddr) &&