lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 9 Jan 2014 21:07:58 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Giri Reddy <giri.reddy@...gic.com>
CC:	netdev <netdev@...r.kernel.org>
Subject: Re: Use of 'SIOCDEVPRIVATE' in ethernet drivers.

On Tue, 2014-01-07 at 18:21 +0000, Giri Reddy wrote:
> I'm implementing a new interface for upgrading the firmware for our next
> generation of Qlogic drivers. We need to transfer control information
> between userspace and driver, in addition to the firmware payload. I'm
> considering using 'SIOCDEVPRIVATE' ioctl interface to pass control
> information between userland and driver.
> 
> I also see comments in the source (include/linux/sockios.h) that
> 'SIOCDEVPRIVATE' will be deprecated 2.5.x. What is the current status of
> deprecation in the latest versions of the kernel?

It is still supported and unlikely to be removed, but no in-tree driver
will be allowed to expose new operations this way.

> Are we still allowed to use 'SIOCDEVPRIVATE' in drivers if there the
> deprecation efforts are on hold.
> 
> Any input will be appreciated.

The existing interfaces used for firmware update are:

1. ethtool ETHTOOL_FLASHDEV command.  Userland program installs a
firmware blob under /lib/firmware and then issues this command using
ioctl().  It can specify which flash partition is to be written.  Driver
loads and writes the entire blob and (presumably) resets the chip if
necessary.  There is no way to read the old firmware.

Example drivers: bna, cxgb4, be2net, vxge

2. MTD driver plus ethtool ETHTOOL_RESET command.  The flash
partition(s) containing firmware are exposed as separate devices with
names that indicate what they all are.  Userland can read and write the
firmware through /dev/mtd* or /dev/mtdblock*.  It can reset the chip
after writing firmware, using ioctl().  This is flexible but relatively
complicated for userland to use.

Example driver: sfc

3. ethtool ETHTOOL_{G,S}EEPROM commands.  Userland program sends these
commands using ioctl().  There is no clean way to expose more than one
flash partition, e.g. for controller, PHY, and net-boot firmware.

Example driver: bnx2

Please choose one of the above and don't invent another one.  (There are
already several other interfaces in use that are too horrible to mention
here.)

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ