aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cnic.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2010-10-05 23:16:06 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-06 17:09:23 -0400
commit1420398db4d5e236583d3ab392637df255bd5c6b (patch)
tree5d2e287b142ea3b4a6167dc5d9af1ee5de699751 /drivers/net/cnic.c
parentceb7e1c7c5ab86ca686d523f99ca473a1f3a984d (diff)
cnic: Use pfid for internal memory offsets.
The pfid (physical function ID) is the same as PCI function on production devices. The pfid for future devices will be different and will be used for internal memory offsets. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r--drivers/net/cnic.c144
1 files changed, 74 insertions, 70 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 0e31d5aa1dd2..50cded7fff51 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -1246,8 +1246,8 @@ static int cnic_bnx2x_iscsi_init1(struct cnic_dev *dev, struct kwqe *kwqe)
1246{ 1246{
1247 struct cnic_local *cp = dev->cnic_priv; 1247 struct cnic_local *cp = dev->cnic_priv;
1248 struct iscsi_kwqe_init1 *req1 = (struct iscsi_kwqe_init1 *) kwqe; 1248 struct iscsi_kwqe_init1 *req1 = (struct iscsi_kwqe_init1 *) kwqe;
1249 int func = cp->func, pages; 1249 int hq_bds, pages;
1250 int hq_bds; 1250 u32 pfid = cp->pfid;
1251 1251
1252 cp->num_iscsi_tasks = req1->num_tasks_per_conn; 1252 cp->num_iscsi_tasks = req1->num_tasks_per_conn;
1253 cp->num_ccells = req1->num_ccells_per_conn; 1253 cp->num_ccells = req1->num_ccells_per_conn;
@@ -1264,60 +1264,60 @@ static int cnic_bnx2x_iscsi_init1(struct cnic_dev *dev, struct kwqe *kwqe)
1264 return 0; 1264 return 0;
1265 1265
1266 /* init Tstorm RAM */ 1266 /* init Tstorm RAM */
1267 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + TSTORM_ISCSI_RQ_SIZE_OFFSET(func), 1267 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + TSTORM_ISCSI_RQ_SIZE_OFFSET(pfid),
1268 req1->rq_num_wqes); 1268 req1->rq_num_wqes);
1269 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + TSTORM_ISCSI_PAGE_SIZE_OFFSET(func), 1269 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + TSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid),
1270 PAGE_SIZE); 1270 PAGE_SIZE);
1271 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1271 CNIC_WR8(dev, BAR_TSTRORM_INTMEM +
1272 TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(func), PAGE_SHIFT); 1272 TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT);
1273 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + 1273 CNIC_WR16(dev, BAR_TSTRORM_INTMEM +
1274 TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(func), 1274 TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid),
1275 req1->num_tasks_per_conn); 1275 req1->num_tasks_per_conn);
1276 1276
1277 /* init Ustorm RAM */ 1277 /* init Ustorm RAM */
1278 CNIC_WR16(dev, BAR_USTRORM_INTMEM + 1278 CNIC_WR16(dev, BAR_USTRORM_INTMEM +
1279 USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(func), 1279 USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(pfid),
1280 req1->rq_buffer_size); 1280 req1->rq_buffer_size);
1281 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_PAGE_SIZE_OFFSET(func), 1281 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_PAGE_SIZE_OFFSET(pfid),
1282 PAGE_SIZE); 1282 PAGE_SIZE);
1283 CNIC_WR8(dev, BAR_USTRORM_INTMEM + 1283 CNIC_WR8(dev, BAR_USTRORM_INTMEM +
1284 USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(func), PAGE_SHIFT); 1284 USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT);
1285 CNIC_WR16(dev, BAR_USTRORM_INTMEM + 1285 CNIC_WR16(dev, BAR_USTRORM_INTMEM +
1286 USTORM_ISCSI_NUM_OF_TASKS_OFFSET(func), 1286 USTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid),
1287 req1->num_tasks_per_conn); 1287 req1->num_tasks_per_conn);
1288 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_RQ_SIZE_OFFSET(func), 1288 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_RQ_SIZE_OFFSET(pfid),
1289 req1->rq_num_wqes); 1289 req1->rq_num_wqes);
1290 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_CQ_SIZE_OFFSET(func), 1290 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_CQ_SIZE_OFFSET(pfid),
1291 req1->cq_num_wqes); 1291 req1->cq_num_wqes);
1292 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_R2TQ_SIZE_OFFSET(func), 1292 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_R2TQ_SIZE_OFFSET(pfid),
1293 cp->num_iscsi_tasks * BNX2X_ISCSI_MAX_PENDING_R2TS); 1293 cp->num_iscsi_tasks * BNX2X_ISCSI_MAX_PENDING_R2TS);
1294 1294
1295 /* init Xstorm RAM */ 1295 /* init Xstorm RAM */
1296 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_PAGE_SIZE_OFFSET(func), 1296 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid),
1297 PAGE_SIZE); 1297 PAGE_SIZE);
1298 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1298 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1299 XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(func), PAGE_SHIFT); 1299 XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT);
1300 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + 1300 CNIC_WR16(dev, BAR_XSTRORM_INTMEM +
1301 XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(func), 1301 XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid),
1302 req1->num_tasks_per_conn); 1302 req1->num_tasks_per_conn);
1303 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_HQ_SIZE_OFFSET(func), 1303 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_HQ_SIZE_OFFSET(pfid),
1304 hq_bds); 1304 hq_bds);
1305 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_SQ_SIZE_OFFSET(func), 1305 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_SQ_SIZE_OFFSET(pfid),
1306 req1->num_tasks_per_conn); 1306 req1->num_tasks_per_conn);
1307 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_R2TQ_SIZE_OFFSET(func), 1307 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_R2TQ_SIZE_OFFSET(pfid),
1308 cp->num_iscsi_tasks * BNX2X_ISCSI_MAX_PENDING_R2TS); 1308 cp->num_iscsi_tasks * BNX2X_ISCSI_MAX_PENDING_R2TS);
1309 1309
1310 /* init Cstorm RAM */ 1310 /* init Cstorm RAM */
1311 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_PAGE_SIZE_OFFSET(func), 1311 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid),
1312 PAGE_SIZE); 1312 PAGE_SIZE);
1313 CNIC_WR8(dev, BAR_CSTRORM_INTMEM + 1313 CNIC_WR8(dev, BAR_CSTRORM_INTMEM +
1314 CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(func), PAGE_SHIFT); 1314 CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT);
1315 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + 1315 CNIC_WR16(dev, BAR_CSTRORM_INTMEM +
1316 CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(func), 1316 CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid),
1317 req1->num_tasks_per_conn); 1317 req1->num_tasks_per_conn);
1318 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_CQ_SIZE_OFFSET(func), 1318 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_CQ_SIZE_OFFSET(pfid),
1319 req1->cq_num_wqes); 1319 req1->cq_num_wqes);
1320 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_HQ_SIZE_OFFSET(func), 1320 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_HQ_SIZE_OFFSET(pfid),
1321 hq_bds); 1321 hq_bds);
1322 1322
1323 return 0; 1323 return 0;
@@ -1327,7 +1327,7 @@ static int cnic_bnx2x_iscsi_init2(struct cnic_dev *dev, struct kwqe *kwqe)
1327{ 1327{
1328 struct iscsi_kwqe_init2 *req2 = (struct iscsi_kwqe_init2 *) kwqe; 1328 struct iscsi_kwqe_init2 *req2 = (struct iscsi_kwqe_init2 *) kwqe;
1329 struct cnic_local *cp = dev->cnic_priv; 1329 struct cnic_local *cp = dev->cnic_priv;
1330 int func = cp->func; 1330 u32 pfid = cp->pfid;
1331 struct iscsi_kcqe kcqe; 1331 struct iscsi_kcqe kcqe;
1332 struct kcqe *cqes[1]; 1332 struct kcqe *cqes[1];
1333 1333
@@ -1339,21 +1339,21 @@ static int cnic_bnx2x_iscsi_init2(struct cnic_dev *dev, struct kwqe *kwqe)
1339 } 1339 }
1340 1340
1341 CNIC_WR(dev, BAR_TSTRORM_INTMEM + 1341 CNIC_WR(dev, BAR_TSTRORM_INTMEM +
1342 TSTORM_ISCSI_ERROR_BITMAP_OFFSET(func), req2->error_bit_map[0]); 1342 TSTORM_ISCSI_ERROR_BITMAP_OFFSET(pfid), req2->error_bit_map[0]);
1343 CNIC_WR(dev, BAR_TSTRORM_INTMEM + 1343 CNIC_WR(dev, BAR_TSTRORM_INTMEM +
1344 TSTORM_ISCSI_ERROR_BITMAP_OFFSET(func) + 4, 1344 TSTORM_ISCSI_ERROR_BITMAP_OFFSET(pfid) + 4,
1345 req2->error_bit_map[1]); 1345 req2->error_bit_map[1]);
1346 1346
1347 CNIC_WR16(dev, BAR_USTRORM_INTMEM + 1347 CNIC_WR16(dev, BAR_USTRORM_INTMEM +
1348 USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(func), req2->max_cq_sqn); 1348 USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfid), req2->max_cq_sqn);
1349 CNIC_WR(dev, BAR_USTRORM_INTMEM + 1349 CNIC_WR(dev, BAR_USTRORM_INTMEM +
1350 USTORM_ISCSI_ERROR_BITMAP_OFFSET(func), req2->error_bit_map[0]); 1350 USTORM_ISCSI_ERROR_BITMAP_OFFSET(pfid), req2->error_bit_map[0]);
1351 CNIC_WR(dev, BAR_USTRORM_INTMEM + 1351 CNIC_WR(dev, BAR_USTRORM_INTMEM +
1352 USTORM_ISCSI_ERROR_BITMAP_OFFSET(func) + 4, 1352 USTORM_ISCSI_ERROR_BITMAP_OFFSET(pfid) + 4,
1353 req2->error_bit_map[1]); 1353 req2->error_bit_map[1]);
1354 1354
1355 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + 1355 CNIC_WR16(dev, BAR_CSTRORM_INTMEM +
1356 CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(func), req2->max_cq_sqn); 1356 CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfid), req2->max_cq_sqn);
1357 1357
1358 kcqe.completion_status = ISCSI_KCQE_COMPLETION_STATUS_SUCCESS; 1358 kcqe.completion_status = ISCSI_KCQE_COMPLETION_STATUS_SUCCESS;
1359 1359
@@ -1804,37 +1804,37 @@ static void cnic_init_storm_conn_bufs(struct cnic_dev *dev,
1804static void cnic_init_bnx2x_mac(struct cnic_dev *dev) 1804static void cnic_init_bnx2x_mac(struct cnic_dev *dev)
1805{ 1805{
1806 struct cnic_local *cp = dev->cnic_priv; 1806 struct cnic_local *cp = dev->cnic_priv;
1807 int func = CNIC_FUNC(cp); 1807 u32 pfid = cp->pfid;
1808 u8 *mac = dev->mac_addr; 1808 u8 *mac = dev->mac_addr;
1809 1809
1810 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1810 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1811 XSTORM_ISCSI_LOCAL_MAC_ADDR0_OFFSET(func), mac[0]); 1811 XSTORM_ISCSI_LOCAL_MAC_ADDR0_OFFSET(pfid), mac[0]);
1812 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1812 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1813 XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(func), mac[1]); 1813 XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(pfid), mac[1]);
1814 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1814 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1815 XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(func), mac[2]); 1815 XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(pfid), mac[2]);
1816 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1816 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1817 XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(func), mac[3]); 1817 XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(pfid), mac[3]);
1818 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1818 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1819 XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(func), mac[4]); 1819 XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(pfid), mac[4]);
1820 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1820 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1821 XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(func), mac[5]); 1821 XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(pfid), mac[5]);
1822 1822
1823 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1823 CNIC_WR8(dev, BAR_TSTRORM_INTMEM +
1824 TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(func), mac[5]); 1824 TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(pfid), mac[5]);
1825 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1825 CNIC_WR8(dev, BAR_TSTRORM_INTMEM +
1826 TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(func) + 1, 1826 TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(pfid) + 1,
1827 mac[4]); 1827 mac[4]);
1828 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1828 CNIC_WR8(dev, BAR_TSTRORM_INTMEM +
1829 TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(func), mac[3]); 1829 TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(pfid), mac[3]);
1830 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1830 CNIC_WR8(dev, BAR_TSTRORM_INTMEM +
1831 TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(func) + 1, 1831 TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(pfid) + 1,
1832 mac[2]); 1832 mac[2]);
1833 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1833 CNIC_WR8(dev, BAR_TSTRORM_INTMEM +
1834 TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(func) + 2, 1834 TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(pfid) + 2,
1835 mac[1]); 1835 mac[1]);
1836 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1836 CNIC_WR8(dev, BAR_TSTRORM_INTMEM +
1837 TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(func) + 3, 1837 TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(pfid) + 3,
1838 mac[0]); 1838 mac[0]);
1839} 1839}
1840 1840
@@ -1850,10 +1850,10 @@ static void cnic_bnx2x_set_tcp_timestamp(struct cnic_dev *dev, int tcp_ts)
1850 } 1850 }
1851 1851
1852 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1852 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1853 XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(cp->func), xstorm_flags); 1853 XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(cp->pfid), xstorm_flags);
1854 1854
1855 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + 1855 CNIC_WR16(dev, BAR_TSTRORM_INTMEM +
1856 TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(cp->func), tstorm_flags); 1856 TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(cp->pfid), tstorm_flags);
1857} 1857}
1858 1858
1859static int cnic_bnx2x_connect(struct cnic_dev *dev, struct kwqe *wqes[], 1859static int cnic_bnx2x_connect(struct cnic_dev *dev, struct kwqe *wqes[],
@@ -1928,7 +1928,7 @@ static int cnic_bnx2x_connect(struct cnic_dev *dev, struct kwqe *wqes[],
1928 cnic_init_storm_conn_bufs(dev, kwqe1, kwqe3, conn_buf); 1928 cnic_init_storm_conn_bufs(dev, kwqe1, kwqe3, conn_buf);
1929 1929
1930 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + 1930 CNIC_WR16(dev, BAR_XSTRORM_INTMEM +
1931 XSTORM_ISCSI_LOCAL_VLAN_OFFSET(cp->func), csk->vlan_id); 1931 XSTORM_ISCSI_LOCAL_VLAN_OFFSET(cp->pfid), csk->vlan_id);
1932 1932
1933 cnic_bnx2x_set_tcp_timestamp(dev, 1933 cnic_bnx2x_set_tcp_timestamp(dev,
1934 kwqe1->tcp_flags & L4_KWQ_CONNECT_REQ1_TIME_STAMP); 1934 kwqe1->tcp_flags & L4_KWQ_CONNECT_REQ1_TIME_STAMP);
@@ -3283,30 +3283,30 @@ static void cnic_cm_stop_bnx2x_hw(struct cnic_dev *dev)
3283static int cnic_cm_init_bnx2x_hw(struct cnic_dev *dev) 3283static int cnic_cm_init_bnx2x_hw(struct cnic_dev *dev)
3284{ 3284{
3285 struct cnic_local *cp = dev->cnic_priv; 3285 struct cnic_local *cp = dev->cnic_priv;
3286 int func = CNIC_FUNC(cp); 3286 u32 pfid = cp->pfid;
3287 3287
3288 cnic_init_bnx2x_mac(dev); 3288 cnic_init_bnx2x_mac(dev);
3289 cnic_bnx2x_set_tcp_timestamp(dev, 1); 3289 cnic_bnx2x_set_tcp_timestamp(dev, 1);
3290 3290
3291 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + 3291 CNIC_WR16(dev, BAR_XSTRORM_INTMEM +
3292 XSTORM_ISCSI_LOCAL_VLAN_OFFSET(func), 0); 3292 XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfid), 0);
3293 3293
3294 CNIC_WR(dev, BAR_XSTRORM_INTMEM + 3294 CNIC_WR(dev, BAR_XSTRORM_INTMEM +
3295 XSTORM_TCP_GLOBAL_DEL_ACK_COUNTER_ENABLED_OFFSET(func), 1); 3295 XSTORM_TCP_GLOBAL_DEL_ACK_COUNTER_ENABLED_OFFSET(pfid), 1);
3296 CNIC_WR(dev, BAR_XSTRORM_INTMEM + 3296 CNIC_WR(dev, BAR_XSTRORM_INTMEM +
3297 XSTORM_TCP_GLOBAL_DEL_ACK_COUNTER_MAX_COUNT_OFFSET(func), 3297 XSTORM_TCP_GLOBAL_DEL_ACK_COUNTER_MAX_COUNT_OFFSET(pfid),
3298 DEF_MAX_DA_COUNT); 3298 DEF_MAX_DA_COUNT);
3299 3299
3300 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 3300 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
3301 XSTORM_ISCSI_TCP_VARS_TTL_OFFSET(func), DEF_TTL); 3301 XSTORM_ISCSI_TCP_VARS_TTL_OFFSET(pfid), DEF_TTL);
3302 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 3302 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
3303 XSTORM_ISCSI_TCP_VARS_TOS_OFFSET(func), DEF_TOS); 3303 XSTORM_ISCSI_TCP_VARS_TOS_OFFSET(pfid), DEF_TOS);
3304 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 3304 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
3305 XSTORM_ISCSI_TCP_VARS_ADV_WND_SCL_OFFSET(func), 2); 3305 XSTORM_ISCSI_TCP_VARS_ADV_WND_SCL_OFFSET(pfid), 2);
3306 CNIC_WR(dev, BAR_XSTRORM_INTMEM + 3306 CNIC_WR(dev, BAR_XSTRORM_INTMEM +
3307 XSTORM_TCP_TX_SWS_TIMER_VAL_OFFSET(func), DEF_SWS_TIMER); 3307 XSTORM_TCP_TX_SWS_TIMER_VAL_OFFSET(pfid), DEF_SWS_TIMER);
3308 3308
3309 CNIC_WR(dev, BAR_TSTRORM_INTMEM + TSTORM_TCP_MAX_CWND_OFFSET(func), 3309 CNIC_WR(dev, BAR_TSTRORM_INTMEM + TSTORM_TCP_MAX_CWND_OFFSET(pfid),
3310 DEF_MAX_CWND); 3310 DEF_MAX_CWND);
3311 return 0; 3311 return 0;
3312} 3312}
@@ -4123,9 +4123,13 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
4123 struct cnic_local *cp = dev->cnic_priv; 4123 struct cnic_local *cp = dev->cnic_priv;
4124 int func = CNIC_FUNC(cp), ret, i; 4124 int func = CNIC_FUNC(cp), ret, i;
4125 int port = CNIC_PORT(cp); 4125 int port = CNIC_PORT(cp);
4126 u32 pfid;
4126 u16 eq_idx; 4127 u16 eq_idx;
4127 u8 sb_id = cp->status_blk_num; 4128 u8 sb_id = cp->status_blk_num;
4128 4129
4130 cp->pfid = func;
4131 pfid = cp->pfid;
4132
4129 ret = cnic_init_id_tbl(&cp->cid_tbl, MAX_ISCSI_TBL_SZ, 4133 ret = cnic_init_id_tbl(&cp->cid_tbl, MAX_ISCSI_TBL_SZ,
4130 cp->iscsi_start_cid); 4134 cp->iscsi_start_cid);
4131 4135
@@ -4133,7 +4137,7 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
4133 return -ENOMEM; 4137 return -ENOMEM;
4134 4138
4135 cp->kcq1.io_addr = BAR_CSTRORM_INTMEM + 4139 cp->kcq1.io_addr = BAR_CSTRORM_INTMEM +
4136 CSTORM_ISCSI_EQ_PROD_OFFSET(func, 0); 4140 CSTORM_ISCSI_EQ_PROD_OFFSET(pfid, 0);
4137 cp->kcq1.sw_prod_idx = 0; 4141 cp->kcq1.sw_prod_idx = 0;
4138 4142
4139 cp->kcq1.hw_prod_idx_ptr = 4143 cp->kcq1.hw_prod_idx_ptr =
@@ -4147,41 +4151,41 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
4147 /* Only 1 EQ */ 4151 /* Only 1 EQ */
4148 CNIC_WR16(dev, cp->kcq1.io_addr, MAX_KCQ_IDX); 4152 CNIC_WR16(dev, cp->kcq1.io_addr, MAX_KCQ_IDX);
4149 CNIC_WR(dev, BAR_CSTRORM_INTMEM + 4153 CNIC_WR(dev, BAR_CSTRORM_INTMEM +
4150 CSTORM_ISCSI_EQ_CONS_OFFSET(func, 0), 0); 4154 CSTORM_ISCSI_EQ_CONS_OFFSET(pfid, 0), 0);
4151 CNIC_WR(dev, BAR_CSTRORM_INTMEM + 4155 CNIC_WR(dev, BAR_CSTRORM_INTMEM +
4152 CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(func, 0), 4156 CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(pfid, 0),
4153 cp->kcq1.dma.pg_map_arr[1] & 0xffffffff); 4157 cp->kcq1.dma.pg_map_arr[1] & 0xffffffff);
4154 CNIC_WR(dev, BAR_CSTRORM_INTMEM + 4158 CNIC_WR(dev, BAR_CSTRORM_INTMEM +
4155 CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(func, 0) + 4, 4159 CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(pfid, 0) + 4,
4156 (u64) cp->kcq1.dma.pg_map_arr[1] >> 32); 4160 (u64) cp->kcq1.dma.pg_map_arr[1] >> 32);
4157 CNIC_WR(dev, BAR_CSTRORM_INTMEM + 4161 CNIC_WR(dev, BAR_CSTRORM_INTMEM +
4158 CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(func, 0), 4162 CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(pfid, 0),
4159 cp->kcq1.dma.pg_map_arr[0] & 0xffffffff); 4163 cp->kcq1.dma.pg_map_arr[0] & 0xffffffff);
4160 CNIC_WR(dev, BAR_CSTRORM_INTMEM + 4164 CNIC_WR(dev, BAR_CSTRORM_INTMEM +
4161 CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(func, 0) + 4, 4165 CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(pfid, 0) + 4,
4162 (u64) cp->kcq1.dma.pg_map_arr[0] >> 32); 4166 (u64) cp->kcq1.dma.pg_map_arr[0] >> 32);
4163 CNIC_WR8(dev, BAR_CSTRORM_INTMEM + 4167 CNIC_WR8(dev, BAR_CSTRORM_INTMEM +
4164 CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_VALID_OFFSET(func, 0), 1); 4168 CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_VALID_OFFSET(pfid, 0), 1);
4165 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + 4169 CNIC_WR16(dev, BAR_CSTRORM_INTMEM +
4166 CSTORM_ISCSI_EQ_SB_NUM_OFFSET(func, 0), cp->status_blk_num); 4170 CSTORM_ISCSI_EQ_SB_NUM_OFFSET(pfid, 0), cp->status_blk_num);
4167 CNIC_WR8(dev, BAR_CSTRORM_INTMEM + 4171 CNIC_WR8(dev, BAR_CSTRORM_INTMEM +
4168 CSTORM_ISCSI_EQ_SB_INDEX_OFFSET(func, 0), 4172 CSTORM_ISCSI_EQ_SB_INDEX_OFFSET(pfid, 0),
4169 HC_INDEX_C_ISCSI_EQ_CONS); 4173 HC_INDEX_C_ISCSI_EQ_CONS);
4170 4174
4171 for (i = 0; i < cp->conn_buf_info.num_pages; i++) { 4175 for (i = 0; i < cp->conn_buf_info.num_pages; i++) {
4172 CNIC_WR(dev, BAR_TSTRORM_INTMEM + 4176 CNIC_WR(dev, BAR_TSTRORM_INTMEM +
4173 TSTORM_ISCSI_CONN_BUF_PBL_OFFSET(func, i), 4177 TSTORM_ISCSI_CONN_BUF_PBL_OFFSET(pfid, i),
4174 cp->conn_buf_info.pgtbl[2 * i]); 4178 cp->conn_buf_info.pgtbl[2 * i]);
4175 CNIC_WR(dev, BAR_TSTRORM_INTMEM + 4179 CNIC_WR(dev, BAR_TSTRORM_INTMEM +
4176 TSTORM_ISCSI_CONN_BUF_PBL_OFFSET(func, i) + 4, 4180 TSTORM_ISCSI_CONN_BUF_PBL_OFFSET(pfid, i) + 4,
4177 cp->conn_buf_info.pgtbl[(2 * i) + 1]); 4181 cp->conn_buf_info.pgtbl[(2 * i) + 1]);
4178 } 4182 }
4179 4183
4180 CNIC_WR(dev, BAR_USTRORM_INTMEM + 4184 CNIC_WR(dev, BAR_USTRORM_INTMEM +
4181 USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(func), 4185 USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(pfid),
4182 cp->gbl_buf_info.pg_map_arr[0] & 0xffffffff); 4186 cp->gbl_buf_info.pg_map_arr[0] & 0xffffffff);
4183 CNIC_WR(dev, BAR_USTRORM_INTMEM + 4187 CNIC_WR(dev, BAR_USTRORM_INTMEM +
4184 USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(func) + 4, 4188 USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(pfid) + 4,
4185 (u64) cp->gbl_buf_info.pg_map_arr[0] >> 32); 4189 (u64) cp->gbl_buf_info.pg_map_arr[0] >> 32);
4186 4190
4187 cnic_setup_bnx2x_context(dev); 4191 cnic_setup_bnx2x_context(dev);
@@ -4386,7 +4390,7 @@ static void cnic_stop_bnx2x_hw(struct cnic_dev *dev)
4386 index_values[HC_INDEX_C_ISCSI_EQ_CONS]), 4390 index_values[HC_INDEX_C_ISCSI_EQ_CONS]),
4387 0); 4391 0);
4388 CNIC_WR(dev, BAR_CSTRORM_INTMEM + 4392 CNIC_WR(dev, BAR_CSTRORM_INTMEM +
4389 CSTORM_ISCSI_EQ_CONS_OFFSET(cp->func, 0), 0); 4393 CSTORM_ISCSI_EQ_CONS_OFFSET(cp->pfid, 0), 0);
4390 CNIC_WR16(dev, cp->kcq1.io_addr, 0); 4394 CNIC_WR16(dev, cp->kcq1.io_addr, 0);
4391 cnic_free_resc(dev); 4395 cnic_free_resc(dev);
4392} 4396}