goto out;
}
- mtu = dev->mtu;
+ mtu = IEEE802154_MTU;
pr_debug("name = %s, mtu = %u\n", dev->name, mtu);
if (size > mtu) {
err = -ENXIO;
goto out;
}
- mtu = dev->mtu;
+ mtu = IEEE802154_MTU;
pr_debug("name = %s, mtu = %u\n", dev->name, mtu);
if (size > mtu) {
*/
dev->needed_tailroom = IEEE802154_MAX_AUTH_TAG_LEN +
IEEE802154_FCS_LEN;
- dev->mtu = IEEE802154_MTU;
+ /* The mtu size is the payload without mac header in this case.
+ * We have a dynamic length header with a minimum header length
+ * which is hard_header_len. In this case we let mtu to the size
+ * of maximum payload which is IEEE802154_MTU - IEEE802154_FCS_LEN -
+ * hard_header_len. The FCS which is set by hardware or ndo_start_xmit
+ * and the minimum mac header which can be evaluated inside driver
+ * layer. The rest of mac header will be part of payload if greater
+ * than hard_header_len.
+ */
+ dev->mtu = IEEE802154_MTU - IEEE802154_FCS_LEN -
+ dev->hard_header_len;
dev->tx_queue_len = 300;
dev->flags = IFF_NOARP | IFF_BROADCAST;
}
struct net_device *dev = skb->dev;
int ret;
- /* This check is for AF_PACKET RAW socket only, which doesn't
- * know about the FCS which is set here or by hardware. otherwise
- * it should not occur in any case!
- *
- * TODO: This should be handled in AF_PACKET and return -EMSGSIZE.
- */
- if (skb->len > IEEE802154_MTU - IEEE802154_FCS_LEN) {
- netdev_warn(dev, "Frame len above MTU limit. Dropped.\n");
- goto err_tx;
- }
-
if (!(local->hw.flags & IEEE802154_HW_TX_OMIT_CKSUM)) {
u16 crc = crc_ccitt(0, skb->data, skb->len);