Commit 645926b3 authored by Dave Jones's avatar Dave Jones Committed by Greg Kroah-Hartman
Browse files

staging/bcm: move IOCTL_QOS_THRESHOLD case out to its own function.



bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines.  Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: default avatarDave Jones <davej@fedoraproject.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e5781c6
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -981,6 +981,19 @@ static int bcm_char_ioctl_chip_reset(struct bcm_mini_adapter *Adapter)
	return Status;
}

static int bcm_char_ioctl_qos_threshold(ULONG arg, struct bcm_mini_adapter *Adapter)
{
	USHORT uiLoopIndex;

	for (uiLoopIndex = 0; uiLoopIndex < NO_OF_QUEUES; uiLoopIndex++) {
		if (get_user(Adapter->PackInfo[uiLoopIndex].uiThreshold,
				(unsigned long __user *)arg)) {
			return -EFAULT;
		}
	}
	return 0;
}


static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
{
@@ -1107,19 +1120,9 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
		Status = bcm_char_ioctl_chip_reset(Adapter);
		return Status;

	case IOCTL_QOS_THRESHOLD: {
		USHORT uiLoopIndex;

		Status = 0;
		for (uiLoopIndex = 0; uiLoopIndex < NO_OF_QUEUES; uiLoopIndex++) {
			if (get_user(Adapter->PackInfo[uiLoopIndex].uiThreshold,
					(unsigned long __user *)arg)) {
				Status = -EFAULT;
				break;
			}
		}
		break;
	}
	case IOCTL_QOS_THRESHOLD:
		Status = bcm_char_ioctl_qos_threshold(arg, Adapter);
		return Status;

	case IOCTL_DUMP_PACKET_INFO:
		DumpPackInfo(Adapter);