aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge/vxge-config.c
diff options
context:
space:
mode:
authorJon Mason <jon.mason@exar.com>2010-11-10 23:26:00 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-11 12:30:22 -0500
commite7935c9669c27c5d530bff634c0c15f7a602d697 (patch)
tree5f2d6eded542d81bc7cae1a012ee5a0bbbe3d7ec /drivers/net/vxge/vxge-config.c
parentc3150eac9f2e5f770b09d371f7716540219a46f6 (diff)
vxge: Titan1A detection
Detect if the adapter is Titan or Titan1A, and tune the driver for this hardware. Also, remove unnecessary function __vxge_hw_device_id_get. Signed-off-by: Jon Mason <jon.mason@exar.com> Signed-off-by: Ram Vepa <ram.vepa@exar.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge/vxge-config.c')
-rw-r--r--drivers/net/vxge/vxge-config.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index 388e6c48696b..5903b2e9a6e9 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -99,9 +99,6 @@ static enum vxge_hw_status
99__vxge_hw_device_config_check(struct vxge_hw_device_config *new_config); 99__vxge_hw_device_config_check(struct vxge_hw_device_config *new_config);
100 100
101static void 101static void
102__vxge_hw_device_id_get(struct __vxge_hw_device *hldev);
103
104static void
105__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev); 102__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
106 103
107static enum vxge_hw_status 104static enum vxge_hw_status
@@ -806,26 +803,6 @@ exit:
806} 803}
807 804
808/* 805/*
809 * __vxge_hw_device_id_get
810 * This routine returns sets the device id and revision numbers into the device
811 * structure
812 */
813void __vxge_hw_device_id_get(struct __vxge_hw_device *hldev)
814{
815 u64 val64;
816
817 val64 = readq(&hldev->common_reg->titan_asic_id);
818 hldev->device_id =
819 (u16)VXGE_HW_TITAN_ASIC_ID_GET_INITIAL_DEVICE_ID(val64);
820
821 hldev->major_revision =
822 (u8)VXGE_HW_TITAN_ASIC_ID_GET_INITIAL_MAJOR_REVISION(val64);
823
824 hldev->minor_revision =
825 (u8)VXGE_HW_TITAN_ASIC_ID_GET_INITIAL_MINOR_REVISION(val64);
826}
827
828/*
829 * __vxge_hw_device_access_rights_get: Get Access Rights of the driver 806 * __vxge_hw_device_access_rights_get: Get Access Rights of the driver
830 * This routine returns the Access Rights of the driver 807 * This routine returns the Access Rights of the driver
831 */ 808 */
@@ -1327,7 +1304,6 @@ vxge_hw_device_initialize(
1327 vfree(hldev); 1304 vfree(hldev);
1328 goto exit; 1305 goto exit;
1329 } 1306 }
1330 __vxge_hw_device_id_get(hldev);
1331 1307
1332 __vxge_hw_device_host_info_get(hldev); 1308 __vxge_hw_device_host_info_get(hldev);
1333 1309
@@ -4442,16 +4418,18 @@ vpath_open_exit1:
4442void 4418void
4443vxge_hw_vpath_rx_doorbell_init(struct __vxge_hw_vpath_handle *vp) 4419vxge_hw_vpath_rx_doorbell_init(struct __vxge_hw_vpath_handle *vp)
4444{ 4420{
4445 struct __vxge_hw_virtualpath *vpath = NULL; 4421 struct __vxge_hw_virtualpath *vpath = vp->vpath;
4422 struct __vxge_hw_ring *ring = vpath->ringh;
4423 struct vxgedev *vdev = netdev_priv(vpath->hldev->ndev);
4446 u64 new_count, val64, val164; 4424 u64 new_count, val64, val164;
4447 struct __vxge_hw_ring *ring;
4448 4425
4449 vpath = vp->vpath; 4426 if (vdev->titan1) {
4450 ring = vpath->ringh; 4427 new_count = readq(&vpath->vp_reg->rxdmem_size);
4428 new_count &= 0x1fff;
4429 } else
4430 new_count = ring->config->ring_blocks * VXGE_HW_BLOCK_SIZE / 8;
4451 4431
4452 new_count = readq(&vpath->vp_reg->rxdmem_size); 4432 val164 = VXGE_HW_RXDMEM_SIZE_PRC_RXDMEM_SIZE(new_count);
4453 new_count &= 0x1fff;
4454 val164 = (VXGE_HW_RXDMEM_SIZE_PRC_RXDMEM_SIZE(new_count));
4455 4433
4456 writeq(VXGE_HW_PRC_RXD_DOORBELL_NEW_QW_CNT(val164), 4434 writeq(VXGE_HW_PRC_RXD_DOORBELL_NEW_QW_CNT(val164),
4457 &vpath->vp_reg->prc_rxd_doorbell); 4435 &vpath->vp_reg->prc_rxd_doorbell);