Patchwork Adjusting PS3's Ethernet Link Speed

login
register
mail settings
Submitter Geoff Levand
Date May 12, 2009, 10:20 p.m.
Message ID <4A09F634.4070708@am.sony.com>
Download mbox | patch
Permalink /patch/27130/
State New
Headers show

Comments

Geoff Levand - May 12, 2009, 10:20 p.m.
On 05/02/2009 10:16 AM, Geoff Levand wrote:
> On 04/28/2009 06:52 AM, Benjamin Rose wrote:
>> For educational reasons, I've been trying to adjust the link speed of  
>> the ethernet connection on the PS3 from 1Gbps to 100Mbps. Using the  
>> ethtool results in a "Cannot set new settings: Operation not  
>> supported" for any variation from just ethtool -s eth0 speed 100 to  
>> ethtool -s eth0 speed 100 duplex full autoneg off.
>> 
>> I am using the latest stable 2.6.29 kernel found on kernel.org.
> 
> The current kernel driver just uses the auto negotiated speed.
> It does not support a manual setting.
> 
>> As a more extreme tactic, I've edited the drivers/net/ps3_gelic_net.c  
>> source file to force the adapter to use 100Mbps. The patch can be  
>> found attached to this e-mail. They're very simple changes.
>> 
>> With those changes ethtool eth0 now shows the speed as 100Mbps and as  
>> auto negotiation as off, however I am still getting 1Gbps speeds. Is  
>> the PS3's hypervisor to blame or was this too naive of a change?
> 
> It seems all your patch does is change the value that reports what the
> driver can support, without actually adding any additional support.
> 
>> Any help at all is greatly appreciated!!
> 
> I have no plan to support this kind control in ps3_gelic_net.  If you
> want to use your PS3 for this work you can use an external USB Ethernet
> adapter.


The following patch adds the definitions needed to set the
the PS3's Ethernet link speed.  I have not tested this, and
will not support it until I have a chance to do so.

This is FOR EXPERTS ONLY.

-Geoff

---
 drivers/net/ps3_gelic_net.h |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Geert Uytterhoeven - May 13, 2009, 9:21 a.m.
On Tue, 12 May 2009, Geoff Levand wrote:
> The following patch adds the definitions needed to set the
> the PS3's Ethernet link speed.  I have not tested this, and
> will not support it until I have a chance to do so.
> 
> This is FOR EXPERTS ONLY.
> 
> -Geoff
> 
> ---
>  drivers/net/ps3_gelic_net.h |   18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> --- a/drivers/net/ps3_gelic_net.h
> +++ b/drivers/net/ps3_gelic_net.h
> @@ -189,6 +193,20 @@ enum gelic_lv1_net_control_code {
>  	GELIC_LV1_GET_WLAN_EVENT	= 11
>  };
>  
> +/*
> + * for GELIC_LV1_SET_NEGOTIATION_MODE
> + * lv1_net_control(bus, dev, GELIC_LV1_SET_NEGOTIATION_MODE,
> +	GELIC_LV1_PHY_ETHERNET_0, flags, 0, &v1, &v2)
> + * Hardware does not support half_duplex with 1G.
> + */
> +enum {
> +	GELIC_LV1_NEGOTIATION_FULL_DUPLEX      = 0x02;
> +	GELIC_LV1_NEGOTIATION_AUTO_NEGOTIATION = 0x04;
> +	GELIC_LV1_NEGOTIATION_LINE_SPEED_10M   = 0x10;
> +	GELIC_LV1_NEGOTIATION_LINE_SPEED_100M  = 0x20;
> +	GELIC_LV1_NEGOTIATION_LINE_SPEED_1G    = 0x40;
> +};
> +

Similar definitions already exist in enum gelic_lv1_ether_port_status,
to be used with the GELIC_LV1_GET_ETH_PORT_STATUS command.

> @@ -176,6 +176,10 @@ enum gelic_descr_rx_dma_status {
>  						       */
>  };
>  
> +enum gelic_lv1_phy {
> +	GELIC_LV1_PHY_ETHERNET_0	= 0x0000000000000002L,
> +};
> +

From looking at the symmetry between GELIC_LV1_SET_NEGOTIATION_MODE and
GELIC_LV1_GET_ETH_PORT_STATUS, you can just use the existing
GELIC_LV1_VLAN_TX_ETHERNET definition.

So you don't need any new definitions at all, just the knowledge you can use
GELIC_LV1_SET_NEGOTIATION_MODE to set what GELIC_LV1_GET_ETH_PORT_STATUS
returns?

With kind regards,

Geert Uytterhoeven
Software Architect
Techsoft Centre

Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

Patch

--- a/drivers/net/ps3_gelic_net.h
+++ b/drivers/net/ps3_gelic_net.h
@@ -176,6 +176,10 @@  enum gelic_descr_rx_dma_status {
 						       */
 };
 
+enum gelic_lv1_phy {
+	GELIC_LV1_PHY_ETHERNET_0	= 0x0000000000000002L,
+};
+
 /* for lv1_net_control */
 enum gelic_lv1_net_control_code {
 	GELIC_LV1_GET_MAC_ADDRESS	= 1,
@@ -189,6 +193,20 @@  enum gelic_lv1_net_control_code {
 	GELIC_LV1_GET_WLAN_EVENT	= 11
 };
 
+/*
+ * for GELIC_LV1_SET_NEGOTIATION_MODE
+ * lv1_net_control(bus, dev, GELIC_LV1_SET_NEGOTIATION_MODE,
+	GELIC_LV1_PHY_ETHERNET_0, flags, 0, &v1, &v2)
+ * Hardware does not support half_duplex with 1G.
+ */
+enum {
+	GELIC_LV1_NEGOTIATION_FULL_DUPLEX      = 0x02;
+	GELIC_LV1_NEGOTIATION_AUTO_NEGOTIATION = 0x04;
+	GELIC_LV1_NEGOTIATION_LINE_SPEED_10M   = 0x10;
+	GELIC_LV1_NEGOTIATION_LINE_SPEED_100M  = 0x20;
+	GELIC_LV1_NEGOTIATION_LINE_SPEED_1G    = 0x40;
+};
+
 /* for GELIC_LV1_SET_WOL */
 enum gelic_lv1_wol_command {
 	GELIC_LV1_WOL_MAGIC_PACKET	= 1,