/* The DECnet spec requires that the "routing layer" accepts packets which are at least 230 bytes in size. This excludes any headers which the NSP layer might add, so we always assume that we'll be using the maximal length header on data packets. The variation in length is due to the inclusion (or not) of the two 16 bit acknowledgement fields so it doesn't make much practical difference.  */
unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu)
/* The DECnet spec requires that the "routing layer" accepts packets which are at least 230 bytes in size. This excludes any headers which the NSP layer might add, so we always assume that we'll be using the maximal length header on data packets. The variation in length is due to the inclusion (or not) of the two 16 bit acknowledgement fields so it doesn't make much practical difference.  */
unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu)
{
	unsigned mss = 230 - DN_MAX_NSP_DATA_HEADER;
	if (dev) {
		struct dn_dev *dn_db = dev->dn_ptr;
		mtu -= LL_RESERVED_SPACE(dev);
		if (dn_db->use_long)
			mtu -= 21;
		else
			mtu -= 6;
		mtu -= DN_MAX_NSP_DATA_HEADER;
	} else {
		mtu -= (21 + DN_MAX_NSP_DATA_HEADER + 16);
	}
	if (mtu > mss)
		mss = mtu;
	return mss;
}