/* fc_set_mfs() - Set the maximum frame size for a local port @lport: The local port to set the MFS for @mfs: The new MFS  */
int fc_set_mfs(struct fc_lport *lport, u32 mfs)
/* fc_set_mfs() - Set the maximum frame size for a local port @lport: The local port to set the MFS for @mfs: The new MFS  */
int fc_set_mfs(struct fc_lport *lport, u32 mfs)
{
	unsigned int old_mfs;
	int rc = -EINVAL;
	mutex_lock(&lport->lp_mutex);
	old_mfs = lport->mfs;
	if (mfs >= FC_MIN_MAX_FRAME) {
		mfs &= ~3;
		if (mfs > FC_MAX_FRAME)
			mfs = FC_MAX_FRAME;
		mfs -= sizeof(struct fc_frame_header);
		lport->mfs = mfs;
		rc = 0;
	}
	if (!rc && mfs < old_mfs)
		fc_lport_enter_reset(lport);
	mutex_unlock(&lport->lp_mutex);
	return rc;
}