From patchwork Mon Apr 4 21:06:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 89728 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 29539B6FBB for ; Tue, 5 Apr 2011 08:18:43 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755785Ab1DDWSh (ORCPT ); Mon, 4 Apr 2011 18:18:37 -0400 Received: from suva.vyatta.com ([76.74.103.44]:43884 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755747Ab1DDWSR (ORCPT ); Mon, 4 Apr 2011 18:18:17 -0400 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id p34MHARf031240; Mon, 4 Apr 2011 15:17:11 -0700 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id p34MHAOu031239; Mon, 4 Apr 2011 15:17:10 -0700 Message-Id: <20110404210805.288930078@linuxplumber.net> User-Agent: quilt/0.48-1 Date: Mon, 04 Apr 2011 14:06:35 -0700 From: Stephen Hemminger To: "David S. Miller" , Ben Hutchings , Jon Mason Cc: netdev@vger.kernel.org Subject: [PATCH 1/8] vxge: convert to set_phys_id References: <20110404210634.840793593@linuxplumber.net> Content-Disposition: inline; filename=vxge-set-phys-id.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Also fix up incorrect docbook comment Signed-off-by: Stephen Hemminger --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/net/vxge/vxge-ethtool.c 2011-04-04 11:56:50.004060423 -0700 +++ b/drivers/net/vxge/vxge-ethtool.c 2011-04-04 11:58:47.045259090 -0700 @@ -134,22 +134,29 @@ static void vxge_ethtool_gregs(struct ne /** * vxge_ethtool_idnic - To physically identify the nic on the system. * @dev : device pointer. - * @id : pointer to the structure with identification parameters given by - * ethtool. + * @state : requested LED state * * Used to physically identify the NIC on the system. - * The Link LED will blink for a time specified by the user. - * Return value: * 0 on success */ -static int vxge_ethtool_idnic(struct net_device *dev, u32 data) +static int vxge_ethtool_idnic(struct net_device *dev, + enum ethtool_phys_id_state state) { struct vxgedev *vdev = netdev_priv(dev); struct __vxge_hw_device *hldev = vdev->devh; - vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON); - msleep_interruptible(data ? (data * HZ) : VXGE_MAX_FLICKER_TIME); - vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_OFF); + switch (state) { + case ETHTOOL_ID_ACTIVE: + vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON); + break; + + case ETHTOOL_ID_INACTIVE: + vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_OFF); + break; + + default: + return -EINVAL; + } return 0; } @@ -1183,7 +1190,7 @@ static const struct ethtool_ops vxge_eth .get_tso = ethtool_op_get_tso, .set_tso = vxge_ethtool_op_set_tso, .get_strings = vxge_ethtool_get_strings, - .phys_id = vxge_ethtool_idnic, + .set_phys_id = vxge_ethtool_idnic, .get_sset_count = vxge_ethtool_get_sset_count, .get_ethtool_stats = vxge_get_ethtool_stats, .set_flags = vxge_set_flags,