Re: [PATCH] intel_scu_ipc: Utility driver for intel scu ipc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

seen this a bit late..., one question:

On Friday 22 October 2010 16:43:55 Alan Cox wrote:
> From: Sreedhara DS <sreedhara.ds@xxxxxxxxx>
> 
> This driver implements ioctl and interfaces with intel scu ipc driver. It
> is used to access pmic/msic registers from user space and firmware update
> utility.
Why is an ioctl used for updating the firmware?
Why isn't request_firmware(..) via:
/lib/firmware/...
used?
Then the firmware could be maintained here:
http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=summary
and no further userspace tools for firmware updating are needed.

Thanks,

   Thomas
> 
> Signed-off-by: Sreedhara DS <sreedhara.ds@xxxxxxxxx>
> [Extensive clean up and debug]
> Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
...
> +/**
> + *	scu_ipc_ioctl		-	control ioctls for the SCU
> + *	@fp: file handle of the SCU device
> + *	@cmd: ioctl coce
> + *	@arg: pointer to user passed structure
> + *
> + *	Support the I/O and firmware flashing interfaces of the SCU
> + */
> +static long scu_ipc_ioctl(struct file *fp, unsigned int cmd,
> +							unsigned long arg)
> +{
> +	int ret;
> +	struct scu_ipc_data  data;
> +	void __user *argp = (void __user *)arg;
> +
> +	if (!capable(CAP_SYS_RAWIO))
> +		return -EPERM;
> +
> +	if (cmd == INTE_SCU_IPC_FW_UPDATE) {
> +			u8 *fwbuf = kmalloc(MAX_FW_SIZE, GFP_KERNEL);
> +			if (fwbuf == NULL)
> +				return -ENOMEM;
> +			if (copy_from_user(fwbuf, (u8 *)arg, MAX_FW_SIZE)) {
> +				kfree(fwbuf);
> +				return -EFAULT;
> +			}
> +			ret = intel_scu_ipc_fw_update(fwbuf, MAX_FW_SIZE);
> +			kfree(fwbuf);
> +			return ret;
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux