From owner-freebsd-drivers@FreeBSD.ORG Sun Dec 4 18:33:17 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71335106564A for ; Sun, 4 Dec 2011 18:33:17 +0000 (UTC) (envelope-from gbal.naresh@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4002E8FC13 for ; Sun, 4 Dec 2011 18:33:16 +0000 (UTC) Received: by iafi7 with SMTP id i7so2571075iaf.13 for ; Sun, 04 Dec 2011 10:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:content-type:x-mailer:message-id:date:to :content-transfer-encoding:mime-version; bh=J2bH0Yh0hUlvufJzT1ViMSvK/6pFQrwMLBKvdzdk1y4=; b=KHYhFOxJZTXfWna9fNsQhP3FW52oxrETwcOn18+63I1lYAdcJ6I8PYcfM6iRiuoLtV GrdzLT43bTD9AudizmiQFJYXKf5XK3Zp34hjKW8Ff7qf9gVH0IheNaWYwO44AuXIuPhs 0L4LkOC4C3wdXfJFaMGVfQ2TqNkuFn+1IGdqo= Received: by 10.231.60.84 with SMTP id o20mr1642280ibh.31.1323021910134; Sun, 04 Dec 2011 10:05:10 -0800 (PST) Received: from [192.168.1.2] ([122.175.18.38]) by mx.google.com with ESMTPS id ft1sm36434971igc.3.2011.12.04.10.05.06 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 04 Dec 2011 10:05:07 -0800 (PST) From: Naresh Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (9A405) Message-Id: <9E03496F-B9A3-499E-9C50-9F0D1EC6FF4F@gmail.com> Date: Sun, 4 Dec 2011 23:34:12 +0530 To: freebsd-drivers@freebsd.org Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: Firmware upgrade for CNA X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 18:33:17 -0000 Hi All, Our product is a CNA i.e it supports both 10G Ethernet and Storage. We need t= o provide firmware upgrade facility through our FreeBSD nic driver. The driver should be able to flash any version of the firmware when provided= . Asuuming driver is already loaded flashing steps should be something like=20= 1) User will invoke flashing by providing the image name and file path. 2) Driver should load the image from the path and start flashing. 3) Return the flashing status to the user. I looked into load_firmware FreeBSD mechanism. But it requires image to be=20= converted to loadable module, load image module and then invoke driver using= sysctl to start flashing.=20 Is there any standard way other than load_firmware ? Can we open and read a f= ile in the driver? In Linux, we copy the image to /lib/firmware and invoke flashing using somet= hing like "ethtool -f eth0 image".=20 Then kernel loads the image file from=20 /lib/firmware to a data buffer and invokes the driver. The driver then flash= es and return status. Is there a approach in FreeBSD something similar to Linux ? Thanks all for your help. -Naresh Sent from my iPhone=