aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-05 17:54:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-05 17:54:29 -0400
commitcc998ff8811530be521f6b316f37ab7676a07938 (patch)
treea054b3bf4b2ef406bf756a6cfc9be2f9115f17ae /arch
parent57d730924d5cc2c3e280af16a9306587c3a511db (diff)
parent0d40f75bdab241868c0eb6f97aef9f8b3a66f7b3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking changes from David Miller: "Noteworthy changes this time around: 1) Multicast rejoin support for team driver, from Jiri Pirko. 2) Centralize and simplify TCP RTT measurement handling in order to reduce the impact of bad RTO seeding from SYN/ACKs. Also, when both timestamps and local RTT measurements are available prefer the later because there are broken middleware devices which scramble the timestamp. From Yuchung Cheng. 3) Add TCP_NOTSENT_LOWAT socket option to limit the amount of kernel memory consumed to queue up unsend user data. From Eric Dumazet. 4) Add a "physical port ID" abstraction for network devices, from Jiri Pirko. 5) Add a "suppress" operation to influence fib_rules lookups, from Stefan Tomanek. 6) Add a networking development FAQ, from Paul Gortmaker. 7) Extend the information provided by tcp_probe and add ipv6 support, from Daniel Borkmann. 8) Use RCU locking more extensively in openvswitch data paths, from Pravin B Shelar. 9) Add SCTP support to openvswitch, from Joe Stringer. 10) Add EF10 chip support to SFC driver, from Ben Hutchings. 11) Add new SYNPROXY netfilter target, from Patrick McHardy. 12) Compute a rate approximation for sending in TCP sockets, and use this to more intelligently coalesce TSO frames. Furthermore, add a new packet scheduler which takes advantage of this estimate when available. From Eric Dumazet. 13) Allow AF_PACKET fanouts with random selection, from Daniel Borkmann. 14) Add ipv6 support to vxlan driver, from Cong Wang" Resolved conflicts as per discussion. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1218 commits) openvswitch: Fix alignment of struct sw_flow_key. netfilter: Fix build errors with xt_socket.c tcp: Add missing braces to do_tcp_setsockopt caif: Add missing braces to multiline if in cfctrl_linkup_request bnx2x: Add missing braces in bnx2x:bnx2x_link_initialize vxlan: Fix kernel panic on device delete. net: mvneta: implement ->ndo_do_ioctl() to support PHY ioctls net: mvneta: properly disable HW PHY polling and ensure adjust_link() works icplus: Use netif_running to determine device state ethernet/arc/arc_emac: Fix huge delays in large file copies tuntap: orphan frags before trying to set tx timestamp tuntap: purge socket error queue on detach qlcnic: use standard NAPI weights ipv6:introduce function to find route for redirect bnx2x: VF RSS support - VF side bnx2x: VF RSS support - PF side vxlan: Notify drivers for listening UDP port changes net: usbnet: update addr_assign_type if appropriate driver/net: enic: update enic maintainers and driver driver/net: enic: Exposing symbols for Cisco's low latency driver ...
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/sama5d3xmb.dtsi8
-rw-r--r--arch/arm/mach-pxa/icontrol.c3
-rw-r--r--arch/arm/mach-pxa/zeus.c46
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c1
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c1
-rw-r--r--arch/sh/boards/board-espt.c1
-rw-r--r--arch/sh/boards/board-sh7757lcr.c4
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c1
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c3
-rw-r--r--arch/sh/boards/mach-sh7763rdp/setup.c1
-rw-r--r--arch/sh/kernel/cpu/sh2/setup-sh7619.c11
-rw-r--r--arch/tile/gxio/iorpc_mpipe.c66
-rw-r--r--arch/tile/gxio/iorpc_mpipe_info.c18
-rw-r--r--arch/tile/gxio/mpipe.c43
-rw-r--r--arch/tile/include/gxio/iorpc_mpipe.h14
-rw-r--r--arch/tile/include/gxio/iorpc_mpipe_info.h4
-rw-r--r--arch/tile/include/gxio/mpipe.h143
-rw-r--r--arch/tile/include/hv/drv_mpipe_intf.h3
18 files changed, 323 insertions, 48 deletions
diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi
index 8a9e05d8a4b8..dba739b6ef36 100644
--- a/arch/arm/boot/dts/sama5d3xmb.dtsi
+++ b/arch/arm/boot/dts/sama5d3xmb.dtsi
@@ -81,6 +81,14 @@
81 81
82 macb1: ethernet@f802c000 { 82 macb1: ethernet@f802c000 {
83 phy-mode = "rmii"; 83 phy-mode = "rmii";
84
85 #address-cells = <1>;
86 #size-cells = <0>;
87 phy0: ethernet-phy@1 {
88 interrupt-parent = <&pioE>;
89 interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
90 reg = <1>;
91 };
84 }; 92 };
85 93
86 pinctrl@fffff200 { 94 pinctrl@fffff200 {
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c
index fe31bfcbb8df..c98511c5abd1 100644
--- a/arch/arm/mach-pxa/icontrol.c
+++ b/arch/arm/mach-pxa/icontrol.c
@@ -73,9 +73,6 @@ static struct pxa2xx_spi_chip mcp251x_chip_info4 = {
73 73
74static struct mcp251x_platform_data mcp251x_info = { 74static struct mcp251x_platform_data mcp251x_info = {
75 .oscillator_frequency = 16E6, 75 .oscillator_frequency = 16E6,
76 .board_specific_setup = NULL,
77 .power_enable = NULL,
78 .transceiver_enable = NULL
79}; 76};
80 77
81static struct spi_board_info mcp251x_board_info[] = { 78static struct spi_board_info mcp251x_board_info[] = {
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index f5d436434566..04a0aea23873 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -29,6 +29,8 @@
29#include <linux/i2c/pca953x.h> 29#include <linux/i2c/pca953x.h>
30#include <linux/apm-emulation.h> 30#include <linux/apm-emulation.h>
31#include <linux/can/platform/mcp251x.h> 31#include <linux/can/platform/mcp251x.h>
32#include <linux/regulator/fixed.h>
33#include <linux/regulator/machine.h>
32 34
33#include <asm/mach-types.h> 35#include <asm/mach-types.h>
34#include <asm/suspend.h> 36#include <asm/suspend.h>
@@ -391,33 +393,34 @@ static struct pxa2xx_spi_master pxa2xx_spi_ssp3_master_info = {
391}; 393};
392 394
393/* CAN bus on SPI */ 395/* CAN bus on SPI */
394static int zeus_mcp2515_setup(struct spi_device *sdev) 396static struct regulator_consumer_supply can_regulator_consumer =
395{ 397 REGULATOR_SUPPLY("vdd", "spi3.0");
396 int err;
397
398 err = gpio_request(ZEUS_CAN_SHDN_GPIO, "CAN shutdown");
399 if (err)
400 return err;
401 398
402 err = gpio_direction_output(ZEUS_CAN_SHDN_GPIO, 1); 399static struct regulator_init_data can_regulator_init_data = {
403 if (err) { 400 .constraints = {
404 gpio_free(ZEUS_CAN_SHDN_GPIO); 401 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
405 return err; 402 },
406 } 403 .consumer_supplies = &can_regulator_consumer,
404 .num_consumer_supplies = 1,
405};
407 406
408 return 0; 407static struct fixed_voltage_config can_regulator_pdata = {
409} 408 .supply_name = "CAN_SHDN",
409 .microvolts = 3300000,
410 .gpio = ZEUS_CAN_SHDN_GPIO,
411 .init_data = &can_regulator_init_data,
412};
410 413
411static int zeus_mcp2515_transceiver_enable(int enable) 414static struct platform_device can_regulator_device = {
412{ 415 .name = "reg-fixed-volage",
413 gpio_set_value(ZEUS_CAN_SHDN_GPIO, !enable); 416 .id = -1,
414 return 0; 417 .dev = {
415} 418 .platform_data = &can_regulator_pdata,
419 },
420};
416 421
417static struct mcp251x_platform_data zeus_mcp2515_pdata = { 422static struct mcp251x_platform_data zeus_mcp2515_pdata = {
418 .oscillator_frequency = 16*1000*1000, 423 .oscillator_frequency = 16*1000*1000,
419 .board_specific_setup = zeus_mcp2515_setup,
420 .power_enable = zeus_mcp2515_transceiver_enable,
421}; 424};
422 425
423static struct spi_board_info zeus_spi_board_info[] = { 426static struct spi_board_info zeus_spi_board_info[] = {
@@ -516,6 +519,7 @@ static struct platform_device *zeus_devices[] __initdata = {
516 &zeus_leds_device, 519 &zeus_leds_device,
517 &zeus_pcmcia_device, 520 &zeus_pcmcia_device,
518 &zeus_max6369_device, 521 &zeus_max6369_device,
522 &can_regulator_device,
519}; 523};
520 524
521/* AC'97 */ 525/* AC'97 */
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index c5be60d85e4b..3a6ffa250fb1 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -358,7 +358,6 @@ static struct platform_device usbhsf_device = {
358static struct sh_eth_plat_data sh_eth_platdata = { 358static struct sh_eth_plat_data sh_eth_platdata = {
359 .phy = 0x00, /* LAN8710A */ 359 .phy = 0x00, /* LAN8710A */
360 .edmac_endian = EDMAC_LITTLE_ENDIAN, 360 .edmac_endian = EDMAC_LITTLE_ENDIAN,
361 .register_type = SH_ETH_REG_GIGABIT,
362 .phy_interface = PHY_INTERFACE_MODE_MII, 361 .phy_interface = PHY_INTERFACE_MODE_MII,
363}; 362};
364 363
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index 24f26ee97f42..35dd7f201a16 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -91,7 +91,6 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
91static struct sh_eth_plat_data ether_platform_data __initdata = { 91static struct sh_eth_plat_data ether_platform_data __initdata = {
92 .phy = 0x01, 92 .phy = 0x01,
93 .edmac_endian = EDMAC_LITTLE_ENDIAN, 93 .edmac_endian = EDMAC_LITTLE_ENDIAN,
94 .register_type = SH_ETH_REG_FAST_RCAR,
95 .phy_interface = PHY_INTERFACE_MODE_RMII, 94 .phy_interface = PHY_INTERFACE_MODE_RMII,
96 /* 95 /*
97 * Although the LINK signal is available on the board, it's connected to 96 * Although the LINK signal is available on the board, it's connected to
diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c
index 4d94dff9015c..7291e2f11a47 100644
--- a/arch/sh/boards/board-espt.c
+++ b/arch/sh/boards/board-espt.c
@@ -80,7 +80,6 @@ static struct resource sh_eth_resources[] = {
80static struct sh_eth_plat_data sh7763_eth_pdata = { 80static struct sh_eth_plat_data sh7763_eth_pdata = {
81 .phy = 0, 81 .phy = 0,
82 .edmac_endian = EDMAC_LITTLE_ENDIAN, 82 .edmac_endian = EDMAC_LITTLE_ENDIAN,
83 .register_type = SH_ETH_REG_GIGABIT,
84 .phy_interface = PHY_INTERFACE_MODE_MII, 83 .phy_interface = PHY_INTERFACE_MODE_MII,
85}; 84};
86 85
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
index 4f114d1cd019..25c5a932f9fe 100644
--- a/arch/sh/boards/board-sh7757lcr.c
+++ b/arch/sh/boards/board-sh7757lcr.c
@@ -77,7 +77,6 @@ static struct resource sh_eth0_resources[] = {
77static struct sh_eth_plat_data sh7757_eth0_pdata = { 77static struct sh_eth_plat_data sh7757_eth0_pdata = {
78 .phy = 1, 78 .phy = 1,
79 .edmac_endian = EDMAC_LITTLE_ENDIAN, 79 .edmac_endian = EDMAC_LITTLE_ENDIAN,
80 .register_type = SH_ETH_REG_FAST_SH4,
81 .set_mdio_gate = sh7757_eth_set_mdio_gate, 80 .set_mdio_gate = sh7757_eth_set_mdio_gate,
82}; 81};
83 82
@@ -106,7 +105,6 @@ static struct resource sh_eth1_resources[] = {
106static struct sh_eth_plat_data sh7757_eth1_pdata = { 105static struct sh_eth_plat_data sh7757_eth1_pdata = {
107 .phy = 1, 106 .phy = 1,
108 .edmac_endian = EDMAC_LITTLE_ENDIAN, 107 .edmac_endian = EDMAC_LITTLE_ENDIAN,
109 .register_type = SH_ETH_REG_FAST_SH4,
110 .set_mdio_gate = sh7757_eth_set_mdio_gate, 108 .set_mdio_gate = sh7757_eth_set_mdio_gate,
111}; 109};
112 110
@@ -151,7 +149,6 @@ static struct resource sh_eth_giga0_resources[] = {
151static struct sh_eth_plat_data sh7757_eth_giga0_pdata = { 149static struct sh_eth_plat_data sh7757_eth_giga0_pdata = {
152 .phy = 18, 150 .phy = 18,
153 .edmac_endian = EDMAC_LITTLE_ENDIAN, 151 .edmac_endian = EDMAC_LITTLE_ENDIAN,
154 .register_type = SH_ETH_REG_GIGABIT,
155 .set_mdio_gate = sh7757_eth_giga_set_mdio_gate, 152 .set_mdio_gate = sh7757_eth_giga_set_mdio_gate,
156 .phy_interface = PHY_INTERFACE_MODE_RGMII_ID, 153 .phy_interface = PHY_INTERFACE_MODE_RGMII_ID,
157}; 154};
@@ -186,7 +183,6 @@ static struct resource sh_eth_giga1_resources[] = {
186static struct sh_eth_plat_data sh7757_eth_giga1_pdata = { 183static struct sh_eth_plat_data sh7757_eth_giga1_pdata = {
187 .phy = 19, 184 .phy = 19,
188 .edmac_endian = EDMAC_LITTLE_ENDIAN, 185 .edmac_endian = EDMAC_LITTLE_ENDIAN,
189 .register_type = SH_ETH_REG_GIGABIT,
190 .set_mdio_gate = sh7757_eth_giga_set_mdio_gate, 186 .set_mdio_gate = sh7757_eth_giga_set_mdio_gate,
191 .phy_interface = PHY_INTERFACE_MODE_RGMII_ID, 187 .phy_interface = PHY_INTERFACE_MODE_RGMII_ID,
192}; 188};
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 61fade0ffa96..a4f630f04ea3 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -159,7 +159,6 @@ static struct resource sh_eth_resources[] = {
159static struct sh_eth_plat_data sh_eth_plat = { 159static struct sh_eth_plat_data sh_eth_plat = {
160 .phy = 0x1f, /* SMSC LAN8700 */ 160 .phy = 0x1f, /* SMSC LAN8700 */
161 .edmac_endian = EDMAC_LITTLE_ENDIAN, 161 .edmac_endian = EDMAC_LITTLE_ENDIAN,
162 .register_type = SH_ETH_REG_FAST_SH4,
163 .phy_interface = PHY_INTERFACE_MODE_MII, 162 .phy_interface = PHY_INTERFACE_MODE_MII,
164 .ether_link_active_low = 1 163 .ether_link_active_low = 1
165}; 164};
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index b70180ef3e29..21e4230659a5 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -365,7 +365,7 @@ static struct platform_device keysc_device = {
365static struct resource sh_eth_resources[] = { 365static struct resource sh_eth_resources[] = {
366 [0] = { 366 [0] = {
367 .start = SH_ETH_ADDR, 367 .start = SH_ETH_ADDR,
368 .end = SH_ETH_ADDR + 0x1FC, 368 .end = SH_ETH_ADDR + 0x1FC - 1,
369 .flags = IORESOURCE_MEM, 369 .flags = IORESOURCE_MEM,
370 }, 370 },
371 [1] = { 371 [1] = {
@@ -377,6 +377,7 @@ static struct resource sh_eth_resources[] = {
377static struct sh_eth_plat_data sh_eth_plat = { 377static struct sh_eth_plat_data sh_eth_plat = {
378 .phy = 0x1f, /* SMSC LAN8187 */ 378 .phy = 0x1f, /* SMSC LAN8187 */
379 .edmac_endian = EDMAC_LITTLE_ENDIAN, 379 .edmac_endian = EDMAC_LITTLE_ENDIAN,
380 .phy_interface = PHY_INTERFACE_MODE_MII,
380}; 381};
381 382
382static struct platform_device sh_eth_device = { 383static struct platform_device sh_eth_device = {
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
index 50ba481fa240..2c8fb04685d4 100644
--- a/arch/sh/boards/mach-sh7763rdp/setup.c
+++ b/arch/sh/boards/mach-sh7763rdp/setup.c
@@ -88,7 +88,6 @@ static struct resource sh_eth_resources[] = {
88static struct sh_eth_plat_data sh7763_eth_pdata = { 88static struct sh_eth_plat_data sh7763_eth_pdata = {
89 .phy = 1, 89 .phy = 1,
90 .edmac_endian = EDMAC_LITTLE_ENDIAN, 90 .edmac_endian = EDMAC_LITTLE_ENDIAN,
91 .register_type = SH_ETH_REG_GIGABIT,
92 .phy_interface = PHY_INTERFACE_MODE_MII, 91 .phy_interface = PHY_INTERFACE_MODE_MII,
93}; 92};
94 93
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
index bb11e1925178..4df4d4ffe39b 100644
--- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/serial.h> 13#include <linux/serial.h>
14#include <linux/serial_sci.h> 14#include <linux/serial_sci.h>
15#include <linux/sh_eth.h>
15#include <linux/sh_timer.h> 16#include <linux/sh_timer.h>
16#include <linux/io.h> 17#include <linux/io.h>
17 18
@@ -110,10 +111,16 @@ static struct platform_device scif2_device = {
110 }, 111 },
111}; 112};
112 113
114static struct sh_eth_plat_data eth_platform_data = {
115 .phy = 1,
116 .edmac_endian = EDMAC_LITTLE_ENDIAN,
117 .phy_interface = PHY_INTERFACE_MODE_MII,
118};
119
113static struct resource eth_resources[] = { 120static struct resource eth_resources[] = {
114 [0] = { 121 [0] = {
115 .start = 0xfb000000, 122 .start = 0xfb000000,
116 .end = 0xfb0001c8, 123 .end = 0xfb0001c7,
117 .flags = IORESOURCE_MEM, 124 .flags = IORESOURCE_MEM,
118 }, 125 },
119 [1] = { 126 [1] = {
@@ -127,7 +134,7 @@ static struct platform_device eth_device = {
127 .name = "sh7619-ether", 134 .name = "sh7619-ether",
128 .id = -1, 135 .id = -1,
129 .dev = { 136 .dev = {
130 .platform_data = (void *)1, 137 .platform_data = &eth_platform_data,
131 }, 138 },
132 .num_resources = ARRAY_SIZE(eth_resources), 139 .num_resources = ARRAY_SIZE(eth_resources),
133 .resource = eth_resources, 140 .resource = eth_resources,
diff --git a/arch/tile/gxio/iorpc_mpipe.c b/arch/tile/gxio/iorpc_mpipe.c
index 31b87bf8c027..4f8f3d619c4a 100644
--- a/arch/tile/gxio/iorpc_mpipe.c
+++ b/arch/tile/gxio/iorpc_mpipe.c
@@ -387,6 +387,27 @@ int gxio_mpipe_link_close_aux(gxio_mpipe_context_t * context, int mac)
387 387
388EXPORT_SYMBOL(gxio_mpipe_link_close_aux); 388EXPORT_SYMBOL(gxio_mpipe_link_close_aux);
389 389
390struct link_set_attr_aux_param {
391 int mac;
392 uint32_t attr;
393 int64_t val;
394};
395
396int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t * context, int mac,
397 uint32_t attr, int64_t val)
398{
399 struct link_set_attr_aux_param temp;
400 struct link_set_attr_aux_param *params = &temp;
401
402 params->mac = mac;
403 params->attr = attr;
404 params->val = val;
405
406 return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
407 sizeof(*params), GXIO_MPIPE_OP_LINK_SET_ATTR_AUX);
408}
409
410EXPORT_SYMBOL(gxio_mpipe_link_set_attr_aux);
390 411
391struct get_timestamp_aux_param { 412struct get_timestamp_aux_param {
392 uint64_t sec; 413 uint64_t sec;
@@ -454,6 +475,51 @@ int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context,
454 475
455EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_aux); 476EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_aux);
456 477
478struct adjust_timestamp_freq_param {
479 int32_t ppb;
480};
481
482int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t * context,
483 int32_t ppb)
484{
485 struct adjust_timestamp_freq_param temp;
486 struct adjust_timestamp_freq_param *params = &temp;
487
488 params->ppb = ppb;
489
490 return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
491 sizeof(*params),
492 GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ);
493}
494
495EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_freq);
496
497struct config_edma_ring_blks_param {
498 unsigned int ering;
499 unsigned int max_blks;
500 unsigned int min_snf_blks;
501 unsigned int db;
502};
503
504int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t * context,
505 unsigned int ering, unsigned int max_blks,
506 unsigned int min_snf_blks, unsigned int db)
507{
508 struct config_edma_ring_blks_param temp;
509 struct config_edma_ring_blks_param *params = &temp;
510
511 params->ering = ering;
512 params->max_blks = max_blks;
513 params->min_snf_blks = min_snf_blks;
514 params->db = db;
515
516 return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
517 sizeof(*params),
518 GXIO_MPIPE_OP_CONFIG_EDMA_RING_BLKS);
519}
520
521EXPORT_SYMBOL(gxio_mpipe_config_edma_ring_blks);
522
457struct arm_pollfd_param { 523struct arm_pollfd_param {
458 union iorpc_pollfd pollfd; 524 union iorpc_pollfd pollfd;
459}; 525};
diff --git a/arch/tile/gxio/iorpc_mpipe_info.c b/arch/tile/gxio/iorpc_mpipe_info.c
index d0254aa60cba..64883aabeb9c 100644
--- a/arch/tile/gxio/iorpc_mpipe_info.c
+++ b/arch/tile/gxio/iorpc_mpipe_info.c
@@ -16,6 +16,24 @@
16#include "gxio/iorpc_mpipe_info.h" 16#include "gxio/iorpc_mpipe_info.h"
17 17
18 18
19struct instance_aux_param {
20 _gxio_mpipe_link_name_t name;
21};
22
23int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t * context,
24 _gxio_mpipe_link_name_t name)
25{
26 struct instance_aux_param temp;
27 struct instance_aux_param *params = &temp;
28
29 params->name = name;
30
31 return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
32 sizeof(*params), GXIO_MPIPE_INFO_OP_INSTANCE_AUX);
33}
34
35EXPORT_SYMBOL(gxio_mpipe_info_instance_aux);
36
19struct enumerate_aux_param { 37struct enumerate_aux_param {
20 _gxio_mpipe_link_name_t name; 38 _gxio_mpipe_link_name_t name;
21 _gxio_mpipe_link_mac_t mac; 39 _gxio_mpipe_link_mac_t mac;
diff --git a/arch/tile/gxio/mpipe.c b/arch/tile/gxio/mpipe.c
index e71c63390acc..5301a9ffbae1 100644
--- a/arch/tile/gxio/mpipe.c
+++ b/arch/tile/gxio/mpipe.c
@@ -36,8 +36,14 @@ int gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index)
36 int fd; 36 int fd;
37 int i; 37 int i;
38 38
39 if (mpipe_index >= GXIO_MPIPE_INSTANCE_MAX)
40 return -EINVAL;
41
39 snprintf(file, sizeof(file), "mpipe/%d/iorpc", mpipe_index); 42 snprintf(file, sizeof(file), "mpipe/%d/iorpc", mpipe_index);
40 fd = hv_dev_open((HV_VirtAddr) file, 0); 43 fd = hv_dev_open((HV_VirtAddr) file, 0);
44
45 context->fd = fd;
46
41 if (fd < 0) { 47 if (fd < 0) {
42 if (fd >= GXIO_ERR_MIN && fd <= GXIO_ERR_MAX) 48 if (fd >= GXIO_ERR_MIN && fd <= GXIO_ERR_MAX)
43 return fd; 49 return fd;
@@ -45,8 +51,6 @@ int gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index)
45 return -ENODEV; 51 return -ENODEV;
46 } 52 }
47 53
48 context->fd = fd;
49
50 /* Map in the MMIO space. */ 54 /* Map in the MMIO space. */
51 context->mmio_cfg_base = (void __force *) 55 context->mmio_cfg_base = (void __force *)
52 iorpc_ioremap(fd, HV_MPIPE_CONFIG_MMIO_OFFSET, 56 iorpc_ioremap(fd, HV_MPIPE_CONFIG_MMIO_OFFSET,
@@ -64,12 +68,15 @@ int gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index)
64 for (i = 0; i < 8; i++) 68 for (i = 0; i < 8; i++)
65 context->__stacks.stacks[i] = 255; 69 context->__stacks.stacks[i] = 255;
66 70
71 context->instance = mpipe_index;
72
67 return 0; 73 return 0;
68 74
69 fast_failed: 75 fast_failed:
70 iounmap((void __force __iomem *)(context->mmio_cfg_base)); 76 iounmap((void __force __iomem *)(context->mmio_cfg_base));
71 cfg_failed: 77 cfg_failed:
72 hv_dev_close(context->fd); 78 hv_dev_close(context->fd);
79 context->fd = -1;
73 return -ENODEV; 80 return -ENODEV;
74} 81}
75 82
@@ -383,7 +390,7 @@ EXPORT_SYMBOL_GPL(gxio_mpipe_iqueue_init);
383 390
384int gxio_mpipe_equeue_init(gxio_mpipe_equeue_t *equeue, 391int gxio_mpipe_equeue_init(gxio_mpipe_equeue_t *equeue,
385 gxio_mpipe_context_t *context, 392 gxio_mpipe_context_t *context,
386 unsigned int edma_ring_id, 393 unsigned int ering,
387 unsigned int channel, 394 unsigned int channel,
388 void *mem, unsigned int mem_size, 395 void *mem, unsigned int mem_size,
389 unsigned int mem_flags) 396 unsigned int mem_flags)
@@ -394,7 +401,7 @@ int gxio_mpipe_equeue_init(gxio_mpipe_equeue_t *equeue,
394 /* Offset used to read number of completed commands. */ 401 /* Offset used to read number of completed commands. */
395 MPIPE_EDMA_POST_REGION_ADDR_t offset; 402 MPIPE_EDMA_POST_REGION_ADDR_t offset;
396 403
397 int result = gxio_mpipe_init_edma_ring(context, edma_ring_id, channel, 404 int result = gxio_mpipe_init_edma_ring(context, ering, channel,
398 mem, mem_size, mem_flags); 405 mem, mem_size, mem_flags);
399 if (result < 0) 406 if (result < 0)
400 return result; 407 return result;
@@ -405,7 +412,7 @@ int gxio_mpipe_equeue_init(gxio_mpipe_equeue_t *equeue,
405 offset.region = 412 offset.region =
406 MPIPE_MMIO_ADDR__REGION_VAL_EDMA - 413 MPIPE_MMIO_ADDR__REGION_VAL_EDMA -
407 MPIPE_MMIO_ADDR__REGION_VAL_IDMA; 414 MPIPE_MMIO_ADDR__REGION_VAL_IDMA;
408 offset.ring = edma_ring_id; 415 offset.ring = ering;
409 416
410 __gxio_dma_queue_init(&equeue->dma_queue, 417 __gxio_dma_queue_init(&equeue->dma_queue,
411 context->mmio_fast_base + offset.word, 418 context->mmio_fast_base + offset.word,
@@ -413,6 +420,9 @@ int gxio_mpipe_equeue_init(gxio_mpipe_equeue_t *equeue,
413 equeue->edescs = mem; 420 equeue->edescs = mem;
414 equeue->mask_num_entries = num_entries - 1; 421 equeue->mask_num_entries = num_entries - 1;
415 equeue->log2_num_entries = __builtin_ctz(num_entries); 422 equeue->log2_num_entries = __builtin_ctz(num_entries);
423 equeue->context = context;
424 equeue->ering = ering;
425 equeue->channel = channel;
416 426
417 return 0; 427 return 0;
418} 428}
@@ -493,6 +503,20 @@ static gxio_mpipe_context_t *_gxio_get_link_context(void)
493 return contextp; 503 return contextp;
494} 504}
495 505
506int gxio_mpipe_link_instance(const char *link_name)
507{
508 _gxio_mpipe_link_name_t name;
509 gxio_mpipe_context_t *context = _gxio_get_link_context();
510
511 if (!context)
512 return GXIO_ERR_NO_DEVICE;
513
514 strncpy(name.name, link_name, sizeof(name.name));
515 name.name[GXIO_MPIPE_LINK_NAME_LEN - 1] = '\0';
516
517 return gxio_mpipe_info_instance_aux(context, name);
518}
519
496int gxio_mpipe_link_enumerate_mac(int idx, char *link_name, uint8_t *link_mac) 520int gxio_mpipe_link_enumerate_mac(int idx, char *link_name, uint8_t *link_mac)
497{ 521{
498 int rv; 522 int rv;
@@ -543,3 +567,12 @@ int gxio_mpipe_link_close(gxio_mpipe_link_t *link)
543} 567}
544 568
545EXPORT_SYMBOL_GPL(gxio_mpipe_link_close); 569EXPORT_SYMBOL_GPL(gxio_mpipe_link_close);
570
571int gxio_mpipe_link_set_attr(gxio_mpipe_link_t *link, uint32_t attr,
572 int64_t val)
573{
574 return gxio_mpipe_link_set_attr_aux(link->context, link->mac, attr,
575 val);
576}
577
578EXPORT_SYMBOL_GPL(gxio_mpipe_link_set_attr);
diff --git a/arch/tile/include/gxio/iorpc_mpipe.h b/arch/tile/include/gxio/iorpc_mpipe.h
index 9d50fce1b1a7..fdd07f88cfd7 100644
--- a/arch/tile/include/gxio/iorpc_mpipe.h
+++ b/arch/tile/include/gxio/iorpc_mpipe.h
@@ -44,10 +44,13 @@
44#define GXIO_MPIPE_OP_REGISTER_CLIENT_MEMORY IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1210) 44#define GXIO_MPIPE_OP_REGISTER_CLIENT_MEMORY IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1210)
45#define GXIO_MPIPE_OP_LINK_OPEN_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1211) 45#define GXIO_MPIPE_OP_LINK_OPEN_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1211)
46#define GXIO_MPIPE_OP_LINK_CLOSE_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1212) 46#define GXIO_MPIPE_OP_LINK_CLOSE_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1212)
47#define GXIO_MPIPE_OP_LINK_SET_ATTR_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1213)
47 48
48#define GXIO_MPIPE_OP_GET_TIMESTAMP_AUX IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x121e) 49#define GXIO_MPIPE_OP_GET_TIMESTAMP_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x121e)
49#define GXIO_MPIPE_OP_SET_TIMESTAMP_AUX IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x121f) 50#define GXIO_MPIPE_OP_SET_TIMESTAMP_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x121f)
50#define GXIO_MPIPE_OP_ADJUST_TIMESTAMP_AUX IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1220) 51#define GXIO_MPIPE_OP_ADJUST_TIMESTAMP_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1220)
52#define GXIO_MPIPE_OP_CONFIG_EDMA_RING_BLKS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1221)
53#define GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1222)
51#define GXIO_MPIPE_OP_ARM_POLLFD IORPC_OPCODE(IORPC_FORMAT_KERNEL_POLLFD, 0x9000) 54#define GXIO_MPIPE_OP_ARM_POLLFD IORPC_OPCODE(IORPC_FORMAT_KERNEL_POLLFD, 0x9000)
52#define GXIO_MPIPE_OP_CLOSE_POLLFD IORPC_OPCODE(IORPC_FORMAT_KERNEL_POLLFD, 0x9001) 55#define GXIO_MPIPE_OP_CLOSE_POLLFD IORPC_OPCODE(IORPC_FORMAT_KERNEL_POLLFD, 0x9001)
53#define GXIO_MPIPE_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000) 56#define GXIO_MPIPE_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
@@ -114,6 +117,8 @@ int gxio_mpipe_link_open_aux(gxio_mpipe_context_t * context,
114 117
115int gxio_mpipe_link_close_aux(gxio_mpipe_context_t * context, int mac); 118int gxio_mpipe_link_close_aux(gxio_mpipe_context_t * context, int mac);
116 119
120int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t * context, int mac,
121 uint32_t attr, int64_t val);
117 122
118int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t * context, uint64_t * sec, 123int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t * context, uint64_t * sec,
119 uint64_t * nsec, uint64_t * cycles); 124 uint64_t * nsec, uint64_t * cycles);
@@ -124,6 +129,9 @@ int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t * context, uint64_t sec,
124int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context, 129int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context,
125 int64_t nsec); 130 int64_t nsec);
126 131
132int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t * context,
133 int32_t ppb);
134
127int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie); 135int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie);
128 136
129int gxio_mpipe_close_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie); 137int gxio_mpipe_close_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie);
diff --git a/arch/tile/include/gxio/iorpc_mpipe_info.h b/arch/tile/include/gxio/iorpc_mpipe_info.h
index 0bcf3f71ce8b..476c5e5ca22c 100644
--- a/arch/tile/include/gxio/iorpc_mpipe_info.h
+++ b/arch/tile/include/gxio/iorpc_mpipe_info.h
@@ -27,11 +27,15 @@
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28 28
29 29
30#define GXIO_MPIPE_INFO_OP_INSTANCE_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1250)
30#define GXIO_MPIPE_INFO_OP_ENUMERATE_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1251) 31#define GXIO_MPIPE_INFO_OP_ENUMERATE_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1251)
31#define GXIO_MPIPE_INFO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000) 32#define GXIO_MPIPE_INFO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
32#define GXIO_MPIPE_INFO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001) 33#define GXIO_MPIPE_INFO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
33 34
34 35
36int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t * context,
37 _gxio_mpipe_link_name_t name);
38
35int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t * context, 39int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t * context,
36 unsigned int idx, 40 unsigned int idx,
37 _gxio_mpipe_link_name_t * name, 41 _gxio_mpipe_link_name_t * name,
diff --git a/arch/tile/include/gxio/mpipe.h b/arch/tile/include/gxio/mpipe.h
index b74f470ed11e..e37cf4f0cffd 100644
--- a/arch/tile/include/gxio/mpipe.h
+++ b/arch/tile/include/gxio/mpipe.h
@@ -220,6 +220,13 @@ typedef MPIPE_PDESC_t gxio_mpipe_idesc_t;
220 */ 220 */
221typedef MPIPE_EDMA_DESC_t gxio_mpipe_edesc_t; 221typedef MPIPE_EDMA_DESC_t gxio_mpipe_edesc_t;
222 222
223/*
224 * Max # of mpipe instances. 2 currently.
225 */
226#define GXIO_MPIPE_INSTANCE_MAX HV_MPIPE_INSTANCE_MAX
227
228#define NR_MPIPE_MAX GXIO_MPIPE_INSTANCE_MAX
229
223/* Get the "va" field from an "idesc". 230/* Get the "va" field from an "idesc".
224 * 231 *
225 * This is the address at which the ingress hardware copied the first 232 * This is the address at which the ingress hardware copied the first
@@ -311,6 +318,9 @@ typedef struct {
311 /* File descriptor for calling up to Linux (and thus the HV). */ 318 /* File descriptor for calling up to Linux (and thus the HV). */
312 int fd; 319 int fd;
313 320
321 /* Corresponding mpipe instance #. */
322 int instance;
323
314 /* The VA at which configuration registers are mapped. */ 324 /* The VA at which configuration registers are mapped. */
315 char *mmio_cfg_base; 325 char *mmio_cfg_base;
316 326
@@ -810,7 +820,7 @@ extern int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t *context,
810/* Initialize an eDMA ring, using the given memory and size. 820/* Initialize an eDMA ring, using the given memory and size.
811 * 821 *
812 * @param context An initialized mPIPE context. 822 * @param context An initialized mPIPE context.
813 * @param ring The eDMA ring index. 823 * @param ering The eDMA ring index.
814 * @param channel The channel to use. This must be one of the channels 824 * @param channel The channel to use. This must be one of the channels
815 * associated with the context's set of open links. 825 * associated with the context's set of open links.
816 * @param mem A physically contiguous region of memory to be filled 826 * @param mem A physically contiguous region of memory to be filled
@@ -823,10 +833,37 @@ extern int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t *context,
823 * ::GXIO_ERR_INVAL_MEMORY_SIZE on failure. 833 * ::GXIO_ERR_INVAL_MEMORY_SIZE on failure.
824 */ 834 */
825extern int gxio_mpipe_init_edma_ring(gxio_mpipe_context_t *context, 835extern int gxio_mpipe_init_edma_ring(gxio_mpipe_context_t *context,
826 unsigned int ring, unsigned int channel, 836 unsigned int ering, unsigned int channel,
827 void *mem, size_t mem_size, 837 void *mem, size_t mem_size,
828 unsigned int mem_flags); 838 unsigned int mem_flags);
829 839
840/* Set the "max_blks", "min_snf_blks", and "db" fields of
841 * ::MPIPE_EDMA_RG_INIT_DAT_THRESH_t for a given edma ring.
842 *
843 * The global pool of dynamic blocks will be automatically adjusted.
844 *
845 * This function should not be called after any egress has been done
846 * on the edma ring.
847 *
848 * Most applications should just use gxio_mpipe_equeue_set_snf_size().
849 *
850 * @param context An initialized mPIPE context.
851 * @param ering The eDMA ring index.
852 * @param max_blks The number of blocks to dedicate to the ring
853 * (normally min_snf_blks + 1). Must be greater than min_snf_blocks.
854 * @param min_snf_blks The number of blocks which must be stored
855 * prior to starting to send the packet (normally 12).
856 * @param db Whether to allow use of dynamic blocks by the ring
857 * (normally 1).
858 *
859 * @return 0 on success, negative on error.
860 */
861extern int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t *context,
862 unsigned int ering,
863 unsigned int max_blks,
864 unsigned int min_snf_blks,
865 unsigned int db);
866
830/***************************************************************** 867/*****************************************************************
831 * Classifier Program * 868 * Classifier Program *
832 ******************************************************************/ 869 ******************************************************************/
@@ -1288,15 +1325,39 @@ typedef struct {
1288 /* The log2() of the number of entries. */ 1325 /* The log2() of the number of entries. */
1289 unsigned long log2_num_entries; 1326 unsigned long log2_num_entries;
1290 1327
1328 /* The context. */
1329 gxio_mpipe_context_t *context;
1330
1331 /* The ering. */
1332 unsigned int ering;
1333
1334 /* The channel. */
1335 unsigned int channel;
1336
1291} gxio_mpipe_equeue_t; 1337} gxio_mpipe_equeue_t;
1292 1338
1293/* Initialize an "equeue". 1339/* Initialize an "equeue".
1294 * 1340 *
1295 * Takes the equeue plus the same args as gxio_mpipe_init_edma_ring(). 1341 * This function uses gxio_mpipe_init_edma_ring() to initialize the
1342 * underlying edma_ring using the provided arguments.
1343 *
1344 * @param equeue An egress queue to be initialized.
1345 * @param context An initialized mPIPE context.
1346 * @param ering The eDMA ring index.
1347 * @param channel The channel to use. This must be one of the channels
1348 * associated with the context's set of open links.
1349 * @param mem A physically contiguous region of memory to be filled
1350 * with a ring of ::gxio_mpipe_edesc_t structures.
1351 * @param mem_size Number of bytes in the ring. Must be 512, 2048,
1352 * 8192 or 65536, times 16 (i.e. sizeof(gxio_mpipe_edesc_t)).
1353 * @param mem_flags ::gxio_mpipe_mem_flags_e memory flags.
1354 *
1355 * @return 0 on success, ::GXIO_MPIPE_ERR_BAD_EDMA_RING or
1356 * ::GXIO_ERR_INVAL_MEMORY_SIZE on failure.
1296 */ 1357 */
1297extern int gxio_mpipe_equeue_init(gxio_mpipe_equeue_t *equeue, 1358extern int gxio_mpipe_equeue_init(gxio_mpipe_equeue_t *equeue,
1298 gxio_mpipe_context_t *context, 1359 gxio_mpipe_context_t *context,
1299 unsigned int edma_ring_id, 1360 unsigned int ering,
1300 unsigned int channel, 1361 unsigned int channel,
1301 void *mem, unsigned int mem_size, 1362 void *mem, unsigned int mem_size,
1302 unsigned int mem_flags); 1363 unsigned int mem_flags);
@@ -1494,6 +1555,37 @@ static inline int gxio_mpipe_equeue_is_complete(gxio_mpipe_equeue_t *equeue,
1494 completion_slot, update); 1555 completion_slot, update);
1495} 1556}
1496 1557
1558/* Set the snf (store and forward) size for an equeue.
1559 *
1560 * The snf size for an equeue defaults to 1536, and encodes the size
1561 * of the largest packet for which egress is guaranteed to avoid
1562 * transmission underruns and/or corrupt checksums under heavy load.
1563 *
1564 * The snf size affects a global resource pool which cannot support,
1565 * for example, all 24 equeues each requesting an snf size of 8K.
1566 *
1567 * To ensure that jumbo packets can be egressed properly, the snf size
1568 * should be set to the size of the largest possible packet, which
1569 * will usually be limited by the size of the app's largest buffer.
1570 *
1571 * This is a convenience wrapper around
1572 * gxio_mpipe_config_edma_ring_blks().
1573 *
1574 * This function should not be called after any egress has been done
1575 * on the equeue.
1576 *
1577 * @param equeue An egress queue initialized via gxio_mpipe_equeue_init().
1578 * @param size The snf size, in bytes.
1579 * @return Zero on success, negative error otherwise.
1580 */
1581static inline int gxio_mpipe_equeue_set_snf_size(gxio_mpipe_equeue_t *equeue,
1582 size_t size)
1583{
1584 int blks = (size + 127) / 128;
1585 return gxio_mpipe_config_edma_ring_blks(equeue->context, equeue->ering,
1586 blks + 1, blks, 1);
1587}
1588
1497/***************************************************************** 1589/*****************************************************************
1498 * Link Management * 1590 * Link Management *
1499 ******************************************************************/ 1591 ******************************************************************/
@@ -1634,6 +1726,24 @@ typedef struct {
1634 uint8_t mac; 1726 uint8_t mac;
1635} gxio_mpipe_link_t; 1727} gxio_mpipe_link_t;
1636 1728
1729/* Translate a link name to the instance number of the mPIPE shim which is
1730 * connected to that link. This call does not verify whether the link is
1731 * currently available, and does not reserve any link resources;
1732 * gxio_mpipe_link_open() must be called to perform those functions.
1733 *
1734 * Typically applications will call this function to translate a link name
1735 * to an mPIPE instance number; call gxio_mpipe_init(), passing it that
1736 * instance number, to initialize the mPIPE shim; and then call
1737 * gxio_mpipe_link_open(), passing it the same link name plus the mPIPE
1738 * context, to configure the link.
1739 *
1740 * @param link_name Name of the link; see @ref gxio_mpipe_link_names.
1741 * @return The mPIPE instance number which is associated with the named
1742 * link, or a negative error code (::GXIO_ERR_NO_DEVICE) if the link does
1743 * not exist.
1744 */
1745extern int gxio_mpipe_link_instance(const char *link_name);
1746
1637/* Retrieve one of this system's legal link names, and its MAC address. 1747/* Retrieve one of this system's legal link names, and its MAC address.
1638 * 1748 *
1639 * @param index Link name index. If a system supports N legal link names, 1749 * @param index Link name index. If a system supports N legal link names,
@@ -1697,6 +1807,17 @@ static inline int gxio_mpipe_link_channel(gxio_mpipe_link_t *link)
1697 return link->channel; 1807 return link->channel;
1698} 1808}
1699 1809
1810/* Set a link attribute.
1811 *
1812 * @param link A properly initialized link state object.
1813 * @param attr An attribute from the set of @ref gxio_mpipe_link_attrs.
1814 * @param val New value of the attribute.
1815 * @return 0 if the attribute was successfully set, or a negative error
1816 * code.
1817 */
1818extern int gxio_mpipe_link_set_attr(gxio_mpipe_link_t *link, uint32_t attr,
1819 int64_t val);
1820
1700/////////////////////////////////////////////////////////////////// 1821///////////////////////////////////////////////////////////////////
1701// Timestamp // 1822// Timestamp //
1702/////////////////////////////////////////////////////////////////// 1823///////////////////////////////////////////////////////////////////
@@ -1733,4 +1854,18 @@ extern int gxio_mpipe_set_timestamp(gxio_mpipe_context_t *context,
1733extern int gxio_mpipe_adjust_timestamp(gxio_mpipe_context_t *context, 1854extern int gxio_mpipe_adjust_timestamp(gxio_mpipe_context_t *context,
1734 int64_t delta); 1855 int64_t delta);
1735 1856
1857/** Adjust the mPIPE timestamp clock frequency.
1858 *
1859 * @param context An initialized mPIPE context.
1860 * @param ppb A 32-bit signed PPB (Parts Per Billion) value to adjust.
1861 * The absolute value of ppb must be less than or equal to 1000000000.
1862 * Values less than about 30000 will generally cause a GXIO_ERR_INVAL
1863 * return due to the granularity of the hardware that converts reference
1864 * clock cycles into seconds and nanoseconds.
1865 * @return If the call was successful, zero; otherwise, a negative error
1866 * code.
1867 */
1868extern int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t* context,
1869 int32_t ppb);
1870
1736#endif /* !_GXIO_MPIPE_H_ */ 1871#endif /* !_GXIO_MPIPE_H_ */
diff --git a/arch/tile/include/hv/drv_mpipe_intf.h b/arch/tile/include/hv/drv_mpipe_intf.h
index 6cdae3bf046e..c97e416dd963 100644
--- a/arch/tile/include/hv/drv_mpipe_intf.h
+++ b/arch/tile/include/hv/drv_mpipe_intf.h
@@ -23,6 +23,9 @@
23#include <arch/mpipe_constants.h> 23#include <arch/mpipe_constants.h>
24 24
25 25
26/** Number of mPIPE instances supported */
27#define HV_MPIPE_INSTANCE_MAX (2)
28
26/** Number of buffer stacks (32). */ 29/** Number of buffer stacks (32). */
27#define HV_MPIPE_NUM_BUFFER_STACKS \ 30#define HV_MPIPE_NUM_BUFFER_STACKS \
28 (MPIPE_MMIO_INIT_DAT_GX36_1__BUFFER_STACK_MASK_WIDTH) 31 (MPIPE_MMIO_INIT_DAT_GX36_1__BUFFER_STACK_MASK_WIDTH)