close(DATEI);
foreach (@Zeilen){
- if ( $_ =~ /\*/){
- my @files = `ls $_`;
+ chomp($_);
+ my @files = `find $_ -maxdepth 0 2>/dev/null`;
foreach (@files){
push(@include,$_);
- }
- }
- else {push(@include,$_);}
+ }
}
}
--- /dev/null
+/etc/haproxy/haproxy.cfg
--- /dev/null
+/etc/monitrc
+/etc/monit.d
+++ /dev/null
-/opt/teamspeak/bad_names.txt
-/opt/teamspeak/server.dbs
-/opt/teamspeak/server.ini
-/opt/teamspeak/server.log
-/opt/teamspeak/whitelist.txt
-
-
--- /dev/null
+# seems to crash often
+blacklist btmrvl_sdio
# Flush all chains.
&flush();
- # Reload firewall rules.
- &preparerules();
+ # Prepare firewall rules.
+ if (! -z "${General::swroot}/firewall/input"){
+ &buildrules(\%configinputfw);
+ }
+ if (! -z "${General::swroot}/firewall/outgoing"){
+ &buildrules(\%configoutgoingfw);
+ }
+ if (! -z "${General::swroot}/firewall/config"){
+ &buildrules(\%configfwdfw);
+ }
# Load P2P block rules.
&p2pblock();
# Reload firewall policy.
run("/usr/sbin/firewall-policy");
+
+ #Reload firewall.local if present
+ if ( -f '/etc/sysconfig/firewall.local'){
+ run("/etc/sysconfig/firewall.local reload");
+ }
}
sub run {
run("$IPTABLES -t mangle -F $CHAIN_MANGLE_NAT_DESTINATION_FIX");
}
-sub preparerules {
- if (! -z "${General::swroot}/firewall/input"){
- &buildrules(\%configinputfw);
- }
- if (! -z "${General::swroot}/firewall/outgoing"){
- &buildrules(\%configoutgoingfw);
- }
- if (! -z "${General::swroot}/firewall/config"){
- &buildrules(\%configfwdfw);
- }
-}
-
sub buildrules {
my $hash = shift;
push(@source_options, ("-s", $source));
}
- if ($source_intf) {
- push(@source_options, ("-i", $source_intf));
- }
-
# Prepare destination options.
my @destination_options = ();
if ($destination) {
push(@destination_options, ("-d", $destination));
}
- if ($destination_intf) {
- push(@destination_options, ("-o", $destination_intf));
- }
-
# Add time constraint options.
push(@options, @time_options);
}
}
+ # Add source and destination interface to the filter rules.
+ # These are supposed to help filtering forged packets that originate
+ # from BLUE with an IP address from GREEN for instance.
+ if ($source_intf) {
+ push(@source_options, ("-i", $source_intf));
+ }
+
+ if ($destination_intf) {
+ push(@destination_options, ("-o", $destination_intf));
+ }
+
push(@options, @source_options);
push(@options, @destination_options);
}
}
}
- #Reload firewall.local if present
- if ( -f '/etc/sysconfig/firewall.local'){
- run("/etc/sysconfig/firewall.local reload");
- }
}
# Formats the given timestamp into the iptables format which is "hh:mm" UTC.
--- /dev/null
+#---------------------------------------------------------------------
+# Example configuration for a possible web application. See the
+# full configuration options online.
+#
+# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
+#
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+# Global settings
+#---------------------------------------------------------------------
+global
+ # to have these messages end up in /var/log/haproxy.log you will
+ # need to:
+ #
+ # 1) configure syslog to accept network log events. This is done
+ # by adding the '-r' option to the SYSLOGD_OPTIONS in
+ # /etc/sysconfig/syslog
+ #
+ # 2) configure local2 events to go to the /var/log/haproxy.log
+ # file. A line like the following can be added to
+ # /etc/sysconfig/syslog
+ #
+ # local2.* /var/log/haproxy.log
+ #
+ log 127.0.0.1 local2
+
+ chroot /var/lib/haproxy
+ pidfile /var/run/haproxy.pid
+ maxconn 4000
+ user haproxy
+ group haproxy
+ daemon
+
+ # turn on stats unix socket
+ stats socket /var/lib/haproxy/stats
+
+#---------------------------------------------------------------------
+# common defaults that all the 'listen' and 'backend' sections will
+# use if not designated in their block
+#---------------------------------------------------------------------
+defaults
+ mode http
+ log global
+ option httplog
+ option dontlognull
+ option http-server-close
+ option forwardfor except 127.0.0.0/8
+ option redispatch
+ retries 3
+ timeout http-request 10s
+ timeout queue 1m
+ timeout connect 10s
+ timeout client 1m
+ timeout server 1m
+ timeout http-keep-alive 10s
+ timeout check 10s
+ maxconn 3000
+
+#---------------------------------------------------------------------
+# main frontend which proxys to the backends
+#---------------------------------------------------------------------
+frontend main *:5000
+ acl url_static path_beg -i /static /images /javascript /stylesheets
+ acl url_static path_end -i .jpg .gif .png .css .js
+
+ use_backend static if url_static
+ default_backend app
+
+#---------------------------------------------------------------------
+# static backend for serving up images, stylesheets and such
+#---------------------------------------------------------------------
+backend static
+ balance roundrobin
+ server static 127.0.0.1:4331 check
+
+#---------------------------------------------------------------------
+# round robin balancing between the various backends
+#---------------------------------------------------------------------
+backend app
+ balance roundrobin
+ server app1 127.0.0.1:5001 check
+ server app2 127.0.0.1:5002 check
+ server app3 127.0.0.1:5003 check
+ server app4 127.0.0.1:5004 check
+
#
interface=blue0
hw_mode=g
-channel=05
+channel=6
logger_syslog=-1
logger_syslog_level=3
logger_stdout=-1
Timeout 300
ServerSignature on
UseCanonicalName off
-ServerTokens Full
+ServerTokens Prod
LogLevel warn
CustomLog /var/log/httpd/access_log combined
Include /etc/httpd/conf/hostname.conf
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.14.22 Kernel Configuration
+# Linux/arm 3.14.30 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
-CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_SUPPORT=m
#
# Multimedia core support
# CONFIG_MEDIA_RADIO_SUPPORT is not set
CONFIG_MEDIA_RC_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
-CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_SUBDEV_API=y
-CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_V4L2=m
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_TUNER=m
CONFIG_VIDEOBUF2_MEMOPS=m
CONFIG_VIDEOBUF2_DMA_CONTIG=m
CONFIG_VIDEOBUF2_VMALLOC=m
-CONFIG_DVB_CORE=y
+CONFIG_DVB_CORE=m
CONFIG_DVB_NET=y
CONFIG_TTPCI_EEPROM=m
CONFIG_DVB_MAX_ADAPTERS=8
#
# Media drivers
#
-CONFIG_RC_CORE=y
+CONFIG_RC_CORE=m
CONFIG_RC_MAP=m
CONFIG_RC_DECODERS=y
CONFIG_LIRC=m
#
CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
CONFIG_MEDIA_ATTACH=y
-CONFIG_VIDEO_IR_I2C=y
+CONFIG_VIDEO_IR_I2C=m
#
# Audio decoders, processors and mixers
CONFIG_SOC_CAMERA_OV9740=m
CONFIG_SOC_CAMERA_RJ54N1=m
CONFIG_SOC_CAMERA_TW9910=m
-CONFIG_MEDIA_TUNER=y
-CONFIG_MEDIA_TUNER_SIMPLE=y
-CONFIG_MEDIA_TUNER_TDA8290=y
-CONFIG_MEDIA_TUNER_TDA827X=y
-CONFIG_MEDIA_TUNER_TDA18271=y
-CONFIG_MEDIA_TUNER_TDA9887=y
-CONFIG_MEDIA_TUNER_MT20XX=y
+CONFIG_MEDIA_TUNER=m
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_MT20XX=m
CONFIG_MEDIA_TUNER_MT2060=m
CONFIG_MEDIA_TUNER_MT2063=m
CONFIG_MEDIA_TUNER_MT2266=m
CONFIG_MEDIA_TUNER_MT2131=m
CONFIG_MEDIA_TUNER_QT1010=m
-CONFIG_MEDIA_TUNER_XC2028=y
-CONFIG_MEDIA_TUNER_XC5000=y
-CONFIG_MEDIA_TUNER_XC4000=y
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_XC4000=m
CONFIG_MEDIA_TUNER_MXL5005S=m
CONFIG_MEDIA_TUNER_MXL5007T=m
-CONFIG_MEDIA_TUNER_MC44S803=y
+CONFIG_MEDIA_TUNER_MC44S803=m
CONFIG_MEDIA_TUNER_MAX2165=m
CONFIG_MEDIA_TUNER_TDA18218=m
CONFIG_MEDIA_TUNER_FC0011=m
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.14.25 Kernel Configuration
+# Linux/arm 3.14.30 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_JME=m
CONFIG_NET_VENDOR_MARVELL=y
CONFIG_MV643XX_ETH=m
-CONFIG_MVMDIO=m
-CONFIG_MVNETA=m
+CONFIG_MVMDIO=y
+CONFIG_MVNETA=y
CONFIG_SKGE=m
# CONFIG_SKGE_DEBUG is not set
CONFIG_SKGE_GENESIS=y
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
CONFIG_PHYLIB=y
+CONFIG_SWCONFIG=m
+# CONFIG_SWCONFIG_LEDS is not set
#
# MII PHY device drivers
CONFIG_MICREL_PHY=m
CONFIG_FIXED_PHY=y
CONFIG_MDIO_BITBANG=m
-# CONFIG_MDIO_GPIO is not set
+CONFIG_MDIO_GPIO=m
CONFIG_MDIO_SUN4I=m
CONFIG_MDIO_BUS_MUX=m
CONFIG_MDIO_BUS_MUX_GPIO=m
CONFIG_MDIO_BUS_MUX_MMIOREG=m
CONFIG_GATEWORKS_GW16083=m
+CONFIG_B53=m
+CONFIG_B53_PHY_DRIVER=m
+# CONFIG_B53_MMAP_DRIVER is not set
+# CONFIG_B53_SRAB_DRIVER is not set
+CONFIG_B53_PHY_FIXUP=y
# CONFIG_PLIP is not set
CONFIG_PPP=m
CONFIG_PPP_BSDCOMP=m
# CONFIG_REGULATOR_TPS6507X is not set
CONFIG_REGULATOR_TWL4030=y
CONFIG_REGULATOR_VEXPRESS=m
-CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_SUPPORT=m
#
# Multimedia core support
# CONFIG_MEDIA_RADIO_SUPPORT is not set
CONFIG_MEDIA_RC_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
-CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_SUBDEV_API=y
-CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_V4L2=m
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_TUNER=m
CONFIG_V4L2_MEM2MEM_DEV=m
-CONFIG_VIDEOBUF_GEN=y
+CONFIG_VIDEOBUF_GEN=m
CONFIG_VIDEOBUF_DMA_SG=m
CONFIG_VIDEOBUF_VMALLOC=m
-CONFIG_VIDEOBUF_DMA_CONTIG=y
+CONFIG_VIDEOBUF_DMA_CONTIG=m
CONFIG_VIDEOBUF_DVB=m
CONFIG_VIDEOBUF2_CORE=m
CONFIG_VIDEOBUF2_MEMOPS=m
CONFIG_VIDEOBUF2_DMA_CONTIG=m
CONFIG_VIDEOBUF2_VMALLOC=m
-CONFIG_DVB_CORE=y
+CONFIG_DVB_CORE=m
CONFIG_DVB_NET=y
CONFIG_TTPCI_EEPROM=m
CONFIG_DVB_MAX_ADAPTERS=8
#
# Media drivers
#
-CONFIG_RC_CORE=y
+CONFIG_RC_CORE=m
CONFIG_RC_MAP=m
CONFIG_RC_DECODERS=y
CONFIG_LIRC=m
# CONFIG_VIDEO_CAFE_CCIC is not set
# CONFIG_VIDEO_DM6446_CCDC is not set
CONFIG_VIDEO_OMAP2_VOUT_VRFB=y
-CONFIG_VIDEO_OMAP2_VOUT=y
+CONFIG_VIDEO_OMAP2_VOUT=m
CONFIG_VIDEO_TIMBERDALE=m
CONFIG_SOC_CAMERA=m
CONFIG_SOC_CAMERA_SCALE_CROP=m
#
CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
CONFIG_MEDIA_ATTACH=y
-CONFIG_VIDEO_IR_I2C=y
+CONFIG_VIDEO_IR_I2C=m
#
# Audio decoders, processors and mixers
CONFIG_SOC_CAMERA_OV9740=m
CONFIG_SOC_CAMERA_RJ54N1=m
CONFIG_SOC_CAMERA_TW9910=m
-CONFIG_MEDIA_TUNER=y
-CONFIG_MEDIA_TUNER_SIMPLE=y
-CONFIG_MEDIA_TUNER_TDA8290=y
-CONFIG_MEDIA_TUNER_TDA827X=y
-CONFIG_MEDIA_TUNER_TDA18271=y
-CONFIG_MEDIA_TUNER_TDA9887=y
-CONFIG_MEDIA_TUNER_MT20XX=y
+CONFIG_MEDIA_TUNER=m
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_MT20XX=m
CONFIG_MEDIA_TUNER_MT2060=m
CONFIG_MEDIA_TUNER_MT2063=m
CONFIG_MEDIA_TUNER_MT2266=m
CONFIG_MEDIA_TUNER_MT2131=m
CONFIG_MEDIA_TUNER_QT1010=m
-CONFIG_MEDIA_TUNER_XC2028=y
-CONFIG_MEDIA_TUNER_XC5000=y
-CONFIG_MEDIA_TUNER_XC4000=y
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_XC4000=m
CONFIG_MEDIA_TUNER_MXL5005S=m
CONFIG_MEDIA_TUNER_MXL5007T=m
-CONFIG_MEDIA_TUNER_MC44S803=y
+CONFIG_MEDIA_TUNER_MC44S803=m
CONFIG_MEDIA_TUNER_MAX2165=m
CONFIG_MEDIA_TUNER_TDA18218=m
CONFIG_MEDIA_TUNER_FC0011=m
CONFIG_RTC_DRV_PL031=m
CONFIG_RTC_DRV_VT8500=m
CONFIG_RTC_DRV_SUNXI=y
-CONFIG_RTC_DRV_MV=m
+CONFIG_RTC_DRV_MV=y
CONFIG_RTC_DRV_MXC=m
CONFIG_RTC_DRV_SNVS=m
CONFIG_RTC_DRV_MOXART=m
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.14.22 Kernel Configuration
+# Linux/arm 3.14.30 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
# CONFIG_DM_SWITCH is not set
# CONFIG_TARGET_CORE is not set
CONFIG_NETDEVICES=y
-CONFIG_MII=y
+CONFIG_MII=m
CONFIG_NET_CORE=y
CONFIG_BONDING=m
CONFIG_DUMMY=m
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
CONFIG_USB_RTL8152=m
-CONFIG_USB_USBNET=y
+CONFIG_USB_USBNET=m
CONFIG_USB_NET_AX8817X=m
CONFIG_USB_NET_AX88179_178A=m
CONFIG_USB_NET_CDCETHER=m
CONFIG_USB_NET_SR9700=m
CONFIG_USB_NET_SR9800=m
CONFIG_USB_NET_SMSC75XX=m
-CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_GL620A=m
CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 3.14.22 Kernel Configuration
+# Linux/x86 3.14.30 Kernel Configuration
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_THERMAL_VECTOR=y
CONFIG_VM86=y
-CONFIG_X86_16BIT=y
-CONFIG_X86_ESPFIX32=y
CONFIG_TOSHIBA=m
CONFIG_I8K=m
# CONFIG_X86_REBOOTFIXUPS is not set
CONFIG_BINFMT_MISC=y
CONFIG_COREDUMP=y
CONFIG_HAVE_ATOMIC_IOMAP=y
+CONFIG_IOSF_MBI=m
CONFIG_NET=y
#
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 3.14.22 Kernel Configuration
+# Linux/x86 3.14.30 Kernel Configuration
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_THERMAL_VECTOR=y
CONFIG_VM86=y
-CONFIG_X86_16BIT=y
-CONFIG_X86_ESPFIX32=y
CONFIG_TOSHIBA=m
CONFIG_I8K=m
# CONFIG_X86_REBOOTFIXUPS is not set
CONFIG_BINFMT_MISC=y
CONFIG_COREDUMP=y
CONFIG_HAVE_ATOMIC_IOMAP=y
+CONFIG_IOSF_MBI=m
CONFIG_NET=y
#
CONFIG_DVB_TUA6100=m
CONFIG_DVB_CX24116=m
CONFIG_DVB_CX24117=m
-CONFIG_DVB_M88DC2800=m
CONFIG_DVB_SI21XX=m
CONFIG_DVB_TS2020=m
CONFIG_DVB_DS3000=m
CONFIG_DVB_LGS8GXX=m
CONFIG_DVB_ATBM8830=m
CONFIG_DVB_TDA665x=m
+CONFIG_DVB_DVBSKY_M88DS3103=m
+CONFIG_DVB_M88DC2800=m
CONFIG_DVB_IX2505V=m
CONFIG_DVB_IT913X_FE=m
CONFIG_DVB_M88RS2000=m
--- /dev/null
+# bcm43362 NVRAM file for LeMaker Banana Pro and Cubietruck
+#AP6210_NVRAM_V1.2_03192013
+
+manfid=0x2d0
+prodid=0x492
+vendid=0x14e4
+devid=0x4343
+boardtype=0x0598
+
+# Board Revision is P307, same nvram file can be used for P304, P305, P306 and P307 as the tssi pa params used are same
+#Please force the automatic RX PER data to the respective board directory if not using P307 board, for e.g. for P305 boards force the data into the following directory /projects/BCM43362/a1_labdata/boardtests/results/sdg_rev0305
+boardrev=0x1307
+boardnum=777
+xtalfreq=26000
+boardflags=0x80201
+boardflags2=0x80
+sromrev=3
+wl0id=0x431b
+macaddr=DE:AD:BE:EF:00:00
+aa2g=1
+ag0=2
+maxp2ga0=74
+cck2gpo=0x2222
+ofdm2gpo=0x44444444
+mcs2gpo0=0x6666
+mcs2gpo1=0x6666
+pa0maxpwr=56
+
+#P207 PA params
+#pa0b0=5447
+#pa0b1=-658
+#pa0b2=-175<div></div>
+
+#Same PA params for P304,P305, P306, P307
+
+pa0b0=5447
+pa0b1=-607
+pa0b2=-160
+pa0itssit=62
+pa1itssit=62
+
+
+cckPwrOffset=5
+ccode=0
+rssismf2g=0xa
+rssismc2g=0x3
+rssisav2g=0x7
+triso2g=0
+noise_cal_enable_2g=0
+noise_cal_po_2g=0
+swctrlmap_2g=0x04040404,0x02020202,0x02020202,0x010101,0x1ff
+temp_add=29767
+temp_mult=425
+
+btc_flags=0x6
+btc_params0=5000
+btc_params1=1000
+btc_params6=63
--- /dev/null
+###############################################################################
+## Monit control file
+###############################################################################
+##
+## Comments begin with a '#' and extend through the end of the line. Keywords
+## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
+##
+## Below you will find examples of some frequently used statements. For
+## information about the control file and a complete list of statements and
+## options, please have a look in the Monit manual.
+##
+##
+###############################################################################
+## Global section
+###############################################################################
+##
+## Start Monit in the background (run as a daemon):
+#
+set daemon 60 # check services at 1-minute intervals
+# with start delay 240 # optional: delay the first check by 4-minutes (by
+# # default Monit check immediately after Monit start)
+#
+#
+## Set syslog logging with the 'daemon' facility. If the FACILITY option is
+## omitted, Monit will use 'user' facility by default. If you want to log to
+## a standalone log file instead, specify the full path to the log file
+#
+set logfile syslog facility log_daemon
+#
+#
+## Set the location of the Monit lock file which stores the process id of the
+## running Monit instance. By default this file is stored in $HOME/.monit.pid
+#
+set pidfile /var/run/monit.pid
+#
+## Set the location of the Monit id file which stores the unique id for the
+## Monit instance. The id is generated and stored on first Monit start. By
+## default the file is placed in $HOME/.monit.id.
+#
+set idfile /var/lib/monit/id
+#
+## Set the location of the Monit state file which saves monitoring states
+## on each cycle. By default the file is placed in $HOME/.monit.state. If
+## the state file is stored on a persistent filesystem, Monit will recover
+## the monitoring state across reboots. If it is on temporary filesystem, the
+## state will be lost on reboot which may be convenient in some situations.
+#
+set statefile /var/lib/monit/state
+#
+## Set the list of mail servers for alert delivery. Multiple servers may be
+## specified using a comma separator. If the first mail server fails, Monit
+# will use the second mail server in the list and so on. By default Monit uses
+# port 25 - it is possible to override this with the PORT option.
+#
+# set mailserver mail.bar.baz, # primary mailserver
+# backup.bar.baz port 10025, # backup mailserver on port 10025
+# localhost # fallback relay
+#
+#
+## By default Monit will drop alert events if no mail servers are available.
+## If you want to keep the alerts for later delivery retry, you can use the
+## EVENTQUEUE statement. The base directory where undelivered alerts will be
+## stored is specified by the BASEDIR option. You can limit the queue size
+## by using the SLOTS option (if omitted, the queue is limited by space
+## available in the back end filesystem).
+#
+set eventqueue
+ basedir /var/lib/monit # set the base directory where events will be stored
+ slots 100 # optionally limit the queue size
+#
+#
+## Send status and events to M/Monit (for more informations about M/Monit
+## see http://mmonit.com/). By default Monit registers credentials with
+## M/Monit so M/Monit can smoothly communicate back to Monit and you don't
+## have to register Monit credentials manually in M/Monit. It is possible to
+## disable credential registration using the commented out option below.
+## Though, if safety is a concern we recommend instead using https when
+## communicating with M/Monit and send credentials encrypted.
+#
+# set mmonit http://monit:monit@192.168.1.10:8080/collector
+# # and register without credentials # Don't register credentials
+#
+#
+## Monit by default uses the following format for alerts if the the mail-format
+## statement is missing::
+## --8<--
+## set mail-format {
+## from: monit@$HOST
+## subject: monit alert -- $EVENT $SERVICE
+## message: $EVENT Service $SERVICE
+## Date: $DATE
+## Action: $ACTION
+## Host: $HOST
+## Description: $DESCRIPTION
+##
+## Your faithful employee,
+## Monit
+## }
+## --8<--
+##
+## You can override this message format or parts of it, such as subject
+## or sender using the MAIL-FORMAT statement. Macros such as $DATE, etc.
+## are expanded at runtime. For example, to override the sender, use:
+#
+# set mail-format { from: monit@foo.bar }a
+#
+#
+## You can set alert recipients whom will receive alerts if/when a
+## service defined in this file has errors. Alerts may be restricted on
+## events by using a filter as in the second example below.
+#
+# set alert sysadm@foo.bar # receive all alerts
+## Do not alert when Monit start, stop or perform a user initiated action.
+## This filter is recommended to avoid getting alerts for trivial cases
+# set alert your-name@your.domain not on { instance, action }
+#
+#
+## Monit has an embedded web server which can be used to view status of
+## services monitored and manage services from a web interface. See the
+## Monit Wiki if you want to enable SSL for the web server.
+#
+set httpd port 2812 and
+ use address localhost # only accept connection from localhost
+ allow localhost # allow localhost to connect to the server and
+# allow admin:monit # require user 'admin' with password 'monit'
+# allow @monit # allow users of group 'monit' to connect (rw)
+# allow @users readonly # allow users of group 'users' to connect readonly
+
+###############################################################################
+## Services
+###############################################################################
+##
+## Check general system resources such as load average, cpu and memory
+## usage. Each test specifies a resource, conditions and the action to be
+## performed should a test fail.
+#
+# check system myhost.mydomain.tld
+# if loadavg (1min) > 4 then alert
+# if loadavg (5min) > 2 then alert
+# if memory usage > 75% then alert
+# if swap usage > 25% then alert
+# if cpu usage (user) > 70% then alert
+# if cpu usage (system) > 30% then alert
+# if cpu usage (wait) > 20% then alert
+#
+#
+## Check if a file exists, checksum, permissions, uid and gid. In addition
+## to alert recipients in the global section, customized alert can be sent to
+## additional recipients by specifying a local alert handler. The service may
+## be grouped using the GROUP option. More than one group can be specified by
+## repeating the 'group name' statement.
+#
+# check file apache_bin with path /usr/local/apache/bin/httpd
+# if failed checksum and
+# expect the sum 8f7f419955cefa0b33a2ba316cba3659 then unmonitor
+# if failed permission 755 then unmonitor
+# if failed uid root then unmonitor
+# if failed gid root then unmonitor
+# alert security@foo.bar on {
+# checksum, permission, uid, gid, unmonitor
+# } with the mail-format { subject: Alarm! }
+# group server
+#
+#
+## Check that a process is running, in this case Apache, and that it respond
+## to HTTP and HTTPS requests. Check its resource usage such as cpu and memory,
+## and number of children. If the process is not running, Monit will restart
+## it by default. In case the service is restarted very often and the
+## problem remains, it is possible to disable monitoring using the TIMEOUT
+## statement. This service depends on another service (apache_bin) which
+## is defined above.
+#
+# check process apache with pidfile /usr/local/apache/logs/httpd.pid
+# start program = "/etc/init.d/httpd start" with timeout 60 seconds
+# stop program = "/etc/init.d/httpd stop"
+# if cpu > 60% for 2 cycles then alert
+# if cpu > 80% for 5 cycles then restart
+# if totalmem > 200.0 MB for 5 cycles then restart
+# if children > 250 then restart
+# if loadavg(5min) greater than 10 for 8 cycles then stop
+# if failed host www.tildeslash.com port 80 protocol http
+# and request "/somefile.html"
+# then restart
+# if failed port 443 type tcpssl protocol http
+# with timeout 15 seconds
+# then restart
+# if 3 restarts within 5 cycles then timeout
+# depends on apache_bin
+# group server
+#
+#
+## Check filesystem permissions, uid, gid, space and inode usage. Other services,
+## such as databases, may depend on this resource and an automatically graceful
+## stop may be cascaded to them before the filesystem will become full and data
+## lost.
+#
+# check filesystem datafs with path /dev/sdb1
+# start program = "/bin/mount /data"
+# stop program = "/bin/umount /data"
+# if failed permission 660 then unmonitor
+# if failed uid root then unmonitor
+# if failed gid disk then unmonitor
+# if space usage > 80% for 5 times within 15 cycles then alert
+# if space usage > 99% then stop
+# if inode usage > 30000 then alert
+# if inode usage > 99% then stop
+# group server
+#
+#
+## Check a file's timestamp. In this example, we test if a file is older
+## than 15 minutes and assume something is wrong if its not updated. Also,
+## if the file size exceed a given limit, execute a script
+#
+# check file database with path /data/mydatabase.db
+# if failed permission 700 then alert
+# if failed uid data then alert
+# if failed gid data then alert
+# if timestamp > 15 minutes then alert
+# if size > 100 MB then exec "/my/cleanup/script" as uid dba and gid dba
+#
+#
+## Check directory permission, uid and gid. An event is triggered if the
+## directory does not belong to the user with uid 0 and gid 0. In addition,
+## the permissions have to match the octal description of 755 (see chmod(1)).
+#
+# check directory bin with path /bin
+# if failed permission 755 then unmonitor
+# if failed uid 0 then unmonitor
+# if failed gid 0 then unmonitor
+#
+#
+## Check a remote host availability by issuing a ping test and check the
+## content of a response from a web server. Up to three pings are sent and
+## connection to a port and an application level network check is performed.
+#
+# check host myserver with address 192.168.1.1
+# if failed icmp type echo count 3 with timeout 3 seconds then alert
+# if failed port 3306 protocol mysql with timeout 15 seconds then alert
+# if failed port 80 protocol http
+# and request /monit/ with content = "Monit [0-9.]+ Download"
+# then alert
+#
+#
+###############################################################################
+## Includes
+###############################################################################
+##
+## It is possible to include additional configuration parts from other files or
+## directories.
+#
+include /etc/monit.d/*
+#
#etc/rc.d/init.d/mldonkey
etc/rc.d/init.d/modules
#etc/rc.d/init.d/motion
+#etc/rc.d/init.d/monit
etc/rc.d/init.d/mountfs
etc/rc.d/init.d/mountkernfs
etc/rc.d/init.d/mounttmpfs
#etc/rc.d/init.d/mysql
#etc/rc.d/init.d/netsnmpd
etc/rc.d/init.d/network
+etc/rc.d/init.d/network-trigger
etc/rc.d/init.d/network-vlans
#etc/rc.d/init.d/networking
etc/rc.d/init.d/networking/any
etc/rc.d/init.d/static-routes
#etc/rc.d/init.d/stunnel
etc/rc.d/init.d/swap
+etc/rc.d/init.d/swconfig
etc/rc.d/init.d/sysctl
etc/rc.d/init.d/sysklogd
-etc/rc.d/init.d/teamspeak
etc/rc.d/init.d/template
#etc/rc.d/init.d/tftpd
etc/rc.d/init.d/tmpfs
etc/rc.d/rcsysinit.d/S50cleanfs
etc/rc.d/rcsysinit.d/S60setclock
etc/rc.d/rcsysinit.d/S70console
+etc/rc.d/rcsysinit.d/S73swconfig
etc/rc.d/rcsysinit.d/S75firstsetup
etc/rc.d/rcsysinit.d/S80localnet
etc/rc.d/rcsysinit.d/S85firewall
+etc/rc.d/rcsysinit.d/S90network-trigger
etc/rc.d/rcsysinit.d/S91network-vlans
etc/rc.d/rcsysinit.d/S92rngd
etc/rc.d/rc3.d/S15fireinfo
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/common/siano/smsdvb.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/common/siano/smsmdtv.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/common/tveeprom.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/dvb-core
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/dvb-core/dvb-core.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/dvb-frontends
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/dvb-frontends/a8293.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/dvb-frontends/af9013.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/cs53l32a.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/cx25840
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/cx25840/cx25840.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/ir-kbd-i2c.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/m52790.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/msp3400.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/mt9v011.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/vp27smpx.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/wm8739.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/i2c/wm8775.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/media.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/pci
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/pci/b2c2
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/pci/b2c2/b2c2-flexcop-pci.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/rc/keymaps/rc-winfast.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/rc/lirc_dev.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/rc/mceusb.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/rc/rc-core.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/rc/rc-loopback.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/rc/redrat3.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/rc/streamzap.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/fc2580.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/m88ts2022.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/max2165.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/mc44s803.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/mt2060.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/mt2063.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/mt20xx.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/mt2131.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/mt2266.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/mxl5005s.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/r820t.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tda18212.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tda18218.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tda18271.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tda827x.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tda8290.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tda9887.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tua9001.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tuner-simple.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tuner-types.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tuner-xc2028.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/tuner_it913x.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/xc4000.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/tuners/xc5000.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/usb
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/usb/au0828
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/usb/au0828/au0828.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/usb/zr364xx/zr364xx.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/tuner.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/v4l2-common.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/v4l2-dv-timings.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/v4l2-mem2mem.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/videobuf-core.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/videobuf-dma-contig.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/videobuf2-dma-contig.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/videobuf2-memops.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/videobuf2-vmalloc.ko
+#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/media/v4l2-core/videodev.ko
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/memstick
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/memstick/core
#lib/modules/KVER-ipfire-kirkwood/kernel/drivers/memstick/core/memstick.ko
#boot/dtb-KVER-ipfire-multi/sun5i-a13-olinuxino.dtb
#boot/dtb-KVER-ipfire-multi/sun6i-a31-colombus.dtb
#boot/dtb-KVER-ipfire-multi/sun7i-a20-bananapi.dtb
+#boot/dtb-KVER-ipfire-multi/sun7i-a20-bananapro.dtb
#boot/dtb-KVER-ipfire-multi/sun7i-a20-cubieboard2.dtb
#boot/dtb-KVER-ipfire-multi/sun7i-a20-cubietruck.dtb
+#boot/dtb-KVER-ipfire-multi/sun7i-a20-lamobo-r1.dtb
#boot/dtb-KVER-ipfire-multi/sun7i-a20-olinuxino-micro.dtb
#boot/dtb-KVER-ipfire-multi/sun7i-a20-pcduino3.dtb
#boot/dtb-KVER-ipfire-multi/vexpress-v2p-ca15-tc1.dtb
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/common/siano/smsdvb.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/common/siano/smsmdtv.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/common/tveeprom.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/dvb-core
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/dvb-core/dvb-core.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/dvb-frontends
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/dvb-frontends/a8293.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/dvb-frontends/af9013.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/cs53l32a.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/cx25840
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/cx25840/cx25840.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/ir-kbd-i2c.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/m52790.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/msp3400.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/mt9v011.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/vp27smpx.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/wm8739.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/i2c/wm8775.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/media.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/pci
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/pci/b2c2
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/pci/b2c2/b2c2-flexcop-pci.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/pci/ttpci/ttpci-eeprom.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/platform
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/platform/m2m-deinterlace.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/platform/omap
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/platform/omap/omap-vout.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/platform/sh_veu.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/platform/soc_camera
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/platform/soc_camera/mx3_camera.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/rc/keymaps/rc-winfast.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/rc/lirc_dev.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/rc/mceusb.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/rc/rc-core.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/rc/rc-loopback.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/rc/redrat3.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/rc/streamzap.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/fc2580.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/m88ts2022.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/max2165.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/mc44s803.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/mt2060.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/mt2063.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/mt20xx.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/mt2131.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/mt2266.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/mxl5005s.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/r820t.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tda18212.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tda18218.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tda18271.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tda827x.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tda8290.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tda9887.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tua9001.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tuner-simple.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tuner-types.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tuner-xc2028.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/tuner_it913x.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/xc4000.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/tuners/xc5000.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/usb
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/usb/au0828
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/usb/au0828/au0828.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/usb/zr364xx/zr364xx.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/tuner.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/v4l2-common.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/v4l2-dv-timings.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/v4l2-mem2mem.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videobuf-core.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videobuf-dma-contig.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videobuf-dma-sg.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videobuf-dvb.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videobuf-vmalloc.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videobuf2-dma-contig.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videobuf2-memops.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videobuf2-vmalloc.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/media/v4l2-core/videodev.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/memstick
#lib/modules/KVER-ipfire-multi/kernel/drivers/memstick/core
#lib/modules/KVER-ipfire-multi/kernel/drivers/memstick/core/memstick.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ethernet/jme.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ethernet/marvell
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ethernet/marvell/mv643xx_eth.ko
-#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ethernet/marvell/mvmdio.ko
-#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ethernet/marvell/mvneta.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ethernet/marvell/skge.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ethernet/marvell/sky2.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ethernet/mellanox
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/amd.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/at803x.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/b53
+#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/b53/b53_common.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/b53/b53_mdio.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/bcm87xx.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/broadcom.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/cicada.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/lxt.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/marvell.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/mdio-bitbang.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/mdio-gpio.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/mdio-mux-gpio.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/mdio-mux-mmioreg.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/mdio-mux.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/realtek.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/smsc.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/ste10Xp.ko
+#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/swconfig.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/phy/vitesse.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ppp
#lib/modules/KVER-ipfire-multi/kernel/drivers/net/ppp/bsd_comp.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/rtc/rtc-max6900.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/rtc/rtc-moxart.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/rtc/rtc-msm6242.ko
-#lib/modules/KVER-ipfire-multi/kernel/drivers/rtc/rtc-mv.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/rtc/rtc-mxc.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/rtc/rtc-pcf2127.ko
#lib/modules/KVER-ipfire-multi/kernel/drivers/rtc/rtc-pcf8523.ko
#lib/modules/KVER-ipfire-multi/modules.symbols
#lib/modules/KVER-ipfire-multi/modules.symbols.bin
#lib/modules/KVER-ipfire-multi/source
+usr/include/linux/switch.h
boot/uInit-ipfire-multi
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/ifb.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/imq.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/macvlan.ko
+#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/mii.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/netconsole.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/phy
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/phy/libphy.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/usb/rtl8150.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/usb/sierra_net.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/usb/smsc75xx.ko
+#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/usb/smsc95xx.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/usb/sr9700.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/usb/sr9800.ko
+#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/usb/usbnet.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/usb/zaurus.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/veth.ko
#lib/modules/KVER-ipfire-rpi/kernel/drivers/net/wireless
--- /dev/null
+usr/bin/swconfig
#boot/MLO
-boot/boot.scr
-boot/boot.script
-boot/convert_bootscript
#boot/u-boot.img
+boot/uEnv.txt
usr/bin/mkimage
#usr/share/u-boot
+#usr/share/u-boot/banana_pi
+usr/share/u-boot/banana_pi/u-boot-sunxi-with-spl.bin
#usr/share/u-boot/pandaboard
-#usr/share/u-boot/pandaboard/MLO
-#usr/share/u-boot/pandaboard/u-boot.img
+usr/share/u-boot/pandaboard/MLO
+usr/share/u-boot/pandaboard/u-boot.img
#usr/share/u-boot/wandboard_dl
-#usr/share/u-boot/wandboard_dl/u-boot.imx
+usr/share/u-boot/wandboard_dl/u-boot.imx
#usr/share/u-boot/wandboard_quad
-#usr/share/u-boot/wandboard_quad/u-boot.imx
+usr/share/u-boot/wandboard_quad/u-boot.imx
#usr/share/u-boot/wandboard_solo
-#usr/share/u-boot/wandboard_solo/u-boot.imx
+usr/share/u-boot/wandboard_solo/u-boot.imx
#usr/bin/setarch
usr/bin/setsid
#usr/bin/setterm
-#usr/bin/tailf
+usr/bin/tailf
#usr/bin/taskset
#usr/bin/ul
#usr/bin/unshare
usr/lib/libcollectdclient.so
usr/lib/libcollectdclient.so.0
usr/lib/libcollectdclient.so.0.0.0
-#usr/lib/perl5/site_perl/5.12.3/Collectd
-#usr/lib/perl5/site_perl/5.12.3/Collectd.pm
-#usr/lib/perl5/site_perl/5.12.3/Collectd/Plugins
-#usr/lib/perl5/site_perl/5.12.3/Collectd/Plugins/Monitorus.pm
-#usr/lib/perl5/site_perl/5.12.3/Collectd/Plugins/OpenVZ.pm
-#usr/lib/perl5/site_perl/5.12.3/Collectd/Unixsock.pm
-#usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Collectd
-#usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Collectd/.packlist
+#usr/lib/perl5/Collectd
+#usr/lib/perl5/Collectd.pm
+#usr/lib/perl5/Collectd/Plugins
+#usr/lib/perl5/Collectd/Plugins/OpenVZ.pm
+#usr/lib/perl5/Collectd/Unixsock.pm
+#usr/lib/perl5/i586-linux-thread-multi
+#usr/lib/perl5/i586-linux-thread-multi/auto
+#usr/lib/perl5/i586-linux-thread-multi/auto/Collectd
+#usr/lib/perl5/i586-linux-thread-multi/auto/Collectd/.packlist
+#usr/lib/perl5/i586-linux-thread-multi/perllocal.pod
#usr/lib/pkgconfig/libcollectdclient.pc
+#usr/man/man3/Collectd::Unixsock.3
usr/sbin/collectd
usr/sbin/collectdmon
#usr/share/collectd
#usr/share/man/man1/collectd-nagios.1
#usr/share/man/man1/collectd.1
#usr/share/man/man1/collectdmon.1
-#usr/share/man/man3/Collectd::Unixsock.3
#usr/share/man/man5/collectd-email.5
#usr/share/man/man5/collectd-exec.5
#usr/share/man/man5/collectd-java.5
#root/.python-eggs/M2Crypto-0.21.1-py2.7-linux-MACHINE.egg-tmp
#root/.python-eggs/M2Crypto-0.21.1-py2.7-linux-MACHINE.egg-tmp/M2Crypto
#root/.python-eggs/M2Crypto-0.21.1-py2.7-linux-MACHINE.egg-tmp/M2Crypto/__m2crypto.so
-#root/.python-eggs/M2Crypto-0.21.1-py2.7-linux-i686.egg-tmp
-#root/.python-eggs/M2Crypto-0.21.1-py2.7-linux-i686.egg-tmp/M2Crypto
-#root/.python-eggs/M2Crypto-0.21.1-py2.7-linux-i686.egg-tmp/M2Crypto/__m2crypto.so
sbin/crda
sbin/regdbdump
+#usr/include/reglib
+#usr/include/reglib/nl80211.h
+#usr/include/reglib/regdb.h
+#usr/include/reglib/reglib.h
+usr/lib/libreg.so
#usr/share/man/man8/crda.8.gz
#usr/share/man/man8/regdbdump.8.gz
lib/firmware/dvb-fe-bcm3510-01.fw
+lib/firmware/dvb-fe-drxj-mc-1.0.8.fw
+lib/firmware/dvb-fe-drxj-mc-vsb-1.0.8.fw
+lib/firmware/dvb-fe-drxj-mc-vsb-qam-1.0.8.fw
lib/firmware/dvb-fe-or51132-qam.fw
lib/firmware/dvb-fe-or51132-vsb.fw
lib/firmware/dvb-fe-or51211.fw
lib/firmware/dvb-usb-vp7045-01.fw
lib/firmware/dvb-usb-wt220u-01.fw
lib/firmware/dvb-usb-wt220u-02.fw
-lib/firmware/v4l-cx23885-enc.fw
+lib/firmware/v4l-cx23885-enc-broken.fw
#etc/init.d
#etc/init.d/fuse
+#etc/rc.d/init.d/fuse
etc/udev/rules.d/99-fuse.rules
sbin/mount.fuse
usr/bin/fusermount
#usr/lib/libfuse.la
usr/lib/libfuse.so
usr/lib/libfuse.so.2
-usr/lib/libfuse.so.2.8.3
+usr/lib/libfuse.so.2.9.3
#usr/lib/libulockmgr.a
#usr/lib/libulockmgr.la
usr/lib/libulockmgr.so
usr/lib/libulockmgr.so.1
usr/lib/libulockmgr.so.1.0.1
#usr/lib/pkgconfig/fuse.pc
+#usr/share/man/man1/fusermount.1
+#usr/share/man/man1/ulockmgr_server.1
+#usr/share/man/man8/mount.fuse.8
#etc/rc.d/init.d/miniupnpd
#etc/rc.d/init.d/mldonkey
etc/rc.d/init.d/modules
+#etc/rc.d/init.d/monit
#etc/rc.d/init.d/motion
etc/rc.d/init.d/mountfs
etc/rc.d/init.d/mountkernfs
#etc/rc.d/init.d/mysql
#etc/rc.d/init.d/netsnmpd
etc/rc.d/init.d/network
+etc/rc.d/init.d/network-trigger
etc/rc.d/init.d/network-vlans
#etc/rc.d/init.d/networking
etc/rc.d/init.d/networking/any
etc/rc.d/init.d/swap
etc/rc.d/init.d/sysctl
etc/rc.d/init.d/sysklogd
-etc/rc.d/init.d/teamspeak
etc/rc.d/init.d/template
#etc/rc.d/init.d/tftpd
etc/rc.d/init.d/tmpfs
etc/rc.d/rcsysinit.d/S75firstsetup
etc/rc.d/rcsysinit.d/S80localnet
etc/rc.d/rcsysinit.d/S85firewall
+etc/rc.d/rcsysinit.d/S90network-trigger
etc/rc.d/rcsysinit.d/S91network-vlans
etc/rc.d/rcsysinit.d/S92rngd
etc/rc.d/rc3.d/S15fireinfo
#usr/bin/setarch
usr/bin/setsid
#usr/bin/setterm
-#usr/bin/tailf
+usr/bin/tailf
#usr/bin/taskset
#usr/bin/ul
#usr/bin/unshare
#usr/bin/downloadsource.sh
#usr/bin/execute-postinstall.sh
-#usr/bin/start-networking.sh
#usr/bin/installer
+#usr/bin/start-networking.sh
#usr/lib/dracut/modules.d/99installer
#usr/lib/dracut/modules.d/99installer/70-dhcpcd.exe
#usr/lib/dracut/modules.d/99installer/fake-root.sh
#usr/share/locale/es/LC_MESSAGES/installer.mo
#usr/share/locale/fa/LC_MESSAGES/installer.mo
#usr/share/locale/fr/LC_MESSAGES/installer.mo
+#usr/share/locale/hr/LC_MESSAGES/installer.mo
#usr/share/locale/hu/LC_MESSAGES/installer.mo
#usr/share/locale/id/LC_MESSAGES/installer.mo
#usr/share/locale/it/LC_MESSAGES/installer.mo
#usr/share/locale/ja/LC_MESSAGES/installer.mo
+#usr/share/locale/jv/LC_MESSAGES/installer.mo
#usr/share/locale/km_KH/LC_MESSAGES/installer.mo
#usr/share/locale/nl/LC_MESSAGES/installer.mo
#usr/share/locale/pl/LC_MESSAGES/installer.mo
#usr/share/locale/pt_PT/LC_MESSAGES/installer.mo
#usr/share/locale/ro_RO/LC_MESSAGES/installer.mo
#usr/share/locale/ru/LC_MESSAGES/installer.mo
+#usr/share/locale/rw/LC_MESSAGES/installer.mo
#usr/share/locale/sk/LC_MESSAGES/installer.mo
#usr/share/locale/sq/LC_MESSAGES/installer.mo
+#usr/share/locale/sr/LC_MESSAGES/installer.mo
+#usr/share/locale/su/LC_MESSAGES/installer.mo
#usr/share/locale/sv/LC_MESSAGES/installer.mo
#usr/share/locale/th/LC_MESSAGES/installer.mo
#usr/share/locale/tk/LC_MESSAGES/installer.mo
#lib/kbd/consolefonts/lat0-12.psfu.gz
#lib/kbd/consolefonts/lat0-14.psfu.gz
lib/kbd/consolefonts/lat0-16.psfu.gz
+lib/kbd/consolefonts/lat0-sun16.psfu.gz
#lib/kbd/consolefonts/lat1-08.psfu.gz
#lib/kbd/consolefonts/lat1-10.psfu.gz
#lib/kbd/consolefonts/lat1-12.psfu.gz
#lib/kbd/consolefonts/lat2-12.psfu.gz
#lib/kbd/consolefonts/lat2-14.psfu.gz
lib/kbd/consolefonts/lat2-16.psfu.gz
+lib/kbd/consolefonts/lat2-sun16.psfu.gz
#lib/kbd/consolefonts/lat2a-16.psfu.gz
#lib/kbd/consolefonts/lat4-08.psfu.gz
#lib/kbd/consolefonts/lat4-10.psfu.gz
#lib/kbd/consolefonts/lat9w-12.psfu.gz
#lib/kbd/consolefonts/lat9w-14.psfu.gz
#lib/kbd/consolefonts/lat9w-16.psfu.gz
+lib/kbd/consolefonts/latarcyrheb-sun16.psfu.gz
#lib/kbd/consolefonts/partialfonts
#lib/kbd/consolefonts/partialfonts/8859-1.a0-ff.08.gz
#lib/kbd/consolefonts/partialfonts/8859-1.a0-ff.14.gz
lib/firmware/3com/3C359.bin
lib/firmware/3com/typhoon.bin
lib/firmware/GPL-3
+lib/firmware/LICENCE.Abilis
+lib/firmware/LICENCE.IntcSST2
lib/firmware/LICENCE.Marvell
lib/firmware/LICENCE.OLPC
lib/firmware/LICENCE.agere
lib/firmware/LICENCE.chelsio_firmware
lib/firmware/LICENCE.cw1200
lib/firmware/LICENCE.ene_firmware
+lib/firmware/LICENCE.fw_sst_0f28
lib/firmware/LICENCE.go7007
lib/firmware/LICENCE.i2400m
lib/firmware/LICENCE.ibt_firmware
+lib/firmware/LICENCE.it913x
lib/firmware/LICENCE.iwlwifi_firmware
lib/firmware/LICENCE.mwl8335
lib/firmware/LICENCE.myri10ge_firmware
lib/firmware/LICENCE.phanfw
+lib/firmware/LICENCE.qat_dh895xcc_firmware
lib/firmware/LICENCE.qla2xxx
+lib/firmware/LICENCE.r8a779x_usb3
lib/firmware/LICENCE.ralink-firmware.txt
lib/firmware/LICENCE.ralink_a_mediatek_company_firmware
lib/firmware/LICENCE.rtlwifi_firmware.txt
+lib/firmware/LICENCE.siano
lib/firmware/LICENCE.tda7706-firmware.txt
lib/firmware/LICENCE.ti-connectivity
lib/firmware/LICENCE.ueagle-atm4-firmware
lib/firmware/LICENCE.via_vt6656
lib/firmware/LICENCE.wl1251
+lib/firmware/LICENCE.xc4000
lib/firmware/LICENCE.xc5000
+lib/firmware/LICENCE.xc5000c
lib/firmware/LICENSE.amd-ucode
lib/firmware/LICENSE.dib0700
lib/firmware/LICENSE.radeon
lib/firmware/amd-ucode/microcode_amd.bin.asc
lib/firmware/amd-ucode/microcode_amd_fam15h.bin
lib/firmware/amd-ucode/microcode_amd_fam15h.bin.asc
+lib/firmware/amd-ucode/microcode_amd_fam16h.bin
+lib/firmware/amd-ucode/microcode_amd_fam16h.bin.asc
#lib/firmware/ar3k
#lib/firmware/ar3k/1020200
lib/firmware/ar3k/1020200/PS_ASIC.pst
lib/firmware/ar9170-1.fw
lib/firmware/ar9170-2.fw
lib/firmware/ar9271.fw
+lib/firmware/as102_data1_st.hex
+lib/firmware/as102_data2_st.hex
lib/firmware/ath3k-1.fw
#lib/firmware/ath6k
#lib/firmware/ath6k/AR6002
lib/firmware/bnx2x/bnx2x-e1-7.0.20.0.fw
lib/firmware/bnx2x/bnx2x-e1-7.0.23.0.fw
lib/firmware/bnx2x/bnx2x-e1-7.0.29.0.fw
+lib/firmware/bnx2x/bnx2x-e1-7.10.51.0.fw
lib/firmware/bnx2x/bnx2x-e1-7.2.16.0.fw
lib/firmware/bnx2x/bnx2x-e1-7.2.51.0.fw
lib/firmware/bnx2x/bnx2x-e1-7.8.17.0.fw
+lib/firmware/bnx2x/bnx2x-e1-7.8.19.0.fw
lib/firmware/bnx2x/bnx2x-e1-7.8.2.0.fw
lib/firmware/bnx2x/bnx2x-e1h-6.0.34.0.fw
lib/firmware/bnx2x/bnx2x-e1h-6.2.5.0.fw
lib/firmware/bnx2x/bnx2x-e1h-7.0.20.0.fw
lib/firmware/bnx2x/bnx2x-e1h-7.0.23.0.fw
lib/firmware/bnx2x/bnx2x-e1h-7.0.29.0.fw
+lib/firmware/bnx2x/bnx2x-e1h-7.10.51.0.fw
lib/firmware/bnx2x/bnx2x-e1h-7.2.16.0.fw
lib/firmware/bnx2x/bnx2x-e1h-7.2.51.0.fw
lib/firmware/bnx2x/bnx2x-e1h-7.8.17.0.fw
+lib/firmware/bnx2x/bnx2x-e1h-7.8.19.0.fw
lib/firmware/bnx2x/bnx2x-e1h-7.8.2.0.fw
lib/firmware/bnx2x/bnx2x-e2-6.0.34.0.fw
lib/firmware/bnx2x/bnx2x-e2-6.2.5.0.fw
lib/firmware/bnx2x/bnx2x-e2-7.0.20.0.fw
lib/firmware/bnx2x/bnx2x-e2-7.0.23.0.fw
lib/firmware/bnx2x/bnx2x-e2-7.0.29.0.fw
+lib/firmware/bnx2x/bnx2x-e2-7.10.51.0.fw
lib/firmware/bnx2x/bnx2x-e2-7.2.16.0.fw
lib/firmware/bnx2x/bnx2x-e2-7.2.51.0.fw
lib/firmware/bnx2x/bnx2x-e2-7.8.17.0.fw
+lib/firmware/bnx2x/bnx2x-e2-7.8.19.0.fw
lib/firmware/bnx2x/bnx2x-e2-7.8.2.0.fw
#lib/firmware/brcm
lib/firmware/brcm/bcm4329-fullmac-4.bin
lib/firmware/brcm/bcm43xx-0.fw
lib/firmware/brcm/bcm43xx_hdr-0.fw
+lib/firmware/brcm/brcmfmac43143-sdio.bin
+lib/firmware/brcm/brcmfmac43143.bin
lib/firmware/brcm/brcmfmac43236b.bin
lib/firmware/brcm/brcmfmac43241b0-sdio.bin
lib/firmware/brcm/brcmfmac43241b4-sdio.bin
lib/firmware/brcm/brcmfmac4330-sdio.bin
lib/firmware/brcm/brcmfmac4334-sdio.bin
lib/firmware/brcm/brcmfmac4335-sdio.bin
+lib/firmware/brcm/brcmfmac43362-sdio.bin
+lib/firmware/brcm/brcmfmac4354-sdio.bin
lib/firmware/carl9170-1.fw
#lib/firmware/carl9170fw
#lib/firmware/carl9170fw/CMakeLists.txt
lib/firmware/cis/src/RS-COM-2P.cis
lib/firmware/cis/src/tamarack.cis
lib/firmware/cis/tamarack.cis
+lib/firmware/cmmb_vega_12mhz.inp
+lib/firmware/cmmb_venice_12mhz.inp
#lib/firmware/configure
#lib/firmware/cpia2
lib/firmware/cpia2/stv0672_vp4.bin
lib/firmware/cxgb3/t3fw-7.12.0.bin
lib/firmware/cxgb3/t3fw-7.4.0.bin
#lib/firmware/cxgb4
-lib/firmware/cxgb4/t4fw-1.9.23.0.bin
+lib/firmware/cxgb4/t4fw-1.12.25.0.bin
lib/firmware/cxgb4/t4fw.bin
-lib/firmware/cxgb4/t5fw-1.9.23.0.bin
+lib/firmware/cxgb4/t5fw-1.12.25.0.bin
lib/firmware/cxgb4/t5fw.bin
#lib/firmware/dabusb
lib/firmware/dabusb/bitstream.bin
#lib/firmware/dsp56k/bootstrap.asm
lib/firmware/dsp56k/bootstrap.bin
#lib/firmware/dsp56k/concat-bootstrap.pl
+lib/firmware/dvb-fe-xc4000-1.4.1.fw
lib/firmware/dvb-fe-xc5000-1.6.114.fw
+lib/firmware/dvb-fe-xc5000c-4.1.30.7.fw
lib/firmware/dvb-usb-dib0700-1.20.fw
+lib/firmware/dvb-usb-it9135-01.fw
+lib/firmware/dvb-usb-it9135-02.fw
lib/firmware/dvb-usb-terratec-h5-drxk.fw
+lib/firmware/dvb_nova_12mhz.inp
+lib/firmware/dvb_nova_12mhz_b0.inp
#lib/firmware/e100
lib/firmware/e100/d101m_ucode.bin
lib/firmware/e100/d101s_ucode.bin
lib/firmware/i2400m-fw-usb-1.5.sbcf
lib/firmware/i6050-fw-usb-1.5.sbcf
#lib/firmware/intel
+lib/firmware/intel/IntcSST2.bin
+lib/firmware/intel/fw_sst_0f28.bin
+lib/firmware/intel/fw_sst_0f28.bin-48kHz_i2s_master
+lib/firmware/intel/ibt-hw-37.7.10-fw-1.0.1.2d.d.bseq
lib/firmware/intel/ibt-hw-37.7.10-fw-1.0.2.3.d.bseq
+lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.1.2d.d.bseq
lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
lib/firmware/intel/ibt-hw-37.7.bseq
+lib/firmware/intel/ibt-hw-37.8.10-fw-1.10.2.27.d.bseq
+lib/firmware/intel/ibt-hw-37.8.10-fw-1.10.3.11.e.bseq
+lib/firmware/intel/ibt-hw-37.8.bseq
lib/firmware/intelliport2.bin
#lib/firmware/isci
#lib/firmware/isci/Makefile
#lib/firmware/isci/create_fw.h
lib/firmware/isci/isci_firmware.bin
#lib/firmware/isci/probe_roms.h
+lib/firmware/isdbt_nova_12mhz.inp
+lib/firmware/isdbt_nova_12mhz_b0.inp
+lib/firmware/isdbt_rio.inp
lib/firmware/iwlwifi-100-5.ucode
lib/firmware/iwlwifi-1000-3.ucode
lib/firmware/iwlwifi-1000-5.ucode
lib/firmware/iwlwifi-135-6.ucode
lib/firmware/iwlwifi-2000-6.ucode
lib/firmware/iwlwifi-2030-6.ucode
+lib/firmware/iwlwifi-3160-10.ucode
lib/firmware/iwlwifi-3160-7.ucode
+lib/firmware/iwlwifi-3160-8.ucode
+lib/firmware/iwlwifi-3160-9.ucode
lib/firmware/iwlwifi-3945-2.ucode
lib/firmware/iwlwifi-4965-2.ucode
lib/firmware/iwlwifi-5000-1.ucode
lib/firmware/iwlwifi-6000g2b-6.ucode
lib/firmware/iwlwifi-6050-4.ucode
lib/firmware/iwlwifi-6050-5.ucode
+lib/firmware/iwlwifi-7260-10.ucode
lib/firmware/iwlwifi-7260-7.ucode
+lib/firmware/iwlwifi-7260-8.ucode
+lib/firmware/iwlwifi-7260-9.ucode
+lib/firmware/iwlwifi-7265-10.ucode
+lib/firmware/iwlwifi-7265-8.ucode
+lib/firmware/iwlwifi-7265-9.ucode
+lib/firmware/iwlwifi-7265D-10.ucode
#lib/firmware/kaweth
lib/firmware/kaweth/new_code.bin
lib/firmware/kaweth/new_code_fix.bin
lib/firmware/mwl8k/fmimage_8764_ap-1.fw
lib/firmware/mwl8k/helper_8366.fw
lib/firmware/mwl8k/helper_8687.fw
+lib/firmware/myri10ge_eth_big_z8e.dat
lib/firmware/myri10ge_eth_z8e.dat
+lib/firmware/myri10ge_ethp_big_z8e.dat
lib/firmware/myri10ge_ethp_z8e.dat
+lib/firmware/myri10ge_rss_eth_big_z8e.dat
lib/firmware/myri10ge_rss_eth_z8e.dat
+lib/firmware/myri10ge_rss_ethp_big_z8e.dat
lib/firmware/myri10ge_rss_ethp_z8e.dat
#lib/firmware/myricom
lib/firmware/myricom/lanai.bin
#lib/firmware/ositech
lib/firmware/ositech/Xilinx7OD.bin
lib/firmware/phanfw.bin
+lib/firmware/qat_895xcc.bin
lib/firmware/ql2100_fw.bin
lib/firmware/ql2200_fw.bin
lib/firmware/ql2300_fw.bin
lib/firmware/qlogic/sd7220.fw
#lib/firmware/r128
lib/firmware/r128/r128_cce.bin
+lib/firmware/r8a779x_usb3_v1.dlmem
#lib/firmware/radeon
lib/firmware/radeon/ARUBA_me.bin
lib/firmware/radeon/ARUBA_pfp.bin
lib/firmware/radeon/BARTS_smc.bin
lib/firmware/radeon/BONAIRE_ce.bin
lib/firmware/radeon/BONAIRE_mc.bin
+lib/firmware/radeon/BONAIRE_mc2.bin
lib/firmware/radeon/BONAIRE_me.bin
lib/firmware/radeon/BONAIRE_mec.bin
lib/firmware/radeon/BONAIRE_pfp.bin
lib/firmware/radeon/BONAIRE_sdma.bin
lib/firmware/radeon/BONAIRE_smc.bin
lib/firmware/radeon/BONAIRE_uvd.bin
+lib/firmware/radeon/BONAIRE_vce.bin
lib/firmware/radeon/BTC_rlc.bin
lib/firmware/radeon/CAICOS_mc.bin
lib/firmware/radeon/CAICOS_me.bin
lib/firmware/radeon/CYPRESS_uvd.bin
lib/firmware/radeon/HAINAN_ce.bin
lib/firmware/radeon/HAINAN_mc.bin
+lib/firmware/radeon/HAINAN_mc2.bin
lib/firmware/radeon/HAINAN_me.bin
lib/firmware/radeon/HAINAN_pfp.bin
lib/firmware/radeon/HAINAN_rlc.bin
lib/firmware/radeon/HAINAN_smc.bin
+lib/firmware/radeon/HAWAII_ce.bin
+lib/firmware/radeon/HAWAII_mc.bin
+lib/firmware/radeon/HAWAII_mc2.bin
+lib/firmware/radeon/HAWAII_me.bin
+lib/firmware/radeon/HAWAII_mec.bin
+lib/firmware/radeon/HAWAII_pfp.bin
+lib/firmware/radeon/HAWAII_rlc.bin
+lib/firmware/radeon/HAWAII_sdma.bin
+lib/firmware/radeon/HAWAII_smc.bin
lib/firmware/radeon/JUNIPER_me.bin
lib/firmware/radeon/JUNIPER_pfp.bin
lib/firmware/radeon/JUNIPER_rlc.bin
lib/firmware/radeon/KAVERI_pfp.bin
lib/firmware/radeon/KAVERI_rlc.bin
lib/firmware/radeon/KAVERI_sdma.bin
+lib/firmware/radeon/MULLINS_ce.bin
+lib/firmware/radeon/MULLINS_me.bin
+lib/firmware/radeon/MULLINS_mec.bin
+lib/firmware/radeon/MULLINS_pfp.bin
+lib/firmware/radeon/MULLINS_rlc.bin
+lib/firmware/radeon/MULLINS_sdma.bin
lib/firmware/radeon/OLAND_ce.bin
lib/firmware/radeon/OLAND_mc.bin
+lib/firmware/radeon/OLAND_mc2.bin
lib/firmware/radeon/OLAND_me.bin
lib/firmware/radeon/OLAND_pfp.bin
lib/firmware/radeon/OLAND_rlc.bin
lib/firmware/radeon/PALM_pfp.bin
lib/firmware/radeon/PITCAIRN_ce.bin
lib/firmware/radeon/PITCAIRN_mc.bin
+lib/firmware/radeon/PITCAIRN_mc2.bin
lib/firmware/radeon/PITCAIRN_me.bin
lib/firmware/radeon/PITCAIRN_pfp.bin
lib/firmware/radeon/PITCAIRN_rlc.bin
lib/firmware/radeon/R600_me.bin
lib/firmware/radeon/R600_pfp.bin
lib/firmware/radeon/R600_rlc.bin
+lib/firmware/radeon/R600_uvd.bin
lib/firmware/radeon/R700_rlc.bin
lib/firmware/radeon/REDWOOD_me.bin
lib/firmware/radeon/REDWOOD_pfp.bin
lib/firmware/radeon/RS690_cp.bin
lib/firmware/radeon/RS780_me.bin
lib/firmware/radeon/RS780_pfp.bin
+lib/firmware/radeon/RS780_uvd.bin
lib/firmware/radeon/RV610_me.bin
lib/firmware/radeon/RV610_pfp.bin
lib/firmware/radeon/RV620_me.bin
lib/firmware/radeon/RV770_me.bin
lib/firmware/radeon/RV770_pfp.bin
lib/firmware/radeon/RV770_smc.bin
+lib/firmware/radeon/RV770_uvd.bin
lib/firmware/radeon/SUMO2_me.bin
lib/firmware/radeon/SUMO2_pfp.bin
lib/firmware/radeon/SUMO_me.bin
lib/firmware/radeon/SUMO_uvd.bin
lib/firmware/radeon/TAHITI_ce.bin
lib/firmware/radeon/TAHITI_mc.bin
+lib/firmware/radeon/TAHITI_mc2.bin
lib/firmware/radeon/TAHITI_me.bin
lib/firmware/radeon/TAHITI_pfp.bin
lib/firmware/radeon/TAHITI_rlc.bin
lib/firmware/radeon/TURKS_smc.bin
lib/firmware/radeon/VERDE_ce.bin
lib/firmware/radeon/VERDE_mc.bin
+lib/firmware/radeon/VERDE_mc2.bin
lib/firmware/radeon/VERDE_me.bin
lib/firmware/radeon/VERDE_pfp.bin
lib/firmware/radeon/VERDE_rlc.bin
lib/firmware/radeon/VERDE_smc.bin
+lib/firmware/radeon/bonaire_ce.bin
+lib/firmware/radeon/bonaire_mc.bin
+lib/firmware/radeon/bonaire_me.bin
+lib/firmware/radeon/bonaire_mec.bin
+lib/firmware/radeon/bonaire_pfp.bin
+lib/firmware/radeon/bonaire_rlc.bin
+lib/firmware/radeon/bonaire_sdma.bin
+lib/firmware/radeon/bonaire_smc.bin
+lib/firmware/radeon/hainan_ce.bin
+lib/firmware/radeon/hainan_mc.bin
+lib/firmware/radeon/hainan_me.bin
+lib/firmware/radeon/hainan_pfp.bin
+lib/firmware/radeon/hainan_rlc.bin
+lib/firmware/radeon/hainan_smc.bin
+lib/firmware/radeon/hawaii_ce.bin
+lib/firmware/radeon/hawaii_mc.bin
+lib/firmware/radeon/hawaii_me.bin
+lib/firmware/radeon/hawaii_mec.bin
+lib/firmware/radeon/hawaii_pfp.bin
+lib/firmware/radeon/hawaii_rlc.bin
+lib/firmware/radeon/hawaii_sdma.bin
+lib/firmware/radeon/hawaii_smc.bin
+lib/firmware/radeon/kabini_ce.bin
+lib/firmware/radeon/kabini_me.bin
+lib/firmware/radeon/kabini_mec.bin
+lib/firmware/radeon/kabini_pfp.bin
+lib/firmware/radeon/kabini_rlc.bin
+lib/firmware/radeon/kabini_sdma.bin
+lib/firmware/radeon/kaveri_ce.bin
+lib/firmware/radeon/kaveri_me.bin
+lib/firmware/radeon/kaveri_mec.bin
+lib/firmware/radeon/kaveri_mec2.bin
+lib/firmware/radeon/kaveri_pfp.bin
+lib/firmware/radeon/kaveri_rlc.bin
+lib/firmware/radeon/kaveri_sdma.bin
+lib/firmware/radeon/mullins_ce.bin
+lib/firmware/radeon/mullins_me.bin
+lib/firmware/radeon/mullins_mec.bin
+lib/firmware/radeon/mullins_pfp.bin
+lib/firmware/radeon/mullins_rlc.bin
+lib/firmware/radeon/mullins_sdma.bin
+lib/firmware/radeon/oland_ce.bin
+lib/firmware/radeon/oland_mc.bin
+lib/firmware/radeon/oland_me.bin
+lib/firmware/radeon/oland_pfp.bin
+lib/firmware/radeon/oland_rlc.bin
+lib/firmware/radeon/oland_smc.bin
+lib/firmware/radeon/pitcairn_ce.bin
+lib/firmware/radeon/pitcairn_mc.bin
+lib/firmware/radeon/pitcairn_me.bin
+lib/firmware/radeon/pitcairn_pfp.bin
+lib/firmware/radeon/pitcairn_rlc.bin
+lib/firmware/radeon/pitcairn_smc.bin
+lib/firmware/radeon/tahiti_ce.bin
+lib/firmware/radeon/tahiti_mc.bin
+lib/firmware/radeon/tahiti_me.bin
+lib/firmware/radeon/tahiti_pfp.bin
+lib/firmware/radeon/tahiti_rlc.bin
+lib/firmware/radeon/tahiti_smc.bin
+lib/firmware/radeon/verde_ce.bin
+lib/firmware/radeon/verde_mc.bin
+lib/firmware/radeon/verde_me.bin
+lib/firmware/radeon/verde_pfp.bin
+lib/firmware/radeon/verde_rlc.bin
+lib/firmware/radeon/verde_smc.bin
lib/firmware/rp2.fw
+lib/firmware/rsi_91x.fw
lib/firmware/rt2561.bin
lib/firmware/rt2561s.bin
lib/firmware/rt2661.bin
lib/firmware/rtl_nic/rtl8105e-1.fw
lib/firmware/rtl_nic/rtl8106e-1.fw
lib/firmware/rtl_nic/rtl8106e-2.fw
+lib/firmware/rtl_nic/rtl8107e-1.fw
+lib/firmware/rtl_nic/rtl8107e-2.fw
lib/firmware/rtl_nic/rtl8168d-1.fw
lib/firmware/rtl_nic/rtl8168d-2.fw
lib/firmware/rtl_nic/rtl8168e-1.fw
lib/firmware/rtl_nic/rtl8168g-1.fw
lib/firmware/rtl_nic/rtl8168g-2.fw
lib/firmware/rtl_nic/rtl8168g-3.fw
+lib/firmware/rtl_nic/rtl8168h-1.fw
+lib/firmware/rtl_nic/rtl8168h-2.fw
lib/firmware/rtl_nic/rtl8402-1.fw
lib/firmware/rtl_nic/rtl8411-1.fw
lib/firmware/rtl_nic/rtl8411-2.fw
lib/firmware/rtlwifi/rtl8192cufw_B.bin
lib/firmware/rtlwifi/rtl8192cufw_TMSC.bin
lib/firmware/rtlwifi/rtl8192defw.bin
+lib/firmware/rtlwifi/rtl8192eefw.bin
lib/firmware/rtlwifi/rtl8192sefw.bin
lib/firmware/rtlwifi/rtl8712u.bin
+lib/firmware/rtlwifi/rtl8723aufw_A.bin
+lib/firmware/rtlwifi/rtl8723aufw_B.bin
+lib/firmware/rtlwifi/rtl8723aufw_B_NoBT.bin
+lib/firmware/rtlwifi/rtl8723befw.bin
lib/firmware/rtlwifi/rtl8723fw.bin
lib/firmware/rtlwifi/rtl8723fw_B.bin
+lib/firmware/rtlwifi/rtl8821aefw.bin
+lib/firmware/rtlwifi/rtl8821aefw_wowlan.bin
lib/firmware/s2250.fw
lib/firmware/s2250_loader.fw
-lib/firmware/s5p-mfc
-lib/firmware/s5p-mfc/s5p-mfc-v6.fw
-lib/firmware/s5p-mfc/s5p-mfc.fw
+lib/firmware/s5p-mfc-v6-v2.fw
+lib/firmware/s5p-mfc-v6.fw
+lib/firmware/s5p-mfc-v7.fw
+lib/firmware/s5p-mfc-v8.fw
+lib/firmware/s5p-mfc.fw
#lib/firmware/sb16
lib/firmware/sb16/alaw_main.csp
lib/firmware/sb16/ima_adpcm_capture.csp
lib/firmware/slicoss/oasisdbgdownload.sys
lib/firmware/slicoss/oasisdownload.sys
lib/firmware/slicoss/oasisrcvucode.sys
+lib/firmware/sms1xxx-hcw-55xxx-dvbt-02.fw
+lib/firmware/sms1xxx-hcw-55xxx-isdbt-02.fw
+lib/firmware/sms1xxx-nova-a-dvbt-01.fw
+lib/firmware/sms1xxx-nova-b-dvbt-01.fw
+lib/firmware/sms1xxx-stellar-dvbt-01.fw
#lib/firmware/sun
lib/firmware/sun/cassini.bin
#lib/firmware/sxg
lib/firmware/sxg/saharadbgdownloadB.sys
lib/firmware/sxg/saharadownloadB.sys
+lib/firmware/tdmb_nova_12mhz.inp
#lib/firmware/tehuti
lib/firmware/tehuti/bdx.bin
#lib/firmware/ti-connectivity
lib/firmware/ti-connectivity/wl12xx-nvs.bin
lib/firmware/ti-connectivity/wl18xx-conf.bin
lib/firmware/ti-connectivity/wl18xx-fw-2.bin
+lib/firmware/ti-connectivity/wl18xx-fw-3.bin
+lib/firmware/ti-connectivity/wl18xx-fw-4.bin
lib/firmware/ti-connectivity/wl18xx-fw.bin
lib/firmware/ti_3410.fw
lib/firmware/ti_5052.fw
+#etc/logrotate.d
+etc/logrotate.d/.empty
#usr/man/man8/logrotate.8
usr/sbin/logrotate
var/lib/logrotate.status
bin/lowntfs-3g
bin/ntfs-3g
-lib/libntfs-3g.so
-lib/libntfs-3g.so.80
-lib/libntfs-3g.so.80.0.0
+#lib/libntfs-3g.so
+lib/libntfs-3g.so.85
+lib/libntfs-3g.so.85.0.0
+sbin/mkfs.ntfs
sbin/mount.lowntfs-3g
sbin/mount.ntfs-3g
usr/bin/ntfs-3g.probe
usr/bin/ntfs-3g.secaudit
usr/bin/ntfs-3g.usermap
+usr/bin/ntfscat
+usr/bin/ntfscluster
+usr/bin/ntfscmp
+usr/bin/ntfsfix
+usr/bin/ntfsinfo
+usr/bin/ntfsls
#usr/include/ntfs-3g
#usr/include/ntfs-3g/acls.h
#usr/include/ntfs-3g/attrib.h
#usr/include/ntfs-3g/ntfstime.h
#usr/include/ntfs-3g/object_id.h
#usr/include/ntfs-3g/param.h
+#usr/include/ntfs-3g/realpath.h
#usr/include/ntfs-3g/reparse.h
#usr/include/ntfs-3g/runlist.h
#usr/include/ntfs-3g/security.h
#usr/include/ntfs-3g/xattrs.h
#usr/lib/libntfs-3g.a
#usr/lib/libntfs-3g.la
-usr/lib/libntfs-3g.so
+#usr/lib/libntfs-3g.so
usr/lib/pkgconfig/libntfs-3g.pc
+usr/sbin/mkntfs
+usr/sbin/ntfsclone
+usr/sbin/ntfscp
+usr/sbin/ntfslabel
+usr/sbin/ntfsresize
+usr/sbin/ntfsundelete
#usr/share/doc/ntfs-3g
#usr/share/doc/ntfs-3g/README
+#usr/share/man/man8/mkfs.ntfs.8
+#usr/share/man/man8/mkntfs.8
#usr/share/man/man8/mount.lowntfs-3g.8
#usr/share/man/man8/mount.ntfs-3g.8
#usr/share/man/man8/ntfs-3g.8
#usr/share/man/man8/ntfs-3g.probe.8
#usr/share/man/man8/ntfs-3g.secaudit.8
#usr/share/man/man8/ntfs-3g.usermap.8
+#usr/share/man/man8/ntfscat.8
+#usr/share/man/man8/ntfsclone.8
+#usr/share/man/man8/ntfscluster.8
+#usr/share/man/man8/ntfscmp.8
+#usr/share/man/man8/ntfscp.8
+#usr/share/man/man8/ntfsfix.8
+#usr/share/man/man8/ntfsinfo.8
+#usr/share/man/man8/ntfslabel.8
+#usr/share/man/man8/ntfsls.8
+#usr/share/man/man8/ntfsprogs.8
+#usr/share/man/man8/ntfsresize.8
+#usr/share/man/man8/ntfsundelete.8
etc/rc.d/rc0.d/K46ntpd
etc/rc.d/rc3.d/S26ntpd
etc/rc.d/rc6.d/K46ntpd
+usr/bin/calc_tickadj
usr/bin/ntp-keygen
usr/bin/ntp-wait
usr/bin/ntpd
usr/bin/ntptrace
usr/bin/sntp
usr/bin/tickadj
+#usr/include/event2
+#usr/share/doc/ntp4
+#usr/share/doc/ntp4/html
+#usr/share/doc/ntp4/html/access.html
+#usr/share/doc/ntp4/html/accopt.html
+#usr/share/doc/ntp4/html/assoc.html
+#usr/share/doc/ntp4/html/audio.html
+#usr/share/doc/ntp4/html/authentic.html
+#usr/share/doc/ntp4/html/authopt.html
+#usr/share/doc/ntp4/html/autokey.html
+#usr/share/doc/ntp4/html/bugs.html
+#usr/share/doc/ntp4/html/build.html
+#usr/share/doc/ntp4/html/clock.html
+#usr/share/doc/ntp4/html/clockopt.html
+#usr/share/doc/ntp4/html/cluster.html
+#usr/share/doc/ntp4/html/comdex.html
+#usr/share/doc/ntp4/html/config.html
+#usr/share/doc/ntp4/html/confopt.html
+#usr/share/doc/ntp4/html/copyright.html
+#usr/share/doc/ntp4/html/debug.html
+#usr/share/doc/ntp4/html/decode.html
+#usr/share/doc/ntp4/html/discipline.html
+#usr/share/doc/ntp4/html/discover.html
+#usr/share/doc/ntp4/html/drivers
+#usr/share/doc/ntp4/html/drivers/driver1.html
+#usr/share/doc/ntp4/html/drivers/driver10.html
+#usr/share/doc/ntp4/html/drivers/driver11.html
+#usr/share/doc/ntp4/html/drivers/driver12.html
+#usr/share/doc/ntp4/html/drivers/driver16.html
+#usr/share/doc/ntp4/html/drivers/driver18.html
+#usr/share/doc/ntp4/html/drivers/driver19.html
+#usr/share/doc/ntp4/html/drivers/driver20.html
+#usr/share/doc/ntp4/html/drivers/driver22.html
+#usr/share/doc/ntp4/html/drivers/driver26.html
+#usr/share/doc/ntp4/html/drivers/driver27.html
+#usr/share/doc/ntp4/html/drivers/driver28.html
+#usr/share/doc/ntp4/html/drivers/driver29.html
+#usr/share/doc/ntp4/html/drivers/driver3.html
+#usr/share/doc/ntp4/html/drivers/driver30.html
+#usr/share/doc/ntp4/html/drivers/driver31.html
+#usr/share/doc/ntp4/html/drivers/driver32.html
+#usr/share/doc/ntp4/html/drivers/driver33.html
+#usr/share/doc/ntp4/html/drivers/driver34.html
+#usr/share/doc/ntp4/html/drivers/driver35.html
+#usr/share/doc/ntp4/html/drivers/driver36.html
+#usr/share/doc/ntp4/html/drivers/driver37.html
+#usr/share/doc/ntp4/html/drivers/driver38.html
+#usr/share/doc/ntp4/html/drivers/driver39.html
+#usr/share/doc/ntp4/html/drivers/driver4.html
+#usr/share/doc/ntp4/html/drivers/driver40.html
+#usr/share/doc/ntp4/html/drivers/driver42.html
+#usr/share/doc/ntp4/html/drivers/driver43.html
+#usr/share/doc/ntp4/html/drivers/driver44.html
+#usr/share/doc/ntp4/html/drivers/driver45.html
+#usr/share/doc/ntp4/html/drivers/driver46.html
+#usr/share/doc/ntp4/html/drivers/driver5.html
+#usr/share/doc/ntp4/html/drivers/driver6.html
+#usr/share/doc/ntp4/html/drivers/driver7.html
+#usr/share/doc/ntp4/html/drivers/driver8.html
+#usr/share/doc/ntp4/html/drivers/driver9.html
+#usr/share/doc/ntp4/html/drivers/icons
+#usr/share/doc/ntp4/html/drivers/icons/home.gif
+#usr/share/doc/ntp4/html/drivers/icons/mail2.gif
+#usr/share/doc/ntp4/html/drivers/mx4200data.html
+#usr/share/doc/ntp4/html/drivers/oncore-shmem.html
+#usr/share/doc/ntp4/html/drivers/scripts
+#usr/share/doc/ntp4/html/drivers/scripts/footer.txt
+#usr/share/doc/ntp4/html/drivers/scripts/style.css
+#usr/share/doc/ntp4/html/drivers/tf582_4.html
+#usr/share/doc/ntp4/html/extern.html
+#usr/share/doc/ntp4/html/filter.html
+#usr/share/doc/ntp4/html/hints
+#usr/share/doc/ntp4/html/hints.html
+#usr/share/doc/ntp4/html/hints/a-ux
+#usr/share/doc/ntp4/html/hints/aix
+#usr/share/doc/ntp4/html/hints/bsdi
+#usr/share/doc/ntp4/html/hints/changes
+#usr/share/doc/ntp4/html/hints/decosf1
+#usr/share/doc/ntp4/html/hints/decosf2
+#usr/share/doc/ntp4/html/hints/freebsd
+#usr/share/doc/ntp4/html/hints/hpux
+#usr/share/doc/ntp4/html/hints/linux
+#usr/share/doc/ntp4/html/hints/mpeix
+#usr/share/doc/ntp4/html/hints/notes-xntp-v3
+#usr/share/doc/ntp4/html/hints/parse
+#usr/share/doc/ntp4/html/hints/refclocks
+#usr/share/doc/ntp4/html/hints/rs6000
+#usr/share/doc/ntp4/html/hints/sco.html
+#usr/share/doc/ntp4/html/hints/sgi
+#usr/share/doc/ntp4/html/hints/solaris-dosynctodr.html
+#usr/share/doc/ntp4/html/hints/solaris.html
+#usr/share/doc/ntp4/html/hints/solaris.xtra.4023118
+#usr/share/doc/ntp4/html/hints/solaris.xtra.4095849
+#usr/share/doc/ntp4/html/hints/solaris.xtra.S99ntpd
+#usr/share/doc/ntp4/html/hints/solaris.xtra.patchfreq
+#usr/share/doc/ntp4/html/hints/sun4
+#usr/share/doc/ntp4/html/hints/svr4-dell
+#usr/share/doc/ntp4/html/hints/svr4_package
+#usr/share/doc/ntp4/html/hints/todo
+#usr/share/doc/ntp4/html/hints/vxworks.html
+#usr/share/doc/ntp4/html/hints/winnt.html
+#usr/share/doc/ntp4/html/history.html
+#usr/share/doc/ntp4/html/howto.html
+#usr/share/doc/ntp4/html/huffpuff.html
+#usr/share/doc/ntp4/html/icons
+#usr/share/doc/ntp4/html/icons/home.gif
+#usr/share/doc/ntp4/html/icons/mail2.gif
+#usr/share/doc/ntp4/html/icons/sitemap.png
+#usr/share/doc/ntp4/html/index.html
+#usr/share/doc/ntp4/html/kern.html
+#usr/share/doc/ntp4/html/kernpps.html
+#usr/share/doc/ntp4/html/keygen.html
+#usr/share/doc/ntp4/html/leap.html
+#usr/share/doc/ntp4/html/miscopt.html
+#usr/share/doc/ntp4/html/monopt.html
+#usr/share/doc/ntp4/html/msyslog.html
+#usr/share/doc/ntp4/html/ntp-wait.html
+#usr/share/doc/ntp4/html/ntp_conf.html
+#usr/share/doc/ntp4/html/ntpd.html
+#usr/share/doc/ntp4/html/ntpdate.html
+#usr/share/doc/ntp4/html/ntpdc.html
+#usr/share/doc/ntp4/html/ntpdsim.html
+#usr/share/doc/ntp4/html/ntpdsim_new.html
+#usr/share/doc/ntp4/html/ntpq.html
+#usr/share/doc/ntp4/html/ntptime.html
+#usr/share/doc/ntp4/html/ntptrace.html
+#usr/share/doc/ntp4/html/orphan.html
+#usr/share/doc/ntp4/html/parsedata.html
+#usr/share/doc/ntp4/html/parsenew.html
+#usr/share/doc/ntp4/html/pic
+#usr/share/doc/ntp4/html/pic/9400n.jpg
+#usr/share/doc/ntp4/html/pic/alice11.gif
+#usr/share/doc/ntp4/html/pic/alice13.gif
+#usr/share/doc/ntp4/html/pic/alice15.gif
+#usr/share/doc/ntp4/html/pic/alice23.gif
+#usr/share/doc/ntp4/html/pic/alice31.gif
+#usr/share/doc/ntp4/html/pic/alice32.gif
+#usr/share/doc/ntp4/html/pic/alice35.gif
+#usr/share/doc/ntp4/html/pic/alice38.gif
+#usr/share/doc/ntp4/html/pic/alice44.gif
+#usr/share/doc/ntp4/html/pic/alice47.gif
+#usr/share/doc/ntp4/html/pic/alice51.gif
+#usr/share/doc/ntp4/html/pic/alice61.gif
+#usr/share/doc/ntp4/html/pic/barnstable.gif
+#usr/share/doc/ntp4/html/pic/beaver.gif
+#usr/share/doc/ntp4/html/pic/boom3.gif
+#usr/share/doc/ntp4/html/pic/boom3a.gif
+#usr/share/doc/ntp4/html/pic/boom4.gif
+#usr/share/doc/ntp4/html/pic/broad.gif
+#usr/share/doc/ntp4/html/pic/bustardfly.gif
+#usr/share/doc/ntp4/html/pic/c51.jpg
+#usr/share/doc/ntp4/html/pic/description.jpg
+#usr/share/doc/ntp4/html/pic/discipline.gif
+#usr/share/doc/ntp4/html/pic/dogsnake.gif
+#usr/share/doc/ntp4/html/pic/driver29.gif
+#usr/share/doc/ntp4/html/pic/driver43_1.gif
+#usr/share/doc/ntp4/html/pic/driver43_2.jpg
+#usr/share/doc/ntp4/html/pic/fg6021.gif
+#usr/share/doc/ntp4/html/pic/fg6039.jpg
+#usr/share/doc/ntp4/html/pic/fig_3_1.gif
+#usr/share/doc/ntp4/html/pic/flatheads.gif
+#usr/share/doc/ntp4/html/pic/flt1.gif
+#usr/share/doc/ntp4/html/pic/flt2.gif
+#usr/share/doc/ntp4/html/pic/flt3.gif
+#usr/share/doc/ntp4/html/pic/flt4.gif
+#usr/share/doc/ntp4/html/pic/flt5.gif
+#usr/share/doc/ntp4/html/pic/flt6.gif
+#usr/share/doc/ntp4/html/pic/flt7.gif
+#usr/share/doc/ntp4/html/pic/flt8.gif
+#usr/share/doc/ntp4/html/pic/flt9.gif
+#usr/share/doc/ntp4/html/pic/freq1211.gif
+#usr/share/doc/ntp4/html/pic/gadget.jpg
+#usr/share/doc/ntp4/html/pic/gps167.jpg
+#usr/share/doc/ntp4/html/pic/group.gif
+#usr/share/doc/ntp4/html/pic/hornraba.gif
+#usr/share/doc/ntp4/html/pic/igclock.gif
+#usr/share/doc/ntp4/html/pic/neoclock4x.gif
+#usr/share/doc/ntp4/html/pic/offset1211.gif
+#usr/share/doc/ntp4/html/pic/oncore_evalbig.gif
+#usr/share/doc/ntp4/html/pic/oncore_remoteant.jpg
+#usr/share/doc/ntp4/html/pic/oncore_utplusbig.gif
+#usr/share/doc/ntp4/html/pic/oz2.gif
+#usr/share/doc/ntp4/html/pic/panda.gif
+#usr/share/doc/ntp4/html/pic/pd_om006.gif
+#usr/share/doc/ntp4/html/pic/pd_om011.gif
+#usr/share/doc/ntp4/html/pic/peer.gif
+#usr/share/doc/ntp4/html/pic/pogo.gif
+#usr/share/doc/ntp4/html/pic/pogo1a.gif
+#usr/share/doc/ntp4/html/pic/pogo3a.gif
+#usr/share/doc/ntp4/html/pic/pogo4.gif
+#usr/share/doc/ntp4/html/pic/pogo5.gif
+#usr/share/doc/ntp4/html/pic/pogo6.gif
+#usr/share/doc/ntp4/html/pic/pogo7.gif
+#usr/share/doc/ntp4/html/pic/pogo8.gif
+#usr/share/doc/ntp4/html/pic/pzf509.jpg
+#usr/share/doc/ntp4/html/pic/pzf511.jpg
+#usr/share/doc/ntp4/html/pic/rabbit.gif
+#usr/share/doc/ntp4/html/pic/radio2.jpg
+#usr/share/doc/ntp4/html/pic/sheepb.jpg
+#usr/share/doc/ntp4/html/pic/stack1a.jpg
+#usr/share/doc/ntp4/html/pic/stats.gif
+#usr/share/doc/ntp4/html/pic/sx5.gif
+#usr/share/doc/ntp4/html/pic/thunderbolt.jpg
+#usr/share/doc/ntp4/html/pic/time1.gif
+#usr/share/doc/ntp4/html/pic/tonea.gif
+#usr/share/doc/ntp4/html/pic/tribeb.gif
+#usr/share/doc/ntp4/html/pic/wingdorothy.gif
+#usr/share/doc/ntp4/html/poll.html
+#usr/share/doc/ntp4/html/pps.html
+#usr/share/doc/ntp4/html/prefer.html
+#usr/share/doc/ntp4/html/quick.html
+#usr/share/doc/ntp4/html/rate.html
+#usr/share/doc/ntp4/html/rdebug.html
+#usr/share/doc/ntp4/html/refclock.html
+#usr/share/doc/ntp4/html/release.html
+#usr/share/doc/ntp4/html/scripts
+#usr/share/doc/ntp4/html/scripts/accopt.txt
+#usr/share/doc/ntp4/html/scripts/audio.txt
+#usr/share/doc/ntp4/html/scripts/authopt.txt
+#usr/share/doc/ntp4/html/scripts/clockopt.txt
+#usr/share/doc/ntp4/html/scripts/command.txt
+#usr/share/doc/ntp4/html/scripts/config.txt
+#usr/share/doc/ntp4/html/scripts/confopt.txt
+#usr/share/doc/ntp4/html/scripts/external.txt
+#usr/share/doc/ntp4/html/scripts/footer.txt
+#usr/share/doc/ntp4/html/scripts/hand.txt
+#usr/share/doc/ntp4/html/scripts/install.txt
+#usr/share/doc/ntp4/html/scripts/manual.txt
+#usr/share/doc/ntp4/html/scripts/misc.txt
+#usr/share/doc/ntp4/html/scripts/miscopt.txt
+#usr/share/doc/ntp4/html/scripts/monopt.txt
+#usr/share/doc/ntp4/html/scripts/refclock.txt
+#usr/share/doc/ntp4/html/scripts/special.txt
+#usr/share/doc/ntp4/html/scripts/style.css
+#usr/share/doc/ntp4/html/select.html
+#usr/share/doc/ntp4/html/sitemap.html
+#usr/share/doc/ntp4/html/sntp.html
+#usr/share/doc/ntp4/html/stats.html
+#usr/share/doc/ntp4/html/tickadj.html
+#usr/share/doc/ntp4/html/warp.html
+#usr/share/doc/ntp4/html/xleave.html
+#usr/share/doc/ntp4/ntp-keygen.html
+#usr/share/doc/ntp4/ntp-wait.html
+#usr/share/doc/ntp4/ntp.conf.html
+#usr/share/doc/ntp4/ntp.keys.html
+#usr/share/doc/ntp4/ntpd.html
+#usr/share/doc/ntp4/ntpdc.html
+#usr/share/doc/ntp4/ntpq.html
+#usr/share/doc/ntp4/ntpsnmpd.html
+#usr/share/doc/ntp4/ntpsweep.html
+#usr/share/doc/ntp4/ntptrace.html
+#usr/share/doc/sntp
+#usr/share/doc/sntp/sntp.html
+#usr/share/man/man1/calc_tickadj.1
#usr/share/man/man1/ntp-keygen.1
+#usr/share/man/man1/ntp-wait.1
#usr/share/man/man1/ntpd.1
#usr/share/man/man1/ntpdc.1
#usr/share/man/man1/ntpq.1
-#usr/share/man/man1/ntpsnmpd.1
+#usr/share/man/man1/ntptrace.1
#usr/share/man/man1/sntp.1
+#usr/share/man/man5/ntp.conf.5
+#usr/share/man/man5/ntp.keys.5
+#usr/share/ntp
+#usr/share/ntp/lib
+#usr/share/ntp/lib/NTP
+#usr/share/ntp/lib/NTP/Util.pm
var/ipfire/time/counter.conf
var/ipfire/time/enable
var/ipfire/time/settime.conf
#usr/share/doc/openvpn/README.polarssl
#usr/share/doc/openvpn/management-notes.txt
#usr/share/man/man8/openvpn.8
-var/ipfire/ovpn
var/ipfire/ovpn/ca
var/ipfire/ovpn/caconfig
var/ipfire/ovpn/ccd
var/ipfire/ovpn/ovpnconfig
var/ipfire/ovpn/scripts
var/ipfire/ovpn/settings
+var/log/openvpn
usr/bin/probenic.sh
usr/sbin/setup
+usr/share/locale/ar/LC_MESSAGES/setup.mo
+usr/share/locale/ca/LC_MESSAGES/setup.mo
+#usr/share/locale/cs_CZ
+#usr/share/locale/cs_CZ/LC_MESSAGES
+usr/share/locale/cs_CZ/LC_MESSAGES/setup.mo
+usr/share/locale/da/LC_MESSAGES/setup.mo
usr/share/locale/de/LC_MESSAGES/setup.mo
+#usr/share/locale/el_GR
+#usr/share/locale/el_GR/LC_MESSAGES
+usr/share/locale/el_GR/LC_MESSAGES/setup.mo
+usr/share/locale/es/LC_MESSAGES/setup.mo
+usr/share/locale/fa/LC_MESSAGES/setup.mo
+usr/share/locale/fr/LC_MESSAGES/setup.mo
+usr/share/locale/hr/LC_MESSAGES/setup.mo
+usr/share/locale/hu/LC_MESSAGES/setup.mo
+usr/share/locale/id/LC_MESSAGES/setup.mo
+usr/share/locale/it/LC_MESSAGES/setup.mo
+usr/share/locale/ja/LC_MESSAGES/setup.mo
+#usr/share/locale/jv
+#usr/share/locale/jv/LC_MESSAGES
+usr/share/locale/jv/LC_MESSAGES/setup.mo
+#usr/share/locale/km_KH
+#usr/share/locale/km_KH/LC_MESSAGES
+usr/share/locale/km_KH/LC_MESSAGES/setup.mo
+usr/share/locale/nl/LC_MESSAGES/setup.mo
+usr/share/locale/pl/LC_MESSAGES/setup.mo
+usr/share/locale/pt_BR/LC_MESSAGES/setup.mo
+#usr/share/locale/pt_PT
+#usr/share/locale/pt_PT/LC_MESSAGES
+usr/share/locale/pt_PT/LC_MESSAGES/setup.mo
+#usr/share/locale/ro_RO
+#usr/share/locale/ro_RO/LC_MESSAGES
+usr/share/locale/ro_RO/LC_MESSAGES/setup.mo
+usr/share/locale/ru/LC_MESSAGES/setup.mo
+usr/share/locale/rw/LC_MESSAGES/setup.mo
+usr/share/locale/sk/LC_MESSAGES/setup.mo
+usr/share/locale/sq/LC_MESSAGES/setup.mo
+usr/share/locale/sr/LC_MESSAGES/setup.mo
+#usr/share/locale/su
+#usr/share/locale/su/LC_MESSAGES
+usr/share/locale/su/LC_MESSAGES/setup.mo
+usr/share/locale/sv/LC_MESSAGES/setup.mo
+usr/share/locale/th/LC_MESSAGES/setup.mo
+#usr/share/locale/tk
+#usr/share/locale/tk/LC_MESSAGES
+usr/share/locale/tk/LC_MESSAGES/setup.mo
+usr/share/locale/tr/LC_MESSAGES/setup.mo
+usr/share/locale/uk/LC_MESSAGES/setup.mo
+#usr/share/locale/uz@Latn
+#usr/share/locale/uz@Latn/LC_MESSAGES
+usr/share/locale/uz@Latn/LC_MESSAGES/setup.mo
+usr/share/locale/vi/LC_MESSAGES/setup.mo
+#usr/share/locale/zh
+#usr/share/locale/zh/LC_MESSAGES
+usr/share/locale/zh/LC_MESSAGES/setup.mo
etc/logrotate.conf
etc/mime.types
etc/modprobe.d
+etc/modprobe.d/btmrvl_sdio.conf
etc/modprobe.d/cfg80211.conf
etc/modprobe.d/pcspeaker.conf
etc/modules.conf
#home
home/nobody
#lib
+#lib/firmware
+#lib/firmware/brcm
+lib/firmware/brcm/brcmfmac43362-sdio.txt
#media
media/cdrom
media/floppy
root/.bash_profile
root/.bashrc
root/ipfire
+run
#sbin
#srv
#usr/bin
usr/local/bin/settime
usr/local/bin/timecheck
usr/local/bin/timezone-transition
-#usr/local/bin/uname
+usr/local/bin/update-bootloader
usr/local/bin/update-lang-cache
#usr/local/include
#usr/local/lib
#usr/share/misc
#usr/share/terminfo
#usr/share/zoneinfo
-run
#var
#var/cache
var/empty
etc/strongswan.d/charon/eap-ttls.conf
etc/strongswan.d/charon/farp.conf
etc/strongswan.d/charon/fips-prf.conf
+etc/strongswan.d/charon/gcm.conf
etc/strongswan.d/charon/gcrypt.conf
etc/strongswan.d/charon/gmp.conf
etc/strongswan.d/charon/hmac.conf
usr/lib/ipsec/plugins/libstrongswan-eap-ttls.so
usr/lib/ipsec/plugins/libstrongswan-farp.so
usr/lib/ipsec/plugins/libstrongswan-fips-prf.so
+usr/lib/ipsec/plugins/libstrongswan-gcm.so
usr/lib/ipsec/plugins/libstrongswan-gcrypt.so
usr/lib/ipsec/plugins/libstrongswan-gmp.so
usr/lib/ipsec/plugins/libstrongswan-hmac.so
#usr/share/strongswan/templates/config/plugins/eap-ttls.conf
#usr/share/strongswan/templates/config/plugins/farp.conf
#usr/share/strongswan/templates/config/plugins/fips-prf.conf
+#usr/share/strongswan/templates/config/plugins/gcm.conf
#usr/share/strongswan/templates/config/plugins/gcrypt.conf
#usr/share/strongswan/templates/config/plugins/gmp.conf
#usr/share/strongswan/templates/config/plugins/hmac.conf
#usr/share/man/man8/sysklogd.8
var/log/dhcpcd.log
var/log/messages
-var/log/ovpnserver.log
etc/modprobe.d/blacklist.conf
etc/udev
#etc/udev/rules.d
-#etc/udev/rules.d/30-persistent-network.rules
#etc/udev/rules.d/55-lfs.rules
#etc/udev/rules.d/81-cdrom.rules
#etc/udev/rules.d/83-cdrom-symlinks.rules
#lib/udev/hwdb.d/60-keyboard.hwdb
#lib/udev/init-net-rules.sh
#lib/udev/mtd_probe
+#lib/udev/network-hotplug-rename
#lib/udev/rule_generator.functions
#lib/udev/rules.d
#lib/udev/rules.d/25-alsa.rules
#lib/udev/rules.d/50-udev-default.rules
#lib/udev/rules.d/60-cdrom_id.rules
#lib/udev/rules.d/60-keyboard.rules
+#lib/udev/rules.d/60-net.rules
#lib/udev/rules.d/60-persistent-alsa.rules
#lib/udev/rules.d/60-persistent-input.rules
#lib/udev/rules.d/60-persistent-serial.rules
+++ /dev/null
-etc/system-release
-etc/issue
-var/ipfire/header.pl
-var/ipfire/langs
-var/ipfire/lang.pl
etc/system-release
etc/issue
+srv/web/ipfire/cgi-bin/fwhosts.cgi
srv/web/ipfire/cgi-bin/ovpnmain.cgi
+var/ipfire/backup/bin/backup.pl
var/ipfire/langs
/usr/local/bin/backupctrl exclude >/dev/null 2>&1
# Remove old core updates from pakfire cache to save space...
-core=87
+core=88
for (( i=1; i<=$core; i++ ))
do
rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
/opt/pakfire/db/installed/meta-sqlite \
/opt/pakfire/db/rootfiles/sqlite
+# Fix #10625
+mkdir -p /etc/logrotate.d
+
sync
# This update need a reboot...
--- /dev/null
+../../../common/hwdata
\ No newline at end of file
etc/ipsec.user.conf
etc/ipsec.user.secrets
etc/localtime
+etc/rc.d/rcsysinit.d/S19checkfstab
+etc/rc.d/rcsysinit.d/S70console
etc/shadow
etc/ssh/ssh_config
etc/ssh/sshd_config
etc/ssl/openssl.cnf
etc/sudoers
etc/sysconfig/firewall.local
+etc/sysconfig/modules
etc/sysconfig/rc.local
etc/udev/rules.d/30-persistent-network.rules
srv/web/ipfire/html/proxy.pac
-var/ipfire/ovpn
+var/ipfire/time
+var/ipfire/ovpn/ccd.conf
+var/ipfire/ovpn/ccdroute
+var/ipfire/ovpn/ccdroute2
var/log/cache
var/state/dhcp/dhcpd.leases
var/updatecache
--- /dev/null
+../../../../common/armv5tel/glibc
\ No newline at end of file
--- /dev/null
+../../../../common/armv5tel/swconfig
\ No newline at end of file
--- /dev/null
+../../../../common/armv5tel/u-boot
\ No newline at end of file
--- /dev/null
+../../../common/bash
\ No newline at end of file
--- /dev/null
+../../../common/crda
\ No newline at end of file
--- /dev/null
+etc/system-release
+etc/issue
+etc/modprobe.d/btmrvl_sdio.conf
+etc/rc.d/init.d/collectd
+etc/rc.d/init.d/leds
+opt/pakfire/etc/pakfire.conf
+usr/lib/firewall/rules.pl
+usr/local/bin/backupiso
+usr/local/bin/update-bootloader
+usr/local/share/GeoIP/GeoIP.dat
+var/ipfire/header.pl
+var/ipfire/langs
+var/ipfire/lang.pl
+var/ipfire/ovpn/openssl/ovpn.cnf
--- /dev/null
+../../../common/hwdata
\ No newline at end of file
--- /dev/null
+../../../common/iw
\ No newline at end of file
--- /dev/null
+../../../common/kbd
\ No newline at end of file
--- /dev/null
+etc/ntp
+etc/ntp.conf
+etc/rc.d/rc0.d/K46ntpd
+etc/rc.d/rc3.d/S26ntpd
+etc/rc.d/rc6.d/K46ntpd
+usr/bin/calc_tickadj
+usr/bin/ntp-keygen
+usr/bin/ntp-wait
+usr/bin/ntpd
+usr/bin/ntpdate
+usr/bin/ntpdc
+usr/bin/ntpq
+usr/bin/ntptime
+usr/bin/ntptrace
+usr/bin/sntp
+usr/bin/tickadj
+#usr/include/event2
+#usr/share/doc/ntp4
+#usr/share/doc/ntp4/html
+#usr/share/doc/ntp4/html/access.html
+#usr/share/doc/ntp4/html/accopt.html
+#usr/share/doc/ntp4/html/assoc.html
+#usr/share/doc/ntp4/html/audio.html
+#usr/share/doc/ntp4/html/authentic.html
+#usr/share/doc/ntp4/html/authopt.html
+#usr/share/doc/ntp4/html/autokey.html
+#usr/share/doc/ntp4/html/bugs.html
+#usr/share/doc/ntp4/html/build.html
+#usr/share/doc/ntp4/html/clock.html
+#usr/share/doc/ntp4/html/clockopt.html
+#usr/share/doc/ntp4/html/cluster.html
+#usr/share/doc/ntp4/html/comdex.html
+#usr/share/doc/ntp4/html/config.html
+#usr/share/doc/ntp4/html/confopt.html
+#usr/share/doc/ntp4/html/copyright.html
+#usr/share/doc/ntp4/html/debug.html
+#usr/share/doc/ntp4/html/decode.html
+#usr/share/doc/ntp4/html/discipline.html
+#usr/share/doc/ntp4/html/discover.html
+#usr/share/doc/ntp4/html/drivers
+#usr/share/doc/ntp4/html/drivers/driver1.html
+#usr/share/doc/ntp4/html/drivers/driver10.html
+#usr/share/doc/ntp4/html/drivers/driver11.html
+#usr/share/doc/ntp4/html/drivers/driver12.html
+#usr/share/doc/ntp4/html/drivers/driver16.html
+#usr/share/doc/ntp4/html/drivers/driver18.html
+#usr/share/doc/ntp4/html/drivers/driver19.html
+#usr/share/doc/ntp4/html/drivers/driver20.html
+#usr/share/doc/ntp4/html/drivers/driver22.html
+#usr/share/doc/ntp4/html/drivers/driver26.html
+#usr/share/doc/ntp4/html/drivers/driver27.html
+#usr/share/doc/ntp4/html/drivers/driver28.html
+#usr/share/doc/ntp4/html/drivers/driver29.html
+#usr/share/doc/ntp4/html/drivers/driver3.html
+#usr/share/doc/ntp4/html/drivers/driver30.html
+#usr/share/doc/ntp4/html/drivers/driver31.html
+#usr/share/doc/ntp4/html/drivers/driver32.html
+#usr/share/doc/ntp4/html/drivers/driver33.html
+#usr/share/doc/ntp4/html/drivers/driver34.html
+#usr/share/doc/ntp4/html/drivers/driver35.html
+#usr/share/doc/ntp4/html/drivers/driver36.html
+#usr/share/doc/ntp4/html/drivers/driver37.html
+#usr/share/doc/ntp4/html/drivers/driver38.html
+#usr/share/doc/ntp4/html/drivers/driver39.html
+#usr/share/doc/ntp4/html/drivers/driver4.html
+#usr/share/doc/ntp4/html/drivers/driver40.html
+#usr/share/doc/ntp4/html/drivers/driver42.html
+#usr/share/doc/ntp4/html/drivers/driver43.html
+#usr/share/doc/ntp4/html/drivers/driver44.html
+#usr/share/doc/ntp4/html/drivers/driver45.html
+#usr/share/doc/ntp4/html/drivers/driver46.html
+#usr/share/doc/ntp4/html/drivers/driver5.html
+#usr/share/doc/ntp4/html/drivers/driver6.html
+#usr/share/doc/ntp4/html/drivers/driver7.html
+#usr/share/doc/ntp4/html/drivers/driver8.html
+#usr/share/doc/ntp4/html/drivers/driver9.html
+#usr/share/doc/ntp4/html/drivers/icons
+#usr/share/doc/ntp4/html/drivers/icons/home.gif
+#usr/share/doc/ntp4/html/drivers/icons/mail2.gif
+#usr/share/doc/ntp4/html/drivers/mx4200data.html
+#usr/share/doc/ntp4/html/drivers/oncore-shmem.html
+#usr/share/doc/ntp4/html/drivers/scripts
+#usr/share/doc/ntp4/html/drivers/scripts/footer.txt
+#usr/share/doc/ntp4/html/drivers/scripts/style.css
+#usr/share/doc/ntp4/html/drivers/tf582_4.html
+#usr/share/doc/ntp4/html/extern.html
+#usr/share/doc/ntp4/html/filter.html
+#usr/share/doc/ntp4/html/hints
+#usr/share/doc/ntp4/html/hints.html
+#usr/share/doc/ntp4/html/hints/a-ux
+#usr/share/doc/ntp4/html/hints/aix
+#usr/share/doc/ntp4/html/hints/bsdi
+#usr/share/doc/ntp4/html/hints/changes
+#usr/share/doc/ntp4/html/hints/decosf1
+#usr/share/doc/ntp4/html/hints/decosf2
+#usr/share/doc/ntp4/html/hints/freebsd
+#usr/share/doc/ntp4/html/hints/hpux
+#usr/share/doc/ntp4/html/hints/linux
+#usr/share/doc/ntp4/html/hints/mpeix
+#usr/share/doc/ntp4/html/hints/notes-xntp-v3
+#usr/share/doc/ntp4/html/hints/parse
+#usr/share/doc/ntp4/html/hints/refclocks
+#usr/share/doc/ntp4/html/hints/rs6000
+#usr/share/doc/ntp4/html/hints/sco.html
+#usr/share/doc/ntp4/html/hints/sgi
+#usr/share/doc/ntp4/html/hints/solaris-dosynctodr.html
+#usr/share/doc/ntp4/html/hints/solaris.html
+#usr/share/doc/ntp4/html/hints/solaris.xtra.4023118
+#usr/share/doc/ntp4/html/hints/solaris.xtra.4095849
+#usr/share/doc/ntp4/html/hints/solaris.xtra.S99ntpd
+#usr/share/doc/ntp4/html/hints/solaris.xtra.patchfreq
+#usr/share/doc/ntp4/html/hints/sun4
+#usr/share/doc/ntp4/html/hints/svr4-dell
+#usr/share/doc/ntp4/html/hints/svr4_package
+#usr/share/doc/ntp4/html/hints/todo
+#usr/share/doc/ntp4/html/hints/vxworks.html
+#usr/share/doc/ntp4/html/hints/winnt.html
+#usr/share/doc/ntp4/html/history.html
+#usr/share/doc/ntp4/html/howto.html
+#usr/share/doc/ntp4/html/huffpuff.html
+#usr/share/doc/ntp4/html/icons
+#usr/share/doc/ntp4/html/icons/home.gif
+#usr/share/doc/ntp4/html/icons/mail2.gif
+#usr/share/doc/ntp4/html/icons/sitemap.png
+#usr/share/doc/ntp4/html/index.html
+#usr/share/doc/ntp4/html/kern.html
+#usr/share/doc/ntp4/html/kernpps.html
+#usr/share/doc/ntp4/html/keygen.html
+#usr/share/doc/ntp4/html/leap.html
+#usr/share/doc/ntp4/html/miscopt.html
+#usr/share/doc/ntp4/html/monopt.html
+#usr/share/doc/ntp4/html/msyslog.html
+#usr/share/doc/ntp4/html/ntp-wait.html
+#usr/share/doc/ntp4/html/ntp_conf.html
+#usr/share/doc/ntp4/html/ntpd.html
+#usr/share/doc/ntp4/html/ntpdate.html
+#usr/share/doc/ntp4/html/ntpdc.html
+#usr/share/doc/ntp4/html/ntpdsim.html
+#usr/share/doc/ntp4/html/ntpdsim_new.html
+#usr/share/doc/ntp4/html/ntpq.html
+#usr/share/doc/ntp4/html/ntptime.html
+#usr/share/doc/ntp4/html/ntptrace.html
+#usr/share/doc/ntp4/html/orphan.html
+#usr/share/doc/ntp4/html/parsedata.html
+#usr/share/doc/ntp4/html/parsenew.html
+#usr/share/doc/ntp4/html/pic
+#usr/share/doc/ntp4/html/pic/9400n.jpg
+#usr/share/doc/ntp4/html/pic/alice11.gif
+#usr/share/doc/ntp4/html/pic/alice13.gif
+#usr/share/doc/ntp4/html/pic/alice15.gif
+#usr/share/doc/ntp4/html/pic/alice23.gif
+#usr/share/doc/ntp4/html/pic/alice31.gif
+#usr/share/doc/ntp4/html/pic/alice32.gif
+#usr/share/doc/ntp4/html/pic/alice35.gif
+#usr/share/doc/ntp4/html/pic/alice38.gif
+#usr/share/doc/ntp4/html/pic/alice44.gif
+#usr/share/doc/ntp4/html/pic/alice47.gif
+#usr/share/doc/ntp4/html/pic/alice51.gif
+#usr/share/doc/ntp4/html/pic/alice61.gif
+#usr/share/doc/ntp4/html/pic/barnstable.gif
+#usr/share/doc/ntp4/html/pic/beaver.gif
+#usr/share/doc/ntp4/html/pic/boom3.gif
+#usr/share/doc/ntp4/html/pic/boom3a.gif
+#usr/share/doc/ntp4/html/pic/boom4.gif
+#usr/share/doc/ntp4/html/pic/broad.gif
+#usr/share/doc/ntp4/html/pic/bustardfly.gif
+#usr/share/doc/ntp4/html/pic/c51.jpg
+#usr/share/doc/ntp4/html/pic/description.jpg
+#usr/share/doc/ntp4/html/pic/discipline.gif
+#usr/share/doc/ntp4/html/pic/dogsnake.gif
+#usr/share/doc/ntp4/html/pic/driver29.gif
+#usr/share/doc/ntp4/html/pic/driver43_1.gif
+#usr/share/doc/ntp4/html/pic/driver43_2.jpg
+#usr/share/doc/ntp4/html/pic/fg6021.gif
+#usr/share/doc/ntp4/html/pic/fg6039.jpg
+#usr/share/doc/ntp4/html/pic/fig_3_1.gif
+#usr/share/doc/ntp4/html/pic/flatheads.gif
+#usr/share/doc/ntp4/html/pic/flt1.gif
+#usr/share/doc/ntp4/html/pic/flt2.gif
+#usr/share/doc/ntp4/html/pic/flt3.gif
+#usr/share/doc/ntp4/html/pic/flt4.gif
+#usr/share/doc/ntp4/html/pic/flt5.gif
+#usr/share/doc/ntp4/html/pic/flt6.gif
+#usr/share/doc/ntp4/html/pic/flt7.gif
+#usr/share/doc/ntp4/html/pic/flt8.gif
+#usr/share/doc/ntp4/html/pic/flt9.gif
+#usr/share/doc/ntp4/html/pic/freq1211.gif
+#usr/share/doc/ntp4/html/pic/gadget.jpg
+#usr/share/doc/ntp4/html/pic/gps167.jpg
+#usr/share/doc/ntp4/html/pic/group.gif
+#usr/share/doc/ntp4/html/pic/hornraba.gif
+#usr/share/doc/ntp4/html/pic/igclock.gif
+#usr/share/doc/ntp4/html/pic/neoclock4x.gif
+#usr/share/doc/ntp4/html/pic/offset1211.gif
+#usr/share/doc/ntp4/html/pic/oncore_evalbig.gif
+#usr/share/doc/ntp4/html/pic/oncore_remoteant.jpg
+#usr/share/doc/ntp4/html/pic/oncore_utplusbig.gif
+#usr/share/doc/ntp4/html/pic/oz2.gif
+#usr/share/doc/ntp4/html/pic/panda.gif
+#usr/share/doc/ntp4/html/pic/pd_om006.gif
+#usr/share/doc/ntp4/html/pic/pd_om011.gif
+#usr/share/doc/ntp4/html/pic/peer.gif
+#usr/share/doc/ntp4/html/pic/pogo.gif
+#usr/share/doc/ntp4/html/pic/pogo1a.gif
+#usr/share/doc/ntp4/html/pic/pogo3a.gif
+#usr/share/doc/ntp4/html/pic/pogo4.gif
+#usr/share/doc/ntp4/html/pic/pogo5.gif
+#usr/share/doc/ntp4/html/pic/pogo6.gif
+#usr/share/doc/ntp4/html/pic/pogo7.gif
+#usr/share/doc/ntp4/html/pic/pogo8.gif
+#usr/share/doc/ntp4/html/pic/pzf509.jpg
+#usr/share/doc/ntp4/html/pic/pzf511.jpg
+#usr/share/doc/ntp4/html/pic/rabbit.gif
+#usr/share/doc/ntp4/html/pic/radio2.jpg
+#usr/share/doc/ntp4/html/pic/sheepb.jpg
+#usr/share/doc/ntp4/html/pic/stack1a.jpg
+#usr/share/doc/ntp4/html/pic/stats.gif
+#usr/share/doc/ntp4/html/pic/sx5.gif
+#usr/share/doc/ntp4/html/pic/thunderbolt.jpg
+#usr/share/doc/ntp4/html/pic/time1.gif
+#usr/share/doc/ntp4/html/pic/tonea.gif
+#usr/share/doc/ntp4/html/pic/tribeb.gif
+#usr/share/doc/ntp4/html/pic/wingdorothy.gif
+#usr/share/doc/ntp4/html/poll.html
+#usr/share/doc/ntp4/html/pps.html
+#usr/share/doc/ntp4/html/prefer.html
+#usr/share/doc/ntp4/html/quick.html
+#usr/share/doc/ntp4/html/rate.html
+#usr/share/doc/ntp4/html/rdebug.html
+#usr/share/doc/ntp4/html/refclock.html
+#usr/share/doc/ntp4/html/release.html
+#usr/share/doc/ntp4/html/scripts
+#usr/share/doc/ntp4/html/scripts/accopt.txt
+#usr/share/doc/ntp4/html/scripts/audio.txt
+#usr/share/doc/ntp4/html/scripts/authopt.txt
+#usr/share/doc/ntp4/html/scripts/clockopt.txt
+#usr/share/doc/ntp4/html/scripts/command.txt
+#usr/share/doc/ntp4/html/scripts/config.txt
+#usr/share/doc/ntp4/html/scripts/confopt.txt
+#usr/share/doc/ntp4/html/scripts/external.txt
+#usr/share/doc/ntp4/html/scripts/footer.txt
+#usr/share/doc/ntp4/html/scripts/hand.txt
+#usr/share/doc/ntp4/html/scripts/install.txt
+#usr/share/doc/ntp4/html/scripts/manual.txt
+#usr/share/doc/ntp4/html/scripts/misc.txt
+#usr/share/doc/ntp4/html/scripts/miscopt.txt
+#usr/share/doc/ntp4/html/scripts/monopt.txt
+#usr/share/doc/ntp4/html/scripts/refclock.txt
+#usr/share/doc/ntp4/html/scripts/special.txt
+#usr/share/doc/ntp4/html/scripts/style.css
+#usr/share/doc/ntp4/html/select.html
+#usr/share/doc/ntp4/html/sitemap.html
+#usr/share/doc/ntp4/html/sntp.html
+#usr/share/doc/ntp4/html/stats.html
+#usr/share/doc/ntp4/html/tickadj.html
+#usr/share/doc/ntp4/html/warp.html
+#usr/share/doc/ntp4/html/xleave.html
+#usr/share/doc/ntp4/ntp-keygen.html
+#usr/share/doc/ntp4/ntp-wait.html
+#usr/share/doc/ntp4/ntp.conf.html
+#usr/share/doc/ntp4/ntp.keys.html
+#usr/share/doc/ntp4/ntpd.html
+#usr/share/doc/ntp4/ntpdc.html
+#usr/share/doc/ntp4/ntpq.html
+#usr/share/doc/ntp4/ntpsnmpd.html
+#usr/share/doc/ntp4/ntpsweep.html
+#usr/share/doc/ntp4/ntptrace.html
+#usr/share/doc/sntp
+#usr/share/doc/sntp/sntp.html
+#usr/share/man/man1/calc_tickadj.1
+#usr/share/man/man1/ntp-keygen.1
+#usr/share/man/man1/ntp-wait.1
+#usr/share/man/man1/ntpd.1
+#usr/share/man/man1/ntpdc.1
+#usr/share/man/man1/ntpq.1
+#usr/share/man/man1/ntptrace.1
+#usr/share/man/man1/sntp.1
+#usr/share/man/man5/ntp.conf.5
+#usr/share/man/man5/ntp.keys.5
+#usr/share/ntp
+#usr/share/ntp/lib
+#usr/share/ntp/lib/NTP
+#usr/share/ntp/lib/NTP/Util.pm
+var/ipfire/time/counter.conf
+var/ipfire/time/enable
+var/ipfire/time/settime.conf
+var/ipfire/time/settings
--- /dev/null
+../../../common/openssl
\ No newline at end of file
--- /dev/null
+../../../common/openssl-compat
\ No newline at end of file
--- /dev/null
+lib/firmware/amd-ucode/microcode_amd_fam15h.bin
+lib/firmware/amd-ucode/microcode_amd_fam15h.bin.asc
+lib/firmware/amd-ucode/microcode_amd_fam16h.bin
+lib/firmware/amd-ucode/microcode_amd_fam16h.bin.asc
+lib/firmware/as102_data1_st.hex
+lib/firmware/as102_data2_st.hex
+lib/firmware/bnx2x/bnx2x-e1-7.10.51.0.fw
+lib/firmware/bnx2x/bnx2x-e1-7.8.19.0.fw
+lib/firmware/bnx2x/bnx2x-e1h-7.10.51.0.fw
+lib/firmware/bnx2x/bnx2x-e1h-7.8.19.0.fw
+lib/firmware/bnx2x/bnx2x-e2-7.10.51.0.fw
+lib/firmware/bnx2x/bnx2x-e2-7.8.19.0.fw
+lib/firmware/brcm/brcmfmac43143.bin
+lib/firmware/brcm/brcmfmac43143-sdio.bin
+lib/firmware/brcm/brcmfmac43362-sdio.bin
+lib/firmware/brcm/brcmfmac4354-sdio.bin
+lib/firmware/cmmb_vega_12mhz.inp
+lib/firmware/cmmb_venice_12mhz.inp
+lib/firmware/cxgb4/t4fw-1.12.25.0.bin
+lib/firmware/cxgb4/t4fw.bin
+lib/firmware/cxgb4/t5fw-1.12.25.0.bin
+lib/firmware/cxgb4/t5fw.bin
+lib/firmware/dvb-fe-drxj-mc-1.0.8.fw
+lib/firmware/dvb-fe-drxj-mc-vsb-1.0.8.fw
+lib/firmware/dvb-fe-drxj-mc-vsb-qam-1.0.8.fw
+lib/firmware/dvb-fe-xc4000-1.4.1.fw
+lib/firmware/dvb-fe-xc5000c-4.1.30.7.fw
+lib/firmware/dvb_nova_12mhz_b0.inp
+lib/firmware/dvb_nova_12mhz.inp
+lib/firmware/dvb-usb-it9135-01.fw
+lib/firmware/dvb-usb-it9135-02.fw
+lib/firmware/emi62/bitstream.fw
+lib/firmware/intel/fw_sst_0f28.bin
+lib/firmware/intel/fw_sst_0f28.bin-48kHz_i2s_master
+lib/firmware/intel/ibt-hw-37.7.10-fw-1.0.1.2d.d.bseq
+lib/firmware/intel/ibt-hw-37.7.10-fw-1.0.2.3.d.bseq
+lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.1.2d.d.bseq
+lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
+lib/firmware/intel/ibt-hw-37.8.10-fw-1.10.2.27.d.bseq
+lib/firmware/intel/ibt-hw-37.8.10-fw-1.10.3.11.e.bseq
+lib/firmware/intel/ibt-hw-37.8.bseq
+lib/firmware/intel/IntcSST2.bin
+lib/firmware/isdbt_nova_12mhz_b0.inp
+lib/firmware/isdbt_nova_12mhz.inp
+lib/firmware/isdbt_rio.inp
+lib/firmware/iwlwifi-3160-10.ucode
+lib/firmware/iwlwifi-3160-8.ucode
+lib/firmware/iwlwifi-3160-9.ucode
+lib/firmware/iwlwifi-7260-10.ucode
+lib/firmware/iwlwifi-7260-8.ucode
+lib/firmware/iwlwifi-7260-9.ucode
+lib/firmware/iwlwifi-7265-10.ucode
+lib/firmware/iwlwifi-7265-8.ucode
+lib/firmware/iwlwifi-7265-9.ucode
+lib/firmware/iwlwifi-7265D-10.ucode
+lib/firmware/LICENCE.Abilis
+lib/firmware/LICENCE.chelsio_firmware
+lib/firmware/LICENCE.fw_sst_0f28
+lib/firmware/LICENCE.ibt_firmware
+lib/firmware/LICENCE.IntcSST2
+lib/firmware/LICENCE.it913x
+lib/firmware/LICENCE.iwlwifi_firmware
+lib/firmware/LICENCE.qat_dh895xcc_firmware
+lib/firmware/LICENCE.r8a779x_usb3
+lib/firmware/LICENCE.siano
+lib/firmware/LICENCE.xc4000
+lib/firmware/LICENCE.xc5000c
+lib/firmware/LICENSE.amd-ucode
+lib/firmware/LICENSE.radeon
+lib/firmware/myri10ge_eth_big_z8e.dat
+lib/firmware/myri10ge_ethp_big_z8e.dat
+lib/firmware/myri10ge_ethp_z8e.dat
+lib/firmware/myri10ge_eth_z8e.dat
+lib/firmware/myri10ge_rss_eth_big_z8e.dat
+lib/firmware/myri10ge_rss_ethp_big_z8e.dat
+lib/firmware/myri10ge_rss_ethp_z8e.dat
+lib/firmware/myri10ge_rss_eth_z8e.dat
+lib/firmware/qat_895xcc.bin
+lib/firmware/ql2400_fw.bin
+lib/firmware/ql2500_fw.bin
+lib/firmware/r8a779x_usb3_v1.dlmem
+lib/firmware/radeon/bonaire_ce.bin
+lib/firmware/radeon/BONAIRE_mc2.bin
+lib/firmware/radeon/bonaire_mc.bin
+lib/firmware/radeon/bonaire_me.bin
+lib/firmware/radeon/bonaire_mec.bin
+lib/firmware/radeon/bonaire_pfp.bin
+lib/firmware/radeon/bonaire_rlc.bin
+lib/firmware/radeon/bonaire_sdma.bin
+lib/firmware/radeon/bonaire_smc.bin
+lib/firmware/radeon/BONAIRE_vce.bin
+lib/firmware/radeon/hainan_ce.bin
+lib/firmware/radeon/HAINAN_mc2.bin
+lib/firmware/radeon/hainan_mc.bin
+lib/firmware/radeon/hainan_me.bin
+lib/firmware/radeon/hainan_pfp.bin
+lib/firmware/radeon/hainan_rlc.bin
+lib/firmware/radeon/hainan_smc.bin
+lib/firmware/radeon/hawaii_ce.bin
+lib/firmware/radeon/HAWAII_ce.bin
+lib/firmware/radeon/HAWAII_mc2.bin
+lib/firmware/radeon/hawaii_mc.bin
+lib/firmware/radeon/HAWAII_mc.bin
+lib/firmware/radeon/hawaii_me.bin
+lib/firmware/radeon/HAWAII_me.bin
+lib/firmware/radeon/hawaii_mec.bin
+lib/firmware/radeon/HAWAII_mec.bin
+lib/firmware/radeon/hawaii_pfp.bin
+lib/firmware/radeon/HAWAII_pfp.bin
+lib/firmware/radeon/hawaii_rlc.bin
+lib/firmware/radeon/HAWAII_rlc.bin
+lib/firmware/radeon/hawaii_sdma.bin
+lib/firmware/radeon/HAWAII_sdma.bin
+lib/firmware/radeon/hawaii_smc.bin
+lib/firmware/radeon/HAWAII_smc.bin
+lib/firmware/radeon/kabini_ce.bin
+lib/firmware/radeon/kabini_me.bin
+lib/firmware/radeon/kabini_mec.bin
+lib/firmware/radeon/kabini_pfp.bin
+lib/firmware/radeon/kabini_rlc.bin
+lib/firmware/radeon/kabini_sdma.bin
+lib/firmware/radeon/kaveri_ce.bin
+lib/firmware/radeon/kaveri_me.bin
+lib/firmware/radeon/kaveri_mec2.bin
+lib/firmware/radeon/kaveri_mec.bin
+lib/firmware/radeon/kaveri_pfp.bin
+lib/firmware/radeon/kaveri_rlc.bin
+lib/firmware/radeon/kaveri_sdma.bin
+lib/firmware/radeon/mullins_ce.bin
+lib/firmware/radeon/MULLINS_ce.bin
+lib/firmware/radeon/mullins_me.bin
+lib/firmware/radeon/MULLINS_me.bin
+lib/firmware/radeon/mullins_mec.bin
+lib/firmware/radeon/MULLINS_mec.bin
+lib/firmware/radeon/mullins_pfp.bin
+lib/firmware/radeon/MULLINS_pfp.bin
+lib/firmware/radeon/mullins_rlc.bin
+lib/firmware/radeon/MULLINS_rlc.bin
+lib/firmware/radeon/mullins_sdma.bin
+lib/firmware/radeon/MULLINS_sdma.bin
+lib/firmware/radeon/oland_ce.bin
+lib/firmware/radeon/OLAND_mc2.bin
+lib/firmware/radeon/oland_mc.bin
+lib/firmware/radeon/oland_me.bin
+lib/firmware/radeon/oland_pfp.bin
+lib/firmware/radeon/oland_rlc.bin
+lib/firmware/radeon/oland_smc.bin
+lib/firmware/radeon/pitcairn_ce.bin
+lib/firmware/radeon/PITCAIRN_mc2.bin
+lib/firmware/radeon/pitcairn_mc.bin
+lib/firmware/radeon/pitcairn_me.bin
+lib/firmware/radeon/pitcairn_pfp.bin
+lib/firmware/radeon/pitcairn_rlc.bin
+lib/firmware/radeon/pitcairn_smc.bin
+lib/firmware/radeon/R600_uvd.bin
+lib/firmware/radeon/RS780_uvd.bin
+lib/firmware/radeon/RV770_uvd.bin
+lib/firmware/radeon/tahiti_ce.bin
+lib/firmware/radeon/TAHITI_mc2.bin
+lib/firmware/radeon/tahiti_mc.bin
+lib/firmware/radeon/tahiti_me.bin
+lib/firmware/radeon/tahiti_pfp.bin
+lib/firmware/radeon/tahiti_rlc.bin
+lib/firmware/radeon/tahiti_smc.bin
+lib/firmware/radeon/verde_ce.bin
+lib/firmware/radeon/VERDE_mc2.bin
+lib/firmware/radeon/verde_mc.bin
+lib/firmware/radeon/verde_me.bin
+lib/firmware/radeon/verde_pfp.bin
+lib/firmware/radeon/verde_rlc.bin
+lib/firmware/radeon/verde_smc.bin
+lib/firmware/README
+lib/firmware/rsi_91x.fw
+lib/firmware/rtl_nic/rtl8107e-1.fw
+lib/firmware/rtl_nic/rtl8107e-2.fw
+lib/firmware/rtl_nic/rtl8168h-1.fw
+lib/firmware/rtl_nic/rtl8168h-2.fw
+lib/firmware/rtlwifi/rtl8192cfw.bin
+lib/firmware/rtlwifi/rtl8192cfwU_B.bin
+lib/firmware/rtlwifi/rtl8192defw.bin
+lib/firmware/rtlwifi/rtl8192eefw.bin
+lib/firmware/rtlwifi/rtl8723aufw_A.bin
+lib/firmware/rtlwifi/rtl8723aufw_B.bin
+lib/firmware/rtlwifi/rtl8723aufw_B_NoBT.bin
+lib/firmware/rtlwifi/rtl8723befw.bin
+lib/firmware/rtlwifi/rtl8821aefw.bin
+lib/firmware/rtlwifi/rtl8821aefw_wowlan.bin
+lib/firmware/s5p-mfc.fw
+lib/firmware/s5p-mfc-v6.fw
+lib/firmware/s5p-mfc-v6-v2.fw
+lib/firmware/s5p-mfc-v7.fw
+lib/firmware/s5p-mfc-v8.fw
+lib/firmware/sms1xxx-hcw-55xxx-dvbt-02.fw
+lib/firmware/sms1xxx-hcw-55xxx-isdbt-02.fw
+lib/firmware/sms1xxx-nova-a-dvbt-01.fw
+lib/firmware/sms1xxx-nova-b-dvbt-01.fw
+lib/firmware/sms1xxx-stellar-dvbt-01.fw
+lib/firmware/tdmb_nova_12mhz.inp
+lib/firmware/ti-connectivity/wl18xx-fw-3.bin
+lib/firmware/ti-connectivity/wl18xx-fw-4.bin
+lib/firmware/v4l-cx23885-enc-broken.fw
+lib/firmware/WHENCE
+lib/firmware/brcm/brcmfmac43362-sdio.txt
--- /dev/null
+../../../common/wireless-regdb
\ No newline at end of file
--- /dev/null
+../../../common/wpa_supplicant
\ No newline at end of file
. /opt/pakfire/lib/functions.sh
/usr/local/bin/backupctrl exclude >/dev/null 2>&1
-function add_to_backup ()
-{
- # Add path to ROOTFILES but remove old entries to prevent double
- # files in the tar
- grep -v "^$1" /opt/pakfire/tmp/ROOTFILES > /opt/pakfire/tmp/ROOTFILES.tmp
- mv /opt/pakfire/tmp/ROOTFILES.tmp /opt/pakfire/tmp/ROOTFILES
- echo $1 >> /opt/pakfire/tmp/ROOTFILES
+
+function find_device() {
+ local mountpoint="${1}"
+
+ local root
+ local dev mp fs flags rest
+ while read -r dev mp fs flags rest; do
+ # Skip unwanted entries
+ [ "${dev}" = "rootfs" ] && continue
+
+ if [ "${mp}" = "${mountpoint}" ] && [ -b "${dev}" ]; then
+ root="$(basename "${dev}")"
+ break
+ fi
+ done < /proc/mounts
+
+ # Get the actual device from the partition that holds /
+ while [ -n "${root}" ]; do
+ if [ -e "/sys/block/${root}" ]; then
+ echo "${root}"
+ return 0
+ fi
+
+ # Remove last character
+ root="${root::-1}"
+ done
+
+ return 1
}
+
#
# Remove old core updates from pakfire cache to save space...
-core=86
+core=87
for (( i=1; i<=${core}; i++ ))
do
rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
#
KVER="xxxKVERxxx"
-#
-# check if we the backup file already exist
-if [ -e /var/ipfire/backup/core-upgrade${core}_${KVER}.tar.xz ]; then
- echo Moving backup to backup-old ...
- mv -f /var/ipfire/backup/core-upgrade${core}_${KVER}.tar.xz \
- /var/ipfire/backup/core-upgrade${core}_${KVER}-old.tar.xz
-fi
-echo First we made a backup of all files that was inside of the
-echo update archive. This may take a while ...
-# Add some files that are not in the package to backup
-add_to_backup lib/modules
-add_to_backup boot
-
-# Backup the files
-tar cJvf /var/ipfire/backup/core-upgrade${core}_${KVER}.tar.xz \
- -C / -T /opt/pakfire/tmp/ROOTFILES --exclude='#*' --exclude='/var/cache' > /dev/null 2>&1
-
# Check diskspace on root
ROOTSPACE=`df / -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1`
echo
echo Update Kernel to $KVER ...
#
-# Remove old kernel, configs, initrd, modules ...
+# Remove old kernel, configs, initrd, modules, dtb's ...
#
rm -rf /boot/System.map-*
rm -rf /boot/config-*
rm -rf /boot/ipfirerd-*
+rm -rf /boot/initramfs-*
rm -rf /boot/vmlinuz-*
rm -rf /boot/uImage-ipfire-*
rm -rf /boot/uInit-ipfire-*
+rm -rf /boot/dtb-*-ipfire-*
rm -rf /lib/modules
case "$(uname -m)" in
i?86)
- # Backup grub.conf
- cp -vf /boot/grub/grub.conf /boot/grub-legacy.conf
+ # Backup old grub config
+ if [ -f /boot/grub/grub.conf ]; then
+ cp -vf /boot/grub/grub.conf /boot/old-grub-config
+ fi
+ if [ -f /boot/grub/menu.lst ]; then
+ cp -vf /boot/grub/menu.lst /boot/old-grub-config
+ fi
+ if [ -f /boot/grub/grub.cfg ]; then
+ cp -vf /boot/grub/grub.cfg /boot/old-grub-config
+ fi
# Remove all files that belong to GRUB-legacy
rm -rfv /boot/grub
;;
+ armv*)
+ # Backup uEnv.txt if exist
+ if [ -e /boot/uEnv.txt ]; then
+ cp -vf /boot/uEnv.txt /boot/uEnv.txt.org
+ fi
+
+ # work around the u-boot folder detection bug
+ mkdir -pv /boot/dtb-$KVER-ipfire-kirkwood
+ mkdir -pv /boot/dtb-$KVER-ipfire-multi
+ ;;
esac
+
#
#Stop services
/etc/init.d/snort stop
#Extract files
tar xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p --numeric-owner -C /
+#
+#restart init because glibc was updated.
+telinit u
+
# Check diskspace on boot
BOOTSPACE=`df /boot -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1`
# Special handling for old kirkwood images.
# (install only kirkwood kernel)
rm -rf /boot/*
+ # work around the u-boot folder detection bug
+ mkdir -pv /boot/dtb-$KVER-ipfire-kirkwood
tar xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p \
--numeric-owner -C / --wildcards 'boot/*-kirkwood*'
;;
case "$(uname -m)" in
i?86)
- #
- # Update to GRUB2
- #
- echo
- echo Update grub configuration ...
- if grep -qE "^serial" /boot/grub-legacy.conf; then
- sed -i /etc/default/grub \
- -e "s| panic=10 | console=ttyS0,115200n8 panic=10 |g"
- echo "GRUB_TERMINAL=\"serial\"" >> /etc/default/grub
- echo "GRUB_SERIAL_COMMAND=\"serial --unit=0 --speed=115200\"" >> /etc/default/grub
- fi
- grub-mkconfig -o /boot/grub/grub.cfg
-
- ROOT=$(mount | grep " / " | cut -d" " -f1)
- ROOT=${ROOT::-1}
+ case "$(find_device "/")" in
+ xvd* )
+ echo Skip remove grub2 files, because pygrub fail.
+ rm -f /boot/grub/*
+ echo config will recreated by linux-pae install.
+ ;;
+ * )
+ #
+ # Update to GRUB2
+ #
+ echo
+ echo Update grub configuration ...
+ if grep -qE "^serial" /boot/old-grub-config; then
+ sed -i /etc/default/grub \
+ -e "s|panic=10|& console=ttyS0,115200n8|g"
+ echo "GRUB_TERMINAL=\"serial\"" >> /etc/default/grub
+ echo "GRUB_SERIAL_COMMAND=\"serial --unit=0 --speed=115200\"" >> /etc/default/grub
+ fi
- if ! grub-install --no-floppy --recheck "${ROOT}"; then
- if ! grub-install --no-floppy --recheck --force "${ROOT}"; then
+ if ! /usr/local/bin/update-bootloader; then
logger -p syslog.emerg -t ipfire \
"Could not update the bootloader!"
fi
- fi
- ;;
+ ;;
+ esac
esac
# Force (re)install pae kernel if pae is supported
fi
fi
-# Force reinstall xen kernel if it was installed
-if [ -e "/opt/pakfire/db/installed/meta-linux-xen" ]; then
- echo "Name: linux-xen" > /opt/pakfire/db/installed/meta-linux-xen
- echo "ProgVersion: 0" >> /opt/pakfire/db/installed/meta-linux-xen
- echo "Release: 0" >> /opt/pakfire/db/installed/meta-linux-xen
- echo "Name: linux-xen" > /opt/pakfire/db/meta/meta-linux-xen
- echo "ProgVersion: 0" >> /opt/pakfire/db/meta/meta-linux-xen
- echo "Release: 0" >> /opt/pakfire/db/meta/meta-linux-xen
- # Add xvc0 to /etc/securetty
- echo "xvc0" >> /etc/securetty
-fi
-
#
# After pakfire has ended run it again and update the lists and do upgrade
#
echo '/opt/pakfire/pakfire upgrade -y' >> /tmp/pak_update
echo '/opt/pakfire/pakfire upgrade -y' >> /tmp/pak_update
echo '/opt/pakfire/pakfire upgrade -y' >> /tmp/pak_update
-echo '/usr/bin/logger -p syslog.emerg -t ipfire "Core-upgrade finished. If you use a customized grub.cfg"' >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t ipfire "Core-upgrade finished. If you use a customized grub/uboot config"' >> /tmp/pak_update
echo '/usr/bin/logger -p syslog.emerg -t ipfire "Check it before reboot !!!"' >> /tmp/pak_update
echo '/usr/bin/logger -p syslog.emerg -t ipfire " *** Please reboot... *** "' >> /tmp/pak_update
echo 'touch /var/run/need_reboot ' >> /tmp/pak_update
-usr/lib/libsrtp.so
etc/asterisk
etc/logrotate.d/asterisk
+etc/rc.d/init.d/asterisk
etc/rc.d/rc0.d/K30asterisk
etc/rc.d/rc3.d/S30asterisk
etc/rc.d/rc6.d/K30asterisk
#usr/include/asterisk/xml.h
#usr/include/asterisk/xmldoc.h
#usr/include/asterisk/xmpp.h
-#usr/include/srtp
-#usr/include/srtp/aes.h
-#usr/include/srtp/aes_cbc.h
-#usr/include/srtp/aes_icm.h
-#usr/include/srtp/alloc.h
-#usr/include/srtp/auth.h
-#usr/include/srtp/cipher.h
-#usr/include/srtp/config.h
-#usr/include/srtp/crypto.h
-#usr/include/srtp/crypto_kernel.h
-#usr/include/srtp/crypto_math.h
-#usr/include/srtp/crypto_types.h
-#usr/include/srtp/cryptoalg.h
-#usr/include/srtp/datatypes.h
-#usr/include/srtp/err.h
-#usr/include/srtp/gf2_8.h
-#usr/include/srtp/hmac.h
-#usr/include/srtp/integers.h
-#usr/include/srtp/kernel_compat.h
-#usr/include/srtp/key.h
-#usr/include/srtp/null_auth.h
-#usr/include/srtp/null_cipher.h
-#usr/include/srtp/prng.h
-#usr/include/srtp/rand_source.h
-#usr/include/srtp/rdb.h
-#usr/include/srtp/rdbx.h
-#usr/include/srtp/rtp.h
-#usr/include/srtp/sha1.h
-#usr/include/srtp/srtp.h
-#usr/include/srtp/stat.h
-#usr/include/srtp/ut_sim.h
-#usr/include/srtp/xfm.h
#usr/lib/asterisk
#usr/lib/asterisk/modules
usr/lib/asterisk/modules/app_adsiprog.so
usr/lib/asterisk/modules/format_h264.so
usr/lib/asterisk/modules/format_ilbc.so
usr/lib/asterisk/modules/format_jpeg.so
-#usr/lib/asterisk/modules/format_ogg_vorbis.so
usr/lib/asterisk/modules/format_pcm.so
usr/lib/asterisk/modules/format_siren14.so
usr/lib/asterisk/modules/format_siren7.so
usr/lib/asterisk/modules/res_crypto.so
usr/lib/asterisk/modules/res_curl.so
usr/lib/asterisk/modules/res_fax.so
-#usr/lib/asterisk/modules/res_fax_spandsp.so
usr/lib/asterisk/modules/res_format_attr_celt.so
usr/lib/asterisk/modules/res_format_attr_h263.so
usr/lib/asterisk/modules/res_format_attr_h264.so
usr/lib/asterisk/modules/res_timing_timerfd.so
usr/lib/libasteriskssl.so
usr/lib/libasteriskssl.so.1
-#usr/lib/libsrtp.a
#usr/lib/pkgconfig/asterisk.pc
usr/sbin/astcanary
usr/sbin/astdb2bdb
var/ipfire/asterisk/app_skel.conf
var/ipfire/asterisk/asterisk.adsi
var/ipfire/asterisk/asterisk.conf
-#var/ipfire/asterisk/asterisk.makeopts
+var/ipfire/asterisk/asterisk.logrotate
var/ipfire/asterisk/calendar.conf
var/ipfire/asterisk/ccss.conf
var/ipfire/asterisk/cdr.conf
var/lib/asterisk/sounds/en/.asterisk-extra-sounds-en-gsm-1.4.15
var/lib/asterisk/sounds/en/1-for-am-2-for-pm.gsm
var/lib/asterisk/sounds/en/1-yes-2-no.gsm
+#var/lib/asterisk/sounds/en/CHANGES-asterisk-core-en-1.4.26
+#var/lib/asterisk/sounds/en/CHANGES-asterisk-extra-en-1.4.15
+#var/lib/asterisk/sounds/en/CREDITS-asterisk-core-en-1.4.26
+#var/lib/asterisk/sounds/en/CREDITS-asterisk-extra-en-1.4.15
+#var/lib/asterisk/sounds/en/LICENSE-asterisk-core-en-1.4.26
+#var/lib/asterisk/sounds/en/LICENSE-asterisk-extra-en-1.4.15
var/lib/asterisk/sounds/en/OfficeSpace.gsm
var/lib/asterisk/sounds/en/Randulo-allison.gsm
var/lib/asterisk/sounds/en/SIP_Test_Failure.gsm
var/spool/asterisk/voicemail/default/1234/en
var/spool/asterisk/voicemail/default/1234/en/busy.gsm
var/spool/asterisk/voicemail/default/1234/en/unavail.gsm
-etc/rc.d/init.d/asterisk
#usr/lib/libclamav.la
usr/lib/libclamav.so
usr/lib/libclamav.so.6
-usr/lib/libclamav.so.6.1.22
+usr/lib/libclamav.so.6.1.25
#usr/lib/libclamunrar.la
usr/lib/libclamunrar.so
usr/lib/libclamunrar.so.6
-usr/lib/libclamunrar.so.6.1.22
+usr/lib/libclamunrar.so.6.1.25
#usr/lib/libclamunrar_iface.la
usr/lib/libclamunrar_iface.so
usr/lib/libclamunrar_iface.so.6
-usr/lib/libclamunrar_iface.so.6.1.22
+usr/lib/libclamunrar_iface.so.6.1.25
#usr/lib/pkgconfig/libclamav.pc
usr/sbin/clamd
usr/share/clamav
var/ipfire/clamav/clamd.conf.sample
var/ipfire/clamav/freshclam.conf
var/ipfire/clamav/freshclam.conf.sample
-#var/run/clamav
etc/rc.d/init.d/clamav
usr/local/bin/clamavctrl
--- /dev/null
+#etc/haproxy
+etc/haproxy/haproxy.cfg
+etc/rc.d/init.d/haproxy
+usr/sbin/haproxy
+#usr/sbin/haproxy-systemd-wrapper
+#usr/share/man/man1/haproxy.1
+var/ipfire/backup/addons/includes/haproxy
+var/lib/haproxy
--- /dev/null
+#usr/include/srtp
+#usr/include/srtp/aes.h
+#usr/include/srtp/aes_cbc.h
+#usr/include/srtp/aes_gcm_ossl.h
+#usr/include/srtp/aes_icm.h
+#usr/include/srtp/aes_icm_ossl.h
+#usr/include/srtp/alloc.h
+#usr/include/srtp/auth.h
+#usr/include/srtp/cipher.h
+#usr/include/srtp/config.h
+#usr/include/srtp/crypto.h
+#usr/include/srtp/crypto_kernel.h
+#usr/include/srtp/crypto_math.h
+#usr/include/srtp/crypto_types.h
+#usr/include/srtp/cryptoalg.h
+#usr/include/srtp/datatypes.h
+#usr/include/srtp/ekt.h
+#usr/include/srtp/err.h
+#usr/include/srtp/getopt_s.h
+#usr/include/srtp/gf2_8.h
+#usr/include/srtp/hmac.h
+#usr/include/srtp/integers.h
+#usr/include/srtp/kernel_compat.h
+#usr/include/srtp/key.h
+#usr/include/srtp/null_auth.h
+#usr/include/srtp/null_cipher.h
+#usr/include/srtp/prng.h
+#usr/include/srtp/rand_source.h
+#usr/include/srtp/rdb.h
+#usr/include/srtp/rdbx.h
+#usr/include/srtp/rtp.h
+#usr/include/srtp/rtp_priv.h
+#usr/include/srtp/sha1.h
+#usr/include/srtp/srtp.h
+#usr/include/srtp/srtp_priv.h
+#usr/include/srtp/stat.h
+#usr/include/srtp/ut_sim.h
+#usr/include/srtp/xfm.h
+usr/lib/libsrtp.so
+#usr/lib/pkgconfig/libsrtp.pc
-var/ipfire/lynis-1.2.9
-var/ipfire/lynis-1.2.9/db
-var/ipfire/lynis-1.2.9/db/fileperms.db
-var/ipfire/lynis-1.2.9/db/hints.db
-var/ipfire/lynis-1.2.9/db/integrity.db
-var/ipfire/lynis-1.2.9/db/malware-susp.db
-var/ipfire/lynis-1.2.9/db/malware.db
-var/ipfire/lynis-1.2.9/db/sbl.db
-var/ipfire/lynis-1.2.9/default.prf
-var/ipfire/lynis-1.2.9/include
-var/ipfire/lynis-1.2.9/include/binaries
-var/ipfire/lynis-1.2.9/include/consts
-var/ipfire/lynis-1.2.9/include/functions
-var/ipfire/lynis-1.2.9/include/osdetection
-var/ipfire/lynis-1.2.9/include/parameters
-var/ipfire/lynis-1.2.9/include/profiles
-var/ipfire/lynis-1.2.9/include/report
-var/ipfire/lynis-1.2.9/include/tests_accounting
-var/ipfire/lynis-1.2.9/include/tests_authentication
-var/ipfire/lynis-1.2.9/include/tests_banners
-var/ipfire/lynis-1.2.9/include/tests_boot_services
-var/ipfire/lynis-1.2.9/include/tests_crypto
-var/ipfire/lynis-1.2.9/include/tests_databases
-var/ipfire/lynis-1.2.9/include/tests_file_integrity
-var/ipfire/lynis-1.2.9/include/tests_file_permissions
-var/ipfire/lynis-1.2.9/include/tests_filesystems
-var/ipfire/lynis-1.2.9/include/tests_firewalls
-var/ipfire/lynis-1.2.9/include/tests_hardening
-var/ipfire/lynis-1.2.9/include/tests_hardening_tools
-var/ipfire/lynis-1.2.9/include/tests_homedirs
-var/ipfire/lynis-1.2.9/include/tests_insecure_services
-var/ipfire/lynis-1.2.9/include/tests_kernel
-var/ipfire/lynis-1.2.9/include/tests_kernel_hardening
-var/ipfire/lynis-1.2.9/include/tests_ldap
-var/ipfire/lynis-1.2.9/include/tests_logging
-var/ipfire/lynis-1.2.9/include/tests_mac_frameworks
-var/ipfire/lynis-1.2.9/include/tests_mail_messaging
-var/ipfire/lynis-1.2.9/include/tests_malware
-var/ipfire/lynis-1.2.9/include/tests_memory_processes
-var/ipfire/lynis-1.2.9/include/tests_nameservices
-var/ipfire/lynis-1.2.9/include/tests_networking
-var/ipfire/lynis-1.2.9/include/tests_php
-var/ipfire/lynis-1.2.9/include/tests_ports_packages
-var/ipfire/lynis-1.2.9/include/tests_printers_spools
-var/ipfire/lynis-1.2.9/include/tests_scheduling
-var/ipfire/lynis-1.2.9/include/tests_shells
-var/ipfire/lynis-1.2.9/include/tests_snmp
-var/ipfire/lynis-1.2.9/include/tests_solaris
-var/ipfire/lynis-1.2.9/include/tests_squid
-var/ipfire/lynis-1.2.9/include/tests_ssh
-var/ipfire/lynis-1.2.9/include/tests_storage
-var/ipfire/lynis-1.2.9/include/tests_storage_nfs
-var/ipfire/lynis-1.2.9/include/tests_time
-var/ipfire/lynis-1.2.9/include/tests_virtualization
-var/ipfire/lynis-1.2.9/include/tests_webservers
-var/ipfire/lynis-1.2.9/lynis
-var/ipfire/lynis-1.2.9/lynis.8
-var/ipfire/lynis-1.2.9/plugins
-var/ipfire/lynis-1.2.9/plugins/README
-var/ipfire/lynis-1.2.9/plugins/plugin_access_files
-var/ipfire/lynis-1.2.9/plugins/plugin_compliance_pci
-var/ipfire/lynis-1.2.9/plugins/plugin_homedirs
-var/ipfire/lynis-1.2.9/plugins/plugin_webserver_data
\ No newline at end of file
+var/ipfire/lynis
+#var/ipfire/lynis/CONTRIBUTORS
+#var/ipfire/lynis/db
+var/ipfire/lynis/db/fileperms.db
+var/ipfire/lynis/db/hints.db
+var/ipfire/lynis/db/integrity.db
+var/ipfire/lynis/db/malware-susp.db
+var/ipfire/lynis/db/malware.db
+var/ipfire/lynis/db/sbl.db
+var/ipfire/lynis/default.prf
+#var/ipfire/lynis/extras
+var/ipfire/lynis/extras/.bzrignore
+#var/ipfire/lynis/extras/README
+#var/ipfire/lynis/extras/bash_completion.d
+var/ipfire/lynis/extras/bash_completion.d/lynis
+var/ipfire/lynis/extras/build-lynis.sh
+var/ipfire/lynis/extras/check-lynis.sh
+var/ipfire/lynis/extras/files.dat
+var/ipfire/lynis/extras/lynis.spec
+#var/ipfire/lynis/extras/openbsd
+#var/ipfire/lynis/extras/openbsd/+CONTENTS
+#var/ipfire/lynis/extras/systemd
+#var/ipfire/lynis/extras/systemd/lynis.service
+#var/ipfire/lynis/extras/systemd/lynis.timer
+#var/ipfire/lynis/include
+var/ipfire/lynis/include/binaries
+var/ipfire/lynis/include/consts
+var/ipfire/lynis/include/data_upload
+var/ipfire/lynis/include/functions
+var/ipfire/lynis/include/osdetection
+var/ipfire/lynis/include/parameters
+var/ipfire/lynis/include/profiles
+var/ipfire/lynis/include/report
+var/ipfire/lynis/include/tests_accounting
+var/ipfire/lynis/include/tests_authentication
+var/ipfire/lynis/include/tests_banners
+var/ipfire/lynis/include/tests_boot_services
+var/ipfire/lynis/include/tests_crypto
+var/ipfire/lynis/include/tests_custom.template
+var/ipfire/lynis/include/tests_databases
+var/ipfire/lynis/include/tests_file_integrity
+var/ipfire/lynis/include/tests_file_permissions
+var/ipfire/lynis/include/tests_filesystems
+var/ipfire/lynis/include/tests_firewalls
+var/ipfire/lynis/include/tests_hardening
+var/ipfire/lynis/include/tests_hardening_tools
+var/ipfire/lynis/include/tests_homedirs
+var/ipfire/lynis/include/tests_insecure_services
+var/ipfire/lynis/include/tests_kernel
+var/ipfire/lynis/include/tests_kernel_hardening
+var/ipfire/lynis/include/tests_ldap
+var/ipfire/lynis/include/tests_logging
+var/ipfire/lynis/include/tests_mac_frameworks
+var/ipfire/lynis/include/tests_mail_messaging
+var/ipfire/lynis/include/tests_malware
+var/ipfire/lynis/include/tests_memory_processes
+var/ipfire/lynis/include/tests_nameservices
+var/ipfire/lynis/include/tests_networking
+var/ipfire/lynis/include/tests_php
+var/ipfire/lynis/include/tests_ports_packages
+var/ipfire/lynis/include/tests_printers_spools
+var/ipfire/lynis/include/tests_scheduling
+var/ipfire/lynis/include/tests_shells
+var/ipfire/lynis/include/tests_snmp
+#var/ipfire/lynis/include/tests_solaris
+var/ipfire/lynis/include/tests_squid
+var/ipfire/lynis/include/tests_ssh
+var/ipfire/lynis/include/tests_storage
+var/ipfire/lynis/include/tests_storage_nfs
+var/ipfire/lynis/include/tests_tcpwrappers
+var/ipfire/lynis/include/tests_time
+var/ipfire/lynis/include/tests_tooling
+var/ipfire/lynis/include/tests_virtualization
+var/ipfire/lynis/include/tests_webservers
+var/ipfire/lynis/lynis
+var/ipfire/lynis/lynis.8
+#var/ipfire/lynis/plugins
+var/ipfire/lynis/plugins/README
+var/ipfire/lynis/plugins/custom_plugin.template
--- /dev/null
+etc/monitrc
+usr/bin/monit
+#usr/share/man/man1/monit.1
+var/ipfire/backup/addons/includes/monit
+etc/rc.d/init.d/monit
+etc/rc.d/rc0.d/K40monit
+etc/rc.d/rc3.d/S60monit
+etc/rc.d/rc6.d/K40monit
usr/bin/ndiff
usr/bin/nmap
usr/bin/nping
+usr/lib/python2.7/site-packages/ndiff.py
+usr/lib/python2.7/site-packages/ndiff.pyc
#usr/share/man/de/man1/nmap.1
#usr/share/man/es/man1/nmap.1
#usr/share/man/fr/man1/nmap.1
#usr/share/man/hu/man1
#usr/share/man/hu/man1/nmap.1
#usr/share/man/it/man1/nmap.1
-#usr/share/man/jp
-#usr/share/man/jp/man1
-#usr/share/man/jp/man1/nmap.1
+#usr/share/man/ja/man1/nmap.1
#usr/share/man/man1/ncat.1
#usr/share/man/man1/ndiff.1
#usr/share/man/man1/nmap.1
#usr/share/man/zh/man1
#usr/share/man/zh/man1/nmap.1
#usr/share/ncat
-usr/share/ncat/ca-bundle.crt
+#usr/share/ncat/ca-bundle.crt
#usr/share/nmap
usr/share/nmap/nmap-mac-prefixes
usr/share/nmap/nmap-os-db
usr/share/nmap/nmap.dtd
usr/share/nmap/nmap.xsl
usr/share/nmap/nse_main.lua
-#usr/share/nmap/nselib
+usr/share/nmap/nselib
usr/share/nmap/nselib/afp.lua
+usr/share/nmap/nselib/ajp.lua
usr/share/nmap/nselib/amqp.lua
usr/share/nmap/nselib/asn1.lua
+usr/share/nmap/nselib/base32.lua
usr/share/nmap/nselib/base64.lua
+usr/share/nmap/nselib/bin.luadoc
+usr/share/nmap/nselib/bit.luadoc
usr/share/nmap/nselib/bitcoin.lua
usr/share/nmap/nselib/bittorrent.lua
+usr/share/nmap/nselib/bjnp.lua
usr/share/nmap/nselib/brute.lua
+usr/share/nmap/nselib/cassandra.lua
usr/share/nmap/nselib/citrixxml.lua
usr/share/nmap/nselib/comm.lua
usr/share/nmap/nselib/creds.lua
usr/share/nmap/nselib/cvs.lua
-#usr/share/nmap/nselib/data
+usr/share/nmap/nselib/data
+usr/share/nmap/nselib/data/dns-srv-names
+usr/share/nmap/nselib/data/drupal-modules.lst
usr/share/nmap/nselib/data/favicon-db
usr/share/nmap/nselib/data/http-default-accounts-fingerprints.lua
+usr/share/nmap/nselib/data/http-devframework-fingerprints.lua
usr/share/nmap/nselib/data/http-fingerprints.lua
usr/share/nmap/nselib/data/http-folders.txt
+usr/share/nmap/nselib/data/http-sql-errors.lst
+usr/share/nmap/nselib/data/http-web-files-extensions.lst
+usr/share/nmap/nselib/data/ike-fingerprints.lua
+#usr/share/nmap/nselib/data/jdwp-class
+#usr/share/nmap/nselib/data/jdwp-class/JDWPExecCmd.class
+#usr/share/nmap/nselib/data/jdwp-class/JDWPExecCmd.java
+#usr/share/nmap/nselib/data/jdwp-class/JDWPSystemInfo.class
+#usr/share/nmap/nselib/data/jdwp-class/JDWPSystemInfo.java
+#usr/share/nmap/nselib/data/jdwp-class/README.txt
+usr/share/nmap/nselib/data/mgroupnames.db
usr/share/nmap/nselib/data/mysql-cis.audit
usr/share/nmap/nselib/data/oracle-default-accounts.lst
usr/share/nmap/nselib/data/oracle-sids
usr/share/nmap/nselib/data/packetdecoders.lua
usr/share/nmap/nselib/data/passwords.lst
+#usr/share/nmap/nselib/data/pixel.gif
#usr/share/nmap/nselib/data/psexec
-usr/share/nmap/nselib/data/psexec/README
+#usr/share/nmap/nselib/data/psexec/README
usr/share/nmap/nselib/data/psexec/backdoor.lua
usr/share/nmap/nselib/data/psexec/default.lua
usr/share/nmap/nselib/data/psexec/drives.lua
usr/share/nmap/nselib/data/ssl-fingerprints
usr/share/nmap/nselib/data/tftplist.txt
usr/share/nmap/nselib/data/usernames.lst
+usr/share/nmap/nselib/data/vhosts-default.lst
+usr/share/nmap/nselib/data/vhosts-full.lst
usr/share/nmap/nselib/data/wp-plugins.lst
usr/share/nmap/nselib/datafiles.lua
usr/share/nmap/nselib/dhcp.lua
usr/share/nmap/nselib/dnssd.lua
usr/share/nmap/nselib/drda.lua
usr/share/nmap/nselib/eap.lua
+usr/share/nmap/nselib/eigrp.lua
+usr/share/nmap/nselib/formulas.lua
usr/share/nmap/nselib/ftp.lua
usr/share/nmap/nselib/giop.lua
+usr/share/nmap/nselib/gps.lua
usr/share/nmap/nselib/http.lua
usr/share/nmap/nselib/httpspider.lua
usr/share/nmap/nselib/iax2.lua
+usr/share/nmap/nselib/ike.lua
usr/share/nmap/nselib/imap.lua
usr/share/nmap/nselib/informix.lua
usr/share/nmap/nselib/ipOps.lua
+usr/share/nmap/nselib/ipp.lua
usr/share/nmap/nselib/iscsi.lua
+usr/share/nmap/nselib/isns.lua
+usr/share/nmap/nselib/jdwp.lua
usr/share/nmap/nselib/json.lua
usr/share/nmap/nselib/ldap.lua
+usr/share/nmap/nselib/lfs.luadoc
usr/share/nmap/nselib/listop.lua
usr/share/nmap/nselib/match.lua
usr/share/nmap/nselib/membase.lua
+usr/share/nmap/nselib/mobileme.lua
usr/share/nmap/nselib/mongodb.lua
usr/share/nmap/nselib/msrpc.lua
usr/share/nmap/nselib/msrpcperformance.lua
usr/share/nmap/nselib/ncp.lua
usr/share/nmap/nselib/ndmp.lua
usr/share/nmap/nselib/netbios.lua
+usr/share/nmap/nselib/nmap.luadoc
usr/share/nmap/nselib/nrpc.lua
usr/share/nmap/nselib/nsedebug.lua
usr/share/nmap/nselib/omp2.lua
+usr/share/nmap/nselib/openssl.luadoc
+usr/share/nmap/nselib/ospf.lua
usr/share/nmap/nselib/packet.lua
+usr/share/nmap/nselib/pcre.luadoc
usr/share/nmap/nselib/pgsql.lua
usr/share/nmap/nselib/pop3.lua
usr/share/nmap/nselib/pppoe.lua
usr/share/nmap/nselib/proxy.lua
+usr/share/nmap/nselib/rdp.lua
usr/share/nmap/nselib/redis.lua
usr/share/nmap/nselib/rmi.lua
usr/share/nmap/nselib/rpc.lua
usr/share/nmap/nselib/tab.lua
usr/share/nmap/nselib/target.lua
usr/share/nmap/nselib/tftp.lua
+usr/share/nmap/nselib/tls.lua
usr/share/nmap/nselib/tns.lua
+usr/share/nmap/nselib/unicode.lua
+usr/share/nmap/nselib/unittest.lua
usr/share/nmap/nselib/unpwdb.lua
usr/share/nmap/nselib/upnp.lua
usr/share/nmap/nselib/url.lua
usr/share/nmap/scripts/afp-path-vuln.nse
usr/share/nmap/scripts/afp-serverinfo.nse
usr/share/nmap/scripts/afp-showmount.nse
+usr/share/nmap/scripts/ajp-auth.nse
+usr/share/nmap/scripts/ajp-brute.nse
+usr/share/nmap/scripts/ajp-headers.nse
+usr/share/nmap/scripts/ajp-methods.nse
+usr/share/nmap/scripts/ajp-request.nse
+usr/share/nmap/scripts/allseeingeye-info.nse
usr/share/nmap/scripts/amqp-info.nse
usr/share/nmap/scripts/asn-query.nse
usr/share/nmap/scripts/auth-owners.nse
usr/share/nmap/scripts/bitcoin-info.nse
usr/share/nmap/scripts/bitcoinrpc-info.nse
usr/share/nmap/scripts/bittorrent-discovery.nse
+usr/share/nmap/scripts/bjnp-discover.nse
+usr/share/nmap/scripts/broadcast-ataoe-discover.nse
usr/share/nmap/scripts/broadcast-avahi-dos.nse
+usr/share/nmap/scripts/broadcast-bjnp-discover.nse
usr/share/nmap/scripts/broadcast-db2-discover.nse
usr/share/nmap/scripts/broadcast-dhcp-discover.nse
usr/share/nmap/scripts/broadcast-dhcp6-discover.nse
usr/share/nmap/scripts/broadcast-dns-service-discovery.nse
usr/share/nmap/scripts/broadcast-dropbox-listener.nse
+usr/share/nmap/scripts/broadcast-eigrp-discovery.nse
+usr/share/nmap/scripts/broadcast-igmp-discovery.nse
usr/share/nmap/scripts/broadcast-listener.nse
usr/share/nmap/scripts/broadcast-ms-sql-discover.nse
usr/share/nmap/scripts/broadcast-netbios-master-browser.nse
usr/share/nmap/scripts/broadcast-novell-locate.nse
usr/share/nmap/scripts/broadcast-pc-anywhere.nse
usr/share/nmap/scripts/broadcast-pc-duo.nse
+usr/share/nmap/scripts/broadcast-pim-discovery.nse
usr/share/nmap/scripts/broadcast-ping.nse
usr/share/nmap/scripts/broadcast-pppoe-discover.nse
usr/share/nmap/scripts/broadcast-rip-discover.nse
usr/share/nmap/scripts/broadcast-ripng-discover.nse
usr/share/nmap/scripts/broadcast-sybase-asa-discover.nse
+usr/share/nmap/scripts/broadcast-tellstick-discover.nse
usr/share/nmap/scripts/broadcast-upnp-info.nse
usr/share/nmap/scripts/broadcast-versant-locate.nse
usr/share/nmap/scripts/broadcast-wake-on-lan.nse
usr/share/nmap/scripts/broadcast-wpad-discover.nse
usr/share/nmap/scripts/broadcast-wsdd-discover.nse
usr/share/nmap/scripts/broadcast-xdmcp-discover.nse
+usr/share/nmap/scripts/cassandra-brute.nse
+usr/share/nmap/scripts/cassandra-info.nse
usr/share/nmap/scripts/cccam-version.nse
usr/share/nmap/scripts/citrix-brute-xml.nse
usr/share/nmap/scripts/citrix-enum-apps-xml.nse
usr/share/nmap/scripts/couchdb-databases.nse
usr/share/nmap/scripts/couchdb-stats.nse
usr/share/nmap/scripts/creds-summary.nse
+usr/share/nmap/scripts/cups-info.nse
+usr/share/nmap/scripts/cups-queue-info.nse
usr/share/nmap/scripts/cvs-brute-repository.nse
usr/share/nmap/scripts/cvs-brute.nse
usr/share/nmap/scripts/daap-get-library.nse
usr/share/nmap/scripts/db2-das-info.nse
usr/share/nmap/scripts/db2-discover.nse
usr/share/nmap/scripts/dhcp-discover.nse
+usr/share/nmap/scripts/dict-info.nse
+usr/share/nmap/scripts/distcc-cve2004-2687.nse
usr/share/nmap/scripts/dns-blacklist.nse
usr/share/nmap/scripts/dns-brute.nse
usr/share/nmap/scripts/dns-cache-snoop.nse
+usr/share/nmap/scripts/dns-check-zone.nse
usr/share/nmap/scripts/dns-client-subnet-scan.nse
usr/share/nmap/scripts/dns-fuzz.nse
+usr/share/nmap/scripts/dns-ip6-arpa-scan.nse
usr/share/nmap/scripts/dns-nsec-enum.nse
+usr/share/nmap/scripts/dns-nsec3-enum.nse
usr/share/nmap/scripts/dns-nsid.nse
usr/share/nmap/scripts/dns-random-srcport.nse
usr/share/nmap/scripts/dns-random-txid.nse
usr/share/nmap/scripts/duplicates.nse
usr/share/nmap/scripts/eap-info.nse
usr/share/nmap/scripts/epmd-info.nse
+usr/share/nmap/scripts/eppc-enum-processes.nse
usr/share/nmap/scripts/finger.nse
usr/share/nmap/scripts/firewalk.nse
+usr/share/nmap/scripts/firewall-bypass.nse
+usr/share/nmap/scripts/flume-master-info.nse
+usr/share/nmap/scripts/freelancer-info.nse
usr/share/nmap/scripts/ftp-anon.nse
usr/share/nmap/scripts/ftp-bounce.nse
usr/share/nmap/scripts/ftp-brute.nse
usr/share/nmap/scripts/ftp-vuln-cve2010-4221.nse
usr/share/nmap/scripts/ganglia-info.nse
usr/share/nmap/scripts/giop-info.nse
+usr/share/nmap/scripts/gkrellm-info.nse
usr/share/nmap/scripts/gopher-ls.nse
+usr/share/nmap/scripts/gpsd-info.nse
usr/share/nmap/scripts/hadoop-datanode-info.nse
usr/share/nmap/scripts/hadoop-jobtracker-info.nse
usr/share/nmap/scripts/hadoop-namenode-info.nse
usr/share/nmap/scripts/hbase-region-info.nse
usr/share/nmap/scripts/hddtemp-info.nse
usr/share/nmap/scripts/hostmap-bfk.nse
+usr/share/nmap/scripts/hostmap-ip2hosts.nse
+usr/share/nmap/scripts/hostmap-robtex.nse
+usr/share/nmap/scripts/http-adobe-coldfusion-apsa1301.nse
usr/share/nmap/scripts/http-affiliate-id.nse
usr/share/nmap/scripts/http-apache-negotiation.nse
usr/share/nmap/scripts/http-auth-finder.nse
usr/share/nmap/scripts/http-brute.nse
usr/share/nmap/scripts/http-cakephp-version.nse
usr/share/nmap/scripts/http-chrono.nse
+usr/share/nmap/scripts/http-coldfusion-subzero.nse
+usr/share/nmap/scripts/http-comments-displayer.nse
usr/share/nmap/scripts/http-config-backup.nse
usr/share/nmap/scripts/http-cors.nse
+usr/share/nmap/scripts/http-csrf.nse
usr/share/nmap/scripts/http-date.nse
usr/share/nmap/scripts/http-default-accounts.nse
+usr/share/nmap/scripts/http-devframework.nse
+usr/share/nmap/scripts/http-dlink-backdoor.nse
+usr/share/nmap/scripts/http-dombased-xss.nse
usr/share/nmap/scripts/http-domino-enum-passwords.nse
+usr/share/nmap/scripts/http-drupal-enum-users.nse
+usr/share/nmap/scripts/http-drupal-modules.nse
usr/share/nmap/scripts/http-email-harvest.nse
usr/share/nmap/scripts/http-enum.nse
+usr/share/nmap/scripts/http-errors.nse
+usr/share/nmap/scripts/http-exif-spider.nse
usr/share/nmap/scripts/http-favicon.nse
+usr/share/nmap/scripts/http-feed.nse
+usr/share/nmap/scripts/http-fileupload-exploiter.nse
usr/share/nmap/scripts/http-form-brute.nse
+usr/share/nmap/scripts/http-form-fuzzer.nse
+usr/share/nmap/scripts/http-frontpage-login.nse
usr/share/nmap/scripts/http-generator.nse
+usr/share/nmap/scripts/http-git.nse
+usr/share/nmap/scripts/http-gitweb-projects-enum.nse
usr/share/nmap/scripts/http-google-malware.nse
usr/share/nmap/scripts/http-grep.nse
usr/share/nmap/scripts/http-headers.nse
+usr/share/nmap/scripts/http-huawei-hg5xx-vuln.nse
+usr/share/nmap/scripts/http-icloud-findmyiphone.nse
+usr/share/nmap/scripts/http-icloud-sendmsg.nse
+usr/share/nmap/scripts/http-iis-short-name-brute.nse
usr/share/nmap/scripts/http-iis-webdav-vuln.nse
usr/share/nmap/scripts/http-joomla-brute.nse
usr/share/nmap/scripts/http-litespeed-sourcecode-download.nse
usr/share/nmap/scripts/http-malware-host.nse
usr/share/nmap/scripts/http-method-tamper.nse
usr/share/nmap/scripts/http-methods.nse
+usr/share/nmap/scripts/http-mobileversion-checker.nse
+usr/share/nmap/scripts/http-ntlm-info.nse
usr/share/nmap/scripts/http-open-proxy.nse
usr/share/nmap/scripts/http-open-redirect.nse
usr/share/nmap/scripts/http-passwd.nse
usr/share/nmap/scripts/http-php-version.nse
+usr/share/nmap/scripts/http-phpmyadmin-dir-traversal.nse
+usr/share/nmap/scripts/http-phpself-xss.nse
usr/share/nmap/scripts/http-proxy-brute.nse
usr/share/nmap/scripts/http-put.nse
usr/share/nmap/scripts/http-qnap-nas-info.nse
+usr/share/nmap/scripts/http-referer-checker.nse
+usr/share/nmap/scripts/http-rfi-spider.nse
usr/share/nmap/scripts/http-robots.txt.nse
usr/share/nmap/scripts/http-robtex-reverse-ip.nse
+usr/share/nmap/scripts/http-robtex-shared-ns.nse
+usr/share/nmap/scripts/http-server-header.nse
+usr/share/nmap/scripts/http-sitemap-generator.nse
+usr/share/nmap/scripts/http-slowloris-check.nse
+usr/share/nmap/scripts/http-slowloris.nse
+usr/share/nmap/scripts/http-sql-injection.nse
+usr/share/nmap/scripts/http-stored-xss.nse
usr/share/nmap/scripts/http-title.nse
+usr/share/nmap/scripts/http-tplink-dir-traversal.nse
usr/share/nmap/scripts/http-trace.nse
+usr/share/nmap/scripts/http-traceroute.nse
usr/share/nmap/scripts/http-unsafe-output-escaping.nse
+usr/share/nmap/scripts/http-useragent-tester.nse
usr/share/nmap/scripts/http-userdir-enum.nse
usr/share/nmap/scripts/http-vhosts.nse
+usr/share/nmap/scripts/http-virustotal.nse
+usr/share/nmap/scripts/http-vlcstreamer-ls.nse
usr/share/nmap/scripts/http-vmware-path-vuln.nse
usr/share/nmap/scripts/http-vuln-cve2009-3960.nse
+usr/share/nmap/scripts/http-vuln-cve2010-0738.nse
usr/share/nmap/scripts/http-vuln-cve2010-2861.nse
usr/share/nmap/scripts/http-vuln-cve2011-3192.nse
usr/share/nmap/scripts/http-vuln-cve2011-3368.nse
usr/share/nmap/scripts/http-vuln-cve2012-1823.nse
+usr/share/nmap/scripts/http-vuln-cve2013-0156.nse
+usr/share/nmap/scripts/http-vuln-zimbra-lfi.nse
usr/share/nmap/scripts/http-waf-detect.nse
+usr/share/nmap/scripts/http-waf-fingerprint.nse
usr/share/nmap/scripts/http-wordpress-brute.nse
usr/share/nmap/scripts/http-wordpress-enum.nse
usr/share/nmap/scripts/http-wordpress-plugins.nse
+usr/share/nmap/scripts/http-xssed.nse
usr/share/nmap/scripts/iax2-brute.nse
usr/share/nmap/scripts/iax2-version.nse
+usr/share/nmap/scripts/icap-info.nse
+usr/share/nmap/scripts/ike-version.nse
usr/share/nmap/scripts/imap-brute.nse
usr/share/nmap/scripts/imap-capabilities.nse
usr/share/nmap/scripts/informix-brute.nse
usr/share/nmap/scripts/informix-query.nse
usr/share/nmap/scripts/informix-tables.nse
+usr/share/nmap/scripts/ip-forwarding.nse
usr/share/nmap/scripts/ip-geolocation-geobytes.nse
usr/share/nmap/scripts/ip-geolocation-geoplugin.nse
usr/share/nmap/scripts/ip-geolocation-ipinfodb.nse
usr/share/nmap/scripts/ip-geolocation-maxmind.nse
usr/share/nmap/scripts/ipidseq.nse
usr/share/nmap/scripts/ipv6-node-info.nse
+usr/share/nmap/scripts/ipv6-ra-flood.nse
usr/share/nmap/scripts/irc-botnet-channels.nse
usr/share/nmap/scripts/irc-brute.nse
usr/share/nmap/scripts/irc-info.nse
+usr/share/nmap/scripts/irc-sasl-brute.nse
usr/share/nmap/scripts/irc-unrealircd-backdoor.nse
usr/share/nmap/scripts/iscsi-brute.nse
usr/share/nmap/scripts/iscsi-info.nse
+usr/share/nmap/scripts/isns-info.nse
+usr/share/nmap/scripts/jdwp-exec.nse
+usr/share/nmap/scripts/jdwp-info.nse
+usr/share/nmap/scripts/jdwp-inject.nse
usr/share/nmap/scripts/jdwp-version.nse
usr/share/nmap/scripts/krb5-enum-users.nse
usr/share/nmap/scripts/ldap-brute.nse
usr/share/nmap/scripts/ldap-rootdse.nse
usr/share/nmap/scripts/ldap-search.nse
usr/share/nmap/scripts/lexmark-config.nse
+usr/share/nmap/scripts/llmnr-resolve.nse
usr/share/nmap/scripts/lltd-discovery.nse
usr/share/nmap/scripts/maxdb-info.nse
+usr/share/nmap/scripts/mcafee-epo-agent.nse
usr/share/nmap/scripts/membase-brute.nse
usr/share/nmap/scripts/membase-http-info.nse
usr/share/nmap/scripts/memcached-info.nse
+usr/share/nmap/scripts/metasploit-info.nse
+usr/share/nmap/scripts/metasploit-msgrpc-brute.nse
usr/share/nmap/scripts/metasploit-xmlrpc-brute.nse
+usr/share/nmap/scripts/mmouse-brute.nse
+usr/share/nmap/scripts/mmouse-exec.nse
usr/share/nmap/scripts/modbus-discover.nse
usr/share/nmap/scripts/mongodb-brute.nse
usr/share/nmap/scripts/mongodb-databases.nse
usr/share/nmap/scripts/mongodb-info.nse
+usr/share/nmap/scripts/mrinfo.nse
usr/share/nmap/scripts/ms-sql-brute.nse
usr/share/nmap/scripts/ms-sql-config.nse
+usr/share/nmap/scripts/ms-sql-dac.nse
usr/share/nmap/scripts/ms-sql-dump-hashes.nse
usr/share/nmap/scripts/ms-sql-empty-password.nse
usr/share/nmap/scripts/ms-sql-hasdbaccess.nse
usr/share/nmap/scripts/ms-sql-query.nse
usr/share/nmap/scripts/ms-sql-tables.nse
usr/share/nmap/scripts/ms-sql-xp-cmdshell.nse
+usr/share/nmap/scripts/msrpc-enum.nse
+usr/share/nmap/scripts/mtrace.nse
+usr/share/nmap/scripts/murmur-version.nse
usr/share/nmap/scripts/mysql-audit.nse
usr/share/nmap/scripts/mysql-brute.nse
usr/share/nmap/scripts/mysql-databases.nse
+usr/share/nmap/scripts/mysql-dump-hashes.nse
usr/share/nmap/scripts/mysql-empty-password.nse
+usr/share/nmap/scripts/mysql-enum.nse
usr/share/nmap/scripts/mysql-info.nse
+usr/share/nmap/scripts/mysql-query.nse
usr/share/nmap/scripts/mysql-users.nse
usr/share/nmap/scripts/mysql-variables.nse
+usr/share/nmap/scripts/mysql-vuln-cve2012-2122.nse
usr/share/nmap/scripts/nat-pmp-info.nse
usr/share/nmap/scripts/nat-pmp-mapport.nse
usr/share/nmap/scripts/nbstat.nse
usr/share/nmap/scripts/omp2-enum-targets.nse
usr/share/nmap/scripts/openlookup-info.nse
usr/share/nmap/scripts/openvas-otp-brute.nse
+usr/share/nmap/scripts/oracle-brute-stealth.nse
usr/share/nmap/scripts/oracle-brute.nse
usr/share/nmap/scripts/oracle-enum-users.nse
usr/share/nmap/scripts/oracle-sid-brute.nse
usr/share/nmap/scripts/ovs-agent-version.nse
usr/share/nmap/scripts/p2p-conficker.nse
usr/share/nmap/scripts/path-mtu.nse
+usr/share/nmap/scripts/pcanywhere-brute.nse
usr/share/nmap/scripts/pgsql-brute.nse
usr/share/nmap/scripts/pjl-ready-message.nse
usr/share/nmap/scripts/pop3-brute.nse
usr/share/nmap/scripts/pop3-capabilities.nse
usr/share/nmap/scripts/pptp-version.nse
+usr/share/nmap/scripts/qconn-exec.nse
usr/share/nmap/scripts/qscan.nse
+usr/share/nmap/scripts/quake1-info.nse
usr/share/nmap/scripts/quake3-info.nse
usr/share/nmap/scripts/quake3-master-getservers.nse
+usr/share/nmap/scripts/rdp-enum-encryption.nse
usr/share/nmap/scripts/rdp-vuln-ms12-020.nse
usr/share/nmap/scripts/realvnc-auth-bypass.nse
usr/share/nmap/scripts/redis-brute.nse
usr/share/nmap/scripts/resolveall.nse
usr/share/nmap/scripts/reverse-index.nse
usr/share/nmap/scripts/rexec-brute.nse
+usr/share/nmap/scripts/rfc868-time.nse
usr/share/nmap/scripts/riak-http-info.nse
usr/share/nmap/scripts/rlogin-brute.nse
usr/share/nmap/scripts/rmi-dumpregistry.nse
+usr/share/nmap/scripts/rmi-vuln-classloader.nse
+usr/share/nmap/scripts/rpc-grind.nse
usr/share/nmap/scripts/rpcap-brute.nse
usr/share/nmap/scripts/rpcap-info.nse
usr/share/nmap/scripts/rpcinfo.nse
usr/share/nmap/scripts/script.db
usr/share/nmap/scripts/servicetags.nse
usr/share/nmap/scripts/sip-brute.nse
+usr/share/nmap/scripts/sip-call-spoof.nse
usr/share/nmap/scripts/sip-enum-users.nse
+usr/share/nmap/scripts/sip-methods.nse
usr/share/nmap/scripts/skypev2-version.nse
usr/share/nmap/scripts/smb-brute.nse
usr/share/nmap/scripts/smb-check-vulns.nse
usr/share/nmap/scripts/smb-enum-shares.nse
usr/share/nmap/scripts/smb-enum-users.nse
usr/share/nmap/scripts/smb-flood.nse
+usr/share/nmap/scripts/smb-ls.nse
usr/share/nmap/scripts/smb-mbenum.nse
usr/share/nmap/scripts/smb-os-discovery.nse
+usr/share/nmap/scripts/smb-print-text.nse
usr/share/nmap/scripts/smb-psexec.nse
usr/share/nmap/scripts/smb-security-mode.nse
usr/share/nmap/scripts/smb-server-stats.nse
usr/share/nmap/scripts/smb-system-info.nse
+usr/share/nmap/scripts/smb-vuln-ms10-054.nse
+usr/share/nmap/scripts/smb-vuln-ms10-061.nse
usr/share/nmap/scripts/smbv2-enabled.nse
usr/share/nmap/scripts/smtp-brute.nse
usr/share/nmap/scripts/smtp-commands.nse
usr/share/nmap/scripts/smtp-vuln-cve2011-1764.nse
usr/share/nmap/scripts/sniffer-detect.nse
usr/share/nmap/scripts/snmp-brute.nse
+usr/share/nmap/scripts/snmp-hh3c-logins.nse
usr/share/nmap/scripts/snmp-interfaces.nse
usr/share/nmap/scripts/snmp-ios-config.nse
usr/share/nmap/scripts/snmp-netstat.nse
usr/share/nmap/scripts/socks-auth-info.nse
usr/share/nmap/scripts/socks-brute.nse
usr/share/nmap/scripts/socks-open-proxy.nse
-usr/share/nmap/scripts/sql-injection.nse
usr/share/nmap/scripts/ssh-hostkey.nse
usr/share/nmap/scripts/ssh2-enum-algos.nse
usr/share/nmap/scripts/sshv1.nse
usr/share/nmap/scripts/ssl-cert.nse
+usr/share/nmap/scripts/ssl-date.nse
usr/share/nmap/scripts/ssl-enum-ciphers.nse
usr/share/nmap/scripts/ssl-google-cert-catalog.nse
+usr/share/nmap/scripts/ssl-heartbleed.nse
usr/share/nmap/scripts/ssl-known-key.nse
usr/share/nmap/scripts/sslv2.nse
+usr/share/nmap/scripts/sstp-discover.nse
usr/share/nmap/scripts/stun-info.nse
usr/share/nmap/scripts/stun-version.nse
usr/share/nmap/scripts/stuxnet-detect.nse
usr/share/nmap/scripts/targets-ipv6-multicast-slaac.nse
usr/share/nmap/scripts/targets-sniffer.nse
usr/share/nmap/scripts/targets-traceroute.nse
+usr/share/nmap/scripts/teamspeak2-version.nse
usr/share/nmap/scripts/telnet-brute.nse
usr/share/nmap/scripts/telnet-encryption.nse
usr/share/nmap/scripts/tftp-enum.nse
+usr/share/nmap/scripts/tls-nextprotoneg.nse
+usr/share/nmap/scripts/traceroute-geolocation.nse
+usr/share/nmap/scripts/unittest.nse
usr/share/nmap/scripts/unusual-port.nse
usr/share/nmap/scripts/upnp-info.nse
usr/share/nmap/scripts/url-snarf.nse
+usr/share/nmap/scripts/ventrilo-info.nse
usr/share/nmap/scripts/versant-info.nse
usr/share/nmap/scripts/vmauthd-brute.nse
usr/share/nmap/scripts/vnc-brute.nse
usr/share/nmap/scripts/voldemort-info.nse
usr/share/nmap/scripts/vuze-dht-info.nse
usr/share/nmap/scripts/wdb-version.nse
-usr/share/nmap/scripts/whois.nse
+usr/share/nmap/scripts/weblogic-t3-info.nse
+usr/share/nmap/scripts/whois-domain.nse
+usr/share/nmap/scripts/whois-ip.nse
usr/share/nmap/scripts/wsdd-discover.nse
usr/share/nmap/scripts/x11-access.nse
usr/share/nmap/scripts/xdmcp-discover.nse
#srv/web/owncloud/3rdparty/fontawesome/font/fontawesome-webfont.svg
#srv/web/owncloud/3rdparty/fontawesome/font/fontawesome-webfont.ttf
#srv/web/owncloud/3rdparty/fontawesome/font/fontawesome-webfont.woff
-#srv/web/owncloud/3rdparty/getid3
-#srv/web/owncloud/3rdparty/getid3/extension.cache.dbm.php
-#srv/web/owncloud/3rdparty/getid3/extension.cache.mysql.php
-#srv/web/owncloud/3rdparty/getid3/extension.cache.sqlite3.php
-#srv/web/owncloud/3rdparty/getid3/getid3.lib.php
-#srv/web/owncloud/3rdparty/getid3/getid3.php
-#srv/web/owncloud/3rdparty/getid3/license.txt
-#srv/web/owncloud/3rdparty/getid3/module.archive.gzip.php
-#srv/web/owncloud/3rdparty/getid3/module.archive.rar.php
-#srv/web/owncloud/3rdparty/getid3/module.archive.szip.php
-#srv/web/owncloud/3rdparty/getid3/module.archive.tar.php
-#srv/web/owncloud/3rdparty/getid3/module.archive.zip.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.asf.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.bink.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.flv.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.matroska.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.mpeg.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.nsv.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.quicktime.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.real.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.riff.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.swf.php
-#srv/web/owncloud/3rdparty/getid3/module.audio-video.ts.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.aa.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.aac.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.ac3.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.au.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.avr.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.bonk.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.dss.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.dts.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.flac.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.la.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.lpac.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.midi.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.mod.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.monkey.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.mp3.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.mpc.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.ogg.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.optimfrog.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.rkau.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.shorten.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.tta.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.voc.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.vqf.php
-#srv/web/owncloud/3rdparty/getid3/module.audio.wavpack.php
-#srv/web/owncloud/3rdparty/getid3/module.graphic.bmp.php
-#srv/web/owncloud/3rdparty/getid3/module.graphic.efax.php
-#srv/web/owncloud/3rdparty/getid3/module.graphic.gif.php
-#srv/web/owncloud/3rdparty/getid3/module.graphic.jpg.php
-#srv/web/owncloud/3rdparty/getid3/module.graphic.pcd.php
-#srv/web/owncloud/3rdparty/getid3/module.graphic.png.php
-#srv/web/owncloud/3rdparty/getid3/module.graphic.svg.php
-#srv/web/owncloud/3rdparty/getid3/module.graphic.tiff.php
-#srv/web/owncloud/3rdparty/getid3/module.misc.cue.php
-#srv/web/owncloud/3rdparty/getid3/module.misc.exe.php
-#srv/web/owncloud/3rdparty/getid3/module.misc.iso.php
-#srv/web/owncloud/3rdparty/getid3/module.misc.msoffice.php
-#srv/web/owncloud/3rdparty/getid3/module.misc.par2.php
-#srv/web/owncloud/3rdparty/getid3/module.misc.pdf.php
-#srv/web/owncloud/3rdparty/getid3/module.tag.apetag.php
-#srv/web/owncloud/3rdparty/getid3/module.tag.id3v1.php
-#srv/web/owncloud/3rdparty/getid3/module.tag.id3v2.php
-#srv/web/owncloud/3rdparty/getid3/module.tag.lyrics3.php
-#srv/web/owncloud/3rdparty/getid3/module.tag.xmp.php
-#srv/web/owncloud/3rdparty/getid3/write.apetag.php
-#srv/web/owncloud/3rdparty/getid3/write.id3v1.php
-#srv/web/owncloud/3rdparty/getid3/write.id3v2.php
-#srv/web/owncloud/3rdparty/getid3/write.lyrics3.php
-#srv/web/owncloud/3rdparty/getid3/write.metaflac.php
-#srv/web/owncloud/3rdparty/getid3/write.php
-#srv/web/owncloud/3rdparty/getid3/write.real.php
-#srv/web/owncloud/3rdparty/getid3/write.vorbiscomment.php
#srv/web/owncloud/3rdparty/guzzle
#srv/web/owncloud/3rdparty/guzzle/common
#srv/web/owncloud/3rdparty/guzzle/common/Guzzle
#srv/web/owncloud/3rdparty/guzzle/stream/Guzzle/Stream/StreamInterface.php
#srv/web/owncloud/3rdparty/guzzle/stream/Guzzle/Stream/StreamRequestFactoryInterface.php
#srv/web/owncloud/3rdparty/guzzle/stream/Guzzle/Stream/composer.json
-#srv/web/owncloud/3rdparty/isoft
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Driver
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Driver/PDODblib
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Driver/PDODblib/Connection.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Driver/PDODblib/Driver.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Platforms
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Platforms/DblibPlatform.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Readme.md
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/RealestateMssqlBundle.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Schema
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Schema/DblibSchemaManager.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Types
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Types/DateTimeType.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Types/DateType.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Types/RealestateDateTime.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/Types/UniqueidentifierType.php
-#srv/web/owncloud/3rdparty/isoft/mssql-bundle/Realestate/MssqlBundle/composer.json
+#srv/web/owncloud/3rdparty/james-heinrich
+#srv/web/owncloud/3rdparty/james-heinrich/getid3
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/.gitattributes
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/README.md
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/changelog.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/composer.json
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/dependencies.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/extension.cache.dbm.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/extension.cache.mysql.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/extension.cache.sqlite3.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/getid3.lib.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/getid3.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.archive.gzip.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.archive.rar.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.archive.szip.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.archive.tar.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.archive.zip.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.asf.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.bink.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.flv.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.matroska.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.mpeg.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.nsv.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.quicktime.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.real.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.riff.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.swf.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio-video.ts.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.aa.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.aac.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.ac3.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.amr.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.au.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.avr.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.bonk.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.dss.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.dts.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.flac.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.la.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.lpac.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.midi.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.mod.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.monkey.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.mp3.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.mpc.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.ogg.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.optimfrog.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.rkau.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.shorten.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.tta.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.voc.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.vqf.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.audio.wavpack.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.graphic.bmp.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.graphic.efax.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.graphic.gif.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.graphic.jpg.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.graphic.pcd.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.graphic.png.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.graphic.svg.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.graphic.tiff.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.misc.cue.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.misc.exe.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.misc.iso.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.misc.msoffice.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.misc.par2.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.misc.pdf.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.tag.apetag.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.tag.id3v1.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.tag.id3v2.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.tag.lyrics3.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/module.tag.xmp.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/write.apetag.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/write.id3v1.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/write.id3v2.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/write.lyrics3.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/write.metaflac.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/write.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/write.real.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/getid3/write.vorbiscomment.php
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/license.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/licenses
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/licenses/licence.gpl-10.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/licenses/licence.gpl-20.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/licenses/licence.gpl-30.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/licenses/licence.lgpl-30.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/licenses/licence.mpl-20.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/licenses/license.commercial.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/readme.txt
+#srv/web/owncloud/3rdparty/james-heinrich/getid3/structure.txt
#srv/web/owncloud/3rdparty/js
#srv/web/owncloud/3rdparty/js/chosen
#srv/web/owncloud/3rdparty/js/chosen/LICENSE.md
#srv/web/owncloud/3rdparty/patches.txt
#srv/web/owncloud/3rdparty/phpass
#srv/web/owncloud/3rdparty/phpass/PasswordHash.php
-#srv/web/owncloud/3rdparty/phpass/c
-#srv/web/owncloud/3rdparty/phpass/c/Makefile
-#srv/web/owncloud/3rdparty/phpass/c/crypt_private.c
#srv/web/owncloud/3rdparty/phpass/test.php
#srv/web/owncloud/3rdparty/phpmailer
#srv/web/owncloud/3rdparty/phpmailer/phpmailer
#srv/web/owncloud/apps/activity/l10n/hy.php
#srv/web/owncloud/apps/activity/l10n/ia.php
#srv/web/owncloud/apps/activity/l10n/id.php
+#srv/web/owncloud/apps/activity/l10n/io.php
#srv/web/owncloud/apps/activity/l10n/is.php
#srv/web/owncloud/apps/activity/l10n/it.php
#srv/web/owncloud/apps/activity/l10n/ja.php
-#srv/web/owncloud/apps/activity/l10n/ja_JP.php
#srv/web/owncloud/apps/activity/l10n/jv.php
#srv/web/owncloud/apps/activity/l10n/ka_GE.php
#srv/web/owncloud/apps/activity/l10n/km.php
#srv/web/owncloud/apps/activity/l10n/kn.php
#srv/web/owncloud/apps/activity/l10n/ko.php
#srv/web/owncloud/apps/activity/l10n/ku_IQ.php
-#srv/web/owncloud/apps/activity/l10n/l10n.pl
#srv/web/owncloud/apps/activity/l10n/lb.php
#srv/web/owncloud/apps/activity/l10n/lt_LT.php
#srv/web/owncloud/apps/activity/l10n/lv.php
#srv/web/owncloud/apps/activity/tests/hooksdeleteusertest.php
#srv/web/owncloud/apps/activity/tests/mailqueuehandlertest.php
#srv/web/owncloud/apps/activity/tests/navigationtest.php
+#srv/web/owncloud/apps/activity/tests/parameterhelpertest.php
#srv/web/owncloud/apps/activity/tests/phpunit.xml
#srv/web/owncloud/apps/activity/tests/usersettingstest.php
#srv/web/owncloud/apps/admin_dependencies_chk
#srv/web/owncloud/apps/bookmarks/js/full_tags.php
#srv/web/owncloud/apps/bookmarks/js/settings.js
#srv/web/owncloud/apps/bookmarks/l10n
-#srv/web/owncloud/apps/bookmarks/l10n/ach
-#srv/web/owncloud/apps/bookmarks/l10n/ach/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ady
-#srv/web/owncloud/apps/bookmarks/l10n/ady/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/af
-#srv/web/owncloud/apps/bookmarks/l10n/af/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/af_ZA
#srv/web/owncloud/apps/bookmarks/l10n/af_ZA.php
-#srv/web/owncloud/apps/bookmarks/l10n/af_ZA/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ak
-#srv/web/owncloud/apps/bookmarks/l10n/ak/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/am_ET
-#srv/web/owncloud/apps/bookmarks/l10n/am_ET/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ar
+#srv/web/owncloud/apps/bookmarks/l10n/ar.js
+#srv/web/owncloud/apps/bookmarks/l10n/ar.json
#srv/web/owncloud/apps/bookmarks/l10n/ar.php
-#srv/web/owncloud/apps/bookmarks/l10n/ar/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ast
+#srv/web/owncloud/apps/bookmarks/l10n/ast.js
+#srv/web/owncloud/apps/bookmarks/l10n/ast.json
#srv/web/owncloud/apps/bookmarks/l10n/ast.php
-#srv/web/owncloud/apps/bookmarks/l10n/ast/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/az
-#srv/web/owncloud/apps/bookmarks/l10n/az/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/be
+#srv/web/owncloud/apps/bookmarks/l10n/az.js
+#srv/web/owncloud/apps/bookmarks/l10n/az.json
+#srv/web/owncloud/apps/bookmarks/l10n/az.php
#srv/web/owncloud/apps/bookmarks/l10n/be.php
-#srv/web/owncloud/apps/bookmarks/l10n/be/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/bg_BG
+#srv/web/owncloud/apps/bookmarks/l10n/bg_BG.js
+#srv/web/owncloud/apps/bookmarks/l10n/bg_BG.json
#srv/web/owncloud/apps/bookmarks/l10n/bg_BG.php
-#srv/web/owncloud/apps/bookmarks/l10n/bg_BG/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/bn_BD
+#srv/web/owncloud/apps/bookmarks/l10n/bn_BD.js
+#srv/web/owncloud/apps/bookmarks/l10n/bn_BD.json
#srv/web/owncloud/apps/bookmarks/l10n/bn_BD.php
-#srv/web/owncloud/apps/bookmarks/l10n/bn_BD/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/bn_IN
-#srv/web/owncloud/apps/bookmarks/l10n/bn_IN/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/bs
+#srv/web/owncloud/apps/bookmarks/l10n/bn_IN.js
+#srv/web/owncloud/apps/bookmarks/l10n/bn_IN.json
+#srv/web/owncloud/apps/bookmarks/l10n/bn_IN.php
#srv/web/owncloud/apps/bookmarks/l10n/bs.php
-#srv/web/owncloud/apps/bookmarks/l10n/bs/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ca
+#srv/web/owncloud/apps/bookmarks/l10n/ca.js
+#srv/web/owncloud/apps/bookmarks/l10n/ca.json
#srv/web/owncloud/apps/bookmarks/l10n/ca.php
-#srv/web/owncloud/apps/bookmarks/l10n/ca/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ca@valencia
-#srv/web/owncloud/apps/bookmarks/l10n/ca@valencia/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/cs_CZ
+#srv/web/owncloud/apps/bookmarks/l10n/cs_CZ.js
+#srv/web/owncloud/apps/bookmarks/l10n/cs_CZ.json
#srv/web/owncloud/apps/bookmarks/l10n/cs_CZ.php
-#srv/web/owncloud/apps/bookmarks/l10n/cs_CZ/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/cy_GB
+#srv/web/owncloud/apps/bookmarks/l10n/cy_GB.js
+#srv/web/owncloud/apps/bookmarks/l10n/cy_GB.json
#srv/web/owncloud/apps/bookmarks/l10n/cy_GB.php
-#srv/web/owncloud/apps/bookmarks/l10n/cy_GB/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/da
+#srv/web/owncloud/apps/bookmarks/l10n/da.js
+#srv/web/owncloud/apps/bookmarks/l10n/da.json
#srv/web/owncloud/apps/bookmarks/l10n/da.php
-#srv/web/owncloud/apps/bookmarks/l10n/da/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/de
+#srv/web/owncloud/apps/bookmarks/l10n/de.js
+#srv/web/owncloud/apps/bookmarks/l10n/de.json
#srv/web/owncloud/apps/bookmarks/l10n/de.php
-#srv/web/owncloud/apps/bookmarks/l10n/de/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/de_AT
#srv/web/owncloud/apps/bookmarks/l10n/de_AT.php
-#srv/web/owncloud/apps/bookmarks/l10n/de_AT/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/de_CH
+#srv/web/owncloud/apps/bookmarks/l10n/de_CH.js
+#srv/web/owncloud/apps/bookmarks/l10n/de_CH.json
#srv/web/owncloud/apps/bookmarks/l10n/de_CH.php
-#srv/web/owncloud/apps/bookmarks/l10n/de_CH/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/de_DE
+#srv/web/owncloud/apps/bookmarks/l10n/de_DE.js
+#srv/web/owncloud/apps/bookmarks/l10n/de_DE.json
#srv/web/owncloud/apps/bookmarks/l10n/de_DE.php
-#srv/web/owncloud/apps/bookmarks/l10n/de_DE/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/el
+#srv/web/owncloud/apps/bookmarks/l10n/el.js
+#srv/web/owncloud/apps/bookmarks/l10n/el.json
#srv/web/owncloud/apps/bookmarks/l10n/el.php
-#srv/web/owncloud/apps/bookmarks/l10n/el/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/en@pirate
-#srv/web/owncloud/apps/bookmarks/l10n/en@pirate/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/en_GB
+#srv/web/owncloud/apps/bookmarks/l10n/en_GB.js
+#srv/web/owncloud/apps/bookmarks/l10n/en_GB.json
#srv/web/owncloud/apps/bookmarks/l10n/en_GB.php
-#srv/web/owncloud/apps/bookmarks/l10n/en_GB/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/en_NZ
-#srv/web/owncloud/apps/bookmarks/l10n/en_NZ/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/eo
+#srv/web/owncloud/apps/bookmarks/l10n/eo.js
+#srv/web/owncloud/apps/bookmarks/l10n/eo.json
#srv/web/owncloud/apps/bookmarks/l10n/eo.php
-#srv/web/owncloud/apps/bookmarks/l10n/eo/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es
+#srv/web/owncloud/apps/bookmarks/l10n/es.js
+#srv/web/owncloud/apps/bookmarks/l10n/es.json
#srv/web/owncloud/apps/bookmarks/l10n/es.php
-#srv/web/owncloud/apps/bookmarks/l10n/es/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_AR
+#srv/web/owncloud/apps/bookmarks/l10n/es_AR.js
+#srv/web/owncloud/apps/bookmarks/l10n/es_AR.json
#srv/web/owncloud/apps/bookmarks/l10n/es_AR.php
-#srv/web/owncloud/apps/bookmarks/l10n/es_AR/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_BO
-#srv/web/owncloud/apps/bookmarks/l10n/es_BO/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_CL
#srv/web/owncloud/apps/bookmarks/l10n/es_CL.php
-#srv/web/owncloud/apps/bookmarks/l10n/es_CL/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_CO
-#srv/web/owncloud/apps/bookmarks/l10n/es_CO/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_CR
-#srv/web/owncloud/apps/bookmarks/l10n/es_CR/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_EC
-#srv/web/owncloud/apps/bookmarks/l10n/es_EC/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_MX
+#srv/web/owncloud/apps/bookmarks/l10n/es_MX.js
+#srv/web/owncloud/apps/bookmarks/l10n/es_MX.json
#srv/web/owncloud/apps/bookmarks/l10n/es_MX.php
-#srv/web/owncloud/apps/bookmarks/l10n/es_MX/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_PE
-#srv/web/owncloud/apps/bookmarks/l10n/es_PE/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_PY
-#srv/web/owncloud/apps/bookmarks/l10n/es_PY/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_US
-#srv/web/owncloud/apps/bookmarks/l10n/es_US/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/es_UY
-#srv/web/owncloud/apps/bookmarks/l10n/es_UY/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/et_EE
+#srv/web/owncloud/apps/bookmarks/l10n/et_EE.js
+#srv/web/owncloud/apps/bookmarks/l10n/et_EE.json
#srv/web/owncloud/apps/bookmarks/l10n/et_EE.php
-#srv/web/owncloud/apps/bookmarks/l10n/et_EE/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/eu
+#srv/web/owncloud/apps/bookmarks/l10n/eu.js
+#srv/web/owncloud/apps/bookmarks/l10n/eu.json
#srv/web/owncloud/apps/bookmarks/l10n/eu.php
-#srv/web/owncloud/apps/bookmarks/l10n/eu/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/eu_ES
#srv/web/owncloud/apps/bookmarks/l10n/eu_ES.php
-#srv/web/owncloud/apps/bookmarks/l10n/eu_ES/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/fa
+#srv/web/owncloud/apps/bookmarks/l10n/fa.js
+#srv/web/owncloud/apps/bookmarks/l10n/fa.json
#srv/web/owncloud/apps/bookmarks/l10n/fa.php
-#srv/web/owncloud/apps/bookmarks/l10n/fa/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/fi
#srv/web/owncloud/apps/bookmarks/l10n/fi.php
-#srv/web/owncloud/apps/bookmarks/l10n/fi/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/fi_FI
+#srv/web/owncloud/apps/bookmarks/l10n/fi_FI.js
+#srv/web/owncloud/apps/bookmarks/l10n/fi_FI.json
#srv/web/owncloud/apps/bookmarks/l10n/fi_FI.php
-#srv/web/owncloud/apps/bookmarks/l10n/fi_FI/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/fr
+#srv/web/owncloud/apps/bookmarks/l10n/fr.js
+#srv/web/owncloud/apps/bookmarks/l10n/fr.json
#srv/web/owncloud/apps/bookmarks/l10n/fr.php
-#srv/web/owncloud/apps/bookmarks/l10n/fr/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/fr_CA
-#srv/web/owncloud/apps/bookmarks/l10n/fr_CA/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/gl
+#srv/web/owncloud/apps/bookmarks/l10n/gl.js
+#srv/web/owncloud/apps/bookmarks/l10n/gl.json
#srv/web/owncloud/apps/bookmarks/l10n/gl.php
-#srv/web/owncloud/apps/bookmarks/l10n/gl/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/he
+#srv/web/owncloud/apps/bookmarks/l10n/he.js
+#srv/web/owncloud/apps/bookmarks/l10n/he.json
#srv/web/owncloud/apps/bookmarks/l10n/he.php
-#srv/web/owncloud/apps/bookmarks/l10n/he/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/hi
#srv/web/owncloud/apps/bookmarks/l10n/hi.php
-#srv/web/owncloud/apps/bookmarks/l10n/hi/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/hi_IN
-#srv/web/owncloud/apps/bookmarks/l10n/hi_IN/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/hr
#srv/web/owncloud/apps/bookmarks/l10n/hr.php
-#srv/web/owncloud/apps/bookmarks/l10n/hr/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/hu_HU
+#srv/web/owncloud/apps/bookmarks/l10n/hu_HU.js
+#srv/web/owncloud/apps/bookmarks/l10n/hu_HU.json
#srv/web/owncloud/apps/bookmarks/l10n/hu_HU.php
-#srv/web/owncloud/apps/bookmarks/l10n/hu_HU/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/hy
#srv/web/owncloud/apps/bookmarks/l10n/hy.php
-#srv/web/owncloud/apps/bookmarks/l10n/hy/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ia
+#srv/web/owncloud/apps/bookmarks/l10n/ia.js
+#srv/web/owncloud/apps/bookmarks/l10n/ia.json
#srv/web/owncloud/apps/bookmarks/l10n/ia.php
-#srv/web/owncloud/apps/bookmarks/l10n/ia/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/id
+#srv/web/owncloud/apps/bookmarks/l10n/id.js
+#srv/web/owncloud/apps/bookmarks/l10n/id.json
#srv/web/owncloud/apps/bookmarks/l10n/id.php
-#srv/web/owncloud/apps/bookmarks/l10n/id/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/is
+#srv/web/owncloud/apps/bookmarks/l10n/is.js
+#srv/web/owncloud/apps/bookmarks/l10n/is.json
#srv/web/owncloud/apps/bookmarks/l10n/is.php
-#srv/web/owncloud/apps/bookmarks/l10n/is/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/it
+#srv/web/owncloud/apps/bookmarks/l10n/it.js
+#srv/web/owncloud/apps/bookmarks/l10n/it.json
#srv/web/owncloud/apps/bookmarks/l10n/it.php
-#srv/web/owncloud/apps/bookmarks/l10n/it/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ja
+#srv/web/owncloud/apps/bookmarks/l10n/ja.js
+#srv/web/owncloud/apps/bookmarks/l10n/ja.json
#srv/web/owncloud/apps/bookmarks/l10n/ja.php
-#srv/web/owncloud/apps/bookmarks/l10n/ja/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ja_JP.php
-#srv/web/owncloud/apps/bookmarks/l10n/jv
#srv/web/owncloud/apps/bookmarks/l10n/jv.php
-#srv/web/owncloud/apps/bookmarks/l10n/jv/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ka
-#srv/web/owncloud/apps/bookmarks/l10n/ka/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ka_GE
+#srv/web/owncloud/apps/bookmarks/l10n/ka_GE.js
+#srv/web/owncloud/apps/bookmarks/l10n/ka_GE.json
#srv/web/owncloud/apps/bookmarks/l10n/ka_GE.php
-#srv/web/owncloud/apps/bookmarks/l10n/ka_GE/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/km
+#srv/web/owncloud/apps/bookmarks/l10n/km.js
+#srv/web/owncloud/apps/bookmarks/l10n/km.json
#srv/web/owncloud/apps/bookmarks/l10n/km.php
-#srv/web/owncloud/apps/bookmarks/l10n/km/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/kn
-#srv/web/owncloud/apps/bookmarks/l10n/kn/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ko
+#srv/web/owncloud/apps/bookmarks/l10n/ko.js
+#srv/web/owncloud/apps/bookmarks/l10n/ko.json
#srv/web/owncloud/apps/bookmarks/l10n/ko.php
-#srv/web/owncloud/apps/bookmarks/l10n/ko/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ku_IQ
#srv/web/owncloud/apps/bookmarks/l10n/ku_IQ.php
-#srv/web/owncloud/apps/bookmarks/l10n/ku_IQ/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/l10n.pl
-#srv/web/owncloud/apps/bookmarks/l10n/lb
+#srv/web/owncloud/apps/bookmarks/l10n/lb.js
+#srv/web/owncloud/apps/bookmarks/l10n/lb.json
#srv/web/owncloud/apps/bookmarks/l10n/lb.php
-#srv/web/owncloud/apps/bookmarks/l10n/lb/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/lt_LT
+#srv/web/owncloud/apps/bookmarks/l10n/lt_LT.js
+#srv/web/owncloud/apps/bookmarks/l10n/lt_LT.json
#srv/web/owncloud/apps/bookmarks/l10n/lt_LT.php
-#srv/web/owncloud/apps/bookmarks/l10n/lt_LT/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/lv
+#srv/web/owncloud/apps/bookmarks/l10n/lv.js
+#srv/web/owncloud/apps/bookmarks/l10n/lv.json
#srv/web/owncloud/apps/bookmarks/l10n/lv.php
-#srv/web/owncloud/apps/bookmarks/l10n/lv/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/mk
+#srv/web/owncloud/apps/bookmarks/l10n/mk.js
+#srv/web/owncloud/apps/bookmarks/l10n/mk.json
#srv/web/owncloud/apps/bookmarks/l10n/mk.php
-#srv/web/owncloud/apps/bookmarks/l10n/mk/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ml
-#srv/web/owncloud/apps/bookmarks/l10n/ml/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ml_IN
-#srv/web/owncloud/apps/bookmarks/l10n/ml_IN/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/mn
-#srv/web/owncloud/apps/bookmarks/l10n/mn/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ms_MY
#srv/web/owncloud/apps/bookmarks/l10n/ms_MY.php
-#srv/web/owncloud/apps/bookmarks/l10n/ms_MY/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/my_MM
#srv/web/owncloud/apps/bookmarks/l10n/my_MM.php
-#srv/web/owncloud/apps/bookmarks/l10n/my_MM/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/nb_NO
+#srv/web/owncloud/apps/bookmarks/l10n/nb_NO.js
+#srv/web/owncloud/apps/bookmarks/l10n/nb_NO.json
#srv/web/owncloud/apps/bookmarks/l10n/nb_NO.php
-#srv/web/owncloud/apps/bookmarks/l10n/nb_NO/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/nds
-#srv/web/owncloud/apps/bookmarks/l10n/nds/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ne
-#srv/web/owncloud/apps/bookmarks/l10n/ne/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/nl
+#srv/web/owncloud/apps/bookmarks/l10n/nl.js
+#srv/web/owncloud/apps/bookmarks/l10n/nl.json
#srv/web/owncloud/apps/bookmarks/l10n/nl.php
-#srv/web/owncloud/apps/bookmarks/l10n/nl/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/nn_NO
+#srv/web/owncloud/apps/bookmarks/l10n/nn_NO.js
+#srv/web/owncloud/apps/bookmarks/l10n/nn_NO.json
#srv/web/owncloud/apps/bookmarks/l10n/nn_NO.php
-#srv/web/owncloud/apps/bookmarks/l10n/nn_NO/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/nqo
-#srv/web/owncloud/apps/bookmarks/l10n/nqo/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/oc
#srv/web/owncloud/apps/bookmarks/l10n/oc.php
-#srv/web/owncloud/apps/bookmarks/l10n/oc/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/or_IN
-#srv/web/owncloud/apps/bookmarks/l10n/or_IN/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/pa
#srv/web/owncloud/apps/bookmarks/l10n/pa.php
-#srv/web/owncloud/apps/bookmarks/l10n/pa/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/pl
+#srv/web/owncloud/apps/bookmarks/l10n/pl.js
+#srv/web/owncloud/apps/bookmarks/l10n/pl.json
#srv/web/owncloud/apps/bookmarks/l10n/pl.php
-#srv/web/owncloud/apps/bookmarks/l10n/pl/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/pl_PL
#srv/web/owncloud/apps/bookmarks/l10n/pl_PL.php
-#srv/web/owncloud/apps/bookmarks/l10n/pl_PL/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/pt_BR
+#srv/web/owncloud/apps/bookmarks/l10n/pt_BR.js
+#srv/web/owncloud/apps/bookmarks/l10n/pt_BR.json
#srv/web/owncloud/apps/bookmarks/l10n/pt_BR.php
-#srv/web/owncloud/apps/bookmarks/l10n/pt_BR/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/pt_PT
+#srv/web/owncloud/apps/bookmarks/l10n/pt_PT.js
+#srv/web/owncloud/apps/bookmarks/l10n/pt_PT.json
#srv/web/owncloud/apps/bookmarks/l10n/pt_PT.php
-#srv/web/owncloud/apps/bookmarks/l10n/pt_PT/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ro
+#srv/web/owncloud/apps/bookmarks/l10n/ro.js
+#srv/web/owncloud/apps/bookmarks/l10n/ro.json
#srv/web/owncloud/apps/bookmarks/l10n/ro.php
-#srv/web/owncloud/apps/bookmarks/l10n/ro/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ru
+#srv/web/owncloud/apps/bookmarks/l10n/ru.js
+#srv/web/owncloud/apps/bookmarks/l10n/ru.json
#srv/web/owncloud/apps/bookmarks/l10n/ru.php
-#srv/web/owncloud/apps/bookmarks/l10n/ru/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ru_RU
#srv/web/owncloud/apps/bookmarks/l10n/ru_RU.php
-#srv/web/owncloud/apps/bookmarks/l10n/ru_RU/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/si_LK
+#srv/web/owncloud/apps/bookmarks/l10n/si_LK.js
+#srv/web/owncloud/apps/bookmarks/l10n/si_LK.json
#srv/web/owncloud/apps/bookmarks/l10n/si_LK.php
-#srv/web/owncloud/apps/bookmarks/l10n/si_LK/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/sk
#srv/web/owncloud/apps/bookmarks/l10n/sk.php
-#srv/web/owncloud/apps/bookmarks/l10n/sk/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/sk_SK
+#srv/web/owncloud/apps/bookmarks/l10n/sk_SK.js
+#srv/web/owncloud/apps/bookmarks/l10n/sk_SK.json
#srv/web/owncloud/apps/bookmarks/l10n/sk_SK.php
-#srv/web/owncloud/apps/bookmarks/l10n/sk_SK/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/sl
+#srv/web/owncloud/apps/bookmarks/l10n/sl.js
+#srv/web/owncloud/apps/bookmarks/l10n/sl.json
#srv/web/owncloud/apps/bookmarks/l10n/sl.php
-#srv/web/owncloud/apps/bookmarks/l10n/sl/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/sq
#srv/web/owncloud/apps/bookmarks/l10n/sq.php
-#srv/web/owncloud/apps/bookmarks/l10n/sq/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/sr
+#srv/web/owncloud/apps/bookmarks/l10n/sr.js
+#srv/web/owncloud/apps/bookmarks/l10n/sr.json
#srv/web/owncloud/apps/bookmarks/l10n/sr.php
-#srv/web/owncloud/apps/bookmarks/l10n/sr/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/sr@latin
#srv/web/owncloud/apps/bookmarks/l10n/sr@latin.php
-#srv/web/owncloud/apps/bookmarks/l10n/sr@latin/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/su
-#srv/web/owncloud/apps/bookmarks/l10n/su/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/sv
+#srv/web/owncloud/apps/bookmarks/l10n/sv.js
+#srv/web/owncloud/apps/bookmarks/l10n/sv.json
#srv/web/owncloud/apps/bookmarks/l10n/sv.php
-#srv/web/owncloud/apps/bookmarks/l10n/sv/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/sw_KE
-#srv/web/owncloud/apps/bookmarks/l10n/sw_KE/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ta_IN
-#srv/web/owncloud/apps/bookmarks/l10n/ta_IN/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ta_LK
+#srv/web/owncloud/apps/bookmarks/l10n/ta_IN.php
+#srv/web/owncloud/apps/bookmarks/l10n/ta_LK.js
+#srv/web/owncloud/apps/bookmarks/l10n/ta_LK.json
#srv/web/owncloud/apps/bookmarks/l10n/ta_LK.php
-#srv/web/owncloud/apps/bookmarks/l10n/ta_LK/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/te
#srv/web/owncloud/apps/bookmarks/l10n/te.php
-#srv/web/owncloud/apps/bookmarks/l10n/te/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/templates
-#srv/web/owncloud/apps/bookmarks/l10n/templates/bookmarks.pot
-#srv/web/owncloud/apps/bookmarks/l10n/th_TH
+#srv/web/owncloud/apps/bookmarks/l10n/th_TH.js
+#srv/web/owncloud/apps/bookmarks/l10n/th_TH.json
#srv/web/owncloud/apps/bookmarks/l10n/th_TH.php
-#srv/web/owncloud/apps/bookmarks/l10n/th_TH/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/tr
+#srv/web/owncloud/apps/bookmarks/l10n/tr.js
+#srv/web/owncloud/apps/bookmarks/l10n/tr.json
#srv/web/owncloud/apps/bookmarks/l10n/tr.php
-#srv/web/owncloud/apps/bookmarks/l10n/tr/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/tzm
-#srv/web/owncloud/apps/bookmarks/l10n/tzm/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ug
+#srv/web/owncloud/apps/bookmarks/l10n/ug.js
+#srv/web/owncloud/apps/bookmarks/l10n/ug.json
#srv/web/owncloud/apps/bookmarks/l10n/ug.php
-#srv/web/owncloud/apps/bookmarks/l10n/ug/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/uk
+#srv/web/owncloud/apps/bookmarks/l10n/uk.js
+#srv/web/owncloud/apps/bookmarks/l10n/uk.json
#srv/web/owncloud/apps/bookmarks/l10n/uk.php
-#srv/web/owncloud/apps/bookmarks/l10n/uk/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ur
-#srv/web/owncloud/apps/bookmarks/l10n/ur/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/ur_PK
#srv/web/owncloud/apps/bookmarks/l10n/ur_PK.php
-#srv/web/owncloud/apps/bookmarks/l10n/ur_PK/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/uz
-#srv/web/owncloud/apps/bookmarks/l10n/uz/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/vi
+#srv/web/owncloud/apps/bookmarks/l10n/vi.js
+#srv/web/owncloud/apps/bookmarks/l10n/vi.json
#srv/web/owncloud/apps/bookmarks/l10n/vi.php
-#srv/web/owncloud/apps/bookmarks/l10n/vi/bookmarks.po
#srv/web/owncloud/apps/bookmarks/l10n/xgettextfiles
-#srv/web/owncloud/apps/bookmarks/l10n/zh_CN
-#srv/web/owncloud/apps/bookmarks/l10n/zh_CN.GB2312
-#srv/web/owncloud/apps/bookmarks/l10n/zh_CN.GB2312.php
-#srv/web/owncloud/apps/bookmarks/l10n/zh_CN.GB2312/bookmarks.po
+#srv/web/owncloud/apps/bookmarks/l10n/zh_CN.js
+#srv/web/owncloud/apps/bookmarks/l10n/zh_CN.json
#srv/web/owncloud/apps/bookmarks/l10n/zh_CN.php
-#srv/web/owncloud/apps/bookmarks/l10n/zh_CN/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/zh_HK
#srv/web/owncloud/apps/bookmarks/l10n/zh_HK.php
-#srv/web/owncloud/apps/bookmarks/l10n/zh_HK/bookmarks.po
-#srv/web/owncloud/apps/bookmarks/l10n/zh_TW
+#srv/web/owncloud/apps/bookmarks/l10n/zh_TW.js
+#srv/web/owncloud/apps/bookmarks/l10n/zh_TW.json
#srv/web/owncloud/apps/bookmarks/l10n/zh_TW.php
-#srv/web/owncloud/apps/bookmarks/l10n/zh_TW/bookmarks.po
#srv/web/owncloud/apps/bookmarks/lib
#srv/web/owncloud/apps/bookmarks/lib/bookmarks.php
#srv/web/owncloud/apps/bookmarks/lib/search.php
#srv/web/owncloud/apps/bookmarks/templates/list.php
#srv/web/owncloud/apps/bookmarks/templates/settings.php
#srv/web/owncloud/apps/bookmarks/tests
-#srv/web/owncloud/apps/bookmarks/tests/lib_bookmark.php
+#srv/web/owncloud/apps/bookmarks/tests/bootstrap.php
+#srv/web/owncloud/apps/bookmarks/tests/lib_bookmark_test.php
+#srv/web/owncloud/apps/bookmarks/tests/phpunit.xml
#srv/web/owncloud/apps/calendar
#srv/web/owncloud/apps/calendar/3rdparty
#srv/web/owncloud/apps/calendar/3rdparty/fullcalendar
#srv/web/owncloud/apps/contacts/lib/jsonresponse.php
#srv/web/owncloud/apps/contacts/lib/middleware
#srv/web/owncloud/apps/contacts/lib/middleware/http.php
-#srv/web/owncloud/apps/contacts/lib/searchprovider.php
+#srv/web/owncloud/apps/contacts/lib/search
+#srv/web/owncloud/apps/contacts/lib/search/contact.php
+#srv/web/owncloud/apps/contacts/lib/search/provider.php
#srv/web/owncloud/apps/contacts/lib/share
#srv/web/owncloud/apps/contacts/lib/share/addressbook.php
#srv/web/owncloud/apps/contacts/lib/share/contact.php
#srv/web/owncloud/apps/files_external/ajax
#srv/web/owncloud/apps/files_external/ajax/addMountPoint.php
#srv/web/owncloud/apps/files_external/ajax/addRootCertificate.php
+#srv/web/owncloud/apps/files_external/ajax/applicable.php
#srv/web/owncloud/apps/files_external/ajax/dropbox.php
#srv/web/owncloud/apps/files_external/ajax/google.php
#srv/web/owncloud/apps/files_external/ajax/removeMountPoint.php
#srv/web/owncloud/apps/files_external/lib/api.php
#srv/web/owncloud/apps/files_external/lib/config.php
#srv/web/owncloud/apps/files_external/lib/dropbox.php
+#srv/web/owncloud/apps/files_external/lib/etagpropagator.php
#srv/web/owncloud/apps/files_external/lib/ftp.php
#srv/web/owncloud/apps/files_external/lib/google.php
#srv/web/owncloud/apps/files_external/lib/owncloud.php
#srv/web/owncloud/apps/files_external/templates/settings.php
#srv/web/owncloud/apps/files_external/tests
#srv/web/owncloud/apps/files_external/tests/amazons3.php
+#srv/web/owncloud/apps/files_external/tests/amazons3migration.php
#srv/web/owncloud/apps/files_external/tests/appSpec.js
#srv/web/owncloud/apps/files_external/tests/config.php
#srv/web/owncloud/apps/files_external/tests/dropbox.php
#srv/web/owncloud/apps/files_external/tests/dynamicmountconfig.php
+#srv/web/owncloud/apps/files_external/tests/etagpropagator.php
#srv/web/owncloud/apps/files_external/tests/ftp.php
#srv/web/owncloud/apps/files_external/tests/google.php
#srv/web/owncloud/apps/files_external/tests/js
#srv/web/owncloud/apps/files_external/tests/js/mountsfilelistSpec.js
#srv/web/owncloud/apps/files_external/tests/mountconfig.php
#srv/web/owncloud/apps/files_external/tests/owncloud.php
+#srv/web/owncloud/apps/files_external/tests/owncloudfunctions.php
#srv/web/owncloud/apps/files_external/tests/sftp.php
#srv/web/owncloud/apps/files_external/tests/smb.php
#srv/web/owncloud/apps/files_external/tests/smbfunctions.php
#srv/web/owncloud/apps/files_sharing/lib/cache.php
#srv/web/owncloud/apps/files_sharing/lib/connector
#srv/web/owncloud/apps/files_sharing/lib/connector/publicauth.php
+#srv/web/owncloud/apps/files_sharing/lib/exceptions.php
#srv/web/owncloud/apps/files_sharing/lib/external
#srv/web/owncloud/apps/files_sharing/lib/external/cache.php
#srv/web/owncloud/apps/files_sharing/lib/external/manager.php
#srv/web/owncloud/apps/files_sharing/templates/settings-admin.php
#srv/web/owncloud/apps/files_sharing/tests
#srv/web/owncloud/apps/files_sharing/tests/api.php
+#srv/web/owncloud/apps/files_sharing/tests/backend.php
#srv/web/owncloud/apps/files_sharing/tests/base.php
#srv/web/owncloud/apps/files_sharing/tests/cache.php
#srv/web/owncloud/apps/files_sharing/tests/externalstorage.php
+#srv/web/owncloud/apps/files_sharing/tests/helper.php
#srv/web/owncloud/apps/files_sharing/tests/js
#srv/web/owncloud/apps/files_sharing/tests/js/appSpec.js
#srv/web/owncloud/apps/files_sharing/tests/js/shareSpec.js
#srv/web/owncloud/apps/updater/admin.php
#srv/web/owncloud/apps/updater/ajax
#srv/web/owncloud/apps/updater/ajax/backup
+#srv/web/owncloud/apps/updater/ajax/backup.php
#srv/web/owncloud/apps/updater/ajax/backup/delete.php
#srv/web/owncloud/apps/updater/ajax/backup/download.php
#srv/web/owncloud/apps/updater/ajax/backup/list.php
+#srv/web/owncloud/apps/updater/ajax/download.php
#srv/web/owncloud/apps/updater/ajax/update.php
#srv/web/owncloud/apps/updater/appinfo
#srv/web/owncloud/apps/updater/appinfo/app.php
#srv/web/owncloud/apps/updater/lib
#srv/web/owncloud/apps/updater/lib/app.php
#srv/web/owncloud/apps/updater/lib/backup.php
+#srv/web/owncloud/apps/updater/lib/collection.php
#srv/web/owncloud/apps/updater/lib/downloader.php
+#srv/web/owncloud/apps/updater/lib/fsexception.php
#srv/web/owncloud/apps/updater/lib/helper.php
#srv/web/owncloud/apps/updater/lib/location
#srv/web/owncloud/apps/updater/lib/location.php
#srv/web/owncloud/apps/updater/lib/location/3rdparty.php
#srv/web/owncloud/apps/updater/lib/location/apps.php
#srv/web/owncloud/apps/updater/lib/location/core.php
+#srv/web/owncloud/apps/updater/lib/permissionexception.php
#srv/web/owncloud/apps/updater/lib/updater.php
#srv/web/owncloud/apps/updater/templates
#srv/web/owncloud/apps/updater/templates/admin.php
#srv/web/owncloud/apps/user_ldap/group_ldap.php
#srv/web/owncloud/apps/user_ldap/group_proxy.php
#srv/web/owncloud/apps/user_ldap/js
+#srv/web/owncloud/apps/user_ldap/js/experiencedAdmin.js
#srv/web/owncloud/apps/user_ldap/js/ldapFilter.js
#srv/web/owncloud/apps/user_ldap/js/settings.js
#srv/web/owncloud/apps/user_ldap/l10n
#srv/web/owncloud/apps/user_ldap/tests/data
#srv/web/owncloud/apps/user_ldap/tests/data/sid.dat
#srv/web/owncloud/apps/user_ldap/tests/group_ldap.php
+#srv/web/owncloud/apps/user_ldap/tests/helper.php
#srv/web/owncloud/apps/user_ldap/tests/user
#srv/web/owncloud/apps/user_ldap/tests/user/manager.php
#srv/web/owncloud/apps/user_ldap/tests/user/user.php
#srv/web/owncloud/core/css/jquery.ocdialog.css
#srv/web/owncloud/core/css/mobile.css
#srv/web/owncloud/core/css/multiselect.css
+#srv/web/owncloud/core/css/select2
+#srv/web/owncloud/core/css/select2/select2-spinner.gif
+#srv/web/owncloud/core/css/select2/select2.css
+#srv/web/owncloud/core/css/select2/select2.png
+#srv/web/owncloud/core/css/select2/select2x2.png
#srv/web/owncloud/core/css/share.css
#srv/web/owncloud/core/css/styles.css
#srv/web/owncloud/core/doc
#srv/web/owncloud/core/doc/admin
#srv/web/owncloud/core/doc/admin/_images
-#srv/web/owncloud/core/doc/admin/_images/100000000000003800000018D49F1CE7.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000050000000DB83B8FA5B.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000950000004412998BE7.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000A800000073F49785A6.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000B600000120706C3C75.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000CD000000ECA8DE7780.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000F1000000F56125BDBA.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000F1000000F6704F46D3.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000F300000068AF0ECD53.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000F40000019A110DD159.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000F5000000675DC5F68C.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000F500000067A8845EF8.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000F60000006754ED2A1E.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000000F6000000685DFB3767.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000012C0000009C444B4720.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000013C0000017D4FC6CEF5.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001400000008A557EF7E3.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001440000005A2989832F.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000160000000DBB2FB0223.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000165000000D3FF2168AB.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000167000000B43E4BF478.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001800000009A9494E037.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001880000007EA4444400.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000018B000000A090F31164.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000018E000000C4BA62B2A3.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000193000001AE9AB8B0A2.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000194000000498325A766.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000194000000FAD39BC0D8.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001980000009271BE0D26.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000019E0000004CD2A0F407.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001A3000000AAFE82893A.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001AC000000477C76808F.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001BF00000012349EAE2F.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001C1000000FE663748B2.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001C9000000AF9C1CE57F.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001CF00000176B0BE1EBC.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001D30000014DC251C948.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001E50000006E3ECDC427.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000001FD000000DF8D2D7546.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000200000000BCCCC35DEB.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002170000004A27056037.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000021C0000004CACBF786C.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002210000002DE3BE7515.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000227000000935D9B1EF6.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000023B000000125381F51B.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000247000000A77440E4D3.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002720000013FB6EDA793.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000027B0000011D10F70F88.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002840000016729388B7F.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000288000001A1D5BE4881.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000289000001A9D7F3941F.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002910000018B31D51F03.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000291000001951B69B9A6.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002950000019EF5732E36.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002950000021E245F6883.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000298000001870B0581FA.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000298000001874D3CA506.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000029B0000018885B5282E.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002A6000000BFBE298238.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002B1000002258C08D304.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002B3000000365E1CD00D.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002BB000000266DB6AD1A.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000002F3000000926CA65D02.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000304000001B964698779.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000336000000F38C3FAF84.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000372000002AF943ADDA0.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003730000002B6865E951.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003A60000011E274A1A28.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003A6000002A9C7A660BE.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003A800000039364066E4.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003B30000021B5EE5D338.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003DF00000071A41D8A1F.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003DF000000D953A456B6.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003E8000001524A147A04.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003EC000000AB60616FA7.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000003FB000002359BAFB40E.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000004010000017E4A6552BC.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000403000001632F0B76F6.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000404000000FCFC13E732.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000004100000005657010336.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000004170000016ACB5E15AE.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000041D0000017D8D1BC4D9.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000042500000163D2B339D5.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000427000000324F58266D.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000042E000001D3EEB9978B.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000042F000000CC3EDDE79E.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000430000000AF9D6E724E.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000043000000164DA0CE8C9.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000043200000169BCD20493.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000044C000002B0B421E27E.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000045800000197FE462F2B.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000462000000D44541CF9A.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000046C000000C2D3E5CF30.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000004770000008AAF3CFFDB.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000004920000028D9C8DC2CB.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000004C0000000795BB2C146.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000004CA000002B52116BE0C.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000004ED000000BE3B9E25D5.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000523000000C6F786381C.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000052500000088DBB95005.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000525000000BE30CF0423.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000527000000A7AB409FE0.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000052F000000C2867B7294.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000530000001410CF0028A.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000053100000142D9A4C916.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000532000000285DDBBF37.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000053A00000067708C8F53.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000552000000BF22E90239.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000557000002E148BAB6D4.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005970000006AE23997C9.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005AF00000074604B1A67.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005B90000007866D92D14.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005BB0000007C1DF71FA7.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005C30000006CAFFAAD61.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005D00000003B29340A7A.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005D50000009458C5EE48.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005E20000009B1BA5A8CF.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005E6000000676902E040.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005EB000000A68BA73E2D.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005EC00000073E678DFEC.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005F30000030F1372448D.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005F70000005F0912E904.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005F70000007E43DB8026.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005FA0000005CE8491B77.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000005FF0000005F35710398.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000006000000005EDA7B96BE.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000060300000065DF96536B.png
-#srv/web/owncloud/core/doc/admin/_images/10000000000006060000006A0106CA0C.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000061A0000006FC014C3A4.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000061D0000007047877972.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000061E0000006BCF9ECC0B.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000062A0000005F61A18950.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000631000000E19D116AA0.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000063F00000090AAE1FA4A.png
-#srv/web/owncloud/core/doc/admin/_images/1000000000000668000002D29EAD9899.png
-#srv/web/owncloud/core/doc/admin/_images/100000000000066D000001AAD8CE8256.png
-#srv/web/owncloud/core/doc/admin/_images/10000201000002FC000001DC2DDAD2F1.png
-#srv/web/owncloud/core/doc/admin/_images/1000020100000359000000A8B848DE68.png
-#srv/web/owncloud/core/doc/admin/_images/10000201000005F90000029D8BA200FB.png
-#srv/web/owncloud/core/doc/admin/_images/custom_mount_config_gui-1.png
-#srv/web/owncloud/core/doc/admin/_images/custom_mount_config_gui-2.png
-#srv/web/owncloud/core/doc/admin/_images/custom_mount_config_gui-3.png
-#srv/web/owncloud/core/doc/admin/_images/custom_mount_config_gui-4.png
-#srv/web/owncloud/core/doc/admin/_images/edit_encrypted_file.png
+#srv/web/owncloud/core/doc/admin/_images/antivirus-app.png
+#srv/web/owncloud/core/doc/admin/_images/antivirus-config.png
+#srv/web/owncloud/core/doc/admin/_images/antivirus-daemon-socket.png
+#srv/web/owncloud/core/doc/admin/_images/antivirus-executable.png
+#srv/web/owncloud/core/doc/admin/_images/antivirus-logging.png
+#srv/web/owncloud/core/doc/admin/_images/create_public_share.png
+#srv/web/owncloud/core/doc/admin/_images/documents_app_enable.png
+#srv/web/owncloud/core/doc/admin/_images/encryption1.png
+#srv/web/owncloud/core/doc/admin/_images/encryption2.png
+#srv/web/owncloud/core/doc/admin/_images/encryption3.png
+#srv/web/owncloud/core/doc/admin/_images/encryption4.png
+#srv/web/owncloud/core/doc/admin/_images/encryption5.png
+#srv/web/owncloud/core/doc/admin/_images/encryption6.png
+#srv/web/owncloud/core/doc/admin/_images/encryption7.png
+#srv/web/owncloud/core/doc/admin/_images/encryption8.png
+#srv/web/owncloud/core/doc/admin/_images/encryption9.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-amazons3.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-app-add.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-app-enable.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-app-local.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-app-usermounts.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox-allowshare.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox-app.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox-configapp.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox-oc.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-ftp.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive-0auth.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive-9.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive-sdk.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive1.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive2.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive5.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive7.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive8.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-smb.png
+#srv/web/owncloud/core/doc/admin/_images/external-storage-webdav.png
#srv/web/owncloud/core/doc/admin/_images/install-wizard-advanced.png
#srv/web/owncloud/core/doc/admin/_images/install-wizard.png
#srv/web/owncloud/core/doc/admin/_images/ldap-advanced-1-connection.png
#srv/web/owncloud/core/doc/admin/_images/ldap-wizard-2-user.png
#srv/web/owncloud/core/doc/admin/_images/ldap-wizard-3-login.png
#srv/web/owncloud/core/doc/admin/_images/ldap-wizard-4-group.png
+#srv/web/owncloud/core/doc/admin/_images/lucene-search-enable.png
+#srv/web/owncloud/core/doc/admin/_images/lucene-search-user.png
#srv/web/owncloud/core/doc/admin/_images/oc_admin_app_page.png
-#srv/web/owncloud/core/doc/admin/_images/oc_admin_user_manage.png
+#srv/web/owncloud/core/doc/admin/_images/preview_images.png
+#srv/web/owncloud/core/doc/admin/_images/remote_shares.png
+#srv/web/owncloud/core/doc/admin/_images/sharing-admin.png
+#srv/web/owncloud/core/doc/admin/_images/sharing-user-local.png
+#srv/web/owncloud/core/doc/admin/_images/sharing-user.png
+#srv/web/owncloud/core/doc/admin/_images/smtp-config-php-sendmail.png
+#srv/web/owncloud/core/doc/admin/_images/smtp-config-smtp.png
+#srv/web/owncloud/core/doc/admin/_images/smtp-config-wizard.png
#srv/web/owncloud/core/doc/admin/_images/ucs-app-center-install.png
#srv/web/owncloud/core/doc/admin/_images/ucs-app-center-module.png
#srv/web/owncloud/core/doc/admin/_images/ucsint.png
#srv/web/owncloud/core/doc/admin/_images/ucsint1.png
#srv/web/owncloud/core/doc/admin/_images/ucsint2.png
#srv/web/owncloud/core/doc/admin/_images/untrusted-domain.png
+#srv/web/owncloud/core/doc/admin/_images/updater-1.png
+#srv/web/owncloud/core/doc/admin/_images/updater-2.png
+#srv/web/owncloud/core/doc/admin/_images/updater-3.png
+#srv/web/owncloud/core/doc/admin/_images/updater-4.png
+#srv/web/owncloud/core/doc/admin/_images/updater-5.png
+#srv/web/owncloud/core/doc/admin/_images/updater-6.png
+#srv/web/owncloud/core/doc/admin/_images/updater-7.png
+#srv/web/owncloud/core/doc/admin/_images/users-config.png
+#srv/web/owncloud/core/doc/admin/_images/users-create.png
+#srv/web/owncloud/core/doc/admin/_images/users-groups.png
#srv/web/owncloud/core/doc/admin/_images/win7features.jpg
#srv/web/owncloud/core/doc/admin/_images/winserverroles.jpg
#srv/web/owncloud/core/doc/admin/_sources
-#srv/web/owncloud/core/doc/admin/_sources/apps
-#srv/web/owncloud/core/doc/admin/_sources/apps/activity
-#srv/web/owncloud/core/doc/admin/_sources/apps/activity/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/admin_dependencies_chk
-#srv/web/owncloud/core/doc/admin/_sources/apps/admin_dependencies_chk/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_antivirus
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_antivirus/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_encryption
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_encryption/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_external
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_external/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_sharing
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_sharing/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_trashbin
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_trashbin/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_versions
-#srv/web/owncloud/core/doc/admin/_sources/apps/files_versions/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/firstrunwizard
-#srv/web/owncloud/core/doc/admin/_sources/apps/firstrunwizard/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/user_ldap
-#srv/web/owncloud/core/doc/admin/_sources/apps/user_ldap/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/apps/viewers
-#srv/web/owncloud/core/doc/admin/_sources/apps/viewers/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/config
-#srv/web/owncloud/core/doc/admin/_sources/config/apps.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/code_locations.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/default_parameters.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/deleted_items.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/logging.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/mail_parameters.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/maintenance.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/miscellaneous.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/previews.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/reverse_proxy_configurations.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/session_info.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/user_experience.txt
-#srv/web/owncloud/core/doc/admin/_sources/config/verification.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration
#srv/web/owncloud/core/doc/admin/_sources/configuration/auth_ldap.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/background_jobs.txt
+#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration-antivirus.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_3rdparty.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_apps.txt
+#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_assets.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_automation.txt
+#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_config_sample_php.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_custom_clients.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_database.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_encryption.txt
+#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_file_sharing.txt
+#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_files_locking.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_knowledgebase.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_language.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_logging.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_mail.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_maintenance.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_preview.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_reverseproxy.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_users.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/configuring_big_file_upload.txt
+#srv/web/owncloud/core/doc/admin/_sources/configuration/configuring_documents.txt
+#srv/web/owncloud/core/doc/admin/_sources/configuration/configuring_search.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/custom_mount_config.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/custom_mount_config_gui.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/custom_user_backend.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/index.txt
+#srv/web/owncloud/core/doc/admin/_sources/configuration/server_to_server_managing.txt
#srv/web/owncloud/core/doc/admin/_sources/configuration/xsendfile.txt
#srv/web/owncloud/core/doc/admin/_sources/contents.txt
-#srv/web/owncloud/core/doc/admin/_sources/cron
-#srv/web/owncloud/core/doc/admin/_sources/cron/index.txt
#srv/web/owncloud/core/doc/admin/_sources/index.txt
#srv/web/owncloud/core/doc/admin/_sources/installation
+#srv/web/owncloud/core/doc/admin/_sources/installation/configuration_hiawatha.txt
+#srv/web/owncloud/core/doc/admin/_sources/installation/configuration_lighttpd.txt
+#srv/web/owncloud/core/doc/admin/_sources/installation/configuration_nginx.txt
+#srv/web/owncloud/core/doc/admin/_sources/installation/configuration_yaws.txt
#srv/web/owncloud/core/doc/admin/_sources/installation/index.txt
#srv/web/owncloud/core/doc/admin/_sources/installation/installation_appliance.txt
#srv/web/owncloud/core/doc/admin/_sources/installation/installation_linux.txt
#srv/web/owncloud/core/doc/admin/_sources/issues/index.txt
#srv/web/owncloud/core/doc/admin/_sources/maintenance
#srv/web/owncloud/core/doc/admin/_sources/maintenance/backup.txt
+#srv/web/owncloud/core/doc/admin/_sources/maintenance/convert_db.txt
+#srv/web/owncloud/core/doc/admin/_sources/maintenance/enable_maintenance.txt
#srv/web/owncloud/core/doc/admin/_sources/maintenance/index.txt
#srv/web/owncloud/core/doc/admin/_sources/maintenance/migrating.txt
#srv/web/owncloud/core/doc/admin/_sources/maintenance/restore.txt
#srv/web/owncloud/core/doc/admin/_sources/maintenance/update.txt
-#srv/web/owncloud/core/doc/admin/_sources/quota
-#srv/web/owncloud/core/doc/admin/_sources/quota/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/sharing_api
-#srv/web/owncloud/core/doc/admin/_sources/sharing_api/create_a_new_share.txt
-#srv/web/owncloud/core/doc/admin/_sources/sharing_api/delete_share.txt
-#srv/web/owncloud/core/doc/admin/_sources/sharing_api/get_all_shares.txt
-#srv/web/owncloud/core/doc/admin/_sources/sharing_api/get_information_about_a_known_share.txt
-#srv/web/owncloud/core/doc/admin/_sources/sharing_api/get_shares_from_a_specific_file_or_folder.txt
-#srv/web/owncloud/core/doc/admin/_sources/sharing_api/index.txt
+#srv/web/owncloud/core/doc/admin/_sources/maintenance/upgrade.txt
+#srv/web/owncloud/core/doc/admin/_sources/whats_new_admin.txt
#srv/web/owncloud/core/doc/admin/_static
#srv/web/owncloud/core/doc/admin/_static/ajax-loader.gif
#srv/web/owncloud/core/doc/admin/_static/basic.css
#srv/web/owncloud/core/doc/admin/_static/up-pressed.png
#srv/web/owncloud/core/doc/admin/_static/up.png
#srv/web/owncloud/core/doc/admin/_static/websupport.js
-#srv/web/owncloud/core/doc/admin/apps
-#srv/web/owncloud/core/doc/admin/apps/activity
-#srv/web/owncloud/core/doc/admin/apps/activity/index.html
-#srv/web/owncloud/core/doc/admin/apps/admin_dependencies_chk
-#srv/web/owncloud/core/doc/admin/apps/admin_dependencies_chk/index.html
-#srv/web/owncloud/core/doc/admin/apps/files_antivirus
-#srv/web/owncloud/core/doc/admin/apps/files_antivirus/index.html
-#srv/web/owncloud/core/doc/admin/apps/files_encryption
-#srv/web/owncloud/core/doc/admin/apps/files_encryption/index.html
-#srv/web/owncloud/core/doc/admin/apps/files_external
-#srv/web/owncloud/core/doc/admin/apps/files_external/index.html
-#srv/web/owncloud/core/doc/admin/apps/files_sharing
-#srv/web/owncloud/core/doc/admin/apps/files_sharing/index.html
-#srv/web/owncloud/core/doc/admin/apps/files_trashbin
-#srv/web/owncloud/core/doc/admin/apps/files_trashbin/index.html
-#srv/web/owncloud/core/doc/admin/apps/files_versions
-#srv/web/owncloud/core/doc/admin/apps/files_versions/index.html
-#srv/web/owncloud/core/doc/admin/apps/firstrunwizard
-#srv/web/owncloud/core/doc/admin/apps/firstrunwizard/index.html
-#srv/web/owncloud/core/doc/admin/apps/index.html
-#srv/web/owncloud/core/doc/admin/apps/user_ldap
-#srv/web/owncloud/core/doc/admin/apps/user_ldap/index.html
-#srv/web/owncloud/core/doc/admin/apps/viewers
-#srv/web/owncloud/core/doc/admin/apps/viewers/index.html
-#srv/web/owncloud/core/doc/admin/config
-#srv/web/owncloud/core/doc/admin/config/apps.html
-#srv/web/owncloud/core/doc/admin/config/code_locations.html
-#srv/web/owncloud/core/doc/admin/config/default_parameters.html
-#srv/web/owncloud/core/doc/admin/config/deleted_items.html
-#srv/web/owncloud/core/doc/admin/config/index.html
-#srv/web/owncloud/core/doc/admin/config/logging.html
-#srv/web/owncloud/core/doc/admin/config/mail_parameters.html
-#srv/web/owncloud/core/doc/admin/config/maintenance.html
-#srv/web/owncloud/core/doc/admin/config/miscellaneous.html
-#srv/web/owncloud/core/doc/admin/config/previews.html
-#srv/web/owncloud/core/doc/admin/config/reverse_proxy_configurations.html
-#srv/web/owncloud/core/doc/admin/config/session_info.html
-#srv/web/owncloud/core/doc/admin/config/user_experience.html
-#srv/web/owncloud/core/doc/admin/config/verification.html
#srv/web/owncloud/core/doc/admin/configuration
#srv/web/owncloud/core/doc/admin/configuration/auth_ldap.html
#srv/web/owncloud/core/doc/admin/configuration/background_jobs.html
+#srv/web/owncloud/core/doc/admin/configuration/configuration-antivirus.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_3rdparty.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_apps.html
+#srv/web/owncloud/core/doc/admin/configuration/configuration_assets.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_automation.html
+#srv/web/owncloud/core/doc/admin/configuration/configuration_config_sample_php.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_custom_clients.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_database.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_encryption.html
+#srv/web/owncloud/core/doc/admin/configuration/configuration_file_sharing.html
+#srv/web/owncloud/core/doc/admin/configuration/configuration_files_locking.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_knowledgebase.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_language.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_logging.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_mail.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_maintenance.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_preview.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_reverseproxy.html
#srv/web/owncloud/core/doc/admin/configuration/configuration_users.html
#srv/web/owncloud/core/doc/admin/configuration/configuring_big_file_upload.html
+#srv/web/owncloud/core/doc/admin/configuration/configuring_documents.html
+#srv/web/owncloud/core/doc/admin/configuration/configuring_search.html
#srv/web/owncloud/core/doc/admin/configuration/custom_mount_config.html
#srv/web/owncloud/core/doc/admin/configuration/custom_mount_config_gui.html
#srv/web/owncloud/core/doc/admin/configuration/custom_user_backend.html
#srv/web/owncloud/core/doc/admin/configuration/index.html
+#srv/web/owncloud/core/doc/admin/configuration/server_to_server_managing.html
#srv/web/owncloud/core/doc/admin/configuration/xsendfile.html
#srv/web/owncloud/core/doc/admin/contents.html
-#srv/web/owncloud/core/doc/admin/cron
-#srv/web/owncloud/core/doc/admin/cron/index.html
#srv/web/owncloud/core/doc/admin/genindex.html
#srv/web/owncloud/core/doc/admin/index.html
#srv/web/owncloud/core/doc/admin/installation
+#srv/web/owncloud/core/doc/admin/installation/configuration_hiawatha.html
+#srv/web/owncloud/core/doc/admin/installation/configuration_lighttpd.html
+#srv/web/owncloud/core/doc/admin/installation/configuration_nginx.html
+#srv/web/owncloud/core/doc/admin/installation/configuration_yaws.html
#srv/web/owncloud/core/doc/admin/installation/index.html
#srv/web/owncloud/core/doc/admin/installation/installation_appliance.html
#srv/web/owncloud/core/doc/admin/installation/installation_linux.html
#srv/web/owncloud/core/doc/admin/issues/index.html
#srv/web/owncloud/core/doc/admin/maintenance
#srv/web/owncloud/core/doc/admin/maintenance/backup.html
+#srv/web/owncloud/core/doc/admin/maintenance/convert_db.html
+#srv/web/owncloud/core/doc/admin/maintenance/enable_maintenance.html
#srv/web/owncloud/core/doc/admin/maintenance/index.html
#srv/web/owncloud/core/doc/admin/maintenance/migrating.html
#srv/web/owncloud/core/doc/admin/maintenance/restore.html
#srv/web/owncloud/core/doc/admin/maintenance/update.html
+#srv/web/owncloud/core/doc/admin/maintenance/upgrade.html
#srv/web/owncloud/core/doc/admin/objects.inv
-#srv/web/owncloud/core/doc/admin/quota
-#srv/web/owncloud/core/doc/admin/quota/index.html
#srv/web/owncloud/core/doc/admin/search.html
#srv/web/owncloud/core/doc/admin/searchindex.js
-#srv/web/owncloud/core/doc/admin/sharing_api
-#srv/web/owncloud/core/doc/admin/sharing_api/create_a_new_share.html
-#srv/web/owncloud/core/doc/admin/sharing_api/delete_share.html
-#srv/web/owncloud/core/doc/admin/sharing_api/get_all_shares.html
-#srv/web/owncloud/core/doc/admin/sharing_api/get_information_about_a_known_share.html
-#srv/web/owncloud/core/doc/admin/sharing_api/get_shares_from_a_specific_file_or_folder.html
-#srv/web/owncloud/core/doc/admin/sharing_api/index.html
+#srv/web/owncloud/core/doc/admin/whats_new_admin.html
#srv/web/owncloud/core/doc/user
#srv/web/owncloud/core/doc/user/_images
-#srv/web/owncloud/core/doc/user/_images/1000000000000163000000E9CDA84C92.png
-#srv/web/owncloud/core/doc/user/_images/1000000000000175000000FAB2A2B294.png
-#srv/web/owncloud/core/doc/user/_images/1000000000000195000000EF7E44082C.png
-#srv/web/owncloud/core/doc/user/_images/10000000000001CE000000F2E2084BA1.png
-#srv/web/owncloud/core/doc/user/_images/100000000000041D0000003D52225C0D.png
-#srv/web/owncloud/core/doc/user/_images/1000000000000453000001BFFCF48776.png
-#srv/web/owncloud/core/doc/user/_images/1000000000000467000002B63162E59B.png
-#srv/web/owncloud/core/doc/user/_images/10000000000004690000026615360BEB.png
-#srv/web/owncloud/core/doc/user/_images/100000000000046D0000015F4B5494A9.png
-#srv/web/owncloud/core/doc/user/_images/100000000000046F000000DEA2BFCD9B.png
-#srv/web/owncloud/core/doc/user/_images/1000000000000470000001B68AE60DD3.png
-#srv/web/owncloud/core/doc/user/_images/10000000000004710000014BBC34499D.png
-#srv/web/owncloud/core/doc/user/_images/100000000000047200000129CB014025.png
-#srv/web/owncloud/core/doc/user/_images/100000000000047700000219A3013A92.png
-#srv/web/owncloud/core/doc/user/_images/1000000000000479000002887E7F48EA.png
-#srv/web/owncloud/core/doc/user/_images/100000000000047A000000B727198874.png
-#srv/web/owncloud/core/doc/user/_images/100000000000047A000000FB86FF2A9A.png
-#srv/web/owncloud/core/doc/user/_images/100000000000047A0000011C6682A254.png
-#srv/web/owncloud/core/doc/user/_images/100000000000048100000245268CDB7A.png
#srv/web/owncloud/core/doc/user/_images/bookmark_addurl.png
#srv/web/owncloud/core/doc/user/_images/bookmark_setting.png
-#srv/web/owncloud/core/doc/user/_images/calendar_createevent.png
+#srv/web/owncloud/core/doc/user/_images/calendar_create_event.png
+#srv/web/owncloud/core/doc/user/_images/calendar_create_event_repeat.png
+#srv/web/owncloud/core/doc/user/_images/calendar_create_event_share.png
+#srv/web/owncloud/core/doc/user/_images/calendar_create_new.png
+#srv/web/owncloud/core/doc/user/_images/calendar_default.png
+#srv/web/owncloud/core/doc/user/_images/calendar_edit_event.png
#srv/web/owncloud/core/doc/user/_images/calendar_export.png
#srv/web/owncloud/core/doc/user/_images/calendar_import.png
-#srv/web/owncloud/core/doc/user/_images/calendar_manage-calendars.png
#srv/web/owncloud/core/doc/user/_images/calendar_newtimezone1.png
+#srv/web/owncloud/core/doc/user/_images/calendar_settings.png
+#srv/web/owncloud/core/doc/user/_images/contact_address_book_add.png
#srv/web/owncloud/core/doc/user/_images/contact_bottombar.png
#srv/web/owncloud/core/doc/user/_images/contact_crop.jpg
-#srv/web/owncloud/core/doc/user/_images/contact_del_ab.png
-#srv/web/owncloud/core/doc/user/_images/contact_emptycontact.png
-#srv/web/owncloud/core/doc/user/_images/contact_picture.jpg
+#srv/web/owncloud/core/doc/user/_images/contact_new.png
+#srv/web/owncloud/core/doc/user/_images/contact_picture.png
+#srv/web/owncloud/core/doc/user/_images/contact_picture_default.png
#srv/web/owncloud/core/doc/user/_images/contact_syncopt.jpg
#srv/web/owncloud/core/doc/user/_images/contact_thunderbird-Symbol_Gear.jpg
#srv/web/owncloud/core/doc/user/_images/contact_thunderbird-Symbol_Impeller.jpg
#srv/web/owncloud/core/doc/user/_images/contact_thunderbird-URL_config.jpg
#srv/web/owncloud/core/doc/user/_images/contact_uploadbutton.png
#srv/web/owncloud/core/doc/user/_images/contact_vcfpick.jpg
+#srv/web/owncloud/core/doc/user/_images/contacts_empty.png
+#srv/web/owncloud/core/doc/user/_images/contacts_settings.png
+#srv/web/owncloud/core/doc/user/_images/deleted_files.png
+#srv/web/owncloud/core/doc/user/_images/documents_personal_settings.png
#srv/web/owncloud/core/doc/user/_images/dolphin_webdav.png
+#srv/web/owncloud/core/doc/user/_images/download.png
+#srv/web/owncloud/core/doc/user/_images/email_address_personal_settings.png
+#srv/web/owncloud/core/doc/user/_images/encryption1.png
+#srv/web/owncloud/core/doc/user/_images/encryption2.png
+#srv/web/owncloud/core/doc/user/_images/encryption3.png
+#srv/web/owncloud/core/doc/user/_images/encryption4.png
+#srv/web/owncloud/core/doc/user/_images/event_export.png
#srv/web/owncloud/core/doc/user/_images/explorer_webdav.png
-#srv/web/owncloud/core/doc/user/_images/external_google_drive_1_sign_in.png
-#srv/web/owncloud/core/doc/user/_images/external_google_drive_2_verify.png
-#srv/web/owncloud/core/doc/user/_images/external_google_drive_3_create_project.png
-#srv/web/owncloud/core/doc/user/_images/external_google_drive_4_enable_api.png
-#srv/web/owncloud/core/doc/user/_images/external_google_drive_5_setup_ownCloud.png
-#srv/web/owncloud/core/doc/user/_images/external_google_drive_6_accept.png
#srv/web/owncloud/core/doc/user/_images/files_versioning.png
+#srv/web/owncloud/core/doc/user/_images/full_name.png
#srv/web/owncloud/core/doc/user/_images/gnome3_nautilus_webdav.png
#srv/web/owncloud/core/doc/user/_images/kdes.png
#srv/web/owncloud/core/doc/user/_images/kdes1.png
#srv/web/owncloud/core/doc/user/_images/kdes6.png
#srv/web/owncloud/core/doc/user/_images/kdes7.png
#srv/web/owncloud/core/doc/user/_images/kdes9.png
+#srv/web/owncloud/core/doc/user/_images/language_personal_settings.png
+#srv/web/owncloud/core/doc/user/_images/notifications_personal_settings.png
#srv/web/owncloud/core/doc/user/_images/oc_connect.png
#srv/web/owncloud/core/doc/user/_images/oc_documents.png
#srv/web/owncloud/core/doc/user/_images/oc_documents_col_edit.png
#srv/web/owncloud/core/doc/user/_images/oc_documents_edit.png
#srv/web/owncloud/core/doc/user/_images/oc_documents_share.png
-#srv/web/owncloud/core/doc/user/_images/oc_files_share.png
-#srv/web/owncloud/core/doc/user/_images/oc_filesweb.png
#srv/web/owncloud/core/doc/user/_images/oc_filesweb_navigate.png
#srv/web/owncloud/core/doc/user/_images/oc_filesweb_new.png
-#srv/web/owncloud/core/doc/user/_images/oc_ui.png
-#srv/web/owncloud/core/doc/user/_images/oc_user_preferences.png
+#srv/web/owncloud/core/doc/user/_images/oc_main_web.png
+#srv/web/owncloud/core/doc/user/_images/oc_main_web_labelled.png
+#srv/web/owncloud/core/doc/user/_images/oc_personal_settings_dropdown.png
#srv/web/owncloud/core/doc/user/_images/osx_webdav1.png
#srv/web/owncloud/core/doc/user/_images/osx_webdav2.png
+#srv/web/owncloud/core/doc/user/_images/password_change.png
+#srv/web/owncloud/core/doc/user/_images/personal_settings.png
+#srv/web/owncloud/core/doc/user/_images/profile_picture_personal_settings.png
+#srv/web/owncloud/core/doc/user/_images/quota1.png
+#srv/web/owncloud/core/doc/user/_images/s2s-add-remote-share.png
+#srv/web/owncloud/core/doc/user/_images/s2s-connect-to-remote-share.png
+#srv/web/owncloud/core/doc/user/_images/s2s-create_public_share.png
+#srv/web/owncloud/core/doc/user/_images/s2s-remote-share-labeled.png
+#srv/web/owncloud/core/doc/user/_images/usage_indicator.png
+#srv/web/owncloud/core/doc/user/_images/users-files.png
+#srv/web/owncloud/core/doc/user/_images/users-overlays-sharepoint.png
+#srv/web/owncloud/core/doc/user/_images/users-overlays-win-net-drive.png
+#srv/web/owncloud/core/doc/user/_images/users-overlays.png
+#srv/web/owncloud/core/doc/user/_images/users-share-local.png
+#srv/web/owncloud/core/doc/user/_images/users-share-local2.png
+#srv/web/owncloud/core/doc/user/_images/users-share-public.png
#srv/web/owncloud/core/doc/user/_sources
#srv/web/owncloud/core/doc/user/_sources/bookmarks.txt
#srv/web/owncloud/core/doc/user/_sources/contents.txt
#srv/web/owncloud/core/doc/user/_sources/files/filesweb.txt
#srv/web/owncloud/core/doc/user/_sources/files/index.txt
#srv/web/owncloud/core/doc/user/_sources/files/quota.txt
+#srv/web/owncloud/core/doc/user/_sources/files/server_to_server_using.txt
#srv/web/owncloud/core/doc/user/_sources/files/sync.txt
#srv/web/owncloud/core/doc/user/_sources/files/versioncontrol.txt
#srv/web/owncloud/core/doc/user/_sources/index.txt
-#srv/web/owncloud/core/doc/user/_sources/migration.txt
+#srv/web/owncloud/core/doc/user/_sources/installing_apps.txt
#srv/web/owncloud/core/doc/user/_sources/pim
#srv/web/owncloud/core/doc/user/_sources/pim/calendar.txt
#srv/web/owncloud/core/doc/user/_sources/pim/contacts.txt
#srv/web/owncloud/core/doc/user/_sources/pim/sync_thunderbird.txt
#srv/web/owncloud/core/doc/user/_sources/pim/troubleshooting.txt
#srv/web/owncloud/core/doc/user/_sources/userpreferences.txt
-#srv/web/owncloud/core/doc/user/_sources/web_guide
-#srv/web/owncloud/core/doc/user/_sources/web_guide/index.txt
#srv/web/owncloud/core/doc/user/_sources/webinterface.txt
+#srv/web/owncloud/core/doc/user/_sources/whats_new.txt
#srv/web/owncloud/core/doc/user/_static
#srv/web/owncloud/core/doc/user/_static/ajax-loader.gif
#srv/web/owncloud/core/doc/user/_static/basic.css
#srv/web/owncloud/core/doc/user/files/filesweb.html
#srv/web/owncloud/core/doc/user/files/index.html
#srv/web/owncloud/core/doc/user/files/quota.html
+#srv/web/owncloud/core/doc/user/files/server_to_server_using.html
#srv/web/owncloud/core/doc/user/files/sync.html
#srv/web/owncloud/core/doc/user/files/versioncontrol.html
#srv/web/owncloud/core/doc/user/genindex.html
#srv/web/owncloud/core/doc/user/index.html
-#srv/web/owncloud/core/doc/user/migration.html
+#srv/web/owncloud/core/doc/user/installing_apps.html
#srv/web/owncloud/core/doc/user/objects.inv
#srv/web/owncloud/core/doc/user/pim
#srv/web/owncloud/core/doc/user/pim/calendar.html
#srv/web/owncloud/core/doc/user/search.html
#srv/web/owncloud/core/doc/user/searchindex.js
#srv/web/owncloud/core/doc/user/userpreferences.html
-#srv/web/owncloud/core/doc/user/web_guide
-#srv/web/owncloud/core/doc/user/web_guide/index.html
#srv/web/owncloud/core/doc/user/webinterface.html
+#srv/web/owncloud/core/doc/user/whats_new.html
#srv/web/owncloud/core/fonts
#srv/web/owncloud/core/fonts/LICENSE.txt
#srv/web/owncloud/core/fonts/OpenSans-Bold.woff
#srv/web/owncloud/core/img/actions/public.svg
#srv/web/owncloud/core/img/actions/rename.png
#srv/web/owncloud/core/img/actions/rename.svg
+#srv/web/owncloud/core/img/actions/search-white.png
+#srv/web/owncloud/core/img/actions/search-white.svg
#srv/web/owncloud/core/img/actions/search.png
#srv/web/owncloud/core/img/actions/search.svg
#srv/web/owncloud/core/img/actions/settings.png
#srv/web/owncloud/core/js/octemplate.js
#srv/web/owncloud/core/js/placeholder.js
#srv/web/owncloud/core/js/placeholders.js
+#srv/web/owncloud/core/js/select2
+#srv/web/owncloud/core/js/select2/LICENSE
+#srv/web/owncloud/core/js/select2/README.md
+#srv/web/owncloud/core/js/select2/bower.json
+#srv/web/owncloud/core/js/select2/component.json
+#srv/web/owncloud/core/js/select2/composer.json
+#srv/web/owncloud/core/js/select2/package.json
+#srv/web/owncloud/core/js/select2/release.sh
+#srv/web/owncloud/core/js/select2/select2-bootstrap.css
+#srv/web/owncloud/core/js/select2/select2.jquery.json
+#srv/web/owncloud/core/js/select2/select2.js
+#srv/web/owncloud/core/js/select2/select2_locale_ar.js
+#srv/web/owncloud/core/js/select2/select2_locale_bg.js
+#srv/web/owncloud/core/js/select2/select2_locale_ca.js
+#srv/web/owncloud/core/js/select2/select2_locale_cs.js
+#srv/web/owncloud/core/js/select2/select2_locale_da.js
+#srv/web/owncloud/core/js/select2/select2_locale_de.js
+#srv/web/owncloud/core/js/select2/select2_locale_el.js
+#srv/web/owncloud/core/js/select2/select2_locale_en.js.template
+#srv/web/owncloud/core/js/select2/select2_locale_es.js
+#srv/web/owncloud/core/js/select2/select2_locale_et.js
+#srv/web/owncloud/core/js/select2/select2_locale_eu.js
+#srv/web/owncloud/core/js/select2/select2_locale_fa.js
+#srv/web/owncloud/core/js/select2/select2_locale_fi.js
+#srv/web/owncloud/core/js/select2/select2_locale_fr.js
+#srv/web/owncloud/core/js/select2/select2_locale_gl.js
+#srv/web/owncloud/core/js/select2/select2_locale_he.js
+#srv/web/owncloud/core/js/select2/select2_locale_hr.js
+#srv/web/owncloud/core/js/select2/select2_locale_hu.js
+#srv/web/owncloud/core/js/select2/select2_locale_id.js
+#srv/web/owncloud/core/js/select2/select2_locale_is.js
+#srv/web/owncloud/core/js/select2/select2_locale_it.js
+#srv/web/owncloud/core/js/select2/select2_locale_ja.js
+#srv/web/owncloud/core/js/select2/select2_locale_ka.js
+#srv/web/owncloud/core/js/select2/select2_locale_ko.js
+#srv/web/owncloud/core/js/select2/select2_locale_lt.js
+#srv/web/owncloud/core/js/select2/select2_locale_lv.js
+#srv/web/owncloud/core/js/select2/select2_locale_mk.js
+#srv/web/owncloud/core/js/select2/select2_locale_ms.js
+#srv/web/owncloud/core/js/select2/select2_locale_nl.js
+#srv/web/owncloud/core/js/select2/select2_locale_no.js
+#srv/web/owncloud/core/js/select2/select2_locale_pl.js
+#srv/web/owncloud/core/js/select2/select2_locale_pt-BR.js
+#srv/web/owncloud/core/js/select2/select2_locale_pt-PT.js
+#srv/web/owncloud/core/js/select2/select2_locale_ro.js
+#srv/web/owncloud/core/js/select2/select2_locale_rs.js
+#srv/web/owncloud/core/js/select2/select2_locale_ru.js
+#srv/web/owncloud/core/js/select2/select2_locale_sk.js
+#srv/web/owncloud/core/js/select2/select2_locale_sv.js
+#srv/web/owncloud/core/js/select2/select2_locale_th.js
+#srv/web/owncloud/core/js/select2/select2_locale_tr.js
+#srv/web/owncloud/core/js/select2/select2_locale_uk.js
+#srv/web/owncloud/core/js/select2/select2_locale_vi.js
+#srv/web/owncloud/core/js/select2/select2_locale_zh-CN.js
+#srv/web/owncloud/core/js/select2/select2_locale_zh-TW.js
#srv/web/owncloud/core/js/setup.js
+#srv/web/owncloud/core/js/setupchecks.js
#srv/web/owncloud/core/js/share.js
#srv/web/owncloud/core/js/singleselect.js
#srv/web/owncloud/core/js/snap.js
#srv/web/owncloud/core/templates/message.html
#srv/web/owncloud/core/templates/singleuser.user.php
#srv/web/owncloud/core/templates/tags.html
+#srv/web/owncloud/core/templates/untrustedDomain.php
#srv/web/owncloud/core/templates/update.admin.php
#srv/web/owncloud/core/templates/update.user.php
#srv/web/owncloud/cron.php
#srv/web/owncloud/lib/private/connector/sabre/quotaplugin.php
#srv/web/owncloud/lib/private/connector/sabre/request.php
#srv/web/owncloud/lib/private/connector/sabre/server.php
+#srv/web/owncloud/lib/private/contacts
+#srv/web/owncloud/lib/private/contacts/localaddressbook.php
#srv/web/owncloud/lib/private/contactsmanager.php
#srv/web/owncloud/lib/private/davclient.php
#srv/web/owncloud/lib/private/db
#srv/web/owncloud/lib/private/db.php
#srv/web/owncloud/lib/private/db/adapter.php
+#srv/web/owncloud/lib/private/db/adaptermysql.php
#srv/web/owncloud/lib/private/db/adapteroci8.php
#srv/web/owncloud/lib/private/db/adapterpgsql.php
#srv/web/owncloud/lib/private/db/adaptersqlite.php
#srv/web/owncloud/lib/private/db/mdb2schemawriter.php
#srv/web/owncloud/lib/private/db/migrationexception.php
#srv/web/owncloud/lib/private/db/migrator.php
+#srv/web/owncloud/lib/private/db/mssqlmigrator.php
#srv/web/owncloud/lib/private/db/mysqlmigrator.php
#srv/web/owncloud/lib/private/db/nocheckmigrator.php
#srv/web/owncloud/lib/private/db/oracleconnection.php
#srv/web/owncloud/lib/private/db/oraclemigrator.php
#srv/web/owncloud/lib/private/db/pgsqltools.php
#srv/web/owncloud/lib/private/db/sqlitemigrator.php
+#srv/web/owncloud/lib/private/db/sqlitesessioninit.php
#srv/web/owncloud/lib/private/db/statementwrapper.php
#srv/web/owncloud/lib/private/defaults.php
#srv/web/owncloud/lib/private/eventsource.php
#srv/web/owncloud/lib/private/hooks/forwardingemitter.php
#srv/web/owncloud/lib/private/hooks/legacyemitter.php
#srv/web/owncloud/lib/private/hooks/publicemitter.php
+#srv/web/owncloud/lib/private/httphelper.php
#srv/web/owncloud/lib/private/image.php
#srv/web/owncloud/lib/private/installer.php
#srv/web/owncloud/lib/private/json.php
#srv/web/owncloud/lib/private/migration/provider.php
#srv/web/owncloud/lib/private/mimetypes.list.php
#srv/web/owncloud/lib/private/navigationmanager.php
+#srv/web/owncloud/lib/private/needsupdateexception.php
#srv/web/owncloud/lib/private/notsquareexception.php
#srv/web/owncloud/lib/private/ocs
#srv/web/owncloud/lib/private/ocs.php
#srv/web/owncloud/lib/private/preview/provider.php
#srv/web/owncloud/lib/private/preview/svg.php
#srv/web/owncloud/lib/private/preview/txt.php
-#srv/web/owncloud/lib/private/preview/unknown.php
#srv/web/owncloud/lib/private/previewmanager.php
#srv/web/owncloud/lib/private/repair.php
#srv/web/owncloud/lib/private/repairstep.php
#srv/web/owncloud/lib/private/search/result/folder.php
#srv/web/owncloud/lib/private/search/result/image.php
#srv/web/owncloud/lib/private/server.php
+#srv/web/owncloud/lib/private/serviceunavailableexception.php
#srv/web/owncloud/lib/private/session
#srv/web/owncloud/lib/private/session/internal.php
#srv/web/owncloud/lib/private/session/memory.php
#srv/web/owncloud/lib/public/icontainer.php
#srv/web/owncloud/lib/public/idb.php
#srv/web/owncloud/lib/public/idbconnection.php
+#srv/web/owncloud/lib/public/igroup.php
+#srv/web/owncloud/lib/public/igroupmanager.php
#srv/web/owncloud/lib/public/ihelper.php
#srv/web/owncloud/lib/public/il10n.php
#srv/web/owncloud/lib/public/ilogger.php
#srv/web/owncloud/lib/repair
#srv/web/owncloud/lib/repair/collation.php
#srv/web/owncloud/lib/repair/innodb.php
+#srv/web/owncloud/lib/repair/preview.php
#srv/web/owncloud/lib/repair/repairmimetypes.php
+#srv/web/owncloud/lib/repair/searchlucenetables.php
#srv/web/owncloud/occ
#srv/web/owncloud/ocs
#srv/web/owncloud/ocs/providers.php
#srv/web/owncloud/search/templates
#srv/web/owncloud/search/templates/part.results.php
#srv/web/owncloud/settings
-#srv/web/owncloud/settings/admin
#srv/web/owncloud/settings/admin.php
-#srv/web/owncloud/settings/admin/controller.php
#srv/web/owncloud/settings/ajax
#srv/web/owncloud/settings/ajax/apps
#srv/web/owncloud/settings/ajax/apps/ocs.php
#srv/web/owncloud/settings/ajax/changedisplayname.php
+#srv/web/owncloud/settings/ajax/checksetup.php
#srv/web/owncloud/settings/ajax/creategroup.php
#srv/web/owncloud/settings/ajax/createuser.php
#srv/web/owncloud/settings/ajax/decryptall.php
#srv/web/owncloud/settings/ajax/deletekeys.php
#srv/web/owncloud/settings/ajax/disableapp.php
#srv/web/owncloud/settings/ajax/enableapp.php
-#srv/web/owncloud/settings/ajax/excludegroups.php
+#srv/web/owncloud/settings/ajax/geteveryonecount.php
#srv/web/owncloud/settings/ajax/getlog.php
#srv/web/owncloud/settings/ajax/grouplist.php
#srv/web/owncloud/settings/ajax/installapp.php
#srv/web/owncloud/settings/ajax/uninstallapp.php
#srv/web/owncloud/settings/ajax/updateapp.php
#srv/web/owncloud/settings/ajax/userlist.php
+#srv/web/owncloud/settings/application.php
#srv/web/owncloud/settings/apps.php
#srv/web/owncloud/settings/changepassword
#srv/web/owncloud/settings/changepassword/controller.php
+#srv/web/owncloud/settings/controller
+#srv/web/owncloud/settings/controller/mailsettingscontroller.php
#srv/web/owncloud/settings/css
#srv/web/owncloud/settings/css/settings.css
#srv/web/owncloud/settings/help.php
#srv/web/owncloud/settings/js/apps.js
#srv/web/owncloud/settings/js/log.js
#srv/web/owncloud/settings/js/personal.js
+#srv/web/owncloud/settings/js/settings.js
#srv/web/owncloud/settings/js/users
#srv/web/owncloud/settings/js/users/deleteHandler.js
#srv/web/owncloud/settings/js/users/filter.js
#srv/web/owncloud/settings/templates/users/part.grouplist.php
#srv/web/owncloud/settings/templates/users/part.setquota.php
#srv/web/owncloud/settings/templates/users/part.userlist.php
+#srv/web/owncloud/settings/tests
+#srv/web/owncloud/settings/tests/js
+#srv/web/owncloud/settings/tests/js/users
+#srv/web/owncloud/settings/tests/js/users/deleteHandlerSpec.js
#srv/web/owncloud/settings/users.php
#srv/web/owncloud/status.php
#srv/web/owncloud/themes
+++ /dev/null
-etc/rc.d/init.d/teamspeak
-opt/teamspeak
-var/ipfire/backup/addons/includes/teamspeak
--- /dev/null
+# Options for the charon IKE daemon.
+charon {
+ # Accept unencrypted ID and HASH payloads in IKEv1 Main Mode.
+ accept_unencrypted_mainmode_messages = yes
+
+ # Maximum number of half-open IKE_SAs for a single peer IP.
+ # block_threshold = 5
+
+ # Whether relations in validated certificate chains should be cached in
+ # memory.
+ # cert_cache = yes
+
+ # Send Cisco Unity vendor ID payload (IKEv1 only).
+ cisco_unity = yes
+
+ # Close the IKE_SA if setup of the CHILD_SA along with IKE_AUTH failed.
+ # close_ike_on_child_failure = no
+
+ # Number of half-open IKE_SAs that activate the cookie mechanism.
+ # cookie_threshold = 10
+
+ # Use ANSI X9.42 DH exponent size or optimum size matched to cryptographic
+ # strength.
+ # dh_exponent_ansi_x9_42 = yes
+
+ # DNS server assigned to peer via configuration payload (CP).
+ # dns1 =
+
+ # DNS server assigned to peer via configuration payload (CP).
+ # dns2 =
+
+ # Enable Denial of Service protection using cookies and aggressiveness
+ # checks.
+ # dos_protection = yes
+
+ # Compliance with the errata for RFC 4753.
+ # ecp_x_coordinate_only = yes
+
+ # Free objects during authentication (might conflict with plugins).
+ # flush_auth_cfg = no
+
+ # Maximum size (complete IP datagram size in bytes) of a sent IKE fragment
+ # when using proprietary IKEv1 or standardized IKEv2 fragmentation (0 for
+ # address family specific default values). If specified this limit is
+ # used for both IPv4 and IPv6.
+ # fragment_size = 0
+
+ # Name of the group the daemon changes to after startup.
+ # group =
+
+ # Timeout in seconds for connecting IKE_SAs (also see IKE_SA_INIT DROPPING).
+ # half_open_timeout = 30
+
+ # Enable hash and URL support.
+ # hash_and_url = no
+
+ # Allow IKEv1 Aggressive Mode with pre-shared keys as responder.
+ # i_dont_care_about_security_and_use_aggressive_mode_psk = no
+
+ # A space-separated list of routing tables to be excluded from route
+ # lookups.
+ # ignore_routing_tables =
+
+ # Maximum number of IKE_SAs that can be established at the same time before
+ # new connection attempts are blocked.
+ # ikesa_limit = 0
+
+ # Number of exclusively locked segments in the hash table.
+ ikesa_table_segments = 4
+
+ # Size of the IKE_SA hash table.
+ ikesa_table_size = 32
+
+ # Whether to close IKE_SA if the only CHILD_SA closed due to inactivity.
+ # inactivity_close_ike = no
+
+ # Limit new connections based on the current number of half open IKE_SAs,
+ # see IKE_SA_INIT DROPPING in strongswan.conf(5).
+ init_limit_half_open = 1000
+
+ # Limit new connections based on the number of queued jobs.
+ # init_limit_job_load = 0
+
+ # Causes charon daemon to ignore IKE initiation requests.
+ # initiator_only = no
+
+ # Install routes into a separate routing table for established IPsec
+ # tunnels.
+ # install_routes = yes
+
+ # Install virtual IP addresses.
+ # install_virtual_ip = yes
+
+ # The name of the interface on which virtual IP addresses should be
+ # installed.
+ # install_virtual_ip_on =
+
+ # Check daemon, libstrongswan and plugin integrity at startup.
+ # integrity_test = no
+
+ # A comma-separated list of network interfaces that should be ignored, if
+ # interfaces_use is specified this option has no effect.
+ # interfaces_ignore =
+
+ # A comma-separated list of network interfaces that should be used by
+ # charon. All other interfaces are ignored.
+ # interfaces_use =
+
+ # NAT keep alive interval.
+ # keep_alive = 20s
+
+ # Plugins to load in the IKE daemon charon.
+ # load =
+
+ # Determine plugins to load via each plugin's load option.
+ # load_modular = no
+
+ # Maximum packet size accepted by charon.
+ # max_packet = 10000
+
+ # Enable multiple authentication exchanges (RFC 4739).
+ # multiple_authentication = yes
+
+ # WINS servers assigned to peer via configuration payload (CP).
+ # nbns1 =
+
+ # WINS servers assigned to peer via configuration payload (CP).
+ # nbns2 =
+
+ # UDP port used locally. If set to 0 a random port will be allocated.
+ # port = 500
+
+ # UDP port used locally in case of NAT-T. If set to 0 a random port will be
+ # allocated. Has to be different from charon.port, otherwise a random port
+ # will be allocated.
+ # port_nat_t = 4500
+
+ # By default public IPv6 addresses are preferred over temporary ones (RFC
+ # 4941), to make connections more stable. Enable this option to reverse
+ # this.
+ # prefer_temporary_addrs = no
+
+ # Process RTM_NEWROUTE and RTM_DELROUTE events.
+ # process_route = yes
+
+ # Delay in ms for receiving packets, to simulate larger RTT.
+ # receive_delay = 0
+
+ # Delay request messages.
+ # receive_delay_request = yes
+
+ # Delay response messages.
+ # receive_delay_response = yes
+
+ # Specific IKEv2 message type to delay, 0 for any.
+ # receive_delay_type = 0
+
+ # Size of the AH/ESP replay window, in packets.
+ # replay_window = 32
+
+ # Base to use for calculating exponential back off, see IKEv2 RETRANSMISSION
+ # in strongswan.conf(5).
+ # retransmit_base = 1.8
+
+ # Timeout in seconds before sending first retransmit.
+ # retransmit_timeout = 4.0
+
+ # Number of times to retransmit a packet before giving up.
+ # retransmit_tries = 5
+
+ # Interval to use when retrying to initiate an IKE_SA (e.g. if DNS
+ # resolution failed), 0 to disable retries.
+ # retry_initiate_interval = 0
+
+ # Initiate CHILD_SA within existing IKE_SAs.
+ # reuse_ikesa = yes
+
+ # Numerical routing table to install routes to.
+ # routing_table =
+
+ # Priority of the routing table.
+ # routing_table_prio =
+
+ # Delay in ms for sending packets, to simulate larger RTT.
+ # send_delay = 0
+
+ # Delay request messages.
+ # send_delay_request = yes
+
+ # Delay response messages.
+ # send_delay_response = yes
+
+ # Specific IKEv2 message type to delay, 0 for any.
+ # send_delay_type = 0
+
+ # Send strongSwan vendor ID payload
+ # send_vendor_id = no
+
+ # Number of worker threads in charon.
+ # threads = 16
+
+ # Name of the user the daemon changes to after startup.
+ # user =
+
+ crypto_test {
+
+ # Benchmark crypto algorithms and order them by efficiency.
+ # bench = no
+
+ # Buffer size used for crypto benchmark.
+ # bench_size = 1024
+
+ # Number of iterations to test each algorithm.
+ # bench_time = 50
+
+ # Test crypto algorithms during registration (requires test vectors
+ # provided by the test-vectors plugin).
+ # on_add = no
+
+ # Test crypto algorithms on each crypto primitive instantiation.
+ # on_create = no
+
+ # Strictly require at least one test vector to enable an algorithm.
+ # required = no
+
+ # Whether to test RNG with TRUE quality; requires a lot of entropy.
+ # rng_true = no
+
+ }
+
+ host_resolver {
+
+ # Maximum number of concurrent resolver threads (they are terminated if
+ # unused).
+ # max_threads = 3
+
+ # Minimum number of resolver threads to keep around.
+ # min_threads = 0
+
+ }
+
+ leak_detective {
+
+ # Includes source file names and line numbers in leak detective output.
+ # detailed = yes
+
+ # Threshold in bytes for leaks to be reported (0 to report all).
+ # usage_threshold = 10240
+
+ # Threshold in number of allocations for leaks to be reported (0 to
+ # report all).
+ # usage_threshold_count = 0
+
+ }
+
+ processor {
+
+ # Section to configure the number of reserved threads per priority class
+ # see JOB PRIORITY MANAGEMENT in strongswan.conf(5).
+ priority_threads {
+
+ }
+
+ }
+
+ # Section containing a list of scripts (name = path) that are executed when
+ # the daemon is started.
+ start-scripts {
+
+ }
+
+ # Section containing a list of scripts (name = path) that are executed when
+ # the daemon is terminated.
+ stop-scripts {
+
+ }
+
+ tls {
+
+ # List of TLS encryption ciphers.
+ # cipher =
+
+ # List of TLS key exchange methods.
+ # key_exchange =
+
+ # List of TLS MAC algorithms.
+ # mac =
+
+ # List of TLS cipher suites.
+ # suites =
+
+ }
+
+ x509 {
+
+ # Discard certificates with unsupported or unknown critical extensions.
+ # enforce_critical = yes
+
+ }
+
+}
+
+++ /dev/null
-setenv initrd_high 90000000
-fatload mmc 0:1 0x82000000 zImage-ipfire-multi
-#fatload mmc 0:1 0x85000000 uInit-ipfire-multi
-fatload mmc 0:1 ${fdtaddr} omap4-${board_name}.dtb
-setenv bootargs video=800x600 console=tty1 rootwait smsc95xx.macaddr=$usbethaddr root=/dev/mmcblk0p3 ro
-#bootz 0x82000000 0x85000000 ${fdtaddr}
-bootz 0x82000000 - ${fdtaddr}
+++ /dev/null
-mkimage -A arm -T script -C none -d boot.script boot.scr
--- /dev/null
+KVER=xxxKVERxxx
+DTBSUNXI=sun7i-a20-bananapi.dtb
+uenvcmd=if test "$board" = "panda" ;then run bootpanda; else run bootsunxi; fi;
+bootpanda=setenv initrd_high 90000000; fatload mmc 0:1 0x82000000 zImage-ipfire-multi; fatload mmc 0:1 ${fdtaddr} dtb-${KVER}-ipfire-multi/${fdtfile}; setenv bootargs video=800x600 console=tty1 rootwait smsc95xx.macaddr=$usbethaddr root=/dev/mmcblk0p3; bootz 0x82000000 - ${fdtaddr};
+bootsunxi=setenv fdt_high ffffffff; fatload mmc 0:1 0x46000000 zImage-ipfire-multi; fatload mmc 0:1 0x49000000 dtb-${KVER}-ipfire-multi/${DTBSUNXI}; fatload mmc 0:1 0x49100000 uInit-ipfire-multi; setenv bootargs console=ttyS0,115200n8 rootwait root=/dev/mmcblk0p3 rootwait; bootz 0x46000000 0x49100000 0x49000000;
--- /dev/null
+# Call a script that checks for the right name of the new device.
+# If it matches the configuration it will be renamed accordingly.
+ACTION=="add", SUBSYSTEM=="net", PROGRAM="/lib/udev/network-hotplug-rename", RESULT=="?*", NAME="$result"
--- /dev/null
+#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2015 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+# Check if all appropriate variables are set
+[ -n "${INTERFACE}" ] || exit 2
+
+# Ignore virtual interfaces, etc.
+case "${INTERFACE}" in
+ lo)
+ exit 0
+ ;;
+ tun*)
+ exit 0
+ ;;
+ ppp*)
+ exit 0
+ ;;
+esac
+
+# Check if INTERFACE actually exists
+[ -d "/sys/class/net/${INTERFACE}" ] || exit 1
+
+# If the network configuration is not readable,
+# we cannot go on.
+if [ ! -r "/var/ipfire/ethernet/settings" ]; then
+ exit 1
+fi
+
+# Read network settings
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+
+# Standard zones
+ZONES="RED GREEN ORANGE BLUE"
+
+# Determine the address of INTERFACE
+ADDRESS="$(</sys/class/net/${INTERFACE}/address)"
+
+# Walk through all zones and find the matching interface
+for zone in ${ZONES}; do
+ address="${zone}_MACADDR"
+ device="${zone}_DEV"
+
+ # Skip if address or device is unset
+ [ -n "${!address}" -a -n "${!device}" ] || continue
+
+ # If a matching interface has been found we will
+ # print the name to which udev will rename it.
+ if [ "${ADDRESS}" = "${!address}" ]; then
+ echo "${!device}"
+ exit 0
+ fi
+done
+
+# If we get here we have not found a matching device,
+# but we won't return an error any way. The new device
+# will remain with the previous name.
+exit 0
- look what is going on: "xm top" or "xm list"
This script can also build a Citrix XenCenter xva image. (Need xz-aware
-xen version. Tested with Citrix Xen Server 6.2.5 beta)
+xen version. Tested with Citrix Xen Server 6.5)
- run "XEN_IMG_TYPE=xva bash xen-image-maker.sh" to build an xva image.
-- import the vm with "xe vm-import file=ipfire.xva"
+- import the vm with "xe vm-import filename=ipfire.xva"
mount -o loop $IMGvar $MNThdd/var
# Install IPFire without kernel modules
-xz -d < $ISODIR/$SNAME-$VERSION.tlz > $TMPDIR/$SNAME-$VERSION.tar
+xz -d < $ISODIR/distro.img > $TMPDIR/$SNAME-$VERSION.tar
tar -C $MNThdd/ -xvf $TMPDIR/$SNAME-$VERSION.tar \
--exclude=lib/modules* --exclude=boot* --numeric-owner
echo "timeout 10" > $MNThdd/boot/grub/grub.conf
echo "default 0" >> $MNThdd/boot/grub/grub.conf
echo "title IPFire ($KERN_TYPE-kernel)" >> $MNThdd/boot/grub/grub.conf
-echo " kernel /vmlinuz-$KVER-ipfire-$KERN_TYPE root=/dev/$P3 rootdelay=10 panic=10 console=$CONSOLE ro" \
+echo " kernel /vmlinuz-$KVER-ipfire-$KERN_TYPE root=/dev/$P3 rootdelay=10 panic=10 console=$CONSOLE" \
>> $MNThdd/boot/grub/grub.conf
-echo " initrd /ipfirerd-$KVER-$KERN_TYPE.img" >> $MNThdd/boot/grub/grub.conf
+echo " initrd /initramfs-$KVER-ipfire-$KERN_TYPE.img" >> $MNThdd/boot/grub/grub.conf
echo "# savedefault 0" >> $MNThdd/boot/grub/grub.conf
ln -s grub.conf $MNThdd/boot/grub/menu.lst
mount --bind /dev $MNThdd/dev
mount --bind /sys $MNThdd/sys
chroot $MNThdd /usr/bin/perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
-sed -i -e "s|DEVICE1|/dev/$P1|g" $MNThdd/etc/fstab
-sed -i -e "s|DEVICE2|/dev/$P2|g" $MNThdd/etc/fstab
-sed -i -e "s|DEVICE3|/dev/$P3|g" $MNThdd/etc/fstab
-sed -i -e "s|DEVICE4|/dev/$P4|g" $MNThdd/etc/fstab
-sed -i -e "s|FSTYPE|$FSTYPE|g" $MNThdd/etc/fstab
+# create fstab
+echo "/dev/$P1 /boot auto defaults 1 3" > $MNThdd/etc/fstab
+echo "/dev/$P2 swap swap defaults 0 0" >> $MNThdd/etc/fstab
+echo "/dev/$P3 / auto defaults 1 1" >> $MNThdd/etc/fstab
+echo "/dev/$P4 /var auto defaults 1 2" >> $MNThdd/etc/fstab
+
#Remove root / fstab check
rm -rf $MNThdd/etc/rc.d/rcsysinit.d/S19checkfstab
}
my $sip_colour = ipcolour($sip);
- my $dip_colour = ipcolour($dip);
+ # use colour of destination network for DNAT
+ my $dip_colour = $dip ne $dip_ret ? ipcolour($dip_ret) : ipcolour($dip);
my $sserv = '';
if ($sport < 1024) {
my %aliases=();
my %optionsfw=();
my %ifaces=();
+my %rulehash=();
my @PROTOCOLS = ("TCP", "UDP", "ICMP", "IGMP", "AH", "ESP", "GRE","IPv6","IPIP");
&General::readhasharray("$configfwdfw", \%configfwdfw);
&General::readhasharray("$configinput", \%configinputfw);
&General::readhasharray("$configoutgoing", \%configoutgoingfw);
+ my $maxkey;
#Set Variables according to the JQuery code in protocol section
if ($fwdfwsettings{'PROT'} eq 'TCP' || $fwdfwsettings{'PROT'} eq 'UDP')
{
if( $fwdfwsettings{'grp1'} eq 'ipfire_src' && $fwdfwsettings{'grp2'} eq 'ipfire'){
$errormessage=$Lang::tr{'fwdfw err same'};
}
- #INPUT part
- if($fwdfwsettings{'grp2'} eq 'ipfire' && $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'ORANGE'){
+ # INPUT part
+ if ($fwdfwsettings{'grp2'} eq 'ipfire' && $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'ORANGE'){
$fwdfwsettings{'config'}=$configinput;
$fwdfwsettings{'chain'} = 'INPUTFW';
- my $maxkey=&General::findhasharraykey(\%configinputfw);
- #check if we have an identical rule already
- if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
- foreach my $key (sort keys %configinputfw){
- if ( "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
- eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31],$configinputfw{$key}[32],$configinputfw{$key}[33],$configinputfw{$key}[34],$configinputfw{$key}[35],$configinputfw{$key}[36]"){
- $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
- if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
- $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
- }
- if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && &validremark($fwdfwsettings{'ruleremark'})){
- $errormessage='';
- }
- if ($fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'}){
- $fwdfwsettings{'nosave'} = 'on';
- }
- }
- }
- }
- #check Rulepos on new Rule
- if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
- $fwdfwsettings{'oldrulenumber'}=$maxkey;
- foreach my $key (sort keys %configinputfw){
- if ( "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
- eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31],$configinputfw{$key}[32],$configinputfw{$key}[33],$configinputfw{$key}[34],$configinputfw{$key}[35],$configinputfw{$key}[36]"){
- $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
- }
- }
- }
- #check if we just close a rule
- if( $fwdfwsettings{'oldgrp1a'} eq $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'} ) {
- if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
- $errormessage='';
- $fwdfwsettings{'nosave2'} = 'on';
- }
- }
- if (!$errormessage){
- if($fwdfwsettings{'nosave2'} ne 'on'){
- &saverule(\%configinputfw,$configinput);
- }
- }
- }elsif($fwdfwsettings{'grp1'} eq 'ipfire_src' ){
+ $maxkey=&General::findhasharraykey(\%configinputfw);
+ %rulehash=%configinputfw;
+ }elsif ($fwdfwsettings{'grp1'} eq 'ipfire_src' ){
# OUTGOING PART
$fwdfwsettings{'config'}=$configoutgoing;
$fwdfwsettings{'chain'} = 'OUTGOINGFW';
- my $maxkey=&General::findhasharraykey(\%configoutgoingfw);
- if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
- foreach my $key (sort keys %configoutgoingfw){
- if ( "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
- eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31],$configoutgoingfw{$key}[32],$configoutgoingfw{$key}[33],$configoutgoingfw{$key}[34],$configoutgoingfw{$key}[35],$configoutgoingfw{$key}[36]"){
- $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
- if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
- $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
- }
- if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && &validremark($fwdfwsettings{'ruleremark'})){
- $errormessage='';
- }
- if ($fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'}){
- $fwdfwsettings{'nosave'} = 'on';
- }
- }
- }
- }
- #check Rulepos on new Rule
- if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
- $fwdfwsettings{'oldrulenumber'}=$maxkey;
- foreach my $key (sort keys %configoutgoingfw){
- if ( "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
- eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31],$configoutgoingfw{$key}[32],$configoutgoingfw{$key}[33],$configoutgoingfw{$key}[34],$configoutgoingfw{$key}[35],$configoutgoingfw{$key}[36]"){
- $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
- }
- }
- }
- #check if we just close a rule
- if( $fwdfwsettings{'oldgrp1a'} eq $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'} ) {
- if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
- $fwdfwsettings{'nosave2'} = 'on';
- $errormessage='';
- }
- }
- #increase counters
- if (!$errormessage){
- if ($fwdfwsettings{'nosave2'} ne 'on'){
- &saverule(\%configoutgoingfw,$configoutgoing);
- }
- }
- }else{
- #FORWARD PART
+ $maxkey=&General::findhasharraykey(\%configoutgoingfw);
+ %rulehash=%configoutgoingfw;
+ }else {
+ # FORWARD PART
$fwdfwsettings{'config'}=$configfwdfw;
$fwdfwsettings{'chain'} = 'FORWARDFW';
- my $maxkey=&General::findhasharraykey(\%configfwdfw);
- if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
- #check if we have an identical rule already
- foreach my $key (sort keys %configfwdfw){
- if ( "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
- eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31],$configfwdfw{$key}[32],$configfwdfw{$key}[33],$configfwdfw{$key}[34],$configfwdfw{$key}[35],$configfwdfw{$key}[36]"){
- $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
- if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
- $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
- }
- if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && &validremark($fwdfwsettings{'ruleremark'})){
- $errormessage='';
- }
- if ($fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'}){
- $fwdfwsettings{'nosave'} = 'on';
- }
- }
+ $maxkey=&General::findhasharraykey(\%configfwdfw);
+ %rulehash=%configfwdfw;
+ }
+ #check if we have an identical rule already
+ if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
+ foreach my $key (sort keys %rulehash){
+ if ( "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'ruleremark'},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
+ eq "$rulehash{$key}[0],$rulehash{$key}[2],$rulehash{$key}[3],$rulehash{$key}[4],$rulehash{$key}[5],$rulehash{$key}[6],$rulehash{$key}[7],$rulehash{$key}[8],$rulehash{$key}[9],$rulehash{$key}[10],$rulehash{$key}[11],$rulehash{$key}[12],$rulehash{$key}[13],$rulehash{$key}[14],$rulehash{$key}[15],$rulehash{$key}[16],$rulehash{$key}[17],$rulehash{$key}[18],$rulehash{$key}[19],$rulehash{$key}[20],$rulehash{$key}[21],$rulehash{$key}[22],$rulehash{$key}[23],$rulehash{$key}[24],$rulehash{$key}[25],$rulehash{$key}[26],$rulehash{$key}[27],$rulehash{$key}[28],$rulehash{$key}[29],$rulehash{$key}[30],$rulehash{$key}[31],$rulehash{$key}[32],$rulehash{$key}[33],$rulehash{$key}[34],$rulehash{$key}[35],$rulehash{$key}[36]"){
+ $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
+ if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
+ $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
+ }
+ if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && &validremark($fwdfwsettings{'ruleremark'})){
+ $errormessage='';
+ }
+ if ($fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'}){
+ $fwdfwsettings{'nosave'} = 'on';
+ }
}
}
- #check Rulepos on new Rule
- if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
- $fwdfwsettings{'oldrulenumber'}=$maxkey;
- foreach my $key (sort keys %configfwdfw){
- if ( "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
- eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31],$configfwdfw{$key}[32],$configfwdfw{$key}[33],$configfwdfw{$key}[34],$configfwdfw{$key}[35],$configfwdfw{$key}[36]"){
- $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
- }
+ }
+ #check Rulepos on new Rule
+ if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
+ $fwdfwsettings{'oldrulenumber'}=$maxkey;
+ foreach my $key (sort keys %rulehash){
+ if ( "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
+ eq "$rulehash{$key}[0],$rulehash{$key}[2],$rulehash{$key}[3],$rulehash{$key}[4],$rulehash{$key}[5],$rulehash{$key}[6],$rulehash{$key}[7],$rulehash{$key}[8],$rulehash{$key}[9],$rulehash{$key}[10],$rulehash{$key}[11],$rulehash{$key}[12],$rulehash{$key}[13],$rulehash{$key}[14],$rulehash{$key}[15],$rulehash{$key}[18],$rulehash{$key}[19],$rulehash{$key}[20],$rulehash{$key}[21],$rulehash{$key}[22],$rulehash{$key}[23],$rulehash{$key}[24],$rulehash{$key}[25],$rulehash{$key}[26],$rulehash{$key}[27],$rulehash{$key}[28],$rulehash{$key}[29],$rulehash{$key}[30],$rulehash{$key}[31],$rulehash{$key}[32],$rulehash{$key}[33],$rulehash{$key}[34],$rulehash{$key}[35],$rulehash{$key}[36]"){
+ $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
}
}
- #check if we just close a rule
- if( $fwdfwsettings{'oldgrp1a'} eq $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}){
- if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
- $fwdfwsettings{'nosave2'} = 'on';
- $errormessage='';
- }
+ }
+ #check if we just close a rule
+ if( $fwdfwsettings{'oldgrp1a'} eq $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}){
+ if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
+ $fwdfwsettings{'nosave2'} = 'on';
+ $errormessage='';
}
- #check max concurrent connections per ip address
- if ($fwdfwsettings{'LIMIT_CON_CON'} eq 'ON'){
- if (!($fwdfwsettings{'concon'} =~ /^(\d+)$/)) {
- $errormessage.=$Lang::tr{'fwdfw err concon'};
- }
- }else{
- $fwdfwsettings{'concon'}='';
+ }
+ #check max concurrent connections per ip address
+ if ($fwdfwsettings{'LIMIT_CON_CON'} eq 'ON'){
+ if (!($fwdfwsettings{'concon'} =~ /^(\d+)$/)) {
+ $errormessage.=$Lang::tr{'fwdfw err concon'};
}
- #check ratelimit value
- if ($fwdfwsettings{'RATE_LIMIT'} eq 'ON'){
- if (!($fwdfwsettings{'ratecon'} =~ /^(\d+)$/)) {
- $errormessage.=$Lang::tr{'fwdfw err ratecon'};
- }
- }else{
- $fwdfwsettings{'ratecon'}='';
+ }else{
+ $fwdfwsettings{'concon'}='';
+ }
+ #check ratelimit value
+ if ($fwdfwsettings{'RATE_LIMIT'} eq 'ON'){
+ if (!($fwdfwsettings{'ratecon'} =~ /^(\d+)$/)) {
+ $errormessage.=$Lang::tr{'fwdfw err ratecon'};
}
- #increase counters
- if (!$errormessage){
- if ($fwdfwsettings{'nosave2'} ne 'on'){
- &saverule(\%configfwdfw,$configfwdfw);
- }
+ }else{
+ $fwdfwsettings{'ratecon'}='';
+ }
+ #increase counters
+ if (!$errormessage){
+ if ($fwdfwsettings{'nosave2'} ne 'on'){
+ &saverule(\%rulehash,$fwdfwsettings{'config'});
}
}
if ($errormessage){
}
}
}
- if ($tcpcounter > 15){
+ if ($tcpcounter > 14){
$errormessage=$Lang::tr{'fwhost err maxservicetcp'};
}
- if ($udpcounter > 15){
+ if ($udpcounter > 14){
$errormessage=$Lang::tr{'fwhost err maxserviceudp'};
}
$tcpcounter=0;
my $comment = $3;
my $packet = $4;
- $packet =~ /IN=(\w+)/; my $iface=$1; if ( $1 =~ /2./ ){ $iface="";}
- $packet =~ /SRC=([\d\.]+)/; my $srcaddr=$1;
- $packet =~ /DST=([\d\.]+)/; my $dstaddr=$1;
- $packet =~ /MAC=([\w+\:]+)/; my $macaddr=$1;
- $packet =~ /PROTO=(\w+)/; my $proto=$1;
- $packet =~ /SPT=(\d+)/; my $srcport=$1;
- $packet =~ /DPT=(\d+)/; my $dstport=$1;
+ my ($iface, $srcaddr, $dstaddr, $macaddr, $proto, $srcport, $dstport);
+ $iface=$1 if $packet =~ /IN=(\w+)/;
+ $srcaddr=$1 if $packet =~ /SRC=([\d\.]+)/;
+ $dstaddr=$1 if $packet =~ /DST=([\d\.]+)/;
+ $macaddr=$1 if $packet =~ /MAC=([\w+\:]+)/;
+ $proto=$1 if $packet =~ /PROTO=(\w+)/;
+ $srcport=$1 if $packet =~ /SPT=(\d+)/;
+ $dstport=$1 if $packet =~ /DPT=(\d+)/;
my $gi = Geo::IP::PurePerl->new();
my $ccode = $gi->country_code_by_name($srcaddr);
$cgiparams{'REMOTE_ID'} = '';
#use default advanced value
- $cgiparams{'IKE_ENCRYPTION'} = 'aes256|aes192|aes128|3des'; #[18];
- $cgiparams{'IKE_INTEGRITY'} = 'sha2_256|sha|md5'; #[19];
+ $cgiparams{'IKE_ENCRYPTION'} = 'aes256|aes192|aes128|aes256gcm128|aes192gcm128|aes128gcm128|aes256gcm96|aes192gcm96|aes128gcm96|aes256gcm64|aes192gcm64|aes128gcm64'; #[18];
+ $cgiparams{'IKE_INTEGRITY'} = 'sha2_512|sha2_256|sha'; #[19];
$cgiparams{'IKE_GROUPTYPE'} = '4096|3072|2048|1536|1024'; #[20];
$cgiparams{'IKE_LIFETIME'} = '3'; #[16];
- $cgiparams{'ESP_ENCRYPTION'} = 'aes256|aes192|aes128|3des'; #[21];
- $cgiparams{'ESP_INTEGRITY'} = 'sha2_256|sha1|md5'; #[22];
+ $cgiparams{'ESP_ENCRYPTION'} = 'aes256|aes192|aes128|aes256gcm128|aes192gcm128|aes128gcm128|aes256gcm96|aes192gcm96|aes128gcm96|aes256gcm64|aes192gcm64|aes128gcm64'; #[21];
+ $cgiparams{'ESP_INTEGRITY'} = 'sha2_512|sha2_256|sha1'; #[22];
$cgiparams{'ESP_GROUPTYPE'} = ''; #[23];
$cgiparams{'ESP_KEYLIFE'} = '1'; #[17];
$cgiparams{'COMPRESSION'} = 'on'; #[13];
goto ADVANCED_ERROR;
}
foreach my $val (@temp) {
- if ($val !~ /^(aes256|aes192|aes128|3des|camellia256|camellia192|camellia128)$/) {
+ if ($val !~ /^(aes(256|192|128)(gcm(128|96|64))?|3des|camellia(256|192|128))$/) {
$errormessage = $Lang::tr{'invalid input'};
goto ADVANCED_ERROR;
}
$errormessage = $Lang::tr{'invalid input for ike lifetime'};
goto ADVANCED_ERROR;
}
- if ($cgiparams{'IKE_LIFETIME'} < 1 || $cgiparams{'IKE_LIFETIME'} > 24) {
- $errormessage = $Lang::tr{'ike lifetime should be between 1 and 24 hours'};
+ if ($cgiparams{'IKE_LIFETIME'} < 1 || $cgiparams{'IKE_LIFETIME'} > 8) {
+ $errormessage = $Lang::tr{'ike lifetime should be between 1 and 8 hours'};
goto ADVANCED_ERROR;
}
@temp = split('\|', $cgiparams{'ESP_ENCRYPTION'});
goto ADVANCED_ERROR;
}
foreach my $val (@temp) {
- if ($val !~ /^(aes256|aes192|aes128|3des|camellia256|camellia192|camellia128)$/) {
+ if ($val !~ /^(aes(256|192|128)(gcm(128|96|64))?|3des|camellia(256|192|128))$/) {
$errormessage = $Lang::tr{'invalid input'};
goto ADVANCED_ERROR;
}
$checked{'IKE_ENCRYPTION'}{'aes256'} = '';
$checked{'IKE_ENCRYPTION'}{'aes192'} = '';
$checked{'IKE_ENCRYPTION'}{'aes128'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes256gcm128'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes192gcm128'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes128gcm128'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes256gcm96'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes192gcm96'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes128gcm96'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes256gcm64'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes192gcm64'} = '';
+ $checked{'IKE_ENCRYPTION'}{'aes128gcm64'} = '';
$checked{'IKE_ENCRYPTION'}{'3des'} = '';
$checked{'IKE_ENCRYPTION'}{'camellia256'} = '';
$checked{'IKE_ENCRYPTION'}{'camellia192'} = '';
$checked{'ESP_ENCRYPTION'}{'aes256'} = '';
$checked{'ESP_ENCRYPTION'}{'aes192'} = '';
$checked{'ESP_ENCRYPTION'}{'aes128'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes256gcm128'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes192gcm128'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes128gcm128'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes256gcm96'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes192gcm96'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes128gcm96'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes256gcm64'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes192gcm64'} = '';
+ $checked{'ESP_ENCRYPTION'}{'aes128gcm64'} = '';
$checked{'ESP_ENCRYPTION'}{'3des'} = '';
$checked{'ESP_ENCRYPTION'}{'camellia256'} = '';
$checked{'ESP_ENCRYPTION'}{'camellia192'} = '';
<td class='boldbase' width="15%">$Lang::tr{'encryption'}</td>
<td class='boldbase'>
<select name='IKE_ENCRYPTION' multiple='multiple' size='6' style='width: 100%'>
- <option value='aes256' $checked{'IKE_ENCRYPTION'}{'aes256'}>AES (256 bit)</option>
- <option value='aes192' $checked{'IKE_ENCRYPTION'}{'aes192'}>AES (192 bit)</option>
- <option value='aes128' $checked{'IKE_ENCRYPTION'}{'aes128'}>AES (128 bit)</option>
- <option value='3des' $checked{'IKE_ENCRYPTION'}{'3des'}>3DES</option>
- <option value='camellia256' $checked{'IKE_ENCRYPTION'}{'camellia256'}>Camellia (256 bit)</option>
- <option value='camellia192' $checked{'IKE_ENCRYPTION'}{'camellia192'}>Camellia (192 bit)</option>
- <option value='camellia128' $checked{'IKE_ENCRYPTION'}{'camellia128'}>Camellia (128 bit)</option>
+ <option value='aes256' $checked{'IKE_ENCRYPTION'}{'aes256'}>256 bit AES-CBC</option>
+ <option value='aes192' $checked{'IKE_ENCRYPTION'}{'aes192'}>192 bit AES-CBC</option>
+ <option value='aes128' $checked{'IKE_ENCRYPTION'}{'aes128'}>128 bit AES-CBC</option>
+ <option value='aes256gcm128' $checked{'IKE_ENCRYPTION'}{'aes256gcm128'}>256 bit AES-GCM/128 bit ICV</option>
+ <option value='aes192gcm128' $checked{'IKE_ENCRYPTION'}{'aes192gcm128'}>192 bit AES-GCM/128 bit ICV</option>
+ <option value='aes128gcm128' $checked{'IKE_ENCRYPTION'}{'aes128gcm128'}>128 bit AES-GCM/128 bit ICV</option>
+ <option value='aes256gcm96' $checked{'IKE_ENCRYPTION'}{'aes256gcm96'}>256 bit AES-GCM/96 bit ICV</option>
+ <option value='aes192gcm96' $checked{'IKE_ENCRYPTION'}{'aes192gcm96'}>192 bit AES-GCM/96 bit ICV</option>
+ <option value='aes128gcm96' $checked{'IKE_ENCRYPTION'}{'aes128gcm96'}>128 bit AES-GCM/96 bit ICV</option>
+ <option value='aes256gcm64' $checked{'IKE_ENCRYPTION'}{'aes256gcm64'}>256 bit AES-GCM/64 bit ICV</option>
+ <option value='aes192gcm64' $checked{'IKE_ENCRYPTION'}{'aes192gcm64'}>192 bit AES-GCM/64 bit ICV</option>
+ <option value='aes128gcm64' $checked{'IKE_ENCRYPTION'}{'aes128gcm64'}>128 bit AES-GCM/64 bit ICV</option>
+ <option value='3des' $checked{'IKE_ENCRYPTION'}{'3des'}>168 bit 3DES-EDE-CBC</option>
+ <option value='camellia256' $checked{'IKE_ENCRYPTION'}{'camellia256'}>256 bit Camellia-CBC</option>
+ <option value='camellia192' $checked{'IKE_ENCRYPTION'}{'camellia192'}>192 bit Camellia-CBC</option>
+ <option value='camellia128' $checked{'IKE_ENCRYPTION'}{'camellia128'}>128 bit Camellia-CBC</option>
</select>
</td>
<td class='boldbase'>
<select name='ESP_ENCRYPTION' multiple='multiple' size='6' style='width: 100%'>
- <option value='aes256' $checked{'ESP_ENCRYPTION'}{'aes256'}>AES (256 bit)</option>
- <option value='aes192' $checked{'ESP_ENCRYPTION'}{'aes192'}>AES (192 bit)</option>
- <option value='aes128' $checked{'ESP_ENCRYPTION'}{'aes128'}>AES (128 bit)</option>
- <option value='3des' $checked{'ESP_ENCRYPTION'}{'3des'}>3DES</option>
- <option value='camellia256' $checked{'ESP_ENCRYPTION'}{'camellia256'}>Camellia (256 bit)</option>
- <option value='camellia192' $checked{'ESP_ENCRYPTION'}{'camellia192'}>Camellia (192 bit)</option>
- <option value='camellia128' $checked{'ESP_ENCRYPTION'}{'camellia128'}>Camellia (128 bit)</option>
+ <option value='aes256' $checked{'ESP_ENCRYPTION'}{'aes256'}>256 bit AES-CBC</option>
+ <option value='aes192' $checked{'ESP_ENCRYPTION'}{'aes192'}>192 bit AES-CBC</option>
+ <option value='aes128' $checked{'ESP_ENCRYPTION'}{'aes128'}>128 bit AES-CBC</option>
+ <option value='aes256gcm128' $checked{'ESP_ENCRYPTION'}{'aes256gcm128'}>256 bit AES-GCM/128 bit ICV</option>
+ <option value='aes192gcm128' $checked{'ESP_ENCRYPTION'}{'aes192gcm128'}>192 bit AES-GCM/128 bit ICV</option>
+ <option value='aes128gcm128' $checked{'ESP_ENCRYPTION'}{'aes128gcm128'}>128 bit AES-GCM/128 bit ICV</option>
+ <option value='aes256gcm96' $checked{'ESP_ENCRYPTION'}{'aes256gcm96'}>256 bit AES-GCM/96 bit ICV</option>
+ <option value='aes192gcm96' $checked{'ESP_ENCRYPTION'}{'aes192gcm96'}>192 bit AES-GCM/96 bit ICV</option>
+ <option value='aes128gcm96' $checked{'ESP_ENCRYPTION'}{'aes128gcm96'}>128 bit AES-GCM/96 bit ICV</option>
+ <option value='aes256gcm64' $checked{'ESP_ENCRYPTION'}{'aes256gcm64'}>256 bit AES-GCM/64 bit ICV</option>
+ <option value='aes192gcm64' $checked{'ESP_ENCRYPTION'}{'aes192gcm64'}>192 bit AES-GCM/64 bit ICV</option>
+ <option value='aes128gcm64' $checked{'ESP_ENCRYPTION'}{'aes128gcm64'}>128 bit AES-GCM/64 bit ICV</option>
+ <option value='3des' $checked{'ESP_ENCRYPTION'}{'3des'}>168 bit 3DES-EDE-CBC</option>
+ <option value='camellia256' $checked{'ESP_ENCRYPTION'}{'camellia256'}>256 bit Camellia-CBC</option>
+ <option value='camellia192' $checked{'ESP_ENCRYPTION'}{'camellia192'}>192 bit Camellia-CBC</option>
+ <option value='camellia128' $checked{'ESP_ENCRYPTION'}{'camellia128'}>128 bit Camellia-CBC</option>
</select>
</td>
</tr>
$wlanapsettings{'HIDESSID'} = 'off';
$wlanapsettings{'ENC'} = 'wpa2'; # none / wpa1 /wpa2
$wlanapsettings{'TXPOWER'} = 'auto';
-$wlanapsettings{'CHANNEL'} = '05';
+$wlanapsettings{'CHANNEL'} = '6';
$wlanapsettings{'COUNTRY'} = '00';
$wlanapsettings{'HW_MODE'} = 'g';
$wlanapsettings{'PWD'} = 'IPFire-2.x';
foreach (@channellist_cmd){
$_ =~ /(.*) \[(\d+)(.*)\]/;
$channel = $2;chomp $channel;
-if ( $channel =~ /\d+/ ){push(@temp,$channel);}
+if ( $channel =~ /\d+/ ){push(@temp,$channel + 0);}
}
@channellist = @temp;
} else {
foreach (@channellist_cmd){
$_ =~ /(.*)Channel (\d+)(.*):/;
$channel = $2;chomp $channel;
-if ( $channel =~ /\d+/ ){push(@temp,$channel);}
+if ( $channel =~ /\d+/ ){push(@temp,$channel + 0);}
}
@channellist = @temp;
}
my @countrylist_cmd = `regdbdump /usr/lib/crda/regulatory.bin 2>/dev/null`;
# get available country codes
-my @temp;
+my @temp = "00";
foreach (@countrylist_cmd){
$_ =~ /country (.*):/;
$country = $1;chomp $country;
'ike grouptype' => 'Type de groupe IKE :',
'ike integrity' => 'Intégrité IKE :',
'ike lifetime' => 'Durée de vie IKE :',
-'ike lifetime should be between 1 and 24 hours' => 'La durée de vie IKE devrait être comprise entre 1 et 8 heures.',
+'ike lifetime should be between 1 and 24 hours' => 'La durée de vie IKE devrait être comprise entre 1 et 24 heures.',
'import' => 'Importer',
'importkey' => 'Importer PSK',
'in' => 'Dans',
include Config
VER = 1.17
-DATVER = 06052014
+DATVER = 15022015
THISAPP = Geo-IP-PurePerl-$(VER)
DL_FILE = $(THISAPP).tar.gz
GeoIP.dat-$(DATVER).gz = $(DL_FROM)/GeoIP.dat-$(DATVER).gz
$(DL_FILE)_MD5 = 42a6b9d4dd2563a20c8998556216e1de
-GeoIP.dat-$(DATVER).gz_MD5 = aba5fc86202337c53a33bbc47d2083d0
+GeoIP.dat-$(DATVER).gz_MD5 = 508e3c10da15f2722774cf4014863976
install : $(TARGET)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2015 Michael Tremer & Christian Schmidt #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 2.0.16
+VER = 2.0.23
THISAPP = acpid-$(VER)
DL_FILE = $(THISAPP).tar.xz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = d59fc02c9c34f0d5c137495302e2c074
+$(DL_FILE)_MD5 = d7bcdcdefcd53b03730e50ba842554ea
install : $(TARGET)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = asterisk
-PAK_VER = 13
+PAK_VER = 14
-DEPS = "sqlite"
+DEPS = "libsrtp"
###############################################################################
# Top-level Rules
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VERSUFIX = ipfire$(KCFG)
+
+VER = 3.18.1-1
+
+THISAPP = backports-$(VER)
+DL_FILE = $(THISAPP).tar.xz
+DL_FROM = $(URL_IPFIRE)
+DIR_APP = $(DIR_SRC)/$(THISAPP)
+TARGET = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
+
+#ifeq "$(MACHINE_TYPE)" "arm"
+CFLAGS += -fno-PIC
+#endif
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 6cef5f2c800e12441d2cba9fa42b6a5b
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist:
+ $(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+ @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+ @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+ @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+ @$(PREBUILD)
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar Jxf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-ipfire-build.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-grsecurity.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-add_usbnet_modules.patch
+
+ # DVB patches
+ cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/v4l-dvb_fix_tua6034_pll.patch
+
+ # Wlan patches
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/compat-drivers-3.8.3-ath_ignore_eeprom_regdomain.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-iwlwifi-noibss_only_on_radar_chan.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.37-rt2800usb_add_dlink_dwa137_usbid.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_add_libertas_uap.patch
+
+ # smsc mac address patch for pandaboard and raspberry pi
+ifeq "$(KCFG)" "-multi"
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10-smsc95xx-add_mac_addr_param.patch
+endif
+ifeq "$(KCFG)" "-rpi"
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10-smsc95xx-add_mac_addr_param.patch
+endif
+
+ # generate config
+ cd $(DIR_APP) && make KLIB=/lib/modules/$(KVER)-$(VERSUFIX)/ allmodconfig
+
+ # Disable some settings
+ cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_DEVELOPER_WARNINGS=y/# CPTCFG_CFG80211_DEVELOPER_WARNINGS is not set/g" .config
+ cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_CERTIFICATION_ONUS=y/# CPTCFG_CFG80211_CERTIFICATION_ONUS is not set/g" .config
+ cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_REG_CELLULAR_HINTS=y/# CPTCFG_CFG80211_REG_CELLULAR_HINTS is not set/g" .config
+ cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_REG_RELAX_NO_IR=y/# CPTCFG_CFG80211_REG_RELAX_NO_IR is not set/g" .config
+ cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_INTERNAL_REGDB=y/# CPTCFG_CFG80211_INTERNAL_REGDB is not set/g" .config
+ cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_DEFAULT_PS=y/# CPTCFG_CFG80211_DEFAULT_PS is not set/g" .config
+ cd $(DIR_APP) && sed -i -e "s/CPTCFG_NFC=m/# CPTCFG_NFC is not set/g" .config
+
+ # Disable some modules (build fail)
+ cd $(DIR_APP) && sed -i -e "s/CPTCFG_VIDEO_VIA_CAMERA=m/# CPTCFG_VIDEO_VIA_CAMERA is not set/g" .config
+
+ # Disable DEBUG
+ cd $(DIR_APP) && sed -i -e "s/.*DEBUG=y/# & is not set/g" .config
+ cd $(DIR_APP) && sed -i -e "s/.*DEBUGFS=y/# & is not set/g" .config
+ cd $(DIR_APP) && sed -i -e "s/=y is not set/ is not set/g" .config
+
+ # Disable OF_GRAPH (not supported by kernel 3.14)
+ cd $(DIR_APP) && sed -i -e "s/CONFIG_OF/CONFIG_OF_IGNORE/g" include/linux/of_graph.h
+
+ cd $(DIR_APP) && make $(MAKETUNING) KLIB=/lib/modules/$(KVER)-$(VERSUFIX)/ install
+
+ # Remove vsp1 module (not mach to our platforms)
+ rm -rf /lib/modules/$(KVER)-$(VERSUFIX)/kernel/drivers/media/platform/vsp1
+
+ @rm -rf $(DIR_APP)
+ @$(POSTBUILD)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 0.98.5
+VER = 0.98.6
THISAPP = clamav-$(VER)
DL_FILE = $(THISAPP).tar.gz
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = clamav
-PAK_VER = 27
+PAK_VER = 28
DEPS = ""
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = abb5c7efaff3394c0a49ff970841a2ac
+$(DL_FILE)_MD5 = 7f4f7e82a09e42c4ebf153d6d452d9d8
install : $(TARGET)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/clamav/llvm-glibc.patch
cd $(DIR_APP) && ./configure \
--prefix=/usr \
--sysconfdir=/var/ipfire/clamav \
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
+ifeq "$(MACHINE)" "armv5tel"
+ MAKETUNING = -j2
+endif
+
###############################################################################
# Top-level Rules
###############################################################################
include Config
PKG_NAME = collectd
-VER = 4.10.7
+VER = 4.10.9
THISAPP = collectd-$(VER)
DL_FILE = $(THISAPP).tar.bz2
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = f4193fdb5002ddac8159c88032a726bc
+$(DL_FILE)_MD5 = 980dd3387508f9ad209df04a6f7a126c
install : $(TARGET)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0001-src-utils_mount.h-Add-stdio.h.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0002-Don-t-notify-continuously-when-MySQL-slave-SQL-threa.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0003-curl_xml.c-avoid-using-uninitalized-variable-in-erro.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0004-interface.c-FreeBSD-10-support.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0005-Revert-curl_xml.c-avoid-using-uninitalized-variable-.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0006-network-set_thread_cbs-so-we-initialize-the-right-th.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0007-apache-plugin-Call-curl_global_init-from-the-init-fu.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0008-network-comment-libgcrypt-initalization-process.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0009-Call-curl_global_init-in-_init-of-plugins-using-curl.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0010-indent-wh_init-to-be-consistent-with-the-rest-of-the.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0011-Configparser-when-we-alocate-an-empty-list-we-also-n.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0012-don-t-assume-pkg-config-is-in-PATH.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0013-add-missing-backticks-which-broke-the-build.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0014-snmp-free-snmp_pdu-struct-allocated-by-snmp_pdu_crea.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0015-curl_xml-plugin-Fixed-tautological-pointer-compariso.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0016-Add-support-for-OpenVPN-2.3.0-status-files.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0017-openvpn-plugin-Don-t-signal-an-error-when-no-clients.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0018-openvpn-Remove-boguous-file-handler-check.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0019-openvpn-Ignore-not-fully-established-connections.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0020-openvpn-Make-read-functions-robust-like-in-8516f9abb.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0021-openvpn-Fix-copy-and-paste-error.patch
+ cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0022-openvpn-Change-data-type-from-COUNTER-to-DERIVE.patch
cd $(DIR_APP) && ./configure --prefix=/usr --localstatedir=/var \
--disable-{apple_sensors,csv,ipvs,mbmon,memcached,mysql} \
--disable-{netlink,nginx,nut,perl,serial,snmp,tape,vserver,xmms} \
include Config
-VER = 1.1.3
+VER = 3.13
THISAPP = crda-$(VER)
-DL_FILE = $(THISAPP).tar.bz2
+DL_FILE = $(THISAPP).tar.xz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 29579185e06a75675507527243d28e5c
+$(DL_FILE)_MD5 = 66b1b0417c1ad19f0009a5c0c0c1aebc
install : $(TARGET)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && USE_OPENSSL=1 make $(MAKETUNING)
- cd $(DIR_APP) && USE_OPENSSL=1 make install
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/crda-3.13-crypto_use_optional.patch
+ cd $(DIR_APP) && make $(MAKETUNING)
+ cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)
include Config
-VER = 005
+VER = 007
THISAPP = ddns-$(VER)
DL_FILE = $(THISAPP).tar.xz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 5fb0e7c8a775ae03074ad90d5a251a4c
+$(DL_FILE)_MD5 = 44f63cecc36db0d9ffddfa4bca7983ae
install : $(TARGET)
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ddns/ddns-005-Add-changeip-com.patch
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ddns/ddns-005-SPDNS-fix-auth.patch
-
cd $(DIR_APP) && [ -x "configure" ] || sh ./autogen.sh
- cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire
+ cd $(DIR_APP) && ./configure \
+ --prefix=/usr \
+ --sysconfdir=/var/ipfire \
+ --disable-manpages
+
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
ln -s $(THISAPP) /usr/src/directfb
-# @rm -rf $(DIR_APP)
+ @rm -rf $(DIR_APP)
@$(POSTBUILD)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
-COPTS = -DHAVE_ISC_READER
+# We cannot use INOTIFY because our ISC reader code does not support that
+COPTS = -DHAVE_ISC_READER -DNO_INOTIFY
###############################################################################
# Top-level Rules
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/dnsmasq-2.73-remove-floor-on-edns0-packet-size-with-DNSSEC.patch
- cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/dnsmasq-2.73-fix-crash-in-DNSSEC-code-when-attempting-to-verify-large-RRs.patch
- cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/dnsmasq-2.73-make-caching-work-for-CNAMEs-pointing-to-A-AAAA-records-shadowed-in-etc-hosts.patch
- cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/dnsmasq-2.73-fix-problems-validating-NSEC3-and-wildcards.patch
- cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/dnsmasq-2.73-initialise-return-value.patch
- cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/dnsmasq-2.73-bad-packet-protection.patch
- cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-2.72rc2-Add-support-to-read-ISC-DHCP-lease-file.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0001-Add-newline-at-the-end-of-example-config-file.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0002-crash-at-startup-when-an-empty-suffix-is-supplied-to.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0003-Debian-build-fixes-for-kFreeBSD.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0004-Set-conntrack-mark-before-connect-call.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0005-Fix-typo-in-new-Dbus-code.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0006-Fit-example-conf-file-typo.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0007-Improve-RFC-compliance-when-unable-to-supply-address.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0008-Fix-conntrack-with-bind-interfaces.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0009-Use-inotify-instead-of-polling-on-Linux.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0010-Teach-the-new-inotify-code-about-symlinks.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0011-Remove-floor-on-EDNS0-packet-size-with-DNSSEC.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0012-CHANGELOG-re.-inotify.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0013-Fix-breakage-of-domain-domain-subnet-local.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0014-Remove-redundant-IN6_IS_ADDR_ULA-a-macro-defn.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0015-Eliminate-IPv6-privacy-addresses-from-interface-name.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0016-Tweak-field-width-in-cache-dump-to-avoid-truncating-.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0017-Fix-crash-in-DNSSEC-code-when-attempting-to-verify-l.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0018-Make-caching-work-for-CNAMEs-pointing-to-A-AAAA-reco.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0019-Fix-problems-validating-NSEC3-and-wildcards.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0020-Initialise-return-value.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0021-Add-ignore-address-option.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0022-Bad-packet-protection.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0023-Fix-build-failure-in-new-inotify-code-on-BSD.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0024-Implement-makefile-dependencies-on-COPTS-variable.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0025-Fix-race-condition-issue-in-makefile.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0026-DNSSEC-do-top-down-search-for-limit-of-secure-delega.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0027-Add-log-queries-extra-option-for-more-complete-loggi.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0028-Add-min-cache-ttl-option.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0029-Log-port-of-requestor-when-doing-extra-logging.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0030-Don-t-answer-from-cache-RRsets-from-wildcards-as-we-.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0031-Logs-for-DS-records-consistent.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0032-Cope-with-multiple-interfaces-with-the-same-LL-addre.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0033-Don-t-treat-SERVFAIL-as-a-recoverable-error.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0034-Add-dhcp-hostsdir-config-option.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0035-Update-German-translation.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0036-Don-t-reply-to-DHCPv6-SOLICIT-messages-when-not-conf.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0037-Allow-inotify-to-be-disabled-at-compile-time-on-Linu.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0038-Expand-inotify-code-to-dhcp-hostsdir-dhcp-optsdir-an.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0039-Update-copyrights-for-dawn-of-2015.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0040-inotify-documentation-updates.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0041-Fix-broken-ECDSA-DNSSEC-signatures.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0042-BSD-make-support.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0043-Fix-build-failure-on-openBSD.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0044-Manpage-typo-fix.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0045-Fixup-dhcp-configs-after-reading-extra-hostfiles-wit.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0046-Extra-logging-for-inotify-code.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0047-man-page-typo.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0048-Fix-get-version-script-which-returned-wrong-tag-in-s.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0049-Typos.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0050-Make-dynamic-hosts-files-work-when-no-hosts-set.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0051-Fix-trivial-memory-leaks-to-quieten-valgrind.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0052-Fix-uninitialized-value-used-in-get_client_mac.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0053-Log-parsing-utils-in-contrib-reverse-dns.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0054-Add-dnssec-timestamp-option-and-facility.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0055-Fix-last-commit-to-not-crash-if-uid-changing-not-con.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0056-New-version-of-contrib-reverse-dns.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/0057-Tweak-DNSSEC-timestamp-code-to-create-file-later-rem.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
cd $(DIR_APP) && sed -i src/config.h \
-e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
-e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
-e 's|#define HAVE_DHCP6|//#define HAVE_DHCP6|g' \
-e 's|#define HAVE_TFTP|//#define HAVE_TFTP|g'
- cd $(DIR_APP) && make CFLAGS="$(CFLAGS)" COPTS="$(COPTS)" $(MAKETUNING)
- cd $(DIR_APP) && make PREFIX=/usr install
+ cd $(DIR_APP) && make CFLAGS="$(CFLAGS)" COPTS="$(COPTS)" \
+ PREFIX=/usr all install
@rm -rf $(DIR_APP)
@$(POSTBUILD)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 20110802
+VER = 20141125
THISAPP = dvb-firmwares-$(VER)
-DL_FILE = $(THISAPP).tar.bz2
+DL_FILE = $(THISAPP).tar.xz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/dvb-firmwares
TARGET = $(DIR_INFO)/$(THISAPP)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 330e19f9444a03f5338bab590ab9d728
+$(DL_FILE)_MD5 = 3c7182522dc091b506d2120d71a6a360
install : $(TARGET)
cd $(DIR_SRC)/ffmpeg && make $(MAKETUNING) $(EXTRA_MAKE)
cd $(DIR_SRC)/ffmpeg && make install
cd $(DIR_SRC)/ffmpeg && make install-libs
- ldconfig
-# @rm -rf $(DIR_APP)
+ @rm -rf $(DIR_APP)
@$(POSTBUILD)
include Config
-VER = 2.1.10
+VER = 2.1.11
THISAPP = fireinfo-v$(VER)
DL_FILE = $(THISAPP).tar.gz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = cc7838cda22d7d4e9bb177aa1dc6f25a
+$(DL_FILE)_MD5 = 093799207ab7397cc7f2d5eb45868c69
install : $(TARGET)
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo/0001-bogomips-Don-t-crash-when-no-bogomips-are-available.patch
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo/0002-ARM-Read-board-model-from-device-tree-in-proc.patch
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo/0003-Revert-vendor-model-for-ARM-to-old-behaviour.patch
-
cd $(DIR_APP) && [ -x "configure" ] || sh ./autogen.sh
cd $(DIR_APP) && ./configure --prefix=/usr
cd $(DIR_APP) && make $(MAKETUNING)
endif
# /boot: 64MB - OFFSET
-# / : 700MB
+# / : 750MB
S_BOOT := $(shell echo $$(( 131072 - $(S_OFFSET) )))
-S_ROOT := 1433600
+S_ROOT := 1536000
PADDING = 100 # MB
mkdir -pv $(MNThdd)/boot
mount $(PART_BOOT) $(MNThdd)/boot
- # Install MLO and uboot first
+ # Install Pandaboard MLO and uboot first
ifeq "$(MACHINE_TYPE)" "arm"
cp -v /boot/MLO $(MNThdd)/boot/
cp -v /boot/u-boot.img $(MNThdd)/boot/
cp -v /boot/zImage-ipfire-multi $(MNThdd)/boot/
+ # work around a u-boot bug not find the folders sometimes
+ mkdir -pv $(MNThdd)/boot/dtb-$(KVER)-ipfire-multi
+ mkdir -pv $(MNThdd)/boot/dtb-$(KVER)-ipfire-kirkwood
sync
umount $(MNThdd)/boot
mount $(PART_BOOT) $(MNThdd)/boot
ifeq "$(MACHINE_TYPE)" "arm"
sed -i -e "s| console=tty1 | console=ttyAMA0,115200n8 |g" $(MNThdd)/boot/cmdline.txt
- sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/boot.script
- cd $(MNThdd)/boot && ./convert_bootscript
+ sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/uEnv.txt
endif
endif
# not copied to a block device)
dd if=/dev/zero bs=1M count=$(PADDING) >> $(IMG)
+ifeq "$(MACHINE_TYPE)" "arm"
+ # Install u-boot for LeMaker Banana Pi into image 8KB
+ dd if=/usr/share/u-boot/banana_pi/u-boot-sunxi-with-spl.bin of=$(IMG) bs=1K seek=8 conv=notrunc
+endif
+
# Compress Image
pigz -f9 < $(IMG) > $(IMAGE_FILE)
rm -rf $(IMG) $(MNThdd)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 3.4
+VER = 3.10
THISAPP = fping-$(VER)
DL_FILE = $(THISAPP).tar.gz
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = fping
-PAK_VER = 2
+PAK_VER = 3
DEPS = ""
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = a4bc97804e630dbf26dfac8f28c78091
+$(DL_FILE)_MD5 = 6a0ddecb671df1d580d20c0dd1095773
install : $(TARGET)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2015 Michael Tremer & Christian Schmidt #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 2.8.3
+VER = 2.9.3
THISAPP = fuse-$(VER)
DL_FILE = $(THISAPP).tar.gz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 517c8384f915e40647bda9f71579fd97
+$(DL_FILE)_MD5 = 33cae22ca50311446400daf8a6255c6a
install : $(TARGET)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh966775.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh966778.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh970090.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh995972.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1008310.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1019916.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1022022.patch
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1091162.patch
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1098050.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1027101.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1027261.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1032628.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1044628.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1111460.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1133809-1.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1133809-2.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1139571.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1154563.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1170121.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1183533.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-resolv-stack_chk_fail.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-remove-ctors-dtors-output-sections.patch
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2013 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER = 1.5.11
+
+THISAPP = haproxy-$(VER)
+DL_FILE = $(THISAPP).tar.gz
+DL_FROM = $(URL_IPFIRE)
+DIR_APP = $(DIR_SRC)/$(THISAPP)
+TARGET = $(DIR_INFO)/$(THISAPP)
+PROG = haproxy
+PAK_VER = 1
+
+DEPS = ""
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 5500a79d0d2b238d4a1e9749bd0c2cb2
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist:
+ @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+ @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+ @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+ @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+ @$(PREBUILD)
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+
+ cd $(DIR_APP) && make $(MAKETUNING) CPU="generic" TARGET="linux2628" \
+ USE_OPENSSL=1 USE_PCRE=1 USE_ZLIB=1 USE_REGPARM=1 \
+ ADDINC="$(CFLAGS)" USE_LINUX_TPROXY=1 ADDLIB="$(LDFLAGS)"
+
+ cd $(DIR_APP) && make install-bin install-man PREFIX=/usr
+
+ -mkdir -pv /etc/haproxy /var/lib/haproxy
+ install -v -m 644 $(DIR_SRC)/config/haproxy/haproxy.cfg \
+ /etc/haproxy/haproxy.cfg
+
+ install -v -m 644 $(DIR_SRC)/config/backup/includes/haproxy \
+ /var/ipfire/backup/addons/includes/haproxy
+
+ # Restore initscript
+ install -v -m 754 $(DIR_SRC)/src/initscripts/init.d/haproxy \
+ /etc/rc.d/init.d/haproxy
+
+ @rm -rf $(DIR_APP)
+ @$(POSTBUILD)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 2.2
+VER = 2.3
THISAPP = hostapd-$(VER)
DL_FILE = $(THISAPP).tar.gz
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = hostapd
-PAK_VER = 30
+PAK_VER = 33
DEPS = ""
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 23c1f78a693c3288802d516adb7fd289
+$(DL_FILE)_MD5 = 40b89c61036add0c2dd1fc10767d3b5f
install : $(TARGET)
THISAPP = hwdata
TARGET = $(DIR_INFO)/$(THISAPP)
+# https://pci-ids.ucw.cz/v2.2/pci.ids
+# http://www.linux-usb.org/usb.ids
+
###############################################################################
# Top-level Rules
###############################################################################
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2010 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
ln -sf ../init.d/firstsetup /etc/rc.d/rcsysinit.d/S75firstsetup
ln -sf ../init.d/localnet /etc/rc.d/rcsysinit.d/S80localnet
ln -sf ../init.d/firewall /etc/rc.d/rcsysinit.d/S85firewall
+ ln -sf ../init.d/network-trigger /etc/rc.d/rcsysinit.d/S90network-trigger
ln -sf ../init.d/network-vlans /etc/rc.d/rcsysinit.d/S91network-vlans
ln -sf ../init.d/rngd /etc/rc.d/rcsysinit.d/S92rngd
ln -sf ../init.d/wlanclient /etc/rc.d/rc0.d/K82wlanclient
ln -sf any /etc/rc.d/init.d/networking/$$i; \
done
- # ARM does not need checkfstab and acpid
+ # ARM does not need checkfstab and acpid, intel no swconfig
ifeq "$(MACHINE_TYPE)" "arm"
rm -vf /etc/rc.d/init.d/{acpid,checkfstab}
+ ln -sf ../init.d/swconfig /etc/rc.d/rcsysinit.d/S73swconfig
else
+ rm -vf /etc/rc.d/init.d/swconfig
ln -sf ../init.d/acpid /etc/rc.d/rc3.d/S12acpid
ln -sf ../init.d/acpid /etc/rc.d/rc0.d/K87acpid
ln -sf ../init.d/acpid /etc/rc.d/rc6.d/K87acpid
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- @rm -rf $(DIR_APP) $(DIR_SRC)/libnfnetlink-1.0.0 $(DIR_SRC)/netfilter-layer7* $(DIR_SRC)/libnetfilter_queue-0.0.17
+ @rm -rf $(DIR_APP) $(DIR_SRC)/libnfnetlink-* $(DIR_SRC)/netfilter-layer7* $(DIR_SRC)/libnetfilter_queue-*
@cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
# cp -rf /usr/src/linux/include/linux/netfilter /usr/include/linux
cd $(DIR_SRC)/libnetfilter_cttimeout-1.0.0 && make $(MAKETUNING) $(EXTRA_MAKE)
cd $(DIR_SRC)/libnetfilter_cttimeout-1.0.0 && make install
- @rm -rf $(DIR_APP) $(DIR_SRC)/libnfnetlink-1.0.0 $(DIR_SRC)/netfilter-layer7* $(DIR_SRC)/libnetfilter_queue-0.0.17
+ @rm -rf $(DIR_APP) $(DIR_SRC)/libnfnetlink-* $(DIR_SRC)/netfilter-layer7* $(DIR_SRC)/libnetfilter_queue-*
@$(POSTBUILD)
include Config
-VER = 3.10
+VER = 3.14
THISAPP = iw-$(VER)
DL_FILE = $(THISAPP).tar.xz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 07219ad06535bc270f7a8873aba6d5fa
+$(DL_FILE)_MD5 = 66e41053f6fc0781b683b5b688442de6
install : $(TARGET)
###############################################################################
# Top-level Rules
###############################################################################
-objects = $(DL_FILE) $(THISAPP)-more-programs-1.patch
+objects = $(DL_FILE) $(THISAPP)-more-programs-1.patch \
+ kbd-latarcyrheb-16-fixed.tar.bz2 kbd-latsun-fonts.tar.bz2
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(THISAPP)-more-programs-1.patch = $(DL_FROM)/kbd-$(VER)-more-programs-1.patch
+kbd-latarcyrheb-16-fixed.tar.bz2 = $(DL_FROM)/kbd-latarcyrheb-16-fixed.tar.bz2
+kbd-latsun-fonts.tar.bz2 = $(DL_FROM)/kbd-latsun-fonts.tar.bz2
$(DL_FILE)_MD5 = 069d1175b4891343b107a8ac2b4a39f6
$(THISAPP)-more-programs-1.patch_MD5 = dc70180a6bc0afa2b741cd38e3cc2e18
+kbd-latarcyrheb-16-fixed.tar.bz2_MD5 = 884fdbb0b952b2e3e8389a0c40a3e301
+kbd-latsun-fonts.tar.bz2_MD5 = e22ee88353968df8d4a4b1bf1fa8fc31
install : $(TARGET)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-more-programs-1.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-backspace-1.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-gcc4_fixes-1.patch
+
+ # Extract our own fonts
+ cd $(DIR_APP) && tar xvfa $(DIR_DL)/kbd-latarcyrheb-16-fixed.tar.bz2
+ cd $(DIR_APP) && tar xvfa $(DIR_DL)/kbd-latsun-fonts.tar.bz2
+
cd $(DIR_APP) && ./configure --datadir=/lib/kbd --disable-nls
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+ @rm -rf $(DIR_SRC)/$(THISAPP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/mitkrb-1.12.1-db2_fix-1.patch
cd $(DIR_APP) && sed -e "s@python2.5/Python.h@& python2.7/Python.h@g" \
chmod -f -v 755 "/usr/lib/lib$$LIB.so"; \
done
- @rm -rf $(DIR_APP)
+ @rm -rf $(DIR_SRC)/$(THISAPP)
@$(POSTBUILD)
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
+PROG = libsrtp
+PAK_VER = 1
+
+DEPS = ""
###############################################################################
# Top-level Rules
md5 : $(subst %,%_MD5,$(objects))
+dist:
+ @$(PAK)
+
###############################################################################
# Downloading, checking, md5sum
###############################################################################
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 3.14.25
+VER = 3.14.33
-RPI_PATCHES = 3.14.25-grsec-ipfire1
-A7M_PATCHES = 3.14.25-grsec-ipfire1
-GRS_PATCHES = grsecurity-3.0-3.14.25-201411220954.patch.xz
+RPI_PATCHES = 3.14.33-grsec-ipfire1
+A7M_PATCHES = 3.14.33-grsec-ipfire1
+GRS_PATCHES = grsecurity-3.0-3.14.33-201502180832.patch.xz
THISAPP = linux-$(VER)
DL_FILE = linux-$(VER).tar.xz
CFLAGS =
CXXFLAGS =
-PAK_VER = 53
+PAK_VER = 58
DEPS = ""
VERSUFIX=ipfire$(KCFG)
arm7-multi-patches-$(A7M_PATCHES).patch.xz = $(URL_IPFIRE)/arm7-multi-patches-$(A7M_PATCHES).patch.xz
$(GRS_PATCHES) = $(URL_IPFIRE)/$(GRS_PATCHES)
-$(DL_FILE)_MD5 = 3ae910d35292706d85870c3939547123
-rpi-patches-$(RPI_PATCHES).patch.xz_MD5 = b573af847c28ebed8c15a74542360db1
-arm7-multi-patches-$(A7M_PATCHES).patch.xz_MD5 = 8b47b81a530db68cb2c2f6bb6418ca28
-$(GRS_PATCHES)_MD5 = 6b2c8669e39304cfe647f9de16260929
+$(DL_FILE)_MD5 = c19feb0646fde7e96602ac313fb7e5d6
+rpi-patches-$(RPI_PATCHES).patch.xz_MD5 = e423c8b3a408f23b9a26f8f0f4384c50
+arm7-multi-patches-$(A7M_PATCHES).patch.xz_MD5 = f147ce7c81889d2c5134304f3a6e60e3
+$(GRS_PATCHES)_MD5 = 119943451628ff5a62437637d60a585d
install : $(TARGET)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-iwlwifi-noibss_only_on_radar_chan.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.37-rt2800usb_add_dlink_dwa137_usbid.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.55-rt2800usb-change_queue_warn_to_debug.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.25_rt2x00_fix_bss_bcn_num.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.25-rt5592_no_special_txop_init.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.39-add_libertas_uap.patch
# mISDN Patches
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2.33_ipg-fix-driver-name.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.27_mcs7830-fix-driver-name.patch
+ # r8169 L23 patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.32-r8169_disable_L23.patch
+
ifeq "$(KCFG)" "-kirkwood"
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.10-mv_cesa_disable_failing_hmac_sha1.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-kirkwood_legacy_boot.patch
# Apply Arm7-multiarch kernel patches.
cd $(DIR_APP) && xzcat $(DIR_DL)/arm7-multi-patches-$(A7M_PATCHES).patch.xz | patch -Np1
+
+ # Install switch api userspace header
+ cd $(DIR_APP) && install -v -m644 include/uapi/linux/switch.h /usr/include/linux/
+
+ # Fix Lamobo-R1 SATA Power
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.x-lamobo-r1-fix-sata-pwr.patch
endif
ifeq "$(KCFG)" "-rpi"
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 52d77db
+VER = 78535e8
THISAPP = linux-firmware-$(VER)
DL_FILE = $(THISAPP).tar.xz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 3f6f1e78af3ee67a5540355f2ed8ba14
+$(DL_FILE)_MD5 = a4cafb924fbcaeb34d1b464be0e4d089
+
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
- touch /var/lib/logrotate.status
+ mkdir -pv /etc/logrotate.d
+ touch /etc/logrotate.d/.empty /var/lib/logrotate.status
@rm -rf $(DIR_APP)
@$(POSTBUILD)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2015 IPfire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 1.2.9
+VER = 1.6.4
THISAPP = lynis-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
-DIR_APP = $(DIR_SRC)/$(THISAPP)
+DIR_APP = $(DIR_SRC)/lynis
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = lynis
-PAK_VER = 4
+PAK_VER = 5
DEPS = ""
###############################################################################
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 69b369173ffc0f10f021035f73857e1f
+$(DL_FILE)_MD5 = dfa946388af8926bd24f772d4fa4830a
install : $(TARGET)
cd $(DIR_SRC)/mISDNuser && ./configure --prefix=/usr --with-AF_ISDN=34
cd $(DIR_SRC)/mISDNuser && make MISDNDIR=/usr/src/linux
cd $(DIR_SRC)/mISDNuser && make install MISDNDIR=/usr/src/linux
+ @rm -rf $(DIR_APP)
@$(POSTBUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2009 Michael Tremer & Christian Schmidt #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER = 5.11
+
+THISAPP = monit-$(VER)
+DL_FILE = $(THISAPP).tar.gz
+DL_FROM = $(URL_IPFIRE)
+DIR_APP = $(DIR_SRC)/$(THISAPP)
+TARGET = $(DIR_INFO)/$(THISAPP)
+PROG = monit
+PAK_VER = 3
+
+DEPS = ""
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = ff00f39d248ed7068932ed82211da9e6
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist:
+ @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+ @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+ @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+ @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+ @$(PREBUILD)
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
+ cd $(DIR_APP) && make $(MAKETUNING)
+ cd $(DIR_APP) && make install
+
+ install -v -m 644 $(DIR_SRC)/config/backup/includes/monit \
+ /var/ipfire/backup/addons/includes/monit
+
+ # Install default configuration
+ install -v -m 600 $(DIR_SRC)/config/monit/monitrc /etc
+
+ # Install start links and backup include file.
+ ln -sf ../init.d/monit /etc/rc.d/rc3.d/S60monit
+ ln -sf ../init.d/monit /etc/rc.d/rc0.d/K40monit
+ ln -sf ../init.d/monit /etc/rc.d/rc6.d/K40monit
+
+ @rm -rf $(DIR_APP)
+ @$(POSTBUILD)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 0.82
+VER = 0.86
THISAPP = mtr-$(VER)
DL_FILE = $(THISAPP).tar.gz
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = mtr
-PAK_VER = 1
+PAK_VER = 2
DEPS = ""
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 10601ea543fda3e51545c4bce195b64c
+$(DL_FILE)_MD5 = 8d63592c9d4579ef20cf491b41843eb2
install : $(TARGET)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+ @rm -rf $(DIR_APP) $(DIR_SRC)/nagios-plugins* && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && \
./configure --prefix=/usr \
--sysconfdir=/etc/nagios \
ln -s /etc/init.d/nagios /etc/rc.d/rc3.d/S67nagios
ln -s /etc/init.d/nagios /etc/rc.d/rc0.d/K33nagios
ln -s /etc/init.d/nagios /etc/rc.d/rc6.d/K33nagios
- @rm -rf $(DIR_APP)
+ @rm -rf $(DIR_APP) $(DIR_SRC)/nagios-plugins*
@$(POSTBUILD)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 6.01
+VER = 6.47
THISAPP = nmap-$(VER)
DL_FILE = $(THISAPP).tar.bz2
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = nmap
-PAK_VER = 6
+PAK_VER = 7
DEPS = ""
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = a1a71940f238abb835dbf3ee7412bcea
+$(DL_FILE)_MD5 = edfe81f6763223c0a29bfa15a8526e2a
install : $(TARGET)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2009 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2015 Michael Tremer & Christian Schmidt #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 2011.1.15
+VER = 2014.2.15
-THISAPP = ntfs-3g-$(VER)
+THISAPP = ntfs-3g_ntfsprogs-$(VER)
DL_FILE = $(THISAPP).tgz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 15a5cf5752012269fa168c24191f00e2
+$(DL_FILE)_MD5 = f11d563816249d730a00498983485f3a
install : $(TARGET)
include Config
-VER = 4.2.6p5
+VER = 4.2.8
THISAPP = ntp-$(VER)
DL_FILE = $(THISAPP).tar.gz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 00df80a84ec9528fcfb09498075525bc
+$(DL_FILE)_MD5 = 6972a626be6150db8cfbd0b63d8719e7
install : $(TARGET)
include Config
-VER = 1.0.1j
+VER = 1.0.1k
THISAPP = openssl-$(VER)
DL_FILE = $(THISAPP).tar.gz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = f7175c9cd3c39bb1907ac8bba9df8ed3
+$(DL_FILE)_MD5 = d4f002bd22a56881340105028842ae1f
install : $(TARGET)
no-mdc2 \
no-rc5 \
no-srp \
+ no-ssl2 \
+ no-ssl3 \
$(CONFIGURE_ARGS) \
-DSSL_FORBID_ENULL \
-DHAVE_CRYPTODEV \
include Config
-VER = 0.9.8zc
+VER = 0.9.8zd
THISAPP = openssl-$(VER)
DL_FILE = $(THISAPP).tar.gz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 1b239eea3a60d67863e7b66700e47a16
+$(DL_FILE)_MD5 = e9b9ee12f2911e1a378e2458d9bfff77
install : $(TARGET)
chmod 700 /var/ipfire/ovpn/ovpn-leases.db
chown -R root:root /var/ipfire/ovpn/scripts
chown -R nobody:nobody /var/ipfire/ovpn
- chown root.nobody /var/log/ovpnserver.log
- chmod 660 /var/log/ovpnserver.log
chmod 700 /var/ipfire/ovpn/certs
mv -v /var/ipfire/ovpn/verify /usr/lib/openvpn/verify
chown root:root /usr/lib/openvpn/verify
include Config
-VER = 7.0.0
+VER = 7.0.3
THISAPP = owncloud-$(VER)
DL_FILE = $(THISAPP).tar.bz2
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = owncloud
-PAK_VER = 2
+PAK_VER = 4
DEPS = ""
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 28cfdc99e8ee9350fe88430b4c7d62f2
+$(DL_FILE)_MD5 = d5d2ad068046e6ddb322cf001a9bb3d5
install : $(TARGET)
/etc/httpd/conf/vhosts.d/
install -v -m 644 $(DIR_SRC)/config/backup/includes/owncloud \
/var/ipfire/backup/addons/includes/owncloud
+
+ @rm -rf $(DIR_SRC)/$(PROG)
@$(POSTBUILD)
include Config
-VER = 2.7c
+VER = 2.7
THISAPP = Pound-$(VER)
DL_FILE = $(THISAPP).tgz
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = pound
-PAK_VER = 6
+PAK_VER = 7
DEPS = ""
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 56dace6b79c6be1d25b31355269c380a
+$(DL_FILE)_MD5 = ec8298aa3e4aee3ffbecdc0639d7f14a
install : $(TARGET)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 3.6.24
+VER = 3.6.25
THISAPP = samba-$(VER)
DL_FILE = $(THISAPP).tar.gz
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = samba
-PAK_VER = 59
+PAK_VER = 60
DEPS = "cups krb5"
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = d98425c0c2b73e08f048d31ffc727fb0
+$(DL_FILE)_MD5 = 76da2fa64edd94a0188531e7ecb27c4e
install : $(TARGET)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = squid-accounting
-PAK_VER = 3
+PAK_VER = 4
DEPS = "perl-DBI perl-DBD-SQLite perl-File-ReadBackwards perl-PDF-API2 sendEmail"
@$(PREBUILD)
# Create directories
- -mkdir -pv /{bin,boot,etc/opt,etc/modprobe.d,home,lib,mnt,opt,run}
+ -mkdir -pv /{bin,boot,etc/opt,etc/modprobe.d,home,lib/firmware/brcm,mnt,opt,run}
-mkdir -pv /{media/{floppy,cdrom,usbkey},sbin,srv,var}
-install -dv -m 0750 /root
-install -dv -m 1777 /tmp /var/tmp
# Config files
cp -rvf $(DIR_SRC)/config/etc/* /etc;
+ cp -rvf $(DIR_SRC)/config/lib/* /lib;
touch /etc/{fs,m}tab
echo "$(NAME) v$(VERSION) - $(SLOGAN)" > /etc/issue
echo "===============================" >> /etc/issue
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/strongswan-5.0.2_ipfire.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/strongswan-5.2.2-issue-816-eb25190.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/strongswan-5.2.2-issue-816-650a3ad.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/strongswan-5.2.2-issue-816-dd0ebb.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/strongswan-5.2.2-issue-819-cd2c30a.patch
cd $(DIR_APP) && [ -x "configure" ] || ./autogen.sh
cd $(DIR_APP) && ./configure \
--enable-farp \
--enable-openssl \
--enable-gcrypt \
+ --enable-gcm \
--enable-xauth-eap \
--enable-xauth-noauth \
--enable-eap-radius \
ln -sf $(CONFIG_ROOT)/certs /etc/ipsec.d/certs
ln -sf $(CONFIG_ROOT)/crls /etc/ipsec.d/crls
+ install -v -m 644 $(DIR_SRC)/config/strongswan/charon.conf \
+ /etc/strongswan.d/charon.conf
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 2.0.24.1
+VER = 001
-THISAPP = teamspeak-$(VER)
+THISAPP = swconfig-$(VER)
+DL_FILE = $(THISAPP).tar.xz
+DL_FROM = $(URL_IPFIRE)
+DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
-PROG = teamspeak
-PAK_VER = 2
-
-DEPS = ""
+SUP_ARCH = armv5tel
###############################################################################
# Top-level Rules
###############################################################################
-objects =
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = c35919a05fc82b3f8b311da8dfc2cd3e
install : $(TARGET)
-check :
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
-download :
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+ @$(CHECK)
-md5 :
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+ @$(LOAD)
-dist:
- @$(PAK)
+$(subst %,%_MD5,$(objects)) :
+ @$(MD5)
###############################################################################
# Installation Details
###############################################################################
-$(TARGET) :
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- -mkdir -p /opt/teamspeak
- install -v -m 644 $(DIR_SRC)/config/backup/includes/teamspeak \
- /var/ipfire/backup/addons/includes/teamspeak
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && make $(MAKETUNING)
+ cd $(DIR_APP) && install -v -m755 swconfig /usr/bin/
+ @rm -rf $(DIR_APP)
@$(POSTBUILD)
#cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)_xen_empty_buffer_check.patch
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
- touch /var/log/{dhcpcd.log,messages,ovpnserver.log}
- chmod 664 /var/log/{dhcpcd.log,messages,ovpnserver.log}
- chown 0:105 /var/log/{dhcpcd.log,messages,ovpnserver.log}
+ touch /var/log/{dhcpcd.log,messages}
+ chmod 664 /var/log/{dhcpcd.log,messages}
+ chown 0:105 /var/log/{dhcpcd.log,messages}
@rm -rf $(DIR_APP)
@$(POSTBUILD)
include Config
-VER = 2014j
+VER = 2015a
TZDATA_VER = $(VER)
TZCODE_VER = $(VER)
tzdata$(TZDATA_VER).tar.gz = $(DL_FROM)/tzdata$(TZDATA_VER).tar.gz
tzcode$(TZCODE_VER).tar.gz = $(DL_FROM)/tzcode$(TZCODE_VER).tar.gz
-tzdata$(TZDATA_VER).tar.gz_MD5 = 2d7ea9c309f0d4e162e426e568290ca3
-tzcode$(TZCODE_VER).tar.gz_MD5 = 970119e9765bc5a9320368851c91ecb6
+tzdata$(TZDATA_VER).tar.gz_MD5 = 4ed11c894a74a5ea64201b1c6dbb8831
+tzcode$(TZCODE_VER).tar.gz_MD5 = 8f375ede46ae137fbac047ac431bda37
install : $(TARGET)
include Config
-VER = 2013.10
+VER = 2014.04
THISAPP = u-boot-$(VER)
DL_FILE = $(THISAPP).tar.bz2
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = a076a044b64371edc52f7e562b13f6b2
+$(DL_FILE)_MD5 = 6d2116d1385a66e9a59742caa9d62a54
install : $(TARGET)
# Install pandaboard uboot as default
cd $(DIR_APP) && install MLO /boot/
cd $(DIR_APP) && install u-boot.img /boot/
- cp -vf $(DIR_SRC)/config/u-boot/* /boot/
cd $(DIR_APP) && make distclean
# Wandboard Quad
/usr/share/u-boot/wandboard_solo
cd $(DIR_APP) && make distclean
+ # LeMaker Banana Pi
+ -mkdir -pv /usr/share/u-boot/banana_pi
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/u-boot/sunxi/001-uboot-sunxi-509d96d4f1f602d62d36db660973249e16f9d088.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/u-boot/sunxi/002-uboot-jwrdegoede-psci-support.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/u-boot/sunxi/003-uboot-fix-gmac-not-working-reliable-on-bananapi.patch
+ cd $(DIR_APP) && make CROSS_COMPILE="" Bananapi_config
+ cd $(DIR_APP) && make CROSS_COMPILE="" HOSTCC="gcc $(CFLAGS)"
+ cd $(DIR_APP) && install -v -m 644 u-boot-sunxi-with-spl.bin \
+ /usr/share/u-boot/banana_pi
+
# mkimage
cd $(DIR_APP) && make CROSS_COMPILE="" HOSTCC="gcc $(CFLAGS)" tools
cd $(DIR_APP) && install -v -m 755 tools/mkimage /usr/bin
+ # config (uEnv.txt)
+ cp -vf $(DIR_SRC)/config/u-boot/* /boot/
+ # patch real Kernel version to uEnv.txt
+ sed -e "s/xxxKVERxxx/$(KVER)/g" -i /boot/uEnv.txt
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
rm -f /lib/udev/rules.d/75-persistent-net-generator.rules
rm -f /lib/udev/rules.d/80-net-name-slot.rules
- # Create rule file for the setup
- touch /etc/udev/rules.d/30-persistent-network.rules
-
# Blacklist some modules
cp -vf $(DIR_SRC)/config/udev/blacklist.conf /etc/modprobe.d/blacklist.conf
install -v -m 644 $(DIR_SRC)/config/udev/25-alsa.rules \
/lib/udev/rules.d
+ # Install network rules.
+ install -v -m 755 $(DIR_SRC)/config/udev/network-hotplug-rename \
+ /lib/udev/network-hotplug-rename
+ install -v -m 644 $(DIR_SRC)/config/udev/60-net.rules \
+ /lib/udev/rules.d
+
# Install hwrng rules.
install -v -m 644 $(DIR_SRC)/config/udev/90-hwrng.rules \
/lib/udev/rules.d
include Config
-VER = 2013.02.13
+VER = 2014.11.18
THISAPP = wireless-regdb-$(VER)
DL_FILE = $(THISAPP).tar.xz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 46a4aa49282ea6713c3cf28cc2fc600f
+$(DL_FILE)_MD5 = d750c402c5510add7380edcb1d9b75b2
install : $(TARGET)
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 2.2
+VER = 2.3
THISAPP = wpa_supplicant-$(VER)
DL_FILE = $(THISAPP).tar.gz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 238e8e888bbd558e1a57e3eb28d1dd07
+$(DL_FILE)_MD5 = f2ed8fef72cf63d8d446a2d0a6da630a
install : $(TARGET)
THISAPP = xvidcore-$(VER)
DL_FILE = $(THISAPP).tar.gz
DL_FROM = $(URL_IPFIRE)
-DIR_APP = $(DIR_SRC)/$(THISAPP)
+DIR_APP = $(DIR_SRC)/xvidcore
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = xvid
PAK_VER = 2
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_SRC)/xvidcore/build/generic && ./configure --prefix=/usr
- cd $(DIR_SRC)/xvidcore/build/generic && make
- cd $(DIR_SRC)/xvidcore/build/generic && make install
+ cd $(DIR_APP)/build/generic && ./configure --prefix=/usr
+ cd $(DIR_APP)/build/generic && make
+ cd $(DIR_APP)/build/generic && make install
chmod -v 755 /usr/lib/libxvidcore.so.4.2
ln -v -sf libxvidcore.so.4.2 /usr/lib/libxvidcore.so.4
ln -v -sf libxvidcore.so.4 /usr/lib/libxvidcore.so
SNAME="ipfire" # Short name
VERSION="2.17" # Version number
CORE="87" # Core Level (Filename)
-PAKFIRE_CORE="86" # Core Level (PAKFIRE)
+PAKFIRE_CORE="87" # Core Level (PAKFIRE)
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` # Git Branch
SLOGAN="www.ipfire.org" # Software slogan
CONFIG_ROOT=/var/ipfire # Configuration rootdir
i586)
# x86-pae (Native and new XEN) kernel build
ipfiremake linux KCFG="-pae"
+ ipfiremake backports KCFG="-pae"
ipfiremake cryptodev KCFG="-pae"
ipfiremake e1000e KCFG="-pae"
ipfiremake igb KCFG="-pae"
# x86 kernel build
ipfiremake linux KCFG=""
+ ipfiremake backports KCFG=""
ipfiremake cryptodev KCFG=""
ipfiremake e1000e KCFG=""
ipfiremake igb KCFG=""
armv5tel)
# arm-rpi (Raspberry Pi) kernel build
ipfiremake linux KCFG="-rpi"
+ ipfiremake backports KCFG="-rpi"
ipfiremake cryptodev KCFG="-rpi"
ipfiremake linux-initrd KCFG="-rpi"
# arm multi platform (Panda, Wandboard ...) kernel build
ipfiremake linux KCFG="-multi"
+ ipfiremake backports KCFG="-multi"
ipfiremake cryptodev KCFG="-multi"
ipfiremake e1000e KCFG="-multi"
ipfiremake igb KCFG="-multi"
# arm-kirkwood (Dreamplug, ICY-Box ...) kernel build
ipfiremake linux KCFG="-kirkwood"
+ ipfiremake backports KCFG="-kirkwood"
ipfiremake cryptodev KCFG="-kirkwood"
ipfiremake e1000e KCFG="-kirkwood"
ipfiremake igb KCFG="-kirkwood"
ipfiremake lm_sensors
ipfiremake liboping
ipfiremake collectd
- ipfiremake teamspeak
ipfiremake elinks
ipfiremake igmpproxy
ipfiremake fbset
ipfiremake iftop
ipfiremake motion
ipfiremake joe
+ ipfiremake monit
ipfiremake nut
ipfiremake watchdog
ipfiremake libpri
ipfiremake squid-accounting
ipfiremake pigz
ipfiremake tmux
+ ipfiremake swconfig
+ ipfiremake haproxy
}
buildinstaller() {
#
# List of PCI ID's
#
-# Version: 2014.04.30
-# Date: 2014-04-30 03:15:02
+# Version: 2015.02.14
+# Date: 2015-02-14 03:15:02
#
# Maintained by Martin Mares <mj@ucw.cz> and other volunteers from the
# PCI ID Project at http://pci-ids.ucw.cz/.
4c53 1300 P017 mezzanine (32-bit PMC)
4c53 1310 P017 mezzanine (64-bit PMC)
002f MegaRAID SAS 2208 IOV [Thunderbolt]
+ 1028 1f39 SPERC8-e
1028 1f3e SPERC 8
0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
0e11 00da ProLiant ML 350
1028 1f48 PERC H730P Mini (for blades)
1028 1f49 PERC H730 Mini
1028 1f4a PERC H730 Mini (for blades)
+ 1028 1f4d PERC FD33xS
+ 1028 1f4f PERC H730P Slim
+ 1028 1f54 PERC FD33xD
17aa 1052 ThinkServer RAID 720i
17aa 1053 ThinkServer RAID 720ix
005e SAS1066 PCI-X Fusion-MPT SAS
0096 SAS3004 PCI-Express Fusion-MPT SAS-3
0097 SAS3008 PCI-Express Fusion-MPT SAS-3
1028 1f45 12GB/s HBA internal
- 1028 1f46 12GB/s HBA external
+ 1028 1f46 12Gbps HBA
0407 MegaRAID
1000 0530 MegaRAID 530 SCSI 320-0X RAID Controller
1000 0531 MegaRAID 531 SCSI 320-4X RAID Controller
1306 Kaveri
1307 Kaveri
1308 Kaveri HDMI/DP Audio Controller
- 1309 Kaveri [Radeon R7 Graphics]
+ 1309 Kaveri [Radeon R6/R7 Graphics]
130a Kaveri [Radeon R6 Graphics]
130b Kaveri [Radeon R4 Graphics]
130c Kaveri [Radeon R7 Graphics]
4c54 264LT [Mach64 LT]
4c57 RV200/M7 [Mobility Radeon 7500]
1014 0517 ThinkPad T30
- 1014 0530 ThinkPad T42 2373-4WU
+ 1014 0530 ThinkPad T4x Series
1028 00e6 Radeon Mobility M7 LW (Dell Inspiron 8100)
1028 012a Latitude C640
1043 1622 Mobility Radeon M7 (L3C/S)
148c 2117 Bravo X700 (Secondary)
5f57 R423 [Radeon X800 XT]
6600 Mars [Radeon HD 8670A/8670M/8750M]
+ 103c 1952 ProBook 455 G1
6601 Mars [Radeon HD 8730M]
103c 2100 FirePro M4100
6602 Mars
6604 Opal XT [Radeon R7 M265]
6605 Opal PRO [Radeon R7 M260]
6606 Mars XTX [Radeon HD 8790M]
+ 1028 0684 FirePro W4170M
6607 Mars LE [Radeon HD 8530M / R5 M240]
+ 6608 Oland GL [FirePro W2100]
6610 Oland XT [Radeon HD 8670 / R7 250]
1019 0030 Radeon HD 8670
1028 2120 Radeon R7 250
6631 Oland
6640 Saturn XT [FirePro M6100]
6641 Saturn PRO [Radeon HD 8930M]
+ 6646 Bonaire XT [Radeon R9 M280X]
+ 6647 Bonaire PRO [Radeon R9 M270X]
6649 Bonaire [FirePro W5100]
6650 Bonaire
6651 Bonaire
6664 Jet XT [Radeon R5 M240]
6665 Jet PRO [Radeon R5 M230]
6667 Jet ULT [Radeon R5 M230]
- 666f Sun LE [Radeon HD 8550M]
+ 666f Sun LE [Radeon HD 8550M / R5 M230]
6670 Hainan
6704 Cayman PRO GL [FirePro V7900]
6707 Cayman LE GL [FirePro V5900]
1002 0310 FirePro S9000
1002 0420 Radeon Sky 700
1002 0422 Radeon Sky 900
+ 1002 0710 FirePro S9050
1002 0b0e FirePro S10000 Passive
1002 0b2a FirePro S10000
1028 030c FirePro W8000
1043 9999 ARES II
1092 3000 Tahiti XT2 [Radeon HD 7970 GHz Edition]
1458 2261 Tahiti XT2 [Radeon HD 7970 GHz Edition OC]
+# GV-R928XOC-3GD
+ 1458 3001 Tahiti XTL [Radeon R9 280X OC]
1462 2774 MSI R7970 TF 3GD5/OC BE
1682 3211 Double D HD 7970 Black Edition
# FX-797A-TNBC
1002 0b01 Radeon HD 8950 OEM
1002 3000 Tahiti PRO2 [Radeon HD 7950 Boost]
1462 3000 Radeon HD 8950 OEM
+ 174b a003 Radeon R9 280
679b Malta [Radeon HD 7990]
1002 0b28 Radeon HD 8990 OEM
1002 0b2a Radeon HD 7990
148c 8990 Radeon HD 8990 OEM
679e Tahiti LE [Radeon HD 7870 XT]
679f Tahiti
- 67a0 Hawaii XT GL
- 67a1 Hawaii GL
+ 67a0 Hawaii XT GL [FirePro W9100]
+ 67a1 Hawaii PRO GL [FirePro W8100]
67a2 Hawaii GL
67a8 Hawaii
67a9 Hawaii
67aa Hawaii
67b0 Hawaii XT [Radeon R9 290X]
67b1 Hawaii PRO [Radeon R9 290]
- 67b9 Vesuvius [Radeon R9 295 X2]
+ 67b9 Vesuvius [Radeon R9 295X2]
67be Hawaii LE
6800 Wimbledon XT [Radeon HD 7970M]
1002 0124 Radeon HD 7970M
6822 Venus PRO [Radeon E8860]
6823 Venus PRO [Radeon HD 8850M / R9 M265X]
6825 Heathrow XT [Radeon HD 7870M]
+ 1028 053f FirePro M6000
+ 1028 05cd FirePro M6000
+ 1028 15cd FirePro M6000
+ 103c 176c FirePro M6000
8086 2111 Chelsea PRO
6826 Chelsea LP [Radeon HD 7700M Series]
6827 Heathrow PRO [Radeon HD 7850M/8850M]
6829 Cape Verde
682a Venus PRO
682b Venus LE [Radeon HD 8830M]
+ 682c Cape Verde GL [FirePro W4100]
682d Chelsea XT GL [FirePro M4000]
682f Chelsea LP [Radeon HD 7730M]
103c 1851 Radeon HD 7750M
1019 0030 Radeon HD 8760 OEM
103c 6890 Radeon HD 8760 OEM
1043 8760 Radeon HD 8760 OEM
+ 1462 2710 R7770-PMD1GD5
174b 8304 Radeon HD 8760 OEM
683f Cape Verde PRO [Radeon HD 7750 / R7 250E]
6840 Thames [Radeon HD 7500M/7600M Series]
1028 05a3 Radeon HD 7670M
1028 05b9 Radeon HD 7670M
1028 05bb Radeon HD 7670M
+ 103c 1789 FirePro M2000
103c 17f1 Radeon HD 7570M
103c 17f4 Radeon HD 7650M
103c 1813 Radeon HD 7590M
174b e180 Radeon HD 7350
17af 3015 Radeon HD 7350
68fe Cedar LE
- 6900 Topaz XT [Radeon R7 M260]
+ 6900 Topaz XT [Radeon R7 M260/M265]
+ 1028 0640 Radeon R7 M265
+ 103c 2269 Radeon R7 M260
+ 103c 22c8 Radeon R7 M260
+ 1179 f903 Radeon R7 M260
+ 1179 f934 Radeon R7 M260
6901 Topaz PRO [Radeon R5 M255]
6920 Tonga
+ 6921 Amethyst XT [Radeon R9 M295X]
+ 692b Tonga PRO GL [FirePro W7100]
+ 692f Tonga XT GL [FirePro W8100]
+ 6938 Amethyst XT [Radeon R9 M295X Mac Edition]
+ 6939 Tonga PRO [Radeon R9 285]
700f RS100 AGP Bridge
7010 RS200/RS250 AGP Bridge
7100 R520 [Radeon X1800 XT]
103c 30c1 6910p
718a RV516/M64 [Mobility Radeon X2300]
718b RV516/M62 [Mobility Radeon X1350]
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
718c RV516/M62-CSP64 [Mobility Radeon X1350]
718d RV516/M64-CSP128 [Mobility Radeon X1450]
7193 RV516 [Radeon X1550 Series]
95c6 RV620 LE [Radeon HD 3450 AGP]
95c9 RV620 LE [Radeon HD 3450 PCI]
95cc RV620 GL [FirePro V3700]
+ 95cd RV620 [FirePro 2450]
95cf RV620 GL [FirePro 2260]
960f RS780 HDMI Audio [Radeon (HD) 3000 Series]
9610 RS780 [Radeon HD 3200]
983d Temash [Radeon HD 8250/8280G]
983e Kabini
983f Kabini
- 9850 Mullins [Radeon APU A6-6200 with R3 Graphics]
- 9851 Mullins [Radeon APU A4-6000 with R2 Graphics]
- 9852 Mullins [Radeon APU A4-6000 with R2 Graphics]
- 9853 Mullins [Radeon APU E2-4000 with R2 Graphics]
- 9854 Mullins [Radeon APU E2-3700 with R2 Graphics]
- 9855 Mullins [Radeon APU XX-2450M with R3 Graphics]
- 9856 Mullins [Radeon APU XX-2200M with R2 Graphics]
+ 9840 Kabini HDMI/DP Audio
+ 9850 Mullins [Radeon R3 Graphics]
+ 9851 Mullins [Radeon R4/R5 Graphics]
+ 9852 Mullins [Radeon R2 Graphics]
+ 9853 Mullins [Radeon R2 Graphics]
+ 9854 Mullins [Radeon R3E Graphics]
+ 9855 Mullins [Radeon R6 Graphics]
+ 9856 Mullins [Radeon R1E/R2E Graphics]
9857 Mullins [Radeon APU XX-2200M with R2 Graphics]
9858 Mullins
9859 Mullins
0160 64bit/66MHz PCI ATM 155 MMF
016e GXT4000P Graphics Adapter
0170 GXT6000P Graphics Adapter
+ 1092 0172 Fire GL2
017d GXT300P Graphics Adapter
0180 Snipe chipset SCSI controller
1014 0241 iSeries 2757 DASD IOA
1014 04c7 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCA)
1014 04c8 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CD2)
1014 0c49 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCD)
+ 044b GenWQE Accelerator Adapter
04aa Flash Adapter 90 (PCIe2 0.9TB)
3022 QLA3022 Network Adapter
4022 QLA3022 Network Adapter
1028 1f03 PERC 5/i Integrated RAID Controller
0016 PowerEdge Expandable RAID controller S300
1028 1f24 PERC S300 Controller
+# NV-RAM Adapter used in Dell DR appliances
+ 0073 NV-RAM Adapter
1029 Siemens Nixdorf IS
102a LSI Logic
0000 HYDRA
1028 028d PowerEdge T410 MGA G200eW WPCM450
1028 029c PowerEdge M710 MGA G200eW WPCM450
1028 02a4 PowerEdge T310 MGA G200eW WPCM450
+ 15d9 0624 X9SCM-F Motherboard
15d9 a811 H8DGU
0533 MGA G200EH
103c 3381 iLO4
000a PCI-to-PCI bridge
0016 SiS961/2/3 SMBus controller
0018 SiS85C503/5513 (LPC Bridge)
+ 0163 163 802.11b/g Wireless LAN Adapter
0180 RAID bus controller 180 SATA/PATA [SiS]
0181 SATA
0182 182 SATA/RAID Controller
103c 3211 Smart Array E200i
103c 3212 Smart Array E200
3239 Smart Array Gen9 Controllers
- 103c 21bd Smart Array
+ 103c 21bd P244br
103c 21be Smart Array
- 103c 21bf Smart Array
- 103c 21c0 Smart Array
+ 103c 21bf H240ar
+ 103c 21c0 P440ar
103c 21c1 Smart Array
- 103c 21c2 Smart Array
- 103c 21c3 Smart Array
+ 103c 21c2 P440
+ 103c 21c3 P441
103c 21c4 Smart Array
103c 21c5 Smart Array
- 103c 21c6 Smart Array
- 103c 21c7 Smart Array
- 103c 21c8 Smart Array
+ 103c 21c6 H244br
+ 103c 21c7 H240
+ 103c 21c8 H241
103c 21c9 Smart Array
103c 21ca Smart Array
- 103c 21cb Smart Array
+ 103c 21cb P840
103c 21cc Smart Array
103c 21cd Smart Array
103c 21ce Smart Array
3010 Samurai_1
3020 Samurai_IDE
1043 ASUSTeK Computer Inc.
+ 0464 Radeon R9 270x GPU
0675 ISDNLink P-IN100-ST-D
0675 1704 ISDN Adapter (PCI Bus, D, C)
0675 1707 ISDN Adapter (PCI Bus, DV, W)
8000 10GbE Converged Network Adapter (TCP/IP Networking)
8001 10GbE Converged Network Adapter (FCoE)
8020 cLOM8214 1/10GbE Controller
+ 1028 1f64 QMD8262-k 10G DP bNDC KR
103c 3346 CN1000Q Dual Port Converged Network Adapter
103c 3733 NC523SFP 10Gb 2-port Server Adapter
1077 0203 8200 Series Single Port 10GbE Converged Network Adapter (TCP/IP Networking)
1093 National Instruments
0160 PCI-DIO-96
0162 PCI-MIO-16XE-50
- 1150 PCI-DIO-32HS High Speed Digital I/O Board
+ 1150 PCI-6533 (PCI-DIO-32HS)
1170 PCI-MIO-16XE-10
1180 PCI-MIO-16E-1
1190 PCI-MIO-16E-4
11b0 PXI-6070E
- 11c0 PXI-6040e
- 11d0 PXI-6030e
- 1270 PCI-6032e
+ 11c0 PXI-6040E
+ 11d0 PXI-6030E
+ 1270 PCI-6032E
+ 1290 PCI-6704
+ 12b0 PCI-6534
1310 PCI-6602
+ 1320 PXI-6533
1330 PCI-6031E
- 1340 PCI-6033e
+ 1340 PCI-6033E
1350 PCI-6071E
1360 PXI-6602
+ 13c0 PXI-6508
+ 1490 PXI-6534
14e0 PCI-6110
14f0 PCI-6111
1580 PXI-6031E
15b0 PXI-6071E
1710 PXI-6509
+ 17c0 PXI-5690
17d0 PCI-6503
1870 PCI-6713
1880 PCI-6711
18b0 PCI-6052E
18c0 PXI-6052E
+ 1920 PXI-6704
+ 1930 PCI-6040E
+ 19c0 PCI-4472
+ 1aa0 PXI-4110
+ 1ad0 PCI-6133
+ 1ae0 PXI-6133
+ 1e30 PCI-6624
+ 1e40 PXI-6624
+ 1e50 PXI-5404
2410 PCI-6733
2420 PXI-6733
2430 PCI-6731
+ 2470 PCI-4474
+ 24a0 PCI-4065
+ 24b0 PXI-4200
+ 24f0 PXI-4472
+ 2510 PCI-4472
+ 2520 PCI-4474
+ 27a0 PCI-6123
+ 27b0 PXI-6123
2880 DAQCard-6601
2890 PCI-6036E
+ 28a0 PXI-4461
+ 28b0 PCI-6013
28c0 PCI-6014
28d0 PCI-5122
28e0 PXI-5122
+ 29f0 PXI-7334
+ 2a00 PXI-7344
2a60 PCI-6023E
2a70 PCI-6024E
2a80 PCI-6025E
- 2ab0 PXI-6025e
+ 2ab0 PXI-6025E
+ 2b10 PXI-6527
+ 2b20 PCI-6527
2b80 PXI-6713
2b90 PXI-6711
2c60 PCI-6601
2c70 PXI-6601
2c80 PCI-6035E
+ 2c90 PCI-6703
2ca0 PCI-6034E
+ 2cb0 PCI-7344
2cc0 PXI-6608
+ 2d20 PXI-5600
2db0 PCI-6608
+ 2dc0 PCI-4070
+ 2dd0 PXI-4070
+ 2eb0 PXI-4472
+ 2ec0 PXI-6115
+ 2ed0 PCI-6115
+ 2ee0 PXI-6120
+ 2ef0 PCI-6120
+ 2fd1 PCI-7334
+ 2fd2 PCI-7350
+ 2fd3 PCI-7342
+ 2fd5 PXI-7350
+ 2fd6 PXI-7342
+ 7003 PCI-6551
+ 7004 PXI-6551
+ 700b PXI-5421
+ 700c PCI-5421
+ 7023 PXI-2593
702c PXI-7831R
702d PCI-7831R
702e PXI-7811R
702f PCI-7811R
+ 7030 PCI-CAN (Series 2)
+ 7031 PCI-CAN/2 (Series 2)
+ 7032 PCI-CAN/LS (Series 2)
+ 7033 PCI-CAN/LS2 (Series 2)
+ 7034 PCI-CAN/DS (Series 2)
+ 7035 PXI-8460 (Series 2, 1 port)
+ 7036 PXI-8460 (Series 2, 2 ports)
+ 7037 PXI-8461 (Series 2, 1 port)
+ 7038 PXI-8461 (Series 2, 2 ports)
+ 7039 PXI-8462 (Series 2)
+ 703f PXI-2566
+ 7040 PXI-2567
+ 7044 MXI-4 Connection Monitor
+ 7047 PXI-6653
+ 704c PXI-2530
+ 704f PXI-4220
+ 7050 PXI-4204
7055 PXI-7830R
7056 PCI-7830R
+ 705a PCI-CAN/XS (Series 2)
+ 705b PCI-CAN/XS2 (Series 2)
+ 705c PXI-8464 (Series 2, 1 port)
+ 705d PXI-8464 (Series 2, 2 ports)
+ 705e cRIO-9102
+ 7060 PXI-5610
+ 7064 PXI-1045 Trigger Routing Module
+ 7065 PXI-6652
+ 7066 PXI-6651
+ 7067 PXI-2529
+ 7068 PCI-CAN/SW (Series 2)
+ 7069 PCI-CAN/SW2 (Series 2)
+ 706a PXI-8463 (Series 2, 1 port)
+ 706b PXI-8463 (Series 2, 2 ports)
+ 7073 PCI-6723
7074 PXI-7833R
+ 7075 PXI-6552
+ 7076 PCI-6552
+ 707c PXI-1428
+ 707e PXI-4462
+ 7080 PXI-8430/2 (RS-232) Interface
+ 7081 PXI-8431/2 (RS-485) Interface
7083 PCI-7833R
-# Low-Cost, High-Current, 96 Ch, 5 V TTL/CMOS Digital I/O
7085 PCI-6509
- 70a9 PCI-6528 (Digital I/O at 60V)
+ 7086 PXI-6528
+ 7087 PCI-6515
+ 7088 PCI-6514
+ 708c PXI-2568
+ 708d PXI-2569
+ 70a9 PCI-6528
70aa PCI-6229
70ab PCI-6259
70ac PCI-6289
+ 70ad PXI-6251
70ae PXI-6220
70af PCI-6221
70b0 PCI-6220
+ 70b1 PXI-6229
+ 70b2 PXI-6259
+ 70b3 PXI-6289
70b4 PCI-6250
+ 70b5 PXI-6221
70b6 PCI-6280
70b7 PCI-6254
- 70b8 PCI-6251 [M Series - High Speed Multifunction DAQ]
+ 70b8 PCI-6251
+ 70b9 PXI-6250
+ 70ba PXI-6254
+ 70bb PXI-6280
70bc PCI-6284
70bd PCI-6281
+ 70be PXI-6284
70bf PXI-6281
70c0 PCI-6143
+ 70c3 PCI-6511
+ 70c4 PXI-7330
+ 70c5 PXI-7340
+ 70c6 PCI-7330
+ 70c7 PCI-7340
+ 70c8 PCI-6513
+ 70c9 PXI-6515
+ 70ca PCI-1405
+ 70cc PCI-6512
+ 70cd PXI-6514
+ 70ce PXI-1405
+ 70cf PCIe-GPIB
+ 70d0 PXI-2570
+ 70d1 PXI-6513
+ 70d2 PXI-6512
+ 70d3 PXI-6511
+ 70d4 PCI-6722
+ 70d6 PXI-4072
+ 70d7 PXI-6541
+ 70d8 PXI-6542
+ 70d9 PCI-6541
+ 70da PCI-6542
+ 70db PCI-8430/2 (RS-232) Interface
+ 70dc PCI-8431/2 (RS-485) Interface
+ 70dd PXI-8430/4 (RS-232) Interface
+ 70de PXI-8431/4 (RS-485) Interface
+ 70df PCI-8430/4 (RS-232) Interface
+ 70e0 PCI-8431/4 (RS-485) Interface
+ 70e1 PXI-2532
+ 70e2 PXI-8430/8 (RS-232) Interface
+ 70e3 PXI-8431/8 (RS-485) Interface
+ 70e4 PCI-8430/8 (RS-232) Interface
+ 70e5 PCI-8431/8 (RS-485) Interface
+ 70e6 PXI-8430/16 (RS-232) Interface
+ 70e7 PCI-8430/16 (RS-232) Interface
+ 70e8 PXI-8432/2 (Isolated RS-232) Interface
+ 70e9 PXI-8433/2 (Isolated RS-485) Interface
+ 70ea PCI-8432/2 (Isolated RS-232) Interface
+ 70eb PCI-8433/2 (Isolated RS-485) Interface
+ 70ec PXI-8432/4 (Isolated RS-232) Interface
+ 70ed PXI-8433/4 (Isolated RS-485) Interface
+ 70ee PCI-8432/4 (Isolated RS-232) Interface
+ 70ef PCI-8433/4 (Isolated RS-485) Interface
70f0 PXI-5922
70f1 PCI-5922
70f2 PCI-6224
+ 70f3 PXI-6224
+ 70f6 cRIO-9101
+ 70f7 cRIO-9103
+ 70f8 cRIO-9104
+ 70ff PXI-6723
+ 7100 PXI-6722
+ 7104 PCIx-1429
+ 7105 PCIe-1429
+ 710a PXI-4071
+ 710d PXI-6143
+ 710e PCIe-GPIB
+ 710f PXI-5422
+ 7110 PCI-5422
+ 7111 PXI-5441
+ 7119 PXI-6561
+ 711a PXI-6562
+ 711b PCI-6561
+ 711c PCI-6562
+ 7120 PCI-7390
7121 PXI-5122EX
7122 PCI-5122EX
- 7144 PXI-5124 (12-bit 200 MS/s Digitizer)
+ 7123 PXIe-5653
+ 7124 PCI-6510
+ 7125 PCI-6516
+ 7126 PCI-6517
+ 7127 PCI-6518
+ 7128 PCI-6519
+ 7137 PXI-2575
+ 713c PXI-2585
+ 713d PXI-2586
+ 7142 PXI-4224
+ 7144 PXI-5124
7145 PCI-5124
+ 7146 PCI-6132
+ 7147 PXI-6132
+ 7148 PCI-6122
+ 7149 PXI-6122
714c PXI-5114
714d PCI-5114
+ 7150 PXI-2564
7152 PCI-5640R
+ 7156 PXI-1044 Trigger Routing Module
+ 715d PCI-1426
+ 7167 PXI-5412
+ 7168 PCI-5412
+ 716b PCI-6230
716c PCI-6225
- 717d PCIE-6251
+ 716d PXI-6225
+ 716f PCI-4461
+ 7170 PCI-4462
+ 7171 PCI-6010
+ 7174 PXI-8360
+ 7177 PXI-6230
+ 717d PCIe-6251
717f PCIe-6259
+ 7187 PCI-1410
+ 718b PCI-6521
+ 718c PXI-6521
+ 7191 PCI-6154
7193 PXI-7813R
7194 PCI-7813R
- 71bc PCI-6221 (37pin)
- 71d0 PXI-6143
+ 7195 PCI-8254R
+ 7197 PXI-5402
+ 7198 PCI-5402
+ 719f PCIe-6535
+ 71a0 PCIe-6536
+ 71a3 PXI-5650
+ 71a4 PXI-5652
+ 71a5 PXI-2594
+ 71a7 PXI-2595
+ 71a9 PXI-2596
+ 71aa PXI-2597
+ 71ab PXI-2598
+ 71ac PXI-2599
+ 71ad PCI-GPIB+
+ 71ae PCIe-1430
+ 71b7 PXI-1056 Trigger Routing Module
+ 71b8 PXI-1045 Trigger Routing Module
+ 71b9 PXI-1044 Trigger Routing Module
+ 71bb PXI-2584
+ 71bc PCI-6221 (37-pin)
+ 71bf PCIe-1427
+ 71c5 PCI-6520
+ 71c6 PXI-2576
+ 71c7 cRIO-9072
71dc PCI-1588
+ 71e0 PCI-6255
+ 71e1 PXI-6255
+ 71e2 PXI-5406
+ 71e3 PCI-5406
+ 71fc PXI-4022
+ 7209 PCI-6233
+ 720a PXI-6233
+ 720b PCI-6238
+ 720c PXI-6238
7260 PXI-5142
7261 PCI-5142
+ 726d PXI-5651
+ 7273 PXI-4461
+ 7274 PXI-4462
+ 7279 PCI-6232
+ 727a PXI-6232
+ 727b PCI-6239
+ 727c PXI-6239
+ 727e SMBus Controller
+ 1093 75ac PXIe-8388
+ 1093 75ad PXIe-8389
+ 1093 7650 PXIe-8381
+ 1093 8360 PXIe-8360
+ 1093 8370 PXIe-8370
+ 1093 8375 PXIe-8375
+ 7281 PCI-6236
+ 7282 PXI-6236
+ 7283 PXI-2554
+ 7288 PXIe-5611
+ 7293 PCIe-8255R
+ 729d cRIO-9074
+ 72a4 PCIe-4065
+ 72a7 PCIe-6537
72a8 PXI-5152
72a9 PCI-5152
72aa PXI-5105
72ab PCI-5105
72b8 PXI-6682
+ 72d0 PXI-2545
+ 72d1 PXI-2546
+ 72d2 PXI-2547
+ 72d3 PXI-2548
+ 72d4 PXI-2549
+ 72d5 PXI-2555
+ 72d6 PXI-2556
+ 72d7 PXI-2557
+ 72d8 PXI-2558
+ 72d9 PXI-2559
+ 72e8 PXIe-6251
+ 72e9 PXIe-6259
+ 72ef PXI-4498
+ 72f0 PXI-4496
+ 72fb PXIe-6672
+ 730e PXI-4130
730f PXI-5922EX
7310 PCI-5922EX
+ 731c PXI-2535
+ 731d PXI-2536
+ 7322 PXIe-6124
+ 7327 PXI-6529
+ 7331 PXIe-5602
+ 7332 PXIe-5601
7333 PXI-5900
+ 7335 PXI-2533
+ 7336 PXI-2534
+ 7342 PXI-4461
7349 PXI-5154
734a PCI-5154
+ 7357 PXI-4065
+ 7359 PXI-4495
+ 7370 PXI-4461
+ 7373 sbRIO-9601
+ 7374 IOtech-9601
+ 7375 sbRIO-9602
+ 7378 sbRIO-9641
737d PXI-5124EX
7384 PXI-7851R
7385 PXI-7852R
7392 PXI-7853R
7393 PCIe-7841R
7394 PCIe-7842R
+ 7397 sbRIO-9611
+ 7398 sbRIO-9612
+ 7399 sbRIO-9631
+ 739a sbRIO-9632
+ 739b sbRIO-9642
+ 73a1 PXIe-4498
+ 73a2 PXIe-4496
73a5 PXIe-5641R
+ 73a7 PXI-8250 Chassis Monitor Module
+ 73a8 PXI-8511 CAN/LS
+ 73a9 PXI-8511 CAN/LS
+ 73aa PXI-8512 CAN/HS
+ 73ab PXI-8512 CAN/HS
+ 73ac PXI-8513 CAN/XS
+ 73ad PXI-8513 CAN/XS
+ 73af PXI-8516 LIN
+ 73b1 PXI-8517 FlexRay
+ 73b2 PXI-8531 CANopen
+ 73b3 PXI-8531 CANopen
+ 73b4 PXI-8532 DeviceNet
+ 73b5 PXI-8532 DeviceNet
+ 73b6 PCI-8511 CAN/LS
+ 73b7 PCI-8511 CAN/LS
+ 73b8 PCI-8512 CAN/HS
+ 73b9 PCI-8512 CAN/HS
+ 73ba PCI-8513 CAN/XS
+ 73bb PCI-8513 CAN/XS
+ 73bd PCI-8516 LIN
+ 73bf PCI-8517 FlexRay
+ 73c0 PCI-8531 CANopen
+ 73c1 PCI-8531 CANopen
+ 73c2 PCI-8532 DeviceNet
+ 73c3 PCI-8532 DeviceNet
+ 73c5 PXIe-2527
+ 73c6 PXIe-2529
+ 73c8 PXIe-2530
+ 73c9 PXIe-2532
+ 73ca PXIe-2569
+ 73cb PXIe-2575
+ 73cc PXIe-2593
73d5 PXI-7951R
73d6 PXI-7952R
73d7 PXI-7953R
73e1 PXI-7854R
73ec PXI-7954R
+ 73ed cRIO-9073
73f0 PXI-5153
73f1 PCI-5153
+ 73f4 PXI-2515
+ 73f6 cRIO-9111
+ 73f7 cRIO-9112
+ 73f8 cRIO-9113
+ 73f9 cRIO-9114
+ 73fa cRIO-9116
+ 73fb cRIO-9118
+ 7404 PXI-4132
7405 PXIe-6674T
+ 7406 PXIe-6674
+ 740e PCIe-8430/16 (RS-232) Interface
+ 740f PCIe-8430/8 (RS-232) Interface
+ 7410 PCIe-8431/16 (RS-485) Interface
+ 7411 PCIe-8431/8 (RS-485) Interface
+ 7414 PCIe-GPIB+
+ 741c PXI-5691
+ 741d PXI-5695
+ 743c CSC-3059
+ 7448 PXI-2510
+ 7454 PXI-2512
+ 7455 PXI-2514
+ 7456 PXIe-2512
+ 7457 PXIe-2514
+ 745a PXI-6682H
745e PXI-5153EX
745f PCI-5153EX
7460 PXI-5154EX
7461 PCI-5154EX
+ 746d PXIe-5650
+ 746e PXIe-5651
+ 746f PXIe-5652
+ 7472 PXI-2800
+ 7495 PXIe-5603
+ 7497 PXIe-5605
+ 74ae PXIe-2515
+ 74b4 PXI-2531
+ 74b5 PXIe-2531
+ 74c1 PXIe-8430/16 (RS-232) Interface
+ 74c2 PXIe-8430/8 (RS-232) Interface
+ 74c3 PXIe-8431/16 (RS-485) Interface
+ 74c4 PXIe-8431/8 (RS-485) Interface
+ 74d5 PXIe-5630
+ 74d9 PCIe-8432/2 (Isolated RS-232) Interface
+ 74da PCIe-8433/2 (Isolated RS-485) Interface
+ 74db PCIe-8432/4 (Isolated RS-232) Interface
+ 74dc PCIe-8433/4 (Isolated RS-485) Interface
+ 74e8 NI 9148
+ 7515 PCIe-8430/2 (RS-232) Interface
+ 7516 PCIe-8430/4 (RS-232) Interface
+ 7517 PCIe-8431/2 (RS-485) Interface
+ 7518 PCIe-8431/4 (RS-485) Interface
+ 751b cRIO-9081
+ 751c cRIO-9082
+ 7528 PXIe-4497
+ 7529 PXIe-4499
+ 752a PXIe-4492
7539 NI 9157
753a NI 9159
+ 7598 PXI-2571
+ 75a4 PXI-4131A
+ 75b1 PCIe-7854R
+ 75ba PXI-2543
+ 75bb PXIe-2543
75e5 PXI-6683
75e6 PXI-6683H
+ 75ef PXIe-5632
+ 761f PXI-2540
+ 7620 PXIe-2540
+ 7621 PXI-2541
+ 7622 PXIe-2541
7626 NI 9154
7627 NI 9155
- b001 IMAQ-PCI-1408
- b011 IMAQ-PXI-1408
- b021 IMAQ-PCI-1424
- b031 IMAQ-PCI-1413
- b041 IMAQ-PCI-1407
- b051 IMAQ-PXI-1407
- b061 IMAQ-PCI-1411
- b071 IMAQ-PCI-1422
- b081 IMAQ-PXI-1422
- b091 IMAQ-PXI-1411
+ 7638 PXI-2720
+ 7639 PXI-2722
+ 763a PXIe-2725
+ 763b PXIe-2727
+ 763c PXI-4465
+ 764b PXIe-2790
+ 764c PXI-2520
+ 764d PXI-2521
+ 764e PXI-2522
+ 764f PXI-2523
+ 7654 PXI-2796
+ 7655 PXI-2797
+ 7656 PXI-2798
+ 7657 PXI-2799
+ 765d PXI-2542
+ 765e PXIe-2542
+ 765f PXI-2544
+ 7660 PXIe-2544
+ 766d PCIe-6535B
+ 766e PCIe-6536B
+ 766f PCIe-6537B
+ 76a3 PXIe-6535B
+ 76a4 PXIe-6536B
+ 76a5 PXIe-6537B
+ 9020 PXI-2501
+ 9030 PXI-2503
+ 9040 PXI-2527
+ 9050 PXI-2565
+ 9060 PXI-2590
+ 9070 PXI-2591
+ 9080 PXI-2580
+ 9090 PCI-4021
+ 90a0 PXI-4021
+ b001 PCI-1408
+ b011 PXI-1408
+ b021 PCI-1424
+ b022 PXI-1424
+ b031 PCI-1413
+ b041 PCI-1407
+ b051 PXI-1407
+ b061 PCI-1411
+ b071 PCI-1422
+ b081 PXI-1422
+ b091 PXI-1411
+ b0b1 PCI-1409
+ b0c1 PXI-1409
+ b0e1 PCI-1428
c4c4 PXIe/PCIe Device
+ 1093 728a PXIe-5421
+ 1093 728b PXIe-5442
+ 1093 728d PXIe-5451
+ 1093 72a2 PXIe-5122
+ 1093 72da PXIe-5422
+ 1093 72f7 PXIe-6535
+ 1093 72f8 PXIe-6536
+ 1093 72f9 PXIe-6537
+ 1093 7326 PCIe-6509
+ 1093 736c PXIe-4140
+ 1093 738b PXIe-5622
+ 1093 73c4 PXIe-5450
+ 1093 73c7 PXIe-6545
+ 1093 73d4 PXIe-6544
+ 1093 7425 PCIe-6320
+ 1093 7427 PCIe-6321
+ 1093 7428 PXIe-6323
+ 1093 7429 PCIe-6323
+ 1093 742a PXIe-6341
+ 1093 742b PCIe-6341
+ 1093 742c PXIe-6343
+ 1093 742d PCIe-6343
+ 1093 742f PCIe-6351
+ 1093 7431 PCIe-6353
+ 1093 7432 PXIe-6361
+ 1093 7433 PCIe-6361
+ 1093 7434 PXIe-6363
+ 1093 7435 PCIe-6363
+ 1093 7436 PXIe-6356
+ 1093 7437 PXIe-6358
+ 1093 7438 PXIe-6366
+ 1093 7439 PXIe-6368
+ 1093 7468 PXIe-5185
+ 1093 7469 PXIe-5186
+ 1093 7492 PXIe-4300
+ 1093 7498 PXIe-6548
+ 1093 7499 PXIe-6547
+ 1093 74a8 PXIe-4330
+ 1093 74a9 PXIe-4331
+ 1093 74b1 PXIe-4154
1093 74b2 PXIe-4353
+ 1093 74b6 PCIe-1433
+ 1093 74cd PXIe-5643R
1093 74d0 PXIe-7961R
+ 1093 74dd PXIe-6376
+ 1093 74de PXIe-6378
1093 74e2 PXIe-7962R
1093 74e3 PXIe-7965R
+ 1093 74e5 PXIe-4844
+ 1093 74f3 PCIe-5140
+ 1093 753c PXIe-1435
+ 1093 7548 PXIe-5622 (25MHz DDC)
+ 1093 754d PCIe-5155
+ 1093 7551 PXIe-6556
1093 7553 PCIe-1473R
+ 1093 7570 PCIe-1474R
+ 1093 7571 PXIe-1475R
+ 1093 7572 PXIe-1476R
+ 1093 75a2 PXIe-5693
+ 1093 75a3 PXIe-5694
+ 1093 75a5 PXIe-4141
1093 75ce PXIe-7966R
+ 1093 75cf PXIe-4357
+ 1093 75d2 PXIe-RevB-5643R
+ 1093 75d3 PXIe-5644R
+ 1093 75ee PXIe-5645R
+ 1093 7613 PXIe-6555
+ 1093 7619 PXIe-5185
+ 1093 761a PXIe-5186
+ 1093 7629 PXIe-4142
+ 1093 762a PXIe-4143
+ 1093 762b PXIe-4138
+ 1093 762c PXIe-4144
+ 1093 762d PXIe-4145
+ 1093 7644 PXIe-4841
+ 1093 7658 PXIe-5162 (4CH)
+ 1093 76ab PXIe-4322
+ 1093 76ad PXIe-4112
+ 1093 76ae PXIe-4113
+ 1093 76b5 PXIe-7971R
+ 1093 76b6 PXIe-7972R
1093 76b7 PXIe-7975R
- 1093 76d0 PXIe-5160
+ 1093 76c8 PXIe-6614
+ 1093 76c9 PXIe-6612
+ 1093 76cb PXIe-5646R
+ 1093 76cc PXIe-5162 (2CH)
+ 1093 76d0 PXIe-5160 (2CH)
+ 1093 76d1 PXIe-5160 (4CH)
+ 1093 76dc PXIe-4610
+ 1093 76fb PCIe-1473R-LX110
+ 1093 76fe PXIe-5644R
+ 1093 76ff PXIe-5644R
+ 1093 7700 PXIe-5644R
+ 1093 7701 PXIe-5645R
+ 1093 7702 PXIe-5645R
+ 1093 7703 PXIe-5645R
+ 1093 770c PXIe-4139
+ 1093 7711 PXIe-4464
+ 1093 7716 PCIe-6612
+ 1093 771e PXIe-4339
+ 1093 7735 cRIO-9033
+ 1093 774b cRIO-9031
+ 1093 774d cRIO-9034
+ 1093 7755 cRIO-9030
+ 1093 7777 PXIe-7976R
+ 1093 7782 PXIe-5646R
+ 1093 7783 PXIe-5646R
+ 1093 7784 PXIe-5646R
+ 1093 77a5 PXIe-6345
+ 1093 77a6 PXIe-6355
+ 1093 77a7 PXIe-6365
+ 1093 77a8 PXIe-6375
+ 1093 77b4 PXIe-7820R
+ 1093 77b5 PXIe-7821R
+ 1093 77b6 PXIe-7822R
+ 1093 77b9 cRIO-9038
c801 PCI-GPIB
- c831 PCI-GPIB bridge
+ c811 PCI-GPIB+
+ c821 PXI-GPIB
+ c831 PMC-GPIB
+ c840 PCI-GPIB
+ d130 PCI-232/2 Interface
+ d140 PCI-232/4 Interface
+ d150 PCI-232/8 Interface
+ d160 PCI-485/2 Interface
+ d170 PCI-485/4 Interface
+ d190 PXI-8422/2 (Isolated RS-232) Interface
+ d1a0 PXI-8422/4 (Isolated RS-232) Interface
+ d1b0 PXI-8423/2 (Isolated RS-485) Interface
+ d1c0 PXI-8423/4 (Isolated RS-485) Interface
+ d1d0 PXI-8420/2 (RS-232) Interface
+ d1e0 PXI-8420/4 (RS-232) Interface
+ d1f0 PXI-8420/8 (RS-232) Interface
+ d1f1 PXI-8420/16 (RS-232) Interface
+ d230 PXI-8421/2 (RS-485) Interface
+ d240 PXI-8421/4 (RS-485) Interface
+ d250 PCI-232/2 (Isolated) Interface
+ d260 PCI-485/2 (Isolated) Interface
+ d270 PCI-232/4 (Isolated) Interface
+ d280 PCI-485/4 (Isolated) Interface
+ d290 PCI-485/8 Interface
+ d2a0 PXI-8421/8 (RS-485) Interface
+ d2b0 PCI-232/16 Interface
+ e111 PCI-CAN
+ e131 PXI-8461 (1 port)
+ e141 PCI-CAN/LS
+ e151 PXI-8460 (1 port)
+ e211 PCI-CAN/2
+ e231 PXI-8461 (2 ports)
+ e241 PCI-CAN/LS2
+ e251 PXI-8460 (2 ports)
+ e261 PCI-CAN/DS
+ e271 PXI-8462
1094 First International Computers [FIC]
# nee CMD Technology Inc
1095 Silicon Image, Inc.
1095 3512 SiI 3512 SATALink Controller
1095 6512 SiI 3512 SATARaid Controller
3531 SiI 3531 [SATALink/SATARaid] Serial ATA Controller
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
1096 Alacron
1097 Appian Technology
1098 Quantum Designs (H.K.) Ltd
1369 c001 LX6464ES
1369 c201 LX1616ES
14b4 d10a DekTec DTA-110T
+ 14b4 d128 Dektec DTA-140
14b4 d140 Dektec DTA-140
1a0e 006f Dektec DTA-111
9060 PCI9060 32-bit 33MHz PCI <-> IOBus Bridge
0365 MCP55 LPC Bridge
0366 MCP55 LPC Bridge
0367 MCP55 LPC Bridge
- 0368 MCP55 SMBus
+ 0368 MCP55 SMBus Controller
1028 020c PowerEdge M605 MCP55 SMBus
1028 0221 PowerEdge R805 MCP55 SMBus
147b 1c24 KN9 series mainboard
063f G94 [GeForce 9600 GE]
0640 G96 [GeForce 9500 GT]
0641 G96 [GeForce 9400 GT]
+ 1682 4009 PV-T94G-ZAFG
+ 0642 G96 [D9M-10]
0643 G96 [GeForce 9500 GT]
0644 G96 [GeForce 9500 GS]
0645 G96 [GeForce 9500 GS]
0beb GF104 High Definition Audio Controller
1462 2322 N460GTX Cyclone 1GD5/OC
0bee GF116 High Definition Audio Controller
+ 0bf0 Tegra2 PCIe x4 Bridge
+ 0bf1 Tegra2 PCIe x2 Bridge
0ca0 GT215 [GeForce GT 330]
0ca2 GT215 [GeForce GT 320]
0ca3 GT215 [GeForce GT 240]
0e0a GK104 HDMI Audio Controller
0e0b GK106 HDMI Audio Controller
0e0c GF114 HDMI Audio Controller
+ 0e0f GK208 HDMI/DP Audio Controller
+ 0e12 TegraK1 PCIe x4 Bridge
+ 0e13 TegraK1 PCIe x1 Bridge
0e1a GK110 HDMI Audio
0e1b GK107 HDMI Audio Controller
103c 197b ZBook 15
1043 8428 GTX650-DC-1GD5
+ 0e1c Tegra3+ PCIe x4 Bridge
+ 0e1d Tegra3+ PCIe x2 Bridge
0e22 GF104 [GeForce GTX 460]
1462 2322 N460GTX Cyclone 1GD5/OC
0e23 GF104 [GeForce GTX 460 SE]
0e3b GF104GLM [Quadro 4000M]
0f00 GF108 [GeForce GT 630]
0f01 GF108 [GeForce GT 620]
+ 0f02 GF108 [GeForce GT 730]
+ 0fbb GM204 High Definition Audio Controller
0fc0 GK107 [GeForce GT 640 OEM]
0fc1 GK107 [GeForce GT 640]
0fc2 GK107 [GeForce GT 630 OEM]
0fc6 GK107 [GeForce GTX 650]
1043 8428 GTX650-DC-1GD5
+ 0fc8 GK107 [GeForce GT 740]
0fcd GK107M [GeForce GT 755M]
0fce GK107M [GeForce GT 640M LE]
0fd1 GK107M [GeForce GT 650M]
0fd5 GK107M [GeForce GT 650M Mac Edition]
0fd8 GK107M [GeForce GT 640M Mac Edition]
0fd9 GK107M [GeForce GT 645M]
+ 0fdb GK107M
0fdf GK107M [GeForce GT 740M]
0fe0 GK107M [GeForce GTX 660M Mac Edition]
0fe1 GK107M [GeForce GT 730M]
0fe2 GK107M [GeForce GT 745M]
0fe3 GK107M [GeForce GT 745M]
+ 103c 2b16 GeForce GT 745A
17aa 3675 GeForce GT 745A
0fe4 GK107M [GeForce GT 750M]
0fe5 GK107 [GeForce K340 USM]
0fef GK107GL [GRID K340]
0ff1 GK107 [NVS 1000]
0ff2 GK107GL [GRID K1]
+ 0ff3 GK107GL [Quadro K420]
0ff5 GK107GL [GRID K1 Tesla USM]
0ff6 GK107GLM [Quadro K1100M]
103c 197b ZBook 15
0ffd GK107 [NVS 510]
0ffe GK107GL [Quadro K2000]
0fff GK107GL [Quadro 410]
+ 1001 GK110B [GeForce GTX TITAN Z]
1003 GK110 [GeForce GTX Titan LE]
1004 GK110 [GeForce GTX 780]
3842 0784 GK110B [GeForce GTX 780 SC w/ ACX Cooler]
1008 GK110 [GeForce GTX 780 Ti Rev. 2]
100a GK110B [GeForce GTX 780 Ti]
100c GK110B [GeForce GTX Titan Black]
+ 101e GK110GL [Tesla K20X]
101f GK110GL [Tesla K20]
1020 GK110GL [Tesla K20X]
1021 GK110GL [Tesla K20Xm]
1027 GK110BGL [Tesla K40st]
1028 GK110GL [Tesla K20m]
1029 GK110BGL [Tesla K40s]
+ 102a GK110BGL [Tesla K40t]
+ 102d GK210GL [Tesla K80]
+ 102e GK110BGL [Tesla K40d]
103a GK110GL [Quadro K6000]
+ 103c GK110GL [Quadro K5200]
1040 GF119 [GeForce GT 520]
1042 GF119 [GeForce 510]
1048 GF119 [GeForce 605]
10b0 104a Gainward GeForce GT 610
104b GF119 [GeForce GT 625 OEM]
104c GF119 [GeForce GT 705]
+ 104d GF119 [GeForce GT 710]
1050 GF119M [GeForce GT 520M]
1051 GF119M [GeForce GT 520MX]
1052 GF119M [GeForce GT 520M]
10c5 GT218 [GeForce 405]
10d8 GT218 [NVS 300]
1140 GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M]
+ 1019 999f GeForce GT 720M
1025 0600 GeForce GT 620M
1025 0606 GeForce GT 620M
1025 064a GeForce GT 620M
1025 0821 GeForce GT 720M
1025 0823 GeForce GT 720M
1025 0830 GeForce GT 720M
+ 1025 0833 GeForce GT 720M
1025 0837 GeForce GT 720M
+ 1025 083e GeForce 820M
1025 0841 GeForce 710M
+ 1025 0854 GeForce 820M
+ 1025 0855 GeForce 820M
+ 1025 0856 GeForce 820M
+ 1025 0857 GeForce 820M
+ 1025 0858 GeForce 820M
+ 1025 0868 GeForce 820M
+ 1025 0869 GeForce 810M
+ 1025 0873 GeForce 820M
+ 1025 0878 GeForce 820M
+ 1025 087b GeForce 820M
+ 1025 087c GeForce 810M
+ 1025 0881 GeForce 820M
+ 1025 088a GeForce 820M
+ 1025 089b GeForce 820M
+ 1025 090f GeForce 820M
+ 1025 0921 GeForce 820M
+ 1025 092e GeForce 810M
+ 1025 092f GeForce 820M
+ 1025 093a GeForce 820M
+ 1025 093c GeForce 820M
+ 1025 093f GeForce 820M
+ 1025 0941 GeForce 820M
+ 1025 0945 GeForce 820M
+ 1025 0954 GeForce 820M
+ 1025 0965 GeForce 820M
1028 054d GeForce GT 630M
1028 054e GeForce GT 630M
1028 0554 GeForce GT 620M
1028 05e0 GeForce GT 720M
1028 05e8 GeForce GT 630M
1028 05f4 GeForce GT 720M
+ 1028 060f GeForce GT 720M
+ 1028 064e GeForce 820M
+ 1028 0652 GeForce 820M
+ 1028 0653 GeForce 820M
+ 1028 0655 GeForce 820M
+ 1028 065e GeForce 820M
+ 1028 0662 GeForce 820M
+ 1028 068d GeForce 820M
103c 18ef GeForce GT 630M
103c 18f9 GeForce GT 630M
103c 18fb GeForce GT 630M
103c 18fd GeForce GT 630M
103c 18ff GeForce GT 630M
+ 103c 2335 GeForce 820M
+ 103c 2337 GeForce 820M
103c 2aef GeForce GT 720A
103c 2af9 GeForce 710A
1043 10dd NVS 5200M
1043 16cd GeForce 820M
1043 16dd GeForce 820M
1043 170d GeForce 820M
+ 1043 176d GeForce 820M
+ 1043 178d GeForce 820M
+ 1043 179d GeForce 820M
+ 1043 17dd GeForce 820M
1043 2132 GeForce GT 620M
1043 2136 NVS 5200M
1043 21ba GeForce GT 720M
1043 224a GeForce GT 710M
1043 227a GeForce 820M
1043 228a GeForce 820M
+ 1043 232a GeForce 820M
+ 1043 233a GeForce 820M
+ 1043 236a GeForce 820M
+ 1043 238a GeForce 820M
1043 8595 GeForce GT 720M
+ 1043 85ea GeForce GT 720M
+ 1043 85eb GeForce 820M
+ 1043 85ec GeForce 820M
+ 1043 85ee GeForce GT 720M
+ 1043 85f3 GeForce 820M
+ 1043 860e GeForce 820M
+ 1043 861a GeForce 820M
+ 1043 861b GeForce 820M
+ 1043 8628 GeForce 820M
+ 1043 8643 GeForce 820M
+ 1043 864c GeForce 820M
+ 1043 8652 GeForce 820M
+ 105b 0dac GeForce GT 720M
+ 105b 0dad GeForce GT 720M
+ 105b 0ef3 GeForce GT 720M
1072 152d GeForce GT 720M
10cf 17f5 GeForce GT 720M
1179 fa01 GeForce 710M
144d c0e2 NVS 5200M
144d c0e3 NVS 5200M
144d c0e4 NVS 5200M
+ 144d c10d GeForce 820M
144d c652 GeForce GT 620M
144d c709 GeForce 710M
144d c711 GeForce 710M
144d c736 GeForce 710M
+ 144d c737 GeForce 710M
+ 144d c745 GeForce 820M
+ 144d c750 GeForce 820M
1462 10b8 GeForce GT 710M
1462 10e9 GeForce GT 720M
1462 1116 GeForce 820M
1462 aa33 GeForce 720M
1462 aaa2 GeForce GT 720M
1462 aaa3 GeForce 820M
+ 1462 acb2 GeForce GT 720M
+ 1462 acc1 GeForce GT 720M
+ 1462 ae61 GeForce 720M
+ 1462 ae65 GeForce GT 720M
+ 1462 ae6a GeForce 820M
1462 ae71 GeForce GT 720M
+ 14c0 0083 GeForce 820M
152d 0926 GeForce 620M
152d 0982 GeForce GT 630M
152d 0983 GeForce GT 630M
+ 152d 1005 GeForce GT 820M
152d 1012 GeForce 710M
+ 152d 1019 GeForce 820M
152d 1030 GeForce GT 630M
152d 1055 GeForce 710M
152d 1067 GeForce GT 720M
152d 1072 GeForce GT 720M
+ 152d 1086 GeForce 820M
+ 152d 1092 GeForce 820M
17aa 2200 NVS 5200M
17aa 2213 GeForce GT 720M
17aa 2220 GeForce GT 720M
17aa 369c GeForce 820A
17aa 369d GeForce 820A
17aa 369e GeForce 820A
+ 17aa 36a9 GeForce 820A
17aa 3800 GeForce GT 720M
17aa 3801 GeForce GT 720M
17aa 3802 GeForce GT 720M
17aa 3803 GeForce GT 720M
17aa 3804 GeForce GT 720M
+ 17aa 3806 GeForce GT 720M
+ 17aa 3808 GeForce GT 720M
+ 17aa 380d GeForce 820M
+ 17aa 380e GeForce 820M
+ 17aa 380f GeForce 820M
+ 17aa 3811 GeForce 820M
+ 17aa 3812 GeForce 820M
+ 17aa 3813 GeForce 820M
+ 17aa 3816 GeForce 820M
+ 17aa 3818 GeForce 820M
+ 17aa 381a GeForce 820M
+ 17aa 381c GeForce 820M
17aa 3901 GeForce 610M / GT 620M
17aa 3902 GeForce 710M
17aa 3903 GeForce 610M/710M
17aa 3904 GeForce GT 620M/625M
17aa 3905 GeForce GT 720M
+ 17aa 3907 GeForce 820M
17aa 3910 GeForce 720M
17aa 3912 GeForce 720M
+ 17aa 3913 GeForce 820M
+ 17aa 3915 GeForce 820M
17aa 3977 GeForce GT 720M
17aa 3983 GeForce 610M
17aa 5001 GeForce 610M
17aa 502d GeForce 710M
17aa 502e GeForce GT 720M
17aa 502f GeForce GT 720M
+ 17aa 5030 GeForce 705M
+ 17aa 5031 GeForce 705M
+ 17aa 5032 GeForce 820M
+ 17aa 5033 GeForce 820M
17aa 503e GeForce 710M
17aa 503f GeForce 820M
+ 17aa 5040 GeForce 820M
1854 0177 GeForce 710M
1854 0180 GeForce 710M
1854 0190 GeForce GT 720M
1854 0192 GeForce GT 720M
1b0a 20dd GeForce GT 620M
1b0a 20df GeForce GT 620M
+ 1b0a 210e GeForce 820M
1b0a 2202 GeForce GT 720M
+ 1b0a 90d7 GeForce 820M
+ 1b0a 90dd GeForce 820M
1180 GK104 [GeForce GTX 680]
1043 83f1 GTX680-DC2-2GD5
3842 3682 GeForce GTX 680 Mac Edition
10de 101d GRID K200
118e GK104 [GeForce GTX 760 OEM]
118f GK104GL [Tesla K10]
+ 1191 GK104 [GeForce GTX 760 Rev. 2]
1193 GK104 [GeForce GTX 760 Ti OEM]
+ 1194 GK104GL [Tesla K8]
1195 GK104 [GeForce GTX 660 Rev. 2]
1198 GK104M [GeForce GTX 880M]
1199 GK104M [GeForce GTX 870M]
10de 101a GRID K240Q
10de 101b GRID K260Q
11b1 GK104GL [GRID K2 Tesla USM]
+ 11b4 GK104GL [Quadro K4200]
11b6 GK104GLM [Quadro K3100M]
11b7 GK104GLM [Quadro K4100M]
11b8 GK104GLM [Quadro K5100M]
1282 GK208 [GeForce GT 640 Rev. 2]
1284 GK208 [GeForce GT 630 Rev. 2]
1286 GK208 [GeForce GT 720]
+ 1287 GK208 [GeForce GT 730]
+ 1288 GK208 [GeForce GT 720]
1290 GK208M [GeForce GT 730M]
103c 2afa GeForce GT 730A
103c 2b04 GeForce GT 730A
1293 GK208M [GeForce GT 730M]
1294 GK208M [GeForce GT 740M]
1295 GK208M [GeForce 710M]
+ 103c 2b0d GeForce GT 710A
+ 103c 2b0f GeForce GT 710A
+ 103c 2b11 GeForce GT 710A
+ 103c 2b20 GeForce 810A
+ 103c 2b21 GeForce GT 810A
+ 103c 2b22 GeForce GT 810A
1296 GK208M [GeForce 825M]
1298 GK208M [GeForce GT 720M]
+ 1299 GK208M [GeForce 920M]
12a0 GK208
12b9 GK208GLM [Quadro K610M]
12ba GK208GLM [Quadro K510M]
1340 GM108M [GeForce 830M]
+ 103c 2b2b GeForce 830A
1341 GM108M [GeForce 840M]
17aa 3697 GeForce 840A
17aa 3699 GeForce 840A
17aa 369c GeForce 840A
+ 1346 GM108M [GeForce 930M]
+ 1347 GM108M [GeForce 940M]
1380 GM107 [GeForce GTX 750 Ti]
1381 GM107 [GeForce GTX 750]
1382 GM107 [GeForce GTX 745]
+ 1389 GM107GL [GRID M30]
1390 GM107M [GeForce 845M]
1391 GM107M [GeForce GTX 850M]
17aa 3697 GeForce GTX 850A
17aa a125 GeForce GTX 850A
1392 GM107M [GeForce GTX 860M]
1393 GM107M [GeForce 840M]
+ 1398 GM107M [GeForce 845M]
+ 139a GM107M [GeForce GTX 950M]
+ 139b GM107M [GeForce GTX 960M]
+ 139c GM107M [GeForce 940M]
+ 13b0 GM107GLM [N16P-Q3]
+ 13b3 GM107GLM [Quadro K2200M]
+ 13ba GM107GL [Quadro K2200]
+ 13bb GM107GL [Quadro K620]
+ 13bc GM107GL [Quadro K1200]
+ 13bd GM107GL [GRID M40]
+ 13c0 GM204 [GeForce GTX 980]
+ 1043 8504 GTX980-4GD5
+ 13c1 GM204
+ 13c2 GM204 [GeForce GTX 970]
+ 13c3 GM204
+ 13d7 GM204M [GeForce GTX 980M]
+ 13d8 GM204M [GeForce GTX 970M]
+ 13d9 GM204M [GeForce GTX 965M]
+ 1401 GM206 [GeForce GTX 960]
+ 17f0 GM200GL [Quadro M6000]
10df Emulex Corporation
0720 OneConnect NIC (Skyhawk)
17aa 1056 ThinkServer OCm14102-UX-L AnyFabric
8406 PCIcanx/PCIcan CAN interface [Kvaser AB]
8407 PCIcan II CAN interface (A1021, PCB-07, PCB-08) [Kvaser AB]
8851 S5933 on Innes Corp FM Radio Capture card
+ e004 X-Gene PCIe bridge
10e9 Alps Electric Co., Ltd.
10ea Integraphics
1680 IGA-1680
5249 RTS5249 PCI Express Card Reader
103c 1909 ZBook 15
5288 RTS5288 PCI Express Card Reader
+ 5289 RTL8411 PCI Express Card Reader
+ 1043 1457 K55A Laptop
8029 RTL-8029(AS)
10b8 2011 EZ-Card (SMC1208)
10ec 8029 RTL-8029(AS)
10ec 8129 RT8129 Fast Ethernet Adapter
11ec 8129 RTL8111/8168 PCIe Gigabit Ethernet (misconfigured)
8136 RTL8101E/RTL8102E PCI Express Fast Ethernet controller
- 103c 2ab1 Pavillion p6774
+ 103c 2ab1 Pavilion p6774
103c 30cc Pavilion dv6700
1179 ff64 RTL8102E PCI-E Fast Ethernet NIC
+ 17c0 1053 AzureWave AW-NE766 802.11B/G/N Mini PCIe Card Model RT2700E
8138 RT8139 (B/C) Cardbus Fast Ethernet Adapter
10ec 8138 RT8139 (B/C) Fast Ethernet Adapter
8139 RTL-8100/8101L/8139 PCI Fast Ethernet Adapter
1043 82c6 M3A78-EH Motherboard
1043 83a3 M4A785TD Motherboard
1043 8432 P8P67 and other motherboards
- 1043 8505 P8H77-I Motherboard
+ 1043 8505 P8 series motherboard
105b 0d7c D270S/D250S Motherboard
10ec 8168 RTL8111/8168 PCI Express Gigabit Ethernet controller
1458 e000 Motherboard
1102 0018 SB1040
000b EMU20k2 [X-Fi Titanium Series]
1102 0041 SB0880 [SoundBlaster X-Fi Titanium PCI-e]
+ 0012 SB Recon3D
4001 SB Audigy FireWire Port
1102 0010 SB Audigy FireWire Port
7002 SB Live! Game Port
0620 RocketRAID 620 2 Port SATA-III Controller
0622 RocketRAID 622 2 Port SATA-III Controller
0640 RocketRAID 640 4 Port SATA-III Controller
+ 0644 RocketRAID 644 4 Port SATA-III Controller (eSATA)
+ 0645 RocketRAID 644L 4 Port SATA-III Controller (eSATA)
1720 RocketRAID 1720 (2x SATA II RAID Controller)
1740 RocketRAID 1740
1742 RocketRAID 1742
1458 0691 VT82C691 Apollo Pro System Controller
0693 VT82C693 [Apollo Pro Plus]
0698 VT82C693A [Apollo Pro133 AGP]
+ 0709 VX11 Standard Host Bridge
+ 070a VX11 PCI Express Root Port
+ 070b VX11 PCI Express Root Port
+ 070c VX11 PCI Express Root Port
+ 070d VX11 PCI Express Root Port
+ 070e VX11 PCI Express Root Port
0926 VT82C926 [Amazon]
1000 VT82C570MV
1106 VT82C570MV
1458 5000 GA-7VAX Mainboard
# probably all K7VT2/4*/6
1849 3189 K7VT series Motherboards
+ 31b0 VX11 Standard Host Bridge
+ 31b1 VX11 Standard Host Bridge
+ 31b2 VX11 DRAM Controller
+ 31b3 VX11 Power Management Controller
+ 31b4 VX11 I/O APIC
+ 31b5 VX11 Scratch Device
+ 31b7 VX11 Standard Host Bridge
+ 31b8 VX11 PCI to PCI Bridge
3204 K8M800 Host Bridge
3205 VT8378 [KM400/A] Chipset Host Bridge
1458 5000 GA-7VM400M Motherboard
3410 VX900 DRAM Bus Control
19da a179 ZBOX nano VD01
3432 VL80x xHCI USB 3.0 Controller
+ 3456 VX11 Standard Host Bridge
+ 345b VX11 Miscellaneous Bus
+ 3a01 VX11 Graphics [Chrome 645/640]
4149 VIA VT6420 (ATA133) Controller
4204 K8M800 Host Bridge
4208 PT890 Host Bridge
8d01 PN133/PN133T [S3 Twister]
8d04 KM266/P4M266/P4M266A/P4N266 [S3 ProSavageDDR]
9001 VX900 Serial ATA Controller
+ 9082 Standard AHCI 1.0 SATA Controller
+ 9140 HDMI Audio Device
+ 9201 USB3.0 Controller
9530 Secure Digital Memory Card Controller
95d0 SDIO Host Controller
a208 PT890 PCI to PCI Bridge Controller
e238 K8T890 PCI to PCI Bridge Controller
e340 PT900 PCI to PCI Bridge Controller
e353 VX800/VX820 PCI Express Root Port
+ e410 VX900 PCI Express Physical Layer Electrical Sub-block
f208 PT890 PCI to PCI Bridge Controller
f238 K8T890 PCI to PCI Bridge Controller
f340 PT900 PCI to PCI Bridge Controller
806c PES16T4A/4T4G2 PCI Express Gen2 Switch
806e PES24T6G2 PCI Express Gen2 Switch
806f HIO524G2 PCI Express Gen2 Switch
+ 8088 PES32NT8BG2 PCI Express Switch
+ 1093 752f PXIe-8383mc Device
+ 1093 7543 PXIe-8383mc System Host
+ 1093 755c PXIe-8364
+ 1093 755d PXIe-8374
+ 1093 75ff PXIe-8383mc DMA
+ 1093 7600 PXIe-8383mc DMA
+ 1093 7602 PXIe-8384
111e Eldec
111f Precision Digital Images
4a47 Precision MX Video engine interface
13c2 1019 S2-3200
13c2 1102 Technotrend/Hauppauge DVB card rev2.1
153b 1155 Cinergy 1200 DVB-S
- 153b 1156 Terratec Cynergy 1200C
+ 153b 1156 Cinergy 1200 DVB-C
153b 1157 Cinergy 1200 DVB-T
+ 153b 1176 Cinergy 1200 DVB-C (MK3)
1894 0020 KNC One DVB-C V1.0
1894 0023 TVStation DVB-C plus
+# http://www.knc1.com/gb.htm
+ 1894 0054 TV-Station DVB-S
7160 SAA7160
1458 9009 E8000 DVB-T/Analog TV/FM tuner
1461 1455 AVerTV Hybrid Speedy PCI-E (H788)
0070 8993 WinTV HVR-2200
0070 89a0 WinTV HVR-2200
0070 89a1 WinTV HVR-2200
+ 0070 f123 WinTV HVR-2205
7231 SAA7231
5ace 8000 Behold TV H8
5ace 8001 Behold TV H8
1137 Cisco Systems Inc
0023 VIC 81 PCIe Upstream Port
0040 VIC PCIe Upstream Port
+ 1137 004f VIC 1280 Dual 40Gb Mezzanine
+ 1137 0084 VIC 1240 Dual 40Gb MLOM
+ 1137 0085 VIC 1225 Dual 10Gb SFP+ PCIe
+ 1137 00cd VIC 1285 Dual 40Gb QSFP+ PCIe
+ 1137 00ce VIC 1225T Dual 10GBaseT PCIe
+ 1137 012a VIC M4308 Dual 40Gb
+ 1137 012c VIC 1340 Dual 40Gb MLOM
+ 1137 012e VIC 1227 Dual 10Gb SFP+ PCIe
+ 1137 0137 VIC 1380 Dual 40Gb Mezzanine
0041 VIC PCIe Downstream Port
0042 VIC Management Controller
1137 0047 VIC P81E PCIe Management Controller
1137 0085 VIC 1225 PCIe Management Controller
1137 00cd VIC 1285 PCIe Management Controller
1137 00ce VIC 1225T PCIe Management Controller
+ 1137 012e VIC 1227 PCIe Management Controller
0043 VIC Ethernet NIC
1137 0047 VIC P81E PCIe Ethernet NIC
1137 0048 VIC M81KR Mezzanine Ethernet NIC
1137 0085 VIC 1225 PCIe Ethernet NIC
1137 00cd VIC 1285 PCIe Ethernet NIC
1137 00ce VIC 1225T PCIe Ethernet NIC
+ 1137 012a VIC M4308 Ethernet NIC
+ 1137 012c VIC 1340 MLOM Ethernet NIC
+ 1137 012e VIC 1227 PCIe Ethernet NIC
+ 1137 0137 VIC 1380 Mezzanine Ethernet NIC
0044 VIC Ethernet NIC Dynamic
1137 0047 VIC P81E PCIe Ethernet NIC Dynamic
1137 0048 VIC M81KR Mezzanine Ethernet NIC Dynamic
1137 0085 VIC 1225 PCIe Ethernet NIC Dynamic
1137 00cd VIC 1285 PCIe Ethernet NIC Dynamic
1137 00ce VIC 1225T PCIe Ethernet NIC Dynamic
+ 1137 012a VIC M4308 Ethernet NIC Dynamic
+ 1137 012c VIC 1340 MLOM Ethernet NIC Dynamic
+ 1137 012e VIC 1227 PCIe Ethernet NIC Dynamic
+ 1137 0137 VIC 1380 Mezzanine Ethernet NIC Dynamic
0045 VIC FCoE HBA
1137 0047 VIC P81E PCIe FCoE HBA
1137 0048 VIC M81KR Mezzanine FCoE HBA
1137 0085 VIC 1225 PCIe FCoE HBA
1137 00cd VIC 1285 PCIe FCoE HBA
1137 00ce VIC 1225T PCIe FCoE HBA
+ 1137 012a VIC M4308 FCoE HBA
+ 1137 012c VIC 1340 MLOM FCoE HBA
+ 1137 012e VIC 1227 PCIe FCoE HBA
+ 1137 0137 VIC 1380 Mezzanine FCoE HBA
+ 0046 VIC SCSI Controller
+ 1137 012a VIC M4308 SCSI Controller
004e VIC 82 PCIe Upstream Port
0071 VIC SR-IOV VF
+ 007a VIC 1300 PCIe Upstream Port
+ 1137 012a VIC M4308 Dual 40Gb
+ 1137 012c VIC 1340 Dual 40Gb MLOM
+ 1137 0137 VIC 1380 Dual 40Gb Mezzanine
00cf VIC Userspace NIC
+ 1137 004f VIC 1280 Mezzanine Userspace NIC
+ 1137 0084 VIC 1240 MLOM Userspace NIC
+ 1137 0085 VIC 1225 PCIe Userspace NIC
+ 1137 00cd VIC 1285 PCIe Userspace NIC
+ 1137 00ce VIC 1225T PCIe Userspace NIC
+ 1137 012a VIC M4308 Userspace NIC
+ 1137 012c VIC 1340 MLOM Userspace NIC
+ 1137 012e VIC 1227 PCIe Userspace NIC
+ 1137 0137 VIC 1380 Mezzanine Userspace NIC
1138 Ziatech Corporation
8905 8905 [STD 32 Bridge]
1139 Dynamic Pictures, Inc
117a A-Trend Technology
117b L G Electronics, Inc.
117c ATTO Technology, Inc.
- 002c SAS RAID Adapter
+ 002c ExpressSAS R380
+ 002d ExpressSAS R348
0030 Ultra320 SCSI Host Adapter
117c 8013 ExpressPCI UL4D
117c 8014 ExpressPCI UL4S
117c 8027 ExpressPCI UL5D
117c 802f ExpressPCI UL5D Low Profile
0033 SAS Adapter
+ 0041 ExpressSAS R30F
+ 8013 ExpressPCI UL4D
+ 8014 ExpressPCI UL4S
+ 8027 ExpressPCI UL5D
117d Becton & Dickinson
117e T/R Systems
117f Integrated Circuit Systems
4353 88E8039 PCI-E Fast Ethernet Controller
104d 902d VAIO VGN-NR120E
4354 88E8040 PCI-E Fast Ethernet Controller
+ 144d c06a R730 Laptop
144d c072 Notebook N150P
4355 88E8040T PCI-E Fast Ethernet Controller
1179 ff50 Satellite P305D-S8995E
16b8 434b Tempo SATA E4P
7810 MV78100 [Discovery Innovation] ARM SoC
7820 MV78200 [Discovery Innovation] ARM SoC
+ 7823 MV78230 [Armada XP] ARM SoC
+ 7846 88F6820 [Armada 385] ARM SoC
f003 GT-64010 Primary Image Piranha Image Generator
11ac Canon Information Systems Research Aust.
11ad Lite-On Communications Inc
0002 V300PSC
0292 V292PBC [Am29030/40 Bridge]
0960 V96xPBC
+ 880a Deltacast Delta-HD-22
c960 V96DPC
11b1 Apricot Computers
11b2 Eastman Kodak
1216 Purup Prepress A/S
1217 O2 Micro, Inc.
00f7 Firewire (IEEE 1394)
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
1179 ff50 Satellite P305D-S8995E
10f7 1394 OHCI Compliant Host Controller
11f7 OZ600 1394a-2000 Controller
1025 0035 TravelMate 660
7114 OZ711M1/MC1 4-in-1 MemoryCardBus Controller
7120 Integrated MMC/SD Controller
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
1179 ff50 Satellite P305D-S8995E
7130 Integrated MS/xD Controller
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
1179 ff50 Satellite P305D-S8995E
7134 OZ711MP1/MS1 MemoryCardBus Controller
7135 Cardbus bridge
7233 OZ711MP3/MS3 4-in-1 MemoryCardBus Controller
8120 Integrated MMC/SD Controller
8130 Integrated MS/MSPRO/xD Controller
- 8320 OZ600 MMC/SD Controller
+ 8220 OZ600FJ1/OZ900FJ1 SD/MMC Card Reader Controller
+ 8221 OZ600FJ0/OZ900FJ0/OZ600FJS SD/MMC Card Reader Controller
+ 8320 OZ600RJ1/OZ900RJ1 SD/MMC Card Reader Controller
1028 04a3 Precision M4600
- 8321 Integrated MMC/SD controller
+ 8321 OZ600RJ0/OZ900RJ0/OZ600RJS SD/MMC Card Reader Controller
8330 OZ600 MS/xD Controller
1028 04a3 Precision M4600
8331 O2 Flash Memory Card
0204 GPS170PCI GPS Receiver
0205 GPS170PEX GPS Receiver (PCI Express)
0206 GPS180PEX GPS Receiver (PCI Express)
+ 0207 GLN180PEX GPS/GLONASS receiver (PCI Express)
+ 0208 GPS180AMC GPS Receiver (PCI Express / MicroTCA / AdvancedMC)
0301 TCR510PCI IRIG Timecode Reader
0302 TCR167PCI IRIG Timecode Reader
0303 TCR511PCI IRIG Timecode Reader
1043 838e Virtuoso 66 (Xonar DS)
1043 8428 Virtuoso 100 (Xonar Xense)
1043 8467 CMI8786 (Xonar DG)
+ 1043 85f4 Virtuoso 100 (Xonar Essence STX II)
13f6 8782 PCI 2.0 HD Audio
13f6 ffff CMI8787-HG2PCI
14c3 1710 HiFier Fantasia
4081 T440F-4081 T440-FCoE Unified Wire Ethernet Controller
4082 T420-4082 Unified Wire Ethernet Controller
4083 T420X-4083 Unified Wire Ethernet Controller
- 4084 T420-4084 Unified Wire Ethernet Controller
+ 4084 T440-4084 Unified Wire Ethernet Controller
4085 T420-4085 SFP+ Unified Wire Ethernet Controller
4086 T440-4086 10Gbase-T Unified Wire Ethernet Controller
4087 T440T-4087 Unified Wire Ethernet Controller
4481 T440F-4081 T440-FCoE Unified Wire Ethernet Controller
4482 T420-4082 Unified Wire Ethernet Controller
4483 T420X-4083 Unified Wire Ethernet Controller
- 4484 T420-4084 Unified Wire Ethernet Controller
+ 4484 T440-4084 Unified Wire Ethernet Controller
4485 T420-4085 SFP+ Unified Wire Ethernet Controller
4486 T440-4086 10Gbase-T Unified Wire Ethernet Controller
4487 T440T-4087 Unified Wire Ethernet Controller
4581 T440F-4081 T440-FCoE Unified Wire Storage Controller
4582 T420-4082 Unified Wire Storage Controller
4583 T420X-4083 Unified Wire Storage Controller
- 4584 T420-4084 Unified Wire Storage Controller
+ 4584 T440-4084 Unified Wire Storage Controller
4585 T420-4085 SFP+ Unified Wire Storage Controller
4586 T440-4086 10Gbase-T Unified Wire Storage Controller
4587 T440T-4087 Unified Wire Storage Controller
4681 T440F-4081 T440-FCoE Unified Wire Storage Controller
4682 T420-4082 Unified Wire Storage Controller
4683 T420X-4083 Unified Wire Storage Controller
- 4684 T420-4084 Unified Wire Storage Controller
+ 4684 T440-4084 Unified Wire Storage Controller
4685 T420-4085 SFP+ Unified Wire Storage Controller
4686 T440-4086 10Gbase-T Unified Wire Storage Controller
4687 T440T-4087 Unified Wire Storage Controller
4781 T440F-4081 T440-FCoE Unified Wire Ethernet Controller
4782 T420-4082 Unified Wire Ethernet Controller
4783 T420X-4083 Unified Wire Ethernet Controller
- 4784 T420-4084 Unified Wire Ethernet Controller
+ 4784 T440-4084 Unified Wire Ethernet Controller
4785 T420-4085 SFP+ Unified Wire Ethernet Controller
4786 T440-4086 10Gbase-T Unified Wire Ethernet Controller
4787 T440T-4087 Unified Wire Ethernet Controller
4788 T440-4088 Unified Wire Ethernet Controller
- 4801 T420-CR Unified Wire Ethernet Controller
- 4802 T422-CR Unified Wire Ethernet Controller
- 4803 T440-CR Unified Wire Ethernet Controller
- 4804 T420-BCH Unified Wire Ethernet Controller
- 4805 T440-BCH Unified Wire Ethernet Controller
- 4806 T440-CH Unified Wire Ethernet Controller
- 4807 T420-SO Unified Wire Ethernet Controller
- 4808 T420-CX Unified Wire Ethernet Controller
- 4809 T420-BT Unified Wire Ethernet Controller
- 480a T404-BT Unified Wire Ethernet Controller
- 480b B420-SR Unified Wire Ethernet Controller
- 480c B404-BT Unified Wire Ethernet Controller
- 480d T480 Unified Wire Ethernet Controller
- 480e T440-LP-CR Unified Wire Ethernet Controller
- 480f T440 [Amsterdam] Unified Wire Ethernet Controller
- 4880 T480-4080 T480 Unified Wire Ethernet Controller
- 4881 T440F-4081 T440-FCoE Unified Wire Ethernet Controller
- 4882 T420-4082 Unified Wire Ethernet Controller
- 4883 T420X-4083 Unified Wire Ethernet Controller
- 4884 T420-4084 Unified Wire Ethernet Controller
- 4885 T420-4085 SFP+ Unified Wire Ethernet Controller
- 4886 T440-4086 10Gbase-T Unified Wire Ethernet Controller
- 4887 T440T-4087 Unified Wire Ethernet Controller
- 4888 T440-4088 Unified Wire Ethernet Controller
+ 4801 T420-CR Unified Wire Ethernet Controller [VF]
+ 4802 T422-CR Unified Wire Ethernet Controller [VF]
+ 4803 T440-CR Unified Wire Ethernet Controller [VF]
+ 4804 T420-BCH Unified Wire Ethernet Controller [VF]
+ 4805 T440-BCH Unified Wire Ethernet Controller [VF]
+ 4806 T440-CH Unified Wire Ethernet Controller [VF]
+ 4807 T420-SO Unified Wire Ethernet Controller [VF]
+ 4808 T420-CX Unified Wire Ethernet Controller [VF]
+ 4809 T420-BT Unified Wire Ethernet Controller [VF]
+ 480a T404-BT Unified Wire Ethernet Controller [VF]
+ 480b B420-SR Unified Wire Ethernet Controller [VF]
+ 480c B404-BT Unified Wire Ethernet Controller [VF]
+ 480d T480 Unified Wire Ethernet Controller [VF]
+ 480e T440-LP-CR Unified Wire Ethernet Controller [VF]
+ 480f T440 [Amsterdam] Unified Wire Ethernet Controller [VF]
+ 4880 T480-4080 T480 Unified Wire Ethernet Controller [VF]
+ 4881 T440F-4081 T440-FCoE Unified Wire Ethernet Controller [VF]
+ 4882 T420-4082 Unified Wire Ethernet Controller [VF]
+ 4883 T420X-4083 Unified Wire Ethernet Controller [VF]
+ 4884 T440-4084 Unified Wire Ethernet Controller [VF]
+ 4885 T420-4085 SFP+ Unified Wire Ethernet Controller [VF]
+ 4886 T440-4086 10Gbase-T Unified Wire Ethernet Controller [VF]
+ 4887 T440T-4087 Unified Wire Ethernet Controller [VF]
+ 4888 T440-4088 Unified Wire Ethernet Controller [VF]
5001 T520-CR Unified Wire Ethernet Controller
5002 T522-CR Unified Wire Ethernet Controller
5003 T540-CR Unified Wire Ethernet Controller
5010 T580-LP-CR Unified Wire Ethernet Controller
5011 T520-LL-CR Unified Wire Ethernet Controller
5012 T560-CR Unified Wire Ethernet Controller
- 5013 T580-CR Unified Wire Ethernet Controller
+ 5013 T580-CHR Unified Wire Ethernet Controller
5014 T580-LP-SO-CR Unified Wire Ethernet Controller
5015 T502-BT Unified Wire Ethernet Controller
5080 T540-5080 Unified Wire Ethernet Controller
5081 T540-5081 Unified Wire Ethernet Controller
+ 5082 T504-5082 Unified Wire Ethernet Controller
5083 T540-5083 Unified Wire Ethernet Controller
5084 T580-5084 Unified Wire Ethernet Controller
5085 T580-5085 Unified Wire Ethernet Controller
+ 5086 T580-5086 Unified Wire Ethernet Controller
+ 5087 T580-5087 Unified Wire Ethernet Controller
+ 5088 T570-5088 Unified Wire Ethernet Controller
+ 5089 T520-5089 Unified Wire Ethernet Controller
5401 T520-CR Unified Wire Ethernet Controller
5402 T522-CR Unified Wire Ethernet Controller
5403 T540-CR Unified Wire Ethernet Controller
5410 T580-LP-CR Unified Wire Ethernet Controller
5411 T520-LL-CR Unified Wire Ethernet Controller
5412 T560-CR Unified Wire Ethernet Controller
- 5413 T580-CR Unified Wire Ethernet Controller
+ 5413 T580-CHR Unified Wire Ethernet Controller
5414 T580-LP-SO-CR Unified Wire Ethernet Controller
5415 T502-BT Unified Wire Ethernet Controller
5480 T540-5080 Unified Wire Ethernet Controller
5481 T540-5081 Unified Wire Ethernet Controller
+ 5482 T504-5082 Unified Wire Ethernet Controller
5483 T540-5083 Unified Wire Ethernet Controller
5484 T580-5084 Unified Wire Ethernet Controller
5485 T580-5085 Unified Wire Ethernet Controller
+ 5486 T580-5086 Unified Wire Ethernet Controller
+ 5487 T580-5087 Unified Wire Ethernet Controller
+ 5488 T570-5088 Unified Wire Ethernet Controller
+ 5489 T520-5089 Unified Wire Ethernet Controller
5501 T520-CR Unified Wire Storage Controller
5502 T522-CR Unified Wire Storage Controller
5503 T540-CR Unified Wire Storage Controller
5510 T580-LP-CR Unified Wire Storage Controller
5511 T520-LL-CR Unified Wire Storage Controller
5512 T560-CR Unified Wire Storage Controller
- 5513 T580-CR Unified Wire Storage Controller
+ 5513 T580-CHR Unified Wire Storage Controller
5514 T580-LP-SO-CR Unified Wire Storage Controller
5515 T502-BT Unified Wire Storage Controller
5580 T540-5080 Unified Wire Storage Controller
5581 T540-5081 Unified Wire Storage Controller
+ 5582 T504-5082 Unified Wire Storage Controller
5583 T540-5083 Unified Wire Storage Controller
5584 T580-5084 Unified Wire Storage Controller
5585 T580-5085 Unified Wire Storage Controller
+ 5586 T580-5086 Unified Wire Storage Controller
+ 5587 T580-5087 Unified Wire Storage Controller
+ 5588 T570-5088 Unified Wire Storage Controller
+ 5589 T520-5089 Unified Wire Storage Controller
5601 T520-CR Unified Wire Storage Controller
5602 T522-CR Unified Wire Storage Controller
5603 T540-CR Unified Wire Storage Controller
5610 T580-LP-CR Unified Wire Storage Controller
5611 T520-LL-CR Unified Wire Storage Controller
5612 T560-CR Unified Wire Storage Controller
- 5613 T580-CR Unified Wire Storage Controller
+ 5613 T580-CHR Unified Wire Storage Controller
5614 T580-LP-SO-CR Unified Wire Storage Controller
5615 T502-BT Unified Wire Storage Controller
5680 T540-5080 Unified Wire Storage Controller
5681 T540-5081 Unified Wire Storage Controller
+ 5682 T504-5082 Unified Wire Storage Controller
5683 T540-5083 Unified Wire Storage Controller
5684 T580-5084 Unified Wire Storage Controller
5685 T580-5085 Unified Wire Storage Controller
+ 5686 T580-5086 Unified Wire Storage Controller
+ 5687 T580-5087 Unified Wire Storage Controller
+ 5688 T570-5088 Unified Wire Storage Controller
+ 5689 T520-5089 Unified Wire Storage Controller
5701 T520-CR Unified Wire Ethernet Controller
5702 T522-CR Unified Wire Ethernet Controller
5703 T540-CR Unified Wire Ethernet Controller
5715 T502-BT Unified Wire Ethernet Controller
5780 T540-5080 Unified Wire Ethernet Controller
5781 T540-5081 Unified Wire Ethernet Controller
+ 5782 T504-5082 Unified Wire Ethernet Controller
5783 T540-5083 Unified Wire Ethernet Controller
5784 T580-5084 Unified Wire Ethernet Controller
5785 T580-5085 Unified Wire Ethernet Controller
- 5801 T520-CR Unified Wire Ethernet Controller
- 5802 T522-CR Unified Wire Ethernet Controller
- 5803 T540-CR Unified Wire Ethernet Controller
- 5804 T520-BCH Unified Wire Ethernet Controller
- 5805 T540-BCH Unified Wire Ethernet Controller
- 5806 T540-CH Unified Wire Ethernet Controller
- 5807 T520-SO Unified Wire Ethernet Controller
- 5808 T520-CX Unified Wire Ethernet Controller
- 5809 T520-BT Unified Wire Ethernet Controller
- 580a T504-BT Unified Wire Ethernet Controller
- 580b B520-SR Unified Wire Ethernet Controller
- 580c B504-BT Unified Wire Ethernet Controller
- 580d T580-CR Unified Wire Ethernet Controller
- 580e T540-LP-CR Unified Wire Ethernet Controller
- 580f T540 [Amsterdam] Unified Wire Ethernet Controller
- 5810 T580-LP-CR Unified Wire Ethernet Controller
- 5811 T520-LL-CR Unified Wire Ethernet Controller
- 5812 T560-CR Unified Wire Ethernet Controller
- 5813 T580-CR Unified Wire Ethernet Controller
- 5814 T580-LP-SO-CR Unified Wire Ethernet Controller
- 5815 T502-BT Unified Wire Ethernet Controller
- 5880 T540-5080 Unified Wire Ethernet Controller
- 5881 T540-5081 Unified Wire Ethernet Controller
- 5883 T540-5083 Unified Wire Ethernet Controller
- 5884 T580-5084 Unified Wire Ethernet Controller
- 5885 T580-5085 Unified Wire Ethernet Controller
+ 5786 T580-5086 Unified Wire Ethernet Controller
+ 5787 T580-5087 Unified Wire Ethernet Controller
+ 5788 T570-5088 Unified Wire Ethernet Controller
+ 5789 T520-5089 Unified Wire Ethernet Controller
+ 5801 T520-CR Unified Wire Ethernet Controller [VF]
+ 5802 T522-CR Unified Wire Ethernet Controller [VF]
+ 5803 T540-CR Unified Wire Ethernet Controller [VF]
+ 5804 T520-BCH Unified Wire Ethernet Controller [VF]
+ 5805 T540-BCH Unified Wire Ethernet Controller [VF]
+ 5806 T540-CH Unified Wire Ethernet Controller [VF]
+ 5807 T520-SO Unified Wire Ethernet Controller [VF]
+ 5808 T520-CX Unified Wire Ethernet Controller [VF]
+ 5809 T520-BT Unified Wire Ethernet Controller [VF]
+ 580a T504-BT Unified Wire Ethernet Controller [VF]
+ 580b B520-SR Unified Wire Ethernet Controller [VF]
+ 580c B504-BT Unified Wire Ethernet Controller [VF]
+ 580d T580-CR Unified Wire Ethernet Controller [VF]
+ 580e T540-LP-CR Unified Wire Ethernet Controller [VF]
+ 580f T540 [Amsterdam] Unified Wire Ethernet Controller [VF]
+ 5810 T580-LP-CR Unified Wire Ethernet Controller [VF]
+ 5811 T520-LL-CR Unified Wire Ethernet Controller [VF]
+ 5812 T560-CR Unified Wire Ethernet Controller [VF]
+ 5813 T580-CHR Unified Wire Ethernet Controller [VF]
+ 5814 T580-LP-SO-CR Unified Wire Ethernet Controller [VF]
+ 5815 T502-BT Unified Wire Ethernet Controller [VF]
+ 5880 T540-5080 Unified Wire Ethernet Controller [VF]
+ 5881 T540-5081 Unified Wire Ethernet Controller [VF]
+ 5882 T504-5082 Unified Wire Ethernet Controller [VF]
+ 5883 T540-5083 Unified Wire Ethernet Controller [VF]
+ 5884 T580-5084 Unified Wire Ethernet Controller [VF]
+ 5885 T580-5085 Unified Wire Ethernet Controller [VF]
+ 5886 T580-5086 Unified Wire Ethernet Controller [VF]
+ 5887 T580-5087 Unified Wire Ethernet Controller [VF]
+ 5888 T570-5088 Unified Wire Ethernet Controller [VF]
+ 5889 T520-5089 Unified Wire Ethernet Controller [VF]
a000 PE10K Unified Wire Ethernet Controller
1426 Storage Technology Corp.
1427 Better On-Line Solutions
1003 HCF 56k Data/Fax Modem
148e OSI Plus Corporation
148f Plant Equipment, Inc.
+ 5370 Dexlink AUWL15I1
1490 Stone Microsystems PTY Ltd.
1491 ZEAL Corporation
1492 Time Logic Corporation
14c2 DTK Computer
14c3 MEDIATEK Corp.
7630 MT7630e 802.11bgn Wireless Network Adapter
+# MT7612E too?
+ 7662 MT7662E 802.11ac PCI Express Wireless Network Adapter
14c4 IWASAKI Information Systems Co Ltd
14c5 Automation Products AB
14c6 Data Race Inc
080f Sentry5 DDR/SDR RAM Controller
0811 Sentry5 External Interface Core
0816 BCM3302 Sentry5 MIPS32 CPU
+ 1570 720p FaceTime HD Camera
1600 NetXtreme BCM5752 Gigabit Ethernet PCI Express
1028 01c1 Precision 490
1028 01c2 Latitude D620
1655 NetXtreme BCM5717 Gigabit Ethernet PCIe
1656 NetXtreme BCM5718 Gigabit Ethernet PCIe
1657 NetXtreme BCM5719 Gigabit Ethernet PCIe
+ 103c 169d Ethernet 1Gb 4-port 331FLR Adapter
1659 NetXtreme BCM5721 Gigabit Ethernet PCI Express
1014 02c6 eServer xSeries server mainboard
1028 01e6 PowerEdge 860
16a2 BCM57840 NetXtreme II 10/20-Gigabit Ethernet
103c 1916 HP FlexFabric 20Gb 2-port 630FLB Adapter
103c 1917 HP FlexFabric 20Gb 2-port 630M Adapter
+ 16a3 NetXtreme BCM57786 Gigabit Ethernet PCIe
16a4 BCM57840 NetXtreme II Ethernet Multi Function
103c 1916 HP NPAR 20Gb 2-port 630FLB Adapter
103c 1917 HP NPAR 20Gb 2-port 630M Adapter
4333 Serial (EDGE/GPRS modem part of Option GT Combo Edge)
4344 EDGE/GPRS data and 802.11b/g combo cardbus [GC89]
4350 BCM43222 Wireless Network Adapter
+ 4351 BCM43222 802.11abgn Wireless Network Adapter
4353 BCM43224 802.11a/b/g/n
1028 000e Wireless 1520 Half-size Mini PCIe Card
103c 1509 WMIB-275N Half-size Mini PCIe Card
4359 BCM43228 802.11a/b/g/n
1028 0011 Wireless 1530 Half-size Mini PCIe Card
103c 182c BCM943228HM4L 802.11a/b/g/n 2x2 Wi-Fi Adapter
+ 4360 BCM4360 802.11ac Wireless Network Adapter
4365 BCM43142 802.11b/g/n
1028 0016 Wireless 1704 802.11n + BT 4.0
43a0 BCM4360 802.11ac Wireless Network Adapter
+ 43a1 BCM4360 802.11ac Wireless Network Adapter
+ 43a2 BCM4360 802.11ac Wireless Network Adapter
+ 43a9 BCM43217 802.11b/g/n
+ 43aa BCM43131 802.11b/g/n
43b1 BCM4352 802.11ac Wireless Network Adapter
+ 43ba BCM43602 802.11ac Wireless LAN SoC
+ 43bb BCM43602 802.11ac Wireless LAN SoC
+ 43bc BCM43602 802.11ac Wireless LAN SoC
+ 43d3 BCM43567 802.11ac Wireless Network Adapter
+ 43d9 BCM43570 802.11ac Wireless Network Adapter
+ 43df BCM4354 802.11ac Wireless LAN SoC
+ 43ec BCM4356 802.11ac Wireless Network Adapter
4401 BCM4401 100Base-T
1025 0035 TravelMate 660
103c 08b0 tc1100 tablet
1815 HCF 56k Modem
0e11 0022 Grizzly
0e11 0042 Yogi
+# Integrated in CX86111/CX86113 processors
+ 1830 CX861xx Integrated Host Bridge
2003 HSF 56k Data/Fax Modem
2004 HSF 56k Data/Fax/Voice Modem
2005 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
0070 9600 WinTV 88x Video
0070 9802 WinTV-HVR1100 DVB-T/Hybrid (Low Profile)
1002 00f8 ATI TV Wonder Pro
+ 1002 00f9 ATI TV Wonder
1002 a101 HDTV Wonder
1043 4823 ASUS PVR-416
107d 6611 Winfast TV 2000XP Expert
18ac db00 DVICO FusionHDTV DVB-T1
5654 2388 GoTView PCI Hybrid Audio Capture Device
8852 CX23885 PCI Video and Audio Decoder
- 0070 8010 Hauppauge WinTV HVR-1400 ExpressCard
+ 0070 8010 WinTV HVR-1400 ExpressCard
+ 0070 f038 WinTV HVR-5525
107d 6f22 WinFast PxTV1200
+ 13c2 3013 TT-budget CT2-4500 CI
1461 c039 AVerTV Hybrid Express (A577)
153b 117e Cinergy T PCIe Dual
18ac db78 FusionHDTV DVB-T Dual Express
+ 4254 0950 S950
+ 4254 0952 S952
+ 4254 0982 T982
+ 4254 9580 T9580
+ 4254 980c T980C
8880 CX23887/8 PCIe Broadcast Audio and Video Decoder with 3D Comb
0070 c108 WinTV-HVR-4400-HD model 1278
5654 2389 GoTView X5 DVD Hybrid PCI-E
1541 MACHONE Communications
1542 Concurrent Computer Corporation
9260 RCIM-II Real-Time Clock & Interrupt Module
+ 9271 RCIM-III Real-Time Clock & Interrupt Module (PCIe)
+ 9272 Pulse Width Modulator Card
+ 9277 5 Volt Delta Sigma Converter Card
+ 9278 10 Volt Delta Sigma Converter Card
+ 9287 Analog Output Card
1543 SILICON Laboratories
3052 Intel 537 [Winmodem]
4c22 Si3036 MC'97 DAA
0740 Virtual Machine Communication Interface
0770 USB2 EHCI Controller
0774 USB1.1 UHCI Controller
- 0778 USB3 xHCI Controller
+ 0778 USB3 xHCI 0.96 Controller
+ 0779 USB3 xHCI 1.0 Controller
0790 PCI bridge
07a0 PCI Express Root Port
07b0 VMXNET3 Ethernet Controller
0191 MT25408 [ConnectX IB Flash Recovery]
01f6 MT27500 Family [ConnectX-3 Flash Recovery]
01ff MT27600 Family [Connect-IB Flash Recovery]
+ 0209 MT27700 Family [ConnectX-4 Flash Recovery]
1002 MT25400 Family [ConnectX-2 Virtual Function]
1003 MT27500 Family [ConnectX-3]
- 1004 MT27500 Family [ConnectX-3 Virtual Function]
+ 103c 1777 InfiniBand FDR/EN 10/40Gb Dual Port 544FLR-QSFP Adapter (Rev Cx)
+ 103c 17c9 Infiniband QDR/Ethernet 10Gb 2-port 544i Adapter
+ 103c 18d6 InfiniBand FDR/EN 10/40Gb Dual Port 544QSFP Adapter
+ 1004 MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
1005 MT27510 Family
1006 MT27511 Family
1007 MT27520 Family [ConnectX-3 Pro]
- 1008 MT27520 Family [ConnectX-3 Pro Virtual Function]
1009 MT27530 Family
100a MT27531 Family
100b MT27540 Family
1010 MT27561 Family
1011 MT27600 [Connect-IB]
1012 MT27600 Family [Connect-IB Virtual Function]
- 1013 MT27620 Family
- 1014 MT27621 Family
+ 1013 MT27700 Family [ConnectX-4]
+ 1014 MT27700 Family [ConnectX-4 Virtual Function]
1015 MT27630 Family
1016 MT27631 Family
1017 MT27640 Family
103c 3040 U98Z062.12 802.11bgn Wireless Half-size Mini PCIe Card
105b e017 T77H126.00 802.11bgn Wireless Half-size Mini PCIe Card
105b e023 T77H121.04 802.11bgn Wireless Half-size Mini PCIe Card
+ 105b e025 T77H121.05 802.11bgn Wireless Half-size Mini PCIe Card
1113 e811 WN7811A (Toshiba PA3722U-1MPC) 802.11bgn Wireless Half-size Mini PCIe Card
185f 30af DNXA-95 802.11bgn Wireless Half-size Mini PCIe Card
1931 0023 Option GTM67x PCIe WiFi Adapter
002c AR2427 802.11bg Wireless Network Adapter (PCI-Express)
002d AR9227 Wireless Network Adapter
002e AR9287 Wireless Network Adapter (PCI-Express)
+ 105b e034 T77H167.00
0030 AR93xx Wireless Network Adapter
103c 1627 AR9380/HB112 802.11abgn 3×3 Wi-Fi Adapter
106b 009a AirPort Extreme
1a56 2001 Killer Wireless-N 1103 Half-size Mini PCIe Card [AR9380]
0032 AR9485 Wireless Network Adapter
103c 1838 AR9485/HB125 802.11bgn 1×1 Wi-Fi Adapter
+ 105b e044 Unex DHXA-225
0033 AR9580 Wireless Network Adapter
0034 AR9462 Wireless Network Adapter
1a56 2003 Killer Wireless-N 1202 Half-size Mini PCIe Card
# Also used as Gigabyte GC-WB150 on a PCIe-to-mini-PCIe converter
1a3b 2100 AW-NB100H 802.11n Wireless Mini PCIe Card
003c QCA988x 802.11ac Wireless Network Adapter
+# all QCA6174 devices?
+ 003e Killer N1525 Wireless-AC
0207 AR5210 Wireless Network Adapter [AR5000 802.11a]
1014 AR5212 802.11abg NIC
1014 058a ThinkPad 11a/b/g Wireless LAN Mini Express Adapter (AR5BXB6)
16b4 Aspex Semiconductor Ltd
16b8 Sonnet Technologies, Inc.
16be Creatix Polymedia GmbH
+16c3 Synopsys, Inc.
16c6 Micrel-Kendin
8695 Centaur KS8695 ARM processor
8842 KSZ8842-PMQL 2-Port Ethernet Switch
6302 XMC Module with user-configurable Virtex-6 FPGA, 365k logic cells, SFP front I/O
6303 XMC Module with user-configurable Virtex-6 FPGA, 240k logic cells, no front I/O
6304 XMC Module with user-configurable Virtex-6 FPGA, 365k logic cells, no front I/O
+ 7000 XMC-7K325F: User-configurable Kintex-7 FPGA, 325k logic cells plus SFP front I/O
+ 7001 XMC-7K410F: User-configurable Kintex-7 FPGA, 410k logic cells plus SFP front I/O
+ 7002 XMC-7K325AX: User-Configurable Kintex-7 FPGA, 325k logic cells with AXM Plug-In I/O
+ 7003 XMC-7K410AX: User-Configurable Kintex-7 FPGA, 410k logic cells with AXM Plug-In I/O
+ 7004 XMC-7K325CC: User-Configurable Kintex-7 FPGA, 325k logic cells, conduction-cooled
+ 7005 XMC-7K410CC: User-Configurable Kintex-7 FPGA, 410k logic cells, conduction-cooled
16da Advantech Co., Ltd.
0011 INES GPIB-PCI
16df PIKA Technologies Inc.
ab06 USR997901A 10/100 Cardbus NIC
16ed Sycron N. V.
1001 UMIO communication card
+16f2 ETAS GmbH
+ 0200 I/O board
+ 16f2 0010 ES53xx I/O board
16f3 Jetway Information Co., Ltd.
16f4 Vweb Corp
8000 VW2010
1760 TEDIA spol. s r. o.
0101 PCD-7004 Digital Bi-Directional Ports PCI Card
0102 PCD-7104 Digital Input & Output PCI Card
+ 0303 PCD-7006C Digital Input & Output PCI Card
1771 InnoVISION Multimedia Ltd.
# nee SBS Technologies
1775 GE Intelligent Platforms
-177d Cavium Networks
+177d Cavium, Inc.
0001 Nitrox XL N1
0003 Nitrox XL N1 Lite
0004 Octeon (and older) FIPS
0094 Octeon Fusion CNF71XX Cell processor
0095 Octeon III CN78XX Network Processor
0096 Octeon III CN70XX Network Processor
+ a001 THUNDERX MRML Bridge
+ a002 THUNDERX PCC Bridge
+ 177d a102 CN88XX PCC Bridge
+ a008 THUNDERX SMMU
+ 177d a108 CN88XX SMMU
+ a009 THUNDERX Generic Interrupt Controller
+ a00a THUNDERX GPIO Controller
+ a00b THUNDERX MPI / SPI Controller
+ a00c THUNDERX MIO-PTP Controller
+ a00d THUNDERX MIX Network Controller
+ a00e THUNDERX Reset Controller
+ a00f THUNDERX UART Controller
+ a010 THUNDERX eMMC/SD Controller
+ a011 THUNDERX MIO-BOOT Controller
+ a012 THUNDERX TWSI / I2C Controller
+ a013 THUNDERX CCPI (Multi-node connect)
+ a014 THUNDERX Voltage Regulator Module
+ a015 THUNDERX PCIe Switch Logic Interface
+ a016 THUNDERX Key Memory
+ a017 THUNDERX GTI (Global System Timers)
+ a018 THUNDERX Random Number Generator
+ a019 THUNDERX DFA
+ a01a THUNDERX Zip Coprocessor
+ a01b THUNDERX xHCI USB Controller
+ a01c THUNDERX AHCI SATA Controller
+ 177d a11c CN88XX AHCI SATA Controller
+ a01d THUNDERX RAID Coprocessor
+ a01e THUNDERX Network Interface Controller
+ a01f THUNDERX Traffic Network Switch
+ a020 THUNDERX PEM (PCI Express Interface)
+ a021 THUNDERX L2C (Level-2 Cache Controller)
+ a022 THUNDERX LMC (DRAM Controller)
+ a023 THUNDERX OCLA (On-Chip Logic Analyzer)
+ a024 THUNDERX OSM
+ a025 THUNDERX GSER (General Serializer/Deserializer)
+ a026 THUNDERX BGX (Common Ethernet Interface)
+ a027 THUNDERX IOBN
+ a029 THUNDERX NCSI (Network Controller Sideband Interface)
+ a02a THUNDERX SGP
+ a02b THUNDERX SMI / MDIO Controller
+ a02c THUNDERX DAP (Debug Access Port)
+ a02d THUNDERX PCIERC (PCIe Root Complex)
+ a02e THUNDERX L2C-TAD
+ a02f THUNDERX L2C-CBC
+ a030 THUNDERX L2C-MCI
+ a031 THUNDERX MIO-FUS (Fuse Access Controller)
+ a032 THUNDERX FUSF (Fuse Controller)
1787 Hightech Information System Ltd.
1789 Ennyah Technologies Corp.
# also used by Struck Innovative Systeme for joint developments
0010 PCIe Counter Timer
0011 SIS1100-e single link
0012 SIS1100-e quad link
+ 0015 SIS8100 [Gigabit link, MicroTCA]
1797 Techwell Inc.
6801 TW6802 multimedia video card
6802 TW6802 multimedia other device
1468 0305 T60N871 802.11g Mini PCI Wireless Adapter
1737 0029 WPC54G v4 802.11g Wireless-G Notebook Adapter
17ff Benq Corporation
+1800 Qualcore Logic Inc.
+ 1100 Nanospeed Trading Gateway
1803 ProdaSafe GmbH
1805 Euresys S.A.
1809 Lumanate, Inc.
0701 RT2760 Wireless 802.11n 1T/2R
1737 0074 WMP110 v2 802.11n RangePlus Wireless PCI Adapter
0781 RT2790 Wireless 802.11n 1T/2R PCIe
+ 1814 2790 RT2790 Wireless 802.11n 1T/2R PCIe
3060 RT3060 Wireless 802.11n 1T/1R
1186 3c04 DWA-525 Wireless N 150 Desktop Adapter (rev.A1)
3062 RT3062 Wireless 802.11n 2T/2R
0612 AD612 Data Acquisition Device
0614 MF614 Multifunction I/O Card
0622 AD622 Data Acquisition Device
- 0624 MF624 Multifunction I/O Card
+ 0624 MF624 Multifunction I/O PCI Card
0625 MF625 3-phase Motor Driver
+ 0634 MF634 Multifunction I/O PCIe Card
186f WiNRADiO Communications
1876 L-3 Communications
a101 VigraWATCH PCI
0115 NT20E2-PTP Network Adapter 2x10Gb
0125 NT4E2-4-PTP Network Adapter 4x1Gb
0135 NT20E2-PTP Network Adapter 2x10Gb
+ 0145 NT40E3-4-PTP Network Adapter 4x10Gb
+ 0155 NT100E3-1-PTP Network Adapter 1x100Gb
18f6 NextIO
1000 [Nexsis] Switch Virtual P2P PCIe Bridge
1001 [Texsis] Switch Virtual P2P PCIe Bridge
1924 800b SFN7x42Q-R1 Flareon Ultra 7000 Series 10/40G Adapter
1803 SFC9020 Virtual Function [Solarstorm]
1813 SFL9021 Virtual Function [Solarstorm]
+ 1903 SFC9120 Virtual Function
+ 1923 SFC9140 Virtual Function
6703 SFC4000 rev A iSCSI/Onload [Solarstorm]
10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard]
10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard]
0401 P4080
0408 P4040E
0409 P4040
+ 0440 T4240 with security
+ 0441 T4240 without security
+ 0446 T4160 with security
+ 0447 T4160 without security
+ 0830 T2080 with security
+ 0831 T2080 without security
+ 0838 T2081 with security
+ 0839 T2081 without security
580c MPC5121e
7010 MPC8641 PCI Host Bridge
7011 MPC8641D PCI Host Bridge
1062 AR8132 Fast Ethernet
1063 AR8131 Gigabit Ethernet
1458 e000 GA-G31M-ES2L Motherboard
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
1066 Attansic L2c Gigabit Ethernet
1067 Attansic L1c Gigabit Ethernet
1073 AR8151 v1.0 Gigabit Ethernet
1a22 Ambric Inc.
1a29 Fortinet, Inc.
4338 CP8 Content Processor ASIC
+ 4e36 NP6 Network Processor
1a2b Ascom AG
0000 GESP v1.2
0001 GESP v1.3
0005 ETP v1.4
000a ETP-104 v1.1
000e DSLP-104 v1.1
+# nee Metalink Ltd.
+1a30 Lantiq
+ 0680 MtW8171 [Hyperion II]
+ 0700 Wave300 PSB8224 [Hyperion III]
+ 0710 Wave300 PSB8231 [Hyperion III]
1a32 Quanta Microsystems, Inc
1a3b AzureWave
1112 AR9285 Wireless Network Adapter (PCI-Express)
1a76 Wavesat
1a77 Lightfleet Corporation
1a78 Virident Systems Inc.
- 0031 Virident FlashMAX Drive
+ 0031 FlashMAX Drive
1a78 0034 FlashMAX PCIe SSD [rev 3]
1a78 0037 FlashMAX PCIe SSD [rev 3D]
1a78 0038 FlashMAX PCIe SSD [rev 4]
0040 FlashMAX II
0041 FlashMAX II
0042 FlashMAX II
+ 0050 FlashMAX III
1a84 Commex Technologies
0001 Vulcan SP HT6210 10-Gigabit Ethernet (rev 02)
1a88 MEN Mikro Elektronik
0200 Wil6200 PCI Express Port
0201 Wil6200 Wireless PCI Express Port
0301 Wil6200 802.11ad Wireless Network Adapter
+ 0302 Wil6200 802.11ad Wireless Network Adapter
+ 0310 Wil6200 802.11ad Wireless Network Adapter
1aec Wolfson Microelectronics
-1aed Fusion-io
+# nee Fusion-io
+1aed SanDisk
1003 ioDimm3 (v1.2)
1005 ioDimm3
1014 03c3 High IOPS SSD PCIe Adapter
1007 ioXtreme Pro
1008 ioXtreme-2
2001 ioDrive2
+ 3001 ioMemory FHHL
+ 3002 ioMemory HHHL
+ 3003 ioMemory Mezzanine
1aee Caustic Graphics Inc.
# nee Qumranet, Inc.
1af4 Red Hat, Inc
1849 1042 Motherboard
1080 ASM1083/1085 PCIe to PCI Bridge
1849 1080 Motherboard
+ 1142 ASM1042A USB 3.0 Host Controller
1b2c Opal-RT Technologies Inc.
1b36 Red Hat, Inc.
0001 QEMU PCI-PCI bridge
1af4 1100 QEMU Virtual Machine
1b37 Signal Processing Devices Sweden AB
0014 ADQ412
+# now owned by HGST (a Western Digital subsidiary)
+1b39 sTec, Inc.
+ 0001 S1120 PCIe Accelerator SSD
1b3a Westar Display Technologies
7589 HRED J2000 - JPEG 2000 Video Codec Device
1b3e Teradata Corp.
9480 88SE9480 SAS/SATA 6Gb/s RAID controller
9485 88SE9485 SAS/SATA 6Gb/s controller
1b55 NetUP Inc.
+ 18f6 Dual DVB Universal CI card
2a2c Dual DVB-S2-CI card
e2e4 Dual DVB-T/C-CI RF card
# 2xHDMI and 2xHD-SDI inputs
e5f4 MPEG2 and H264 Encoder-Transcoder
f1c4 Dual ASI-RX/TX-CI card
+1b66 Deltacast
+ 0007 Delta-3G-elp-11 SDI I/O Board
1b6f Etron Technology, Inc.
7023 EJ168 USB 3.0 Host Controller
7052 EJ188/EJ198 USB 3.0 Host Controller
d430 D410/430 Quad-port E1/T1 card
1b85 OCZ Technology Group, Inc.
1041 RevoDrive 3 X2 PCI-Express SSD 240 GB (Marvell Controller)
+ 8788 RevoDrive Hybrid
1b96 Western Digital
1b9a XAVi Technologies Corp.
1bad ReFLEX CES
1bbf Maxeler Technologies Ltd.
0003 MAX3
0004 MAX4
+1bee IXXAT Automation GmbH
+ 0003 CAN-IB200/PCIe
1bf4 VTI Instruments Corporation
0001 SentinelEX
1bfd EeeTOP
1c1c Symphony
0001 82C101
+1c28 Lite-On IT Corp. / Plextor
+ 0122 M6e PCI Express SSD [Marvell 88SS9183]
1c2c Fiberblaze
000a Capture
000f SmartNIC
0300 Telas 2.V
1c44 Enmotus Inc
8000 8000 Storage IO Controller
+1c7e TTTech Computertechnik AG
+ 0200 zFAS Debug Port
1c7f Elektrobit Austria GmbH
5100 EB5100
1c8a TSF5 Corporation
1cb1 Collion UG & Co.KG
1cc5 Embedded Intelligence, Inc.
0100 CAN-PCIe-02
+1cd2 SesKion GmbH
+ 0301 Simulyzer-RT CompactPCI Serial DIO-1 card
1ce4 Exablaze
0001 ExaNIC X4
0002 ExaNIC X2
1cf7 Subspace Dynamics
+# CEM Solutions Pvt. Ltd.
+1d21 Allo
+1d26 Kalray Inc.
+ 0040 Turbocard2 Accelerator
+ e004 AB01/EMB01 Development Board
1d44 DPT
a400 PM2x24/PM3224
1d5c Fantasia Trading LLC
3513 ARCOM Control Systems Ltd
37d9 ITD Firm ltd.
1138 SCHD-PH-8 Phase detector
+# 12-ch Relay Actuator Card
+ 1140 VR-12-PCI
+# multiport serial board
+ 1141 PCI-485(422)
3842 eVga.com. Corp.
38ef 4Links
3d3d 3DLabs
416c Aladdin Knowledge Systems
0100 AladdinCARD
0200 CPC
+4254 DVBSky
4321 Tata Power Strategic Electronics Division
434e CAST Navigation LLC
4444 Internext Compression Inc
5700 Netpower
584d AuzenTech Co., Ltd.
5851 Exacq Technologies
+ 8008 tDVR8008 8-port video capture card
+ 8016 tDVR8016 16-chan video capture card
+ 8032 tDVR8032 32-chan video capture card
5853 XenSource, Inc.
0001 Xen Platform Device
# Virtual device surfaced in guests to provide HID events.
3000 HD-3000
5500 HD5500 HDTV
7284 HT OMEGA Inc.
+7401 EndRun Technologies
+ e100 PTP3100 PCIe PTP Slave Clock
7604 O.N. Electronic Co Ltd.
7bde MIDAC Corporation
7fed PowerTV
0044 Core Processor DRAM Controller
1025 0347 Aspire 7740G
1025 0487 TravelMate 5742
+ 144d c06a R730 Laptop
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
e4bf 50c1 PC1-GROOVE
0045 Core Processor PCI Express x16 Root Port
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
0046 Core Processor Integrated Graphics Controller
+ 144d c06a R730 Laptop
+ 17c0 10d9 Medion Akoya E7214 Notebook PC [MD98410]
e4bf 50c1 PC1-GROOVE
0047 Core Processor Secondary PCI Express Root Port
0048 Core Processor DRAM Controller
0126 2nd Generation Core Processor Family Integrated Graphics Controller
1028 04cc Vostro 3350
0150 Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller
- 1043 84ca P8H77-I Motherboard
+ 1043 84ca P8 series motherboard
+ 15d9 0624 X9SCM-F Motherboard
1849 0150 Motherboard
0151 Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port
1043 1477 N56VZ
1043 844d P8 series motherboard
015e Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
0162 Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
+ 1043 84ca P8 series motherboard
1849 0162 Motherboard
0166 3rd Gen Core processor Graphics Controller
1043 1517 Zenbook Prime UX31A
0416 4th Gen Core Processor Integrated Graphics Controller
17aa 220e ThinkPad T440p
041a Xeon E3-1200 v3 Processor Integrated Graphics Controller
+ 041e 4th Generation Core Processor Family Integrated Graphics Controller
0433 Coleto Creek ACC - ME/CPM interface
0435 Coleto Creek PCIe Endpoint
0436 DH8900CC Null Device
8086 1015 Centrino Wireless-N 100 BGN
8086 1017 Centrino Wireless-N 100 BG
08b1 Wireless 7260
-# Wilkins Peak 2 2x2 AGN + BT
+# Wilkins Peak 2
+ 8086 4020 Dual Band Wireless-N 7260
+# Wilkins Peak 2
+ 8086 402a Dual Band Wireless-N 7260
+# Wilkins Peak 2
8086 4060 Dual Band Wireless-N 7260
-# Wilkins Peak 2 BGN + BT
+# Wilkins Peak 2
8086 4062 Wireless-N 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
+ 8086 406a Dual Band Wireless-N 7260
+# Wilkins Peak 2
8086 4070 Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 AGN + BT
+# Wilkins Peak 2
+ 8086 4072 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
8086 4160 Dual Band Wireless-N 7260
-# Wilkins Peak 2 BGN + BT
+# Wilkins Peak 2
8086 4162 Wireless-N 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
8086 4170 Dual Band Wireless-AC 7260
-# Wilkins Peak 2 AGN + BT
+# Wilkins Peak 2
+ 8086 4420 Dual Band Wireless-N 7260
+# Wilkins Peak 2
8086 4460 Dual Band Wireless-N 7260
-# Wilkins Peak 2 BGN + BT
+# Wilkins Peak 2
8086 4462 Wireless-N 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
+ 8086 446a Dual Band Wireless-N 7260
+# Wilkins Peak 2
8086 4470 Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
+ 8086 4472 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 4560 Dual Band Wireless-N 7260
+# Wilkins Peak 2
+ 8086 4570 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
8086 486e Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
8086 4870 Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
8086 4a6c Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
8086 4a6e Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
8086 4a70 Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 80MHz (No BT)
+# Wilkins Peak 2
+ 8086 4c60 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 4c70 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 5070 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 5072 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 5170 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 5770 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
8086 c020 Dual Band Wireless-N 7260
-# Wilkins Peak 2 2x2 AGN + BT
+# Wilkins Peak 2
+ 8086 c02a Dual Band Wireless-N 7260
+# Wilkins Peak 2
8086 c060 Dual Band Wireless-N 7260
-# Wilkins Peak 2 BGN + BT
+# Wilkins Peak 2
8086 c062 Wireless-N 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
+ 8086 c06a Dual Band Wireless-N 7260
+# Wilkins Peak 2
8086 c070 Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 AGN + BT
+# Wilkins Peak 2
+ 8086 c072 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
8086 c160 Dual Band Wireless-N 7260
-# Wilkins Peak 2 BGN + BT
+# Wilkins Peak 2
8086 c162 Wireless-N 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
8086 c170 Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 AGN (No BT) - Dell
+# Wilkins Peak 2
+ 8086 c360 Dual Band Wireless-N 7260
+# Wilkins Peak 2
8086 c420 Dual Band Wireless-N 7260
-# Wilkins Peak 2 AGN + BT
+# Wilkins Peak 2
8086 c460 Dual Band Wireless-N 7260
-# Wilkins Peak 2 BGN + BT
+# Wilkins Peak 2
8086 c462 Wireless-N 7260
-# Wilkins Peak 2 2x2 80MHz + BT
+# Wilkins Peak 2
8086 c470 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 c472 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 c560 Dual Band Wireless-N 7260
+# Wilkins Peak 2
+ 8086 c570 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 c760 Dual Band Wireless-N 7260
+# Wilkins Peak 2
+ 8086 c770 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 cc60 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 cc70 Dual Band Wireless-AC 7260
08b2 Wireless 7260
-# Wilkins Peak 2 2x2 AGN (No BT) - Lenovo/HP
+# Wilkins Peak 2
8086 4220 Dual Band Wireless-N 7260
-# Wilkins Peak 2 2x2 AGN + BT - Lenovo/HP
+# Wilkins Peak 2
8086 4260 Dual Band Wireless-N 7260
-# Wilkins Peak 2 2x2 BGN + BT - Dell
+# Wilkins Peak 2
8086 4262 Wireless-N 7260
-# Wilkins Peak 2 2x2 80MHz + BT - Lenovo/HP
- 8086 4270 Dual Band Wireless-AC 7260
-# Wilkins Peak 2 2x2 80MHz (No BT) - Lenovo/HP
+# Wilkins Peak 2
+ 8086 426a Dual Band Wireless-N 7260
+# Wilkins Peak 2
+ 8086 4270 Wireless-N 7260
+# Wilkins Peak 2
+ 8086 4272 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 4360 Dual Band Wireless-N 7260
+# Wilkins Peak 2
+ 8086 4370 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
8086 c220 Dual Band Wireless-N 7260
-# Wilkins Peak 2 2x2 AGN + BT - Lenovo/HP
+# Wilkins Peak 2
8086 c260 Dual Band Wireless-N 7260
-# Wilkins Peak 2 2x2 BGN + BT - Dell
+# Wilkins Peak 2
8086 c262 Wireless-N 7260
-# Wilkins Peak 2 2x2 80MHz + BT - Lenovo/HP
+# Wilkins Peak 2
+ 8086 c26a Dual Band Wireless-N 7260
+# Wilkins Peak 2
8086 c270 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 c272 Dual Band Wireless-AC 7260
+# Wilkins Peak 2
+ 8086 c370 Dual Band Wireless-AC 7260
08b3 Wireless 3160
-# Wilkins Peak 1 1x1 AGN + BT
+# Wilkins Peak 1
8086 0060 Dual Band Wireless-N 3160
-# Wilkins Peak 1 1x1 BGN + BT
+# Wilkins Peak 1
8086 0062 Wireless-N 3160
-# Wilkins Peak 1 1x1 80Mhz + BT
+# Wilkins Peak 1
8086 0070 Dual Band Wireless-AC 3160
-# Wilkins Peak 1 1x1 80Mhz + BT
+# Wilkins Peak 1
+ 8086 0072 Dual Band Wireless-AC 3160
+# Wilkins Peak 1
8086 0170 Dual Band Wireless-AC 3160
-# Wilkins Peak 1 1x1 80Mhz + BT
+# Wilkins Peak 1
+ 8086 0172 Dual Band Wireless-AC 3160
+# Wilkins Peak 1
+ 8086 0260 Dual Band Wireless-N 3160
+# Wilkins Peak 1
8086 0470 Dual Band Wireless-AC 3160
-# Wilkins Peak 1 1x1 AGN + BT
+# Wilkins Peak 1
+ 8086 0472 Dual Band Wireless-AC 3160
+# Wilkins Peak 1
+ 8086 1070 Dual Band Wireless-AC 3160
+# Wilkins Peak 1
+ 8086 1170 Dual Band Wireless-AC 3160
+# Wilkins Peak 1
8086 8060 Dual Band Wireless N-3160
-# Wilkins Peak 1 1x1 BGN + BT
+# Wilkins Peak 1
8086 8062 Wireless N-3160
-# Wilkins Peak 1 1x1 80Mhz + BT
+# Wilkins Peak 1
8086 8070 Dual Band Wireless AC 3160
-# Wilkins Peak 1 1x1 80Mhz + BT
+# Wilkins Peak 1
+ 8086 8072 Dual Band Wireless AC 3160
+# Wilkins Peak 1
8086 8170 Dual Band Wireless AC 3160
-# Wilkins Peak 1 1x1 80Mhz + BT
+# Wilkins Peak 1
+ 8086 8172 Dual Band Wireless AC 3160
+# Wilkins Peak 1
8086 8470 Dual Band Wireless AC 3160
+# Wilkins Peak 1
+ 8086 8570 Dual Band Wireless AC 3160
08b4 Wireless 3160
-# Wilkins Peak 1 1x1 80Mhz + BT - lenovo/HP
+# Wilkins Peak 1
8086 0270 Dual Band Wireless-AC 3160
-# Wilkins Peak 1 1x1 80Mhz + BT - lenovo/HP
+# Wilkins Peak 1
+ 8086 0272 Dual Band Wireless-AC 3160
+# Wilkins Peak 1
+ 8086 0370 Dual Band Wireless-AC 3160
+# Wilkins Peak 1
+ 8086 8260 Dual Band Wireless AC 3160
+# Wilkins Peak 1
8086 8270 Dual Band Wireless AC 3160
+# Wilkins Peak 1
+ 8086 8272 Dual Band Wireless AC 3160
+# Wilkins Peak 1
+ 8086 8370 Dual Band Wireless AC 3160
# PowerVR SGX 545
08cf Atom Processor Z2760 Integrated Graphics Controller
+ 0953 PCIe Data Center SSD
+ 8086 3702 DC P3700 SSD
+ 8086 3703 DC P3700 SSD [2.5" SFF]
+ 8086 3704 DC P3500 SSD [Add-in Card]
+ 8086 3705 DC P3500 SSD [2.5" SFF]
+ 8086 3709 DC P3600 SSD [Add-in Card]
+ 8086 370a DC P3600 SSD [2.5" SFF]
095a Wireless 7265
# Stone Peak 2 AC
8086 1010 Dual Band Wireless-AC 7265
8086 5090 Dual Band Wireless-AC 7265
# Stone Peak 2 AGN
8086 5100 Dual Band Wireless-AC 7265
+# Stone Peak 2 BGN
+ 8086 5102 Wireless-N 7265
# Stone Peak 2 AGN
8086 510a Dual Band Wireless-AC 7265
# Stone Peak 2 AC
8086 5400 Dual Band Wireless-AC 7265
# Stone Peak 2 AC
8086 5410 Dual Band Wireless-AC 7265
+# Stone Peak 2 AC
+ 8086 5412 Dual Band Wireless-AC 7265
# Stone Peak 2 AGN
8086 5420 Dual Band Wireless-N 7265
# Maple Peak AC
8086 5490 Dual Band Wireless-AC 7265
+# Stone Peak 2 AC
+ 8086 5510 Dual Band Wireless-AC 7265
# Maple Peak AC
8086 5590 Dual Band Wireless-AC 7265
+# Stone Peak 2 AGN
+ 8086 9000 Dual Band Wireless-AC 7265
+# Stone Peak 2 AGN
+ 8086 900a Dual Band Wireless-AC 7265
# Stone Peak 2 AC
8086 9010 Dual Band Wireless-AC 7265
# Stone Peak 2 AC
8086 9210 Dual Band Wireless-AC 7265
# Stone Peak 2 AC
8086 9310 Dual Band Wireless-AC 7265
+# Stone Peak 2 AGN
+ 8086 9400 Dual Band Wireless-AC 7265
# Stone Peak 2 AC
8086 9410 Dual Band Wireless-AC 7265
# Stone Peak 2 AC
8086 5200 Dual Band Wireless-N 7265
# Stone Peak 2 BGN
8086 5202 Wireless-N 7265
+# Stone Peak 2 AGN
+ 8086 520a Dual Band Wireless-N 7265
# Stone Peak 2 AC
8086 5210 Dual Band Wireless-AC 7265
+# Stone Peak 2 AC
+ 8086 5212 Dual Band Wireless-AC 7265
# Maple Peak AC
8086 5290 Dual Band Wireless-AC 7265
# Stone Peak 2 BGN
- 8086 5302 Dual Band Wireless-AC 7265
+ 8086 5302 Wireless-N 7265
# Stone Peak 2 AC
8086 5310 Dual Band Wireless-AC 7265
+# Stone Peak 2 AGN
+ 8086 9200 Dual Band Wireless-AC 7265
0960 80960RP (i960RP) Microprocessor/Bridge
0962 80960RM (i960RM) Bridge
0964 80960RP (i960RP) Microprocessor/Bridge
0a22 Haswell-ULT Integrated Graphics Controller
0a26 Haswell-ULT Integrated Graphics Controller
0a2a Haswell-ULT Integrated Graphics Controller
+ 0a2e Haswell-ULT Integrated Graphics Controller
0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller
0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller
105b 0d7c D270S/D250S Motherboard
0efb Xeon E7 v2/Xeon E5 v2/Core i7 DDRIO
0efc Xeon E7 v2/Xeon E5 v2/Core i7 DDRIO
0efd Xeon E7 v2/Xeon E5 v2/Core i7 DDRIO
- 0f00 ValleyView SSA-CUnit
- 0f01 ValleyView SSA-CUnit
- 0f02 ValleyView SSA-CUnit
- 0f03 ValleyView SSA-CUnit
- 0f04 ValleyView High Definition Audio Controller
- 0f05 ValleyView High Definition Audio Controller
- 0f06 ValleyView LPIO1 DMA Controller
- 0f07 ValleyView LPIO1 DMA Controller
- 0f08 ValleyView LPIO1 PWM Controller
- 0f09 ValleyView LPIO1 PWM Controller
- 0f0a ValleyView LPIO1 HSUART Controller #1
- 0f0b ValleyView LPIO1 HSUART Controller #1
- 0f0c ValleyView LPIO1 HSUART Controller #2
- 0f0d ValleyView LPIO1 HSUART Controller #2
- 0f0e ValleyView LPIO1 SPI Controller
- 0f0f ValleyView LPIO1 SPI Controller
- 0f10 ValleyView LPIO1 Controller
- 0f11 ValleyView LPIO1 Controller
- 0f12 ValleyView SMBus Controller
- 0f13 ValleyView SMBus Controller
- 0f14 ValleyView SDIO Controller
- 0f15 ValleyView SDIO Controller
- 0f16 ValleyView SDIO Controller
- 0f17 ValleyView SDIO Controller
- 0f18 ValleyView SEC
- 0f19 ValleyView SEC
- 0f1a ValleyView SEC
- 0f1b ValleyView SEC
- 0f1c ValleyView Power Control Unit
- 0f1d ValleyView Power Control Unit
- 0f1e ValleyView Power Control Unit
- 0f1f ValleyView Power Control Unit
- 0f20 ValleyView 4-Port SATA Storage Controller
- 0f21 ValleyView 4-Port SATA Storage Controller
- 0f22 ValleyView 6-Port SATA AHCI Controller
- 0f23 ValleyView 6-Port SATA AHCI Controller
- 0f24 ValleyView SATA RAID Storage Controller
- 0f25 ValleyView SATA RAID Storage Controller
- 0f26 ValleyView 2-Port SATA Storage Controller
- 0f27 ValleyView 2-Port SATA Storage Controller
- 0f28 ValleyView LPE Audio Controller
- 0f29 ValleyView LPE Audio Controller
- 0f2a ValleyView LPE Audio Controller
- 0f2b ValleyView LPE Audio Controller
- 0f2e ValleyView SATA RAID Storage Controller
- 0f2f ValleyView SATA RAID Storage Controller
- 0f30 ValleyView Gen7
- 0f31 ValleyView Gen7
- 0f32 ValleyView Gen7
- 0f33 ValleyView Gen7
- 0f34 ValleyView USB Enhanced Host Controller
- 0f35 ValleyView USB xHCI Host Controller
- 0f36 ValleyView USB xHCI Host Controller
- 0f37 ValleyView OTG
- 0f38 ValleyView ISP
- 0f39 ValleyView ISP
- 0f3a ValleyView ISP
- 0f3b ValleyView ISP
- 0f3c ValleyView ISP
- 0f3d ValleyView ISP
- 0f3e ValleyView ISP
- 0f3f ValleyView ISP
- 0f40 ValleyView LPIO2 DMA Controller
- 0f41 ValleyView LPIO2 I2C Controller #1
- 0f42 ValleyView LPIO2 I2C Controller #2
- 0f43 ValleyView LPIO2 I2C Controller #3
- 0f44 ValleyView LPIO2 I2C Controller #4
- 0f45 ValleyView LPIO2 I2C Controller #5
- 0f46 ValleyView LPIO2 I2C Controller #6
- 0f47 ValleyView LPIO2 I2C Controller #7
- 0f48 ValleyView PCI Express Root Port
- 0f49 ValleyView PCI Express Root Port
- 0f4a ValleyView PCI Express Root Port
- 0f4b ValleyView PCI Express Root Port
- 0f4c ValleyView PCI Express Root Port
- 0f4d ValleyView PCI Express Root Port
- 0f4e ValleyView PCI Express Root Port
- 0f4f ValleyView PCI Express Root Port
- 0f50 ValleyView MIPI-HSI Controller
+ 0f00 Atom Processor Z36xxx/Z37xxx Series SoC Transaction Register
+ 0f04 Atom Processor Z36xxx/Z37xxx Series High Definition Audio Controller
+ 0f06 Atom Processor Z36xxx/Z37xxx Series LPIO1 DMA Controller
+ 0f08 Atom Processor Z36xxx/Z37xxx Series LPIO1 PWM Controller
+ 0f09 Atom Processor Z36xxx/Z37xxx Series LPIO1 PWM Controller
+ 0f0a Atom Processor Z36xxx/Z37xxx Series LPIO1 HSUART Controller #1
+ 0f0c Atom Processor Z36xxx/Z37xxx Series LPIO1 HSUART Controller #2
+ 0f0e Atom Processor Z36xxx/Z37xxx Series LPIO1 SPI Controller
+ 0f12 Atom Processor E3800 Series SMBus Controller
+ 0f14 Atom Processor Z36xxx/Z37xxx Series SDIO Controller
+ 0f15 Atom Processor Z36xxx/Z37xxx Series SDIO Controller
+ 0f16 Atom Processor Z36xxx/Z37xxx Series SDIO Controller
+ 0f18 Atom Processor Z36xxx/Z37xxx Series Trusted Execution Engine
+ 0f1c Atom Processor Z36xxx/Z37xxx Series Power Control Unit
+ 0f20 Atom Processor E3800 Series SATA IDE Controller
+ 0f21 Atom Processor E3800 Series SATA IDE Controller
+ 0f22 Atom Processor E3800 Series SATA AHCI Controller
+ 0f23 Atom Processor E3800 Series SATA AHCI Controller
+ 0f28 Atom Processor Z36xxx/Z37xxx Series LPE Audio Controller
+ 0f31 Atom Processor Z36xxx/Z37xxx Series Graphics & Display
+ 0f34 Atom Processor Z36xxx/Z37xxx Series USB EHCI
+ 0f35 Atom Processor Z36xxx/Z37xxx Series USB xHCI
+ 0f37 Atom Processor Z36xxx/Z37xxx Series OTG USB Device
+ 0f38 Atom Processor Z36xxx/Z37xxx Series Camera ISP
+ 0f40 Atom Processor Z36xxx/Z37xxx Series LPIO2 DMA Controller
+ 0f41 Atom Processor Z36xxx/Z37xxx Series LPIO2 I2C Controller #1
+ 0f42 Atom Processor Z36xxx/Z37xxx Series LPIO2 I2C Controller #2
+ 0f43 Atom Processor Z36xxx/Z37xxx Series LPIO2 I2C Controller #3
+ 0f44 Atom Processor Z36xxx/Z37xxx Series LPIO2 I2C Controller #4
+ 0f45 Atom Processor Z36xxx/Z37xxx Series LPIO2 I2C Controller #5
+ 0f46 Atom Processor Z36xxx/Z37xxx Series LPIO2 I2C Controller #6
+ 0f47 Atom Processor Z36xxx/Z37xxx Series LPIO2 I2C Controller #7
+ 0f48 Atom Processor E3800 Series PCI Express Root Port 1
+ 0f4a Atom Processor E3800 Series PCI Express Root Port 2
+ 0f4c Atom Processor E3800 Series PCI Express Root Port 3
+ 0f4e Atom Processor E3800 Series PCI Express Root Port 4
+ 0f50 Atom Processor E3800 Series eMMC 4.5 Controller
1000 82542 Gigabit Ethernet Controller (Fiber)
0e11 b0df NC6132 Gigabit Ethernet Adapter (1000-SX)
0e11 b0e0 NC6133 Gigabit Ethernet Adapter (1000-LX)
108f Active Management Technology - SOL
1091 PRO/100 VM Network Connection
1092 PRO/100 VE Network Connection
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
1093 PRO/100 VM Network Connection
1094 PRO/100 VE Network Connection
1095 PRO/100 VE Network Connection
10cd 82567LF-2 Gigabit Network Connection
10ce 82567V-2 Gigabit Network Connection
10d3 82574L Gigabit Network Connection
+ 103c 1785 NC112i 1-port Ethernet Server Adapter
103c 3250 NC112T PCI Express single Port Gigabit Server Adapter
1043 8369 Motherboard
+ 1093 76e9 PCIe-8233 Ethernet Adapter
10a9 8029 Prism XL Single Port Gigabit Ethernet
15d9 060a X7SPA-H/X7SPA-HF Motherboard
15d9 060d C7SIM-Q Motherboard
1520 I350 Ethernet Controller Virtual Function
1521 I350 Gigabit Network Connection
1028 0602 Gigabit 2P I350-t LOM
- 1028 1f60 Intel GbE 4P I350crNDC
- 1028 1f62 Intel GbE 2P I350crNDC
+ 1028 1f60 Gigabit 4P I350-t rNDC
+ 1028 1f62 Gigabit 4P X540/I350 rNDC
1028 ff9a Gigabit 4P X710/I350 rNDC
103c 17d1 Ethernet 1Gb 4-port 366FLR Adapter
103c 2003 Ethernet 1Gb 2-port 367i Adapter
103c 339e Ethernet 1Gb 2-port 361T Adapter
108e 7b16 Quad Port GbE PCIe 2.0 ExpressModule, UTP
108e 7b18 Quad Port GbE PCIe 2.0 Low Profile Adapter, UTP
+ 1093 7648 PCIe-8237R Ethernet Adapter
+ 1093 7649 PCIe-8236 Ethernet Adapter
+ 1093 76b1 PCIe-8237R-S Ethernet Adapter
+ 1093 775b PCIe-8237 Ethernet Adapter
10a9 802a UV2-BaseIO dual-port GbE
17aa 1074 ThinkServer I350-T4 AnyFabric
8086 0001 Ethernet Server Adapter I350-T4
8086 00a3 Ethernet Server Adapter I350-F4
8086 00a4 Ethernet Server Adapter I350-F2
1523 I350 Gigabit Backplane Connection
- 1028 1f9b Gigabit 4P I350 bNDC
+ 1028 0060 Gigabit 2P I350 LOM
+ 1028 1f9b Gigabit 4P I350-t bNDC
103c 1784 Ethernet 1Gb 2-port 361FLB Adapter
103c 18d1 Ethernet 1Gb 2-port 361FLB Adapter
103c 1989 Ethernet 1Gb 2-port 363i Adapter
1529 82599 10 Gigabit Dual Port Network Connection with FCoE
152a 82599 10 Gigabit Dual Port Backplane Connection with FCoE
1533 I210 Gigabit Network Connection
- 103c 0003 Ethernet Server Adapter I210-T1
+ 103c 0003 Ethernet I210-T1 GbE NIC
+ 1093 7706 Compact Vision System Ethernet Adapter
+ 10a9 802c UV300 BaseIO single-port GbE
+ 10a9 802d UV3000 BaseIO GbE Network
17aa 1100 ThinkServer Ethernet Server Adapter
8086 0001 Ethernet Server Adapter I210-T1
8086 0002 Ethernet Server Adapter I210-T1
- 1534 I210 Gigabit Network Connection
1536 I210 Gigabit Fiber Network Connection
1537 I210 Gigabit Backplane Connection
+ 1538 I210 Gigabit Network Connection
1539 I211 Gigabit Network Connection
153a Ethernet Connection I217-LM
103c 1909 ZBook 15
8086 011a Ethernet Converged Network Adapter X520-4
8086 011b Ethernet Converged Network Adapter X520-4
8086 011c Ethernet Converged Network Adapter X520-4
- 154c XL710 X710 Virtual Function
+ 154c XL710/X710 Virtual Function
154d Ethernet 10G 2P X520 Adapter
8086 7b11 10GbE 2P X520 Adapter
1557 82599 10 Gigabit Network Connection
1560 Ethernet Controller X540
156f Ethernet Connection I219-LM
1570 Ethernet Connection I219-V
- 1571 XL710 X710 Virtual Function
- 1572 Ethernet 10G 2P X710 Adapter
+ 1571 XL710/X710 Virtual Function
+ 1572 Ethernet Controller X710 for 10GbE SFP+
1028 1f99 Ethernet 10G 4P X710/I350 rNDC
+ 17aa 0000 ThinkServer XL710 AnyFabric
+ 17aa 4001 ThinkServer XL710-4 AnyFabric
+ 8086 0000 Ethernet Converged Network Adapter X710
8086 0001 Ethernet Converged Network Adapter X710-4
8086 0002 Ethernet Converged Network Adapter X710-4
8086 0004 Ethernet Converged Network Adapter X710-4
8086 0005 Ethernet 10G 4P X710 Adapter
- 8086 0006 Ethernet 10G2P X710 Adapter
+ 8086 0006 Ethernet 10G 2P X710 Adapter
8086 0007 Ethernet Converged Network Adapter X710-2
8086 0008 Ethernet Converged Network Adapter X710-2
157b I210 Gigabit Network Connection
157c I210 Gigabit Backplane Connection
- 1580 Ethernet Controller XL710 for 40Gbe backplane
- 1581 Ethernet Controller X710 for 10Gbe backplane
+ 1580 Ethernet Controller XL710 for 40GbE backplane
+ 1581 Ethernet Controller X710 for 10GbE backplane
1028 1f98 Ethernet 10G 4P X710-k bNDC
1583 Ethernet Controller XL710 for 40GbE QSFP+
+ 8086 0000 Ethernet Converged Network Adapter XL710-Q2
8086 0001 Ethernet Converged Network Adapter XL710-Q2
8086 0002 Ethernet Converged Network Adapter XL710-Q2
8086 0003 Ethernet I/O Module XL710-Q2
1584 Ethernet Controller XL710 for 40GbE QSFP+
+ 8086 0000 Ethernet Converged Network Adapter XL710-Q1
8086 0001 Ethernet Converged Network Adapter XL710-Q1
8086 0002 Ethernet Converged Network Adapter XL710-Q1
8086 0003 Ethernet I/O Module XL710-Q1
15a1 Ethernet Connection (2) I218-V
15a2 Ethernet Connection (3) I218-LM
15a3 Ethernet Connection (3) I218-V
+ 15a8 Ethernet Connection X552 Virtual Function
+ 15aa Ethernet Connection X552 10 GbE Backplane
+ 15ab Ethernet Connection X552 10 GbE Backplane
+ 15ac Ethernet Connection X552 10 GbE SFP+
+ 15ad Ethernet Connection X552/X557-AT 10GBASE-T
+ 15b7 Ethernet Connection (2) I219-LM
+ 15b8 Ethernet Connection (2) I219-V
1600 Broadwell-U Host Bridge -OPI
1601 Broadwell-U PCI Express x16 Controller
1602 Broadwell-U Integrated Graphics
163b Broadwell-U Integrated Graphics
163d Broadwell-U Integrated Graphics
163e Broadwell-U Integrated Graphics
+ 1900 Sky Lake Host Bridge/DRAM Registers
+ 1901 Sky Lake PCIe Controller (x16)
+ 1904 Sky Lake Host Bridge/DRAM Registers
+ 1905 Sky Lake PCIe Controller (x8)
+ 1908 Sky Lake Host Bridge/DRAM Registers
+ 1909 Sky Lake PCIe Controller (x4)
+ 190c Sky Lake Host Bridge/DRAM Registers
+ 190f Sky Lake Host Bridge/DRAM Registers
+ 1910 Sky Lake Host Bridge/DRAM Registers
+ 1911 Sky Lake Gaussian Mixture Model
+ 1912 Sky Lake Integrated Graphics
+ 1916 Sky Lake Integrated Graphics
+ 1918 Sky Lake Host Bridge/DRAM Registers
+ 1919 Sky Lake Imaging Unit
+ 191e Sky Lake Integrated Graphics
+ 191f Sky Lake Host Bridge/DRAM Registers
+ 1926 Sky Lake Integrated Graphics
+ 1932 Sky Lake Integrated Graphics
+ 193b Sky Lake Integrated Graphics
1960 80960RP (i960RP) Microprocessor
101e 0431 MegaRAID 431 RAID Controller
101e 0438 MegaRAID 438 Ultra2 LVD RAID Controller
1028 04da Vostro 3750
8086 7270 Apple MacBookPro8,2 [Core i7, 15", 2011]
1c04 6 Series/C200 Series Chipset Family SATA RAID Controller
+ 103c 3118 Smart Array B110i SATA RAID Controller
1c05 6 Series/C200 Series Chipset Family SATA RAID Controller
1c08 6 Series/C200 Series Chipset Family 2 port SATA IDE Controller
1c09 6 Series/C200 Series Chipset Family 2 port SATA IDE Controller
1e00 7 Series/C210 Series Chipset Family 4-port SATA Controller [IDE mode]
1e01 7 Series Chipset Family 4-port SATA Controller [IDE mode]
1e02 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode]
- 1043 84ca P8H77-I Motherboard
+ 1043 84ca P8 series motherboard
1849 1e02 Motherboard
1e03 7 Series Chipset Family 6-port SATA Controller [AHCI mode]
1043 1477 N56VZ
1043 1477 N56VZ
1043 1517 Zenbook Prime UX31A
1043 8415 P8H77-I Motherboard
+ 1043 8445 ASUS P8Z77-V LX Motherboard
1849 1898 Z77 Extreme4 motherboard
1e22 7 Series/C210 Series Chipset Family SMBus Controller
1043 1477 N56VZ
1043 1517 Zenbook Prime UX31A
- 1043 84ca P8H77-I Motherboard
+ 1043 84ca P8 series motherboard
1849 1e22 Motherboard
1e24 7 Series/C210 Series Chipset Family Thermal Management Controller
1043 1517 Zenbook Prime UX31A
1e26 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1
1043 1477 N56VZ
1043 1517 Zenbook Prime UX31A
- 1043 84ca P8H77-I Motherboard
+ 1043 84ca P8 series motherboard
1849 1e26 Motherboard
1e2d 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2
1043 1477 N56VZ
1043 1517 Zenbook Prime UX31A
- 1043 84ca P8H77-I Motherboard
+ 1043 84ca P8 series motherboard
1849 1e2d Motherboard
1e31 7 Series/C210 Series Chipset Family USB xHCI Host Controller
103c 17ab ProBook 6570b
1043 1477 N56VZ
1043 1517 Zenbook Prime UX31A
- 1043 84ca P8H77-I Motherboard
+ 1043 84ca P8 series motherboard
1849 1e31 Motherboard
1e33 7 Series/C210 Series Chipset Family LAN Controller
1e3a 7 Series/C210 Series Chipset Family MEI Controller #1
1043 1477 N56VZ
1043 1517 Zenbook Prime UX31A
- 1043 84ca P8H77-I Motherboard
+ 1043 84ca P8 series motherboard
1849 1e3a Motherboard
1e3b 7 Series/C210 Series Chipset Family MEI Controller #2
1e3c 7 Series/C210 Series Chipset Family IDE-r Controller
1e42 7 Series Chipset Family LPC Controller
1e43 7 Series Chipset Family LPC Controller
1e44 Z77 Express Chipset LPC Controller
+ 1043 84ca P8 series motherboard
1849 1e44 Motherboard
1e45 7 Series Chipset Family LPC Controller
1e46 Z75 Express Chipset LPC Controller
1f42 Atom processor C2000 GbE
1f44 Atom processor C2000 GbE Virtual Function
1f45 Ethernet Connection I354 2.5 GbE Backplane
+ 2014 Sky Lake-E Ubox Registers
+ 2015 Sky Lake-E Ubox Registers
+ 2016 Sky Lake-E Ubox Registers
+ 2018 Sky Lake-E M2PCI Registers
+ 201a Sky Lake-E Non-Transparent Bridge Registers
+ 201c Sky Lake-E Non-Transparent Bridge Registers
+ 2021 Sky Lake-E CBDMA Registers
+ 2024 Sky Lake-E MM/Vt-d Configuration Registers
+ 2030 Sky Lake-E PCI Express Root Port 1A
+ 2031 Sky Lake-E PCI Express Root Port 1B
+ 2032 Sky Lake-E PCI Express Root Port 1C
+ 2033 Sky Lake-E PCI Express Root Port 1D
+ 2035 Sky Lake-E RAS Configuration Registers
+ 204c Sky Lake-E M3KTI Registers
+ 204d Sky Lake-E M3KTI Registers
+ 204e Sky Lake-E M3KTI Registers
+ 2054 Sky Lake-E CHA Registers
+ 2055 Sky Lake-E CHA Registers
+ 2056 Sky Lake-E CHA Registers
+ 2057 Sky Lake-E CHA Registers
+ 2068 Sky Lake-E DDRIO Registers
+ 2069 Sky Lake-E DDRIO Registers
+ 206a Sky Lake-E IOxAPIC Configuration Registers
+ 206e Sky Lake-E DDRIO Registers
+ 206f Sky Lake-E DDRIO Registers
+ 2078 Sky Lake-E PCU Registers
+ 207a Sky Lake-E PCU Registers
+ 2080 Sky Lake-E PCU Registers
+ 2081 Sky Lake-E PCU Registers
+ 2082 Sky Lake-E PCU Registers
+ 2083 Sky Lake-E PCU Registers
+ 2084 Sky Lake-E PCU Registers
+ 2085 Sky Lake-E PCU Registers
+ 2086 Sky Lake-E PCU Registers
+ 208d Sky Lake-E CHA Registers
+ 208e Sky Lake-E CHA Registers
2250 Xeon Phi coprocessor 5100 series
225c Xeon Phi coprocessor SE10/7120 series
225d Xeon Phi coprocessor 3120 series
103c 30c1 Compaq 6910p
104d 902d VAIO VGN-NR120E
105b 0d7c D270S/D250S Motherboard
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
144d c00c P30 notebook
+ 144d c06a R730 Laptop
144d c072 Notebook N150P
1458 5000 GA-D525TUD
1734 1055 Amilo M1420
17aa 20ae ThinkPad T61/R61
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
8086 544b Desktop Board D425KT
e4bf cc47 CCG-RUMBA
2449 82801BA/BAM/CA/CAM Ethernet Controller
24c5 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller
0e11 00b8 Analog Devices Inc. codec [SoundMAX]
1014 0267 NetVista A30p
- 1014 0537 ThinkPad T41
+ 1014 0537 ThinkPad T4x Series
1014 055f Thinkpad R50e model 1634
1025 005a TravelMate 290
1028 0139 Latitude D400
1734 1055 Amilo M1420
8086 24c5 Dell Dimension 2400
24c6 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller
- 1014 0524 ThinkPad T41
+ 1014 0524 ThinkPad T4x Series
1014 0525 ThinkPad
1014 0559 ThinkPad R50e
1025 003c Aspire 2001WLCi (Compal CL50 motherboard) implementation
103c 30a1 NC2400
103c 30a3 Compaq nw8440
1043 1237 A6J-Q008
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
17aa 2015 ThinkPad T60
17aa 2017 ThinkPad R60/T60/X60 series
27a1 Mobile 945GM/PM/GMS, 943/940GML and 945GT Express PCI Express Root Port
103c 309f Compaq nx9420 Notebook
103c 30a3 Compaq nw8440
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
27a2 Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller
103c 30a1 NC2400
17aa 201a ThinkPad R60/T60/X60 series
103c 309f Compaq nx9420 Notebook
103c 30a1 NC2400
103c 30a3 Compaq nw8440
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
10f7 8338 Panasonic CF-Y5 laptop
17aa 2009 ThinkPad R60/T60/X60 series
27bc NM10 Family LPC Controller
27c4 82801GBM/GHM (ICH7-M Family) SATA Controller [IDE mode]
1025 006c 9814 WKMI
1028 01d7 XPS M1210
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
17aa 200e ThinkPad T60
27c5 82801GBM/GHM (ICH7-M Family) SATA Controller [AHCI mode]
103c 309f Compaq nx9420 Notebook
1043 1237 A6J-Q008
1043 8179 P5KPL-VM,P5LD2-VM Mainboard
105b 0d7c D270S/D250S Motherboard
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
107b 5048 E4500
144d c072 Notebook N150P
1458 5004 GA-D525TUD
1043 1237 A6J-Q008
1043 8179 P5KPL-VM,P5LD2-VM Mainboard
105b 0d7c D270S/D250S Motherboard
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
107b 5048 E4500
144d c072 Notebook N150P
1458 5004 GA-D525TUD
1043 1237 A6J-Q008
1043 8179 P5KPL-VM,P5LD2-VM Mainboard
105b 0d7c D270S/D250S Motherboard
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
107b 5048 E4500
144d c072 Notebook N150P
1458 5004 GA-D525TUD
1043 1237 A6J-Q008
1043 8179 P5KPL-VM,P5LD2-VM Mainboard
105b 0d7c D270S/D250S Motherboard
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
107b 5048 E4500
144d c072 Notebook N150P
1458 5004 GA-D525TUD
1043 1237 A6J-Q008
1043 8179 P5KPL-VM,P5LD2-VM Mainboard
105b 0d7c D270S/D250S Motherboard
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
144d c072 Notebook N150P
1458 5006 GA-D525TUD
1462 7418 Wind PC MS-7418
27d0 NM10/ICH7 Family PCI Express Port 1
103c 309f Compaq nx9420 Notebook
103c 30a3 Compaq nw8440
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
144d c072 Notebook N150P
1458 5001 GA-D525TUD
1462 7418 Wind PC MS-7418
27d2 NM10/ICH7 Family PCI Express Port 2
103c 309f Compaq nx9420 Notebook
103c 30a3 Compaq nw8440
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
144d c072 Notebook N150P
1462 7418 Wind PC MS-7418
1775 11cc CC11/CL11
8086 544b Desktop Board D425KT
27d4 NM10/ICH7 Family PCI Express Port 3
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
144d c072 Notebook N150P
1462 7418 Wind PC MS-7418
1775 11cc CC11/CL11
8086 544b Desktop Board D425KT
27d6 NM10/ICH7 Family PCI Express Port 4
103c 30a3 Compaq nw8440
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
144d c072 Notebook N150P
1462 7418 Wind PC MS-7418
1775 11cc CC11/CL11
1043 8290 P5KPL-VM Motherboard
1043 82ea P5KPL-CM Motherboard
105b 0d7c D270S/D250S Motherboard
+ 1071 8207 Medion MIM 2240 Notebook PC [MD98100]
107b 5048 E4500
10f7 8338 Panasonic CF-Y5 laptop
1179 ff10 Toshiba Satellite A100-796 audio (Realtek ALC861)
103c 2a3b Pavilion A1512X
1043 8179 P5KPL-VM Motherboard
105b 0d7c D270S/D250S Motherboard
+ 1071 8209 Medion MIM 2240 Notebook PC [MD98100]
10f7 8338 Panasonic CF-Y5 laptop
144d c072 Notebook N150P
1458 5001 GA-8I945PG-RH/GA-D525TUD Mainboard
103c 30d9 Presario C700
104d 9005 Vaio VGN-FZ260E
104d 902d VAIO VGN-NR120E
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
2820 82801H (ICH8 Family) 4 port SATA Controller [IDE mode]
1028 01da OptiPlex 745
1462 7235 P965 Neo MS-7235 mainboard
2821 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA Controller [AHCI mode]
- 2822 82801 SATA Controller [RAID mode]
+ 2822 SATA Controller [RAID mode]
1028 020d Inspiron 530
103c 2a6f Asus IPIBL-LB Motherboard
- 2823 Wellsburg sSATA RAID Controller
+ 2823 C610/X99 series chipset sSATA Controller [RAID mode]
2824 82801HB (ICH8) 4 port SATA Controller [AHCI mode]
1043 81ec P5B
2825 82801HR/HO/HH (ICH8R/DO/DH) 2 port SATA Controller [IDE mode]
1028 01da OptiPlex 745
1462 7235 P965 Neo MS-7235 mainboard
2826 C600/X79 series chipset SATA RAID Controller
- 2827 Wellsburg sSATA RAID Controller
+ 2827 C610/X99 series chipset sSATA Controller [RAID mode]
2828 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [IDE mode]
1028 01f3 Inspiron 1420
103c 30c0 Compaq 6710b
104d 9005 Vaio VGN-FZ260E
104d 902d VAIO VGN-NR120E
17aa 20a7 ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
282a 82801 Mobile SATA Controller [RAID mode]
1028 040b Latitude E6510
104d 902d VAIO VGN-NR120E
1462 7235 P965 Neo MS-7235 mainboard
17aa 20aa ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2831 82801H (ICH8 Family) USB UHCI Controller #2
1025 0121 Aspire 5920G
104d 902d VAIO VGN-NR120E
1462 7235 P965 Neo MS-7235 mainboard
17aa 20aa ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2832 82801H (ICH8 Family) USB UHCI Controller #3
1025 0121 Aspire 5920G
104d 9005 Vaio VGN-FZ260E
104d 902d VAIO VGN-NR120E
17aa 20aa ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2833 82801H (ICH8 Family) USB UHCI Controller #4
1043 81ec P5B
104d 902d VAIO VGN-NR120E
1462 7235 P965 Neo MS-7235 mainboard
17aa 20aa ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2835 82801H (ICH8 Family) USB UHCI Controller #5
1025 0121 Acer Aspire 5920G
104d 9005 Vaio VGN-FZ260E
104d 902d VAIO VGN-NR120E
17aa 20aa Thinkpad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2836 82801H (ICH8 Family) USB2 EHCI Controller #1
1025 0121 Aspire 5920G
104d 902d VAIO VGN-NR120E
1462 7235 P965 Neo MS-7235 mainboard
17aa 20ab ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
283a 82801H (ICH8 Family) USB2 EHCI Controller #2
1025 0121 Acer Aspire 5920G
104d 9005 Vaio VGN-FZ260E
104d 902d VAIO VGN-NR120E
17aa 20ab ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
283e 82801H (ICH8 Family) SMBus Controller
1025 0121 Aspire 5920G
104d 902d VAIO VGN-NR120E
1462 7235 P965 Neo MS-7235 mainboard
17aa 20a9 ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
283f 82801H (ICH8 Family) PCI Express Port 1
1028 01da OptiPlex 745
103c 30c1 Compaq 6910p
104d 902d VAIO VGN-NR120E
17aa 20ad ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
2841 82801H (ICH8 Family) PCI Express Port 2
103c 30c1 Compaq 6910p
104d 902d VAIO VGN-NR120E
17aa 20ad ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
2843 82801H (ICH8 Family) PCI Express Port 3
104d 902d VAIO VGN-NR120E
17aa 20ad ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
2845 82801H (ICH8 Family) PCI Express Port 4
17aa 20ad ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
2847 82801H (ICH8 Family) PCI Express Port 5
1028 01da OptiPlex 745
103c 30c1 Compaq 6910p
17aa 20ad ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
2849 82801H (ICH8 Family) PCI Express Port 6
284b 82801H (ICH8 Family) HD Audio Controller
1025 011f Realtek ALC268 audio codec
104d 902d VAIO VGN-NR120E
14f1 5051 Presario C700
17aa 20ac ThinkPad T61/R61
+ 17c0 4088 Medion WIM 2210 Notebook PC [MD96850]
8384 7616 Dell Vostro 1400
e4bf cc47 CCG-RUMBA
284f 82801H (ICH8 Family) Thermal Reporting Device
104d 9005 Vaio VGN-FZ260E
104d 902d VAIO VGN-NR120E
17aa 20a6 ThinkPad T61/R61
+ 17c0 4083 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2912 82801IH (ICH9DH) LPC Interface Controller
2914 82801IO (ICH9DO) LPC Interface Controller
104d 902d VAIO VGN-NR120E
17aa 20b1 ThinkPad T61
17aa 20b3 ThinkPad T61/R61
+ 17c0 4082 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2a01 Mobile PM965/GM965/GL960 PCI Express Root Port
2a02 Mobile GM965/GL960 Integrated Graphics Controller (primary)
103c 30d9 Presario C700
104d 902d VAIO VGN-NR120E
17aa 20b5 ThinkPad T61/R61
+ 17c0 4082 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2a03 Mobile GM965/GL960 Integrated Graphics Controller (secondary)
- 1028 01f3 Dell Inspiron 1420
+ 1028 01f3 Inspiron 1420
103c 30c0 Compaq 6710b
103c 30d9 Presario C700
104d 902d VAIO VGN-NR120E
17aa 20b5 ThinkPad T61/R61
+ 17c0 4082 Medion WIM 2210 Notebook PC [MD96850]
e4bf cc47 CCG-RUMBA
2a04 Mobile PM965/GM965 MEI Controller
103c 30c1 Compaq 6910p
2cf3 Xeon C5500/C3500 Integrated Memory Controller Channel 2 Thermal Control
2d01 Core Processor QuickPath Architecture System Address Decoder
2d10 Core Processor QPI Link 0
- 2d11 Core Processor QPI Physical 0
- 2d12 Core Processor Reserved
- 2d13 Core Processor Reserved
+ 2d11 1st Generation Core Processor QPI Physical 0
+ 2d12 1st Generation Core Processor Reserved
+ 2d13 1st Generation Core Processor Reserved
2d81 Xeon 5600 Series QuickPath Architecture System Address Decoder
2d90 Xeon 5600 Series QPI Link 0
2d91 Xeon 5600 Series QPI Physical 0
2e10 4 Series Chipset DRAM Controller
2e11 4 Series Chipset PCI Express Root Port
2e12 4 Series Chipset Integrated Graphics Controller
+ 17aa 3048 ThinkCentre M6258
2e13 4 Series Chipset Integrated Graphics Controller
2e14 4 Series Chipset HECI Controller
2e15 4 Series Chipset HECI Controller
2e94 4 Series Chipset HECI Controller
2e95 4 Series Chipset HECI Controller
2e96 4 Series Chipset PT IDER Controller
- 2f00 Haswell-E DMI2
- 2f01 Haswell-E PCI Express Root Port 0
- 2f02 Haswell-E PCI Express Root Port 1
- 2f03 Haswell-E PCI Express Root Port 1
- 2f04 Haswell-E PCI Express Root Port 2
- 2f05 Haswell-E PCI Express Root Port 2
- 2f06 Haswell-E PCI Express Root Port 2
- 2f07 Haswell-E PCI Express Root Port 2
- 2f08 Haswell-E PCI Express Root Port 3
- 2f09 Haswell-E PCI Express Root Port 3
- 2f0a Haswell-E PCI Express Root Port 3
- 2f0b Haswell-E PCI Express Root Port 3
- 2f10 Haswell-E IIO Debug
- 2f11 Haswell-E IIO Debug
- 2f12 Haswell-E IIO Debug
- 2f13 Haswell-E IIO Debug
- 2f14 Haswell-E IIO Debug
- 2f15 Haswell-E IIO Debug
- 2f16 Haswell-E IIO Debug
- 2f17 Haswell-E IIO Debug
- 2f18 Haswell-E IIO Debug
- 2f19 Haswell-E IIO Debug
- 2f1a Haswell-E IIO Debug
- 2f1b Haswell-E IIO Debug
- 2f1c Haswell-E IIO Debug
- 2f1d Haswell-E PCIe Ring Interface
- 2f1e Haswell-E Scratchpad & Semaphore Registers
- 2f1f Haswell-E Scratchpad & Semaphore Registers
- 2f20 Haswell-E DMA Channel 0
- 2f21 Haswell-E DMA Channel 1
- 2f22 Haswell-E DMA Channel 2
- 2f23 Haswell-E DMA Channel 3
- 2f24 Haswell-E DMA Channel 4
- 2f25 Haswell-E DMA Channel 5
- 2f26 Haswell-E DMA Channel 6
- 2f27 Haswell-E DMA Channel 7
- 2f28 Haswell-E Address Map, VTd_Misc, System Management
- 2f29 Haswell-E Hot Plug
- 2f2a Haswell-E RAS, Control Status and Global Errors
- 2f2c Haswell-E I/O Apic
- 2f2e Haswell-E RAID 5/6
- 2f2f Haswell-E RAID 5/6
- 2f30 Haswell-E Home Agent 0
- 2f32 Haswell-E QPI Link 0
- 2f33 Haswell-E QPI Link 1
- 2f34 Haswell-E PCIe Ring Interface
- 2f36 Haswell-E R3 QPI Link 0 & 1 Monitoring
- 2f37 Haswell-E R3 QPI Link 0 & 1 Monitoring
- 2f38 Haswell-E Home Agent 1
- 2f39 Haswell-E I/O Performance Monitoring
- 2f3a Haswell-E QPI Link 2
- 2f3e Haswell-E R3 QPI Link 2 Monitoring
- 2f3f Haswell-E R3 QPI Link 2 Monitoring
- 2f40 Haswell-E QPI Link 2
- 2f41 Haswell-E R3 QPI Link 2 Monitoring
- 2f43 Haswell-E QPI Link 2
- 2f45 Haswell-E QPI Link 2 Debug
- 2f46 Haswell-E QPI Link 2 Debug
- 2f47 Haswell-E QPI Link 2 Debug
- 2f60 Haswell-E Home Agent 1
- 2f68 Haswell-E Integrated Memory Controller 1 Target Address, Thermal & RAS Registers
- 2f6a Haswell-E Integrated Memory Controller 1 Channel Target Address Decoder
- 2f6b Haswell-E Integrated Memory Controller 1 Channel Target Address Decoder
- 2f6c Haswell-E Integrated Memory Controller 1 Channel Target Address Decoder
- 2f6d Haswell-E Integrated Memory Controller 1 Channel Target Address Decoder
- 2f6e Haswell-E DDRIO Channel 2/3 Broadcast
- 2f6f Haswell-E DDRIO Global Broadcast
- 2f70 Haswell-E Home Agent 0 Debug
- 2f71 Haswell-E Integrated Memory Controller 0 Target Address, Thermal & RAS Registers
- 2f76 Haswell-E E3 QPI Link Debug
- 2f78 Haswell-E Home Agent 1 Debug
- 2f79 Haswell-E Integrated Memory Controller 1 Target Address, Thermal & RAS Registers
- 2f7d Haswell-E Scratchpad & Semaphore Registers
- 2f7e Haswell-E E3 QPI Link Debug
- 2f80 Haswell-E QPI Link 0
- 2f81 Haswell-E R3 QPI Link 0 & 1 Monitoring
- 2f83 Haswell-E QPI Link 0
- 2f85 Haswell-E QPI Link 0 Debug
- 2f86 Haswell-E QPI Link 0 Debug
- 2f87 Haswell-E QPI Link 0 Debug
- 2f88 Haswell-E VCU
- 2f8a Haswell-E VCU
- 2f90 Haswell-E QPI Link 1
- 2f93 Haswell-E QPI Link 1
- 2f95 Haswell-E QPI Link 1 Debug
- 2f96 Haswell-E QPI Link 1 Debug
- 2f98 Haswell-E Power Control Unit
- 2f99 Haswell-E Power Control Unit
- 2f9a Haswell-E Power Control Unit
- 2f9c Haswell-E Power Control Unit
- 2fa0 Haswell-E Home Agent 0
- 2fa8 Haswell-E Integrated Memory Controller 0 Target Address, Thermal & RAS Registers
- 2faa Haswell-E Integrated Memory Controller 0 Channel Target Address Decoder
- 2fab Haswell-E Integrated Memory Controller 0 Channel Target Address Decoder
- 2fac Haswell-E Integrated Memory Controller 0 Channel Target Address Decoder
- 2fad Haswell-E Integrated Memory Controller 0 Channel Target Address Decoder
- 2fae Haswell-E DDRIO Channel 0/1 Broadcast
- 2faf Haswell-E DDRIO Global Broadcast
- 2fb0 Haswell-E Integrated Memory Controller 0 Channel 0 Thermal Control
- 2fb1 Haswell-E Integrated Memory Controller 0 Channel 1 Thermal Control
- 2fb2 Haswell-E Integrated Memory Controller 0 Channel 0 ERROR Registers
- 2fb3 Haswell-E Integrated Memory Controller 0 Channel 1 ERROR Registers
- 2fb4 Haswell-E Integrated Memory Controller 0 Channel 2 Thermal Control
- 2fb5 Haswell-E Integrated Memory Controller 0 Channel 3 Thermal Control
- 2fb6 Haswell-E Integrated Memory Controller 0 Channel 2 ERROR Registers
- 2fb7 Haswell-E Integrated Memory Controller 0 Channel 3 ERROR Registers
- 2fb8 Haswell-E DDRIO (VMSE) 2 & 3
- 2fb9 Haswell-E DDRIO (VMSE) 2 & 3
- 2fba Haswell-E DDRIO (VMSE) 2 & 3
- 2fbb Haswell-E DDRIO (VMSE) 2 & 3
- 2fbc Haswell-E DDRIO (VMSE) 0 & 1
- 2fbd Haswell-E DDRIO (VMSE) 0 & 1
- 2fbe Haswell-E DDRIO (VMSE) 0 & 1
- 2fbf Haswell-E DDRIO (VMSE) 0 & 1
- 2fc0 Haswell-E Power Control Unit
- 2fc1 Haswell-E Power Control Unit
- 2fc2 Haswell-E Power Control Unit
- 2fc3 Haswell-E Power Control Unit
- 2fc4 Haswell-E Power Control Unit
- 2fc5 Haswell-E Power Control Unit
- 2fd0 Haswell-E Integrated Memory Controller 1 Channel 0 Thermal Control
- 2fd1 Haswell-E Integrated Memory Controller 1 Channel 1 Thermal Control
- 2fd2 Haswell-E Integrated Memory Controller 1 Channel 0 ERROR Registers
- 2fd3 Haswell-E Integrated Memory Controller 1 Channel 1 ERROR Registers
- 2fd4 Haswell-E Integrated Memory Controller 1 Channel 2 Thermal Control
- 2fd5 Haswell-E Integrated Memory Controller 1 Channel 3 Thermal Control
- 2fd6 Haswell-E Integrated Memory Controller 1 Channel 2 ERROR Registers
- 2fd7 Haswell-E Integrated Memory Controller 1 Channel 3 ERROR Registers
- 2fe0 Haswell-E Unicast Registers
- 2fe1 Haswell-E Unicast Registers
- 2fe2 Haswell-E Unicast Registers
- 2fe3 Haswell-E Unicast Registers
- 2fe4 Haswell-E Unicast Registers
- 2fe5 Haswell-E Unicast Registers
- 2fe6 Haswell-E Unicast Registers
- 2fe7 Haswell-E Unicast Registers
- 2fe8 Haswell-E Unicast Registers
- 2fe9 Haswell-E Unicast Registers
- 2fea Haswell-E Unicast Registers
- 2feb Haswell-E Unicast Registers
- 2fec Haswell-E Unicast Registers
- 2fed Haswell-E Unicast Registers
- 2fee Haswell-E Unicast Registers
- 2fef Haswell-E Unicast Registers
- 2ff0 Haswell-E Unicast Registers
- 2ff1 Haswell-E Unicast Registers
- 2ff2 Haswell-E Unicast Registers
- 2ff3 Haswell-E Unicast Registers
- 2ff4 Haswell-E Unicast Registers
- 2ff5 Haswell-E Unicast Registers
- 2ff6 Haswell-E Unicast Registers
- 2ff7 Haswell-E Unicast Registers
- 2ff8 Haswell-E Buffered Ring Agent
- 2ff9 Haswell-E Buffered Ring Agent
- 2ffa Haswell-E Buffered Ring Agent
- 2ffb Haswell-E Buffered Ring Agent
- 2ffc Haswell-E System Address Decoder & Broadcast Registers
- 2ffd Haswell-E System Address Decoder & Broadcast Registers
- 2ffe Haswell-E System Address Decoder & Broadcast Registers
+ 2f00 Xeon E5 v3/Core i7 DMI2
+ 2f01 Xeon E5 v3/Core i7 PCI Express Root Port 0
+ 2f02 Xeon E5 v3/Core i7 PCI Express Root Port 1
+ 2f03 Xeon E5 v3/Core i7 PCI Express Root Port 1
+ 2f04 Xeon E5 v3/Core i7 PCI Express Root Port 2
+ 2f05 Xeon E5 v3/Core i7 PCI Express Root Port 2
+ 2f06 Xeon E5 v3/Core i7 PCI Express Root Port 2
+ 2f07 Xeon E5 v3/Core i7 PCI Express Root Port 2
+ 2f08 Xeon E5 v3/Core i7 PCI Express Root Port 3
+ 2f09 Xeon E5 v3/Core i7 PCI Express Root Port 3
+ 2f0a Xeon E5 v3/Core i7 PCI Express Root Port 3
+ 2f0b Xeon E5 v3/Core i7 PCI Express Root Port 3
+ 2f10 Xeon E5 v3/Core i7 IIO Debug
+ 2f11 Xeon E5 v3/Core i7 IIO Debug
+ 2f12 Xeon E5 v3/Core i7 IIO Debug
+ 2f13 Xeon E5 v3/Core i7 IIO Debug
+ 2f14 Xeon E5 v3/Core i7 IIO Debug
+ 2f15 Xeon E5 v3/Core i7 IIO Debug
+ 2f16 Xeon E5 v3/Core i7 IIO Debug
+ 2f17 Xeon E5 v3/Core i7 IIO Debug
+ 2f18 Xeon E5 v3/Core i7 IIO Debug
+ 2f19 Xeon E5 v3/Core i7 IIO Debug
+ 2f1a Xeon E5 v3/Core i7 IIO Debug
+ 2f1b Xeon E5 v3/Core i7 IIO Debug
+ 2f1c Xeon E5 v3/Core i7 IIO Debug
+ 2f1d Xeon E5 v3/Core i7 PCIe Ring Interface
+ 2f1e Xeon E5 v3/Core i7 Scratchpad & Semaphore Registers
+ 2f1f Xeon E5 v3/Core i7 Scratchpad & Semaphore Registers
+ 2f20 Xeon E5 v3/Core i7 DMA Channel 0
+ 2f21 Xeon E5 v3/Core i7 DMA Channel 1
+ 2f22 Xeon E5 v3/Core i7 DMA Channel 2
+ 2f23 Xeon E5 v3/Core i7 DMA Channel 3
+ 2f24 Xeon E5 v3/Core i7 DMA Channel 4
+ 2f25 Xeon E5 v3/Core i7 DMA Channel 5
+ 2f26 Xeon E5 v3/Core i7 DMA Channel 6
+ 2f27 Xeon E5 v3/Core i7 DMA Channel 7
+ 2f28 Xeon E5 v3/Core i7 Address Map, VTd_Misc, System Management
+ 2f29 Xeon E5 v3/Core i7 Hot Plug
+ 2f2a Xeon E5 v3/Core i7 RAS, Control Status and Global Errors
+ 2f2c Xeon E5 v3/Core i7 I/O APIC
+ 2f2e Xeon E5 v3/Core i7 RAID 5/6
+ 2f2f Xeon E5 v3/Core i7 RAID 5/6
+ 2f30 Xeon E5 v3/Core i7 Home Agent 0
+ 2f32 Xeon E5 v3/Core i7 QPI Link 0
+ 2f33 Xeon E5 v3/Core i7 QPI Link 1
+ 2f34 Xeon E5 v3/Core i7 PCIe Ring Interface
+ 2f36 Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring
+ 2f37 Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring
+ 2f38 Xeon E5 v3/Core i7 Home Agent 1
+ 2f39 Xeon E5 v3/Core i7 I/O Performance Monitoring
+ 2f3a Xeon E5 v3/Core i7 QPI Link 2
+ 2f3e Xeon E5 v3/Core i7 R3 QPI Link 2 Monitoring
+ 2f3f Xeon E5 v3/Core i7 R3 QPI Link 2 Monitoring
+ 2f40 Xeon E5 v3/Core i7 QPI Link 2
+ 2f41 Xeon E5 v3/Core i7 R3 QPI Link 2 Monitoring
+ 2f43 Xeon E5 v3/Core i7 QPI Link 2
+ 2f45 Xeon E5 v3/Core i7 QPI Link 2 Debug
+ 2f46 Xeon E5 v3/Core i7 QPI Link 2 Debug
+ 2f47 Xeon E5 v3/Core i7 QPI Link 2 Debug
+ 2f60 Xeon E5 v3/Core i7 Home Agent 1
+ 2f68 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Target Address, Thermal & RAS Registers
+ 2f6a Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel Target Address Decoder
+ 2f6b Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel Target Address Decoder
+ 2f6c Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel Target Address Decoder
+ 2f6d Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel Target Address Decoder
+ 2f6e Xeon E5 v3/Core i7 DDRIO Channel 2/3 Broadcast
+ 2f6f Xeon E5 v3/Core i7 DDRIO Global Broadcast
+ 2f70 Xeon E5 v3/Core i7 Home Agent 0 Debug
+ 2f71 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Target Address, Thermal & RAS Registers
+ 2f76 Xeon E5 v3/Core i7 E3 QPI Link Debug
+ 2f78 Xeon E5 v3/Core i7 Home Agent 1 Debug
+ 2f79 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Target Address, Thermal & RAS Registers
+ 2f7d Xeon E5 v3/Core i7 Scratchpad & Semaphore Registers
+ 2f7e Xeon E5 v3/Core i7 E3 QPI Link Debug
+ 2f80 Xeon E5 v3/Core i7 QPI Link 0
+ 2f81 Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring
+ 2f83 Xeon E5 v3/Core i7 QPI Link 0
+ 2f85 Xeon E5 v3/Core i7 QPI Link 0 Debug
+ 2f86 Xeon E5 v3/Core i7 QPI Link 0 Debug
+ 2f87 Xeon E5 v3/Core i7 QPI Link 0 Debug
+ 2f88 Xeon E5 v3/Core i7 VCU
+ 2f8a Xeon E5 v3/Core i7 VCU
+ 2f90 Xeon E5 v3/Core i7 QPI Link 1
+ 2f93 Xeon E5 v3/Core i7 QPI Link 1
+ 2f95 Xeon E5 v3/Core i7 QPI Link 1 Debug
+ 2f96 Xeon E5 v3/Core i7 QPI Link 1 Debug
+ 2f98 Xeon E5 v3/Core i7 Power Control Unit
+ 2f99 Xeon E5 v3/Core i7 Power Control Unit
+ 2f9a Xeon E5 v3/Core i7 Power Control Unit
+ 2f9c Xeon E5 v3/Core i7 Power Control Unit
+ 2fa0 Xeon E5 v3/Core i7 Home Agent 0
+ 2fa8 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Target Address, Thermal & RAS Registers
+ 2faa Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel Target Address Decoder
+ 2fab Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel Target Address Decoder
+ 2fac Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel Target Address Decoder
+ 2fad Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel Target Address Decoder
+ 2fae Xeon E5 v3/Core i7 DDRIO Channel 0/1 Broadcast
+ 2faf Xeon E5 v3/Core i7 DDRIO Global Broadcast
+ 2fb0 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel 0 Thermal Control
+ 2fb1 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel 1 Thermal Control
+ 2fb2 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel 0 ERROR Registers
+ 2fb3 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel 1 ERROR Registers
+ 2fb4 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel 2 Thermal Control
+ 2fb5 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel 3 Thermal Control
+ 2fb6 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel 2 ERROR Registers
+ 2fb7 Xeon E5 v3/Core i7 Integrated Memory Controller 0 Channel 3 ERROR Registers
+ 2fb8 Xeon E5 v3/Core i7 DDRIO (VMSE) 2 & 3
+ 2fb9 Xeon E5 v3/Core i7 DDRIO (VMSE) 2 & 3
+ 2fba Xeon E5 v3/Core i7 DDRIO (VMSE) 2 & 3
+ 2fbb Xeon E5 v3/Core i7 DDRIO (VMSE) 2 & 3
+ 2fbc Xeon E5 v3/Core i7 DDRIO (VMSE) 0 & 1
+ 2fbd Xeon E5 v3/Core i7 DDRIO (VMSE) 0 & 1
+ 2fbe Xeon E5 v3/Core i7 DDRIO (VMSE) 0 & 1
+ 2fbf Xeon E5 v3/Core i7 DDRIO (VMSE) 0 & 1
+ 2fc0 Xeon E5 v3/Core i7 Power Control Unit
+ 2fc1 Xeon E5 v3/Core i7 Power Control Unit
+ 2fc2 Xeon E5 v3/Core i7 Power Control Unit
+ 2fc3 Xeon E5 v3/Core i7 Power Control Unit
+ 2fc4 Xeon E5 v3/Core i7 Power Control Unit
+ 2fc5 Xeon E5 v3/Core i7 Power Control Unit
+ 2fd0 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel 0 Thermal Control
+ 2fd1 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel 1 Thermal Control
+ 2fd2 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel 0 ERROR Registers
+ 2fd3 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel 1 ERROR Registers
+ 2fd4 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel 2 Thermal Control
+ 2fd5 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel 3 Thermal Control
+ 2fd6 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel 2 ERROR Registers
+ 2fd7 Xeon E5 v3/Core i7 Integrated Memory Controller 1 Channel 3 ERROR Registers
+ 2fe0 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe1 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe2 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe3 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe4 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe5 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe6 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe7 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe8 Xeon E5 v3/Core i7 Unicast Registers
+ 2fe9 Xeon E5 v3/Core i7 Unicast Registers
+ 2fea Xeon E5 v3/Core i7 Unicast Registers
+ 2feb Xeon E5 v3/Core i7 Unicast Registers
+ 2fec Xeon E5 v3/Core i7 Unicast Registers
+ 2fed Xeon E5 v3/Core i7 Unicast Registers
+ 2fee Xeon E5 v3/Core i7 Unicast Registers
+ 2fef Xeon E5 v3/Core i7 Unicast Registers
+ 2ff0 Xeon E5 v3/Core i7 Unicast Registers
+ 2ff1 Xeon E5 v3/Core i7 Unicast Registers
+ 2ff2 Xeon E5 v3/Core i7 Unicast Registers
+ 2ff3 Xeon E5 v3/Core i7 Unicast Registers
+ 2ff4 Xeon E5 v3/Core i7 Unicast Registers
+ 2ff5 Xeon E5 v3/Core i7 Unicast Registers
+ 2ff6 Xeon E5 v3/Core i7 Unicast Registers
+ 2ff7 Xeon E5 v3/Core i7 Unicast Registers
+ 2ff8 Xeon E5 v3/Core i7 Buffered Ring Agent
+ 2ff9 Xeon E5 v3/Core i7 Buffered Ring Agent
+ 2ffa Xeon E5 v3/Core i7 Buffered Ring Agent
+ 2ffb Xeon E5 v3/Core i7 Buffered Ring Agent
+ 2ffc Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers
+ 2ffd Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers
+ 2ffe Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers
+ 3165 Wireless 3165
+# Stone Peak 1x1
+ 8086 4010 Dual Band Wireless AC 3165
+# Stone Peak 1x1
+ 8086 4210 Dual Band Wireless AC 3165
3200 GD31244 PCI-X SATA HBA
1775 c200 C2K onboard SATA host bus adapter
3310 IOP348 I/O Processor
3b08 5 Series Chipset LPC Interface Controller
3b09 Mobile 5 Series Chipset LPC Interface Controller
1025 0347 Aspire 7740G
+ 144d c06a R730 Laptop
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
3b0a 5 Series Chipset LPC Interface Controller
1028 02da OptiPlex 980
15d9 060d C7SIM-Q Motherboard
15d9 060d C7SIM-Q Motherboard
3b23 5 Series/3400 Series Chipset 4 port SATA AHCI Controller
3b25 5 Series/3400 Series Chipset SATA RAID Controller
+ 103c 3118 HP Smart Array B110i SATA RAID Controller
3b26 5 Series/3400 Series Chipset 2 port SATA IDE Controller
3b28 5 Series/3400 Series Chipset 4 port SATA IDE Controller
+ 144d c06a R730 Laptop
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
3b29 5 Series/3400 Series Chipset 4 port SATA AHCI Controller
1025 0347 Aspire 7740G
+ 144d c06a R730 Laptop
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
3b2c 5 Series/3400 Series Chipset SATA RAID Controller
3b2d 5 Series/3400 Series Chipset 2 port SATA IDE Controller
+ 144d c06a R730 Laptop
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
e4bf 50c1 PC1-GROOVE
3b2e 5 Series/3400 Series Chipset 4 port SATA IDE Controller
e4bf 50c1 PC1-GROOVE
1025 0347 Aspire 7740G
1028 02da OptiPlex 980
1028 040b Latitude E6510
+ 144d c06a R730 Laptop
15d9 060d C7SIM-Q Motherboard
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
e4bf 50c1 PC1-GROOVE
3b32 5 Series/3400 Series Chipset Thermal Subsystem
1025 0347 Aspire 7740G
+ 144d c06a R730 Laptop
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
3b34 5 Series/3400 Series Chipset USB2 Enhanced Host Controller
1025 0347 Aspire 7740G
1028 02da OptiPlex 980
1028 040b Latitude E6510
+ 144d c06a R730 Laptop
15d9 060d C7SIM-Q Motherboard
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
e4bf 50c1 PC1-GROOVE
3b36 5 Series/3400 Series Chipset USB Universal Host Controller
3b37 5 Series/3400 Series Chipset USB Universal Host Controller
1025 0347 Aspire 7740G
1028 02da OptiPlex 980
1028 040b Latitude E6510
+ 144d c06a R730 Laptop
15d9 060d C7SIM-Q Motherboard
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
e4bf 50c1 PC1-GROOVE
3b3e 5 Series/3400 Series Chipset USB Universal Host Controller
3b3f 5 Series/3400 Series Chipset USB Universal Host Controller
3b42 5 Series/3400 Series Chipset PCI Express Root Port 1
1028 02da OptiPlex 980
1028 040b Latitude E6510
+ 144d c06a R730 Laptop
15d9 060d C7SIM-Q Motherboard
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
3b44 5 Series/3400 Series Chipset PCI Express Root Port 2
1028 040b Latitude E6510
15d9 060d C7SIM-Q Motherboard
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
3b46 5 Series/3400 Series Chipset PCI Express Root Port 3
1028 040b Latitude E6510
+ 144d c06a R730 Laptop
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
3b48 5 Series/3400 Series Chipset PCI Express Root Port 4
1028 040b Latitude E6510
+ 144d c06a R730 Laptop
3b4a 5 Series/3400 Series Chipset PCI Express Root Port 5
1028 02da OptiPlex 980
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
3b4c 5 Series/3400 Series Chipset PCI Express Root Port 6
3b4e 5 Series/3400 Series Chipset PCI Express Root Port 7
3b50 5 Series/3400 Series Chipset PCI Express Root Port 8
1025 0347 Aspire 7740G
1028 02da OptiPlex 980
1028 040b Latitude E6510
+ 144d c06a R730 Laptop
15d9 060d C7SIM-Q Motherboard
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
e4bf 50c1 PC1-GROOVE
3b57 5 Series/3400 Series Chipset High Definition Audio
3b64 5 Series/3400 Series Chipset HECI Controller
1025 0347 Aspire 7740G
15d9 060d C7SIM-Q Motherboard
+ 17c0 10d2 Medion Akoya E7214 Notebook PC [MD98410]
e4bf 50c1 PC1-GROOVE
3b65 5 Series/3400 Series Chipset HECI Controller
3b66 5 Series/3400 Series Chipset PT IDER Controller
4222 PRO/Wireless 3945ABG [Golan] Network Connection
103c 135c PRO/Wireless 3945ABG [Golan] Network Connection
8086 1000 PRO/Wireless 3945ABG Network Connection
- 8086 1001 PRO/Wireless 3945ABG Network Connection
+ 8086 1001 WM3945ABG MOW2
8086 1005 PRO/Wireless 3945BG Network Connection
8086 1034 PRO/Wireless 3945BG Network Connection
8086 1044 PRO/Wireless 3945BG Network Connection
65f9 5100 Chipset PCI Express x8 Port 6-7
65fa 5100 Chipset PCI Express x16 Port 4-7
65ff 5100 Chipset DMA Engine
+ 6f00 Broadwell DMI2
+ 6f01 Broadwell PCI Express Root Port 0
+ 6f02 Broadwell PCI Express Root Port 1
+ 6f03 Broadwell PCI Express Root Port 1
+ 6f04 Broadwell PCI Express Root Port 2
+ 6f05 Broadwell PCI Express Root Port 2
+ 6f06 Broadwell PCI Express Root Port 2
+ 6f07 Broadwell PCI Express Root Port 2
+ 6f08 Broadwell PCI Express Root Port 3
+ 6f09 Broadwell PCI Express Root Port 3
+ 6f0a Broadwell PCI Express Root Port 3
+ 6f0b Broadwell PCI Express Root Port 3
+ 6f10 Broadwell IIO Debug
+ 6f11 Broadwell IIO Debug
+ 6f12 Broadwell IIO Debug
+ 6f13 Broadwell IIO Debug
+ 6f14 Broadwell IIO Debug
+ 6f15 Broadwell IIO Debug
+ 6f16 Broadwell IIO Debug
+ 6f17 Broadwell IIO Debug
+ 6f18 Broadwell IIO Debug
+ 6f19 Broadwell IIO Debug
+ 6f1a Broadwell IIO Debug
+ 6f1b Broadwell IIO Debug
+ 6f1c Broadwell IIO Debug
+ 6f1d Broadwell R2PCIe Agent
+ 6f1e Broadwell Ubox
+ 6f1f Broadwell Ubox
+ 6f20 Broadwell-DE Crystal Beach DMA Channel 0
+ 6f21 Broadwell-DE Crystal Beach DMA Channel 1
+ 6f22 Broadwell-DE Crystal Beach DMA Channel 2
+ 6f23 Broadwell-DE Crystal Beach DMA Channel 3
+ 6f24 Broadwell-DE Crystal Beach DMA Channel 4
+ 6f25 Broadwell-DE Crystal Beach DMA Channel 5
+ 6f26 Broadwell-DE Crystal Beach DMA Channel 6
+ 6f27 Broadwell-DE Crystal Beach DMA Channel 7
+ 6f28 Broadwell Adress Map/VTd_Misc/System Management
+ 6f29 Broadwell IIO Hot Plug
+ 6f2a Broadwell IIO RAS/Control Status/Global Errors
+ 6f2c Broadwell I/O APIC
+ 6f30 Broadwell Home Agent 0
+ 6f32 Broadwell QPI Link 0
+ 6f33 Broadwell QPI Link 1
+ 6f34 Broadwell R2PCIe Agent
+ 6f36 Broadwell R3 QPI Link 0/1
+ 6f37 Broadwell R3 QPI Link 0/1
+ 6f38 Broadwell Home Agent 1
+ 6f39 Broadwell IO Performance Monitoring
+ 6f3a Broadwell QPI Link 2
+ 6f3e Broadwell R3 QPI Link 2
+ 6f3f Broadwell R3 QPI Link 2
+ 6f40 Broadwell QPI Link 2
+ 6f41 Broadwell R3 QPI Link 2
+ 6f43 Broadwell QPI Link 2
+ 6f45 Broadwell QPI Link 2 Debug
+ 6f46 Broadwell QPI Link 2 Debug
+ 6f47 Broadwell QPI Link 2 Debug
+ 6f60 Broadwell Home Agent 1
+ 6f68 Broadwell Target Address/Thermal/RAS
+ 6f6a Broadwell Channel Target Address Decoder
+ 6f6b Broadwell Channel Target Address Decoder
+ 6f6c Broadwell Channel Target Address Decoder
+ 6f6d Broadwell Channel Target Address Decoder
+ 6f6e Broadwell DDRIO Channel 2/3 Broadcast
+ 6f6f Broadwell DDRIO Global Broadcast
+ 6f70 Broadwell Home Agent 0 Debug
+ 6f71 Broadwell Memory Controller 0 - Target Address/Thermal/RAS
+ 6f76 Broadwell R3 QPI Link Debug
+ 6f78 Broadwell Home Agent 1 Debug
+ 6f79 Broadwell Target Address/Thermal/RAS
+ 6f7d Broadwell Ubox
+ 6f7e Broadwell R3 QPI Link Debug
+ 6f80 Broadwell QPI Link 0
+ 6f81 Broadwell R3 QPI Link 0/1
+ 6f83 Broadwell QPI Link 0
+ 6f85 Broadwell QPI Link 0 Debug
+ 6f86 Broadwell QPI Link 0 Debug
+ 6f87 Broadwell QPI Link 0 Debug
+ 6f88 Broadwell Power Control Unit
+ 6f8a Broadwell Power Control Unit
+ 6f90 Broadwell QPI Link 1
+ 6f93 Broadwell QPI Link 1
+ 6f95 Broadwell QPI Link 1 Debug
+ 6f96 Broadwell QPI Link 1 Debug
+ 6f98 Broadwell Power Control Unit
+ 6f99 Broadwell Power Control Unit
+ 6f9a Broadwell Power Control Unit
+ 6f9c Broadwell Power Control Unit
+ 6fa0 Broadwell Home Agent 0
+ 6fa8 Broadwell Memory Controller 0 - Target Address/Thermal/RAS
+ 6faa Broadwell Memory Controller 0 - Channel Target Address Decoder
+ 6fab Broadwell Memory Controller 0 - Channel Target Address Decoder
+ 6fac Broadwell Memory Controller 0 - Channel Target Address Decoder
+ 6fad Broadwell Memory Controller 0 - Channel Target Address Decoder
+ 6fae Broadwell DDRIO Channel 0/1 Broadcast
+ 6faf Broadwell DDRIO Global Broadcast
+ 6fb0 Broadwell Memory Controller 0 - Channel 0 Thermal Control
+ 6fb1 Broadwell Memory Controller 0 - Channel 1 Thermal Control
+ 6fb2 Broadwell Memory Controller 0 - Channel 0 Error
+ 6fb3 Broadwell Memory Controller 0 - Channel 1 Error
+ 6fb4 Broadwell Memory Controller 0 - Channel 2 Thermal Control
+ 6fb5 Broadwell Memory Controller 0 - Channel 3 Thermal Control
+ 6fb6 Broadwell Memory Controller 0 - Channel 2 Error
+ 6fb7 Broadwell Memory Controller 0 - Channel 3 Error
+ 6fb8 Broadwell DDRIO Channel 2/3 Interface
+ 6fb9 Broadwell DDRIO Channel 2/3 Interface
+ 6fba Broadwell DDRIO Channel 2/3 Interface
+ 6fbb Broadwell DDRIO Channel 2/3 Interface
+ 6fbc Broadwell DDRIO Channel 0/1 Interface
+ 6fbd Broadwell DDRIO Channel 0/1 Interface
+ 6fbe Broadwell DDRIO Channel 0/1 Interface
+ 6fbf Broadwell DDRIO Channel 0/1 Interface
+ 6fc0 Broadwell Power Control Unit
+ 6fc1 Broadwell Power Control Unit
+ 6fc2 Broadwell Power Control Unit
+ 6fc3 Broadwell Power Control Unit
+ 6fc4 Broadwell Power Control Unit
+ 6fc5 Broadwell Power Control Unit
+ 6fc6 Broadwell Power Control Unit
+ 6fc7 Broadwell Power Control Unit
+ 6fc8 Broadwell Power Control Unit
+ 6fc9 Broadwell Power Control Unit
+ 6fca Broadwell Power Control Unit
+ 6fcb Broadwell Power Control Unit
+ 6fcc Broadwell Power Control Unit
+ 6fcd Broadwell Power Control Unit
+ 6fce Broadwell Power Control Unit
+ 6fcf Broadwell Power Control Unit
+ 6fd0 Broadwell Memory Controller 1 - Channel 0 Thermal Control
+ 6fd1 Broadwell Memory Controller 1 - Channel 1 Thermal Control
+ 6fd2 Broadwell Memory Controller 1 - Channel 0 Error
+ 6fd3 Broadwell Memory Controller 1 - Channel 1 Error
+ 6fd4 Broadwell Memory Controller 1 - Channel 2 Thermal Control
+ 6fd5 Broadwell Memory Controller 1 - Channel 3 Thermal Control
+ 6fd6 Broadwell Memory Controller 1 - Channel 2 Error
+ 6fd7 Broadwell Memory Controller 1 - Channel 3 Error
+ 6fe0 Broadwell Caching Agent
+ 6fe1 Broadwell Caching Agent
+ 6fe2 Broadwell Caching Agent
+ 6fe3 Broadwell Caching Agent
+ 6fe4 Broadwell Caching Agent
+ 6fe5 Broadwell Caching Agent
+ 6fe6 Broadwell Caching Agent
+ 6fe7 Broadwell Caching Agent
+ 6fe8 Broadwell Caching Agent
+ 6fe9 Broadwell Caching Agent
+ 6fea Broadwell Caching Agent
+ 6feb Broadwell Caching Agent
+ 6fec Broadwell Caching Agent
+ 6fed Broadwell Caching Agent
+ 6fee Broadwell Caching Agent
+ 6fef Broadwell Caching Agent
+ 6ff0 Broadwell Caching Agent
+ 6ff1 Broadwell Caching Agent
+ 6ff8 Broadwell Caching Agent
+ 6ff9 Broadwell Caching Agent
+ 6ffa Broadwell Caching Agent
+ 6ffb Broadwell Caching Agent
+ 6ffc Broadwell Caching Agent
+ 6ffd Broadwell Caching Agent
+ 6ffe Broadwell Caching Agent
7000 82371SB PIIX3 ISA [Natoma/Triton II]
1af4 1100 Qemu virtual machine
7010 82371SB PIIX3 IDE [Natoma/Triton II]
8c5d 8 Series/C220 Series Chipset Family LPC Controller
8c5e 8 Series/C220 Series Chipset Family LPC Controller
8c5f 8 Series/C220 Series Chipset Family LPC Controller
- 8d00 Wellsburg 4-port SATA Controller [IDE mode]
- 8d02 Wellsburg 6-Port SATA Controller [AHCI mode]
- 8d04 Wellsburg SATA Controller [RAID mode]
- 8d06 Wellsburg SATA Controller [RAID mode]
+ 8c80 9 Series Chipset Family SATA Controller [IDE Mode]
+ 8c81 9 Series Chipset Family SATA Controller [IDE Mode]
+ 8c82 9 Series Chipset Family SATA Controller [AHCI Mode]
+ 8c83 9 Series Chipset Family SATA Controller [AHCI Mode]
+ 8c84 9 Series Chipset Family SATA Controller [RAID Mode]
+ 8c85 9 Series Chipset Family SATA Controller [RAID Mode]
+ 8c86 9 Series Chipset Family SATA Controller [RAID Mode]
+ 8c87 9 Series Chipset Family SATA Controller [RAID Mode]
+ 8c88 9 Series Chipset Family SATA Controller [IDE Mode]
+ 8c89 9 Series Chipset Family SATA Controller [IDE Mode]
+ 8c8e 9 Series Chipset Family SATA Controller [RAID Mode]
+ 8c8f 9 Series Chipset Family SATA Controller [RAID Mode]
+ 8c90 9 Series Chipset Family PCI Express Root Port 1
+ 8c92 9 Series Chipset Family PCI Express Root Port 2
+ 8c94 9 Series Chipset Family PCI Express Root Port 3
+ 8c96 9 Series Chipset Family PCI Express Root Port 4
+ 8c98 9 Series Chipset Family PCI Express Root Port 5
+ 8c9a 9 Series Chipset Family PCI Express Root Port 6
+ 8c9c 9 Series Chipset Family PCI Express Root Port 7
+ 8c9e 9 Series Chipset Family PCI Express Root Port 8
+ 8ca0 9 Series Chipset Family HD Audio Controller
+ 8ca2 9 Series Chipset Family SMBus Controller
+ 8ca4 9 Series Chipset Family Thermal Controller
+ 8ca6 9 Series Chipset Family USB EHCI Controller #1
+ 8cad 9 Series Chipset Family USB EHCI Controller #2
+ 8cb1 9 Series Chipset Family USB xHCI Controller
+ 8cb3 9 Series Chipset Family LAN Controller
+ 8cba 9 Series Chipset Family ME Interface #1
+ 8cbb 9 Series Chipset Family ME Interface #2
+ 8cbc 9 Series Chipset Family IDE-R Controller
+ 8cbd 9 Series Chipset Family KT Controller
+ 8cc1 9 Series Chipset Family LPC Controller
+ 8cc2 9 Series Chipset Family LPC Controller
+ 8cc3 9 Series Chipset Family HM97 LPC Controller
+ 8cc4 9 Series Chipset Family Z97 LPC Controller
+ 8cc6 9 Series Chipset Family H97 Controller
+ 8d00 C610/X99 series chipset 4-port SATA Controller [IDE mode]
+ 8d02 C610/X99 series chipset 6-Port SATA Controller [AHCI mode]
+ 8d04 C610/X99 series chipset SATA Controller [RAID mode]
+ 8d06 C610/X99 series chipset SATA Controller [RAID mode]
17aa 1031 ThinkServer RAID 110i
- 8d08 Wellsburg 2-port SATA Controller [IDE mode]
- 8d0e Wellsburg SATA Controller [RAID mode]
- 8d10 Wellsburg PCI Express Root Port #1
- 8d11 Wellsburg PCI Express Root Port #1
- 8d12 Wellsburg PCI Express Root Port #2
- 8d13 Wellsburg PCI Express Root Port #2
- 8d14 Wellsburg PCI Express Root Port #3
- 8d15 Wellsburg PCI Express Root Port #3
- 8d16 Wellsburg PCI Express Root Port #4
- 8d17 Wellsburg PCI Express Root Port #4
- 8d18 Wellsburg PCI Express Root Port #5
- 8d19 Wellsburg PCI Express Root Port #5
- 8d1a Wellsburg PCI Express Root Port #6
- 8d1b Wellsburg PCI Express Root Port #6
- 8d1c Wellsburg PCI Express Root Port #7
- 8d1d Wellsburg PCI Express Root Port #7
- 8d1e Wellsburg PCI Express Root Port #8
- 8d1f Wellsburg PCI Express Root Port #8
- 8d20 Wellsburg HD Audio Controller
- 8d21 Wellsburg HD Audio Controller
- 8d22 Wellsburg SMBus Controller
- 8d24 Wellsburg Thermal Subsystem
- 8d26 Wellsburg USB Enhanced Host Controller #1
- 8d2d Wellsburg USB Enhanced Host Controller #2
- 8d31 Wellsburg USB xHCI Host Controller
- 8d33 Wellsburg LAN Controller
- 8d34 Wellsburg NAND Controller
- 8d3a Wellsburg MEI Controller #1
- 8d3b Wellsburg MEI Controller #2
- 8d3c Wellsburg IDE-r Controller
- 8d3d Wellsburg KT Controller
- 8d40 Wellsburg LPC Controller
- 8d41 Wellsburg LPC Controller
- 8d42 Wellsburg LPC Controller
- 8d43 Wellsburg LPC Controller
- 8d44 Wellsburg LPC Controller
- 8d45 Wellsburg LPC Controller
- 8d46 Wellsburg LPC Controller
- 8d47 Wellsburg LPC Controller
- 8d48 Wellsburg LPC Controller
- 8d49 Wellsburg LPC Controller
- 8d4a Wellsburg LPC Controller
- 8d4b Wellsburg LPC Controller
- 8d4c Wellsburg LPC Controller
- 8d4d Wellsburg LPC Controller
- 8d4e Wellsburg LPC Controller
- 8d4f Wellsburg LPC Controller
- 8d60 Wellsburg sSATA Controller [IDE mode]
- 8d62 Wellsburg sSATA Controller [AHCI mode]
- 8d64 Wellsburg sSATA Controller [RAID mode]
- 8d66 Wellsburg sSATA Controller [RAID mode]
- 8d68 Wellsburg sSATA Controller [IDE mode]
- 8d6e Wellsburg sSATA Controller [RAID mode]
- 8d7c Wellsburg SPSR
- 8d7d Wellsburg MS SMBus 0
- 8d7e Wellsburg MS SMBus 1
- 8d7f Wellsburg MS SMBus 2
+ 8d08 C610/X99 series chipset 2-port SATA Controller [IDE mode]
+ 8d0e C610/X99 series chipset SATA Controller [RAID mode]
+ 8d10 C610/X99 series chipset PCI Express Root Port #1
+ 8d11 C610/X99 series chipset PCI Express Root Port #1
+ 8d12 C610/X99 series chipset PCI Express Root Port #2
+ 8d13 C610/X99 series chipset PCI Express Root Port #2
+ 8d14 C610/X99 series chipset PCI Express Root Port #3
+ 8d15 C610/X99 series chipset PCI Express Root Port #3
+ 8d16 C610/X99 series chipset PCI Express Root Port #4
+ 8d17 C610/X99 series chipset PCI Express Root Port #4
+ 8d18 C610/X99 series chipset PCI Express Root Port #5
+ 8d19 C610/X99 series chipset PCI Express Root Port #5
+ 8d1a C610/X99 series chipset PCI Express Root Port #6
+ 8d1b C610/X99 series chipset PCI Express Root Port #6
+ 8d1c C610/X99 series chipset PCI Express Root Port #7
+ 8d1d C610/X99 series chipset PCI Express Root Port #7
+ 8d1e C610/X99 series chipset PCI Express Root Port #8
+ 8d1f C610/X99 series chipset PCI Express Root Port #8
+ 8d20 C610/X99 series chipset HD Audio Controller
+ 8d21 C610/X99 series chipset HD Audio Controller
+ 8d22 C610/X99 series chipset SMBus Controller
+ 8d24 C610/X99 series chipset Thermal Subsystem
+ 8d26 C610/X99 series chipset USB Enhanced Host Controller #1
+ 8d2d C610/X99 series chipset USB Enhanced Host Controller #2
+ 8d31 C610/X99 series chipset USB xHCI Host Controller
+ 8d33 C610/X99 series chipset LAN Controller
+ 8d34 C610/X99 series chipset NAND Controller
+ 8d3a C610/X99 series chipset MEI Controller #1
+ 8d3b C610/X99 series chipset MEI Controller #2
+ 8d3c C610/X99 series chipset IDE-r Controller
+ 8d3d C610/X99 series chipset KT Controller
+ 8d40 C610/X99 series chipset LPC Controller
+ 8d41 C610/X99 series chipset LPC Controller
+ 8d42 C610/X99 series chipset LPC Controller
+ 8d43 C610/X99 series chipset LPC Controller
+ 8d44 C610/X99 series chipset LPC Controller
+ 8d45 C610/X99 series chipset LPC Controller
+ 8d46 C610/X99 series chipset LPC Controller
+ 8d47 C610/X99 series chipset LPC Controller
+ 8d48 C610/X99 series chipset LPC Controller
+ 8d49 C610/X99 series chipset LPC Controller
+ 8d4a C610/X99 series chipset LPC Controller
+ 8d4b C610/X99 series chipset LPC Controller
+ 8d4c C610/X99 series chipset LPC Controller
+ 8d4d C610/X99 series chipset LPC Controller
+ 8d4e C610/X99 series chipset LPC Controller
+ 8d4f C610/X99 series chipset LPC Controller
+ 8d60 C610/X99 series chipset sSATA Controller [IDE mode]
+ 8d62 C610/X99 series chipset sSATA Controller [AHCI mode]
+ 8d64 C610/X99 series chipset sSATA Controller [RAID mode]
+ 8d66 C610/X99 series chipset sSATA Controller [RAID mode]
+ 8d68 C610/X99 series chipset sSATA Controller [IDE mode]
+ 8d6e C610/X99 series chipset sSATA Controller [RAID mode]
+ 8d7c C610/X99 series chipset SPSR
+ 8d7d C610/X99 series chipset MS SMBus 0
+ 8d7e C610/X99 series chipset MS SMBus 1
+ 8d7f C610/X99 series chipset MS SMBus 2
9000 IXP2000 Family Network Processor
9001 IXP2400 Network Processor
9002 IXP2300 Network Processor
9622 Integrated RAID
9641 Integrated RAID
96a1 Integrated RAID
- 9c00 Lynx Point-LP SATA Controller 1 [IDE mode]
- 9c01 Lynx Point-LP SATA Controller 1 [IDE mode]
- 9c02 Lynx Point-LP SATA Controller 1 [AHCI mode]
- 9c03 Lynx Point-LP SATA Controller 1 [AHCI mode]
+ 9c00 8 Series SATA Controller 1 [IDE mode]
+ 9c01 8 Series SATA Controller 1 [IDE mode]
+ 9c02 8 Series SATA Controller 1 [AHCI mode]
+ 9c03 8 Series SATA Controller 1 [AHCI mode]
17aa 2214 ThinkPad X240
- 9c04 Lynx Point-LP SATA Controller 1 [RAID mode]
- 9c05 Lynx Point-LP SATA Controller 1 [RAID mode]
- 9c06 Lynx Point-LP SATA Controller 1 [RAID mode]
- 9c07 Lynx Point-LP SATA Controller 1 [RAID mode]
- 9c08 Lynx Point-LP SATA Controller 2 [IDE mode]
- 9c09 Lynx Point-LP SATA Controller 2 [IDE mode]
- 9c0a LynxPoint-LP SATA Controller [Reserved]
- 9c0b LynxPoint-LP SATA Controller [Reserved]
- 9c0c LynxPoint-LP SATA Controller [Reserved]
- 9c0d LynxPoint-LP SATA Controller [Reserved]
- 9c0e Lynx Point-LP SATA Controller 1 [RAID mode]
- 9c0f Lynx Point-LP SATA Controller 1 [RAID mode]
- 9c10 Lynx Point-LP PCI Express Root Port 1
- 9c11 Lynx Point-LP PCI Express Root Port 1
- 9c12 Lynx Point-LP PCI Express Root Port 2
- 9c13 Lynx Point-LP PCI Express Root Port 2
- 9c14 Lynx Point-LP PCI Express Root Port 3
- 9c15 Lynx Point-LP PCI Express Root Port 3
- 9c16 Lynx Point-LP PCI Express Root Port 4
- 9c17 Lynx Point-LP PCI Express Root Port 4
- 9c18 Lynx Point-LP PCI Express Root Port 5
- 9c19 Lynx Point-LP PCI Express Root Port 5
- 9c1a Lynx Point-LP PCI Express Root Port 6
- 9c1b Lynx Point-LP PCI Express Root Port 6
- 9c1c Lynx Point-LP PCI Express Root Port 7
- 9c1d Lynx Point-LP PCI Express Root Port 7
- 9c1e Lynx Point-LP PCI Express Root Port 8
- 9c1f Lynx Point-LP PCI Express Root Port 8
- 9c20 Lynx Point-LP HD Audio Controller
+ 9c04 8 Series SATA Controller 1 [RAID mode]
+ 9c05 8 Series SATA Controller 1 [RAID mode]
+ 9c06 8 Series SATA Controller 1 [RAID mode]
+ 9c07 8 Series SATA Controller 1 [RAID mode]
+ 9c08 8 Series SATA Controller 2 [IDE mode]
+ 9c09 8 Series SATA Controller 2 [IDE mode]
+ 9c0a 8 Series SATA Controller [Reserved]
+ 9c0b 8 Series SATA Controller [Reserved]
+ 9c0c 8 Series SATA Controller [Reserved]
+ 9c0d 8 Series SATA Controller [Reserved]
+ 9c0e 8 Series SATA Controller 1 [RAID mode]
+ 9c0f 8 Series SATA Controller 1 [RAID mode]
+ 9c10 8 Series PCI Express Root Port 1
+ 9c11 8 Series PCI Express Root Port 1
+ 9c12 8 Series PCI Express Root Port 2
+ 9c13 8 Series PCI Express Root Port 2
+ 9c14 8 Series PCI Express Root Port 3
+ 9c15 8 Series PCI Express Root Port 3
+ 9c16 8 Series PCI Express Root Port 4
+ 9c17 8 Series PCI Express Root Port 4
+ 9c18 8 Series PCI Express Root Port 5
+ 9c19 8 Series PCI Express Root Port 5
+ 9c1a 8 Series PCI Express Root Port 6
+ 9c1b 8 Series PCI Express Root Port 6
+ 9c1c 8 Series PCI Express Root Port 7
+ 9c1d 8 Series PCI Express Root Port 7
+ 9c1e 8 Series PCI Express Root Port 8
+ 9c1f 8 Series PCI Express Root Port 8
+ 9c20 8 Series HD Audio Controller
17aa 2214 ThinkPad X240
- 9c21 Lynx Point-LP HD Audio Controller
- 9c22 Lynx Point-LP SMBus Controller
+ 9c21 8 Series HD Audio Controller
+ 9c22 8 Series SMBus Controller
17aa 2214 ThinkPad X240
- 9c23 Lynx Point-LP CHAP Counters
- 9c24 Lynx Point-LP Thermal
- 9c26 Lynx Point-LP USB EHCI #1
+ 9c23 8 Series CHAP Counters
+ 9c24 8 Series Thermal
+ 9c26 8 Series USB EHCI #1
17aa 2214 ThinkPad X240
- 9c2d Lynx Point-LP USB EHCI #2
- 9c31 Lynx Point-LP USB xHCI HC
+ 9c2d 8 Series USB EHCI #2
+ 9c31 8 Series USB xHCI HC
17aa 2214 ThinkPad X240
- 9c35 Lynx Point-LP SDIO Controller
- 9c36 Lynx Point-LP Audio DSP Controller
- 9c3a Lynx Point-LP HECI #0
+ 9c35 8 Series SDIO Controller
+ 9c36 8 Series Audio DSP Controller
+ 9c3a 8 Series HECI #0
17aa 2214 ThinkPad X240
- 9c3b Lynx Point-LP HECI #1
- 9c3c Lynx Point-LP HECI IDER
- 9c3d Lynx Point-LP HECI KT
- 9c40 Lynx Point-LP LPC Controller
- 9c41 Lynx Point-LP LPC Controller
- 9c42 Lynx Point-LP LPC Controller
- 9c43 Lynx Point-LP LPC Controller
+ 9c3b 8 Series HECI #1
+ 9c3c 8 Series HECI IDER
+ 9c3d 8 Series HECI KT
+ 9c40 8 Series LPC Controller
+ 9c41 8 Series LPC Controller
+ 9c42 8 Series LPC Controller
+ 9c43 8 Series LPC Controller
17aa 2214 ThinkPad X240
- 9c44 Lynx Point-LP LPC Controller
- 9c45 Lynx Point-LP LPC Controller
- 9c46 Lynx Point-LP LPC Controller
- 9c47 Lynx Point-LP LPC Controller
- 9c60 Lynx Point-LP Low Power Sub-System DMA
- 9c61 Lynx Point-LP I2C Controller #0
- 9c62 Lynx Point-LP I2C Controller #1
- 9c63 Lynx Point-LP UART Controller #0
- 9c64 Lynx Point-LP UART Controller #1
- 9c65 Lynx Point-LP SPI Controller #0
- 9c66 Lynx Point-LP SPI Controller #1
+ 9c44 8 Series LPC Controller
+ 9c45 8 Series LPC Controller
+ 9c46 8 Series LPC Controller
+ 9c47 8 Series LPC Controller
+ 9c60 8 Series Low Power Sub-System DMA
+ 9c61 8 Series I2C Controller #0
+ 9c62 8 Series I2C Controller #1
+ 9c63 8 Series UART Controller #0
+ 9c64 8 Series UART Controller #1
+ 9c65 8 Series SPI Controller #0
+ 9c66 8 Series SPI Controller #1
9c83 Wildcat Point-LP SATA Controller [AHCI Mode]
9c85 Wildcat Point-LP SATA Controller [RAID Mode]
9c87 Wildcat Point-LP SATA Controller [RAID Mode]
a012 Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller
144d c072 Notebook N150P
a013 Atom Processor D4xx/D5xx/N4xx/N5xx CHAPS counter
+ a103 Sunrise Point-H SATA Controller [AHCI mode]
+ a105 Sunrise Point-H SATA Controller [RAID mode]
+ a107 Sunrise Point-H SATA Controller [RAID mode]
+ a10f Sunrise Point-H SATA Controller [RAID mode]
+ a110 Sunrise Point-H PCI Express Root Port #1
+ a111 Sunrise Point-H PCI Express Root Port #2
+ a112 Sunrise Point-H PCI Express Root Port #3
+ a113 Sunrise Point-H PCI Express Root Port #4
+ a114 Sunrise Point-H PCI Express Root Port #5
+ a115 Sunrise Point-H PCI Express Root Port #6
+ a116 Sunrise Point-H PCI Express Root Port #7
+ a117 Sunrise Point-H PCI Express Root Port #8
+ a118 Sunrise Point-H PCI Express Root Port #9
+ a119 Sunrise Point-H PCI Express Root Port #10
+ a11a Sunrise Point-H PCI Express Root Port #11
+ a11b Sunrise Point-H PCI Express Root Port #12
+ a11c Sunrise Point-H PCI Express Root Port #13
+ a11d Sunrise Point-H PCI Express Root Port #14
+ a11e Sunrise Point-H PCI Express Root Port #15
+ a11f Sunrise Point-H PCI Express Root Port #16
+ a120 Sunrise Point-H P2SB
+ a121 Sunrise Point-H PMC
+ a122 Sunrise Point-H cAVS
+ a123 Sunrise Point-H SMBus
+ a124 Sunrise Point-H SPI Controller
+ a125 Sunrise Point-H Gigabit Ethernet Controller
+ a126 Sunrise Point-H Northpeak
+ a127 Sunrise Point-H LPSS UART #0
+ a128 Sunrise Point-H LPSS UART #1
+ a129 Sunrise Point-H LPSS SPI #0
+ a12a Sunrise Point-H LPSS SPI #1
+ a12f Sunrise Point-H USB 3.0 xHCI Controller
+ a130 Sunrise Point-H USB Device Controller (OTG)
+ a131 Sunrise Point-H Thermal subsystem
+ a133 Sunrise Point-H Northpeak ACPI Function
+ a135 Sunrise Point-H Integrated Sensor Hub
+ a13a Sunrise Point-H CSME HECI #1
+ a13b Sunrise Point-H CSME HECI #2
+ a13c Sunrise Point-H CSME IDE Redirection
+ a13d Sunrise Point-H KT Redirection
+ a13e Sunrise Point-H CSME HECI #3
+ a140 Sunrise Point-H LPC Controller
+ a141 Sunrise Point-H LPC Controller
+ a142 Sunrise Point-H LPC Controller
+ a143 Sunrise Point-H LPC Controller
+ a144 Sunrise Point-H LPC Controller
+ a145 Sunrise Point-H LPC Controller
+ a146 Sunrise Point-H LPC Controller
+ a147 Sunrise Point-H LPC Controller
+ a148 Sunrise Point-H LPC Controller
+ a149 Sunrise Point-H LPC Controller
+ a14a Sunrise Point-H LPC Controller
+ a14b Sunrise Point-H LPC Controller
+ a14c Sunrise Point-H LPC Controller
+ a14d Sunrise Point-H LPC Controller
+ a14e Sunrise Point-H LPC Controller
+ a14f Sunrise Point-H LPC Controller
+ a150 Sunrise Point-H LPC Controller
+ a151 Sunrise Point-H LPC Controller
+ a152 Sunrise Point-H LPC Controller
+ a153 Sunrise Point-H LPC Controller
+ a154 Sunrise Point-H LPC Controller
+ a155 Sunrise Point-H LPC Controller
+ a156 Sunrise Point-H LPC Controller
+ a157 Sunrise Point-H LPC Controller
+ a158 Sunrise Point-H LPC Controller
+ a159 Sunrise Point-H LPC Controller
+ a15a Sunrise Point-H LPC Controller
+ a15b Sunrise Point-H LPC Controller
+ a15c Sunrise Point-H LPC Controller
+ a15d Sunrise Point-H LPC Controller
+ a15e Sunrise Point-H LPC Controller
+ a15f Sunrise Point-H LPC Controller
+ a160 Sunrise Point-H LPSS I2C Controller #0
+ a161 Sunrise Point-H LPSS I2C Controller #1
+ a166 Sunrise Point-H LPSS UART Controller #2
+ a167 Sunrise Point-H PCI Root Port #17
+ a168 Sunrise Point-H PCI Root Port #18
+ a169 Sunrise Point-H PCI Root Port #19
+ a16a Sunrise Point-H PCI Root Port #20
+ a170 Sunrise Point-H HD Audio
a620 6400/6402 Advanced Memory Buffer (AMB)
b152 21152 PCI-to-PCI Bridge
8086 b152 21152 PCI-to-PCI Bridge
a11c DeckLink HD Extreme 3
a11d DeckLink Studio
a11e DeckLink Optical Fibre
+ a120 Decklink Studio 2
a121 DeckLink HD Extreme 3D/3D+
a124 Intensity Extreme
a126 Intensity Shuttle
a12f DeckLink Mini Monitor
a130 DeckLink Mini Recorder
a132 UltraStudio 4K
+ a138 Decklink SDI 4K
c001 TSI Telsys
c0a9 Micron/Crucial Technology
c0de Motorola
1205 Wildcard TE205P/TE207P dual-span T1/E1/J1 card 5.0V (u1)
1220 Wildcard TE220 dual-span T1/E1/J1 card 3.3V (PCI-Express) (5th gen)
1405 Wildcard TE405P/TE407P quad-span T1/E1/J1 card 5.0V (u1)
+ 1410 Wildcard TE410P quad-span T1/E1/J1 card 3.3V (5th Gen)
1420 Wildcard TE420 quad-span T1/E1/J1 card 3.3V (PCI-Express) (5th gen)
+ 1820 Wildcard TE820 octal-span T1/E1/J1 card 3.3V (PCI-Express)
2400 Wildcard TDM2400P 24-port analog card
3400 Wildcard TC400P transcoder base card
8000 Wildcard TE121 single-span T1/E1/J1 card (PCI-Express)
8008 Hx8 Series 8-port Base Card (PCI-Express)
800a Wildcard TE133 single-span T1/E1/J1 card (PCI Express)
800b Wildcard TE134 single-span T1/E1/J1 card
+ 800c Wildcard A8A 8-port analog card
+ 800d Wildcard A8B 8-port analog card (PCI-Express)
+ 800e Wildcard TE235/TE435 quad-span T1/E1/J1 card (PCI-Express)
+ 800f Wildcard A4A 4-port analog card
+ 8010 Wildcard A4B 4-port analog card (PCI-Express)
+ 8013 Wildcard TE236/TE436 quad-span T1/E1/J1 card
b410 Wildcard B410 quad-BRI card
d4d4 Dy4 Systems Inc
0601 PCI Mezzanine Card
820f DAG 8.2X 10G Ethernet (2nd bus)
8400 DAG 8.4I Infiniband x4 SDR
8500 DAG 8.5I Infiniband x4 DDR
+ 9200 DAG 9.2SX2 10G Ethernet
920e DAG 9.2X2 10G Ethernet
+ a120 DAG 10X2-P 10G Ethernet
+ a12e DAG 10X2-S 10G Ethernet
+ a140 DAG 10X4-P 10G Ethernet
ec80 Belkin Corporation
ec00 F5D6000
ecc0 Echo Digital Audio Corporation
c0ff Kona/Xena 2
cafe Kona SD
cfee Xena LS/SD-22-DA/SD-DA
+ daff KONA LHi
dcaf Kona HD
dfee Xena HD-DA
efac Xena SD-MM/SD-22-MM
06 SATA controller
00 Vendor specific
01 AHCI 1.0
+ 02 Serial Storage Bus
07 Serial Attached SCSI controller
+ 01 Serial Storage Bus
08 Non-Volatile memory controller
+ 01 NVMHCI
+ 02 NVM Express
80 Mass storage controller
C 02 Network controller
00 Ethernet controller
04 ISDN controller
05 WorldFip controller
06 PICMG controller
+ 07 Infiniband controller
80 Network controller
C 03 Display controller
00 VGA compatible controller
00 8254
01 ISA Timer
02 EISA Timers
+ 03 HPET
03 RTC
00 Generic
01 ISA RTC
10 Communication synchronizer
20 Signal processing management
80 Signal processing controller
+C 12 Processing accelerators
+ 00 Processing accelerators
+C 13 Non-Essential Instrumentation
C ff Unassigned class
# The latest version can be obtained from
# http://www.linux-usb.org/usb.ids
#
-# Version: 2014.02.03
-# Date: 2014-02-03 20:34:03
+# Version: 2015.02.03
+# Date: 2015-02-03 20:34:06
#
# Vendors, devices and interfaces. Please keep sorted.
# interface interface_name <-- two tabs
0001 Fry's Electronics
- 142b Arbiter Systems, Inc.
7778 Counterfeit flash drive [Kingston]
0002 Ingram
0003 Club Mac
0004 Nebraska Furniture Mart
-0011 Unknown manufacturer
+0011 Unknown
7788 Flash mass storage drive
0053 Planex
5301 GW-US54ZGL 802.11bg
0011 Gamepad
0105 Trust International B.V.
145f NW-3100 802.11b/g 54Mbps Wireless Network Adapter [zd1211]
+0127 IBP
+ 0002 HDM Interface
0145 Unknown
0112 Card Reader
017c MLK
210d XPLAIN evaluation kit (CDC ACM)
2110 AVR JTAGICE3 Debugger and Programmer
2122 XMEGA-A1 Explained evaluation kit
+ 2141 ICE debugger
2310 EVK11xx evaluation board
2fe4 ATxmega32A4U DFU bootloader
+ 2fe6 Cactus V6 (DFU)
+ 2fea Cactus RF60 (DFU)
2ff0 atmega32u2 DFU bootloader
+ 2ff4 atmega32u4 DFU bootloader
2ffa at90usb162 DFU bootloader
2ffb at90usb AVR DFU bootloader
2ffd at89c5130/c5131 DFU bootloader
011d Bluetooth 1.2 Interface [Broadcom BCM2035]
0121 HP49g+ Calculator
0122 HID Internet Keyboard
+ 0139 Barcode Scanner 4430
0201 ScanJet 6200c
0202 PhotoSmart S20
0204 DeskJet 815c
0212 DeskJet 1220C
0217 LaserJet 2200
0218 APOLLO P2500/2600
+ 0241 Link-5 micro dongle
0304 DeskJet 810c/812c
0305 ScanJet 4300c
0307 CD-Writer+ CD-4e
0314 designjet 30/130 series
0317 LaserJet 1200
0324 SK-2885 keyboard
+ 034a Elite Keyboard
0401 ScanJet 5200c
0404 DeskJet 830c/832c
0405 ScanJet 3400cse
0f11 OfficeJet V40
0f12 Printing Support
0f17 LaserJet 1150
+ 0f2a LaserJet 400 color M451dn
1001 Photo Scanner 1000
1002 PhotoSmart 140 series
1004 DeskJet 970c/970cse
1312 DeskJet 460
1317 LaserJet 1005
1327 iLO Virtual Hub
+ 134a Optical Mouse
1405 ScanJet 3670
1411 PSC 750
1424 f2105 Monitor Hub
1512 Printing Support
1517 color LaserJet 3500
1524 Smart Card Keyboard - KR
+ 1539 Mini Magnetic Stripe Reader
1602 PhotoSmart 330 series
1604 DeskJet 940c
1605 ScanJet 5530C PhotoSmart
1c17 Color LaserJet 2550l
1d02 PhotoSmart A310 series
1d17 LaserJet 1320
+ 1d24 Barcode scanner
1e02 PhotoSmart A320 Printer series
1e11 PSC-950
1e17 LaserJet 1160 series
2005 ScanJet 3570c
2012 OfficeJet Pro K5400
201d un2400 Gobi Wireless Modem (QDL mode)
+ 2039 Cashdrawer
2102 PhotoSmart 7345
2104 DeskJet 630c
2112 OfficeJet Pro L7500
2502 PhotoSmart 7700 series
2504 DeskJet F4200 series
2505 ScanJet 3770
- 2512 OfficeJet Pro L7300
+ 2512 OfficeJet Pro L7300 / Compaq LA2405 series monitor
2514 4-port hub
2517 LaserJet 2410
251d Gobi 2000 Wireless Modem
2702 PhotoSmart A620 series
2704 DeskJet 915
2717 Color LaserJet 2830
+ 2724 Magnetic Stripe Reader IDRA-334133-HP
+ 2805 Scanjet G2710
2811 PSC-2100
2817 Color LaserJet 2840
2902 PhotoSmart A820 series
3807 c485w Flash Drive
3817 LaserJet P2015 series
3902 PhotoSmart 130
+ 3912 Officejet Pro 8500
3a02 PhotoSmart 7150
3a11 OfficeJet 5500 series
3a17 Printing Support
5811 PhotoSmart C5100 series
5817 LaserJet M1319f MFP
5911 PhotoSmart C6180
+ 5912 Officejet Pro 8600
5a11 PhotoSmart C7100 series
5b11 OfficeJet J2100 series
5c11 PhotoSmart C4200 Printer series
6a17 LaserJet 4240
6b02 PhotoSmart R707 (PTP mode)
6b11 Photosmart C4500 series
+ 6c11 Photosmart C4480
6c17 Color LaserJet 4610
6f17 Color LaserJet CP6015 series
7004 DeskJet 3320c
bef4 NEC Picty760
c002 PhotoSmart 7800 series
c102 PhotoSmart 8000 series
+ c111 Deskjet 1510
c202 PhotoSmart 8200 series
c302 DeskJet D2300
c402 PhotoSmart D5100 series
03fb OPTi, Inc.
03fc Elitegroup Computer Systems
03fd Xilinx, Inc.
+ 0008 Platform Cable USB II
03fe Farallon Comunications
0400 National Semiconductor Corp.
05dc Rigol Technologies DS1000USB Oscilloscope
5667 M5667 MP3 player
9665 Gateway Webcam
0403 Future Technology Devices International, Ltd
- 0000 H4SMK 7 Port Hub
+ 0000 H4SMK 7 Port Hub / Bricked Counterfeit FT232 Serial (UART) IC
0232 Serial Converter
1060 JTAG adapter
+ 1234 IronLogic RFID Adapter [Z-2 USB]
6001 FT232 USB-Serial (UART) IC
6002 Lumel PD12
6007 Serial Converter
8b2a Alpermann+Velte Rubidium Q1
8b2b Alpermann+Velte TCD
8b2c Alpermann+Velte TCC70
+ 9132 LCD and Temperature Interface
9133 CallerID
9135 Rotary Pub alarm
+ 9136 Pulsecounter
9e90 Marvell OpenRD Base/Client
9f80 Ewert Energy Systems CANdapter
a6d0 Texas Instruments XDS100v2 JTAG / BeagleBone A3
a951 HCP HIT GSM/GPRS modem [Cinterion MC55i]
+ a9a0 FT2232D - Dual UART/FIFO IC - FTDI
abb8 Lego Mindstorms NXTCam
b810 US Interface Navigator (CAT and 2nd PTT lines)
b811 US Interface Navigator (WKEY and FSK lines)
d011 SCS Position-Tracker/TNC
d012 SCS DRAGON 1
d013 SCS DRAGON 1
+ d388 Xsens converter
+ d389 Xsens Wireless Receiver
+ d38a Xsens serial converter
+ d38b Xsens serial converter
+ d38c Xsens Wireless Receiver
+ d38d Xsens Awinda Station
+ d38e Xsens serial converter
+ d38f Xsens serial converter
d491 Zolix Omni 1509 monochromator
d578 Accesio USB-COM-4SM
d6f8 UNI Black BOX
d739 Propox ISPcable III
d9a9 Actisense USG-1 NMEA Serial Gateway
d9aa Actisense NGT-1 NMEA2000 PC Interface
+ daf4 Qundis Serial Infrared Head
e0d0 Total Phase Aardvark I2C/SPI Host Adapter
e521 EVER Sinline XL Series UPS
e6c8 PYRAMID Computer GmbH LCD
e8d8 Aaronia AG Spectran Spectrum Analyzer
e8dc Aaronia AG UBBV Preamplifier
ea90 Eclo 1-Wire Adapter
+ ecd9 miControl miCan-Stick
ed71 HAMEG HO870 Serial Port
ed72 HAMEG HO720 Serial Port
ed73 HAMEG HO730 Serial Port
ed74 HAMEG HO820 Serial Port
ef10 FT1245BL
f070 Serial Converter 422/485 [Vardaan VEUSB422R3]
+ f0c8 SPROG Decoder Programmer
+ f0c9 SPROG-DCC CAN-USB
+ f0e9 Tagsys L-P101
f1a0 Asix PRESTO Programmer
f208 Papenmeier Braille-Display
f3c0 4N-GALAXY Serial Converter
0249 Aterm WL300NU-G
02b4 Aterm WL300NU-AG
02b6 Aterm WL300NU-GS 802.11n Wireless Adapter
+ 02bc Computer Monitor
0300 LifeTouch Note
0301 LifeTouch Note (debug mode)
55aa Hub
4000 InkJet Color Printer
4021 Photo Printer 6800
4022 1400 Digital Photo Printer
+ 402b Photo Printer 6850
402e 605 Photo Printer
4034 805 Photo Printer
4056 ESP 7200 Series AiO
2524 USB MultiSwitch Hub
2602 USB 2.0 Hub
2640 USB 2.0 Hub
+ 2660 Hub
4060 Ultra Fast Media Reader
4064 Ultra Fast Media Reader
+ 5434 Hub
7500 LAN7500 Ethernet 10/100/1000 Adapter
9512 SMC9512/9514 USB Hub
+ 9514 SMC9514 Hub
a700 2 Port Hub
ec00 SMSC9512/9514 Fast Ethernet Adapter
0425 Motorola Semiconductors HK, Ltd
2036 TUSB2036 Hub
2046 TUSB2046 Hub
2077 TUSB2077 Hub
+ 2f90 SM-USB-DIG
3410 TUSB3410 Microcontroller
3f00 OMAP1610
3f02 SMC WSKP100 Wi-Fi Phone
0021 HID Monitor Controls
0050 Diamond Pro 900u CRT Monitor
0051 Integrated Hub
+ 0100 Control Panel for Leica TCS SP5
0453 CMD Technology
6781 NMB Keyboard
6783 Chicony Composite Keyboard
0150 Super Talent 1GB Flash Drive
0151 Super Flash 1GB / GXT 64MB Flash Drive
0162 SiS162 usb Wireless LAN Adapter
- 0163 802.11 Wireless LAN Adapter
+ 0163 SiS163U 802.11 Wireless LAN Adapter
0817 SiS-184-ASUS-4352.17 touch panel
5401 Wireless Adapter RO80211GS-USB
0458 KYE Systems Corp. (Mouse Systems)
4012 TVGo DVB-T03 [AF9015]
5003 G-pen 560 Tablet
5004 G-pen Tablet
+ 505e Genius iSlim 330
6001 GF3000F Ethernet Adapter
7004 VideoCAM Express V2
7006 Dsc 1.3 Smart Camera Device
7055 Slim 2020AF camera
705a Asus USB2.0 Webcam
705c Genius iSlim 1300AF
+ 7061 Genius iLook 1321 V2
+ 7066 Acer Crystal Eye Webcam
+ 7067 Genius iSlim 1300AF V2
+ 7068 Genius eFace 1325R
+ 706d Genius iSlim 2000AF V2
+ 7076 Genius FaceCam 312
7079 FaceCam 2025R
707f TVGo DVB-T03 [RTL2832]
7088 WideCam 1050
+ 7089 Genius FaceCam 320
+ 708c Genius WideCam F100
0459 Adobe Systems, Inc.
045a SONICblue, Inc.
07da Supra Express 56K modem
02ae Xbox NUI Camera
02b0 Xbox NUI Motor
02b6 Xbox 360 / Bluetooth Wireless Headset
+ 02be Kinect for Windows NUI Audio
+ 02bf Kinect for Windows NUI Camera
+ 02c2 Kinect for Windows NUI Motor
+ 02d1 XBOX One Controller for Windows
+ 02d5 Xbox One Digital TV Tuner
0400 Windows Powered Pocket PC 2002
0401 Windows Powered Pocket PC 2002
0402 Windows Powered Pocket PC 2002
0707 Wireless Laser Mouse 8000
0708 Transceiver v 3.0 for Bluetooth
070a Charon Bluetooth Dongle (DFU)
+ 070f LifeChat LX-3000 Headset
0710 Zune Media Player
0713 Wireless Presenter Mouse 8000
0719 Xbox 360 Wireless Adapter
0721 LifeCam NX-3000 (UVC-compliant)
0723 LifeCam VX-7000 (UVC-compliant)
0724 SideWinder Mouse
+ 0728 LifeCam VX-5000
0730 Digital Media Keyboard 3000
0734 Wireless Optical Desktop 700
0736 Sidewinder X5 Mouse
0779 LifeCam HD-3000
0780 Comfort Curve Keyboard 3000
0797 Optical Mouse 200
+ 07f8 Wired Keyboard 600 (model 1576)
930a ISOUSB.SYS Intel 82930 Isochronous IO Test Board
ffca Catalina
fff8 Keyboard
0820 QuickCam VC
0821 HD Webcam C910
0825 Webcam C270
+ 0826 HD Webcam C525
0828 HD Webcam B990
+ 082b Webcam C170
082d HD Pro Webcam C920
0830 QuickClip
+ 0837 BCC950 ConferenceCam
0840 QuickCam Express
+ 0843 Webcam C930e
0850 QuickCam Web
0870 QuickCam Express
0890 QuickCam Traveler
0a17 G330 Headset
0a1f G930
0a29 H600 [Wireless Headset]
+ 0a38 Headset H340
+ 0a44 Wired headset
+ 0a4d G430 Surround Sound Gaming Headset
0b02 C-UV35 [Bluetooth Mini-Receiver] (HID proxy mode)
8801 Video Camera
b305 BT Mini-Receiver
c064 M110 corded optical mouse (M-B0001)
c066 G9x Laser Mouse
c068 G500 Laser Mouse
- c069 M500 Laser Mouse
+ c069 M-U0007 [Corded Mouse M500]
c06a USB Optical Mouse
c06b G700 Wireless Gaming Mouse
c06c Optical Mouse
c124 Harmony 300 Remote
c125 Harmony 200 Remote
c126 Harmony Link
- c12b Harmony Touch Remote
+ c129 Harmony Hub
+ c12b Harmony Touch/Ultimate Remote
c201 WingMan Extreme Joystick with Throttle
c202 WingMan Formula
c207 WingMan Extreme Digital 3D
c246 Gaming Mouse G300
c248 G105 Gaming Keyboard
c24a G600 Gaming Mouse
+ c24c G400s Optical Mouse
c24d G710 Gaming Keyboard
c24e G500s Laser Gaming Mouse
c281 WingMan Force
c318 Illuminated Keyboard
c31a Comfort Wave 450
c31b Compact Keyboard K300
- c31c Keyboard K120 for Business
+ c31c Keyboard K120
c31d Media Keyboard K200
c401 TrackMan Marble Wheel
c402 Marble Mouse (2-button)
c526 Nano Receiver
c529 Logitech Keyboard + Mice
c52b Unifying Receiver
+ c52d R700 Remote Presenter receiver
c52e MK260 Wireless Combo Receiver
c52f Unifying Receiver
c532 Unifying Receiver
+ c534 Unifying Receiver
+ c603 3Dconnexion Spacemouse Plus XT
+ c605 3Dconnexion CADman
+ c606 3Dconnexion Spacemouse Classic
+ c621 3Dconnexion Spaceball 5000
c623 3Dconnexion Space Traveller 3D Mouse
c625 3Dconnexion Space Pilot 3D Mouse
c626 3Dconnexion Space Navigator 3D Mouse
c627 3Dconnexion Space Explorer 3D Mouse
+ c628 3Dconnexion Space Navigator for Notebooks
c629 3Dconnexion SpacePilot Pro 3D Mouse
+ c62b 3Dconnexion Space Mouse Pro
+ c640 NuLOOQ navigator
c702 Cordless Presenter
c703 Elite Keyboard Y-RP20 + Mouse MX900 (Bluetooth)
c704 diNovo Wireless Desktop
5308 KeyMaestro Keyboard
5408 KeyMaestro Multimedia Keyboard/Hub
5500 Portable Keyboard 86+9 keys (Model 6100C US)
+ 5550 5 button optical mouse model M873U
5720 Smart Card Reader
6782 BTC 7932 mouse+keyboard
046f Crystal Semiconductor
1000 Trust Office Scan USB 19200
1002 HP ScanJet 4300c Parallel Port
047c Dell Computer Corp.
+ ffff UPS Tower 500W LV
047d Kensington
1001 Mouse*in*a*Box
1002 Expert Mouse Pro
0004 InTouch Module
0011 InTouch Module
0014 InTouch Module
+ 0100 Stor.E Slim USB 3.0
+ 0200 External Disk
a006 External Disk 1.5TB
a007 External Disk USB 3.0
a009 Stor.E Basics
+ a00d STOR.E BASICS 500GB
+ b001 Stor.E Partner
d010 External Disk 3TB
+ d011 Canvio Desk
0481 Zenith Data Systems
0482 Kyocera Corp.
000e FS-1020D Printer
9006 IT9135 BDA Afatech DVB-T HDTV Dongle
9009 Zolid HD DVD Maker
9135 Zolid Mini DVB-T Stick
+ 9306 IT930x DVB stick
9503 ITE it9503 feature-limited DVB-T transmission chip [ccHDtv]
9507 ITE it9507 full featured DVB-T transmission chip [ccHDtv]
048f Eicon Tech.
1907 CanoScan LiDE 700F
1909 CanoScan LiDE 110
190a CanoScan LiDE 210
+ 190d CanoScan 9000F Mark II
2200 CanoScan LiDE 25
2201 CanoScan FB320U
2202 CanoScan FB620U
2224 CanoScan LiDE 600F
2225 CanoScan LiDE 70
2228 CanoScan 4400F
+ 2229 CanoScan 8600F
2602 MultiPASS C555
2603 MultiPASS C755
260a CAPT Printer
26b5 MF4200 series
26da LBP3010B printer
26e6 iR1024
+ 2736 I-SENSYS MF4550d
2737 MF4410
3041 PowerShot S10
3042 CanoScan FS4000US Film Scanner
3195 PowerShot SX1 IS
3196 PowerShot SD880 IS DIGITAL ELPH / Digital IXUS 870 IS / IXY DIGITAL 920 IS
319a EOS 7D
+ 319b EOS 50D
31aa SELPHY CP770
31ab SELPHY CP760
31ad PowerShot E1
322c PowerShot SX220 HS
3233 PowerShot G1 X
3234 PowerShot SX150 IS
+ 3235 PowerShot ELPH 510 HS / IXUS 1100 HS
3236 PowerShot S100
3237 PowerShot ELPH 310 HS / IXUS 230 HS
3238 PowerShot SX40 HS
325a PowerShot SX160 IS
325b PowerShot S110
325c PowerShot SX500 IS
+ 325e PowerShot N
325f PowerShot SX280 HS
3260 PowerShot SX270 HS
+ 3261 PowerShot A3500 IS
3262 PowerShot A2600
+ 3263 PowerShot SX275 HS
3264 PowerShot A1400
3265 Powershot ELPH 130 IS / IXUS 140
+ 3266 Powershot ELPH 120 IS / IXUS 135
3268 PowerShot ELPH 330 HS / IXUS 255 HS
3271 PowerShot A2500
3276 PowerShot SX170 IS
3277 PowerShot SX510 HS
+ 3278 PowerShot S200
327d Powershot ELPH 115 IS / IXUS 132
+ 327f EOS Rebel T5 / EOS 1200D / EOS Kiss X70
+ 3284 PowerShot D30
+ 3285 PowerShot SX700 HS
+ 3286 PowerShot SX600 HS
+ 3287 PowerShot ELPH 140 IS / IXUS 150
+ 3288 Powershot ELPH 135 / IXUS 145
+ 3289 PowerShot ELPH 340 HS / IXUS 265 HS
+ 328a PowerShot ELPH 150 IS / IXUS 155
+ 328b PowerShot N Facebook(R) Ready
+ 329a PowerShot SX60 HS
+ 329b PowerShot SX520 HS
+ 329c PowerShot SX400 IS
04aa DaeWoo Telecom, Ltd
04ab Chromatic Research
04ac Micro Audiometrics Corp.
300a Rapid Access IIIe Keyboard
3016 UltraNav Keyboard Hub
3018 UltraNav Keyboard
+ 301a 2-port low-power hub
301b SK-8815 Keyboard
301c Enhanced Performance Keyboard
3020 Enhanced Performance Keyboard
310c Wheel Mouse
4427 Portable CD ROM
4482 Serial Converter
+ 4484 SMSC USB20H04 3-Port Hub [ThinkPad X4 UltraBase, Wistron S Note-3 Media Slice]
4485 Serial Converter
4524 40 Character Vacuum Fluorescent Display
4525 Double sided CRT
1006 Human Interface Device
2050 hub
2830 Opera1 DVB-S (cold state)
+ 3813 NANO BIOS Programmer
+ 4235 Monitor 02 Driver
4381 SCAPS USC-1 Scanner Controller
4611 Storage Adapter FX2 (CY)
4616 Flash Disk (TPP)
1097 fi-5110C
10ae fi-4120C2
10af fi-4220C2
+ 10c7 fi-60f scanner
10e0 fi-5120c Scanner
10e1 fi-5220C
10e7 fi-5900C
004f SK-9020 keyboard
1766 HID Monitor Controls
2004 Bluetooth 4.0 [Broadcom BCM20702A0]
+ 7025 HP HD Webcam
9304 Hub
f01c TT1280DA DVB-T TV Tuner
04cb Fuji Photo Film Co., Ltd
0033 PICkit2
0036 PICkit Serial Analyzer
00e0 PIC32 Starter Board
+ 04cd 28Cxxx EEPROM Programmer
0a04 AGP LIN Serial Analyzer
8000 In-Circuit Debugger
8001 ICD2 in-circuit debugger
9004 Microchip REAL ICE
900a PICkit3
c001 PicoLCD 20x4
+ e11c TL866CS EEPROM Programmer [MiniPRO]
+ f437 SBE Tech Ultrasonic Anemometer
+ f4b5 SmartScope
f8da Hughski Ltd. ColorHug
+ f91c SPROG IIv3
faff Dangerous Prototypes BusPirate v4 Bootloader mode
fb00 Dangerous Prototypes BusPirate v4
fbb2 GCUSB-nStep stepper motor controller
fbba DiscFerret Magnetic Disc Analyser (bootloader mode)
fbbb DiscFerret Magnetic Disc Analyser (active mode)
+ fc1e Bachrus Speedometer Interface
fc92 Open Bench Logic Sniffer
ffef PICoPLC [APStech]
04d9 Holtek Semiconductor, Inc.
2221 Keyboard
2323 Keyboard
2519 Shenzhen LogoTech 2.4GHz receiver
- 2832 1channel Telephone line recorder
+ 2832 HT82A832R Audio MCU
2834 HT82A834R Audio MCU
a055 Keyboard
04da Panasonic (Matsushita)
2372 Lumix Camera (Storage mode)
2374 Lumix Camera (PTP mode)
2451 HDC-SD9
+ 245b HC-X920K (3MOS Full HD video camcorder)
2497 HDC-TM700
250c Gobi Wireless Modem (QDL mode)
250d Gobi Wireless Modem
1003 MP3 Player and Recorder
1006 SDC-200Z
130c NX100
+ 1f05 S2 Portable [JMicron] (500GB)
1f06 HX-MU064DA portable harddisk
2018 WIS09ABGN LinkStick Wireless LAN Adapter
2035 Digital Photo Frame Mass Storage
330c ML-1865
3310 ML-331x Series Laser Printer
3315 ML-2540 Series Laser Printer
+ 331e M262x/M282x Xpress Series Laser Printer
3409 SCX-4216F Scanner
340c SCX-5x15 series
340d SCX-6x20 series
341f Composite Device
3420 Composite Device
3426 SCX-4500 Laser Printer
+ 342d SCX-4x28 Series
344f SCX-3400 Series
3605 InkJet Color Printer
3606 InkJet Color Printer
5f04 NEXiO Sync
5f05 STORY Station 1TB
6032 G2 Portable hard drive
+ 6033 G2 Portable device
6034 G2 Portable hard drive
60b3 M2 Portable Hard Drive
60c4 M2 Portable Hard Drive USB 3.0
+ 6124 D3 Station External Hard Drive
61b6 M3 Portable Hard Drive 1TB
6601 Mobile Phone
6602 Galaxy
6843 E2530 Phone (Samsung Kies mode)
684e Wave (GT-S8500)
685b GT-I9100 Phone [Galaxy S II] (mass storage mode)
- 685c GT-I9250 Phone [Galaxy Nexus]
+ 685c GT-I9250 Phone [Galaxy Nexus] (Mass storage mode)
685d GT-I9100 Phone [Galaxy S II] (Download mode)
685e GT-I9100 / GT-C3350 Phones (USB Debugging mode)
- 6860 GT-I9100 Phone [Galaxy S II], GT-I9300 Phone [Galaxy S III], GT-P7500 [Galaxy Tab 10.1]
+ 6860 GT-I9100 Phone [Galaxy S II], GT-I9300 Phone [Galaxy S III], GT-P7500 [Galaxy Tab 10.1] , GT-I9500 [Galaxy S 4]
+ 6863 GT-I9500 [Galaxy S4] / GT-I9250 [Galaxy Nexus] (network tethering)
+ 6864 GT-I9070 (network tethering, USB debugging enabled)
6865 GT-I9300 Phone [Galaxy S III] (PTP mode)
6866 GT-I9300 Phone [Galaxy S III] (debugging mode)
+ 6868 Escape Composite driver for Android Phones: Modem+Diagnostic+ADB
6875 GT-B3710 Standalone LTE device (Commercial)
6876 GT-B3710 LTE Modem
6877 Galaxy S
0402 Genius LuxeMate i200 Keyboard
0403 KU-0420 keyboard
0418 KU-0418 Tactical Pad
+ 0618 RG-0618U Wireless HID Receiver & KG-0609 Wireless Keyboard with Touchpad
0760 Acer KU-0760 Keyboard
0841 HP Multimedia Keyboard
0860 2.4G Multimedia Wireless Kit
b044 Acer CrystalEye Webcam
b057 integrated USB webcam
b059 CKF7037 HP webcam
+ b064 CNA7137 Integrated Webcam
+ b070 Camera
b071 2.0M UVC Webcam / CNF7129
b083 CKF7063 Webcam (HP)
b091 Webcam
b272 Lenovo EasyCamera
b2b0 Camera
b2b9 Lenovo Integrated Camera UVC
+ b2da thinkpad t430s camera
b2ea Integrated Camera [ThinkPad]
b330 Asus 720p CMOS webcam
b354 UVC 1.00 device HD UVC WebCam
+ b394 Integrated Camera
04f3 Elan Microelectronics Corp.
000a Touchscreen
0103 ActiveJet K-2024 Multimedia Keyboard
01ea DCP-7030
01eb MFC-7320
01f4 MFC-5890CN
+ 0217 MFC-8480DN
0223 DCP-365CN
0248 DCP-7055 scanner/printer
+ 0273 DCP-7057 scanner/printer
+ 02b3 MFC J4510DW
1000 Printer
1002 Printer
2002 PTUSB Printing
0015 ViewMate Desktop Mouse CC2201
00d3 00052486 / Laser Mouse M1052 [hama]
0171 SPCA1527A/SPCA1528 SD card camera (Mass Storage mode)
- 0201 RS232C Adapter
+ 0201 SPCP825 RS232C Adapter
0232 Fingerprint
0538 Wireless Optical Mouse 2.4G [Bright]
0561 Flexcam 100
5330 Digitrex 2110
5331 Vivitar Vivicam 10
5360 Sunplus Generic Digital Camera
+ 5563 Digital Media Player MP3/WMA [The Sharper Image]
5720 Card Reader Driver
+ 6333 Siri A9 UVC chipset
7333 Finet Technology Palmpix DC-85
757a Aiptek, MP315 MP3 Player
ffff PureDigital Ritz Disposable
16e1 n10 Handheld Sync
16e2 n20 Pocket PC Sync
16e3 n30 Handheld Sync
+ 2008 Liquid Gallant Duo E350 (preloader)
3202 Liquid
3203 Liquid (Debug mode)
3230 BeTouch E120
3317 Liquid
3325 Iconia tablet A500
3341 Iconia tablet A500
+ 33c3 Liquid Gallant Duo E350
+ 33c4 Liquid Gallant Duo E350 (debug mode)
+ 33c7 Liquid Gallant Duo E350 (USB tethering)
+ 33c8 Liquid Gallant Duo E350 (debug mode, USB tethering)
d001 Divio NW801/DVC-V6+ Digital Camera
0503 Hitachi America, Ltd
0504 Hayes Microcomputer Products
0004 Direct Connect
0012 F8T012 Bluetooth Adapter
0013 F8T013 Bluetooth Adapter
- 0017 B8T017 Bluetooth+EDR 2.1
+ 0017 B8T017 Bluetooth+EDR 2.1 / F4U017 USB 2.0 7-port Hub
003a Universal Media Reader
0050 F5D6050 802.11b Wireless Adapter v2000 [Atmel at76c503a]
0081 F8T001v2 Bluetooth
0409 F5U409 Serial
0416 Staples 12416 7 port desktop hub
0551 F6C550-AVR UPS
+ 065a F8T065BF Mini Bluetooth 4.0 Adapter
0706 2-N-1 7-Port Hub (Lower half)
0802 Nostromo n40 Gamepad
0803 Nostromo 1745 GamePad
1103 F9L1103 N750 DB 802.11abgn 2x3:3 [Ralink RT3573]
1106 F9L1106v1 802.11a/b/g/n/ac Wireless Adapter [Broadcom BCM43526]
1109 F9L1109v1 802.11a/b/g/n/ac Wireless Adapter [Realtek RTL8812AU]
+ 110a F9L1101v2 802.11abgn Wireless Adapter [Realtek RTL8192DU]
11f2 ISY Wireless Micro Adapter IWL 2000 [RTL8188CUS]
1202 F5U120-PC Parallel Printer Port
1203 F5U120-PC Serial Port
2103 F7D2102 802.11n N300 Micro Wireless Adapter v3000 [Realtek RTL8192CU]
21f1 N300 WLAN N Adapter [ISY]
+ 21f2 RTL8192CU 802.11n WLAN Adapter [ISY IWL 4000]
258a F5U258 Host to Host cable
3101 F1DF102U/F1DG102U Flip Hub
3201 F1DF102U/F1DG102U Flip KVM
5055 F5D5055 Gigabit Network Adapter [AX88xxx]
6050 F6D6050 802.11abgn Wireless Adapter [Broadcom BCM4323]
6051 F5D6051 802.11b Wireless Network Adapter [ZyDAS ZD1201]
- 615a F7D4101 / F9L1101 802.11abgn Wireless Adapter [Broadcom BCM4323]
+ 615a F7D4101 / F9L1101v1 802.11abgn Wireless Adapter [Broadcom BCM4323]
7050 F5D7050 Wireless G Adapter v1000/v2000 [Intersil ISL3887]
7051 F5D7051 802.11g Adapter v1000 [Broadcom 4320 USB]
705a F5D7050 Wireless G Adapter v3000 [Ralink RT2571W]
1080 NET1080 USB-USB Bridge
1200 SSDC Adapter II
1265 File-backed Storage Gadget
+ 3424 Lumidigm Venus fingerprint sensor
a0f0 Cambridge Electronic Devices Power1401 mk 2
a140 USB Clik! 40
a141 (OME) PocketZip 40 MP3 Player Driver
2750 EZ-Link (EZLNKUSB.SYS)
2810 Cypress ATAPI Bridge
4d90 AmScope MD1900 camera
+ 7000 PowerSpec MCE460 Front Panel LED Display
7777 Bluetooth Device
9999 AN2131 uninitialized (?)
0548 Tyan Computer Corp.
02c4 Device
02d1 DVD RW
02d2 PSP Slim
+ 02d8 SBAC-US10 SxS PRO memory card reader/writer
02e1 FeliCa S330 [PaSoRi]
02ea PlayStation 3 Memory Card Adaptor
02f9 DSC-H9
0348 HandyCam HDR-TG3E
035b Walkman NWZ-A828
035c NWZ-A726/A728/A729
+ 035f UP-DR200 Photo Printer
0382 Memory Stick PRO-HG Duo Adaptor (MSAC-UAH1)
0385 Walkman NWZ-E436F
0387 IC Recorder (P)
0440 DSC-H55
0485 MHS-PM5 HD camcorder
04cb WALKMAN NWZ-E354
+ 0541 DSC-HX100V [Cybershot Digital Still Camera]
+ 0689 Walkman NWZ-B173F
06bb WALKMAN NWZ-F805
+ 088c Portable Headphone Amplifier
1000 Wireless Buzz! Receiver
054d Try Corp.
054e Proside Corp.
0002 InkJet Color Printer
0004 InkJet Color Printer
0005 InkJet Color Printer
+ 000b Workcentre 24
+ 014e CM215b Printer
0551 CompuTrend Systems, Inc.
0552 Philips Monitors
0553 STMicroelectronics Imaging Division (VLSI Vision)
2800 MIC K/B
2801 MIC K/B Mouse
2802 Kbd Hub
+ 3002 Keyboard
3004 Genius KB-29E
3107 Keyboard
0567 Xyratex International, Ltd
0065 Bamboo
0069 Bamboo One
0081 Graphire Wireless 6x8
+ 0084 Wireless adapter for Bamboo tablets
0090 TPC90
0093 TPC93
009a TPC9A
00cc Cintiq 21UX (DTK-2100)
00d1 Bamboo Pen & Touch (CTH-460-DE)
00d3 Bamboo Fun (CTH-661)
+ 00d4 Bamboo Pen (CTL-460)
00d6 Bamboo Pen & Touch (CTH-460)
00db Bamboo Fun (CTH-661SE-NL)
00dd Bamboo Pen (CTL-470)
00de CTH-470 [Bamboo Fun Pen & Touch]
00f6 Cintiq 24HD touch (DTH-2400) touchscreen
00f8 Cintiq 24HD touch (DTH-2400) tablet
+ 0307 Cintiq Companion Hybrid 13HD (DTH-A1300) tablet
+ 0309 Cintiq Companion Hybrid 13HD (DTH-A1300) touchscreen
+ 030e Intuos Pen Small (CTL480)
0400 PenPartner 4x5
4850 PenPartner 6x8
056b Decicon, Inc.
0040 Wondereye CP-115 Webcam
0041 Webcam Notebook
0042 Webcam Notebook
+ 0320 DVBSky T330 DVB-T2/C tuner
1232 V.90 modem
1234 Typhoon Redfun Modem V90 56k
1252 HCF V90 Data Fax Voice Modem
2000 SoftGate 802.11 Adapter
2002 SoftGate 802.11 Adapter
262a tm5600 Video & Audio Grabber Capture
+ 680c DVBSky T680C DVB-T2/C tuner
+ 6831 DVBSky S960 DVB-S2 tuner
8390 WinFast PalmTop/Novo TV Video
8392 WinFast PalmTop/Novo TV Video
+ 960c DVBSky S960C DVB-S2 tuner
+ c686 Geniatech T220A DVB-T2 TV Stick
+ c688 Geniatech T230 DVB-T2 TV Stick
cafc CX861xx ROM Boot Loader
cafe AccessRunner ADSL Modem
cb00 ADSL Modem
0584 RATOC System, Inc.
0008 Fujifilm MemoryCard ReaderWriter
0220 U2SCX SCSI Converter
+ 0304 U2SCX-LVD (SCSI Converter)
b000 REX-USB60
b020 REX-USB60F
0585 FlashPoint Technology, Inc.
341a NWD-270N Wireless N-lite USB Adapter
341e NWD2105 802.11bgn Wireless Adapter [Ralink RT3070]
341f NWD2205 802.11n Wireless N Adapter [Realtek RTL8192CU]
+ 3425 NWD6505 802.11a/b/g/n/ac Wireless Adapter [MediaTek MT7610U]
343e N220 802.11bgn Wireless Adapter
0587 America Kotobuki Electronics Industries, Inc.
0588 Sapien Design
0589 Victron
058a Nohau Corp.
058b Infineon Technologies
+ 0015 Flash Loader utility
001c Flash Drive
+ 0041 Flash Loader utility
058c In Focus Systems
0007 Flash
0008 LP130
6362 Flash Card Reader/Writer
6364 AU6477 Card Reader Controller
6366 Multi Flash Reader
- 6377 Multimedia Card Reader
+ 6377 AU6375 4-LUN card reader
6386 Memory Card
6387 Flash Drive
6390 USB 2.0-IDE bridge
9472 Keyboard Hub
9510 ChunghwaTL USB02 Smartcard Reader
9520 EMV Certified Smart Card Reader
+ 9540 AU9540 Smartcard Reader
9720 USB-Serial Adapter
a014 Asus Integrated Webcam
+ b002 Acer Integrated Webcam
0590 Omron Corp.
0004 Cable Modem
000b MR56SVS
0001 Touchscreen
0002 Touch Screen Controller
0500 PCT Multitouch HID Controller
+ 0543 DELL XPS touchscreen
0597 Trisignal Communications
0598 Niigata Canotec Co., Inc.
0599 Brilliance Semiconductor, Inc.
0060 PCMCIA PocketZip Dock
0061 Varo PocketZip 40 MP3 Player
006d HipZip MP3 Player
+ 0070 eGo Portable Hard Drive
007c Ultra Max USB/1394
007d HTC42606 0G9AT00 [Iomega HDD]
007e Mini 256MB/512MB Flash Drive [IOM2D5]
0213 PocketDrive USB2
0323 LaCie d2 Drive USB2
0421 Big Disk G465
+ 0525 BigDisk Extreme 500
0641 Mobile Hard Drive
+ 0829 BigDisk Extreme+
100c Rugged Triple Interface Mobile Hard Drive
1010 Desktop Hard Drive
1019 Desktop Hard Drive
102a Rikiki Hard Drive
1049 rikiki Harddrive
1052 P'9220 Mobile Drive
+ 1064 Rugged 16 and 32 GB
a601 HardDrive
a602 CD R/W
05a0 Vetronix Corp.
0003 CVA124E Cable Voice Adapter (WDM)
0004 CVA122E Cable Voice Adapter (WDM)
05a7 Bose Corp.
+ 4000 Bluetooth Headset
+ 4001 Bluetooth Headset in DFU mode
+ 4002 Bluetooth Headset Series 2
+ 4003 Bluetooth Headset Series 2 in DFU mode
+ bc50 SoundLink Wireless Mobile speaker
+ bc51 SoundLink Wireless Mobile speaker in DFU mode
05a8 Spacetec IMC Corp.
05a9 OmniVision Technologies, Inc.
0511 OV511 Webcam
0223 Internal Keyboard/Trackpad (ANSI)
0224 Internal Keyboard/Trackpad (ISO)
0225 Internal Keyboard/Trackpad (JIS)
- 0229 Internal Keyboard/Trackpad (MacBook Pro) (ANSI)
+ 0229 Internal Keyboard/Trackpad (ANSI)
022a Internal Keyboard/Trackpad (MacBook Pro) (ISO)
022b Internal Keyboard/Trackpad (MacBook Pro) (JIS)
0230 Internal Keyboard/Trackpad (MacBook Pro 4,1) (ANSI)
0263 Apple Internal Keyboard / Trackpad (MacBook Retina)
0301 USB Mouse [Mitsumi, M4848]
0302 Optical Mouse [Fujitsu]
- 0304 Optical USB Mouse [Mitsumi]
+ 0304 Mighty Mouse [Mitsumi, M1152]
0306 Optical USB Mouse [Fujitsu]
030a Internal Trackpad
030b Internal Trackpad
1002 Extended Keyboard Hub [Mitsumi]
1003 Hub in Pro Keyboard [Mitsumi, A1048]
1006 Hub in Aluminum Keyboard
+ 1008 Mini DisplayPort to Dual-Link DVI Adapter
1101 Speakers
1105 Audio in LED Cinema Display
1107 Thunderbolt Display Audio
1263 iPod Nano 4.Gen
1265 iPod Nano 5.Gen
1266 iPod Nano 6.Gen
+ 1267 iPod Nano 7.Gen
1281 Apple Mobile Device [Recovery Mode]
1290 iPhone
1291 iPod Touch 1.Gen
1297 iPhone 4
1299 iPod Touch 3.Gen
129a iPad
+ 129c iPhone 4(CDMA)
129e iPod Touch 4.Gen
129f iPad 2
12a0 iPhone 4S
12a2 iPad 2 (3G; 64GB)
+ 12a3 iPad 2 (CDMA)
+ 12a4 iPad 3 (wifi)
+ 12a5 iPad 3 (CDMA)
12a6 iPad 3 (3G, 16 GB)
+ 12a8 iPhone5/5C/5S
12a9 iPad 2
12aa iPod Touch 5.Gen [A1421]
+ 12ab iPad 4 (WiFi, 32GB)
1300 iPod Shuffle
1301 iPod Shuffle 2.Gen
1302 iPod Shuffle 3.Gen
1401 Modem
1402 Ethernet Adapter [A1277]
1500 SuperDrive [A1379]
+ 8005 OHCI Root Hub Simulation
+ 8006 EHCI Root Hub Simulation
+ 8007 XHCI Root Hub USB 2.0 Simulation
8202 HCF V.90 Data/Fax Modem
8203 Bluetooth HCI
8204 Built-in Bluetooth 2.0+EDR HCI
850a FaceTime Camera
8510 FaceTime HD Camera (Built-in)
911c Hub in A1082 [Cinema HD Display 23"]
+ 9127 Hub in Thunderbolt Display
912f Hub in 30" Cinema Display
9215 Studio Display 15"
9217 Studio Display 17"
9201 Gobi Wireless Modem (QDL mode)
9202 Gobi Wireless Modem
9203 Gobi Wireless Modem
+ 9205 Gobi 2000
9211 Acer Gobi Wireless Modem (QDL mode)
9212 Acer Gobi Wireless Modem
9214 Acer Gobi 2000 Wireless Modem (QDL mode)
0103 FO13FF-65 PC-CAM
021a HP Webcam
0318 Webcam
+ 0361 SunplusIT INC. HP Truevision HD Webcam
+ 036e Webcam
0403 Webcam
+ 041b HP 2.0MP High Definition Webcam
05c9 Semtech Corp.
05ca Ricoh Co., Ltd
0101 RDC-5300 Camera
40ff ScanMaker 3600
5003 Goya
5013 3200 Scanner
+ 6072 XT-3500 A4 HD Scanner
80a3 ScanMaker V6USL (#2)
80ac ScanMaker V6UL/SpicyU
05db Sun Corp. (Suntac?)
4d02 MP3 Player
4d12 MP3 Player
4d30 MP3 Player
+ a209 JumpDrive S70
a300 JumpDrive2
a400 JumpDrive trade; Pro 40-501
a410 JumpDrive 128MB/256MB
a560 JumpDrive FireFly
a701 JumpDrive FireFly
a731 JumpDrive FireFly
+ a768 JumpDrive Retrax
a790 JumpDrive 2GB
a811 16GB Gizmo!
a813 16gB flash thumb drive
+ a815 JumpDrive V10
b002 USB CF Reader
b018 Multi-Card Reader
b047 SDHC Reader [RW047-7000]
+ ba02 Workflow CFR1
c753 JumpDrive TwistTurn
05dd Delta Electronics, Inc.
ff31 AWU-120
0700 Bar Code Scanner (CS1504)
0800 Spectrum24 Wireless LAN Adapter
1200 Bar Code Scanner
+ 1701 Bar Code Scanner (CDC)
1900 SNAPI Imaging Device
2000 MC3090 Rugged Mobile Computer
200d MC70 Rugged Mobile Computer
0605 USB 2.0 Hub
0606 USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub
0607 Logitech G110 Hub
- 0608 USB-2.0 4-Port HUB
+ 0608 Hub
0610 4-port hub
+ 0616 hub
0660 USB 2.0 Hub
0700 SIIG US2256 CompactFlash Card Reader
0701 USB 2.0 IDE Adapter
0717 All-in-1 Card Reader
0718 IDE/SATA Adapter
0719 SATA adapter
+ 0722 SD/MMC card reader
0723 GL827L SD/MMC/MS Flash Card Reader
0726 SD Card Reader
0727 microSD Reader/Writer
0731 GL3310 SATA 3Gb/s Bridge Controller
+ 0732 All-in-One Cardreader
0736 microSD Reader/Writer
+ 0741 microSD Card Reader
+ 0743 SDXC and microSDXC CardReader
0760 USB 2.0 Card Reader/Writer
0761 Genesys Mass Storage Device
0780 USBFS DFU Adapter
0007 Kinesis Advantage PRO MPC/USB Keyboard
0081 Kinesis Integrated Hub
00ff VEC Footpedal
+ 0203 Y-mouse Keyboard & Mouse Adapter
020b PS2 Adapter
0232 X-Keys Switch Interface, Programming Mode
0261 X-Keys Switch Interface, SPLAT Mode
05f7 RFC Distribution(s) PTE, Ltd
05f9 PSC Scanning, Inc.
1104 Magellan 2200VS
+ 1206 Gryphon series (OEM mode)
2202 Point of Sale Handheld Scanner
- 2206 Datalogic Gryphon GFS4170
- 2601 Datalogin Magellan 1000i Barcode Scanner
+ 2206 Gryphon series (keyboard emulation mode)
+ 220c Datalogic Gryphon GD4430
+ 2601 Datalogic Magellan 1000i Barcode Scanner
2602 Datalogic Magellan 1100i Barcode Scanner
+ 4204 Gryphon series (RS-232 emulation mode)
5204 Datalogic Gryphon GFS4170 (config mode)
05fa Siemens Telecommunications Systems, Ltd
3301 Keyboard with PS/2 Mouse Port
3302 Keyboard
3303 Keyboard with PS/2 Mouse Port
-05fc Harman Multimedia
+05fc Harman
+ 0001 Soundcraft Si Multi Digital Card
7849 Harman/Kardon SoundSticks
05fd InterAct, Inc.
0239 SV-239 HammerHead Digital
0011 Browser Mouse
0014 Gamepad
1010 Optical Wireless
+ 2001 Microsoft Wireless Receiver 700
05ff LeCroy Corp.
0600 Barco Display Systems
0601 Jazz Hipster Corp.
0602 Vista Imaging, Inc.
1001 ViCam Webcam
0603 Novatek Microelectronics Corp.
- 00f1 Keyboard
+ 00f1 Keyboard (Labtec Ultra Flat Keyboard)
+ 00f2 Keyboard (Labtec Ultra Flat Keyboard)
6871 Mouse
0604 Jean Co., Ltd
0605 Anchor C&C Co., Ltd
2101 Keyboard
2231 KSK-6001 UELX Keyboard
2270 Gigabyte K8100 Aivia Gaming Keyboard
+ 5253 Thermaltake MEKA G-Unit Gaming Keyboard
5811 ACK-571U Wireless Keyboard
5903 Japanese Keyboard - 595U
6001 SolidTek USB 2p HUB
0201 Defender Office Keyboard (K7310) S Zodiak KM-9010
0252 Emerge Uni-retractable Laser Mouse
3286 Nano Receiver [Sandstrom Laser Mouse SMWLL11]
+ 4101 Wireless Keyboard/Mouse
6301 Trust Wireless Optical Mouse MI-4150K
9003 VoIP Conference Hub (A16GH)
9004 USR9602 USB Internet Mini Phone
1000 CD-ROM Drive
800d TASCAM Portastudio DP-01FX
800e TASCAM US-122L
- 801d DR-100
+ 801d TASCAM DR-100
8021 TASCAM US-122mkII
d001 CD-R/RW Unit
d002 CD-R/RW Unit
a103 Acer/HP Integrated Webcam [CN0314]
a110 HP Webcam
a114 Lemote Webcam
+ a116 UVC 1.3MPixel WebCam
a136 Asus Integrated Webcam [CN031B]
a219 1.3M WebCam (notebook emachines E730, Acer sub-brand)
c107 HP webcam [dv6-1190en]
068e CH Products, Inc.
00d3 OEM 3 axis 5 button joystick
00e2 HFX OEM Joystick
+ 00f0 Multi-Function Panel
00f1 Pro Throttle
00f2 Flight Sim Pedals
00f3 Fighterstick
00f4 Combatstick
- 00fa Flight Sim Pedals
+ 00fa Ch Throttle Quadrant
00ff Flight Sim Yoke
0500 GameStick 3D
0501 CH Pro Pedals
2003 CTX M730V built in Camera
9999 VLxxxx Monitor+Hub
0699 Tektronix, Inc.
+ 0347 AFG 3022B
069a Askey Computer Corp.
0001 VC010 Webcam [pwc]
0303 Cable Modem
06bf Leoco Corp.
06c2 Phidgets Inc. (formerly GLAB)
0030 PhidgetRFID
+ 0031 RFID reader
0038 4-Motor PhidgetServo v3.0
0039 1-Motor PhidgetServo v3.0
003a 8-Motor PhidgetAvancedServo
0007 Monitor Control
0009 Monitor Control
06ca Newer Technology, Inc.
+ 2003 uSCSI
06cb Synaptics, Inc.
0001 TouchPad
0002 Integrated TouchPad
000e HID Device
0010 Wireless TouchPad
0013 DisplayPad
+ 2970 touchpad
06cc Terayon Communication Systems
0101 Cable Modem
0102 Cable Modem
0393 CP9500D/DW Port
0394 CP9000D/DW Port
03a1 CP9550D/DW Port
+ 3b30 CP-D70DW / CP-D707DW
+ 3b31 CP-K60DW-S
06d4 Cisco Systems
06d5 Toshiba
4000 Japanese Keyboard
072f Advanced Card Systems, Ltd
0001 AC1030-based SmartCard Reader
0008 ACR 80 Smart Card Reader
+ 0100 AET65
+ 0101 AET65
+ 0102 AET62
+ 0103 AET62
+ 0901 ACR1281U-C4 (BSI)
1000 PLDT Drive
1001 PLDT Drive
+ 2011 ACR88U
+ 2100 ACR128U
+ 2200 ACR122U
+ 220a ACR1281U-C5 (BSI)
+ 220c ACR1283 Bootloader
+ 220f ACR1281U-C2 (qPBOC)
+ 2211 ACR1261 1S Dual Reader
+ 2214 ACR1222 1SAM PICC Reader
+ 2215 ACR1281 2S CL Reader
+ 221a ACR1251U-A1
+ 221b ACR1251U-C
+ 2224 ACR1281 1S Dual Reader
+ 222b ACR1222U-C8
+ 222c ACR1283L-D2
+ 222d [OEM Reader]
+ 222e ACR123U
+ 2242 ACR1251 1S Dual Reader
8002 AET63 BioTRUSTKey
8003 ACR120
8103 ACR120
+ 8201 APG8201
+ 8900 ACR89U-A1
+ 8901 ACR89U-A2
+ 8902 ACR89U-A3
9000 ACR38 AC1038-based Smart Card Reader
+ 9006 CryptoMate
90cc ACR38 SmartCard Reader
+ 90ce [OEM Reader]
90cf ACR38 SAM Smart Card Reader
90d0 PertoSmart EMV - Card Reader
+ 90d2 ACR83U
+ 90d8 ACR3801
+ 90db CryptoMate64
+ b000 ACR3901U
+ b100 ACR39U
+ b101 ACR39K
+ b102 ACR39T
+ b103 ACR39F
+ b104 ACR39U-SAM
+ b106 ACOS5T2
+ b200 ACOS5T1
+ b301 ACR32-A1
0731 Susteen, Inc.
0528 SonyEricsson DCU-11 Cable
0732 Goldfull Electronics & Telecommunications Corp.
0501 CP1500 AVR UPS
0765 X-Rite, Inc.
5001 Huey PRO Colorimeter
+ 5020 i1 Display Pro
+ 6003 ColorMunki Smile
d094 X-Rite DTP94 [Quato Silver Haze Pro]
0766 Jess-Link Products Co., Ltd
001b Packard Bell Go
4321 CardMan 4321
5121 CardMan 5121
5125 CardMan 5125
+ 5321 CardMan 5321
+ 5340 CardMan 5021 CL
6622 CardMan 6121
a011 CCID Smart Card Reader Keyboard
a021 CCID Smart Card Reader
540e Cruzer Contour Flash Drive
5530 Cruzer
5567 Cruzer Blade
+ 556c Ultra
+ 556d Memory Vault
5571 Cruzer Fit
+ 5576 Cruzer Facet
5580 SDCZ80 Flash Drive
+ 5581 Ultra
5e10 Encrypted
6100 Ultra II SD Plus 2GB
7100 Cruzer Mini
74c3 Sansa Fuze V2 (msc)
74d0 Sansa Clip+ (mtp)
74d1 Sansa Clip+ (msc)
+ 74e5 Sansa Clip Zip
8181 Pen Flash
8183 Hi-Speed Mass Storage Device
8185 SDCZ2 Cruzer Mini Flash Drive (older, thick)
0017 FEther USB2-TX
0018 Wireless LAN USB-11 mini 2
001a ULUSB-11 Key
- 001c CG-WLUSB2GTST 802.11g Wireless Adapter [Intersil ISL3887]
+ 001c CG-WLUSB2GT 802.11g Wireless Adapter [Intersil ISL3880]
+ 0020 CG-WLUSB2GTST 802.11g Wireless Adapter [Intersil ISL3887]
002e CG-WLUSB2GPX [Ralink RT2571W]
002f CG-WLUSB2GNL
0031 CG-WLUSB2GS 802.11bg [Atheros AR5523]
fc02 Cable II USB-2
fc03 USB2-IDE IDE bridge
fcd6 Freecom HD Classic
- fcf6 DataBar 512 MB
+ fcf6 DataBar
fcf8 Freecom Classic SL Network Drive
fcfe Hard Drive 80GB
07af Microtech
0113 Mju 500
0114 C-350Z Camera
0118 Mju Mini Digital/Mju Digital 500 Camera / Stylus 850 SW
+ 0125 Tough TG-1 Camera
0184 P-S100 port
0202 Foot Switch RS-26
0203 Digital Voice Recorder DW-90
a200 DF-UT-06 Hama MMC/SD Reader
a400 CompactFlash & Microdrive Reader
a600 Card Reader
+ a604 12-in-1 Card Reader
ad01 Mass Storage Device
ae01 Mass Storage Device
af01 Mass Storage Device
b00b USB to Memory Stick(LC1)
c010 Kingston FCR-HS2/ATA Card Reader
07c5 APG Cash Drawer
+ 0500 Cash Drawer
07c6 ShareWave, Inc.
0002 Bodega Wireless Access Point
0003 Bodega Wireless Network Adapter
a815 AVerTV DVB-T Volar X (A815)
a827 AVerTV Hybrid Volar HX (A827)
a867 AVerTV DVB-T (A867)
+ b300 A300 DVB-T TV receiver
b800 MR800 FM Radio
e880 MPEG-2 Capture Device (E880)
e882 MPEG-2 Capture Device (E882)
4104 Cw75 Device
4107 CW-L300 Device
4500 LV-20 Digital Camera
+ 6101 fx-9750gII
6801 PL-40R
6802 MIDI Keyboard
07d0 Dazzle
0802 Mako Technologies, LLC
0803 Zoom Telephonics, Inc.
1300 V92 Faxmodem
+ 3095 V.92 56K Mini External Modem Model 3095
4310 4410a Wireless-G Adapter [Intersil ISL3887]
4410 4410b Wireless-G Adapter [ZyDAS ZD1211B]
5241 Cable Modem
4505 SMCWUSB-G 802.11bg
4507 SMCWUSBT-G2 802.11g Wireless Adapter [Atheros AR5523]
4521 Siemens S30863-S1016-R107-2 802.11g Wireless Adapter [Intersil ISL3887]
+ 4531 T-Com Sinus 154 data II [Intersil ISL3887]
5046 SpeedStream 10/100 Ethernet [pegasus]
5501 Wireless Adapter 11g
6500 Cable Modem
9012 WNDA4100 802.11abgn 3x3:3 [Ralink RT3573]
9018 WNDA3200 802.11abgn Wireless Adapter [Atheros AR7010+AR9280]
9020 WNA3100(v1) Wireless-N 300 [Broadcom BCM43231]
+ 9021 WNA3100M(v1) Wireless-N 300 [Realtek RTL8192CU]
9030 WNA1100 Wireless-N 150 [Atheros AR9271]
9040 WNA1000 Wireless-N 150 [Atheros AR9170+AR9101]
9041 WNA1000M 802.11bgn [Realtek RTL8188CUS]
+ 9042 On Networks N150MA 802.11bgn [Realtek RTL8188CUS]
+ 9050 A6200 802.11a/b/g/n/ac Wireless Adapter [Broadcom BCM43526]
+ 9052 A6100 AC600 DB Wireless Adapter [Realtek RTL8811AU]
a001 PA101 10 Mbps HPNA Home Phoneline RJ-1
+ f001 On Networks N300MA 802.11bgn [Realtek RTL8192CU]
084d Minton Optic Industry Co., Inc.
0001 Jenoptik JD800i
0003 S-Cam F5/D-Link DSC-350 Digital Camera
0022 Parallel Port
0023 2 port to Serial Converter
0024 Parallel Port
+ 0026 PortGear SCSI
0027 1 port to Serial Converter
0028 PortGear to SCSI Converter
0032 PortStation SCSI Module
8023 2 port to Serial
8027 PGSDB9 Serial Port
085c ColorVision, Inc.
- 0200 Monitor Spyder
+ 0100 Spyder 1
+ 0200 Spyder 2
+ 0300 Spyder 3
+ 0400 Spyder 4
0862 Teletrol Systems, Inc.
0863 Filanet Corp.
0864 NetGear, Inc.
5036 Portable secure storage for software licenses
0892 DioGraphy, Inc.
0101 Smartdio Reader/Writer
+0894 TSI Incorporated
+ 0010 Remote NDIS Network Device
0897 Lauterbach
0002 Power Debug/Power Debug II
089c United Technologies Research Cntr.
0014 USBee AX-Pro
0015 USBee DX
08ae Macally (Mace Group, Inc.)
+08b0 Metrohm
+ 0006 814 Sample Processor
+ 0015 857 Titrando
+ 001a 852 Titrando
08b4 Sorenson Vision, Inc.
08b7 NATSU
0001 Playstation adapter
0102 ADSL
0301 RNIS
08e4 Pioneer Corp.
+ 0185 DDJ-WeGO2
08e5 Litronic
08e6 Gemalto (was Gemplus)
0001 GemPC-Touch 430
0002 SigmaDrive Adapter (TPP)
0906 Faraday Technology Corp.
0908 Siemens AG
+ 01f4 SIMATIC NET CP 5711
+ 01fe SIMATIC NET PC Adapter A2
2701 ShenZhen SANZHAI Technology Co.,Ltd Spy Pen VGA
0909 Audio-Technica Corp.
090a Trumpion Microelectronics, Inc.
2380 Oregon series
23cc nüvi 1350
2459 GPSmap 62/78 series
+ 2491 Edge 800
2519 eTrex 30
2535 Edge 800
+ 253c GPSmap 62sc
255b Nuvi 2505LM
0920 Echelon Co.
7500 Network Interface
0922 Dymo-CoStar Corp.
0007 LabelWriter 330
0009 LabelWriter 310
+ 0019 LabelWriter 400
001a LabelWriter 400 Turbo
0020 LabelWriter 450
+ 1001 LabelManager PnP
+ 8004 M25 Digital Postal Scale
0923 IC Media Corp.
010f SIIG MobileCam
0924 Xerox
23dd DocuPrint M760 (X760_USB)
3ce8 Phaser 3428 Printer
3d5b Phaser 6115MFP TWAIN Scanner
+ 3d6d WorkCentre 6015N/NI
420f WorkCentre PE220 Series
421f M20 Scanner
423b Printing Support
fffb DocuPrint M750 (X750_USB)
0925 Lakeview Research
0005 Gamtec.,Ltd SmartJoy PLUS Adapter
+ 03e8 Wii Classic Controller Adapter
3881 Saleae Logic
8101 Phidgets, Inc., 1-Motor PhidgetServo v2.0
8104 Phidgets, Inc., 4-Motor PhidgetServo v2.0
0009 Gigabeat F/X (HDD audio player)
000c Gigabeat F (mtp)
0010 Gigabeat S (mtp)
+ 0200 Integrated Bluetooth (Taiyo Yuden)
0301 PCX1100U Cable Modem (WDM)
0302 PCX2000 Cable Modem (WDM)
0305 Cable Modem PCX3000
070a Pocket PC e400 Series
070b Pocket PC e800 Series
0a07 WLM-10U1 802.11abgn Wireless Adapter [Ralink RT3572]
+ 0a13 AX88179 Gigabit Ethernet [Toshiba]
0b05 PX1220E-1G25 External hard drive
0b09 PX1396E-3T01 External hard drive
0b1a STOR.E ALU 2S
653d Kingston DataTraveler 2.0 Stick (1GB)
653e Flash Memory
6540 TransMemory Flash Memory
- 6544 Kingston DataTraveler 2.0 Stick (2GB)
- 6545 Kingston DataTraveler 102 Flash Drive / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick
+ 6544 TransMemory-Mini / Kingston DataTraveler 2.0 Stick (2GB)
+ 6545 Kingston DataTraveler 102/2.0 / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick
0931 Harmonic Data Systems, Ltd
0932 Crescentec Corp.
0300 VideoAdvantage
0030 Composite Device, Mass Storage Device (Flash Drive) amd HID
003c Rhythmedics HID Bootloader
0939 Lumberg, Inc.
- 0b15 Toshiba Stor.E Alu 2 1TB (PX1710E-1HJ0)
+ 0b15 Toshiba Stor.E Alu 2
093a Pixart Imaging, Inc.
0007 CMOS 100K-R Rev. 1.90
010e Digital camera, CD302N/Elta Medi@ digi-cam/HE-501A
260e PAC7311 Gigaware VGA PC Camera:Trust WB-3350p:SIGMA cam 2350
260f PAC7311 SnakeCam
2621 PAC731x Trust Webcam
+ 2622 Webcam Genius
2624 Webcam
093b Plextor Corp.
0010 Storage Adapter
160d DataTraveler Vault Privacy
1613 DataTraveler DT101C Flash Drive
1616 DataTraveler Locker 4GB
+ 161a Dell HyperVisor internal flash drive
1621 DataTraveler 150 (32GB)
1624 DataTraveler G2
1625 DataTraveler 101 II
1643 DataTraveler G3
1653 Data Traveler 100 G2 8 GiB
1656 DataTraveler Ultimate G2
+ 1665 Digital DataTraveler SE9 64GB
+ 1666 DataTraveler G4
1689 DataTraveler SE9
168a DataTraveler Micro
168c DT Elite 3.0
0954 RPM Systems Corp.
0955 NVidia Corp.
7030 Tegra 3 (recovery mode)
- 7100 Notion Ink Adam
+ 7100 Tegra Device
7820 Tegra 2 AC100 developer mode
b400 SHIELD (debug)
b401 SHIELD
+ cf05 SHIELD Tablet (debug)
+ cf06 SHIELD Tablet
+ cf07 SHIELD Tablet
+ cf08 SHIELD Tablet
+ cf09 SHIELD Tablet
0956 BSquare Corp.
0957 Agilent Technologies, Inc.
0200 E-Video DC-350 Camera
0202 E-Video DC-350 Camera
+ 0407 33220A Waveform Generator
0518 82357B GPIB Interface
0a07 34411A Multimeter
+ 1507 33210A Waveform Generator
1745 Test and Measurement Device (IVI)
2918 U2702A oscilloscope
+ fb18 LC Device
0958 CompuLink Research, Inc.
0959 Cologne Chip AG
2bd0 Intelligent ISDN (Ver. 3.60.04)
095c K-Tec Electronics
095d Polycom, Inc.
0001 Polycom ViaVideo
-0967 Acer (??)
+0967 Acer NeWeb Corp.
0204 WarpLink 802.11b Adapter
0968 Catalyst Enterprises, Inc.
096e Feitian Technologies, Inc.
0802 ePass2000 (G&D STARCOS SPK 2.4)
0807 ePass2003
0971 Gretag-Macbeth AG
+ 2000 i1 Pro
+ 2001 i1 Monitor
2003 Eye-One display
2005 Huey
- 2007 ColorMunki
+ 2007 ColorMunki Photo
0973 Schlumberger
0001 e-gate Smart Card
0974 Datagraphix, a business unit of Anacomp
099a Zippy Technology Corp.
0638 Sanwa Supply Inc. Small Keyboard
610c EL-610 Super Mini Electron luminescent Keyboard
+ 713a WK-713 Multimedia Keyboard
7160 Hyper Slim Keyboard
09a3 PairGain Technologies
09a4 Contech Research, Inc.
09c4 ACTiSYS Corp.
0011 ACT-IR2000U IrDA Dongle
09c5 Memory Corp.
+09ca BMC Messsysteme GmbH
+ 5544 PIO
09cc Workbit Corp.
0404 BAFO USB-ATA/ATAPI Bridge Controller
09cd Psion Dacom Home Networks, Ltd
09d1 NeoMagic, Inc.
09d2 Vreelin Engineering, Inc.
09d3 Com One
- 0001 ISDN TA
+ 0001 ISDN TA / Light Rider 128K
+ 000b Bluetooth Adapter class 1 [BlueLight]
09d7 Novatel Wireless
0100 NovAtel FlexPack GPS receiver
09d9 KRF Tech, Ltd
-09da A4 Tech Co., Ltd
+09da A4Tech Co., Ltd.
0006 Optical Mouse WOP-35 / Trust 450L Optical Mouse
- 000a Optical Mouse Opto 510D
+ 000a Optical Mouse Opto 510D / OP-620D
000e X-F710F Optical Mouse 3xFire Gaming Mouse
0018 Trust Human Interface Device
001a Wireless Mouse & RXM-15 Receiver
00d0 ADU208 Relay I/O Interface
00da ADU218 Solid-State Relay I/O Interface
0a0b Cybex Computer Products Co.
+0a0d Servergy, Inc
+ 2514 CTS-1000 Internal Hub
0a11 Xentec, Inc.
0a12 Cambridge Silicon Radio, Ltd
0001 Bluetooth Dongle (HCI mode)
0009 Nanosira4-EDR WHQL Reference Radio
000a Nanosira4-EDR-ROM
000b Nanosira5-ROM
+ 0042 SPI Converter
0043 Bluetooth Device
0100 Casira with BlueCore2-External Module
0101 Casira with BlueCore2-Flash Module
9988 Trek2000 TD-G2
0a17 Pentax Corp.
0004 Optio 330
- 0006 Optio S
+ 0006 Optio S / S4
0007 Optio 550
0009 Optio 33WR
000a Optio 555
5023 Mass Storage Device
5024 Mass Storage Device
5025 Mass Storage Device
+0a4a Ploytec GmbH
0a4b Fujitsu Media Devices, Ltd
0a4c Computex Co., Ltd
15d9 OPTICAL MOUSE
6300 Pirelli Remote NDIS Device
bd11 TiVo AG0100 802.11bg Wireless Adapter [Broadcom BCM4320]
bd13 BCM4323 802.11abgn Wireless Adapter
+ bd16 BCM4319 802.11bgn Wireless Adapter
bd17 BCM43236 802.11abgn Wireless Adapter
d11b Eminent EM4045 [Broadcom 4320 USB]
0a5d Diatrend Corp.
0009 LP2844 Printer
0081 GK420t Label Printer
008b HC100 wristbands Printer
+ 008c ZP 450 Printer
00d1 Zebra GC420d Label Printer
930a Printer
0a62 MPMan
0ab0 Arrow Strong Electronics Co., Ltd
0ab1 FEIG ELECTRONIC GmbH
0002 OBID RFID-Reader
+ 0004 OBID classic-pro
0aba Ellisys
8001 Tracker 110 Protocol Analyzer
8002 Explorer 200 Protocol Analyzer
c326 Namuga 1.3M Webcam
c33f Webcam
c429 Lenovo ThinkCentre Web Camera
+ c42d Lenovo IdeaCentre Web Camera
0ac9 Micro Solutions, Inc.
0000 Backpack CD-ReWriter
0001 BACKPACK 2 Cable
0401 Spectrum III Hybrid Smartcard Reader
0630 Spectrum III Mag-Only Insert Reader (SPT3-355 Series) USB-CDC
0810 SecurePIN (IDPA-506100Y) PIN Pad
+ 2030 ValueMag Magnetic Stripe Reader
0ace ZyDAS
1201 ZD1201 802.11b
1211 ZD1211 802.11g
0af9 Hama, Inc.
0010 USB SightCam 100
0011 Micro Innovations IC50C Webcam
+0afa DMC Co., Ltd.
+ 07d2 Controller Board for Projected Capacitive Touch Screen DUS3000
0afc Zaptronix Ltd
0afd Tateno Dennou, Inc.
0afe Cummins Engine Co.
0aff Jump Zone Network Products, Inc.
0b00 INGENICO
0b05 ASUSTek Computer, Inc.
+ 0001 MeMO Pad HD 7 (CD-ROM mode)
1101 Mass Storage (UISDMC4S)
1706 WL-167G v1 802.11g Adapter [Ralink RT2571]
1707 WL-167G v1 802.11g Adapter [Ralink RT2571]
1708 Mass Storage Device
- 170b Mass Storage Device
+ 170b Multi card reader
170c WL-159g 802.11bg
170d 802.11b/g Wireless Network Adapter
1712 BT-183 Bluetooth 2.0+EDR adapter
1779 My Cinema U3100 Mini Plus [AF9035A]
1784 USB-N13 802.11n Network Adapter (rev. A1) [Ralink RT3072]
1786 USB-N10 802.11n Network Adapter [Realtek RTL8188SU]
+ 1788 BT-270 Bluetooth Adapter
1791 WL-167G v3 802.11n Adapter [Realtek RTL8188SU]
179d USB-N53 802.11abgn Network Adapter [Ralink RT3572]
179e Eee Note EA800 (network mode)
179f Eee Note EA800 (tablet mode)
+ 17a0 Xonar U3 sound card
17a1 Eee Note EA800 (mass storage mode)
17ab USB-N13 802.11n Network Adapter (rev. B1) [Realtek RTL8192CU]
+ 17ba N10 Nano 802.11n Network Adapter [Realtek RTL8192CU]
+ 17c7 WL-330NUL
+ 17c9 USB-AC53 802.11a/b/g/n/ac Wireless Adapter [Broadcom BCM43526]
+ 17d1 AC51 802.11a/b/g/n/ac Wireless Adapter [Mediatek MT7610/Ralink RT2870]
4c80 Transformer Pad TF300TG
4c90 Transformer Pad Infinity TF700
4c91 Transformer Pad Infinity TF700 (Debug mode)
+ 4ca0 Transformer Pad TF701T
+ 4ca1 Transformer Pad TF701T (Debug mode)
4d00 Transformer Prime TF201
4d01 Transformer Prime TF201 (debug mode)
4daf Transformer Pad Infinity TF700 (Fastboot)
+ 5410 MeMO Pad HD 7 (MTP mode)
+ 5412 MeMO Pad HD 7 (PTP mode)
+ 550f ASUS fonepad 7
6101 Cable Modem
620a Remote NDIS Device
b700 Broadcom Bluetooth 2.1
0b0d ProjectLab
0000 CenturyCD
0b0e GN Netcom
+ 034c Jabra UC Voice 750 MS
0420 Jabra SPEAK 510
+ 094d GN Netcom / Jabra REVO Wireless
1022 Jabra PRO 9450, Type 9400BS (DECT Headset)
+ 2007 GN 2000 Stereo Corded Headset
620c Jabra BT620s
9330 Jabra GN9330 Headset
0b0f AVID Technology
0006 SM Media-Shuttle Card Reader
0b33 Contour Design, Inc.
0020 ShuttleXpress
+ 0700 RollerMouse Pro
0b37 Hitachi ULSI Systems Co., Ltd
0b38 Gear Head
0003 Keyboard
300c TT-connect T-3650 CI
300d TT-connect CT-3650 CI
300e TT-connect C-2400
+ 3011 TT-connect S2-4600
+ 3012 TT-connect CT2-4650 CI
+ 3014 TT-TVStick CT2-4400
0b49 ASCII Corp.
064f Trance Vibrator
0b4b Pine Corp. Ltd.
0b95 ASIX Electronics Corp.
1720 10/100 Ethernet
1780 AX88178
+ 1790 AX88179 Gigabit Ethernet
7720 AX88772
772a AX88772A Fast Ethernet
772b AX88772B
0118 U5 802.11g Adapter
011b Wireless MAXg Adapter [Broadcom 4320]
0121 USR5423 802.11bg Wireless Adapter [ZyDAS ZD1211B]
+ 0303 USR5637 56K Faxmodem
6112 FaxModem Model 5633
0bb0 Concord Camera Corp.
0100 Sound Vision Stream
6098 USB Cable Modem
0bb3 Ofuji Technology
0bb4 HTC (High Tech Computer Corp.)
+ 0001 Android Phone via mass storage [Wiko Cink Peax 2]
00ce mmO2 XDA GSM/GPRS Pocket PC
00cf SPV C500 Smart Phone
0a01 PocketPC Sync
0bce Vario MDA
0c01 Dream / ADP1 / G1 / Magic / Tattoo
0c02 Dream / ADP1 / G1 / Magic / Tattoo (Debug)
+ 0c03 Android Phone [Fairphone First Edition (FP1)]
0c13 Diamond
0c1f Sony Ericsson XPERIA X1
0c5f Snap
0c9e Incredible
0ca2 Desire HD (debug mode)
0ca5 Android Phone [Evo Shift 4G]
+ 0cae T-Mobile MyTouch 4G Slide [Doubleshot]
+ 0dea M7_UL [HTC One]
+ 0f64 Desire 601
0ff8 Desire HD (Tethering Mode)
0ff9 Desire / Desire HD / Hero / Thunderbolt (Charge Mode)
0ffe Desire HD (modem mode)
0fff Android Fastboot Bootloader
+ 2008 Android Phone via MTP [Wiko Cink Peax 2]
+ 200b Android Phone via PTP [Wiko Cink Peax 2]
0bb5 Murata Manufacturing Co., Ltd
0bb6 Network Alchemy
0bb7 Joytech Computer Co., Ltd
2200 FreeAgent Go FW
2300 Expansion Portable
2320 USB 3.0 bridge [Portable Expansion Drive]
+ 2321 Expansion Portable
+ 2340 FreeAgent External Hard Drive
+ 3000 FreeAgent Desktop
3008 FreeAgent Desk 1TB
+ 3101 FreeAgent XTreme 640GB
+ 3312 SRD00F2 Expansion Desktop Drive (STBV)
3320 SRD00F2 [Expansion Desktop Drive]
3332 Expansion
+ 5020 FreeAgent GoFlex
5021 FreeAgent GoFlex USB 2.0
+ 5030 FreeAgent GoFlex Upgrade Cable STAE104
5031 FreeAgent GoFlex USB 3.0
+ 5070 FreeAgent GoFlex Desk
+ 5071 FreeAgent GoFlex Desk
50a1 FreeAgent GoFlex Desk
50a5 FreeAgent GoFlex Desk USB 3.0
5121 FreeAgent GoFlex
a003 Backup Plus
a0a1 Backup Plus Desktop
a0a4 Backup Plus Desktop Drive
+ ab00 Slim Portable Drive
+ ab20 Backup Plus Portable Drive
+ ab21 Backup Plus Slim
+ ab31 Backup Plus Desktop Drive (5TB)
0bc3 IPWireless, Inc.
0001 UMTS-TDD (TD-CDMA) modem
0bc4 Microcube Corp.
0171 Mass Storage Device
0176 Mass Storage Device
0178 Mass Storage Device
+ 0179 RTL8188ETV Wireless LAN 802.11n Network Adapter
0184 RTS5182 Card Reader
0186 Card Reader
+ 0301 multicard reader
+ 1724 RTL8723AU 802.11n WLAN Adapter
2831 RTL2831U DVB-T
2832 RTL2832U DVB-T
2838 RTL2838 DVB-T
+ 5730 HP 2.0MP High Definition Webcam
+ 5775 HP "Truevision HD" laptop camera
8150 RTL8150 Fast Ethernet Adapter
8151 RTL8151 Adapteon Business Mobile Networks BV
8171 RTL8188SU 802.11n WLAN Adapter
8197 RTL8187B Wireless Adapter
8198 RTL8187B Wireless Adapter
8199 RTL8187SU 802.11g WLAN Adapter
+ 8812 RTL8812AU 802.11a/b/g/n/ac WLAN Adapter
0bdb Ericsson Business Mobile Networks BV
1000 BV Bluetooth Device
1002 Bluetooth Device 1.2
0012 Bluetooth Device(BC04-External)
0018 Bluetooth Device(BC04-External)
0019 Bluetooth Device
- 0021 Bluetooth Device
+ 0021 Bluetooth Device (V2.1+EDR)
0c24 Bluetooth Device(SAMPLE)
ffff Bluetooth module with BlueCore in DFU mode
0c25 Sampo Corp.
0720 Metrologic MS7120 Barcode Scanner (bi-directional serial mode)
0b61 Vuquest 3310g
0b6a Vuquest 3310 Area-Imaging Scanner
+ 0b81 Barcode scanner Voyager 1400g Series
0c35 Eagletron, Inc.
0c36 E Ink Corp.
0c37 e.Digital
41d9 i1 phone
0c45 Microdia
0011 EBUDDY
+ 0520 MaxTrack Wireless Mouse
1018 Compact Flash storage memory card reader
1020 Mass Storage Reader
1028 Mass Storage Reader
62be PC Camera with Microphone (SN9C202 + OV7663)
62c0 Sonix USB 2.0 Camera
62e0 MSI Starcam Racer
+ 6300 PC Microscope camera
6310 Sonix USB 2.0 Camera
+ 6340 Camera
6341 Defender G-Lens 2577 HD720p Camera
63e0 Sonix Integrated Webcam
63f1 Integrated Webcam
6417 Integrated Webcam
6419 Integrated Webcam
641d 1.3 MPixel Integrated Webcam
+ 643f Dell Integrated HD Webcam
+ 644d 1.3 MPixel Integrated Webcam
6480 Sonix 1.3 MP Laptop Integrated Webcam
648b Integrated Webcam
64bd Sony Visual Communication Camera
+ 7401 TEMPer Temperature Sensor
7402 TEMPerHUM Temperature & Humidity Sensor
7403 Foot Switch
8000 DC31VC
0c4b Reiner SCT Kartensysteme GmbH
0100 cyberJack e-com/pinpad
0300 cyberJack pinpad(a)
+ 0400 cyberJack e-com(a)
+ 0401 cyberJack pinpad(a2)
+ 0500 cyberJack RFID standard dual interface smartcard reader
0501 cyberJack RFID comfort dual interface smartcard reader
9102 cyberJack RFID basis contactless smartcard reader
0c4c Needham's Electronics
0027 Sphairon Homelink 1202 802.11n Wireless Adapter [Atheros AR9170]
0ce5 Validation Technologies International
0003 Matrix
-0ce9 pico Technology
+0ce9 Pico Technology
1001 PicoScope3000 series PC Oscilloscope
+ 1007 PicoScope 2000 series PC Oscilloscope
+ 1008 PicoScope 5000 series PC Oscilloscope
+ 1009 PicoScope 4000 series PC Oscilloscope
+ 100e PicoScope 6000 series PC Oscilloscope
+ 1012 PicoScope 3000A series PC Oscilloscope
+ 1016 PicoScope 2000A series PC Oscilloscope
+ 1018 PicoScope 4000A series PC Oscilloscope
+ 1200 PicoScope 2000 series PC Oscilloscope
+ 1201 PicoScope 3000 series PC Oscilloscope
+ 1202 PicoScope 4000 series PC Oscilloscope
+ 1203 PicoScope 5000 series PC Oscilloscope
+ 1204 PicoScope 6000 series PC Oscilloscope
+ 1211 PicoScope 3000 series PC Oscilloscope
+ 1212 PicoScope 4000 series PC Oscilloscope
0cf1 e-Conn Electronic Co., Ltd
0cf2 ENE Technology, Inc.
6220 SD Card Reader (SG361)
20ff AR7010 (no firmware)
3000 AR3011 Bluetooth (no firmware)
3002 AR3011 Bluetooth
+ 3004 AR3012 Bluetooth 4.0
3005 AR3011 Bluetooth
3008 Bluetooth (AR3011)
7015 TP-Link TL-WN821N v3 / TL-WN822N v2 802.11n [Atheros AR7010+AR9287]
0d34 Rearden Steel Technologies
0d35 Dah Kun Co., Ltd
0d3a Posiflex Technologies, Inc.
+ 0206 Series 3xxx Cash Drawer
+ 0207 Series 3xxx Cash Drawer
+ 0500 Magnetic Stripe Reader
0d3c Sri Cable Technology, Ltd
0d3d Tangtop Technology Co., Ltd
0001 HID Keyboard
+ 0040 PS/2 Adapter
0d3e Fitcom, inc.
0d3f MTS Systems Corp.
0d40 Ascor, Inc.
7000 OneTouch
7010 OneTouch
7100 OneTouch II 300GB External Hard Disk
+ 7310 OneTouch 4
7410 Mobile Hard Disk Drive (1TB)
7450 Basics Portable USB Device
0d4a NF Corp.
0d77 Power Sentry/Newpoint
0d78 Japan Distributor Corp.
0d7a MARX Datentechnik GmbH
+ 0001 CrypToken
0d7b Wellco Technology Co., Ltd
0d7c Taiwan Line Tek Electronic Co., Ltd
0d7d Phison Electronics Corp.
0da3 Nippon Electro-Sensory Devices Corp.
0da4 Polar Electro OY
0001 Interface
+ 0008 Loop
0da7 IOGear, Inc.
0da8 softDSP Co., Ltd
0001 SDS 200A Oscilloscope
0db0 Micro Star International
1020 PC2PC WLAN Card
1967 Bluetooth Dongle
+ 3713 Primo 73
3801 Motorola Bluetooth 2.1+EDR Device
4011 Medion Flash XL V2.0 Card Reader
4023 Lexar Mobile Card Reader
0db4 Chung Fu Chen Yeh Enterprise Corp.
0db7 ELCON Systemtechnik
0002 Goldpfeil P-LAN
+0dba Digidesign
+ 1000 Mbox 1 [Mbox]
+ 3000 Mbox 2
0dbc A&D Medical
0003 AND Serial Cable [AND Smart Cable]
0dbe Jiuh Shiuh Precision Industry Co., Ltd
0041 Mass Storage Device
0042 Mass Storage Device
0101 Hi-Speed Mass Storage Device
+ 0209 SK-3500 S2
020a Oyen Digital MiniPro 2.5" hard drive enclosure
0dc5 SDK Co., Ltd
0dc6 Precision Squared Technology Corp.
005d WLA-2000 v1.001 WLAN [RTL8191SU]
0060 WLA-4000 802.11bgn [Ralink RT3072]
0062 WLA-5000 802.11abgn [Ralink RT3572]
+ 0072 AX88179 Gigabit Ethernet [Sitecom]
061c LN-028 Network USB 2.0 Adapter
21f4 44 St Bluetooth Device
2200 Sitecom bluetooth2.0 class 2 dongle CN-512
9041 802.11n Wireless USB Card
0e0c Gesytec
0101 LonUSB LonTalk Network Adapter
+0e0d PicoQuant GmbH
+ 0003 PicoHarp 300
0e0f VMware, Inc.
0001 Device
0002 Virtual USB Hub
0002 Wrist PDA
0e6a Megawin Technology Co., Ltd
0101 MA100 [USB-UART Bridge IC]
+ 030b Truly Ergonomic Computer Keyboard (Device Firmware Update mode)
+ 030c Truly Ergonomic Computer Keyboard
6001 GEMBIRD Flexible keyboard KB-109F-B-DE
0e6f Logic3
0003 Freebird wireless Controller
1417 A43 IT
14ad 97 Titanium HD
150e 80 G9
+ 3001 40 Titanium
0e7b On-Tech Industry Co., Ltd
0e7e Gmate, Inc.
0001 Yopy 3000 PDA
0003 MT6227 phone
0004 MT6227 phone
0023 S103
- 1806 Samsung SE-208AB Slim Portable DVD Writer
+ 1806 Samsung SE-208 Slim Portable DVD Writer
1836 Samsung SE-S084 Super WriteMaster Slim External DVD writer
+ 2000 MT65xx Preloader
3329 Qstarz BT-Q1000XT
+ 763e MT7630e Bluetooth Adapter
0e8f GreenAsia Inc.
0003 MaxFire Blaze2
- 0012 USB Wireless 2.4GHz Gamepad
+ 0012 Joystick/Gamepad
0016 4 port USB 1.1 hub UH-174
0020 USB to PS/2 Adapter
0021 Multimedia Keyboard Controller
0ea0 Ours Technology, Inc.
2126 7-in-1 Card Reader
2153 SD Card Reader Key
- 2168 Transcend JetFlash 2.0 / Astone USB Drive
+ 2168 Transcend JetFlash 2.0 / Astone USB Drive / Intellegent Stick 2.0
6803 OTI-6803 Flash Disk
6808 OTI-6808 Flash Disk
6828 OTI-6828 Flash Disk
0eb3 Saint Technology Corp.
0eb7 Endor AG
0eb8 Mettler Toledo
+ 2200 Ariva Scale
f000 PS60 Scale
+0ebb Thermo Fisher Scientific
+ 0002 FT-IR Spectrometer
0ebe VWeb Corp.
0ebf Omega Technology of Taiwan, Inc.
0ec0 LHI Technology (China) Co., Ltd
0eef D-WAV Scientific Co., Ltd
0001 eGalax TouchScreen
0002 Touchscreen Controller(Professional)
+ 7200 Touchscreen Controller
+ a802 eGalaxTouch EXC7920
0ef0 Hitachi Cable, Ltd
0ef1 Aichi Micro Intelligent Corp.
0ef2 I/O Magic Corp.
2040 Machine Test System
0f12 Mars Engineering Corp.
0f13 Acetek Technology Co., Ltd
+0f14 Ingenico
+ 0012 Vital'Act 3S
0f18 Finger Lakes Instrumentation
0002 CCD
0006 Focuser
0f32 YFC-BonEagle Electric Co., Ltd
0f37 Kokuyo Co., Ltd
0f38 Nien-Yi Industrial Corp.
+0f39 TG3 Electronics
+ 0876 Keyboard [87 Francium Pro]
0f3d Airprime, Incorporated
0112 CDMA 1xEVDO PC Card, PC 5220
0f41 RDC Semiconductor Co., Ltd
1001 Targus Mini Trackball Optical Mouse
0f63 LeapFrog Enterprises
0010 Leapster Explorer
+ 0022 Leap Reader
0500 Fly Fusion
0600 Leap Port Turbo
0700 POGO
0403 NDS Capture
0404 NDS Emulator (Lite)
0f73 DFI
+0f78 Guntermann & Drunck GmbH
0f7c DQ Technology, Inc.
0f7d NetBotz, Inc.
0f7e Fluke Corp.
0006 Blackberry Pearl
0008 Blackberry Pearl
8001 Blackberry Handheld
- 8004 Blackberry Handheld
+ 8004 Blackberry
8007 Blackberry Handheld
8010 Blackberry Playbook (Connect to Windows mode)
8011 Blackberry Playbook (Connect to Mac mode)
3137 Xperia X10 mini
3138 Xperia X10 mini pro
3149 Xperia X8
+ 514f Xperia arc S [Adb-Enable Mode]
+ 5169 Xperia S [Adb-Enable Mode]
5177 Xperia Ion [Debug Mode]
518c C1605 [Xperia E dual] MTD mode
614f Xperia X12 (debug mode)
7166 Xperia Mini Pro (Tethering mode)
7177 Xperia Ion [Tethering]
8004 9000 Phone [Mass Storage]
- adde Boot loader
+ adde C2005 (Xperia M dual) in service mode
d008 V800-Vodafone 802SE Phone
d016 K750i Phone
d017 K608i Phone
d0cf MD300 Mobile Broadband Modem
d0d4 C902 Phone [Modem]
d0e1 MD400 Mobile Broadband Modem
+ d12a U100i Yari Phone
d12e Xperia X10
+ d14e J108i Cedar
e000 K810 (PictBridge mode)
e039 K800i (msc mode)
e042 W810i Phone
e161 Xperia Ray
e166 Xperia Mini Pro
e167 XPERIA mini
+ e19b C2005 [Xperia M dual] (Mass Storage)
+ f0fa Liveview micro display MN800 in DFU mode
0fcf Dynastream Innovations, Inc.
1003 ANT Development Board
- 1004 ANT2USB
+ 1004 ANTUSB Stick
1006 ANT Development Board
- 1008 Mini stick Suunto
+ 1008 ANTUSB2 Stick
+ 1009 ANTUSB-m Stick
0fd0 Tulip Computers B.V.
0fd1 Giant Electronics Ltd.
0fd2 Seac Banche
0fda Quantec Networks GmbH
0100 quanton flight control
0fdc Micro Plus
+0fde Oregon Scientific
+ ca01 WMRS200 weather station
+ ca05 CM160
0fe0 Osterhout Design Group
0100 Bluetooth Mouse
0101 Bluetooth IMU
ff00 OEM
0fff Aopen, Inc.
1000 Speed Tech Corp.
+ 153b TerraTec Electronic GmbH
1001 Ritronics Components (S) Pte., Ltd
1003 Sigma Corp.
0003 SD14
6018 GM360/GD510/GW520/KP501
618e Ally/Optimus One/Vortex (debug mode)
618f Ally/Optimus One
+ 61c5 P880 / Charge only
61c6 Vortex (msc)
61cc Optimus S
61f1 Optimus Android Phone [LG Software mode]
- 61f9 V909 G-Slate
+ 61f9 Optimus (Various Models) MTP Mode
61fc Optimus 3
61fe Optimus Android Phone [USB tethering mode]
6300 Optimus Android Phone
631c Optimus Android Phone [MTP mode]
+ 631d Optimus Android Phone (Camera/PTP Mode)
631e Optimus Android Phone [Camera/PTP mode]
+ 631f Optimus Android Phone (Charge Mode)
6356 Optimus Android Phone [Virtual CD mode]
6800 CDMA Modem
7000 LG LDP-7024D(LD)USB
+ 91c8 P880 / USB tethering
a400 Renoir (KC910)
1005 Apacer Technology, Inc.
1001 MP3 Player
1004 MP3 Player
1006 MP3 Player
- b113 Handy Steno 2.0/HT203
+ b113 Handy Steno/AH123 / Handy Steno 2.0/HT203
b223 CD-RW + 6in1 Card Reader Digital Storage / Converter
1006 iRiver, Ltd.
3001 iHP-100
1032 C-One Technology Corp.
1033 Nucam Corp.
0068 3,5'' HDD case MD-231
-1038 Ideazon, Inc.
- 0100 Zboard
- 1361 Sensei
+1038 SteelSeries ApS
+ 0100 Ideazon Zboard
+ 1361 Ideazon Sensei
1039 devolo AG
0824 1866 802.11bg [Texas Instruments TNETW1450]
2140 dsl+ 1100 duo
+103a PSA
+ f000 Actia Evo XS
103d Stanton
0100 ScratchAmp
0101 ScratchAmp
0010 Yubikey
0110 Yubikey NEO OTP
0111 Yubikey NEO OTP+CCID
+ 0112 Yubikey NEO CCID
+ 0200 U2F Gnubby
0211 Gnubby
1053 Immanuel Electronics Co., Ltd
1054 BMS International Beheer N.V.
0200 FireWire USB Combo
0400 External HDD
0500 hub
- 0702 Passport External HDD
- 0704 Passport External HDD
- 070a My Passport Essential SE
- 071a My Passport
- 0730 My Passport
- 0740 My Passport
- 0742 My Passport Essential SE
- 0748 My Passport 1TB USB 3.0
+ 0701 WD Passport (WDXMS)
+ 0702 WD Passport (WDXMS)
+ 0704 My Passport Essential (WDME)
+ 0705 My Passport Elite (WDML)
+ 070a My Passport Essential (WDBAAA), My Passport for Mac (WDBAAB), My Passport Essential SE (WDBABM), My Passport SE for Mac (WDBABW)
+ 070b My Passport Elite (WDBAAC)
+ 070c My Passport Studio (WDBAAE)
+ 071a My Passport Essential (WDBAAA)
+ 071d My Passport Studio (WDBALG)
+ 0730 My Passport Essential (WDBACY)
+ 0732 My Passport Essential SE (WDBGYS)
+ 0740 My Passport Essential (WDBACY)
+ 0741 My Passport Ultra
+ 0742 My Passport Essential SE (WDBGYS)
+ 0748 My Passport (WDBKXH, WDBY8L)
+ 07a8 My Passport (WDBBEP), My Passport for Mac (WDBLUZ)
+ 0810 My Passport Ultra (WDBZFP)
+ 0820 My Passport Ultra (WDBMWV, WDBZFP)
0900 MyBook Essential External HDD
- 0901 MyBook External HDD
+ 0901 My Book Essential Edition (Green Ring) (WDG1U)
+ 0902 My Book Pro Edition (WDG1T)
0903 My Book Premium Edition
- 0910 MyBook Essential External HDD
- 1001 External Hard Disk [Elements]
- 1003 Elements 1000 GB
- 1010 Elements External HDD
- 1021 Elements 2TB
- 1023 Elements SE
+ 0910 My Book Essential Edition (Green Ring) (WDG1U)
+ 1001 Elements Desktop (WDE1U)
+ 1003 WD Elements Desktop (WDE1UBK)
+ 1010 Elements Portable (WDBAAR)
+ 1021 Elements Desktop (WDBAAU)
+ 1023 Elements SE Portable (WDBABV)
+ 1042 Elements SE Portable (WDBPCK)
+ 1048 Elements Portable (WDBU6Y)
+ 107c Elements Desktop (WDBWLG)
+ 10a2 Elements SE Portable (WDBPCK)
+ 10a8 Elements Portable (WDBUZG)
+ 10b8 Elements Portable (WDBU6Y, WDBUZG)
+ 1100 My Book Essential Edition 2.0 (WDH1U)
+ 1102 My Book Home Edition (WDH1CS)
1103 My Book Studio
- 1104 MyBook Mirror Edition External HDD
+ 1104 My Book Mirror Edition (WDH2U)
1105 My Book Studio II
- 1123 My Book 3.0
- 1140 My Book Essential USB3.0
+ 1110 My Book Essential (WDBAAF), My Book for Mac (WDBAAG)
+ 1111 My Book Elite (WDBAAH)
+ 1112 My Book Studio (WDBAAJ), My Book Studio LX (WDBACH)
+ 1123 My Book 3.0 (WDBABP)
+ 1130 My Book Essential (WDBACW)
+ 1140 My Book Essential (WDBACW)
+ 1230 My Book (WDBFJK0030HBK)
1059 Giesecke & Devrient GmbH
000b StarSign Bio Token 3.0
105c Hong Ji Electric Wire & Cable (Dongguan) Co., Ltd
106f Money Controls
0009 CT10x Coin Transaction
000a CR10x Coin Recycler
+ 000c Xchange
1076 GCT Semiconductor, Inc.
0031 Bluetooth Device
0032 Bluetooth Device
108e Lotes Co., Ltd.
1099 Surface Optics Corp.
109a DATASOFT Systems GmbH
+109b Hisense
+ 9118 Medion P4013 Mobile
109f eSOL Co., Ltd
3163 Trigem Mobile SmartDisplay84
3164 Trigem Mobile SmartDisplay121
10a9 SK Teletech Co., Ltd
1102 Sky Love Actually IM-U460K
1104 Sky Vega IM-A650S
+ 1105 VEGA Android composite
+ 1106 VEGA Android composite
+ 1107 VEGA Android composite
+ 1108 VEGA Android composite
+ 1109 VEGA Android composite
6021 SIRIUS alpha
+ 6031 Pantech Android composite
+ 6032 Pantech Android composite
+ 6033 Pantech Android composite
+ 6034 Pantech Android composite
+ 6035 Pantech Android composite
+ 6036 Pantech Android composite
+ 6037 Pantech Android composite
+ 6050 Pantech Android composite
+ 6051 Pantech Android composite
+ 6052 Pantech Android composite
+ 6053 Pantech Android composite
+ 6054 Pantech Android composite
+ 6055 Pantech Android composite
+ 6056 Pantech Android composite
+ 6057 Pantech Android composite
+ 6058 Pantech Android composite
+ 6059 Pantech Android composite
+ 6080 MHS291LVW LTE Modem [Verizon Jetpack 4G LTE Mobile Hotspot MHS291L] (Zero CD Mode)
+ 6085 MHS291LVW LTE Modem [Verizon Jetpack 4G LTE Mobile Hotspot MHS291L] (Modem Mode)
+ 7031 Pantech Android composite
+ 7032 Pantech Android composite
+ 7033 Pantech Android composite
+ 7034 Pantech Android composite
+ 7035 Pantech Android composite
+ 7036 Pantech Android composite
+ 7037 Pantech Android composite
10aa Cables To Go
10ab USI Co., Ltd
1002 Bluetooth Device
1427 Ethernet
10bf SmartHome
0001 SmartHome PowerLinc
+10c3 Universal Laser Systems, Inc.
+ 00a4 ULS PLS Series Laser Engraver Firmware Loader
+ 00a5 ULS Print Support
10c4 Cygnal Integrated Products, Inc.
0002 F32x USBXpress Device
0003 CommandIR
8460 Sangoma Wanpipe VoiceTime
8461 Sangoma U100
8477 Balluff RFID Reader
+ 8496 SiLabs Cypress FW downloader
+ 8497 SiLabs Cypress EVB
8605 dilitronics ESoLUX solar lighting controller
86bc C8051F34x AudioDelay [AD-340]
8789 C8051F34x Extender & EDID MGR [EMX-DVI]
87be C8051F34x HDMI Audio Extractor [EMX-HD-AUD]
8863 C8051F34x Bootloader
8897 C8051F38x HDMI Splitter [UHBX]
+ 8918 C8051F38x HDMI Audio Extractor [VSA-HA-DP]
+ 8973 C8051F38x HDMI Splitter [UHBX-8X]
ea60 CP210x UART Bridge / myAVR mySmartUSB light
ea61 CP210x UART Bridge
ea70 CP210x UART Bridge
113d Mapower Electronics Co., Ltd
1141 V One Multimedia, Pte., Ltd
1142 CyberScan Technologies, Inc.
+ 0709 Cyberview High Speed Scanner
1145 Japan Radio Company
0001 AirH PHONE AH-J3001V/J3002V
1146 Shimane SANYO Electric Co., Ltd.
114c Tinius Olsen Testing Machine Co., Inc.
114d Alpha Imaging Technology Corp.
114f Wavecom
+ 1234 Fastrack Xtend FXT001 Modem
115b Salix Technology Co., Ltd.
1162 Secugen Corp.
1163 DeLorme Publishing, Inc.
6832 MC8780 Device
6833 MC8781 Device
683a MC8785 Device
- 683c MC8790 Device
+ 683c Mobile Broadband 3G/UMTS (MC8790 Device)
6850 AirCard 880 Device
6851 AirCard 881 Device
6852 AirCard 880E Device
9008 Gobi 2000 Wireless Modem
9009 Gobi 2000 Wireless Modem
900a Gobi 2000 Wireless Modem
+ 9055 Gobi 9x15 Multimode 3G/4G LTE Modem (NAT mode)
+ 9057 Gobi 9x15 Multimode 3G/4G LTE Modem (IP passthrough mode)
119a ZHAN QI Technology Co., Ltd
119b ruwido austria GmbH
0400 Infrared Keyboard V2.01
11ac Nike
6565 FuelBand
11b0 ATECH FLASH TECHNOLOGY
+ 6208 PRO-28U
+11be R&D International NV
+ f0a0 Martin Maxxyz DMX
11c5 Inmax
0521 IMT-0521 Smartcard Reader
+11ca VeriFone Inc
+ 0207 PIN Pad VX 810
+ 0220 PIN Pad VX 805
11db Topfield Co., Ltd.
1000 PVR
1100 PVR
0004 X75
0005 SXG75/EF81
0008 UMTS/HSDPA Data Card
+ 0101 RCU Connect
11f6 Prolific
2001 Willcom WSIM
11f7 Alcatel (?)
- 02df TD10 Mobile phone USB cable
+ 02df Serial cable (v2) for TD-10 Mobile Phone
1203 TSC Auto ID Technology Co., Ltd
0140 TTP-245C
1209 InterBiometrics
1228 Datapaq Limited
0012 Q18 Data Logger
0015 TPaq21/MPaq21 Datalogger
+ 584c XL2 Logger
1230 Chipidea-Microelectronica, S.A.
1233 Denver Electronics
5677 FUSB200 mp3 player
0000 Neural Impulse Actuator Prototype 1.0 [NIA]
4321 Human Interface Device
ed02 Emotiv EPOC Developer Headset Wireless Dongle
-1235 Novation EMS
- 0001 ReMOTE Audio/XStation
+1235 Focusrite-Novation
+ 0001 ReMOTE Audio/XStation First Edition
0002 Speedio
- 0003 ReMOTE ZeRO SL
+ 0003 RemoteSL + ZeroSL
+ 0004 ReMOTE LE
+ 0005 XIOSynth [First Edition]
+ 0006 XStation
+ 0007 XIOSynth
+ 0008 ReMOTE SL Compact
+ 0009 nIO
+ 000a Nocturn
+ 000b ReMOTE SL MkII
+ 000c ZeRO MkII
+ 000e Launchpad
+ 0010 Saffire 6
+ 0011 Ultranova
+ 0012 Nocturn Keyboard
+ 0013 VRM Box
+ 0014 VRM Box Audio Class (2-out)
+ 0015 Dicer
+ 0016 Ultranova
+ 0018 Twitch
+ 0019 Impulse 25
+ 001a Impulse 49
+ 001b Impulse 61
4661 ReMOTE25
+ 8000 Scarlett 18i6
+ 8002 Scarlett 8i6
8006 Focusrite Scarlett 2i2
+ 8008 Saffire 6
+ 800a Scarlett 2i4
+ 800c Scarlett 18i20
+ 800e iTrack Solo
+ 8010 Forte
+ 8012 Scarlett 6i6
+ 8014 Scarlett 18i8
1241 Belkin
0504 Wireless Trackball Keyboard
1111 Mouse
1122 Typhoon Stream Optical Mouse USB+PS/2
- 1155 PS2/USB Browser Combo Mouse
+ 1155 Memorex Optical ScrollPro Mouse SE MX4600
1166 MI-2150 Trust Mouse
- 1177 F8E842-DL Mouse
+ 1177 Mouse [HT82M21A]
1503 Keyboard
1603 Keyboard
f767 Keyboard
125f A-DATA Technology Co., Ltd.
312a Superior S102
312b Superior S102 Pro
+ a15a DashDrive Durable HD710 portable HDD various size
+ a22a DashDrive Elite HE720 500GB
a91a Portable HDD CH91
c08a C008 Flash Drive
c81a Flash drive
c93a 4GB Pen Drive
c96a C906 Flash Drive
+ cb10 Dash Drive UV100
1260 Standard Microsystems Corp.
ee22 SMC2862W-G v3 EZ Connect 802.11g Adapter [Intersil ISL3887]
1264 Covidien Energy-based Devices
0130 PDM
0150 CMS10GI (Golf)
1286 Marvell Semiconductor, Inc.
+ 00bc Marvell JTAG Probe
1fab 88W8338 [Libertas] 802.11g
2001 88W8388 802.11a/b/g WLAN
2006 88W8362 802.11n WLAN
0002 F5U002 Parallel Port [uss720]
2101 104-key keyboard
1294 RISO KAGAKU CORP.
+ 1320 Webmail Notifier
129b CyberTAN Technology
160b Siemens S30853-S1031-R351 802.11g Wireless Adapter [Atheros AR5523]
160c Siemens S30853-S1038-R351 802.11g Wireless Adapter [Atheros AR5523]
0120 RedOctane Drum Kit for PlayStation(R)3
0200 Harmonix Guitar for PlayStation(R)3
0210 Harmonix Drum Kit for PlayStation(R)3
+12bd Gembird
+ d012 JPD Shockforce gamepad
12c4 Autocue Group Ltd
0006 Teleprompter Two-button Hand Control (v1)
0008 Teleprompter Foot Control (v1)
+12cf DEXIN
+ 0170 Tt eSPORTS BLACK Gaming mouse
12d1 Huawei Technologies Co., Ltd.
1001 E169/E620/E800 HSDPA Modem
1003 E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem
1037 Ideos
1038 Ideos (debug mode)
1039 Ideos (tethering mode)
+ 1404 EM770W miniPCI WCDMA Modem
1406 E1750
140b EC1260 Wireless Data Modem HSD USB Card
140c E180v
14c9 K3770 3G Modem
14cf K3772
14d1 K3770 3G Modem (Mass Storage Mode)
+ 14db E353/E3131
14f1 Gobi 3000 HSPA+ Modem
+ 14fe Modem (Mass Storage Mode)
1501 Pulse
1505 E398 LTE/UMTS/GSM Modem/Networkcard
1506 Modem/Networkcard
1520 K3765 HSPA
1521 K4505 HSPA+
155a R205 Mobile WiFi (CD-ROM mode)
+ 1575 K5150 LTE modem
+ 15ca E3131 3G/UMTS/HSPA+ Modem (Mass Storage Mode)
1805 AT&T Go Phone U2800A phone
1c05 E173s 3G broadband stick (modem on)
1c0b E173s 3G broadband stick (modem off)
1c20 R205 Mobile WiFi (Charging)
1d50 ET302s TD-SCDMA/TD-HSDPA Mobile Broadband
+ 1f01 E353/E3131 (Mass storage mode)
+ 1f16 K5150 LTE modem (Mass Storage Mode)
380b WiMAX USB modem(s)
12d2 LINE TECH INDUSTRIAL CO., LTD.
12d6 EMS Dr. Thomas Wuensche
0444 CPC-USB/ARM7
0888 CPC-USB/M16C
12d7 BETTER WIRE FACTORY CO., LTD.
+12d8 Araneus Information Systems Oy
+ 0001 Alea I True Random Number Generator
12e6 Waldorf Music GmbH
0013 Blofeld
12ef Tapwave, Inc.
0101 Advanced RC Servo Controller
1307 Transcend Information, Inc.
0163 256MB/512MB/1GB Flash Drive
- 0165 2GB/4GB Flash Drive
+ 0165 2GB/4GB/8GB Flash Drive
0190 Ut190 8 GB Flash Drive with MicroSD reader
0310 SD/MicroSD CardReader [hama]
0330 63-in-1 Multi-Card Reader/Writer
0001 Class 1 Bluetooth Dongle
1312 ICS Electronics
1313 ThorLabs
+ 0010 LC1 Linear Camera (Jungo)
+ 0011 SP1 Spectrometer (Jungo)
+ 0012 SP2 Spectrometer (Jungo)
+ 0110 LC1 Linear Camera (VISA)
+ 0111 SP1 Spectrometer (VISA)
+ 0112 SP2 Spectrometer (VISA)
+ 8001 TXP-Series Slot (TXP5001, TXP5004)
+ 8012 BC106 Camera Beam Profiler
+ 8013 WFS10 Wavefront Sensor
+ 8017 BC206 Camera Beam Profiler
+ 8019 BP2 Multi Slit Beam Profiler
+ 8020 PM300 Optical Power Meter
+ 8021 PM300E Optical Power and Energy Meter
+ 8022 PM320E Optical Power and Energy Meter
+ 8030 ER100 Extinction Ratio Meter
8070 PM100D
131d Natural Point
0155 TrackIR 3 Pro Head Tracker
2043 Magicolor 2530DL
2045 Magicolor 2500W
2049 Magicolor 2490MF
+133e Kemper Digital GmbH
+ 0815 Virus TI Desktop
1342 Mobility
0200 EasiDock 200 Hub
0201 EasiDock 200 Keyboard and Mouse Port
0203 EasiDock 200 Printer Port
0204 Ethernet
0304 EasiDock Ethernet
+1343 Citizen Systems
+ 0003 CX / DNP DS40
+ 0004 CX-W / DNP DS80
+ 0005 CY / DNP DSRX
1345 Sino Lite Technology Corp.
001c Xbox Controller Hub
6006 Defender Wireless Controller
0402 G2CCD2
0403 G2/G3CCD-I KAI CCD
0404 G2/G3/G4 CCD-F KAF CCD
+ 0405 Gx CCD-I CCD
+ 0406 Gx CCD-F CCD
0410 G1-0400 CCD
0411 G1-0800 CCD
0412 G1-0300 CCD
0004 Touch Panel Controller
134e Digby's Bitpile, Inc. DBA D Bit
1357 P&E Microcomputer Systems
+ 0089 OpenSDA - CDC Serial Port
0503 USB-ML-12 HCS08/HCS12 Multilink
0504 DEMOJM
+135f Control Development Inc.
+ 0110 Linear Spectrograph
+ 0111 Spectrograph - Renumerated
+ 0200 Linear Spectrograph
+ 0201 Spectrograph - Renumerated
+ 0240 MPP Spectrograph
1366 SEGGER
- 0101 J-Link ARM
+ 0101 J-Link PLUS
136b STEC
+136e Andor Technology Ltd.
+ 0014 Zyla 5.5 sCMOS camera
1370 Swissbit
0323 Swissmemory cirrusWHITE
6828 Victorinox Flash Drive
0005 VFS301 Fingerprint Reader
0007 VFS451 Fingerprint Reader
0008 VFS300 Fingerprint Reader
+ 0010 VFS Fingerprint sensor
0011 VFS5011 Fingerprint Reader
+ 0017 Fingerprint Reader
0018 Fingerprint scanner
003c VFS471 Fingerprint Reader
003d VFS491
+ 003f VFS495 Fingerprint Reader
+ 0050 Swipe Fingerprint Sensor
138e Jungo LTD
9000 Raisonance S.A. STM32 ARM evaluation board
1390 TOMTOM B.V.
0001 GO 520 T/GO 630/ONE XL (v9)
+ 5454 Blue & Me 2
1391 IdealTEK, Inc.
1000 URTC-1000
1395 Sennheiser Communications
0031 AM10 v1 802.11n [Ralink RT3072]
0039 AE1200 802.11bgn Wireless Adapter [Broadcom BCM43235]
003a AE2500 802.11abgn Wireless Adapter [Broadcom BCM43236]
+ 003b AE3000 802.11abgn (3x3) Wireless Adapter [Ralink RT3573]
+ 003e AE6000 802.11a/b/g/n/ac Wireless Adapter [MediaTek MT7610U]
+ 003f WUSB6300 802.11a/b/g/n/ac Wireless Adapter [Realtek RTL8812AU]
13b1 WUSB200: Wireless-G Business Network Adapter with Rangebooster
13b2 Alesis
0030 Multimix 8
13b3 Nippon Dics Co., Ltd.
13ba PCPlay
- 0001 König Electronic CMP-KEYPAD12 Numeric Keypad
+ 0001 Konig Electronic CMP-KEYPAD12 Numeric Keypad
0017 PS/2 Keyboard+Mouse Adapter
0018 Barcode PCP-BCG4209
13be Ricoh Printing Systems, Ltd.
3306 Mediao 802.11n WLAN [Realtek RTL8191SU]
3315 Bluetooth module
3375 Atheros AR3012 Bluetooth 4.0 Adapter
+ 3392 Azurewave 43228+20702
+ 3394 Bluetooth
5070 Webcam
5111 Integrated Webcam
5115 Integrated Webcam
5116 Integrated Webcam
+ 5122 2M Integrated Webcam
5126 PC Cam
+ 5130 Integrated Webcam
5702 UVC VGA Webcam
5710 UVC VGA Webcam
5716 UVC VGA Webcam
7020 DTV-DVB UDST7020BDA DVB-S Box(DVBS for MCE2005)
7022 DTV-DVB UDST7022BDA DVB-S Box(Without HID)
+13d7 Guidance Software, Inc.
+ 0001 T5 PATA forensic bridge
13dc ALEREON, INC.
13dd i.Tech Dynamic Limited
13e1 Kaibo Wire & Cable (Shenzhen) Co., Ltd.
13ec Zydacron
0006 HID Remote Control
13ee MosArt
+ 0001 Optical Mouse
0003 Optical Mouse
13fd Initio Corporation
0840 INIC-1618L SATA
0841 Samsung SE-T084M DVD-RW
+ 1040 INIC-1511L PATA Bridge
1340 Hi-Speed USB to SATA Bridge
160f RocketFish SATA Bridge [INIC-1611]
1640 INIC-1610L SATA Bridge
+ 1669 INIC-1609PN
1840 INIC-1608 SATA bridge
+ 1e40 INIC-1610P SATA bridge
13fe Kingston Technology Company Inc.
1a00 512MB/1GB Flash Drive
1a23 512MB Flash Drive
1d00 DataTraveler 2.0 1GB/4GB Flash Drive / Patriot Xporter 4GB Flash Drive
1e00 Flash Drive 2 GB [ICIDU 2 GB]
1e50 U3 Smart Drive
- 1f00 DataTraveler 2.0 4GB Flash Drive / Patriot Xporter 32GB (PEF32GUSB) Flash Drive
- 1f23 2Gb
+ 1f00 Kingston DataTraveler / Patriot Xporter
+ 1f23 PS2232 flash drive controller
2240 microSD card reader
3100 2/4 GB stick
3123 Verbatim STORE N GO 4GB
+ 3600 flash drive (4GB, EMTEC)
3800 Rage XT Flash Drive
3e00 Flash Drive
+ 4100 Flash drive
+ 5000 USB flash drive (32 GB SHARKOON Accelerate)
5100 Flash Drive
1400 Axxion Group Corp.
1402 Bowe Bell & Howell
0020 Sony Wireless SingStar
2000 Sony Playstation Eye
1419 ABILITY ENTERPRISE CO., LTD.
+1421 Sensor Technology
+ 0605 Sentech Camera
1429 Vega Technologies Industrial (Austria) Co.
142a Thales E-Transactions
0003 Artema Hybrid
5117 OpenMoko Neo1973 kernel usbnet (g_ether, CDC Ethernet) mode
5118 OpenMoko Neo1973 Debug board (V2+)
5119 OpenMoko Neo1973 u-boot cdc_acm serial port
+ 511a HXD8 u-boot usbtty CDC ACM Mode
+ 511b SMDK2440 u-boot usbtty CDC ACM mode
+ 511c SMDK2443 u-boot usbtty CDC ACM mode
+ 511d QT2410 u-boot usbtty CDC ACM mode
5120 OpenMoko Neo1973 u-boot usbtty generic serial
5121 OpenMoko Neo1973 kernel mass storage (g_storage) mode
5122 OpenMoko Neo1973 / Neo Freerunner kernel cdc_ether USB network
1487 DSP Group, Ltd.
148e EVATRONIX SA
148f Ralink Technology, Corp.
+ 1000 Motorola BC4 Bluetooth 3.0+HS Adapter
1706 RT2500USB Wireless Adapter
2070 RT2070 Wireless Adapter
2570 RT2570 Wireless Adapter
5370 RT5370 Wireless Adapter
5372 RT5372 Wireless Adapter
5572 RT5572 Wireless Adapter
+ 7601 MT7601U Wireless Adapter
+ 760b MT7601U Wireless Adapter
9020 RT2500USB Wireless Adapter
9021 RT2501USB Wireless Adapter
1491 Futronic Technology Co. Ltd.
0020 FS81 Fingerprint Scanner Module
1493 Suunto
+ 0010 Bluebird [Ambit]
+ 0019 Duck [Ambit2]
+ 001a Colibri [Ambit2 S]
+ 001b Emu [Ambit3 Peak]
+ 001c Finch [Ambit3 Sport]
+ 001d Greentit [Ambit2 R]
1497 Panstrong Company Ltd.
1498 Microtek International Inc.
a090 DVB-T Tuner
0350 Storage Adapter V2
14c8 Zytronic
14cd Super Top
+ 1212 microSD card reader (SY-T18)
121c microSD card reader
+ 121f microSD CardReader SY-T18
123a SD/MMC/RS-MMC Card Reader
125c SD card reader
127b SDXC Reader
6116 M6116 SATA Bridge
- 6600 USB 2.0 IDE DEVICE
+ 6600 M110E PATA bridge
6700 Card Reader
6900 Card Reader
8123 SD MMC Reader
0501 WR-G528e 'CHEETAH'
14e1 Dialogue Technology Corp.
5000 PenMount 5000 Touch Controller
+14e4 Broadcom Corp.
14e5 SAIN Information & Communications Co., Ltd.
14ea Planex Communications
ab10 GW-US54GZ
1500 Ellisys
1501 Pine-Tum Enterprise Co., Ltd.
1509 First International Computer, Inc.
+ 0a01 LI-3100 Area Meter
+ 0a02 LI-7000 CO2/H2O Gas Analyzer
+ 0a03 C-DiGit Blot Scanner
9242 eHome Infrared Transceiver
1513 medMobile
0444 medMobile
1518 Cheshire Engineering Corp.
0001 HDReye High Dynamic Range Camera
0002 HDReye (before firmware loads)
+1519 Comneon
+ 0020 HSIC Device
1520 Bitwire Corp.
1524 ENE Technology Inc
6680 UTS 6680
1529 UBIQUAM Co., Ltd.
3100 CDMA 1xRTT USB Modem (U-100/105/200/300/520)
152a Thesycon Systemsoftware & Consulting GmbH
+ 8400 INI DVS128
+ 840d INI DAViS
+ 841a INI DAViS FX3
152d JMicron Technology Corp. / JMicron USA Technology Corp.
0539 JMS539 SuperSpeed SATA II 3.0G Bridge
0770 Alienware Integrated Webcam
0003 Krait Mouse
0007 DeathAdder Mouse
0013 Orochi mouse
+ 0015 Naga Mouse
0016 DeathAdder Mouse
0017 RZ01-0035 Laser Gaming Mouse [Imperator]
001c RZ01-0036 Optical Gaming Mouse [Abyssus]
0101 Copperhead Mouse
0102 Tarantula Keyboard
0109 Lycosa Keyboard
+ 0113 RZ07-0074 Gaming Keypad [Orbweaver]
0300 RZ06-0063 Motion Sensing Controllers [Hydra]
+153b TerraTec Electronic GmbH
+ 1181 Cinergy S2 PCIe Dual Port 1
+ 1182 Cinergy S2 PCIe Dual Port 2
1546 U-Blox AG
1547 SG Intec Ltd & Co KG
1000 SG-Lock[U2]
8180 CARD STAR/medic2
154b PNY
0010 USB 2.0 Flash Drive
+ 0048 Flash Drive
004d 8 GB Flash Drive
0057 32GB Micro Slide Attache Flash Drive
+ 007a 8GB Classic Attache Flash Drive
6545 FD Device
154d ConnectCounty Holdings Berhad
154e D&M Holdings, Inc. (Denon/Marantz)
0042 OSBDM - Debug Port
004f i.MX28 SystemOnChip in RecoveryMode
0052 i.MX50 SystemOnChip in RecoveryMode
- 0054 i.MX6Q SystemOnChip in RecoveryMode
+ 0054 i.MX 6Dual/6Quad SystemOnChip in RecoveryMode
+ 0061 i.MX 6Solo/6DualLite SystemOnChip in RecoveryMode
15a4 Afatech Technologies, Inc.
1000 AF9015/AF9035 DVB-T stick
1001 AF9015/AF9035 DVB-T stick
15c2 SoundGraph Inc.
0036 LC16M VFD Display/IR Receiver
0038 GD01 MX LCD Display/IR Receiver
+ 0042 Antec Veris Multimedia Station E-Z IR Receiver
ffda iMON PAD Remote Controller
ffdc iMON PAD Remote Controller
15c5 Advance Multimedia Internet Technology Inc. (AMIT)
0a41 MI-2540D [Optical mouse]
0a4c USB+PS/2 Optical Mouse
0a4d Optical Mouse
+ 0a4f Optical Mouse
15dc Hynix Semiconductor Inc.
15e0 Seong Ji Industrial Co., Ltd.
15e1 RSA
0726 Wi-Fi Wireless LAN Adapter
0740 802.11n Wireless LAN Card
0901 Voyager 205 ADSL Router
+ 2000 naturaSign Pad Standard
+ 2001 naturaSign Pad Standard
+ fe12 Bootloader
1696 Hitachi Video and Information System, Inc.
1697 VTec Test, Inc.
16a5 Shenzhen Zhengerya Cable Co., Ltd.
05e4 Free shared USB VID/PID pair for MIDI devices
06b4 USB2LPT with 2 interfaces
06b5 USB2LPT with 3 interfaces (native, HID, printer)
+ 0762 Osmocom SIMtrace
076b OpenPCD 13.56MHz RFID Reader
076c OpenPICC 13.56MHz RFID Simulator (native)
08ac OpenBeacon USB stick
075c AB-1.x UAC1 [Audio Widget]
075d AB-1.x UAC2 [Audio Widget]
080a S2E1 Interface
+ 0870 Kaufmann Automotive GmbH, RKS+CAN Interface
+16d1 Suprema Inc.
+ 0401 SUP-SFR400(A) BioMini Fingerprint Reader
16d3 Frontline Test Equipment, Inc.
16d5 AnyDATA Corporation
6202 CDMA/UMTS/GPRS modem
6501 CDMA 2000 1xRTT/EV-DO Modem
6502 CDMA/UMTS/GPRS modem
+ 6603 ADU-890WH modem
16d6 JABLOCOM s.r.o.
8000 GDP-04 desktop phone
8001 EYE-02
170b Swissonic
0011 MIDI-USB 1x1
170d Avnera
+1711 Leica Microsystems
+ 3020 IC80 HD Camera
+1724 Meyer Instruments (MIS)
+ 0115 PAXcam5
1725 Vitesse Semiconductor
1726 Axesstel, Inc.
1000 wireless modem
0077 WUSB54GC v3 802.11g Adapter [Ralink RT2070L]
0078 WUSB100 v2 RangePlus Wireless Network Adapter [Ralink RT3070]
0079 WUSB600N v2 Dual-Band Wireless-N Network Adapter [Ralink RT3572]
+173d QSENN
+ 0002 GP-K7000 keyboard
1740 Senao
+ 0100 EUB1200AC AC1200 DB Wireless Adapter [Realtek RTL8812AU]
+ 0600 EUB600v1 802.11abgn Wireless Adapter [Ralink RT3572]
0605 LevelOne WUA-0605 N_Max Wireless USB Adapter
0615 LevelOne WUA-0615 N_Max Wireless USB Adapter
1000 NUB-350 802.11g Wireless Adapter [Intersil ISL3887]
9706 EUB9706 802.11n Wireless Adapter [Ralink RT3072]
9801 EUB9801 802.11abgn Wireless Adapter [Ralink RT3572]
1743 General Atomics
+1748 MQP Electronics
+ 0101 Packet-Master USB12
174c ASMedia Technology Inc.
5106 Transcend StoreJet 25M3
- 55aa ASMedia 2105 SATA bridge
+ 5136 ASM1053 SATA 6Gb/s bridge
+ 55aa ASM1051 SATA 3Gb/s bridge
174f Syntek
1105 SM-MS/Pro-MMC-XD Card Reader
110b HP Webcam
0c30 Telldus TellStick
0c31 Telldus TellStick Duo
0c9f USBtiny
+ 1eef OpenAPC SecuKey
1782 Spreadtrum Communications Inc.
1784 TopSeed Technology Corp.
0001 eHome Infrared Transceiver
0002 Q1U dynamic microphone
0100 C03U multi-pattern microphone
0101 UB1 boundary microphone
+ 0120 Meteorite condenser microphone
0200 StudioDock monitors (internal hub)
0201 StudioDock monitors (audio)
0210 StudioGT monitors
0301 Q2U handheld microphone with XLR
0302 GoMic compact condenser microphone
+ 0303 C01U Pro condenser microphone
0304 Q2U handheld mic with XLR
0305 GoMic compact condenser mic
0310 Meteor condenser microphone
037b Plugable USB-VGA-165
037c Plugable DC-125
037d Plugable USB2-HDMI-165
+ 410a HDMI Adapter
430a HP Port Replicator (Composite Device)
4312 S2340T
17eb Cornice, Inc.
17ef Lenovo
+ 1000 Hub
1003 Integrated Smart Card Reader
1004 Integrated Webcam
1008 Hub
100a ThinkPad Mini Dock Plus Series 3
+ 304b AX88179 Gigabit Ethernet [ThinkPad OneLink GigaLAN]
3815 ChipsBnk 2GB USB Stick
4802 Lenovo Vc0323+MI1310_SOC Camera
4807 UVC Camera
6007 Smartcard Keyboard
6009 ThinkPad Keyboard with TrackPoint
6014 Mini Wireless Keyboard N5901
+ 6025 ThinkPad Travel Mouse
+ 7203 Ethernet adapter [U2L 100P-Y1]
7423 IdeaPad A1 Tablet
7435 A789 (Mass Storage mode, with debug)
743a A789 (Mass Storage mode)
1c22 ZHONGSHAN CHIANG YU ELECTRIC CO., LTD.
1c26 Shanghai Haiying Electronics Co., Ltd.
1c27 HuiYang D & S Cable Co., Ltd.
+1c29 Elster GmbH
+ 0001 ExMFE5 Simulator
+ 10fc enCore device
1c31 LS Cable Ltd.
1c34 SpringCard
7241 Prox'N'Roll RFID Scanner
1c7a LighTuning Technology Inc.
0801 Fingerprint Reader
1c7b LUXSHARE PRECISION INDUSTRY (SHENZHEN) CO., LTD.
-1c83 Schomäcker GmbH
+1c83 Schomaecker GmbH
0001 RS150 V2
1c87 2N TELEKOMUNIKACE a.s.
1c88 Somagic, Inc.
c010 Windham
2047 Texas Instruments
0200 MSP430 USB HID Bootstrap Loader
+ 0855 Invensense Embedded MotionApp HID Sensor
+ 0964 Inventio Software MSP430
2080 Barnes & Noble
0001 nook
0002 NOOKcolor
00dc aes220 FPGA Mini-Module
2478 Tripp-Lite
2008 U209-000-R Serial Port
+249c M2Tech s.r.l.
2632 TwinMOS
3209 7-in-1 Card Reader
+2639 Xsens
+ 0001 MTi-10 IMU
+ 0002 MTi-20 VRU
+ 0003 MTi-30 AHRS
+ 0011 MTi-100 IMU
+ 0012 MTi-200 VRU
+ 0013 MTi-300 AHRS
+ 0017 MTi-G 7xx GNSS/INS
+ 0100 Body Pack
+ 0101 Awinda Station
+ 0102 Awinda Dongle
+ 0103 Sync Station
+ 0200 MTw
+ d00d Wireless Receiver
2650 Electronics For Imaging, Inc. [hex]
2659 Sundtek
1101 TNT DVB-T/DAB/DAB+/FM
1211 MediaTV Pro III (US)
1212 MediaTV Pro III MiniPCIe (EU)
1213 MediaTV Pro III MiniPCIe (US)
+2676 Basler AG
+ ba02 ace
2730 Citizen
200f CT-S310 Label printer
2735 DigitalWay
915d Cyberpix S-210S / Little Tikes My Real Digital Camera
930b CCD Webcam(PC370R)
930c CCD Webcam(PC370R)
+27b8 ThingM
+ 01ed blink(1)
2821 ASUSTek Computer Inc.
0161 WL-161 802.11b Wireless Adapter [SiS 162U]
160f WL-160g 802.11g Wireless Adapter [Envara WiND512]
3300 WL-140 / Hawking HWU36D 802.11b Wireless Adapter [Intersil PRISM 3]
2899 Toptronic Industrial Co., Ltd
012c Camera Device
+2931 Jolla Oy
+ 0a01 Jolla Phone MTP
+ 0a02 Jolla Phone Developer
+ 0a05 Jolla PC connection
+ 0afe Jolla charging only
2c02 Planex Communications
14ea GW-US11H WLAN
2c1a Dolphin Peripherals
2fb2 Fujitsu, Ltd
3125 Eagletron
0001 TrackerPod Camera Stand
+3136 Navini Networks
3176 Whanam Electronics Co., Ltd
+3195 Link Instruments
+ f190 MSO-19
+ f280 MSO-28
+ f281 MSO-28
3275 VidzMedia Pte Ltd
4fb1 MonsterTV P2H
+3333 InLine
+ 3333 2 port KVM switch model 60652K
3334 AEI
1701 Fast Ethernet
3340 Yakumo
043a Mio A701 DigiWalker PPCPhone
0e3a Pocket PC 300 GPS SL / Typhoon MyGuide 3500
a0a3 deltaX 5 BT (D) PDA
+3344 Leaguer Microelectronics (LME)
+ 3744 OEM PC Remote
3504 Micro Star
f110 Security Key
3538 Power Quotient International Co., Ltd
4146 USBest Technology
9281 Iomega Micro Mini 128MB Flash Drive
ba01 Intuix Flash Drive
+4168 Targus
+ 1010 Wireless Compact Laser Mouse
4242 USB Design by Example
4201 Buttons and Lights HID device
4220 Echo 1 Camera
+4255 GoPro
+ 1000 9FF2 [Digital Photo Display]
+ 2000 HD2-14 [Hero 2 Camera]
4317 Broadcom Corp.
0700 U.S. Robotics USR5426 802.11g Adapter
0701 U.S. Robotics USR5425 Wireless MAXg Adapter
1001 Cetus CDC Device
5345 Owon
1234 PDS6062T Oscilloscope
+534c SatoshiLabs
+ 0001 Bitcoin Wallet [TREZOR]
+5354 Meyer Instruments (MIS)
+ 0017 PAXcam2
544d Transmeta Corp.
5543 UC-Logic Technology Corp.
0002 SuperPen WP3325U Tablet
0241 BisonCam, NB Pro
02d0 Lenovo Integrated Webcam [R5U877]
03d0 Lenovo Integrated Webcam [R5U877]
+59e3 Nonolith Labs
5a57 Zinwell
0260 RT2570
0280 802.11a/b/g/n USB Wireless LAN Card
6189 Sitecom
182d USB 2.0 Ethernet
2068 USB to serial cable (v2)
+6244 LightingSoft AG
+ 0101 Intelligent Usb Dmx Interface SIUDI5A
+ 0201 Intelligent Usb Dmx Interface SIUDI5C
+ 0300 Intelligent Usb Dmx Interface SIUDI6 Firmware download
+ 0301 Intelligent Usb Dmx Interface SIUDI6C
+ 0302 Intelligent Usb Dmx Interface SIUDI6A
+ 0303 Intelligent Usb Dmx Interface SIUDI6D
+ 0400 Touch Sensitive Intelligent Control Keypad STICK1A
+ 0401 Touch Sensitive Intelligent Control Keypad STICK1A
+ 0410 Intelligent Usb Dmx Interface SIUDI7 Firmware Download
+ 0411 Intelligent Usb Dmx Interface SIUDI7A
+ 0420 Intelligent Usb Dmx Interface SIUDI8A Firmware Download
+ 0421 Intelligent Usb Dmx Interface SIUDI8A
+ 0430 Intelligent Usb Dmx Interface SIUDI8C Firmware Download
+ 0431 Intelligent Usb Dmx Interface SIUDI8C
+ 0440 Intelligent Usb Dmx Interface SIUDI9A Firmware Download
+ 0441 Intelligent Usb Dmx Interface SIUDI9A
+ 0450 Intelligent Usb Dmx Interface SIUDI9C Firmware Download
+ 0451 Intelligent Usb Dmx Interface SIUDI9C
+ 0460 Touch Sensitive Intelligent Control Keypad STICK2 Firmware download
+ 0461 Touch Sensitive Intelligent Control Keypad STICK2
+ 0470 Touch Sensitive Intelligent Control Keypad STICK1B Firmware download
+ 0471 Touch Sensitive Intelligent Control Keypad STICK1B
+ 0480 Touch Sensitive Intelligent Control Keypad STICK3 Firmware download
+ 0481 Touch Sensitive Intelligent Control Keypad STICK3
+ 0490 Intelligent Usb Dmx Interface SIUDI9D Firmware Download
+ 0491 Intelligent Usb Dmx Interface SIUDI9D
+ 0500 Touch Sensitive Intelligent Control Keypad STICK2B Firmware download
+ 0501 Touch Sensitive Intelligent Control Keypad STICK2B
6253 TwinHan Technology Co., Ltd
0100 Ir reciver f. remote control
636c CoreLogic, Inc.
3301 Retro Adapter Mouse
8341 EGO Systems, Inc.
2000 Flashdisk
+8564 Transcend Information, Inc.
+ 1000 JetFlash
+ 8564 1000 JetFlash
+ 4000 RDF8
+8644 Intenso GmbG
+ 8003 Micro Line
+ 800b Micro Line (4GB)
+8e06 CH Products, Inc.
+ f700 DT225 Trackball
9016 Sitecom
182d WL-022 802.11b Adapter
9022 TeVii Technology Ltd.
7830 MCS7830 10/100 Mbps Ethernet adapter
7832 MCS7832 10/100 Mbps Ethernet adapter
7840 MCS7820/MCS7840 2/4 port serial adapter
+9849 Bestmedia CD Recordable GmbH & Co. KG
+ 0701 Platinum MyDrive HP
+9999 Odeon
+ 0001 JAF Mobile Phone Flasher Interface
99fa Grandtec
8988 V.cap Camera Device
9ac4 J. Westhues
6893 3CRUSB20075 OfficeConnect Wireless 108Mbps 11g Adapter [Atheros AR5523]
6895 AR5523
6897 AR5523
+aaaa MXT
+ 8815 microSD CardReader
abcd Unknown
cdee Petcam
+b58e Blue Microphones
+ 9e84 Yeti Stereo Microphone
+c216 Card Device Expert Co., LTD
+ 0180 MSR90 MagStripe reader
c251 Keil Software, Inc.
2710 ULink
cace CACE Technologies Inc.
0002 AirPCAP Classic 802.11 packet capture adapter
0300 AirPcap NX [Atheros AR9001U-(2)NG]
+cd12 SMART TECHNOLOGY INDUSTRIAL LTD.
+d208 Ultimarc
+ 0310 Mini-PAC Arcade Control Interface
d209 Ultimarc
0301 I-PAC Arcade Control Interface
0501 Ultra-Stik Ultimarc Ultra-Stik Player 1
+d904 LogiLink
+ 0003 Laser Mouse (ID0009A)
e4e4 Xorcom Ltd.
1130 Astribank series
1131 Astribank series
50a6 Gadmei UTV330 TV Box
e355 KWorld DVB-T 355U Digital TV Dongle
eb2a KWorld
+ef18 SMART TECHNOLOGY INDUSTRIAL LTD.
f003 Hewlett Packard
6002 PhotoSmart C500
+f182 Leap Motion
+ 0003 Controller
f4ec Atten Electronics / Siglent Technologies
ee38 Digital Storage Oscilloscope
+f4ed Shenzhen Siglent Co., Ltd.
+ ee37 SDG1010 Waveform Generator
+ ee3a SDG1010 Waveform Generator (TMC mode)
+f766 Hama
+ 0001 PC-Gamepad "Greystorm"
+fc08 Conrad Electronic SE
+ 0101 MIDI Cable UA0037
+ffee FNK Tech
+ 0100 Card Reader Controller RTS5101/RTS5111/RTS5116
# List of known device classes, subclasses and protocols
02 Wire Adapter Multifunction Peripheral
03 ?
01 Cable Based Association
+ 05 USB3 Vision
C fe Application Specific Interface
01 Device Firmware Update
02 IRDA Bridge
fi
# Enable swap plugin if swap found
- if [ "$(swapon -s | wc -l)" == "1" ]; then
+ if [ "$(swapon -s | wc -l)" == "0" ]; then
sed -i -e "s|^LoadPlugin swap|#LoadPlugin swap|g" /etc/collectd.conf
else
sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf
fi
+
+ # sync after config update...
+ sync
if [ $(date +%Y) -gt 2011 ]; then
boot_mesg "Starting Collection daemon..."
if [ "$(basename $0)" == "collectd" ]; then
/etc/init.d/tmpfs backup
fi
+ # sync after backup...
+ sync
;;
restart)
${0} stop
. ${rc_functions}
eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
-FONT="LatArCyrHeb-16"
+FONT="latarcyrheb-sun16"
KEYMAP_CORRECTIONS="euro2"
UNICODE="1"
BROKEN_COMPOSE="0"
TRUST_ANCHOR=".,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5"
function dnssec_args() {
- local cmdline="--dnssec"
+ local cmdline="--dnssec --dnssec-timestamp"
if [ -n "${TRUST_ANCHOR}" ]; then
cmdline="${cmdline} --trust-anchor=${TRUST_ANCHOR}"
--- /dev/null
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/haproxy
+#
+# Description : HAProxy init script
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+ start)
+ boot_mesg "Starting HAProxy..."
+ loadproc /usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg \
+ -p /var/run/haproxy.pid
+ ;;
+
+ stop)
+ boot_mesg "Stopping HAProxy..."
+ killproc /usr/sbin/haproxy
+ ;;
+
+ reload)
+ boot_mesg "Reloading HAProxy..."
+ /usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg \
+ -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)
+ evaluate_retval
+ ;;
+
+ restart)
+ ${0} stop
+ sleep 1
+ ${0} start
+ ;;
+
+ status)
+ statusproc /usr/sbin/haproxy
+ ;;
+
+ *)
+ echo "Usage: ${0} {start|stop|reload|restart|status}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/haproxy
sleep 2
if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
- boot_mesg "Error! Can't set wlan master mode"
- echo_failure;
+ killproc /usr/bin/hostapd > /dev/null 2>&1
+ boot_mesg "Try to create additional AP device ..."
+ ip link set ${INTERFACE} down
+ ip link set ${INTERFACE} name ${INTERFACE}_man
+ iw dev ${INTERFACE}_man interface add ${INTERFACE} type __ap
+ evaluate_retval;
+ if [ -d /sys/class/net/${INTERFACE} ]; then
+ /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf >/dev/null 2>&1 &
+ else
+ ip link set ${INTERFACE}_man down
+ ip link set ${INTERFACE}_man name ${INTERFACE}
+ fi
exit 0;
else
echo_ok
stop)
boot_mesg "Stopping hostapd..."
-
+ ip link set ${INTERFACE} down > /dev/null 2>&1
+ ip link set ${INTERFACE} down_man > /dev/null 2>&1
+ sleep 1
killproc /usr/bin/hostapd
evaluate_retval
;;
setup_netdev_trigger nas6210:red:power ${RED_DEV} tx rx
setup_netdev_trigger nas6210:red:usb_copy ${GREEN_DEV} tx rx
+ # Mirabox start
+ setup_heartbeat_trigger mirabox:green:pwr
+ setup_netdev_trigger mirabox:green:stat ${GREEN_DEV} tx rx
+ setup_netdev_trigger mirabox:blue:stat ${BLUE_DEV} tx rx
+
exit 0
;;
disable_led_trigger nas6210:red:power
disable_led_trigger nas6210:red:usb_copy
+ # Mirabox stop
+ disable_led_trigger mirabox:green:pwr
+ enable_led mirabox:green:pwr
+ disable_led_trigger mirabox:green:stat
+ disable_led_trigger mirabox:blue:stat
+
exit 0
;;
--- /dev/null
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/monit
+#
+# Description : monit monitoring daemon
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+ start)
+ boot_mesg "Starting monit..."
+ loadproc /usr/bin/monit
+ ;;
+
+ stop)
+ boot_mesg "Stopping monit..."
+ killproc /usr/bin/monit
+ ;;
+
+ restart)
+ ${0} stop
+ sleep 1
+ ${0} start
+ ;;
+
+ status)
+ statusproc /usr/bin/monit
+ ;;
+
+ *)
+ echo "Usage: ${0} {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/monit
--- /dev/null
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/network-trigger
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+ start)
+ boot_mesg "Triggering network devices..."
+ udevadm trigger --action="add" --subsystem-match="net"
+ evaluate_retval
+ ;;
+
+ *)
+ echo "Usage: ${0} {start}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/network-trigger
--- /dev/null
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/swconfig
+#
+# Description : Script to setup lan switch.
+# don't edit this script! If you want change the functions
+# create an own script called swconfig.user
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+if [ -e /etc/init.d/swconfig.user ]; then
+ /etc/init.d/swconfig.user $*
+ exit ${?}
+fi
+
+if [ -e /var/ipfire/ethernet/swconfig_mac ]; then
+SWMAC=`cat /var/ipfire/ethernet/swconfig_mac`
+else
+# Generate a random local administrated mac address for vlan swconfig.
+SWMAC=`printf "%1x2:%02x:%02x:%02x:%02x" $[RANDOM%16] $[RANDOM%256] $[RANDOM%256] $[RANDOM%256] $[RANDOM%256]`
+echo $SWMAC > /var/ipfire/ethernet/swconfig_mac
+fi
+
+case "${1}" in
+ start)
+ case `cat /proc/device-tree/model 2>/dev/null` in
+ "Lamobo-R1")
+ #
+ # Lamobo R1 aka BPi R1 Routerboard
+ #
+ # Speaker | LAN1 | LAN2 | LAN3 | LAN4 || LAN5 | HDMI
+ # SW-Port | P2 | P1 | P0 | P4 || P3 |
+ # VLAN | 11 | 12 | 13 | 14 ||ALL(t)|
+ #
+ # Switch-Port P8 - ALL(t) boards internal CPU Port
+ #
+ device=`ls /sys/class/net/*/device/stmmac-0* | head -1 | cut -d/ -f5`
+ ip link set $device up
+ boot_mesg "Configure vlan-switch on $device ..."
+ # Reset switch, counter and enable vlan mode
+ swconfig dev $device set reset 1
+ swconfig dev $device set reset_mib 1
+ swconfig dev $device set enable_vlan 1
+ # configure vlans
+ swconfig dev $device vlan 11 set ports "2 3t 8t"
+ swconfig dev $device vlan 12 set ports "1 3t 8t"
+ swconfig dev $device vlan 13 set ports "0 3t 8t"
+ swconfig dev $device vlan 14 set ports "4 3t 8t"
+ # activate new config
+ swconfig dev $device set apply 1
+ # create interfaces for the vlan's
+ modprobe 8021q
+ vconfig add $device 11
+ vconfig add $device 12
+ vconfig add $device 13
+ vconfig add $device 14
+ # set local mac addresses.
+ ip link set dev $device.11 address $SWMAC:11
+ ip link set dev $device.12 address $SWMAC:12
+ ip link set dev $device.13 address $SWMAC:13
+ ip link set dev $device.14 address $SWMAC:14
+ # need to restart udev...
+ killall udevd
+ /etc/init.d/udev start
+ ;;
+ esac
+ exit 0
+ ;;
+
+ *)
+ echo "Usage: ${0} {start}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/swconfig
+
+++ /dev/null
-#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/teamspeak
-#
-# Description : Start/Stops the teamspeak server
-#
-# Authors : Michael Tremer
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
-
-. /etc/sysconfig/rc
-. $rc_functions
-
-case "$1" in
- status)
- statusproc /opt/teamspeak/server_linux
- ;;
- *)
- export LANG=en_US.utf8
- cd /opt/teamspeak && sudo -u teamspeak ./teamspeak2-server_startscript $*
- exit 0
- ;;
-esac
-# End $rc_base/init.d/teamspeak
echo -en '\033%G' && kbd_mode -u
# Load default console font
-setfont LatArCyrHeb-16
+setfont latarcyrheb-sun16
# Silence the kernel
echo >/proc/sys/kernel/printk "1 4 1 7"
"%s - %s", size_str, p);
}
+ // Cut off the description string after 40 characters
+ disk->description[41] = '\0';
+
*disks++ = disk;
if (--i == 0)
}
static char* center_string(const char* str, int width) {
+ if (!str)
+ return NULL;
+
+ char* string = NULL;
unsigned int str_len = strlen(str);
- unsigned int indent_length = (width - str_len) / 2;
- char indent[indent_length + 1];
+ if (str_len == width) {
+ string = strdup(str);
- for (unsigned int i = 0; i < indent_length; i++) {
- indent[i] = ' ';
- }
- indent[indent_length] = '\0';
+ } else if (str_len > width) {
+ string = strdup(str);
+ string[width - 1] = '\0';
- char* string = NULL;
- if (asprintf(&string, "%s%s", indent, str) < 0)
- return NULL;
+ } else {
+ unsigned int indent_length = (width - str_len) / 2;
+ char indent[indent_length + 1];
+
+ for (unsigned int i = 0; i < indent_length; i++) {
+ indent[i] = ' ';
+ }
+ indent[indent_length] = '\0';
+
+ if (asprintf(&string, "%s%s", indent, str) < 0)
+ return NULL;
+ }
return string;
}
-#define DEFAULT_LANG "English"
-#define NUM_LANGS 10
+#define DEFAULT_LANG "en.utf8"
+#define NUM_LANGS 13
static struct lang {
const char* code;
char* name;
} languages[NUM_LANGS + 1] = {
- { "da.utf8", "Danish (Dansk)" },
- { "nl_NL.utf8", "Dutch (Nederlands)" },
- { "en_US.utf8", "English" },
- { "fr_FR.utf8", "French (Français)" },
- { "de_DE.utf8", "German (Deutsch)" },
- { "pl_PL.utf8", "Polish (Polski)" },
- { "pt_BR.utf8", "Portuguese (Brasil)" },
- { "ru_RU.utf8", "Russian (Русский)" },
- { "es_ES.utf8", "Spanish (Español)" },
- { "tr_TR.utf8", "Turkish (Türkçe)" },
+ { "fa.utf8", "فارسی (Persian)" },
+ { "da.utf8", "Dansk (Danish)" },
+ { "es.utf8", "Español (Spanish)" },
+ { "en.utf8", "English" },
+ { "fr.utf8", "Français (French)" },
+ { "hr.utf8", "Hrvatski (Croatian)" },
+ { "it.utf8", "Italiano (Italian)" },
+ { "de.utf8", "Deutsch (German)" },
+ { "nl.utf8", "Nederlands (Dutch)" },
+ { "pl.utf8", "Polski (Polish)" },
+ { "pt.utf8", "Portuguese (Brasil)" },
+ { "ru.utf8", "Русский (Russian)" },
+ { "tr.utf8", "Türkçe (Turkish)" },
{ NULL, NULL },
};
int disable_swap;
char download_url[STRING_SIZE];
char postinstall[STRING_SIZE];
+ char* language;
} config = {
.unattended = 0,
.serial_console = 0,
.disable_swap = 0,
.download_url = DOWNLOAD_URL,
.postinstall = "\0",
+ .language = DEFAULT_LANG,
};
static void parse_command_line(struct config* c) {
int rc = 0;
char commandstring[STRING_SIZE];
int choice;
- char language[STRING_SIZE];
char message[STRING_SIZE];
char title[STRING_SIZE];
int allok = 0;
// Draw title
char* roottext = center_string(system_release, screen_cols);
- newtDrawRootText(0, 0, roottext);
+ if (roottext)
+ newtDrawRootText(0, 0, roottext);
snprintf(title, sizeof(title), "%s - %s", NAME, SLOGAN);
char* langnames[NUM_LANGS + 1];
for (unsigned int i = 0; i < NUM_LANGS; i++) {
- if (strcmp(languages[i].name, DEFAULT_LANG) == 0)
+ if (strcmp(languages[i].code, DEFAULT_LANG) == 0)
choice = i;
langnames[i] = languages[i].name;
assert(choice <= NUM_LANGS);
fprintf(flog, "Selected language: %s (%s)\n", languages[choice].name, languages[choice].code);
- snprintf(language, sizeof(language), "%s", languages[choice].code);
+ config.language = languages[choice].code;
- setenv("LANGUAGE", language, 1);
- setlocale(LC_ALL, language);
+ setlocale(LC_ALL, config.language);
+ setenv("LANGUAGE", config.language, 1);
}
// Set helpline
else
helpline = center_string(_("<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"), screen_cols);
- newtPushHelpLine(helpline);
+ if (helpline)
+ newtPushHelpLine(helpline);
if (!config.unattended) {
snprintf(message, sizeof(message),
}
/* Save language und local settings */
- write_lang_configs(language);
+ write_lang_configs(config.language);
/* Build cache lang file */
snprintf(commandstring, STRING_SIZE, "/usr/sbin/chroot /harddisk /usr/bin/perl -e \"require '" CONFIG_ROOT "/lang.pl'; &Lang::BuildCacheLang\"");
newtPopWindow();
- /* Set marker that the user has already accepted the gpl */
- mysystem(logfile, "/usr/bin/touch /harddisk/var/ipfire/main/gpl_accepted");
+ /* Set marker that the user has already accepted the GPL if the license has been shown
+ * in the installation process. In unatteded mode, the user will be presented the
+ * license when he or she logs on to the web user interface for the first time. */
+ if (!config.unattended)
+ mysystem(logfile, "/usr/bin/touch /harddisk/var/ipfire/main/gpl_accepted");
/* Copy restore file from cdrom */
char* backup_file = hw_find_backup_file(logfile, SOURCE_MOUNT_PATH);
es
fa
fr
+hr
hu
id
it
ja
+jv
km_KH
nl
pl
pt_PT
ro_RO
ru
+rw
sk
sq
+sr
+su
sv
th
tk
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Arabic (http://www.transifex.com/projects/p/ipfire/language/ar/)\n"
"MIME-Version: 1.0\n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Catalan (http://www.transifex.com/projects/p/ipfire/language/ca/)\n"
"MIME-Version: 1.0\n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Czech (Czech Republic) (http://www.transifex.com/projects/p/ipfire/language/cs_CZ/)\n"
"MIME-Version: 1.0\n"
"Language: cs_CZ\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
-# Henrik Simonsen <cybermaze@gmail.com>, 2014
+# Henrik Simonsen <cybermaze@gmail.com>, 2014-2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-01-13 21:22+0000\n"
+"Last-Translator: Henrik Simonsen <cybermaze@gmail.com>\n"
"Language-Team: Danish (http://www.transifex.com/projects/p/ipfire/language/da/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: da\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr "OK"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr "Annuller"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr "Jeg accepterer brugerlicensen"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Advarsel: Installation uden opsyn starter om 10 sekunder..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Vælg sprog"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "Vælg det sprog du ønsker at anvende under installationen."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Uden opsyn"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr "<Tab>/<Alt-Tab> mellem elementer | <Space> vælger | <F12> næste skærm"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "Velkommen til %s installationsprogram.\n\nVælg Annuller på ethvert tidspunkt for at genstarte computeren."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr "Start installationen"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr "Fandt ikke en lokal kilde. Henter fra internettet."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Installationen vil nu forsøge at hente installationsbilledet."
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "Kunne ikke finde et kildedrev.\n\nDu kan prøve at hente det påkrævede installationsbillede."
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Sørg venligst for at din computer er forbundet til et netværk, så vil installationen forsøge at skaffe en IP adresse."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Hent installationsbillede"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Prøver at starte netværk (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "Kunne ikke oprette forbindelse til et netværk hvilket er nødvendigt for installationen.\n\nForbind venligst din computer til et netværk med en DHCP server og prøv igen."
-#: main.c:340
-msgid "Downloading installation image ..."
-msgstr "Henter installationsbillede ..."
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Prøv igen"
-#: main.c:342
-msgid "Download error"
-msgstr "Fejl under hentning"
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Henter installationsbillede..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "MD5 checksum mismatch"
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "Installationsbilledet kunne ikke hentes.\n Årsag: %s\n\n%s"
-#: main.c:376
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Kunne ikke montere %s til %s:\n %s\n"
+
+#: main.c:543
msgid "License Agreement"
-msgstr ""
+msgstr "Licensaftale"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr "Brugerlicensen ikke accepteret!"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr "Fandt ikke en harddisk."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr "Vælg harddisk"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr "Vælg den eller de harddisk(e) du vil installere IPFire på. Diskene bliver først partitioneret og dernæst bliver der oprettet filsystemer.\n\nAL DATA PÅ DISKENE BLIVER SLETTET."
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr "Ingen harddisk valgt.\n\nVælg venligst en eller flere harddiske du vil installere IPFire på."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr "Installationsprogrammet forbereder nu den eller de valgte harddiske:\n\n%s\n\nVil du fortsætte?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr "Harddisk opsætning"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr "Slet alle data"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr "Installationsprogrammet vil nu opsætte RAID konfigurationen på de valgte harddiske:\n\n%s\n%s\n\nVil du fortsætte?"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr "RAID opsætning"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
-msgstr "Din harddisk konfiguration understøttes ikke pt."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "Din drev konfiguration er ikke understøttet pt."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
-msgstr "Din harddisk er for lille."
+msgstr "Din harddisk har for lille kapacitet."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Din harddisk har meget lille kapacitet, men du kan fortsætte uden en swap partition."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr "ext4 filsystem"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr "ext4 filsystem uden journal"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr "XFS filsystem"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr "ReiserFS filsystem"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr "Vælg filsystem"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr "Vælg venligst et filsystem:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr "Bygger RAID..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr "Kunne ikke bygge RAID."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr "Partitionerer harddisk..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr "Kunne ikke partitionere harddisk."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr "Opretter filsystemer..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr "Kunne ikke oprette filsystemer."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr "Kunne ikke forbinde til filsystemer."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr "Installerer systemet..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr "Kunne ikke installere systemet."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr "Installerer sprog arkivet..."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr "Kunne ikke installere sprog arkivet."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr "Installerer bootloader..."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "Kunne ikke gemme til /etc/default/grub."
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr "Kunne ikke installere bootloader."
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "En backup fil er fundet på installationsbilledet.\n\nØnsker du at genskabe denne backup?"
+
+#: main.c:827
+msgid "Yes"
+msgstr "Ja"
+
+#: main.c:827
+msgid "No"
+msgstr "Nej"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Der opstod en fejl under forsøget på at genskabe backup filen."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Kører efter-installation script..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Efter-installation script fejlede."
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr ""
+msgstr "%s blev installeret korrekt!\n\nFjern venligst installationsmedier fra systemet og vælg Genstart. Efter genstart bliver du bedt om at opsætte netværket og system kodeord. Efter opsætningen, besøg da https://%s:444 (eller hvad du navngav %s) fra din internet browser for at anvende web konsollen."
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr "Tillykke!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr "Genstart"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "Installationen fejlede. Vælg Ok for at genstarte."
#
# Translators:
# Michael Tremer <michael.tremer@ipfire.org>, 2014
+# Peter Cloudstone <rmg-mainz@web.de>, 2014
# Stefan Schantl <stefan.schantl@ipfire.org>, 2014
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 16:04+0000\n"
-"Last-Translator: Stefan Schantl <stefan.schantl@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-07 15:02+0000\n"
+"Last-Translator: Peter Cloudstone <rmg-mainz@web.de>\n"
"Language-Team: German (http://www.transifex.com/projects/p/ipfire/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr "OK"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr "Abbrechen"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr "Ich akzeptiere die Lizenz"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Warnung: Automatische Installation startet in 10 Sekunden..."
+
+#: main.c:403
msgid "Language selection"
msgstr "Sprachauswahl"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr "Wählen Sie die gewünschte Sprache für den Installationsprozess aus."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Automatikmodus"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr "<Tab>/<Alt-Tab> um zu wechseln | <Leertaste> wählt aus | <F12> nächster Bildschirm"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr "Willkommen zum %s Installationsprogramm.\n\nWenn Sie auf irgendeiner der folgenden Seiten 'Abbrechen' auswählen, wird der Computer neu gestartet."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr "Installation beginnen"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr "Kein lokales Quellmedium gefunden. Starte Download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Der Installer versucht nun, das Installationsimage herunterzuladen."
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "Kein Quelllaufwerk gefunden.\n\nBitte versuchen Sie, das erforderliche Installationsabbild herunterzuladen."
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Bitte stellen Sie sicher, dass der Computer mit einem Netzwerk verbunden ist, danach wird das Installationsprogramm versuchen, eine IP-Adresse zu erhalten."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Installationsabbild wird heruntergeladen"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Versuche, Netzwerk (DHCP) zu starten..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "Das Netzwerk konnte nicht gestartet werden, es ist aber für das Fortfahren erforderlich.\n\nBitte verbinden Sie den Computer mit einem Netzwerk mit DHCP und versuchen Sie es erneut."
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Erneut versuchen"
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr "Lade Installationsimage herunter..."
-#: main.c:342
-msgid "Download error"
-msgstr "Fehler beim Download"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "MD5-Prüfsummen stimmen nicht überein"
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "Das Installationsabbild konnte nicht heruntergeladen werden.\nGrund: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Konnte %s nicht auf %s mounten:\n%s\n"
+
+#: main.c:543
msgid "License Agreement"
msgstr "Lizenzvereinbarung"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr "Lizenz nicht akzeptiert!"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr "Es wurde keine Festplatte gefunden."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr "Festplattenauswahl"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr "Wählen Sie die Festplatte(n) auf denen IPFire installiert werden soll. Diese wird/werden zuerst partitioniert und danach mit einem Dateisystem ausgestattet.\n\nSÄMTLICHE DATEN AUF DER FESTPLATTE GEHEN VERLOREN."
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr "Keine Festplatte ausgewählt.\n\nBitte wählen Sie eine oder mehrere Festplatten auf denen IPFire installiert werden soll aus."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr "Das Installationsprogramm wird die folgende Festplatte nun vorbereiten:\n\n%s\n\nMöchten Sie damit fortfahren?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr "Disk-Setup"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr "Alle Daten löschen"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr "Das Installationsprogramm wird nun einen RAID Verbund auf den folgenden Festplatten erstellen:\n\n%s\n%s\n\nMöchten Sie damit fortfahren?"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr "RAID-Setup"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr "Die gewählte Festplattenkonstellation wird momentan nicht unterstützt."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr "Ihre Festplatte ist zu klein."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr "Die gewählte Festplatte ist sehr klein, die Installation kann aber ohne Swap Partition fortgesetzt werden."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr "ext4-Dateisystem"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr "ext4-Dateisystem ohne Journal"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr "XFS-Dateisystem"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr "ReiserFS-Dateisystem"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr "Dateisystemauswahl"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr "Bitte wählen Sie ein Dateisystem:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr "Erstelle RAID..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr "Das RAID konnte nicht erstellt werden."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr "Partitioniere die Festplatte..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr "Die Festplatte konnte nicht partitioniert werden."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr "Erstelle Dateisysteme..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr "Die Dateisysteme konnten nicht erstellt werden."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr "Die Dateisysteme konnten nicht eingehangen werden."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr "Installiere das System..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr "Das System konnte nicht installiert werden."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr "Installiere den Sprachdateicache..."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr "Der Sprachdateicache konnte nicht erstellt werden."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr "Installiere den Bootloader..."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr "/etc/default/grub konnte nicht geschrieben werden."
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr "Der Bootloader konnte nicht installiert werden."
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "Eine Sicherungskopie wurde auf dem Installationsmedium gefunden.\n\nMöchten Sie die Sicherungskopie wiederherstellen?"
+
+#: main.c:827
+msgid "Yes"
+msgstr "Ja"
+
+#: main.c:827
+msgid "No"
+msgstr "Nein"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Bei der Wiederherstellung der Sicherungskopie trat ein Fehler auf."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Führe Post-Installations-Skripte aus..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Post-Installations-Skript fehlgeschlagen."
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr "%s wurde erfolgreich installiert.\n\nEntfernen Sie bitte alle Installionsmedian aus dem Computer und drücken Sie den \"Neustarten\" Knopf . \n\nNach dem erfolgten Neustart wird das Setup-Programm gestartet, in dem Sie Netzwerkkarten und die Systempasswörter konfigurieren können. Sobald dies fertiggestellt ist, können Sie in Ihrem Webbrowser die Weboberfläche mit https://%s:444 (oder welchen Namen Sie Ihrem %s auch immer gegeben haben) erreichen."
+msgstr "%s wurde erfolgreich installiert.\n\nEntfernen Sie bitte alle Installionsmedien aus dem Computer und drücken Sie \"Neustarten\". \n\nNach dem erfolgten Neustart wird das Setup-Programm gestartet, in dem Sie Netzwerkkarten und die Systempasswörter konfigurieren können. Sobald dies fertiggestellt ist, können Sie in Ihrem Webbrowser die Weboberfläche über https://%s:444 (oder welchen Namen Sie Ihrem %s auch immer gegeben haben) erreichen."
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr "Herzlichen Glückwunsch!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr "Neustarten"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr "Installation fehlgeschlagen. Drücken Sie \"OK\" für einen Neustart des Systems."
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Greek (Greece) (http://www.transifex.com/projects/p/ipfire/language/el_GR/)\n"
"MIME-Version: 1.0\n"
"Language: el_GR\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Roberto Peña <roberto.pena@northsecure.es>, 2015
+# Roberto Peña <roberto.pena@northsecure.es>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-02-01 09:23+0000\n"
+"Last-Translator: Roberto Peña <roberto.pena@northsecure.es>\n"
"Language-Team: Spanish (http://www.transifex.com/projects/p/ipfire/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
-msgstr ""
+msgstr "Ok"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
-msgstr ""
+msgstr "Cancelar"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
-msgstr ""
+msgstr "Acepto esta licencia"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Advertencia: La instalación desatendida comenzará en 10 segundos..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Selección de idioma"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "Seleccione el idioma que quiere que se use durante la instalación."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Modo desatendido"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> entre elementos | <Space> seleccionar | <F12> siguiente pantalla"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "Bienvenido al programa de instalación %s.\n\nAl seleccionar Cancelar en cualquiera de las siguientes pantallas se reiniciará el equipo."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
-msgstr ""
+msgstr "Comenzar la instalación"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr ""
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "El instalador no ha podido descargar la imagen de instalación."
-#: main.c:340
-msgid "Downloading installation image ..."
-msgstr ""
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "No se puede encontrar unidad de origen.\n\nPuede intentar descargar la imagen de instalación requerida."
-#: main.c:342
-msgid "Download error"
-msgstr ""
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Por favor, asegúrese de conectar el equipo a una red y el instalador intentará conectarse adquiriendo una dirección IP."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Descargando la imagen de instalación"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Intentando iniciar la red (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "La red no se pudo iniciar, pero es necesaria para continuar con la instalación.\n\nPor favor, conecte el equipo a una red con un servidor DHCP y vuelva a intentarlo."
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Reintentar"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Descargando la imagen de instalación..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "Discordancia suma de verificación MD5 "
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "La imagen de instalación no puede ser descargada.\nRazón: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "No se pudo montar %s to %s:\n%s\n"
-#: main.c:376
+#: main.c:543
msgid "License Agreement"
-msgstr ""
+msgstr "Contrato de licencia"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
-msgstr ""
+msgstr "Licencia no aceptada!"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
-msgstr ""
+msgstr "Disco duro no encontrado."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
-msgstr ""
+msgstr "Selección de disco"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
-msgstr ""
+msgstr "Seleccione el disco(s) donde quiere instalar IPFire. Primero deberán ser particionados y cuando tengan particiones, se les pondrá un sistema de archivos.\n\nTODOS LOS DATOS DEL DISCO SERÁN DESTRUIDOS."
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
-msgstr ""
+msgstr "No se ha seleccionado un disco.\n\nPor favor, seleccione uno o más discos donde quiere que se instale IPFire."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "El programa de instalación preparará ahora los discos elegidos:\n\n%s\n\nQuiere continuar?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
-msgstr ""
+msgstr "Disco de instalación"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
-msgstr ""
+msgstr "Borrar todos los datos"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "El programa de instalación establecerá ahora una configuración RAID en los discos duros seleccionados:\n\n%s\n%s\n\nEstá de acuerdo con continuar?"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
-msgstr ""
+msgstr "Configuración RAID"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
-msgstr ""
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "Su configuración del disco no es compatible actualmente."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
-msgstr ""
+msgstr "Su disco duro es demasiado pequeño."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Su disco duro es muy pequeño, pero se puede continuar sin una partición de intercambio."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
-msgstr ""
+msgstr "Sistema de archivos ext4"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
-msgstr ""
+msgstr "Sistema de archivos ext4 sin diario"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
-msgstr ""
+msgstr "Sistema de archivos XFS"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
-msgstr ""
+msgstr "Sistema de archivos ReiserFS"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
-msgstr ""
+msgstr "Selección del sistema de archivos"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
-msgstr ""
+msgstr "Por favor, seleccione su sistema de archivos:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
-msgstr ""
+msgstr "Construyendo RAID."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
-msgstr ""
+msgstr "No se ha podido construir el RAID."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
-msgstr ""
+msgstr "Particionando disco..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
-msgstr ""
+msgstr "No se ha podido particionar el disco."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
-msgstr ""
+msgstr "Creando el sistema de archivos..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
-msgstr ""
+msgstr "No se ha podido crear el sistema de archivos."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
-msgstr ""
+msgstr "No se ha podido montar el sistema de archivos."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
-msgstr ""
+msgstr "Instalando el sistema..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
-msgstr ""
+msgstr "No se ha podido instalar el sistema."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
-msgstr ""
+msgstr "Instalando la caché del idioma..."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
-msgstr ""
+msgstr "No se ha podido instalar la caché del idioma."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
-msgstr ""
+msgstr "Instalando el bootloader..."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "No se ha podido abrir /etc/default/grub para escritura."
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
-msgstr ""
+msgstr "No se ha podido instalar el bootloader."
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "La imagen de instalación ha encontrado una copia de seguridad.\n\n¿Quiere restaurar la copia de seguridad?"
-#: main.c:666
+#: main.c:827
+msgid "Yes"
+msgstr "Sí"
+
+#: main.c:827
+msgid "No"
+msgstr "No"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Se produjo un error cuando se restauró el archivo de copia de seguridad."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Ejecutando post-script de instalación..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Ha fallado el Post-script de instalación."
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr ""
+msgstr "%s fue instalado con éxito!\n\nPor favor, quite cualquier medio de instalación de este sistema y pulse el botón de reinicio. Una vez reiniciado el sistema, se le pedirá configurar la red y el sistema de contraseñas. Después de eso, para acceder a la consola de configuración, deberá introducir en su navegador web https://%s:444 (o cual sea el nombre de su %s)."
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
-msgstr ""
+msgstr "¡Enhorabuena!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
-msgstr ""
+msgstr "Reiniciar"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "La instalación ha fallado. Pulse Aceptar para reiniciar."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
-# Khalil Delavaran <khalil.delavaran@gmail.com>, 2014
+# Khalil Delavaran <khalil.delavaran@gmail.com>, 2014-2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-02-17 23:49+0000\n"
+"Last-Translator: Khalil Delavaran <khalil.delavaran@gmail.com>\n"
"Language-Team: Persian (http://www.transifex.com/projects/p/ipfire/language/fa/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: fa\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr "بله"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr "نمی خواهم"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr "من این پروانه را می پذیرم."
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "گوشزد: برپاسازی خودکار تا 10 ثانیه دیگر شروع می شود..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "گزینش زبان"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "گزینش زبان شما برای بکارگیری در برپاسازی."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "حالت خودکار"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr "<Tab>/<Alt-Tab> میان عنصری | <Space> گزینش | <F12> برای برگه پسین"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "به برنامه برپا سازی %s خوش آمدید.\n\nبرای راه اندازی دوباره کامپیوتر، نمی خواهم را در هر صفحه ای می توانید گزینش کنید."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr "آغاز برپا سازی"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr "هیچ رسانه محلی یافت نشد. دانلود آغاز شد."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "برنامه نصب تلاش خواهد کرد که ایمیج نصب را دانلود کند."
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "درایو منبع پیدا نشد.\n\nشما می توانید ایمیج مورد نیاز نصب را دانلود کنید. "
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "لطفا مطمئن شوید که دستگاه شما به شبکه متصل است و برنامه نصب برای بدست آوردن IP تلاش خواهد کرد."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "دانلود ایمیج برپاسازی"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "تلاش برای شروع شبکه (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "شبکه نمی تواند شروع کند، و رفتن به نصب ضروری می باشد.\n\nخواهشمند است سیستم را به یک شبکه با DHCP سرور وصل کرده و دوباره تلاش کنید."
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "دوباره"
+
+#: main.c:501
+msgid "Downloading installation image..."
msgstr "در حال دانلود ایمیج برای برپا سازی..."
-#: main.c:342
-msgid "Download error"
-msgstr "ایراد در دانلود"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "ناهماهنگی در کنرل جمعی MD5"
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "ایمیج برپاسازی را نمی توان دانلود کرد.\nزیرا: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "نمی توان %s را به %s مونت کرد:\n%s\n"
-#: main.c:376
+#: main.c:543
msgid "License Agreement"
-msgstr ""
+msgstr "موافقنامه"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr "پروانه پذیرفته نشد!"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr "هارد دیسک یافت نشد."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr "گزینش دیسک"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr "دیسک (های) را برای برپاسازی IPFire گزینش کنید. نخست آنها را پارنیشین بندی کرده، و سپس، سیستم فایلی برای پارتیشن ها برگزینید.\n\nهمه داده های دیسک پاک می شوند."
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr "هیچ دیسکی گزینش نشده است.\n\nخواهشمند است یک دیسک یا بیشتر را برای برپا سازی IPFire گزینش کنید."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr "آماده سازی دیسک سخت برای برپا سازی برنامه :\n\n%s\n\nآیا شما گرایش به ادامه دارید؟"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr "پیکربندی دیسک"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr "پاک کردن همه داده ها"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr "پیکربندی RAID بر روی هارد دیسکهای گزینش شده برای برپا سازی برنامه\n\n%s\n%s\n\nآیا شما گرایش به ادامه دارید؟"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr "پیکربندی RAID"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr "پیکربندی دیسک شما پشتیبانی نمی شود."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr "هارد دیسک شما بسیار کوچک است."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "هارد دیسک شما بسیار کوچک است، ولی می توانید بدون ساخت swap پارتیشن ادامه دهید."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr "فایل سیستم ext4"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr "سیستم فایل ext4 بدون روزنامه"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr "فایل سیستم XFS"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr "فایل سیستم RaiserFS"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr "گزینش فایل سیستم"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr "خواهشمند است فایل سیستم خود را گزینش کنید:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr "ساخت RAID..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr "ناتوانی در ساخت RAID."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr "پارتیشن بندی دیسک..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr "ناتوانی در پارتیشین بندی دیسک."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr "ساخت سیستم فایل..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr "ناتوانی در ساخت سیستم فایل."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr "ناتوانی در مونت کردن سیستم فایل."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr "برپا سازی سیستم..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr "ناتوانی در برپاسازی سیستم."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr "در حال برپا سازی کش زبان..."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr "ناتوانی در برپا سازی کش زبان."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr "برپا سازی بوت لودر..."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "نمی توان /etc/default/grub را برای ویرایش باز کرد."
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr "ناتوانی در برپا سازی بوت لودر."
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "یک فایل بک آپ در ایمیج نصب پیدا شد.\n\nآیا می خواهید بک آپ را بازیابی کنید؟"
+
+#: main.c:827
+msgid "Yes"
+msgstr "بله"
+
+#: main.c:827
+msgid "No"
+msgstr "خیر"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "در هنگامه بازیابی فایل بک آپ شکستی رخ داده است."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "اجرای اسکریپت پس از نصب ..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "اسکریپت پس از نصب شکست خورد."
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr ""
+msgstr "%s برپا سازی شده است!\n\nخواهشمند است هر برپاسازی میانه ای از سیستم را پاک کنید و دکمه ریبوت را بزنید. پس از یک بار ریستارت سیستم، شما به پرسش های پیکربندی شبکه و گذر واژه سیستم پاسخ دهید. سپس برای پیکربندی پیشخوان وب، باید در مرورگر خود آدرس https://%s:444 (یا هر نامیکه گزینشی شما %s )را بنویسید."
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr "شادباش می گوییم!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr "ریبوت"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "برپا سازی شکست خورد. برای راه اندازی دوباره بلی را فشار دهید."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# nonux <nonux@free.fr>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-02-17 23:23+0000\n"
+"Last-Translator: nonux <nonux@free.fr>\n"
"Language-Team: French (http://www.transifex.com/projects/p/ipfire/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
-msgstr ""
+msgstr "Annuler"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
+msgstr "J'accepte la licence"
+
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Sélection de la langue"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
+msgstr "Sélectionnez la langue que vous souhaitez utiliser pour l'installation."
+
+#: main.c:418
+msgid "Unattended mode"
msgstr ""
-#: main.c:323
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
+msgstr "Démarrer l'installation"
+
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Le programme d'installation va maintenant essayer de télécharger l'image d'installation."
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:460
+msgid "Download installation image"
+msgstr "Télécharger l'image d'installation"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Tente de démarrer le réseau (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Ré-essayer"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Téléchargement de l'image d'installation ..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
-msgid "License Agreement"
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
msgstr ""
-#: main.c:377
-msgid "License not accepted!"
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
msgstr ""
-#: main.c:399
+#: main.c:543
+msgid "License Agreement"
+msgstr "Contrat de licence"
+
+#: main.c:544
+msgid "License not accepted!"
+msgstr "Contrat de licence non accepté!"
+
+#: main.c:566
msgid "No hard disk found."
-msgstr ""
+msgstr "Aucun disque dur trouvé."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
-msgstr ""
+msgstr "Sélection du disque"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
-msgstr ""
+msgstr "Configuration du disque"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
-msgstr ""
+msgstr "Supprime toutes les données"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
-msgstr ""
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "La configuration du disque n'est pas actuellement supportée."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
-msgstr ""
+msgstr "Votre disque dur est trop petit."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Votre disque dur est très petit, mais vous pouvez continuer sans la partition d'échange."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
-msgstr ""
+msgstr "Système de fichier ext4"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
-msgstr ""
+msgstr "Système de fichier ext4 sans journalisation"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
-msgstr ""
+msgstr "Système de fichier XFS"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
-msgstr ""
+msgstr "Système de fichier ReiserFS"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
-msgstr ""
+msgstr "Choix du système de fichier"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
-msgstr ""
+msgstr "Merci de choisir votre système de fichier : "
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
-msgstr ""
+msgstr "Contruction du RAID..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
-msgstr ""
+msgstr "Impossible de construire le RAID."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
-msgstr ""
+msgstr "Partitionnement du disque..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
-msgstr ""
+msgstr "Impossible de partitionner le disque."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
-msgstr ""
+msgstr "Création des systèmes de fichiers"
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
-msgstr ""
+msgstr "Impossible de créer les systèmes de fichiers."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
-msgstr ""
+msgstr "Impossible de monter les systèmes de fichiers."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
-msgstr ""
+msgstr "Installation du système..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
-msgstr ""
+msgstr "Impossible d'installer le système."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr "Oui"
+
+#: main.c:827
+msgid "No"
+msgstr "Non"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
-msgstr ""
+msgstr "Re-démarrer"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "La configuration a échoué. Appuyez sur OK pour re-démarrer."
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-01-26 12:07+0000\n"
+"Last-Translator: Blago Culjak <blago.culjak@hotmail.com>\n"
+"Language-Team: Croatian (http://www.transifex.com/projects/p/ipfire/language/hr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: hr\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
+msgid "OK"
+msgstr "OK"
+
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
+msgid "Cancel"
+msgstr "Otkazati"
+
+#: main.c:176
+msgid "I accept this license"
+msgstr "Prihvaćam ovu licencu"
+
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Upozoranje: Nenadgledana instalacija će započeti za 10 sekundi..."
+
+#: main.c:403
+msgid "Language selection"
+msgstr "Odabir jezika"
+
+#: main.c:403
+msgid "Select the language you wish to use for the installation."
+msgstr "Odaberite jezik koji želite koristiti za instalaciju."
+
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Nenadgledana instalacija"
+
+#: main.c:420
+msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
+msgstr "<Tab>/<Alt-Tab> Između odabira | <Space> Izaberi | <F12> Idući ekran"
+
+#: main.c:426
+#, c-format
+msgid ""
+"Welcome to the %s installation program.\n"
+"\n"
+"Selecting Cancel on any of the following screens will reboot the computer."
+msgstr "Dobrodošli u %s instalacijski programa..\n\nOdabirom Otkazati na bilo kojem od sljedećih ekranima će se ponovno pokrenuti računalo."
+
+#: main.c:428
+msgid "Start installation"
+msgstr "Pokrenite instalaciju"
+
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Instalacija će pokušati preuzeti instalacijsku sliku."
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "Izvorišni pogon nije pronađen.\n\nMožete pokušati preuzeti instalacijsku sliku."
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Provjerite da li ste priključeni na mrežu, instalacija će pokušati dobiti IP adresu."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Preuzimanje instalacijske slike"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Pokušaj starta mreže (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "Mreža nije mogla biti pokrenuta a obvezna je za nastavak instalacije. \n\nPriključite se na mrežu s omogućenim DHCPom i pokušajte ponovno."
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Ponovno"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Preuzimanje instalacijske slike"
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "MD5 checksum se ne podudara"
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "Instalacijska slika nije preuzeta.\n Razlog: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Nemogu monitari %s na %s:\n %s\n"
+
+#: main.c:543
+msgid "License Agreement"
+msgstr "Ugovor o licenci"
+
+#: main.c:544
+msgid "License not accepted!"
+msgstr "Licenca nije prihvaćena!"
+
+#: main.c:566
+msgid "No hard disk found."
+msgstr "Tvrdi disk nije pronađen."
+
+#: main.c:587
+msgid "Disk Selection"
+msgstr "Izbor diska"
+
+#: main.c:588
+msgid ""
+"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
+"\n"
+"ALL DATA ON THE DISK WILL BE DESTROYED."
+msgstr "Odaberite disk(ove) na koje želite instalirati IPFire. Prvo će biti podijeljeni, a zatim particije će se datotečni sustav staviti na njih.\n\nSVI PODACI NA DISKU ĆE BITI UNIŠTENI!"
+
+#: main.c:599
+msgid ""
+"No disk has been selected.\n"
+"\n"
+"Please select one or more disks you want to install IPFire on."
+msgstr "Disk nije izabran. \n\nOdaberite jedan ili više diskova na koje želite instalirati na IPFire."
+
+#: main.c:617
+#, c-format
+msgid ""
+"The installation program will now prepare the chosen harddisk:\n"
+"\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr "Instalacijski program će sada pripremiti odabrani tvrdi disk:\n\n %s\n\nSlažete li da nastavimo?"
+
+#: main.c:619
+msgid "Disk Setup"
+msgstr "Postavke diska"
+
+#: main.c:620 main.c:630
+msgid "Delete all data"
+msgstr "Izbriši sve podatke"
+
+#: main.c:627
+#, c-format
+msgid ""
+"The installation program will now set up a RAID configuration on the selected harddisks:\n"
+"\n"
+" %s\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr "Instalacijski program će se sada postaviti RAID konfiguraciju na odabranim tvrdim diskovima:\n\n %s\n %s\n\nSlažete li da nastavimo?"
+
+#: main.c:629
+msgid "RAID Setup"
+msgstr "Postavljanje RAIDa"
+
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "Vaša diskovna konfiguracija nije podržana."
+
+#: main.c:655
+msgid "Your harddisk is too small."
+msgstr "Vaš tvrdi disk je premali."
+
+#: main.c:671
+msgid ""
+"Your harddisk is very small, but you can continue without a swap partition."
+msgstr "Vaš tvrdi disk je dosta mali, ali možete nastaviti bez swap particije."
+
+#: main.c:684
+msgid "ext4 Filesystem"
+msgstr "ext4 datotečni sustav"
+
+#: main.c:685
+msgid "ext4 Filesystem without journal"
+msgstr "ext4 datotečni sustav bez journal-a"
+
+#: main.c:686
+msgid "XFS Filesystem"
+msgstr "XFS datotečni sustav"
+
+#: main.c:687
+msgid "ReiserFS Filesystem"
+msgstr "ReiserFS datotečni sustav"
+
+#: main.c:701
+msgid "Filesystem Selection"
+msgstr "Izabir datotečnog sustava"
+
+#: main.c:701
+msgid "Please choose your filesystem:"
+msgstr "Molimo odaberite svoj datotečni sustav:"
+
+#: main.c:712
+msgid "Building RAID..."
+msgstr "Izgradnja RAIDa..."
+
+#: main.c:716
+msgid "Unable to build the RAID."
+msgstr "Nije moguće izgraditi RAID."
+
+#: main.c:728
+msgid "Partitioning disk..."
+msgstr "Particioniranje diska ..."
+
+#: main.c:732
+msgid "Unable to partition the disk."
+msgstr "Nije moguće particionirati disk."
+
+#: main.c:739
+msgid "Creating filesystems..."
+msgstr "Izrada datotečnog sustava ..."
+
+#: main.c:743
+msgid "Unable to create filesystems."
+msgstr "Nije moguće stvoriti datotečni sustav."
+
+#: main.c:749
+msgid "Unable to mount filesystems."
+msgstr "Nije moguće montirati datotečni sustav."
+
+#: main.c:760
+msgid "Installing the system..."
+msgstr "Instaliranje sustava..."
+
+#: main.c:761
+msgid "Unable to install the system."
+msgstr "Nije moguće instalirati sustav."
+
+#: main.c:777
+msgid "Installing the language cache..."
+msgstr "Instaliranje cache-a jezika..."
+
+#: main.c:778
+msgid "Unable to install the language cache."
+msgstr "Nije moguće instalirati cache jezika."
+
+#: main.c:783
+msgid "Installing the bootloader..."
+msgstr "Instaliranje bootloadera..."
+
+#: main.c:790
+msgid "Unable to open /etc/default/grub for writing."
+msgstr "Ne mogu otvoriti /etc/default/grub grub za pisanje."
+
+#: main.c:812
+msgid "Unable to install the bootloader."
+msgstr "Nije moguće instalirati bootloader."
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "Pričuvna kopija je pronađena na instalacijskoj slici.\n\nDa li želite povratiti kopiju?"
+
+#: main.c:827
+msgid "Yes"
+msgstr "Da"
+
+#: main.c:827
+msgid "No"
+msgstr "Ne"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Greška pri povratu pričuvne kopije."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Izvodim post-instalacijske skripte."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Post-instalacijske skripte nisu uspješno izvršene."
+
+#: main.c:877
+#, c-format
+msgid ""
+"%s was successfully installed!\n"
+"\n"
+"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
+msgstr "%s uspješno je instaliran!\n\nMolimo uklonite sve instalacijske medije iz tog sustava i pritisnite gumb ponovno podizanje sustava. Nakon što je sustav ponovno podigne, od vas će biti zatraženo postavljanje mreže i lozinke sustava. Nakon toga, trebali usmjerite svoj web preglednik nahttps://%s:444 (ili koje god ste nazvali vaš %s) za postavke preko weba."
+
+#: main.c:882
+msgid "Congratulations!"
+msgstr "Čestitamo!"
+
+#: main.c:882
+msgid "Reboot"
+msgstr "Ponovno pokretanje"
+
+#: main.c:893
+msgid "Setup has failed. Press Ok to reboot."
+msgstr "Postavljanje nije uspjelo. Pritisnite OK za ponovno podizanje sustava."
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Hungarian (http://www.transifex.com/projects/p/ipfire/language/hu/)\n"
"MIME-Version: 1.0\n"
"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Indonesian (http://www.transifex.com/projects/p/ipfire/language/id/)\n"
"MIME-Version: 1.0\n"
"Language: id\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Gabriele, 2014
+# luX <lucianocataldo@gmail.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-12-06 18:41+0000\n"
+"Last-Translator: Gabriele\n"
"Language-Team: Italian (http://www.transifex.com/projects/p/ipfire/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
-msgstr ""
+msgstr "OK"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
-msgstr ""
+msgstr "Annulla"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
-msgstr ""
+msgstr "Accetto questa licenza"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Attenzione: L'installazione automatica inizierà tra 10 secondi..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Scelta della lingua"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "Selezionare la lingua che si desidera utilizzare per l'installazione."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Modalità automatico"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> tra elementi | <Space> seleziona | <F12> schermata successiva"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "Benvenuti nel programma di installazione %s.\n\nSelezionando Annulla su una delle seguenti schermate si riavvia il computer."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
-msgstr ""
+msgstr "Avvio installazione"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr ""
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Il programma di installazione proverà ora a scaricare l'immagine di installazione."
-#: main.c:340
-msgid "Downloading installation image ..."
-msgstr ""
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "Nessuna unità di origine trovata.\n\nPuoi provare a scaricare l'immagine d'installazione richiesta."
-#: main.c:342
-msgid "Download error"
-msgstr ""
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Per piacere assicurati di collegare il tuo computer ad una rete e il programma d'installazione proverà ad acquisire un indirizzo IP."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Scaricamento immagine d'installazione"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Provo ad avviare la rete (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "Non è stato possibile avviare la rete, ma è richiesto per continuare l'installazione.\n\nPer piacere collega il tuo computer ad una rete con un server DHCP e riprova."
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Riprova"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Scaricamento immagine di installazione..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "Checksum MD5 non corrispondente"
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "Non è stato possibile scaricare l'immagine di installazione.\nMotivo: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Impossibile montare %s su %s:\n %s\n"
-#: main.c:376
+#: main.c:543
msgid "License Agreement"
-msgstr ""
+msgstr "Contratto di licenza"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
-msgstr ""
+msgstr "Licenza non accettata!"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
-msgstr ""
+msgstr "Nessun Hard Disk trovato."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
-msgstr ""
+msgstr "Selezione disco"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
-msgstr ""
+msgstr "Selezionare il disco su cui si desidera installare IPFire. In primo luogo verrà partizionato, e quindi le partizioni avranno un filesystem.\n\nTUTTI I DATI SUL DISCO VERRANNO DISTRUTTI."
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
-msgstr ""
+msgstr "Non è stato selezionato alcun disco.\n\nSi prega di selezionare uno o più dischi su cui si desidera installare IPFire."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Il programma di installazione preparerà l'hard disk prescelto.\n\n%s\n\nSiete d'accordo di continuare?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
-msgstr ""
+msgstr "Disco di Installazione"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
-msgstr ""
+msgstr "Elimina tutti i dati"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Il programma di installazione configurerà il RAID sul hard disk selezionato:\n\n%s\n%s\n\nSiete d'accordo di continuare?"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
-msgstr ""
+msgstr "Installazione RAID"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
-msgstr ""
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "La tua configurazione disco non è attualmente supportata."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
-msgstr ""
+msgstr "Il disco rigido è troppo piccolo."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Il disco rigido è molto piccolo, ma puoi continuare senza una partizione di swap."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
-msgstr ""
+msgstr "Filesystem ext4"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
-msgstr ""
+msgstr "ext4 Filesystem senza journal"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
-msgstr ""
+msgstr "Filesystem XFS"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
-msgstr ""
+msgstr "Filesystem ReiserFS"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
-msgstr ""
+msgstr "Selezione del filesystem"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
-msgstr ""
+msgstr "Scegliere il filesystem:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
-msgstr ""
+msgstr "Costruzione RAID..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
-msgstr ""
+msgstr "Impossibile generare il RAID."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
-msgstr ""
+msgstr "Partizionamento del disco..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
-msgstr ""
+msgstr "Impossibile partizionare il disco."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
-msgstr ""
+msgstr "Creazione filesystem..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
-msgstr ""
+msgstr "Impossibile creare il filesystem."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
-msgstr ""
+msgstr "Impossibile montare il filesystem."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
-msgstr ""
+msgstr "Installazione del sistema..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
-msgstr ""
+msgstr "Impossibile installare il sistema."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
-msgstr ""
+msgstr "Installazione della cache della lingua..."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
-msgstr ""
+msgstr "Impossibile installare la cache della lingua."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
-msgstr ""
+msgstr "Installazione del bootloader..."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "Impossibile aprire /etc/default/grub per la scrittura."
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
-msgstr ""
+msgstr "Impossibile installare il bootloader."
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "Un file di backup è stato trovato sull'immagine di installazione.\n\nVuoi ripristinare il backup?"
-#: main.c:666
+#: main.c:827
+msgid "Yes"
+msgstr "Sì"
+
+#: main.c:827
+msgid "No"
+msgstr "No"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Si è verificato un errore durante il ripristino del file di backup"
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Esecuzione degli script post-installazione..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Script post-installazione fallito."
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr ""
+msgstr "%s è stato installato con successo!\n\nSi prega di rimuovere eventuali supporti di installazione da questo sistema e premere il pulsante di riavvio. Una volta che il sistema è stato riavviato verrà chiesto di impostare le password di rete e di sistema.\nDopo di che, si dovrebbe puntare il browser web su https://%s:444 (o qualunque altro nome %s) per la console di configurazione web.\n "
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
-msgstr ""
+msgstr "Congratulazioni!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
-msgstr ""
+msgstr "Riavvio"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "Installazione non riuscita. Premere Ok per riavviare."
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Japanese (http://www.transifex.com/projects/p/ipfire/language/ja/)\n"
"MIME-Version: 1.0\n"
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-07-31 09:39+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Javanese (http://www.transifex.com/projects/p/ipfire/language/jv/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: jv\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
+msgid "OK"
+msgstr ""
+
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
+msgid "Cancel"
+msgstr ""
+
+#: main.c:176
+msgid "I accept this license"
+msgstr ""
+
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
+msgid "Language selection"
+msgstr ""
+
+#: main.c:403
+msgid "Select the language you wish to use for the installation."
+msgstr ""
+
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
+msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
+msgstr ""
+
+#: main.c:426
+#, c-format
+msgid ""
+"Welcome to the %s installation program.\n"
+"\n"
+"Selecting Cancel on any of the following screens will reboot the computer."
+msgstr ""
+
+#: main.c:428
+msgid "Start installation"
+msgstr ""
+
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr ""
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr ""
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr ""
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
+msgid "License Agreement"
+msgstr ""
+
+#: main.c:544
+msgid "License not accepted!"
+msgstr ""
+
+#: main.c:566
+msgid "No hard disk found."
+msgstr ""
+
+#: main.c:587
+msgid "Disk Selection"
+msgstr ""
+
+#: main.c:588
+msgid ""
+"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
+"\n"
+"ALL DATA ON THE DISK WILL BE DESTROYED."
+msgstr ""
+
+#: main.c:599
+msgid ""
+"No disk has been selected.\n"
+"\n"
+"Please select one or more disks you want to install IPFire on."
+msgstr ""
+
+#: main.c:617
+#, c-format
+msgid ""
+"The installation program will now prepare the chosen harddisk:\n"
+"\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr ""
+
+#: main.c:619
+msgid "Disk Setup"
+msgstr ""
+
+#: main.c:620 main.c:630
+msgid "Delete all data"
+msgstr ""
+
+#: main.c:627
+#, c-format
+msgid ""
+"The installation program will now set up a RAID configuration on the selected harddisks:\n"
+"\n"
+" %s\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr ""
+
+#: main.c:629
+msgid "RAID Setup"
+msgstr ""
+
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr ""
+
+#: main.c:655
+msgid "Your harddisk is too small."
+msgstr ""
+
+#: main.c:671
+msgid ""
+"Your harddisk is very small, but you can continue without a swap partition."
+msgstr ""
+
+#: main.c:684
+msgid "ext4 Filesystem"
+msgstr ""
+
+#: main.c:685
+msgid "ext4 Filesystem without journal"
+msgstr ""
+
+#: main.c:686
+msgid "XFS Filesystem"
+msgstr ""
+
+#: main.c:687
+msgid "ReiserFS Filesystem"
+msgstr ""
+
+#: main.c:701
+msgid "Filesystem Selection"
+msgstr ""
+
+#: main.c:701
+msgid "Please choose your filesystem:"
+msgstr ""
+
+#: main.c:712
+msgid "Building RAID..."
+msgstr ""
+
+#: main.c:716
+msgid "Unable to build the RAID."
+msgstr ""
+
+#: main.c:728
+msgid "Partitioning disk..."
+msgstr ""
+
+#: main.c:732
+msgid "Unable to partition the disk."
+msgstr ""
+
+#: main.c:739
+msgid "Creating filesystems..."
+msgstr ""
+
+#: main.c:743
+msgid "Unable to create filesystems."
+msgstr ""
+
+#: main.c:749
+msgid "Unable to mount filesystems."
+msgstr ""
+
+#: main.c:760
+msgid "Installing the system..."
+msgstr ""
+
+#: main.c:761
+msgid "Unable to install the system."
+msgstr ""
+
+#: main.c:777
+msgid "Installing the language cache..."
+msgstr ""
+
+#: main.c:778
+msgid "Unable to install the language cache."
+msgstr ""
+
+#: main.c:783
+msgid "Installing the bootloader..."
+msgstr ""
+
+#: main.c:790
+msgid "Unable to open /etc/default/grub for writing."
+msgstr ""
+
+#: main.c:812
+msgid "Unable to install the bootloader."
+msgstr ""
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
+#, c-format
+msgid ""
+"%s was successfully installed!\n"
+"\n"
+"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
+msgstr ""
+
+#: main.c:882
+msgid "Congratulations!"
+msgstr ""
+
+#: main.c:882
+msgid "Reboot"
+msgstr ""
+
+#: main.c:893
+msgid "Setup has failed. Press Ok to reboot."
+msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Khmer (Cambodia) (http://www.transifex.com/projects/p/ipfire/language/km_KH/)\n"
"MIME-Version: 1.0\n"
"Language: km_KH\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Jacques Hylkema <j.hylkema@intronics.nl>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-01-26 07:37+0000\n"
+"Last-Translator: Jacques Hylkema <j.hylkema@intronics.nl>\n"
"Language-Team: Dutch (http://www.transifex.com/projects/p/ipfire/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
-msgstr ""
+msgstr "Oke"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
-msgstr ""
+msgstr "Annuleren"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
-msgstr ""
+msgstr "Ik accepteer deze licentie"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Waarschuwing: Installatie zonder toezicht zal binnen 10 seconden starten..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Taal selectie"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "Selecteer de taal die je wil gebruiken voor de installatie."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Zonder toezicht modus"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> tussen onderdelen | <Space> selecteer | <F12> volgend scherm"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "Welkom bij het %s installatie programma.\n\nKiezen van Annuleren op een van de volgende schermen zal de computer opnieuw laten starten."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
-msgstr ""
+msgstr "Start installatie"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr ""
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Het installatie programma zal nu proberen het installatiebestand te downloaden."
-#: main.c:340
-msgid "Downloading installation image ..."
-msgstr ""
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "Er kon geen bron-schijf worden gevonden.\n\nJe kan proberen het benodigde installatie bestand te downloaden."
-#: main.c:342
-msgid "Download error"
-msgstr ""
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Verbindt uw machine aan een netwerk en het installatie programma zal proberen een IP adres te verkrijgen."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Download installatie bestand"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Bezig met starten van het netwerk (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "Netwerk kon niet worden gestart, maar is vereist om door te kunnen gaan met de installatie.\n\nKoppel je machine aan een netwerk met een DHCP server en probeer opnieuw."
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Opnieuw"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Bezig met downloaden van het installatie bestand..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "MD5 checksum verschil"
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "Het installatie bestand kon niet worden ge-download.\nReden: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Kon %s niet aankoppelen naar %s:\n%s\n"
-#: main.c:376
+#: main.c:543
msgid "License Agreement"
-msgstr ""
+msgstr "Licentie overeenkomst"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
-msgstr ""
+msgstr "Licentie niet geaccepteerd!"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
-msgstr ""
+msgstr "Geen harde schijf gevonden."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
-msgstr ""
+msgstr "Schijf selectie"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
-msgstr ""
+msgstr "Selecteer de schijf/schijven waarop je IPFire op wil installeren. Deze zullen eerst worden gepartitioneerd, waarna er een bestandssysteem op zal worden gezet.\n\nALLE HUIDIGE GEGEVENS OP DE SCHIJF ZULLEN WORDEN VERNIETIGD. "
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
-msgstr ""
+msgstr "Er is geen schijf geselecteerd.\n\nSelecteer een of meerdere schijven waarop je IPFire op wil installeren."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Het installatie programma zal nu de geselecteerde harde schijf voorbereiden:\n\n%s\n\nGa je ermee accoord om door te gaan?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
-msgstr ""
+msgstr "Schijf configuratie"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
-msgstr ""
+msgstr "Verwijder alle gegevens"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Het installatie programma zal nu een RAID configureren op de geselecteerde harde schijven:\n\n%s\n%s\n\nGa je ermee accoord om door te gaan?"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
-msgstr ""
+msgstr "RAID configuratie"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
-msgstr ""
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "Je schijf configuratie wordt momenteel niet ondersteund."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
-msgstr ""
+msgstr "Je harde schijf is te klein."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Je harde schijf is erg klein, maar je kan doorgaan zonder een swap partitie."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
-msgstr ""
+msgstr "ext4 bestandssysteem"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
-msgstr ""
+msgstr "ext4 bestandssysteem zonder journaal"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
-msgstr ""
+msgstr "XFS bestandssysteem"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
-msgstr ""
+msgstr "ReiserFS bestandssysteem"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
-msgstr ""
+msgstr "Bestandssysteem selectie"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
-msgstr ""
+msgstr "Kies uw bestandssysteem:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
-msgstr ""
+msgstr "Opbouwen RAID..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
-msgstr ""
+msgstr "Kon RAID niet opbouwen."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
-msgstr ""
+msgstr "Bezig met partitioneren van de schijf"
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
-msgstr ""
+msgstr "Kon schijf niet partitioneren."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
-msgstr ""
+msgstr "Bezig met creëren bestandssystemen"
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
-msgstr ""
+msgstr "Kon bestandssystemen niet creëren."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
-msgstr ""
+msgstr "Kon bestandssystemen niet aankoppelen."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
-msgstr ""
+msgstr "Bezig met de installatie van het systeem..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
-msgstr ""
+msgstr "Kon het systeem niet installeren."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
-msgstr ""
+msgstr "Bezig met installeren van de taal-cache..."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
-msgstr ""
+msgstr "Kon de taal-cache niet installeren."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
-msgstr ""
+msgstr "Bezig met installeren van de bootloader"
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "Kan /etc/default/grub niet openen met schrijfrechten"
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
-msgstr ""
+msgstr "Kon de bootloader niet installeren."
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "Er is een backup bestand gevonden op de installatie disk.\n\nWil je deze backup terugzetten?"
-#: main.c:666
+#: main.c:827
+msgid "Yes"
+msgstr "Ja"
+
+#: main.c:827
+msgid "No"
+msgstr "Nee"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Er is een fout opgetreden bij het terugzetten van de backup."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Uitvoeren post-install script..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Fout bij uitvoeren van Post-install script"
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr ""
+msgstr "%s was met succes geïnstalleerd!\n\nVerwijder de installatie disk en druk op de reboot knop. Nadat het systeem is herstart zal je worden gevraagd om het netwerk en systeem wachtwoorden in te stellen. Daarna moet je in je webbrowser navigeren naar https://%s:444 (of hoe je %s hebt genoemd) voor de web configuratie console."
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
-msgstr ""
+msgstr "Gefeliciteerd!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
-msgstr ""
+msgstr "Herstarten"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "Installatie is mislukt. Druk op OK om te herstarten."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# btelega <btelega@gmail.com>, 2014
+# Przemysław Karpeta <przemyslaw.karpeta@gmail.com>, 2014
+# Przemyslaw Zdroik <zdroyer@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-01-26 10:41+0000\n"
+"Last-Translator: Przemyslaw Zdroik <zdroyer@gmail.com>\n"
"Language-Team: Polish (http://www.transifex.com/projects/p/ipfire/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: pl\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
-msgstr ""
+msgstr "OK"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
-msgstr ""
+msgstr "Anuluj"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
-msgstr ""
+msgstr "Akceptuje licencje"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Ostrzeżenie: Zautomatyzowana instalacja zacznie się za 10 sekund..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Wybór języka"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "Wybierz język jaki chcesz użyć do tej instalacji."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Tryb zautomatyzowany"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> przełącza między pozycjami | <Space> wybiera | <F12> następny ekran"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "Witaj w instalatorze %s.\n\nWybranie Cancel na dowolnym z następnych ekranów spowoduje restart komputera."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
-msgstr ""
+msgstr "Rozpoczynam instalację"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr ""
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Instalator spróbuje teraz pobrać plik obrazu instalacji."
-#: main.c:340
-msgid "Downloading installation image ..."
-msgstr ""
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "Medium źródłowe nie zostało znalezione.\n\nMożesz spróbować pobrać wymagany plik obrazu instalacji."
-#: main.c:342
-msgid "Download error"
-msgstr ""
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Podłącz twój komputer do sieci a instalator spróbuje połączyć się by pobrać adres IP."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Pobierz pliku obrazu instalacji"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Próba uruchomienia sieci (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "Obsługa sieci, która jest wymagana do kontynuowania instalacji, nie mogła zostać uruchomiona \n\nPodłącz proszę twój komputer do sieci z działającym serwerem DHCP i Spróbuj ponownie."
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Spróbuj ponownie"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Pobieranie pliku obrazu instalacji..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "Niezgodność sumy kontrolnej MD5"
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "Plik obrazu instalacji nie został pobrany\nPrzyczyna: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Nie można zamontować %s w %s:\n%s \n"
-#: main.c:376
+#: main.c:543
msgid "License Agreement"
-msgstr ""
+msgstr "Umowa Licencyjna"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
-msgstr ""
+msgstr "Licencja nie została zaakceptowana !"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
-msgstr ""
+msgstr "Nie znaleziono twardego dysku."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
-msgstr ""
+msgstr "Wybór Dysku"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
-msgstr ""
+msgstr "Wybierz dysk(dyski), na którym ma zostać zainstalowany IPFire. Wybrane urządzenia zostaną podzielone na partycje, a na tych partycjach zostaną utworzone systemy plików. \n\nWSZYSTKIE ISTNIEJĄCE NA DYSKACH DANE ZOSTANĄ ZNISZCZONE."
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
-msgstr ""
+msgstr "Nie wybrano żadnego dysku.\n\nWybierz jeden lub więcej dysków, na których chesz zainstalować IPFire."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Instalator przygotuje teraz wybrany dysk twardy:\n\n %s\n\nCzy kontynuować ?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
-msgstr ""
+msgstr "Konfiguracja Dysku"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
-msgstr ""
+msgstr "Usuń wszystkie dane"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Instalator skonfiguruje teraz RAID na wybranych dyskach twardych:\n\n %s\n %s\n\nCzy kontynuować ?"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
-msgstr ""
+msgstr "Konfiguracja RAID"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
-msgstr ""
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "Twoja konfiguracja dysku nie jest aktualnie obsługiwana. "
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
-msgstr ""
+msgstr "Twój dysk twardy jest za mały"
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Dysk twardy jest bardzo mały, ale można kontynuować bez partycji swap."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
-msgstr ""
+msgstr "system plików ext4 "
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
-msgstr ""
+msgstr "system plików ext4 bez dziennika"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
-msgstr ""
+msgstr "XFS Filesystem"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
-msgstr ""
+msgstr "System plików ReiserFS"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
-msgstr ""
+msgstr "System plików został wybrany"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
-msgstr ""
+msgstr "Wybierz system plików:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
-msgstr ""
+msgstr "Tworzenie RAID ..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
-msgstr ""
+msgstr "Nie udało się utworzyć RAID."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
-msgstr ""
+msgstr "Partycjonowanie dysku..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
-msgstr ""
+msgstr "Partycjonowanie dysku niemożliwe."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
-msgstr ""
+msgstr "Tworzenie systemów plików..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
-msgstr ""
+msgstr "Nie można utworzyć systemów plików."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
-msgstr ""
+msgstr "Nie można zamontować systemów plików."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
-msgstr ""
+msgstr "Instalowanie systemu..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
-msgstr ""
+msgstr "Nie można zainstalować systemu."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
-msgstr ""
+msgstr "Instalacja pamięci podręcznej języków."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
-msgstr ""
+msgstr "Nie można zainstalować pamięci podręcznej języków."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
-msgstr ""
+msgstr "Instalacja programu rozruchowego..."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "Nie można otworzyć /etc/default/grub do zapisu."
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
-msgstr ""
+msgstr "Nie mogę zainstalować programu rozruchowego."
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "Plik kopii zapasowej został odnaleziony w obrazie instalacji.\n\nCzy chcesz przywrócić informację ze znalezionej kopii zapasowej? "
-#: main.c:666
+#: main.c:827
+msgid "Yes"
+msgstr "Tak"
+
+#: main.c:827
+msgid "No"
+msgstr "Nie"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Wystąpił błąd podczas przywracania pliku kopii zapasowej."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Działanie skryptu post-instalacyjnego..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Skrypt post-instalacyjny zawiódł."
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr ""
+msgstr "Instalacja %s zakończyła się sukcesem !\n\nProsze usunąć nośnik instalacyjny z systemu i wcisnąć przycisk restartu. Po restarcie systemu pojawi się prośba o skonfigurowanie sieci i ustawienie haseł systemowych. Następnie należy oworzyć w przeglądarce WWW adres https://%s:444 (lub inną nazwę, ktora została nadana %s), aby uzyskać dostęp do internetowej konsoli konfiguracyjnej."
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
-msgstr ""
+msgstr "Gratulacje!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
-msgstr ""
+msgstr "Uruchom ponownie"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "Konfiguracja nieudana. Wciśnij Ok, aby zrestartować."
#
# Translators:
# André Felipe Morro <andre@andremorro.com>, 2014
+# Evertton de Lima <e.everttonlima@gmail.com>, 2015
# Leandro Luquetti Basilio da Silva <leandroluquetti@gmail.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-02-16 23:04+0000\n"
+"Last-Translator: Evertton de Lima <e.everttonlima@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/ipfire/language/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr "Ok"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr "Cancelar"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr "Eu aceito esta licença"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Cuidado: A instalação irá iniciar em 10 segundos..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Seleção de idioma"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "Selecione o idioma que você deseja usar para a instalação."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Modo automático"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr "<Tab>/<Alt-Tab> entre os elementos | <Space> Selecione | <F12> próxima tela"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "Bem-vindo para o programa de instalação %s.\n\nSelecionando Cancelar em qualquer uma das telas seguintes irá reiniciar o computador."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr "Iniciar a instalação"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr "Nenhuma fonte de mídia local encontrada. Iniciando download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "O instalador irá tentar baixar a imagem de instalação agora."
-#: main.c:340
-msgid "Downloading installation image ..."
-msgstr "Baixando imagem de instalação ..."
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
-#: main.c:342
-msgid "Download error"
-msgstr "Erro de download"
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
-#: main.c:376
-msgid "License Agreement"
+#: main.c:460
+msgid "Download installation image"
+msgstr "Baixar imagem de instalação"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Tentando iniciar a rede (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "Rede não pode ser iniciado, mas é necessária para continuar a instalação.\n\nPor favor, conecte sua máquina a uma rede com servidor DHCP e reinicie."
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Tentar novamente"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Baixando imagem de instalação..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:377
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "A imagem de instalação não pode ser baixada.\nMotivo: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Não pode montar %s para %s:\n%s\n"
+
+#: main.c:543
+msgid "License Agreement"
+msgstr "Contrato de Licença"
+
+#: main.c:544
msgid "License not accepted!"
msgstr "Licença não aceita!"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr "Nenhum disco rígido foi encontrado."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr "Seleção de disco"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr "Selecione o disco(s) que deseja instalar o IPFire. Primeiramente o mesmo será particionado, e então, as partições terão um sistema de arquivos que você escolher. \n\nTODOS OS DADOS NO DISCO SERÃO DESTRUÍDOS."
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr "Nenhum disco foi selecionado.\n\nPor favor seleccione um ou mais discos que você deseja instalar o IPFire."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr "O programa de instalação irá agora preparar o disco rígido escolhido:\n\n%s \n\nVocê concorda em continuar?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr "Configuração de Discos"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr "Apagar todos os dados"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr "O programa de instalação ira agora definir uma configuração de RAID nos discos rígidos selecionados:\n\n%s\n%s\n \nVocê concorda continuar?"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr "Configuração de RAID"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr "Sua configuração de disco não é suportada atualmente."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr "Seu disco rígido é muito pequeno."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Seu disco rígido é muito pequeno, mas você pode continuar sem uma partição swap."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr "Sistema de arquivos ext4"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr "Sistema de arquivos ext4 sem journal"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr "Sistema de arquivos XFS"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr "Sistema de arquivos ReiserFS"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr "Seleção do sistema de arquivos"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr "Por favor, escolha o seu sistema de arquivos:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr "Construindo o RAID..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr "Não foi possível construir o RAID."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr "Particionando o disco..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr "Não foi possível particionar o disco."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr "Criando o sistema de arquivos..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr "Não foi possível criar sistemas de arquivos."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr "Não foi possível montar sistemas de arquivos."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr "Instalando o sistema..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr "Não é possível instalar o sistema."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr "Instalando o cache de linguagem..."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr "Não foi possível instalar o cache de linguagem."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr "Instalando o gerenciador de inicialização..."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "Não possível abrir /etc/default/grub para escrita."
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr "Não foi possível instalar o gerenciador de inicialização."
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "Uma cópia de segurança foi encontrada na imagem de instalação.\n\nVocê quer restaurar a cópia de segurança?"
+
+#: main.c:827
+msgid "Yes"
+msgstr "Sim"
+
+#: main.c:827
+msgid "No"
+msgstr "Não"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Um erro ocorreu enquanto a cópia de segurança foi restaurada."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Executando post-install script..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Post-install script falhou."
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr "Parabéns!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr "Reiniciar"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "Instalação falhou. Pressione Ok para reiniciar."
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Portuguese (Portugal) (http://www.transifex.com/projects/p/ipfire/language/pt_PT/)\n"
"MIME-Version: 1.0\n"
"Language: pt_PT\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/ipfire/language/ro_RO/)\n"
"MIME-Version: 1.0\n"
"Language: ro_RO\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# ellviss <kpe1501@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-02-24 12:56+0000\n"
+"Last-Translator: ellviss <kpe1501@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/projects/p/ipfire/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: ru\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
-msgstr ""
+msgstr "ОК"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
-msgstr ""
+msgstr "Отмена"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
-msgstr ""
+msgstr "Я Согласен с этой лицензией"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Внимание : запуск автоматической установки начнётся через 10 секунд ..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Выберите язык"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "Выберете язык для инсталяции"
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Автоматический режим"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> переход между элементами | <Space> выбор <F12> следующий экран"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "Добро пожаловать в установку %s .\n\nНажатие Отмены на любом из следующих экранах приведёт к перезагрузке."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
-msgstr ""
+msgstr "Начать установку"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr ""
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Установщик пробует скачать установочный образ"
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "Не найден источник\n\nВы можете скачать необходимый загрузочный образ"
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Убедитесь что компьютер подсоединён к сети и установщик может подключиться к запращиваемому ip адресу"
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Скачать образ установки"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Проверка запуска (DHCP)..."
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Повтор"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Скачивание образа установки..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "MD5 хеш не совпал"
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
msgstr ""
-#: main.c:376
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Не удалось подключить %s к %s:\n\n%s\n"
+
+#: main.c:543
msgid "License Agreement"
-msgstr ""
+msgstr "Лицензионное соглашение"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
-msgstr ""
+msgstr "Лицензия не принята"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
-msgstr ""
+msgstr "Не найдены жесткие диски"
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
-msgstr ""
+msgstr "Выберете диск"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Установочная программа настроит выбранный диск :\n\n%s\n\nВы согласны продолжить?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
-msgstr ""
+msgstr "Настройка диска"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
-msgstr ""
+msgstr "Удалить все данные"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
-msgstr ""
+msgstr "Настройка RAID"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
-msgstr ""
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "Конфигурация ваших дисков не поддерживается"
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
-msgstr ""
+msgstr "Ваш диск слишком мал"
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Ваш диск слишком мал, но вы можете продолжить без файла подкачки"
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
-msgstr ""
+msgstr "раздел ext4"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
-msgstr ""
+msgstr "журналируемый раздел ext4"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
-msgstr ""
+msgstr "раздел XFS"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
-msgstr ""
+msgstr "раздел ReiserFS"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
-msgstr ""
+msgstr "Выбор файловой системы"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
-msgstr ""
+msgstr "Пожалуйста, выберете тип файловой системы:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
-msgstr ""
+msgstr "Создание RAID...."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
-msgstr ""
+msgstr "Не возмозжно создать RAID"
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
-msgstr ""
+msgstr "Разбивка диска..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
-msgstr ""
+msgstr "Невозможно разбить диск"
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
-msgstr ""
+msgstr "Создание файловой системы..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
-msgstr ""
+msgstr "Не возможно создать раздел"
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
-msgstr ""
+msgstr "Невозможно присоединить раздел"
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
-msgstr ""
+msgstr "Установка системы ...."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
-msgstr ""
+msgstr "Невозможно установить систему"
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
-msgstr ""
+msgstr "Установка кеша языка...."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
-msgstr ""
+msgstr "Невозможно установить кеш языка"
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
-msgstr ""
+msgstr "Установка загрузчика....."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "Невозможно открыть /etc/default/grub на запись"
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
-msgstr ""
+msgstr "Невозможно установить загрузчик"
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "Файл восстановления был найдет на установочном носителе\n\nвы хотите восстановить ?"
+
+#: main.c:827
+msgid "Yes"
+msgstr "Да"
-#: main.c:666
+#: main.c:827
+msgid "No"
+msgstr "Нет"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Произошла ошибка при восстановлении из файла."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Выполняются пост-установочные скрипты..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Пост-установочный скрипт не сработал"
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr ""
+msgstr "%s успешно установлено!\n\nПожалуйста извлеките все установочные носители из системы и нажмите кнопку перезагрузки. После перезапуска система попросит установить системный и сетевой пароли. После этого вы можете зайти через браузер на https://%s:444 ( где %s - ваш адрес ) для конфигурирования системы через web"
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
-msgstr ""
+msgstr "Поздравляем!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
-msgstr ""
+msgstr "Перезагрузка"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "Установка не удалась. Нажмите ОК для перезапуска"
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
+"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"Language-Team: Kinyarwanda (http://www.transifex.com/projects/p/ipfire/language/rw/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: rw\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
+msgid "OK"
+msgstr ""
+
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
+msgid "Cancel"
+msgstr ""
+
+#: main.c:176
+msgid "I accept this license"
+msgstr ""
+
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
+msgid "Language selection"
+msgstr ""
+
+#: main.c:403
+msgid "Select the language you wish to use for the installation."
+msgstr ""
+
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
+msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
+msgstr ""
+
+#: main.c:426
+#, c-format
+msgid ""
+"Welcome to the %s installation program.\n"
+"\n"
+"Selecting Cancel on any of the following screens will reboot the computer."
+msgstr ""
+
+#: main.c:428
+msgid "Start installation"
+msgstr ""
+
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr ""
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr ""
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr ""
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
+msgid "License Agreement"
+msgstr ""
+
+#: main.c:544
+msgid "License not accepted!"
+msgstr ""
+
+#: main.c:566
+msgid "No hard disk found."
+msgstr ""
+
+#: main.c:587
+msgid "Disk Selection"
+msgstr ""
+
+#: main.c:588
+msgid ""
+"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
+"\n"
+"ALL DATA ON THE DISK WILL BE DESTROYED."
+msgstr ""
+
+#: main.c:599
+msgid ""
+"No disk has been selected.\n"
+"\n"
+"Please select one or more disks you want to install IPFire on."
+msgstr ""
+
+#: main.c:617
+#, c-format
+msgid ""
+"The installation program will now prepare the chosen harddisk:\n"
+"\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr ""
+
+#: main.c:619
+msgid "Disk Setup"
+msgstr ""
+
+#: main.c:620 main.c:630
+msgid "Delete all data"
+msgstr ""
+
+#: main.c:627
+#, c-format
+msgid ""
+"The installation program will now set up a RAID configuration on the selected harddisks:\n"
+"\n"
+" %s\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr ""
+
+#: main.c:629
+msgid "RAID Setup"
+msgstr ""
+
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr ""
+
+#: main.c:655
+msgid "Your harddisk is too small."
+msgstr ""
+
+#: main.c:671
+msgid ""
+"Your harddisk is very small, but you can continue without a swap partition."
+msgstr ""
+
+#: main.c:684
+msgid "ext4 Filesystem"
+msgstr ""
+
+#: main.c:685
+msgid "ext4 Filesystem without journal"
+msgstr ""
+
+#: main.c:686
+msgid "XFS Filesystem"
+msgstr ""
+
+#: main.c:687
+msgid "ReiserFS Filesystem"
+msgstr ""
+
+#: main.c:701
+msgid "Filesystem Selection"
+msgstr ""
+
+#: main.c:701
+msgid "Please choose your filesystem:"
+msgstr ""
+
+#: main.c:712
+msgid "Building RAID..."
+msgstr ""
+
+#: main.c:716
+msgid "Unable to build the RAID."
+msgstr ""
+
+#: main.c:728
+msgid "Partitioning disk..."
+msgstr ""
+
+#: main.c:732
+msgid "Unable to partition the disk."
+msgstr ""
+
+#: main.c:739
+msgid "Creating filesystems..."
+msgstr ""
+
+#: main.c:743
+msgid "Unable to create filesystems."
+msgstr ""
+
+#: main.c:749
+msgid "Unable to mount filesystems."
+msgstr ""
+
+#: main.c:760
+msgid "Installing the system..."
+msgstr ""
+
+#: main.c:761
+msgid "Unable to install the system."
+msgstr ""
+
+#: main.c:777
+msgid "Installing the language cache..."
+msgstr ""
+
+#: main.c:778
+msgid "Unable to install the language cache."
+msgstr ""
+
+#: main.c:783
+msgid "Installing the bootloader..."
+msgstr ""
+
+#: main.c:790
+msgid "Unable to open /etc/default/grub for writing."
+msgstr ""
+
+#: main.c:812
+msgid "Unable to install the bootloader."
+msgstr ""
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
+#, c-format
+msgid ""
+"%s was successfully installed!\n"
+"\n"
+"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
+msgstr ""
+
+#: main.c:882
+msgid "Congratulations!"
+msgstr ""
+
+#: main.c:882
+msgid "Reboot"
+msgstr ""
+
+#: main.c:893
+msgid "Setup has failed. Press Ok to reboot."
+msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Slovak (http://www.transifex.com/projects/p/ipfire/language/sk/)\n"
"MIME-Version: 1.0\n"
"Language: sk\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Albanian (http://www.transifex.com/projects/p/ipfire/language/sq/)\n"
"MIME-Version: 1.0\n"
"Language: sq\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-07-31 09:39+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Serbian (http://www.transifex.com/projects/p/ipfire/language/sr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: sr\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
+msgid "OK"
+msgstr ""
+
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
+msgid "Cancel"
+msgstr ""
+
+#: main.c:176
+msgid "I accept this license"
+msgstr ""
+
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
+msgid "Language selection"
+msgstr ""
+
+#: main.c:403
+msgid "Select the language you wish to use for the installation."
+msgstr ""
+
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
+msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
+msgstr ""
+
+#: main.c:426
+#, c-format
+msgid ""
+"Welcome to the %s installation program.\n"
+"\n"
+"Selecting Cancel on any of the following screens will reboot the computer."
+msgstr ""
+
+#: main.c:428
+msgid "Start installation"
+msgstr ""
+
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr ""
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr ""
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr ""
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
+msgid "License Agreement"
+msgstr ""
+
+#: main.c:544
+msgid "License not accepted!"
+msgstr ""
+
+#: main.c:566
+msgid "No hard disk found."
+msgstr ""
+
+#: main.c:587
+msgid "Disk Selection"
+msgstr ""
+
+#: main.c:588
+msgid ""
+"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
+"\n"
+"ALL DATA ON THE DISK WILL BE DESTROYED."
+msgstr ""
+
+#: main.c:599
+msgid ""
+"No disk has been selected.\n"
+"\n"
+"Please select one or more disks you want to install IPFire on."
+msgstr ""
+
+#: main.c:617
+#, c-format
+msgid ""
+"The installation program will now prepare the chosen harddisk:\n"
+"\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr ""
+
+#: main.c:619
+msgid "Disk Setup"
+msgstr ""
+
+#: main.c:620 main.c:630
+msgid "Delete all data"
+msgstr ""
+
+#: main.c:627
+#, c-format
+msgid ""
+"The installation program will now set up a RAID configuration on the selected harddisks:\n"
+"\n"
+" %s\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr ""
+
+#: main.c:629
+msgid "RAID Setup"
+msgstr ""
+
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr ""
+
+#: main.c:655
+msgid "Your harddisk is too small."
+msgstr ""
+
+#: main.c:671
+msgid ""
+"Your harddisk is very small, but you can continue without a swap partition."
+msgstr ""
+
+#: main.c:684
+msgid "ext4 Filesystem"
+msgstr ""
+
+#: main.c:685
+msgid "ext4 Filesystem without journal"
+msgstr ""
+
+#: main.c:686
+msgid "XFS Filesystem"
+msgstr ""
+
+#: main.c:687
+msgid "ReiserFS Filesystem"
+msgstr ""
+
+#: main.c:701
+msgid "Filesystem Selection"
+msgstr ""
+
+#: main.c:701
+msgid "Please choose your filesystem:"
+msgstr ""
+
+#: main.c:712
+msgid "Building RAID..."
+msgstr ""
+
+#: main.c:716
+msgid "Unable to build the RAID."
+msgstr ""
+
+#: main.c:728
+msgid "Partitioning disk..."
+msgstr ""
+
+#: main.c:732
+msgid "Unable to partition the disk."
+msgstr ""
+
+#: main.c:739
+msgid "Creating filesystems..."
+msgstr ""
+
+#: main.c:743
+msgid "Unable to create filesystems."
+msgstr ""
+
+#: main.c:749
+msgid "Unable to mount filesystems."
+msgstr ""
+
+#: main.c:760
+msgid "Installing the system..."
+msgstr ""
+
+#: main.c:761
+msgid "Unable to install the system."
+msgstr ""
+
+#: main.c:777
+msgid "Installing the language cache..."
+msgstr ""
+
+#: main.c:778
+msgid "Unable to install the language cache."
+msgstr ""
+
+#: main.c:783
+msgid "Installing the bootloader..."
+msgstr ""
+
+#: main.c:790
+msgid "Unable to open /etc/default/grub for writing."
+msgstr ""
+
+#: main.c:812
+msgid "Unable to install the bootloader."
+msgstr ""
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
+#, c-format
+msgid ""
+"%s was successfully installed!\n"
+"\n"
+"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
+msgstr ""
+
+#: main.c:882
+msgid "Congratulations!"
+msgstr ""
+
+#: main.c:882
+msgid "Reboot"
+msgstr ""
+
+#: main.c:893
+msgid "Setup has failed. Press Ok to reboot."
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-07-31 09:39+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Sundanese (http://www.transifex.com/projects/p/ipfire/language/su/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: su\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
+msgid "OK"
+msgstr ""
+
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
+msgid "Cancel"
+msgstr ""
+
+#: main.c:176
+msgid "I accept this license"
+msgstr ""
+
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
+msgid "Language selection"
+msgstr ""
+
+#: main.c:403
+msgid "Select the language you wish to use for the installation."
+msgstr ""
+
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
+msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
+msgstr ""
+
+#: main.c:426
+#, c-format
+msgid ""
+"Welcome to the %s installation program.\n"
+"\n"
+"Selecting Cancel on any of the following screens will reboot the computer."
+msgstr ""
+
+#: main.c:428
+msgid "Start installation"
+msgstr ""
+
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr ""
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr ""
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr ""
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
+msgid "License Agreement"
+msgstr ""
+
+#: main.c:544
+msgid "License not accepted!"
+msgstr ""
+
+#: main.c:566
+msgid "No hard disk found."
+msgstr ""
+
+#: main.c:587
+msgid "Disk Selection"
+msgstr ""
+
+#: main.c:588
+msgid ""
+"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
+"\n"
+"ALL DATA ON THE DISK WILL BE DESTROYED."
+msgstr ""
+
+#: main.c:599
+msgid ""
+"No disk has been selected.\n"
+"\n"
+"Please select one or more disks you want to install IPFire on."
+msgstr ""
+
+#: main.c:617
+#, c-format
+msgid ""
+"The installation program will now prepare the chosen harddisk:\n"
+"\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr ""
+
+#: main.c:619
+msgid "Disk Setup"
+msgstr ""
+
+#: main.c:620 main.c:630
+msgid "Delete all data"
+msgstr ""
+
+#: main.c:627
+#, c-format
+msgid ""
+"The installation program will now set up a RAID configuration on the selected harddisks:\n"
+"\n"
+" %s\n"
+" %s\n"
+"\n"
+"Do you agree to continue?"
+msgstr ""
+
+#: main.c:629
+msgid "RAID Setup"
+msgstr ""
+
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr ""
+
+#: main.c:655
+msgid "Your harddisk is too small."
+msgstr ""
+
+#: main.c:671
+msgid ""
+"Your harddisk is very small, but you can continue without a swap partition."
+msgstr ""
+
+#: main.c:684
+msgid "ext4 Filesystem"
+msgstr ""
+
+#: main.c:685
+msgid "ext4 Filesystem without journal"
+msgstr ""
+
+#: main.c:686
+msgid "XFS Filesystem"
+msgstr ""
+
+#: main.c:687
+msgid "ReiserFS Filesystem"
+msgstr ""
+
+#: main.c:701
+msgid "Filesystem Selection"
+msgstr ""
+
+#: main.c:701
+msgid "Please choose your filesystem:"
+msgstr ""
+
+#: main.c:712
+msgid "Building RAID..."
+msgstr ""
+
+#: main.c:716
+msgid "Unable to build the RAID."
+msgstr ""
+
+#: main.c:728
+msgid "Partitioning disk..."
+msgstr ""
+
+#: main.c:732
+msgid "Unable to partition the disk."
+msgstr ""
+
+#: main.c:739
+msgid "Creating filesystems..."
+msgstr ""
+
+#: main.c:743
+msgid "Unable to create filesystems."
+msgstr ""
+
+#: main.c:749
+msgid "Unable to mount filesystems."
+msgstr ""
+
+#: main.c:760
+msgid "Installing the system..."
+msgstr ""
+
+#: main.c:761
+msgid "Unable to install the system."
+msgstr ""
+
+#: main.c:777
+msgid "Installing the language cache..."
+msgstr ""
+
+#: main.c:778
+msgid "Unable to install the language cache."
+msgstr ""
+
+#: main.c:783
+msgid "Installing the bootloader..."
+msgstr ""
+
+#: main.c:790
+msgid "Unable to open /etc/default/grub for writing."
+msgstr ""
+
+#: main.c:812
+msgid "Unable to install the bootloader."
+msgstr ""
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
+#, c-format
+msgid ""
+"%s was successfully installed!\n"
+"\n"
+"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
+msgstr ""
+
+#: main.c:882
+msgid "Congratulations!"
+msgstr ""
+
+#: main.c:882
+msgid "Reboot"
+msgstr ""
+
+#: main.c:893
+msgid "Setup has failed. Press Ok to reboot."
+msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Swedish (http://www.transifex.com/projects/p/ipfire/language/sv/)\n"
"MIME-Version: 1.0\n"
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Thai (http://www.transifex.com/projects/p/ipfire/language/th/)\n"
"MIME-Version: 1.0\n"
"Language: th\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Turkmen (http://www.transifex.com/projects/p/ipfire/language/tk/)\n"
"MIME-Version: 1.0\n"
"Language: tk\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Ersan YILDIRIM <ersan73@gmail.com>, 2015
+# Kudret Emre <kudretemre@hotmail.com.tr>, 2014
+# Kudret Emre <kudretemre@hotmail.com.tr>, 2014
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2015-02-28 22:11+0000\n"
+"Last-Translator: Ersan YILDIRIM <ersan73@gmail.com>\n"
"Language-Team: Turkish (http://www.transifex.com/projects/p/ipfire/language/tr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: tr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
-msgstr ""
+msgstr "Tamam"
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
-msgstr ""
+msgstr "İptal"
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
-msgstr ""
+msgstr "Lisansı kabul ediyorum"
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr "Uyarı: Katılımsız kurulum 10 saniye içinde başlayacak..."
+
+#: main.c:403
msgid "Language selection"
-msgstr ""
+msgstr "Dil seçimi"
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
-msgstr ""
+msgstr "Yükleme için istediğiniz dili seçin."
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr "Katılımsız kurulum modu"
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> düğmeler arası geçiş | <Space> seç | <F12> sonraki ekran"
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"\n"
"Selecting Cancel on any of the following screens will reboot the computer."
-msgstr ""
+msgstr "%s kurulum programına hoş geldiniz.\n\nSonraki ekranların herhangi birinde İptal seçeneğini seçtiğinizde bilgisayar yeniden başlatılac."
-#: main.c:330
+#: main.c:428
msgid "Start installation"
-msgstr ""
+msgstr "Kurulumu Başlat"
-#: main.c:339
-msgid "No local source media found. Starting download."
-msgstr ""
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr "Yükleyici şimdi kurulum dosyasını indirmeyi deneyecek."
-#: main.c:340
-msgid "Downloading installation image ..."
-msgstr ""
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr "Hiçbir kaynak sürücüsü bulunamadı.\n\nGerekli kurulum dosyasını indirmeyi deneyebilirsiniz."
-#: main.c:342
-msgid "Download error"
-msgstr ""
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr "Makinenizi bir ağa bağladığınıza emin olun ve yükleyiciye IP adresini elle girerek bağlanmayı tekrar deneyin."
+
+#: main.c:460
+msgid "Download installation image"
+msgstr "Kurulum dosyasını indir"
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr "Ağa bağlanmaya çalışılıyor (DHCP)..."
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr "Yüklemenin devam etmesi için ağ bağlantısı gereklidir fakat başlatılamıyor.\n\nLütfen makinenizi bir DHCP sunucu ile ağa bağlayıp tekrar deneyin."
+
+#: main.c:487 main.c:516
+msgid "Retry"
+msgstr "Tekrar dene"
+
+#: main.c:501
+msgid "Downloading installation image..."
+msgstr "Yükleme dosyası indiriliyor..."
+
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
+msgstr "MD5 checksum uyuşmuyor"
+
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr "Yükleme dosyası indirilemedi.\nSebep: %s\n\n%s"
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr "Bağlanamadı: %s - %s:\n%s\n\n"
-#: main.c:376
+#: main.c:543
msgid "License Agreement"
-msgstr ""
+msgstr "Lisans Anlaşması"
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
-msgstr ""
+msgstr "Lisans kabul edilmedi!"
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
-msgstr ""
+msgstr "Sabit disk bulunamadı."
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
-msgstr ""
+msgstr "Disk Seçimi"
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
-msgstr ""
+msgstr "IPFire'ı yüklemek istediğiniz disk(ler)i seçin. Diskler önce bölümlenecek, sonra bölümlere dosya sistemi oluşturulacaktır.\n\nDİSKTEKİ TÜM VERİLER SİLİNECEKTİR."
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
-msgstr ""
+msgstr "Hiçbir disk seçilmedi.\n\nLütfen IPFire'ı yüklemek için bir veya daha fazla disk seçin."
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Yükleme programı şimdi seçilen diski hazırlayacak:\n\n%s\n\nDevam etmek istiyor musunuz?"
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
-msgstr ""
+msgstr "Disk Kurulumu"
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
-msgstr ""
+msgstr "Tüm Veriyi Sil"
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
" %s\n"
"\n"
"Do you agree to continue?"
-msgstr ""
+msgstr "Yükleme programı şimdi seçilen sabit disk üzerinde bir RAID yapılandırması kuracak:\n\n%s\n%s\n\nDevam etmek istiyor musunuz?"
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
-msgstr ""
+msgstr "RAID Kurulumu"
-#: main.c:466
-msgid "You disk configuration is currently not supported."
-msgstr ""
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
+msgstr "Disk yapılandırmanız desteklenmiyor."
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
-msgstr ""
+msgstr "Sabit diskiniz çok küçük."
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
-msgstr ""
+msgstr "Sabit diskiniz çok küçük, fakat takas bölümü olmadan devam edebilirsiniz."
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
-msgstr ""
+msgstr "ext4 Dosya sistemi"
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
-msgstr ""
+msgstr "ext4 Dosya sistemi - günlüksüz"
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
-msgstr ""
+msgstr "XFS Dosya sistemi"
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
-msgstr ""
+msgstr "ReiserFS Dosya sistemi"
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
-msgstr ""
+msgstr "Dosya Sistemi Seçimi"
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
-msgstr ""
+msgstr "Lütfen dosya sisteminizi seçin:"
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
-msgstr ""
+msgstr "RAID oluşturuluyor..."
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
-msgstr ""
+msgstr "RAID oluşturulamıyor."
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
-msgstr ""
+msgstr "Disk bölümleniyor..."
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
-msgstr ""
+msgstr "Disk bölümlendirilemiyor."
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
-msgstr ""
+msgstr "Dosya sistemleri oluşturuluyor..."
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
-msgstr ""
+msgstr "Dosya sistemleri oluşturulamıyor."
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
-msgstr ""
+msgstr "Dosya sistemleri bağlanamıyor."
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
-msgstr ""
+msgstr "Sistem yükleniyor..."
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
-msgstr ""
+msgstr "Sistem yüklenemiyor."
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
-msgstr ""
+msgstr "Dil ön blleği yükleniyor..."
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
-msgstr ""
+msgstr "Dil ön belleği yüklenemiyor."
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
-msgstr ""
+msgstr "bootloader yükleniyor..."
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
-msgstr ""
+msgstr "/etc/default/grub yazma işlemi için açılamıyor."
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
-msgstr ""
+msgstr "bootloader yüklenemiyor."
+
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr "Kurulum dosyasında bir yedek dosyası bulundu.\n\nYedeği geri yüklemek ister misiniz?"
-#: main.c:666
+#: main.c:827
+msgid "Yes"
+msgstr "Evet"
+
+#: main.c:827
+msgid "No"
+msgstr "Hayır"
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr "Yedek dosyası geri yüklenirken bir hata oluştu."
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr "Post-install betiği çalıştırılıyor..."
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr "Post-install betiği başarısız oldu."
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
-msgstr ""
+msgstr "%s başarıyla yüklendi!\n\nLütfen yükleme ortamını sistemden çıkarın ve Yeniden Başlat düğmesine tıklayın. Sistem yeniden başlatıldığında ağ kartları, ağ ve sistem parolalarını yapılandırabileceğiniz programı çalıştıracaktır. Kurulum tamamlandıktan sonra bir internet tarayıcısı açıp yapılandırma sayfasına gitmek için adres satırına https://%s:444 (veya %s yerine ne ad verdiyseniz) adresini girin."
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
-msgstr ""
+msgstr "Tebrikler!"
-#: main.c:671
+#: main.c:882
msgid "Reboot"
-msgstr ""
+msgstr "Yeniden Başlat"
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
-msgstr ""
+msgstr "Kurulum başarısız oldu. Yeniden başlatmak için Tamam düğmesine basın."
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Ukrainian (http://www.transifex.com/projects/p/ipfire/language/uk/)\n"
"MIME-Version: 1.0\n"
"Language: uk\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Uzbek (Latin) (http://www.transifex.com/projects/p/ipfire/language/uz@Latn/)\n"
"MIME-Version: 1.0\n"
"Language: uz@Latn\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Vietnamese (http://www.transifex.com/projects/p/ipfire/language/vi/)\n"
"MIME-Version: 1.0\n"
"Language: vi\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-21 15:09+0000\n"
-"PO-Revision-Date: 2014-08-21 15:11+0000\n"
+"POT-Creation-Date: 2014-11-05 01:29+0000\n"
+"PO-Revision-Date: 2014-11-05 01:33+0000\n"
"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
"Language-Team: Chinese (http://www.transifex.com/projects/p/ipfire/language/zh/)\n"
"MIME-Version: 1.0\n"
"Language: zh\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: main.c:77 main.c:148 main.c:313 main.c:339 main.c:493 main.c:524 main.c:682
+#: main.c:78 main.c:179 main.c:404 main.c:670 main.c:702 main.c:893
msgid "OK"
msgstr ""
-#: main.c:78 main.c:446 main.c:456 main.c:493 main.c:524
+#: main.c:79 main.c:460 main.c:487 main.c:516 main.c:620 main.c:630 main.c:670
+#: main.c:702
msgid "Cancel"
msgstr ""
-#: main.c:145
+#: main.c:176
msgid "I accept this license"
msgstr ""
-#: main.c:312
+#: main.c:384
+msgid "Warning: Unattended installation will start in 10 seconds..."
+msgstr ""
+
+#: main.c:403
msgid "Language selection"
msgstr ""
-#: main.c:312
+#: main.c:403
msgid "Select the language you wish to use for the installation."
msgstr ""
-#: main.c:323
+#: main.c:418
+msgid "Unattended mode"
+msgstr ""
+
+#: main.c:420
msgid "<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
msgstr ""
-#: main.c:328
+#: main.c:426
#, c-format
msgid ""
"Welcome to the %s installation program.\n"
"Selecting Cancel on any of the following screens will reboot the computer."
msgstr ""
-#: main.c:330
+#: main.c:428
msgid "Start installation"
msgstr ""
-#: main.c:339
-msgid "No local source media found. Starting download."
+#: main.c:449
+#, c-format
+msgid "The installer will now try downloading the installation image."
+msgstr ""
+
+#: main.c:452
+#, c-format
+msgid ""
+"No source drive could be found.\n"
+"\n"
+"You can try downloading the required installation image."
+msgstr ""
+
+#: main.c:456
+msgid ""
+"Please make sure to connect your machine to a network and the installer will"
+" try connect to acquire an IP address."
+msgstr ""
+
+#: main.c:460
+msgid "Download installation image"
+msgstr ""
+
+#: main.c:473
+msgid "Trying to start networking (DHCP)..."
+msgstr ""
+
+#: main.c:484
+msgid ""
+"Networking could not be started but is required to go on with the installation.\n"
+"\n"
+"Please connect your machine to a network with a DHCP server and retry."
+msgstr ""
+
+#: main.c:487 main.c:516
+msgid "Retry"
msgstr ""
-#: main.c:340
-msgid "Downloading installation image ..."
+#: main.c:501
+msgid "Downloading installation image..."
msgstr ""
-#: main.c:342
-msgid "Download error"
+#: main.c:510
+#, c-format
+msgid "MD5 checksum mismatch"
msgstr ""
-#: main.c:376
+#: main.c:513
+#, c-format
+msgid ""
+"The installation image could not be downloaded.\n"
+" Reason: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: main.c:528
+#, c-format
+msgid ""
+"Could not mount %s to %s:\n"
+" %s\n"
+msgstr ""
+
+#: main.c:543
msgid "License Agreement"
msgstr ""
-#: main.c:377
+#: main.c:544
msgid "License not accepted!"
msgstr ""
-#: main.c:399
+#: main.c:566
msgid "No hard disk found."
msgstr ""
-#: main.c:418
+#: main.c:587
msgid "Disk Selection"
msgstr ""
-#: main.c:419
+#: main.c:588
msgid ""
"Select the disk(s) you want to install IPFire on. First those will be partitioned, and then the partitions will have a filesystem put on them.\n"
"\n"
"ALL DATA ON THE DISK WILL BE DESTROYED."
msgstr ""
-#: main.c:430
+#: main.c:599
msgid ""
"No disk has been selected.\n"
"\n"
"Please select one or more disks you want to install IPFire on."
msgstr ""
-#: main.c:443
+#: main.c:617
#, c-format
msgid ""
"The installation program will now prepare the chosen harddisk:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:445
+#: main.c:619
msgid "Disk Setup"
msgstr ""
-#: main.c:446 main.c:456
+#: main.c:620 main.c:630
msgid "Delete all data"
msgstr ""
-#: main.c:453
+#: main.c:627
#, c-format
msgid ""
"The installation program will now set up a RAID configuration on the selected harddisks:\n"
"Do you agree to continue?"
msgstr ""
-#: main.c:455
+#: main.c:629
msgid "RAID Setup"
msgstr ""
-#: main.c:466
-msgid "You disk configuration is currently not supported."
+#: main.c:640
+msgid "Your disk configuration is currently not supported."
msgstr ""
-#: main.c:480
+#: main.c:655
msgid "Your harddisk is too small."
msgstr ""
-#: main.c:494
+#: main.c:671
msgid ""
"Your harddisk is very small, but you can continue without a swap partition."
msgstr ""
-#: main.c:506
+#: main.c:684
msgid "ext4 Filesystem"
msgstr ""
-#: main.c:507
+#: main.c:685
msgid "ext4 Filesystem without journal"
msgstr ""
-#: main.c:508
+#: main.c:686
msgid "XFS Filesystem"
msgstr ""
-#: main.c:509
+#: main.c:687
msgid "ReiserFS Filesystem"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Filesystem Selection"
msgstr ""
-#: main.c:523
+#: main.c:701
msgid "Please choose your filesystem:"
msgstr ""
-#: main.c:534
+#: main.c:712
msgid "Building RAID..."
msgstr ""
-#: main.c:538
+#: main.c:716
msgid "Unable to build the RAID."
msgstr ""
-#: main.c:550
+#: main.c:728
msgid "Partitioning disk..."
msgstr ""
-#: main.c:554
+#: main.c:732
msgid "Unable to partition the disk."
msgstr ""
-#: main.c:561
+#: main.c:739
msgid "Creating filesystems..."
msgstr ""
-#: main.c:565
+#: main.c:743
msgid "Unable to create filesystems."
msgstr ""
-#: main.c:571
+#: main.c:749
msgid "Unable to mount filesystems."
msgstr ""
-#: main.c:582
+#: main.c:760
msgid "Installing the system..."
msgstr ""
-#: main.c:583
+#: main.c:761
msgid "Unable to install the system."
msgstr ""
-#: main.c:599
+#: main.c:777
msgid "Installing the language cache..."
msgstr ""
-#: main.c:600
+#: main.c:778
msgid "Unable to install the language cache."
msgstr ""
-#: main.c:605
+#: main.c:783
msgid "Installing the bootloader..."
msgstr ""
-#: main.c:612
+#: main.c:790
msgid "Unable to open /etc/default/grub for writing."
msgstr ""
-#: main.c:634
+#: main.c:812
msgid "Unable to install the bootloader."
msgstr ""
-#: main.c:666
+#: main.c:826
+msgid ""
+"A backup file has been found on the installation image.\n"
+"\n"
+"Do you want to restore the backup?"
+msgstr ""
+
+#: main.c:827
+msgid "Yes"
+msgstr ""
+
+#: main.c:827
+msgid "No"
+msgstr ""
+
+#: main.c:834
+msgid "An error occured when the backup file was restored."
+msgstr ""
+
+#: main.c:869
+msgid "Running post-install script..."
+msgstr ""
+
+#: main.c:870
+msgid "Post-install script failed."
+msgstr ""
+
+#: main.c:877
#, c-format
msgid ""
"%s was successfully installed!\n"
"Please remove any installation mediums from this system and hit the reboot button. Once the system has restarted you will be asked to setup networking and system passwords. After that, you should point your web browser at https://%s:444 (or what ever you name your %s) for the web configuration console."
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Congratulations!"
msgstr ""
-#: main.c:671
+#: main.c:882
msgid "Reboot"
msgstr ""
-#: main.c:682
+#: main.c:893
msgid "Setup has failed. Press Ok to reboot."
msgstr ""
executeCommand(command);
snprintf(command, STRING_SIZE-1, "/usr/sbin/openvpn --config /var/ipfire/ovpn/server.conf");
executeCommand(command);
+ snprintf(command, STRING_SIZE-1, "/bin/chown root.nobody /var/run/ovpnserver.log");
+ executeCommand(command);
+ snprintf(command, STRING_SIZE-1, "/bin/chmod 644 /var/run/ovpnserver.log");
+ executeCommand(command);
}
}
############################################################################
#
. /opt/pakfire/lib/functions.sh
-extract_files
-#
-KVER=xxxKVERxxx
-ROOT=`mount | grep " / " | cut -d" " -f1`
-ROOTUUID=`blkid -c /dev/null -sUUID $ROOT | cut -d'"' -f2`
-if [ ! -z $ROOTUUID ]; then
- ROOT="UUID=$ROOTUUID"
-fi
-if [ -f /boot/grub/grub.conf ]; then
-MOUNT=`grep "kernel" /boot/grub/grub.conf | tail -n 1`
-# Nur den letzten Parameter verwenden
-echo $MOUNT > /dev/null
-MOUNT=$_
-if [ ! $MOUNT == "rw" ]; then
- MOUNT="ro"
-fi
-ENTRY=`grep "savedefault" /boot/grub/grub.conf | tail -n 1`
-# Nur den letzten Parameter verwenden
-echo $ENTRY > /dev/null
-let ENTRY=$_+1
+function find_partition() {
+ local mountpoint="${1}"
-#Check if the system use serial console...
-if [ "$(grep "^serial" /boot/grub/grub.conf)" == "" ]; then
- console=""
-else
- console=" console=ttyS0,115200n8"
-fi
+ local root
+ local dev mp fs flags rest
+ while read -r dev mp fs flags rest; do
+ # Skip unwanted entries
+ [ "${dev}" = "rootfs" ] && continue
+ if [ "${mp}" = "${mountpoint}" ] && [ -b "${dev}" ]; then
+ root="$(basename "${dev}")"
+ break
+ fi
+ done < /proc/mounts
+ echo ${root}
+ return 0
+}
+
+extract_files
#
-# backup grub.conf
-#
-cp /boot/grub/grub.conf /boot/grub/grub-backup-$KVER-pae_install.conf
-#
-# Add new Entry to grub.conf
-#
-echo "" >> /boot/grub/grub.conf
-echo "title IPFire (PAE-Kernel)" >> /boot/grub/grub.conf
-echo " kernel /vmlinuz-$KVER-ipfire-pae root=$ROOT panic=10$console $MOUNT" >> /boot/grub/grub.conf
-echo " initrd /ipfirerd-$KVER-pae.img" >> /boot/grub/grub.conf
-echo " savedefault $ENTRY" >> /boot/grub/grub.conf
-fi
+KVER=xxxKVERxxx
#
# Create new module depency
#
/usr/bin/dracut --force --xz /boot/initramfs-$KVER-ipfire-pae.img $KVER-ipfire-pae
-#
-# Update grub2 config
-#
-grub-mkconfig > /boot/grub/grub.cfg
+
+ROOT="$(find_partition "/")"
+case $ROOT in
+ xvd* )
+ #
+ # We are on XEN so create new grub.conf / menu.lst for pygrub
+ #
+ echo "timeout 10" > /boot/grub/grub.conf
+ echo "default 0" >> /boot/grub/grub.conf
+ echo "title IPFire (pae-kernel)" >> /boot/grub/grub.conf
+ echo " kernel /vmlinuz-$KVER-ipfire-pae root=/dev/$ROOT rootdelay=10 panic=10 console=hvc0" \
+ >> /boot/grub/grub.conf
+ echo " initrd /initramfs-$KVER-ipfire-pae.img" >> /boot/grub/grub.conf
+ echo "# savedefault 0" >> /boot/grub/grub.conf
+ ln -s grub.conf $MNThdd/boot/grub/menu.lst
+ ;;
+ * )
+ #
+ # Update grub2 config
+ #
+ grub-mkconfig > /boot/grub/grub.cfg
+ ;;
+esac
# request a reboot if pae is supported
if [ ! "$(grep "^flags.* pae " /proc/cpuinfo)" == "" ]; then
############################################################################
#
. /opt/pakfire/lib/functions.sh
+if [ -f /boot/grub/grub.conf ]; then
+ echo "Error! Connot remove linux-pae because we are on XEN."
+ exit 1
+fi
remove_files
rm -rf /boot/initramfs-*-pae.img
rm -rf /boot/vmlinuz-*-pae
rm -rf /lib/modules/*-ipfire-pae
-if [ -f /boot/grub/grub.conf ]; then
- cp /boot/grub/grub.conf /boot/grub/grub-backup-pae_uninstall.conf
- sed -i "/title IPFire (PAE-Kernel)/,+3d" /boot/grub/grub.conf
-fi
grub-mkconfig > /boot/grub/grub.cfg
sync && sync
############################################################################
#
. /opt/pakfire/lib/functions.sh
-./uninstall.sh
+remove_files
+rm -rf /boot/initramfs-*-pae.img
+rm -rf /boot/vmlinuz-*-pae
+rm -rf /lib/modules/*-ipfire-pae
+if [ ! -f /boot/grub/grub.conf ]; then
+ grub-mkconfig > /boot/grub/grub.cfg
+fi
./install.sh
+++ /dev/null
-#!/bin/bash
-############################################################################
-# #
-# This file is part of the IPFire Firewall. #
-# #
-# IPFire is free software; you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation; either version 2 of the License, or #
-# (at your option) any later version. #
-# #
-# IPFire is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with IPFire; if not, write to the Free Software #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-# #
-# Copyright (C) 2008 IPFire-Team <info@ipfire.org>. #
-# #
-############################################################################
-#
-. /opt/pakfire/lib/functions.sh
-
-extract_files
-
-[ -d /opt/teamspeak ] || mkdir -p /opt/teamspeak
-
-cd /tmp
-wget -c ftp://ftp.freenet.de/pub/4players/teamspeak.org/releases/ts2_server_rc2_202319.tar.bz2 \
- ftp://ftp.freenet.de/pub/4players/teamspeak.org/developer/server/202401/server_linux
-
-tar xvfj ts2_server_rc2_202319.tar.bz2 -C /tmp
-
-cp -av /tmp/tss2_rc2/* /opt/teamspeak
-mv /tmp/server_linux /opt/teamspeak/server_linux
-chmod 755 -v /opt/teamspeak/server_linux
-
-rm -rf /tmp/tss2_rc2 ts2_server_rc2_202319.tar.bz2
-
-groupadd teamspeak
-useradd -g teamspeak teamspeak
-
-chown teamspeak.teamspeak /opt/teamspeak -Rv
-
-restore_backup ${NAME}
-start_service --background ${NAME}
-
-ln -sf ../init.d/teamspeak /etc/rc.d/rc0.d/K00teamspeak
-ln -sf ../init.d/teamspeak /etc/rc.d/rc3.d/S99teamspeak
-ln -sf ../init.d/teamspeak /etc/rc.d/rc6.d/K00teamspeak
-
-
+++ /dev/null
-#!/bin/bash
-############################################################################
-# #
-# This file is part of the IPFire Firewall. #
-# #
-# IPFire is free software; you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation; either version 2 of the License, or #
-# (at your option) any later version. #
-# #
-# IPFire is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with IPFire; if not, write to the Free Software #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-# #
-# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
-# #
-############################################################################
-#
-. /opt/pakfire/lib/functions.sh
-stop_service ${NAME}
-
-if [ ! -e "/var/ipfire/backup/addons/includes/teamspeak" ]; then
- echo /opt/teamspeak/bad_names.txt > /var/ipfire/backup/addons/includes/teamspeak
- echo /opt/teamspeak/server.dbs >> /var/ipfire/backup/addons/includes/teamspeak
- echo /opt/teamspeak/server.ini >> /var/ipfire/backup/addons/includes/teamspeak
- echo /opt/teamspeak/server.log >> /var/ipfire/backup/addons/includes/teamspeak
- echo /opt/teamspeak/whitelist.txt >> /var/ipfire/backup/addons/includes/teamspeak
-fi
-make_backup ${NAME}
-rm -rf /opt/teamspeak
-userdel teamspeak
-rm -rf /etc/rc.d/rc*.d/*teamspeak
-
-
+++ /dev/null
-#!/bin/bash
-############################################################################
-# #
-# This file is part of the IPFire Firewall. #
-# #
-# IPFire is free software; you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation; either version 2 of the License, or #
-# (at your option) any later version. #
-# #
-# IPFire is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with IPFire; if not, write to the Free Software #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-# #
-# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
-# #
-############################################################################
-#
-. /opt/pakfire/lib/functions.sh
-./uninstall.sh
-./install.sh
--- /dev/null
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_common.c backports-3.18.1-1/drivers/net/usb/asix_common.c
+--- backports-3.18.1-1.org/drivers/net/usb/asix_common.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/asix_common.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,582 @@
++/*
++ * ASIX AX8817X based USB 2.0 Ethernet Devices
++ * Copyright (C) 2003-2006 David Hollis <dhollis@davehollis.com>
++ * Copyright (C) 2005 Phil Chang <pchang23@sbcglobal.net>
++ * Copyright (C) 2006 James Painter <jamie.painter@iname.com>
++ * Copyright (c) 2002-2003 TiVo Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include "asix.h"
++
++int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data)
++{
++ int ret;
++ ret = usbnet_read_cmd(dev, cmd,
++ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ value, index, data, size);
++
++ if (ret != size && ret >= 0)
++ return -EINVAL;
++ return ret;
++}
++
++int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data)
++{
++ return usbnet_write_cmd(dev, cmd,
++ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ value, index, data, size);
++}
++
++void asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data)
++{
++ usbnet_write_cmd_async(dev, cmd,
++ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ value, index, data, size);
++}
++
++int asix_rx_fixup_internal(struct usbnet *dev, struct sk_buff *skb,
++ struct asix_rx_fixup_info *rx)
++{
++ int offset = 0;
++
++ while (offset + sizeof(u16) <= skb->len) {
++ u16 remaining = 0;
++ unsigned char *data;
++
++ if (!rx->size) {
++ if ((skb->len - offset == sizeof(u16)) ||
++ rx->split_head) {
++ if(!rx->split_head) {
++ rx->header = get_unaligned_le16(
++ skb->data + offset);
++ rx->split_head = true;
++ offset += sizeof(u16);
++ break;
++ } else {
++ rx->header |= (get_unaligned_le16(
++ skb->data + offset)
++ << 16);
++ rx->split_head = false;
++ offset += sizeof(u16);
++ }
++ } else {
++ rx->header = get_unaligned_le32(skb->data +
++ offset);
++ offset += sizeof(u32);
++ }
++
++ /* get the packet length */
++ rx->size = (u16) (rx->header & 0x7ff);
++ if (rx->size != ((~rx->header >> 16) & 0x7ff)) {
++ netdev_err(dev->net, "asix_rx_fixup() Bad Header Length 0x%x, offset %d\n",
++ rx->header, offset);
++ rx->size = 0;
++ return 0;
++ }
++ rx->ax_skb = netdev_alloc_skb_ip_align(dev->net,
++ rx->size);
++ if (!rx->ax_skb)
++ return 0;
++ }
++
++ if (rx->size > dev->net->mtu + ETH_HLEN + VLAN_HLEN) {
++ netdev_err(dev->net, "asix_rx_fixup() Bad RX Length %d\n",
++ rx->size);
++ kfree_skb(rx->ax_skb);
++ rx->ax_skb = NULL;
++ rx->size = 0U;
++
++ return 0;
++ }
++
++ if (rx->size > skb->len - offset) {
++ remaining = rx->size - (skb->len - offset);
++ rx->size = skb->len - offset;
++ }
++
++ data = skb_put(rx->ax_skb, rx->size);
++ memcpy(data, skb->data + offset, rx->size);
++ if (!remaining)
++ usbnet_skb_return(dev, rx->ax_skb);
++
++ offset += (rx->size + 1) & 0xfffe;
++ rx->size = remaining;
++ }
++
++ if (skb->len != offset) {
++ netdev_err(dev->net, "asix_rx_fixup() Bad SKB Length %d, %d\n",
++ skb->len, offset);
++ return 0;
++ }
++
++ return 1;
++}
++
++int asix_rx_fixup_common(struct usbnet *dev, struct sk_buff *skb)
++{
++ struct asix_common_private *dp = dev->driver_priv;
++ struct asix_rx_fixup_info *rx = &dp->rx_fixup_info;
++
++ return asix_rx_fixup_internal(dev, skb, rx);
++}
++
++struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
++ gfp_t flags)
++{
++ int padlen;
++ int headroom = skb_headroom(skb);
++ int tailroom = skb_tailroom(skb);
++ u32 packet_len;
++ u32 padbytes = 0xffff0000;
++
++ padlen = ((skb->len + 4) & (dev->maxpacket - 1)) ? 0 : 4;
++
++ /* We need to push 4 bytes in front of frame (packet_len)
++ * and maybe add 4 bytes after the end (if padlen is 4)
++ *
++ * Avoid skb_copy_expand() expensive call, using following rules :
++ * - We are allowed to push 4 bytes in headroom if skb_header_cloned()
++ * is false (and if we have 4 bytes of headroom)
++ * - We are allowed to put 4 bytes at tail if skb_cloned()
++ * is false (and if we have 4 bytes of tailroom)
++ *
++ * TCP packets for example are cloned, but skb_header_release()
++ * was called in tcp stack, allowing us to use headroom for our needs.
++ */
++ if (!skb_header_cloned(skb) &&
++ !(padlen && skb_cloned(skb)) &&
++ headroom + tailroom >= 4 + padlen) {
++ /* following should not happen, but better be safe */
++ if (headroom < 4 ||
++ tailroom < padlen) {
++ skb->data = memmove(skb->head + 4, skb->data, skb->len);
++ skb_set_tail_pointer(skb, skb->len);
++ }
++ } else {
++ struct sk_buff *skb2;
++
++ skb2 = skb_copy_expand(skb, 4, padlen, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (!skb)
++ return NULL;
++ }
++
++ packet_len = ((skb->len ^ 0x0000ffff) << 16) + skb->len;
++ skb_push(skb, 4);
++ cpu_to_le32s(&packet_len);
++ skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len));
++
++ if (padlen) {
++ cpu_to_le32s(&padbytes);
++ memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
++ skb_put(skb, sizeof(padbytes));
++ }
++ return skb;
++}
++
++int asix_set_sw_mii(struct usbnet *dev)
++{
++ int ret;
++ ret = asix_write_cmd(dev, AX_CMD_SET_SW_MII, 0x0000, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to enable software MII access\n");
++ return ret;
++}
++
++int asix_set_hw_mii(struct usbnet *dev)
++{
++ int ret;
++ ret = asix_write_cmd(dev, AX_CMD_SET_HW_MII, 0x0000, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to enable hardware MII access\n");
++ return ret;
++}
++
++int asix_read_phy_addr(struct usbnet *dev, int internal)
++{
++ int offset = (internal ? 1 : 0);
++ u8 buf[2];
++ int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf);
++
++ netdev_dbg(dev->net, "asix_get_phy_addr()\n");
++
++ if (ret < 0) {
++ netdev_err(dev->net, "Error reading PHYID register: %02x\n", ret);
++ goto out;
++ }
++ netdev_dbg(dev->net, "asix_get_phy_addr() returning 0x%04x\n",
++ *((__le16 *)buf));
++ ret = buf[offset];
++
++out:
++ return ret;
++}
++
++int asix_get_phy_addr(struct usbnet *dev)
++{
++ /* return the address of the internal phy */
++ return asix_read_phy_addr(dev, 1);
++}
++
++
++int asix_sw_reset(struct usbnet *dev, u8 flags)
++{
++ int ret;
++
++ ret = asix_write_cmd(dev, AX_CMD_SW_RESET, flags, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to send software reset: %02x\n", ret);
++
++ return ret;
++}
++
++u16 asix_read_rx_ctl(struct usbnet *dev)
++{
++ __le16 v;
++ int ret = asix_read_cmd(dev, AX_CMD_READ_RX_CTL, 0, 0, 2, &v);
++
++ if (ret < 0) {
++ netdev_err(dev->net, "Error reading RX_CTL register: %02x\n", ret);
++ goto out;
++ }
++ ret = le16_to_cpu(v);
++out:
++ return ret;
++}
++
++int asix_write_rx_ctl(struct usbnet *dev, u16 mode)
++{
++ int ret;
++
++ netdev_dbg(dev->net, "asix_write_rx_ctl() - mode = 0x%04x\n", mode);
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_RX_CTL, mode, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to write RX_CTL mode to 0x%04x: %02x\n",
++ mode, ret);
++
++ return ret;
++}
++
++u16 asix_read_medium_status(struct usbnet *dev)
++{
++ __le16 v;
++ int ret = asix_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS, 0, 0, 2, &v);
++
++ if (ret < 0) {
++ netdev_err(dev->net, "Error reading Medium Status register: %02x\n",
++ ret);
++ return ret; /* TODO: callers not checking for error ret */
++ }
++
++ return le16_to_cpu(v);
++
++}
++
++int asix_write_medium_mode(struct usbnet *dev, u16 mode)
++{
++ int ret;
++
++ netdev_dbg(dev->net, "asix_write_medium_mode() - mode = 0x%04x\n", mode);
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to write Medium Mode mode to 0x%04x: %02x\n",
++ mode, ret);
++
++ return ret;
++}
++
++int asix_write_gpio(struct usbnet *dev, u16 value, int sleep)
++{
++ int ret;
++
++ netdev_dbg(dev->net, "asix_write_gpio() - value = 0x%04x\n", value);
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS, value, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to write GPIO value 0x%04x: %02x\n",
++ value, ret);
++
++ if (sleep)
++ msleep(sleep);
++
++ return ret;
++}
++
++/*
++ * AX88772 & AX88178 have a 16-bit RX_CTL value
++ */
++void asix_set_multicast(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct asix_data *data = (struct asix_data *)&dev->data;
++ u16 rx_ctl = AX_DEFAULT_RX_CTL;
++
++ if (net->flags & IFF_PROMISC) {
++ rx_ctl |= AX_RX_CTL_PRO;
++ } else if (net->flags & IFF_ALLMULTI ||
++ netdev_mc_count(net) > AX_MAX_MCAST) {
++ rx_ctl |= AX_RX_CTL_AMALL;
++ } else if (netdev_mc_empty(net)) {
++ /* just broadcast and directed */
++ } else {
++ /* We use the 20 byte dev->data
++ * for our 8 byte filter buffer
++ * to avoid allocating memory that
++ * is tricky to free later */
++ struct netdev_hw_addr *ha;
++ u32 crc_bits;
++
++ memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
++
++ /* Build the multicast hash filter. */
++ netdev_for_each_mc_addr(ha, net) {
++ crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
++ data->multi_filter[crc_bits >> 3] |=
++ 1 << (crc_bits & 7);
++ }
++
++ asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
++ AX_MCAST_FILTER_SIZE, data->multi_filter);
++
++ rx_ctl |= AX_RX_CTL_AM;
++ }
++
++ asix_write_cmd_async(dev, AX_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL);
++}
++
++int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ __le16 res;
++
++ mutex_lock(&dev->phy_mutex);
++ asix_set_sw_mii(dev);
++ asix_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id,
++ (__u16)loc, 2, &res);
++ asix_set_hw_mii(dev);
++ mutex_unlock(&dev->phy_mutex);
++
++ netdev_dbg(dev->net, "asix_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",
++ phy_id, loc, le16_to_cpu(res));
++
++ return le16_to_cpu(res);
++}
++
++void asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ __le16 res = cpu_to_le16(val);
++
++ netdev_dbg(dev->net, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n",
++ phy_id, loc, val);
++ mutex_lock(&dev->phy_mutex);
++ asix_set_sw_mii(dev);
++ asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, &res);
++ asix_set_hw_mii(dev);
++ mutex_unlock(&dev->phy_mutex);
++}
++
++void asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u8 opt;
++
++ if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) {
++ wolinfo->supported = 0;
++ wolinfo->wolopts = 0;
++ return;
++ }
++ wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
++ wolinfo->wolopts = 0;
++ if (opt & AX_MONITOR_LINK)
++ wolinfo->wolopts |= WAKE_PHY;
++ if (opt & AX_MONITOR_MAGIC)
++ wolinfo->wolopts |= WAKE_MAGIC;
++}
++
++int asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u8 opt = 0;
++
++ if (wolinfo->wolopts & WAKE_PHY)
++ opt |= AX_MONITOR_LINK;
++ if (wolinfo->wolopts & WAKE_MAGIC)
++ opt |= AX_MONITOR_MAGIC;
++
++ if (asix_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE,
++ opt, 0, 0, NULL) < 0)
++ return -EINVAL;
++
++ return 0;
++}
++
++int asix_get_eeprom_len(struct net_device *net)
++{
++ return AX_EEPROM_LEN;
++}
++
++int asix_get_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom,
++ u8 *data)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u16 *eeprom_buff;
++ int first_word, last_word;
++ int i;
++
++ if (eeprom->len == 0)
++ return -EINVAL;
++
++ eeprom->magic = AX_EEPROM_MAGIC;
++
++ first_word = eeprom->offset >> 1;
++ last_word = (eeprom->offset + eeprom->len - 1) >> 1;
++
++ eeprom_buff = kmalloc(sizeof(u16) * (last_word - first_word + 1),
++ GFP_KERNEL);
++ if (!eeprom_buff)
++ return -ENOMEM;
++
++ /* ax8817x returns 2 bytes from eeprom on read */
++ for (i = first_word; i <= last_word; i++) {
++ if (asix_read_cmd(dev, AX_CMD_READ_EEPROM, i, 0, 2,
++ &(eeprom_buff[i - first_word])) < 0) {
++ kfree(eeprom_buff);
++ return -EIO;
++ }
++ }
++
++ memcpy(data, (u8 *)eeprom_buff + (eeprom->offset & 1), eeprom->len);
++ kfree(eeprom_buff);
++ return 0;
++}
++
++int asix_set_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom,
++ u8 *data)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u16 *eeprom_buff;
++ int first_word, last_word;
++ int i;
++ int ret;
++
++ netdev_dbg(net, "write EEPROM len %d, offset %d, magic 0x%x\n",
++ eeprom->len, eeprom->offset, eeprom->magic);
++
++ if (eeprom->len == 0)
++ return -EINVAL;
++
++ if (eeprom->magic != AX_EEPROM_MAGIC)
++ return -EINVAL;
++
++ first_word = eeprom->offset >> 1;
++ last_word = (eeprom->offset + eeprom->len - 1) >> 1;
++
++ eeprom_buff = kmalloc(sizeof(u16) * (last_word - first_word + 1),
++ GFP_KERNEL);
++ if (!eeprom_buff)
++ return -ENOMEM;
++
++ /* align data to 16 bit boundaries, read the missing data from
++ the EEPROM */
++ if (eeprom->offset & 1) {
++ ret = asix_read_cmd(dev, AX_CMD_READ_EEPROM, first_word, 0, 2,
++ &(eeprom_buff[0]));
++ if (ret < 0) {
++ netdev_err(net, "Failed to read EEPROM at offset 0x%02x.\n", first_word);
++ goto free;
++ }
++ }
++
++ if ((eeprom->offset + eeprom->len) & 1) {
++ ret = asix_read_cmd(dev, AX_CMD_READ_EEPROM, last_word, 0, 2,
++ &(eeprom_buff[last_word - first_word]));
++ if (ret < 0) {
++ netdev_err(net, "Failed to read EEPROM at offset 0x%02x.\n", last_word);
++ goto free;
++ }
++ }
++
++ memcpy((u8 *)eeprom_buff + (eeprom->offset & 1), data, eeprom->len);
++
++ /* write data to EEPROM */
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_ENABLE, 0x0000, 0, 0, NULL);
++ if (ret < 0) {
++ netdev_err(net, "Failed to enable EEPROM write\n");
++ goto free;
++ }
++ msleep(20);
++
++ for (i = first_word; i <= last_word; i++) {
++ netdev_dbg(net, "write to EEPROM at offset 0x%02x, data 0x%04x\n",
++ i, eeprom_buff[i - first_word]);
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_EEPROM, i,
++ eeprom_buff[i - first_word], 0, NULL);
++ if (ret < 0) {
++ netdev_err(net, "Failed to write EEPROM at offset 0x%02x.\n",
++ i);
++ goto free;
++ }
++ msleep(20);
++ }
++
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_DISABLE, 0x0000, 0, 0, NULL);
++ if (ret < 0) {
++ netdev_err(net, "Failed to disable EEPROM write\n");
++ goto free;
++ }
++
++ ret = 0;
++free:
++ kfree(eeprom_buff);
++ return ret;
++}
++
++void asix_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
++{
++ /* Inherit standard device info */
++ usbnet_get_drvinfo(net, info);
++ strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
++ strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
++ info->eedump_len = AX_EEPROM_LEN;
++}
++
++int asix_set_mac_address(struct net_device *net, void *p)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct asix_data *data = (struct asix_data *)&dev->data;
++ struct sockaddr *addr = p;
++
++ if (netif_running(net))
++ return -EBUSY;
++ if (!is_valid_ether_addr(addr->sa_data))
++ return -EADDRNOTAVAIL;
++
++ memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
++
++ /* We use the 20 byte dev->data
++ * for our 6 byte mac buffer
++ * to avoid allocating memory that
++ * is tricky to free later */
++ memcpy(data->mac_addr, addr->sa_data, ETH_ALEN);
++ asix_write_cmd_async(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
++ data->mac_addr);
++
++ return 0;
++}
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_devices.c backports-3.18.1-1/drivers/net/usb/asix_devices.c
+--- backports-3.18.1-1.org/drivers/net/usb/asix_devices.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/asix_devices.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,1104 @@
++/*
++ * ASIX AX8817X based USB 2.0 Ethernet Devices
++ * Copyright (C) 2003-2006 David Hollis <dhollis@davehollis.com>
++ * Copyright (C) 2005 Phil Chang <pchang23@sbcglobal.net>
++ * Copyright (C) 2006 James Painter <jamie.painter@iname.com>
++ * Copyright (c) 2002-2003 TiVo Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include "asix.h"
++
++#define PHY_MODE_MARVELL 0x0000
++#define MII_MARVELL_LED_CTRL 0x0018
++#define MII_MARVELL_STATUS 0x001b
++#define MII_MARVELL_CTRL 0x0014
++
++#define MARVELL_LED_MANUAL 0x0019
++
++#define MARVELL_STATUS_HWCFG 0x0004
++
++#define MARVELL_CTRL_TXDELAY 0x0002
++#define MARVELL_CTRL_RXDELAY 0x0080
++
++#define PHY_MODE_RTL8211CL 0x000C
++
++struct ax88172_int_data {
++ __le16 res1;
++ u8 link;
++ __le16 res2;
++ u8 status;
++ __le16 res3;
++} __packed;
++
++static void asix_status(struct usbnet *dev, struct urb *urb)
++{
++ struct ax88172_int_data *event;
++ int link;
++
++ if (urb->actual_length < 8)
++ return;
++
++ event = urb->transfer_buffer;
++ link = event->link & 0x01;
++ if (netif_carrier_ok(dev->net) != link) {
++ usbnet_link_change(dev, link, 1);
++ netdev_dbg(dev->net, "Link Status is: %d\n", link);
++ }
++}
++
++static void asix_set_netdev_dev_addr(struct usbnet *dev, u8 *addr)
++{
++ if (is_valid_ether_addr(addr)) {
++ memcpy(dev->net->dev_addr, addr, ETH_ALEN);
++ } else {
++ netdev_info(dev->net, "invalid hw address, using random\n");
++ eth_hw_addr_random(dev->net);
++ }
++}
++
++/* Get the PHY Identifier from the PHYSID1 & PHYSID2 MII registers */
++static u32 asix_get_phyid(struct usbnet *dev)
++{
++ int phy_reg;
++ u32 phy_id;
++ int i;
++
++ /* Poll for the rare case the FW or phy isn't ready yet. */
++ for (i = 0; i < 100; i++) {
++ phy_reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID1);
++ if (phy_reg != 0 && phy_reg != 0xFFFF)
++ break;
++ mdelay(1);
++ }
++
++ if (phy_reg <= 0 || phy_reg == 0xFFFF)
++ return 0;
++
++ phy_id = (phy_reg & 0xffff) << 16;
++
++ phy_reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID2);
++ if (phy_reg < 0)
++ return 0;
++
++ phy_id |= (phy_reg & 0xffff);
++
++ return phy_id;
++}
++
++static u32 asix_get_link(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ return mii_link_ok(&dev->mii);
++}
++
++static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
++}
++
++/* We need to override some ethtool_ops so we require our
++ own structure so we don't interfere with other usbnet
++ devices that may be connected at the same time. */
++static const struct ethtool_ops ax88172_ethtool_ops = {
++ .get_drvinfo = asix_get_drvinfo,
++ .get_link = asix_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_wol = asix_get_wol,
++ .set_wol = asix_set_wol,
++ .get_eeprom_len = asix_get_eeprom_len,
++ .get_eeprom = asix_get_eeprom,
++ .set_eeprom = asix_set_eeprom,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .nway_reset = usbnet_nway_reset,
++};
++
++static void ax88172_set_multicast(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct asix_data *data = (struct asix_data *)&dev->data;
++ u8 rx_ctl = 0x8c;
++
++ if (net->flags & IFF_PROMISC) {
++ rx_ctl |= 0x01;
++ } else if (net->flags & IFF_ALLMULTI ||
++ netdev_mc_count(net) > AX_MAX_MCAST) {
++ rx_ctl |= 0x02;
++ } else if (netdev_mc_empty(net)) {
++ /* just broadcast and directed */
++ } else {
++ /* We use the 20 byte dev->data
++ * for our 8 byte filter buffer
++ * to avoid allocating memory that
++ * is tricky to free later */
++ struct netdev_hw_addr *ha;
++ u32 crc_bits;
++
++ memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
++
++ /* Build the multicast hash filter. */
++ netdev_for_each_mc_addr(ha, net) {
++ crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
++ data->multi_filter[crc_bits >> 3] |=
++ 1 << (crc_bits & 7);
++ }
++
++ asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
++ AX_MCAST_FILTER_SIZE, data->multi_filter);
++
++ rx_ctl |= 0x10;
++ }
++
++ asix_write_cmd_async(dev, AX_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL);
++}
++
++static int ax88172_link_reset(struct usbnet *dev)
++{
++ u8 mode;
++ struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
++
++ mii_check_media(&dev->mii, 1, 1);
++ mii_ethtool_gset(&dev->mii, &ecmd);
++ mode = AX88172_MEDIUM_DEFAULT;
++
++ if (ecmd.duplex != DUPLEX_FULL)
++ mode |= ~AX88172_MEDIUM_FD;
++
++ netdev_dbg(dev->net, "ax88172_link_reset() speed: %u duplex: %d setting mode to 0x%04x\n",
++ ethtool_cmd_speed(&ecmd), ecmd.duplex, mode);
++
++ asix_write_medium_mode(dev, mode);
++
++ return 0;
++}
++
++static const struct net_device_ops ax88172_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_set_mac_address = eth_mac_addr,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = asix_ioctl,
++ .ndo_set_rx_mode = ax88172_set_multicast,
++};
++
++static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int ret = 0;
++ u8 buf[ETH_ALEN];
++ int i;
++ unsigned long gpio_bits = dev->driver_info->data;
++
++ usbnet_get_endpoints(dev,intf);
++
++ /* Toggle the GPIOs in a manufacturer/model specific way */
++ for (i = 2; i >= 0; i--) {
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS,
++ (gpio_bits >> (i * 8)) & 0xff, 0, 0, NULL);
++ if (ret < 0)
++ goto out;
++ msleep(5);
++ }
++
++ ret = asix_write_rx_ctl(dev, 0x80);
++ if (ret < 0)
++ goto out;
++
++ /* Get the MAC address */
++ ret = asix_read_cmd(dev, AX88172_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "read AX_CMD_READ_NODE_ID failed: %d\n",
++ ret);
++ goto out;
++ }
++
++ asix_set_netdev_dev_addr(dev, buf);
++
++ /* Initialize MII structure */
++ dev->mii.dev = dev->net;
++ dev->mii.mdio_read = asix_mdio_read;
++ dev->mii.mdio_write = asix_mdio_write;
++ dev->mii.phy_id_mask = 0x3f;
++ dev->mii.reg_num_mask = 0x1f;
++ dev->mii.phy_id = asix_get_phy_addr(dev);
++
++ dev->net->netdev_ops = &ax88172_netdev_ops;
++ dev->net->ethtool_ops = &ax88172_ethtool_ops;
++ dev->net->needed_headroom = 4; /* cf asix_tx_fixup() */
++ dev->net->needed_tailroom = 4; /* cf asix_tx_fixup() */
++
++ asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
++ asix_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
++ ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
++ mii_nway_restart(&dev->mii);
++
++ return 0;
++
++out:
++ return ret;
++}
++
++static const struct ethtool_ops ax88772_ethtool_ops = {
++ .get_drvinfo = asix_get_drvinfo,
++ .get_link = asix_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_wol = asix_get_wol,
++ .set_wol = asix_set_wol,
++ .get_eeprom_len = asix_get_eeprom_len,
++ .get_eeprom = asix_get_eeprom,
++ .set_eeprom = asix_set_eeprom,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .nway_reset = usbnet_nway_reset,
++};
++
++static int ax88772_link_reset(struct usbnet *dev)
++{
++ u16 mode;
++ struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
++
++ mii_check_media(&dev->mii, 1, 1);
++ mii_ethtool_gset(&dev->mii, &ecmd);
++ mode = AX88772_MEDIUM_DEFAULT;
++
++ if (ethtool_cmd_speed(&ecmd) != SPEED_100)
++ mode &= ~AX_MEDIUM_PS;
++
++ if (ecmd.duplex != DUPLEX_FULL)
++ mode &= ~AX_MEDIUM_FD;
++
++ netdev_dbg(dev->net, "ax88772_link_reset() speed: %u duplex: %d setting mode to 0x%04x\n",
++ ethtool_cmd_speed(&ecmd), ecmd.duplex, mode);
++
++ asix_write_medium_mode(dev, mode);
++
++ return 0;
++}
++
++static int ax88772_reset(struct usbnet *dev)
++{
++ struct asix_data *data = (struct asix_data *)&dev->data;
++ int ret, embd_phy;
++ u16 rx_ctl;
++
++ ret = asix_write_gpio(dev,
++ AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5);
++ if (ret < 0)
++ goto out;
++
++ embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0);
++
++ ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Select PHY #1 failed: %d\n", ret);
++ goto out;
++ }
++
++ ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL);
++ if (ret < 0)
++ goto out;
++
++ msleep(150);
++
++ ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
++ if (ret < 0)
++ goto out;
++
++ msleep(150);
++
++ if (embd_phy) {
++ ret = asix_sw_reset(dev, AX_SWRESET_IPRL);
++ if (ret < 0)
++ goto out;
++ } else {
++ ret = asix_sw_reset(dev, AX_SWRESET_PRTE);
++ if (ret < 0)
++ goto out;
++ }
++
++ msleep(150);
++ rx_ctl = asix_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x after software reset\n", rx_ctl);
++ ret = asix_write_rx_ctl(dev, 0x0000);
++ if (ret < 0)
++ goto out;
++
++ rx_ctl = asix_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x setting to 0x0000\n", rx_ctl);
++
++ ret = asix_sw_reset(dev, AX_SWRESET_PRL);
++ if (ret < 0)
++ goto out;
++
++ msleep(150);
++
++ ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL);
++ if (ret < 0)
++ goto out;
++
++ msleep(150);
++
++ asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
++ asix_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
++ ADVERTISE_ALL | ADVERTISE_CSMA);
++ mii_nway_restart(&dev->mii);
++
++ ret = asix_write_medium_mode(dev, AX88772_MEDIUM_DEFAULT);
++ if (ret < 0)
++ goto out;
++
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
++ AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
++ AX88772_IPG2_DEFAULT, 0, NULL);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Write IPG,IPG1,IPG2 failed: %d\n", ret);
++ goto out;
++ }
++
++ /* Rewrite MAC address */
++ memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
++ data->mac_addr);
++ if (ret < 0)
++ goto out;
++
++ /* Set RX_CTL to default values with 2k buffer, and enable cactus */
++ ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL);
++ if (ret < 0)
++ goto out;
++
++ rx_ctl = asix_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x after all initializations\n",
++ rx_ctl);
++
++ rx_ctl = asix_read_medium_status(dev);
++ netdev_dbg(dev->net,
++ "Medium Status is 0x%04x after all initializations\n",
++ rx_ctl);
++
++ return 0;
++
++out:
++ return ret;
++
++}
++
++static const struct net_device_ops ax88772_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_set_mac_address = asix_set_mac_address,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = asix_ioctl,
++ .ndo_set_rx_mode = asix_set_multicast,
++};
++
++static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int ret, embd_phy, i;
++ u8 buf[ETH_ALEN];
++ u32 phyid;
++
++ usbnet_get_endpoints(dev,intf);
++
++ /* Get the MAC address */
++ if (dev->driver_info->data & FLAG_EEPROM_MAC) {
++ for (i = 0; i < (ETH_ALEN >> 1); i++) {
++ ret = asix_read_cmd(dev, AX_CMD_READ_EEPROM, 0x04 + i,
++ 0, 2, buf + i * 2);
++ if (ret < 0)
++ break;
++ }
++ } else {
++ ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID,
++ 0, 0, ETH_ALEN, buf);
++ }
++
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Failed to read MAC address: %d\n", ret);
++ return ret;
++ }
++
++ asix_set_netdev_dev_addr(dev, buf);
++
++ /* Initialize MII structure */
++ dev->mii.dev = dev->net;
++ dev->mii.mdio_read = asix_mdio_read;
++ dev->mii.mdio_write = asix_mdio_write;
++ dev->mii.phy_id_mask = 0x1f;
++ dev->mii.reg_num_mask = 0x1f;
++ dev->mii.phy_id = asix_get_phy_addr(dev);
++
++ dev->net->netdev_ops = &ax88772_netdev_ops;
++ dev->net->ethtool_ops = &ax88772_ethtool_ops;
++ dev->net->needed_headroom = 4; /* cf asix_tx_fixup() */
++ dev->net->needed_tailroom = 4; /* cf asix_tx_fixup() */
++
++ embd_phy = ((dev->mii.phy_id & 0x1f) == 0x10 ? 1 : 0);
++
++ /* Reset the PHY to normal operation mode */
++ ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Select PHY #1 failed: %d\n", ret);
++ return ret;
++ }
++
++ ax88772_reset(dev);
++
++ /* Read PHYID register *AFTER* the PHY was reset properly */
++ phyid = asix_get_phyid(dev);
++ netdev_dbg(dev->net, "PHYID=0x%08x\n", phyid);
++
++ /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
++ if (dev->driver_info->flags & FLAG_FRAMING_AX) {
++ /* hard_mtu is still the default - the device does not support
++ jumbo eth frames */
++ dev->rx_urb_size = 2048;
++ }
++
++ dev->driver_priv = kzalloc(sizeof(struct asix_common_private), GFP_KERNEL);
++ if (!dev->driver_priv)
++ return -ENOMEM;
++
++ return 0;
++}
++
++static void ax88772_unbind(struct usbnet *dev, struct usb_interface *intf)
++{
++ if (dev->driver_priv)
++ kfree(dev->driver_priv);
++}
++
++static const struct ethtool_ops ax88178_ethtool_ops = {
++ .get_drvinfo = asix_get_drvinfo,
++ .get_link = asix_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_wol = asix_get_wol,
++ .set_wol = asix_set_wol,
++ .get_eeprom_len = asix_get_eeprom_len,
++ .get_eeprom = asix_get_eeprom,
++ .set_eeprom = asix_set_eeprom,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .nway_reset = usbnet_nway_reset,
++};
++
++static int marvell_phy_init(struct usbnet *dev)
++{
++ struct asix_data *data = (struct asix_data *)&dev->data;
++ u16 reg;
++
++ netdev_dbg(dev->net, "marvell_phy_init()\n");
++
++ reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_MARVELL_STATUS);
++ netdev_dbg(dev->net, "MII_MARVELL_STATUS = 0x%04x\n", reg);
++
++ asix_mdio_write(dev->net, dev->mii.phy_id, MII_MARVELL_CTRL,
++ MARVELL_CTRL_RXDELAY | MARVELL_CTRL_TXDELAY);
++
++ if (data->ledmode) {
++ reg = asix_mdio_read(dev->net, dev->mii.phy_id,
++ MII_MARVELL_LED_CTRL);
++ netdev_dbg(dev->net, "MII_MARVELL_LED_CTRL (1) = 0x%04x\n", reg);
++
++ reg &= 0xf8ff;
++ reg |= (1 + 0x0100);
++ asix_mdio_write(dev->net, dev->mii.phy_id,
++ MII_MARVELL_LED_CTRL, reg);
++
++ reg = asix_mdio_read(dev->net, dev->mii.phy_id,
++ MII_MARVELL_LED_CTRL);
++ netdev_dbg(dev->net, "MII_MARVELL_LED_CTRL (2) = 0x%04x\n", reg);
++ reg &= 0xfc0f;
++ }
++
++ return 0;
++}
++
++static int rtl8211cl_phy_init(struct usbnet *dev)
++{
++ struct asix_data *data = (struct asix_data *)&dev->data;
++
++ netdev_dbg(dev->net, "rtl8211cl_phy_init()\n");
++
++ asix_mdio_write (dev->net, dev->mii.phy_id, 0x1f, 0x0005);
++ asix_mdio_write (dev->net, dev->mii.phy_id, 0x0c, 0);
++ asix_mdio_write (dev->net, dev->mii.phy_id, 0x01,
++ asix_mdio_read (dev->net, dev->mii.phy_id, 0x01) | 0x0080);
++ asix_mdio_write (dev->net, dev->mii.phy_id, 0x1f, 0);
++
++ if (data->ledmode == 12) {
++ asix_mdio_write (dev->net, dev->mii.phy_id, 0x1f, 0x0002);
++ asix_mdio_write (dev->net, dev->mii.phy_id, 0x1a, 0x00cb);
++ asix_mdio_write (dev->net, dev->mii.phy_id, 0x1f, 0);
++ }
++
++ return 0;
++}
++
++static int marvell_led_status(struct usbnet *dev, u16 speed)
++{
++ u16 reg = asix_mdio_read(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL);
++
++ netdev_dbg(dev->net, "marvell_led_status() read 0x%04x\n", reg);
++
++ /* Clear out the center LED bits - 0x03F0 */
++ reg &= 0xfc0f;
++
++ switch (speed) {
++ case SPEED_1000:
++ reg |= 0x03e0;
++ break;
++ case SPEED_100:
++ reg |= 0x03b0;
++ break;
++ default:
++ reg |= 0x02f0;
++ }
++
++ netdev_dbg(dev->net, "marvell_led_status() writing 0x%04x\n", reg);
++ asix_mdio_write(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL, reg);
++
++ return 0;
++}
++
++static int ax88178_reset(struct usbnet *dev)
++{
++ struct asix_data *data = (struct asix_data *)&dev->data;
++ int ret;
++ __le16 eeprom;
++ u8 status;
++ int gpio0 = 0;
++ u32 phyid;
++
++ asix_read_cmd(dev, AX_CMD_READ_GPIOS, 0, 0, 1, &status);
++ netdev_dbg(dev->net, "GPIO Status: 0x%04x\n", status);
++
++ asix_write_cmd(dev, AX_CMD_WRITE_ENABLE, 0, 0, 0, NULL);
++ asix_read_cmd(dev, AX_CMD_READ_EEPROM, 0x0017, 0, 2, &eeprom);
++ asix_write_cmd(dev, AX_CMD_WRITE_DISABLE, 0, 0, 0, NULL);
++
++ netdev_dbg(dev->net, "EEPROM index 0x17 is 0x%04x\n", eeprom);
++
++ if (eeprom == cpu_to_le16(0xffff)) {
++ data->phymode = PHY_MODE_MARVELL;
++ data->ledmode = 0;
++ gpio0 = 1;
++ } else {
++ data->phymode = le16_to_cpu(eeprom) & 0x7F;
++ data->ledmode = le16_to_cpu(eeprom) >> 8;
++ gpio0 = (le16_to_cpu(eeprom) & 0x80) ? 0 : 1;
++ }
++ netdev_dbg(dev->net, "GPIO0: %d, PhyMode: %d\n", gpio0, data->phymode);
++
++ /* Power up external GigaPHY through AX88178 GPIO pin */
++ asix_write_gpio(dev, AX_GPIO_RSE | AX_GPIO_GPO_1 | AX_GPIO_GPO1EN, 40);
++ if ((le16_to_cpu(eeprom) >> 8) != 1) {
++ asix_write_gpio(dev, 0x003c, 30);
++ asix_write_gpio(dev, 0x001c, 300);
++ asix_write_gpio(dev, 0x003c, 30);
++ } else {
++ netdev_dbg(dev->net, "gpio phymode == 1 path\n");
++ asix_write_gpio(dev, AX_GPIO_GPO1EN, 30);
++ asix_write_gpio(dev, AX_GPIO_GPO1EN | AX_GPIO_GPO_1, 30);
++ }
++
++ /* Read PHYID register *AFTER* powering up PHY */
++ phyid = asix_get_phyid(dev);
++ netdev_dbg(dev->net, "PHYID=0x%08x\n", phyid);
++
++ /* Set AX88178 to enable MII/GMII/RGMII interface for external PHY */
++ asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 0, 0, 0, NULL);
++
++ asix_sw_reset(dev, 0);
++ msleep(150);
++
++ asix_sw_reset(dev, AX_SWRESET_PRL | AX_SWRESET_IPPD);
++ msleep(150);
++
++ asix_write_rx_ctl(dev, 0);
++
++ if (data->phymode == PHY_MODE_MARVELL) {
++ marvell_phy_init(dev);
++ msleep(60);
++ } else if (data->phymode == PHY_MODE_RTL8211CL)
++ rtl8211cl_phy_init(dev);
++
++ asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR,
++ BMCR_RESET | BMCR_ANENABLE);
++ asix_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
++ ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
++ asix_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
++ ADVERTISE_1000FULL);
++
++ mii_nway_restart(&dev->mii);
++
++ ret = asix_write_medium_mode(dev, AX88178_MEDIUM_DEFAULT);
++ if (ret < 0)
++ return ret;
++
++ /* Rewrite MAC address */
++ memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
++ data->mac_addr);
++ if (ret < 0)
++ return ret;
++
++ ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL);
++ if (ret < 0)
++ return ret;
++
++ return 0;
++}
++
++static int ax88178_link_reset(struct usbnet *dev)
++{
++ u16 mode;
++ struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
++ struct asix_data *data = (struct asix_data *)&dev->data;
++ u32 speed;
++
++ netdev_dbg(dev->net, "ax88178_link_reset()\n");
++
++ mii_check_media(&dev->mii, 1, 1);
++ mii_ethtool_gset(&dev->mii, &ecmd);
++ mode = AX88178_MEDIUM_DEFAULT;
++ speed = ethtool_cmd_speed(&ecmd);
++
++ if (speed == SPEED_1000)
++ mode |= AX_MEDIUM_GM;
++ else if (speed == SPEED_100)
++ mode |= AX_MEDIUM_PS;
++ else
++ mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM);
++
++ mode |= AX_MEDIUM_ENCK;
++
++ if (ecmd.duplex == DUPLEX_FULL)
++ mode |= AX_MEDIUM_FD;
++ else
++ mode &= ~AX_MEDIUM_FD;
++
++ netdev_dbg(dev->net, "ax88178_link_reset() speed: %u duplex: %d setting mode to 0x%04x\n",
++ speed, ecmd.duplex, mode);
++
++ asix_write_medium_mode(dev, mode);
++
++ if (data->phymode == PHY_MODE_MARVELL && data->ledmode)
++ marvell_led_status(dev, speed);
++
++ return 0;
++}
++
++static void ax88178_set_mfb(struct usbnet *dev)
++{
++ u16 mfb = AX_RX_CTL_MFB_16384;
++ u16 rxctl;
++ u16 medium;
++ int old_rx_urb_size = dev->rx_urb_size;
++
++ if (dev->hard_mtu < 2048) {
++ dev->rx_urb_size = 2048;
++ mfb = AX_RX_CTL_MFB_2048;
++ } else if (dev->hard_mtu < 4096) {
++ dev->rx_urb_size = 4096;
++ mfb = AX_RX_CTL_MFB_4096;
++ } else if (dev->hard_mtu < 8192) {
++ dev->rx_urb_size = 8192;
++ mfb = AX_RX_CTL_MFB_8192;
++ } else if (dev->hard_mtu < 16384) {
++ dev->rx_urb_size = 16384;
++ mfb = AX_RX_CTL_MFB_16384;
++ }
++
++ rxctl = asix_read_rx_ctl(dev);
++ asix_write_rx_ctl(dev, (rxctl & ~AX_RX_CTL_MFB_16384) | mfb);
++
++ medium = asix_read_medium_status(dev);
++ if (dev->net->mtu > 1500)
++ medium |= AX_MEDIUM_JFE;
++ else
++ medium &= ~AX_MEDIUM_JFE;
++ asix_write_medium_mode(dev, medium);
++
++ if (dev->rx_urb_size > old_rx_urb_size)
++ usbnet_unlink_rx_urbs(dev);
++}
++
++static int ax88178_change_mtu(struct net_device *net, int new_mtu)
++{
++ struct usbnet *dev = netdev_priv(net);
++ int ll_mtu = new_mtu + net->hard_header_len + 4;
++
++ netdev_dbg(dev->net, "ax88178_change_mtu() new_mtu=%d\n", new_mtu);
++
++ if (new_mtu <= 0 || ll_mtu > 16384)
++ return -EINVAL;
++
++ if ((ll_mtu % dev->maxpacket) == 0)
++ return -EDOM;
++
++ net->mtu = new_mtu;
++ dev->hard_mtu = net->mtu + net->hard_header_len;
++ ax88178_set_mfb(dev);
++
++ /* max qlen depend on hard_mtu and rx_urb_size */
++ usbnet_update_max_qlen(dev);
++
++ return 0;
++}
++
++static const struct net_device_ops ax88178_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_set_mac_address = asix_set_mac_address,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_set_rx_mode = asix_set_multicast,
++ .ndo_do_ioctl = asix_ioctl,
++ .ndo_change_mtu = ax88178_change_mtu,
++};
++
++static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int ret;
++ u8 buf[ETH_ALEN];
++
++ usbnet_get_endpoints(dev,intf);
++
++ /* Get the MAC address */
++ ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Failed to read MAC address: %d\n", ret);
++ return ret;
++ }
++
++ asix_set_netdev_dev_addr(dev, buf);
++
++ /* Initialize MII structure */
++ dev->mii.dev = dev->net;
++ dev->mii.mdio_read = asix_mdio_read;
++ dev->mii.mdio_write = asix_mdio_write;
++ dev->mii.phy_id_mask = 0x1f;
++ dev->mii.reg_num_mask = 0xff;
++ dev->mii.supports_gmii = 1;
++ dev->mii.phy_id = asix_get_phy_addr(dev);
++
++ dev->net->netdev_ops = &ax88178_netdev_ops;
++ dev->net->ethtool_ops = &ax88178_ethtool_ops;
++
++ /* Blink LEDS so users know driver saw dongle */
++ asix_sw_reset(dev, 0);
++ msleep(150);
++
++ asix_sw_reset(dev, AX_SWRESET_PRL | AX_SWRESET_IPPD);
++ msleep(150);
++
++ /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
++ if (dev->driver_info->flags & FLAG_FRAMING_AX) {
++ /* hard_mtu is still the default - the device does not support
++ jumbo eth frames */
++ dev->rx_urb_size = 2048;
++ }
++
++ dev->driver_priv = kzalloc(sizeof(struct asix_common_private), GFP_KERNEL);
++ if (!dev->driver_priv)
++ return -ENOMEM;
++
++ return 0;
++}
++
++static const struct driver_info ax8817x_info = {
++ .description = "ASIX AX8817x USB 2.0 Ethernet",
++ .bind = ax88172_bind,
++ .status = asix_status,
++ .link_reset = ax88172_link_reset,
++ .reset = ax88172_link_reset,
++ .flags = FLAG_ETHER | FLAG_LINK_INTR,
++ .data = 0x00130103,
++};
++
++static const struct driver_info dlink_dub_e100_info = {
++ .description = "DLink DUB-E100 USB Ethernet",
++ .bind = ax88172_bind,
++ .status = asix_status,
++ .link_reset = ax88172_link_reset,
++ .reset = ax88172_link_reset,
++ .flags = FLAG_ETHER | FLAG_LINK_INTR,
++ .data = 0x009f9d9f,
++};
++
++static const struct driver_info netgear_fa120_info = {
++ .description = "Netgear FA-120 USB Ethernet",
++ .bind = ax88172_bind,
++ .status = asix_status,
++ .link_reset = ax88172_link_reset,
++ .reset = ax88172_link_reset,
++ .flags = FLAG_ETHER | FLAG_LINK_INTR,
++ .data = 0x00130103,
++};
++
++static const struct driver_info hawking_uf200_info = {
++ .description = "Hawking UF200 USB Ethernet",
++ .bind = ax88172_bind,
++ .status = asix_status,
++ .link_reset = ax88172_link_reset,
++ .reset = ax88172_link_reset,
++ .flags = FLAG_ETHER | FLAG_LINK_INTR,
++ .data = 0x001f1d1f,
++};
++
++static const struct driver_info ax88772_info = {
++ .description = "ASIX AX88772 USB 2.0 Ethernet",
++ .bind = ax88772_bind,
++ .unbind = ax88772_unbind,
++ .status = asix_status,
++ .link_reset = ax88772_link_reset,
++ .reset = ax88772_link_reset,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | FLAG_MULTI_PACKET,
++ .rx_fixup = asix_rx_fixup_common,
++ .tx_fixup = asix_tx_fixup,
++};
++
++static const struct driver_info ax88772b_info = {
++ .description = "ASIX AX88772B USB 2.0 Ethernet",
++ .bind = ax88772_bind,
++ .unbind = ax88772_unbind,
++ .status = asix_status,
++ .link_reset = ax88772_link_reset,
++ .reset = ax88772_reset,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
++ FLAG_MULTI_PACKET,
++ .rx_fixup = asix_rx_fixup_common,
++ .tx_fixup = asix_tx_fixup,
++ .data = FLAG_EEPROM_MAC,
++};
++
++static const struct driver_info ax88178_info = {
++ .description = "ASIX AX88178 USB 2.0 Ethernet",
++ .bind = ax88178_bind,
++ .unbind = ax88772_unbind,
++ .status = asix_status,
++ .link_reset = ax88178_link_reset,
++ .reset = ax88178_reset,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
++ FLAG_MULTI_PACKET,
++ .rx_fixup = asix_rx_fixup_common,
++ .tx_fixup = asix_tx_fixup,
++};
++
++/*
++ * USBLINK 20F9 "USB 2.0 LAN" USB ethernet adapter, typically found in
++ * no-name packaging.
++ * USB device strings are:
++ * 1: Manufacturer: USBLINK
++ * 2: Product: HG20F9 USB2.0
++ * 3: Serial: 000003
++ * Appears to be compatible with Asix 88772B.
++ */
++static const struct driver_info hg20f9_info = {
++ .description = "HG20F9 USB 2.0 Ethernet",
++ .bind = ax88772_bind,
++ .unbind = ax88772_unbind,
++ .status = asix_status,
++ .link_reset = ax88772_link_reset,
++ .reset = ax88772_reset,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
++ FLAG_MULTI_PACKET,
++ .rx_fixup = asix_rx_fixup_common,
++ .tx_fixup = asix_tx_fixup,
++ .data = FLAG_EEPROM_MAC,
++};
++
++static const struct usb_device_id products [] = {
++{
++ // Linksys USB200M
++ USB_DEVICE (0x077b, 0x2226),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // Netgear FA120
++ USB_DEVICE (0x0846, 0x1040),
++ .driver_info = (unsigned long) &netgear_fa120_info,
++}, {
++ // DLink DUB-E100
++ USB_DEVICE (0x2001, 0x1a00),
++ .driver_info = (unsigned long) &dlink_dub_e100_info,
++}, {
++ // Intellinet, ST Lab USB Ethernet
++ USB_DEVICE (0x0b95, 0x1720),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // Hawking UF200, TrendNet TU2-ET100
++ USB_DEVICE (0x07b8, 0x420a),
++ .driver_info = (unsigned long) &hawking_uf200_info,
++}, {
++ // Billionton Systems, USB2AR
++ USB_DEVICE (0x08dd, 0x90ff),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // ATEN UC210T
++ USB_DEVICE (0x0557, 0x2009),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // Buffalo LUA-U2-KTX
++ USB_DEVICE (0x0411, 0x003d),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // Buffalo LUA-U2-GT 10/100/1000
++ USB_DEVICE (0x0411, 0x006e),
++ .driver_info = (unsigned long) &ax88178_info,
++}, {
++ // Sitecom LN-029 "USB 2.0 10/100 Ethernet adapter"
++ USB_DEVICE (0x6189, 0x182d),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // Sitecom LN-031 "USB 2.0 10/100/1000 Ethernet adapter"
++ USB_DEVICE (0x0df6, 0x0056),
++ .driver_info = (unsigned long) &ax88178_info,
++}, {
++ // corega FEther USB2-TX
++ USB_DEVICE (0x07aa, 0x0017),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // Surecom EP-1427X-2
++ USB_DEVICE (0x1189, 0x0893),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // goodway corp usb gwusb2e
++ USB_DEVICE (0x1631, 0x6200),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // JVC MP-PRX1 Port Replicator
++ USB_DEVICE (0x04f1, 0x3008),
++ .driver_info = (unsigned long) &ax8817x_info,
++}, {
++ // Lenovo U2L100P 10/100
++ USB_DEVICE (0x17ef, 0x7203),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // ASIX AX88772B 10/100
++ USB_DEVICE (0x0b95, 0x772b),
++ .driver_info = (unsigned long) &ax88772b_info,
++}, {
++ // ASIX AX88772 10/100
++ USB_DEVICE (0x0b95, 0x7720),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // ASIX AX88178 10/100/1000
++ USB_DEVICE (0x0b95, 0x1780),
++ .driver_info = (unsigned long) &ax88178_info,
++}, {
++ // Logitec LAN-GTJ/U2A
++ USB_DEVICE (0x0789, 0x0160),
++ .driver_info = (unsigned long) &ax88178_info,
++}, {
++ // Linksys USB200M Rev 2
++ USB_DEVICE (0x13b1, 0x0018),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // 0Q0 cable ethernet
++ USB_DEVICE (0x1557, 0x7720),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // DLink DUB-E100 H/W Ver B1
++ USB_DEVICE (0x07d1, 0x3c05),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // DLink DUB-E100 H/W Ver B1 Alternate
++ USB_DEVICE (0x2001, 0x3c05),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // DLink DUB-E100 H/W Ver C1
++ USB_DEVICE (0x2001, 0x1a02),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // Linksys USB1000
++ USB_DEVICE (0x1737, 0x0039),
++ .driver_info = (unsigned long) &ax88178_info,
++}, {
++ // IO-DATA ETG-US2
++ USB_DEVICE (0x04bb, 0x0930),
++ .driver_info = (unsigned long) &ax88178_info,
++}, {
++ // Belkin F5D5055
++ USB_DEVICE(0x050d, 0x5055),
++ .driver_info = (unsigned long) &ax88178_info,
++}, {
++ // Apple USB Ethernet Adapter
++ USB_DEVICE(0x05ac, 0x1402),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // Cables-to-Go USB Ethernet Adapter
++ USB_DEVICE(0x0b95, 0x772a),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // ABOCOM for pci
++ USB_DEVICE(0x14ea, 0xab11),
++ .driver_info = (unsigned long) &ax88178_info,
++}, {
++ // ASIX 88772a
++ USB_DEVICE(0x0db0, 0xa877),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ // Asus USB Ethernet Adapter
++ USB_DEVICE (0x0b95, 0x7e2b),
++ .driver_info = (unsigned long) &ax88772_info,
++}, {
++ /* ASIX 88172a demo board */
++ USB_DEVICE(0x0b95, 0x172a),
++ .driver_info = (unsigned long) &ax88172a_info,
++}, {
++ /*
++ * USBLINK HG20F9 "USB 2.0 LAN"
++ * Appears to have gazumped Linksys's manufacturer ID but
++ * doesn't (yet) conflict with any known Linksys product.
++ */
++ USB_DEVICE(0x066b, 0x20f9),
++ .driver_info = (unsigned long) &hg20f9_info,
++},
++ { }, // END
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver asix_driver = {
++ .name = DRIVER_NAME,
++ .id_table = products,
++ .probe = usbnet_probe,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disconnect = usbnet_disconnect,
++ .supports_autosuspend = 1,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(asix_driver);
++
++MODULE_AUTHOR("David Hollis");
++MODULE_VERSION(DRIVER_VERSION);
++MODULE_DESCRIPTION("ASIX AX8817X based USB 2.0 Ethernet Devices");
++MODULE_LICENSE("GPL");
++
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix.h backports-3.18.1-1/drivers/net/usb/asix.h
+--- backports-3.18.1-1.org/drivers/net/usb/asix.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/asix.h 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,234 @@
++/*
++ * ASIX AX8817X based USB 2.0 Ethernet Devices
++ * Copyright (C) 2003-2006 David Hollis <dhollis@davehollis.com>
++ * Copyright (C) 2005 Phil Chang <pchang23@sbcglobal.net>
++ * Copyright (C) 2006 James Painter <jamie.painter@iname.com>
++ * Copyright (c) 2002-2003 TiVo Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#ifndef _ASIX_H
++#define _ASIX_H
++
++// #define DEBUG // error path messages, extra info
++// #define VERBOSE // more; success messages
++
++#include <linux/module.h>
++#include <linux/kmod.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/crc32.h>
++#include <linux/usb/usbnet.h>
++#include <linux/slab.h>
++#include <linux/if_vlan.h>
++
++#define DRIVER_VERSION "22-Dec-2011"
++#define DRIVER_NAME "asix"
++
++/* ASIX AX8817X based USB 2.0 Ethernet Devices */
++
++#define AX_CMD_SET_SW_MII 0x06
++#define AX_CMD_READ_MII_REG 0x07
++#define AX_CMD_WRITE_MII_REG 0x08
++#define AX_CMD_SET_HW_MII 0x0a
++#define AX_CMD_READ_EEPROM 0x0b
++#define AX_CMD_WRITE_EEPROM 0x0c
++#define AX_CMD_WRITE_ENABLE 0x0d
++#define AX_CMD_WRITE_DISABLE 0x0e
++#define AX_CMD_READ_RX_CTL 0x0f
++#define AX_CMD_WRITE_RX_CTL 0x10
++#define AX_CMD_READ_IPG012 0x11
++#define AX_CMD_WRITE_IPG0 0x12
++#define AX_CMD_WRITE_IPG1 0x13
++#define AX_CMD_READ_NODE_ID 0x13
++#define AX_CMD_WRITE_NODE_ID 0x14
++#define AX_CMD_WRITE_IPG2 0x14
++#define AX_CMD_WRITE_MULTI_FILTER 0x16
++#define AX88172_CMD_READ_NODE_ID 0x17
++#define AX_CMD_READ_PHY_ID 0x19
++#define AX_CMD_READ_MEDIUM_STATUS 0x1a
++#define AX_CMD_WRITE_MEDIUM_MODE 0x1b
++#define AX_CMD_READ_MONITOR_MODE 0x1c
++#define AX_CMD_WRITE_MONITOR_MODE 0x1d
++#define AX_CMD_READ_GPIOS 0x1e
++#define AX_CMD_WRITE_GPIOS 0x1f
++#define AX_CMD_SW_RESET 0x20
++#define AX_CMD_SW_PHY_STATUS 0x21
++#define AX_CMD_SW_PHY_SELECT 0x22
++
++#define AX_PHY_SELECT_MASK (BIT(3) | BIT(2))
++#define AX_PHY_SELECT_INTERNAL 0
++#define AX_PHY_SELECT_EXTERNAL BIT(2)
++
++#define AX_MONITOR_MODE 0x01
++#define AX_MONITOR_LINK 0x02
++#define AX_MONITOR_MAGIC 0x04
++#define AX_MONITOR_HSFS 0x10
++
++/* AX88172 Medium Status Register values */
++#define AX88172_MEDIUM_FD 0x02
++#define AX88172_MEDIUM_TX 0x04
++#define AX88172_MEDIUM_FC 0x10
++#define AX88172_MEDIUM_DEFAULT \
++ ( AX88172_MEDIUM_FD | AX88172_MEDIUM_TX | AX88172_MEDIUM_FC )
++
++#define AX_MCAST_FILTER_SIZE 8
++#define AX_MAX_MCAST 64
++
++#define AX_SWRESET_CLEAR 0x00
++#define AX_SWRESET_RR 0x01
++#define AX_SWRESET_RT 0x02
++#define AX_SWRESET_PRTE 0x04
++#define AX_SWRESET_PRL 0x08
++#define AX_SWRESET_BZ 0x10
++#define AX_SWRESET_IPRL 0x20
++#define AX_SWRESET_IPPD 0x40
++
++#define AX88772_IPG0_DEFAULT 0x15
++#define AX88772_IPG1_DEFAULT 0x0c
++#define AX88772_IPG2_DEFAULT 0x12
++
++/* AX88772 & AX88178 Medium Mode Register */
++#define AX_MEDIUM_PF 0x0080
++#define AX_MEDIUM_JFE 0x0040
++#define AX_MEDIUM_TFC 0x0020
++#define AX_MEDIUM_RFC 0x0010
++#define AX_MEDIUM_ENCK 0x0008
++#define AX_MEDIUM_AC 0x0004
++#define AX_MEDIUM_FD 0x0002
++#define AX_MEDIUM_GM 0x0001
++#define AX_MEDIUM_SM 0x1000
++#define AX_MEDIUM_SBP 0x0800
++#define AX_MEDIUM_PS 0x0200
++#define AX_MEDIUM_RE 0x0100
++
++#define AX88178_MEDIUM_DEFAULT \
++ (AX_MEDIUM_PS | AX_MEDIUM_FD | AX_MEDIUM_AC | \
++ AX_MEDIUM_RFC | AX_MEDIUM_TFC | AX_MEDIUM_JFE | \
++ AX_MEDIUM_RE)
++
++#define AX88772_MEDIUM_DEFAULT \
++ (AX_MEDIUM_FD | AX_MEDIUM_RFC | \
++ AX_MEDIUM_TFC | AX_MEDIUM_PS | \
++ AX_MEDIUM_AC | AX_MEDIUM_RE)
++
++/* AX88772 & AX88178 RX_CTL values */
++#define AX_RX_CTL_SO 0x0080
++#define AX_RX_CTL_AP 0x0020
++#define AX_RX_CTL_AM 0x0010
++#define AX_RX_CTL_AB 0x0008
++#define AX_RX_CTL_SEP 0x0004
++#define AX_RX_CTL_AMALL 0x0002
++#define AX_RX_CTL_PRO 0x0001
++#define AX_RX_CTL_MFB_2048 0x0000
++#define AX_RX_CTL_MFB_4096 0x0100
++#define AX_RX_CTL_MFB_8192 0x0200
++#define AX_RX_CTL_MFB_16384 0x0300
++
++#define AX_DEFAULT_RX_CTL (AX_RX_CTL_SO | AX_RX_CTL_AB)
++
++/* GPIO 0 .. 2 toggles */
++#define AX_GPIO_GPO0EN 0x01 /* GPIO0 Output enable */
++#define AX_GPIO_GPO_0 0x02 /* GPIO0 Output value */
++#define AX_GPIO_GPO1EN 0x04 /* GPIO1 Output enable */
++#define AX_GPIO_GPO_1 0x08 /* GPIO1 Output value */
++#define AX_GPIO_GPO2EN 0x10 /* GPIO2 Output enable */
++#define AX_GPIO_GPO_2 0x20 /* GPIO2 Output value */
++#define AX_GPIO_RESERVED 0x40 /* Reserved */
++#define AX_GPIO_RSE 0x80 /* Reload serial EEPROM */
++
++#define AX_EEPROM_MAGIC 0xdeadbeef
++#define AX_EEPROM_LEN 0x200
++
++/* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
++struct asix_data {
++ u8 multi_filter[AX_MCAST_FILTER_SIZE];
++ u8 mac_addr[ETH_ALEN];
++ u8 phymode;
++ u8 ledmode;
++ u8 res;
++};
++
++struct asix_rx_fixup_info {
++ struct sk_buff *ax_skb;
++ u32 header;
++ u16 size;
++ bool split_head;
++};
++
++struct asix_common_private {
++ struct asix_rx_fixup_info rx_fixup_info;
++};
++
++extern const struct driver_info ax88172a_info;
++
++/* ASIX specific flags */
++#define FLAG_EEPROM_MAC (1UL << 0) /* init device MAC from eeprom */
++
++int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data);
++
++int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data);
++
++void asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value,
++ u16 index, u16 size, void *data);
++
++int asix_rx_fixup_internal(struct usbnet *dev, struct sk_buff *skb,
++ struct asix_rx_fixup_info *rx);
++int asix_rx_fixup_common(struct usbnet *dev, struct sk_buff *skb);
++
++struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
++ gfp_t flags);
++
++int asix_set_sw_mii(struct usbnet *dev);
++int asix_set_hw_mii(struct usbnet *dev);
++
++int asix_read_phy_addr(struct usbnet *dev, int internal);
++int asix_get_phy_addr(struct usbnet *dev);
++
++int asix_sw_reset(struct usbnet *dev, u8 flags);
++
++u16 asix_read_rx_ctl(struct usbnet *dev);
++int asix_write_rx_ctl(struct usbnet *dev, u16 mode);
++
++u16 asix_read_medium_status(struct usbnet *dev);
++int asix_write_medium_mode(struct usbnet *dev, u16 mode);
++
++int asix_write_gpio(struct usbnet *dev, u16 value, int sleep);
++
++void asix_set_multicast(struct net_device *net);
++
++int asix_mdio_read(struct net_device *netdev, int phy_id, int loc);
++void asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val);
++
++void asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo);
++int asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo);
++
++int asix_get_eeprom_len(struct net_device *net);
++int asix_get_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom,
++ u8 *data);
++int asix_set_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom,
++ u8 *data);
++
++void asix_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info);
++
++int asix_set_mac_address(struct net_device *net, void *p);
++
++#endif /* _ASIX_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/ax88172a.c backports-3.18.1-1/drivers/net/usb/ax88172a.c
+--- backports-3.18.1-1.org/drivers/net/usb/ax88172a.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/ax88172a.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,422 @@
++/*
++ * ASIX AX88172A based USB 2.0 Ethernet Devices
++ * Copyright (C) 2012 OMICRON electronics GmbH
++ *
++ * Supports external PHYs via phylib. Based on the driver for the
++ * AX88772. Original copyrights follow:
++ *
++ * Copyright (C) 2003-2006 David Hollis <dhollis@davehollis.com>
++ * Copyright (C) 2005 Phil Chang <pchang23@sbcglobal.net>
++ * Copyright (C) 2006 James Painter <jamie.painter@iname.com>
++ * Copyright (c) 2002-2003 TiVo Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include "asix.h"
++#include <linux/phy.h>
++
++struct ax88172a_private {
++ struct mii_bus *mdio;
++ struct phy_device *phydev;
++ char phy_name[20];
++ u16 phy_addr;
++ u16 oldmode;
++ int use_embdphy;
++ struct asix_rx_fixup_info rx_fixup_info;
++};
++
++/* MDIO read and write wrappers for phylib */
++static int asix_mdio_bus_read(struct mii_bus *bus, int phy_id, int regnum)
++{
++ return asix_mdio_read(((struct usbnet *)bus->priv)->net, phy_id,
++ regnum);
++}
++
++static int asix_mdio_bus_write(struct mii_bus *bus, int phy_id, int regnum,
++ u16 val)
++{
++ asix_mdio_write(((struct usbnet *)bus->priv)->net, phy_id, regnum, val);
++ return 0;
++}
++
++static int ax88172a_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
++{
++ if (!netif_running(net))
++ return -EINVAL;
++
++ if (!net->phydev)
++ return -ENODEV;
++
++ return phy_mii_ioctl(net->phydev, rq, cmd);
++}
++
++/* set MAC link settings according to information from phylib */
++static void ax88172a_adjust_link(struct net_device *netdev)
++{
++ struct phy_device *phydev = netdev->phydev;
++ struct usbnet *dev = netdev_priv(netdev);
++ struct ax88172a_private *priv = dev->driver_priv;
++ u16 mode = 0;
++
++ if (phydev->link) {
++ mode = AX88772_MEDIUM_DEFAULT;
++
++ if (phydev->duplex == DUPLEX_HALF)
++ mode &= ~AX_MEDIUM_FD;
++
++ if (phydev->speed != SPEED_100)
++ mode &= ~AX_MEDIUM_PS;
++ }
++
++ if (mode != priv->oldmode) {
++ asix_write_medium_mode(dev, mode);
++ priv->oldmode = mode;
++ netdev_dbg(netdev, "speed %u duplex %d, setting mode to 0x%04x\n",
++ phydev->speed, phydev->duplex, mode);
++ phy_print_status(phydev);
++ }
++}
++
++static void ax88172a_status(struct usbnet *dev, struct urb *urb)
++{
++ /* link changes are detected by polling the phy */
++}
++
++/* use phylib infrastructure */
++static int ax88172a_init_mdio(struct usbnet *dev)
++{
++ struct ax88172a_private *priv = dev->driver_priv;
++ int ret, i;
++
++ priv->mdio = mdiobus_alloc();
++ if (!priv->mdio) {
++ netdev_err(dev->net, "Could not allocate MDIO bus\n");
++ return -ENOMEM;
++ }
++
++ priv->mdio->priv = (void *)dev;
++ priv->mdio->read = &asix_mdio_bus_read;
++ priv->mdio->write = &asix_mdio_bus_write;
++ priv->mdio->name = "Asix MDIO Bus";
++ /* mii bus name is usb-<usb bus number>-<usb device number> */
++ snprintf(priv->mdio->id, MII_BUS_ID_SIZE, "usb-%03d:%03d",
++ dev->udev->bus->busnum, dev->udev->devnum);
++
++ priv->mdio->irq = kzalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
++ if (!priv->mdio->irq) {
++ ret = -ENOMEM;
++ goto mfree;
++ }
++ for (i = 0; i < PHY_MAX_ADDR; i++)
++ priv->mdio->irq[i] = PHY_POLL;
++
++ ret = mdiobus_register(priv->mdio);
++ if (ret) {
++ netdev_err(dev->net, "Could not register MDIO bus\n");
++ goto ifree;
++ }
++
++ netdev_info(dev->net, "registered mdio bus %s\n", priv->mdio->id);
++ return 0;
++
++ifree:
++ kfree(priv->mdio->irq);
++mfree:
++ mdiobus_free(priv->mdio);
++ return ret;
++}
++
++static void ax88172a_remove_mdio(struct usbnet *dev)
++{
++ struct ax88172a_private *priv = dev->driver_priv;
++
++ netdev_info(dev->net, "deregistering mdio bus %s\n", priv->mdio->id);
++ mdiobus_unregister(priv->mdio);
++ kfree(priv->mdio->irq);
++ mdiobus_free(priv->mdio);
++}
++
++static const struct net_device_ops ax88172a_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_set_mac_address = asix_set_mac_address,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = ax88172a_ioctl,
++ .ndo_set_rx_mode = asix_set_multicast,
++};
++
++static int ax88172a_get_settings(struct net_device *net,
++ struct ethtool_cmd *cmd)
++{
++ if (!net->phydev)
++ return -ENODEV;
++
++ return phy_ethtool_gset(net->phydev, cmd);
++}
++
++static int ax88172a_set_settings(struct net_device *net,
++ struct ethtool_cmd *cmd)
++{
++ if (!net->phydev)
++ return -ENODEV;
++
++ return phy_ethtool_sset(net->phydev, cmd);
++}
++
++static int ax88172a_nway_reset(struct net_device *net)
++{
++ if (!net->phydev)
++ return -ENODEV;
++
++ return phy_start_aneg(net->phydev);
++}
++
++static const struct ethtool_ops ax88172a_ethtool_ops = {
++ .get_drvinfo = asix_get_drvinfo,
++ .get_link = usbnet_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_wol = asix_get_wol,
++ .set_wol = asix_set_wol,
++ .get_eeprom_len = asix_get_eeprom_len,
++ .get_eeprom = asix_get_eeprom,
++ .set_eeprom = asix_set_eeprom,
++ .get_settings = ax88172a_get_settings,
++ .set_settings = ax88172a_set_settings,
++ .nway_reset = ax88172a_nway_reset,
++};
++
++static int ax88172a_reset_phy(struct usbnet *dev, int embd_phy)
++{
++ int ret;
++
++ ret = asix_sw_reset(dev, AX_SWRESET_IPPD);
++ if (ret < 0)
++ goto err;
++
++ msleep(150);
++ ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
++ if (ret < 0)
++ goto err;
++
++ msleep(150);
++
++ ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_IPPD);
++ if (ret < 0)
++ goto err;
++
++ return 0;
++
++err:
++ return ret;
++}
++
++
++static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int ret;
++ u8 buf[ETH_ALEN];
++ struct ax88172a_private *priv;
++
++ usbnet_get_endpoints(dev, intf);
++
++ priv = kzalloc(sizeof(*priv), GFP_KERNEL);
++ if (!priv)
++ return -ENOMEM;
++
++ dev->driver_priv = priv;
++
++ /* Get the MAC address */
++ ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
++ if (ret < 0) {
++ netdev_err(dev->net, "Failed to read MAC address: %d\n", ret);
++ goto free;
++ }
++ memcpy(dev->net->dev_addr, buf, ETH_ALEN);
++
++ dev->net->netdev_ops = &ax88172a_netdev_ops;
++ dev->net->ethtool_ops = &ax88172a_ethtool_ops;
++
++ /* are we using the internal or the external phy? */
++ ret = asix_read_cmd(dev, AX_CMD_SW_PHY_STATUS, 0, 0, 1, buf);
++ if (ret < 0) {
++ netdev_err(dev->net, "Failed to read software interface selection register: %d\n",
++ ret);
++ goto free;
++ }
++
++ netdev_dbg(dev->net, "AX_CMD_SW_PHY_STATUS = 0x%02x\n", buf[0]);
++ switch (buf[0] & AX_PHY_SELECT_MASK) {
++ case AX_PHY_SELECT_INTERNAL:
++ netdev_dbg(dev->net, "use internal phy\n");
++ priv->use_embdphy = 1;
++ break;
++ case AX_PHY_SELECT_EXTERNAL:
++ netdev_dbg(dev->net, "use external phy\n");
++ priv->use_embdphy = 0;
++ break;
++ default:
++ netdev_err(dev->net, "Interface mode not supported by driver\n");
++ ret = -ENOTSUPP;
++ goto free;
++ }
++
++ priv->phy_addr = asix_read_phy_addr(dev, priv->use_embdphy);
++ ax88172a_reset_phy(dev, priv->use_embdphy);
++
++ /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
++ if (dev->driver_info->flags & FLAG_FRAMING_AX) {
++ /* hard_mtu is still the default - the device does not support
++ jumbo eth frames */
++ dev->rx_urb_size = 2048;
++ }
++
++ /* init MDIO bus */
++ ret = ax88172a_init_mdio(dev);
++ if (ret)
++ goto free;
++
++ return 0;
++
++free:
++ kfree(priv);
++ return ret;
++}
++
++static int ax88172a_stop(struct usbnet *dev)
++{
++ struct ax88172a_private *priv = dev->driver_priv;
++
++ netdev_dbg(dev->net, "Stopping interface\n");
++
++ if (priv->phydev) {
++ netdev_info(dev->net, "Disconnecting from phy %s\n",
++ priv->phy_name);
++ phy_stop(priv->phydev);
++ phy_disconnect(priv->phydev);
++ }
++
++ return 0;
++}
++
++static void ax88172a_unbind(struct usbnet *dev, struct usb_interface *intf)
++{
++ struct ax88172a_private *priv = dev->driver_priv;
++
++ ax88172a_remove_mdio(dev);
++ kfree(priv);
++}
++
++static int ax88172a_reset(struct usbnet *dev)
++{
++ struct asix_data *data = (struct asix_data *)&dev->data;
++ struct ax88172a_private *priv = dev->driver_priv;
++ int ret;
++ u16 rx_ctl;
++
++ ax88172a_reset_phy(dev, priv->use_embdphy);
++
++ msleep(150);
++ rx_ctl = asix_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x after software reset\n", rx_ctl);
++ ret = asix_write_rx_ctl(dev, 0x0000);
++ if (ret < 0)
++ goto out;
++
++ rx_ctl = asix_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x setting to 0x0000\n", rx_ctl);
++
++ msleep(150);
++
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
++ AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
++ AX88772_IPG2_DEFAULT, 0, NULL);
++ if (ret < 0) {
++ netdev_err(dev->net, "Write IPG,IPG1,IPG2 failed: %d\n", ret);
++ goto out;
++ }
++
++ /* Rewrite MAC address */
++ memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
++ ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
++ data->mac_addr);
++ if (ret < 0)
++ goto out;
++
++ /* Set RX_CTL to default values with 2k buffer, and enable cactus */
++ ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL);
++ if (ret < 0)
++ goto out;
++
++ rx_ctl = asix_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x after all initializations\n",
++ rx_ctl);
++
++ rx_ctl = asix_read_medium_status(dev);
++ netdev_dbg(dev->net, "Medium Status is 0x%04x after all initializations\n",
++ rx_ctl);
++
++ /* Connect to PHY */
++ snprintf(priv->phy_name, 20, PHY_ID_FMT,
++ priv->mdio->id, priv->phy_addr);
++
++ priv->phydev = phy_connect(dev->net, priv->phy_name,
++ &ax88172a_adjust_link,
++ PHY_INTERFACE_MODE_MII);
++ if (IS_ERR(priv->phydev)) {
++ netdev_err(dev->net, "Could not connect to PHY device %s\n",
++ priv->phy_name);
++ ret = PTR_ERR(priv->phydev);
++ goto out;
++ }
++
++ netdev_info(dev->net, "Connected to phy %s\n", priv->phy_name);
++
++ /* During power-up, the AX88172A set the power down (BMCR_PDOWN)
++ * bit of the PHY. Bring the PHY up again.
++ */
++ genphy_resume(priv->phydev);
++ phy_start(priv->phydev);
++
++ return 0;
++
++out:
++ return ret;
++
++}
++
++static int ax88172a_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ struct ax88172a_private *dp = dev->driver_priv;
++ struct asix_rx_fixup_info *rx = &dp->rx_fixup_info;
++
++ return asix_rx_fixup_internal(dev, skb, rx);
++}
++
++const struct driver_info ax88172a_info = {
++ .description = "ASIX AX88172A USB 2.0 Ethernet",
++ .bind = ax88172a_bind,
++ .reset = ax88172a_reset,
++ .stop = ax88172a_stop,
++ .unbind = ax88172a_unbind,
++ .status = ax88172a_status,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
++ FLAG_MULTI_PACKET,
++ .rx_fixup = ax88172a_rx_fixup,
++ .tx_fixup = asix_tx_fixup,
++};
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/ax88179_178a.c backports-3.18.1-1/drivers/net/usb/ax88179_178a.c
+--- backports-3.18.1-1.org/drivers/net/usb/ax88179_178a.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/ax88179_178a.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,1756 @@
++/*
++ * ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet Devices
++ *
++ * Copyright (C) 2011-2013 ASIX
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/etherdevice.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/crc32.h>
++#include <linux/usb/usbnet.h>
++#include <uapi/linux/mdio.h>
++#include <linux/mdio.h>
++
++#define AX88179_PHY_ID 0x03
++#define AX_EEPROM_LEN 0x100
++#define AX88179_EEPROM_MAGIC 0x17900b95
++#define AX_MCAST_FLTSIZE 8
++#define AX_MAX_MCAST 64
++#define AX_INT_PPLS_LINK ((u32)BIT(16))
++#define AX_RXHDR_L4_TYPE_MASK 0x1c
++#define AX_RXHDR_L4_TYPE_UDP 4
++#define AX_RXHDR_L4_TYPE_TCP 16
++#define AX_RXHDR_L3CSUM_ERR 2
++#define AX_RXHDR_L4CSUM_ERR 1
++#define AX_RXHDR_CRC_ERR ((u32)BIT(29))
++#define AX_RXHDR_DROP_ERR ((u32)BIT(31))
++#define AX_ACCESS_MAC 0x01
++#define AX_ACCESS_PHY 0x02
++#define AX_ACCESS_EEPROM 0x04
++#define AX_ACCESS_EFUS 0x05
++#define AX_PAUSE_WATERLVL_HIGH 0x54
++#define AX_PAUSE_WATERLVL_LOW 0x55
++
++#define PHYSICAL_LINK_STATUS 0x02
++ #define AX_USB_SS 0x04
++ #define AX_USB_HS 0x02
++
++#define GENERAL_STATUS 0x03
++/* Check AX88179 version. UA1:Bit2 = 0, UA2:Bit2 = 1 */
++ #define AX_SECLD 0x04
++
++#define AX_SROM_ADDR 0x07
++#define AX_SROM_CMD 0x0a
++ #define EEP_RD 0x04
++ #define EEP_BUSY 0x10
++
++#define AX_SROM_DATA_LOW 0x08
++#define AX_SROM_DATA_HIGH 0x09
++
++#define AX_RX_CTL 0x0b
++ #define AX_RX_CTL_DROPCRCERR 0x0100
++ #define AX_RX_CTL_IPE 0x0200
++ #define AX_RX_CTL_START 0x0080
++ #define AX_RX_CTL_AP 0x0020
++ #define AX_RX_CTL_AM 0x0010
++ #define AX_RX_CTL_AB 0x0008
++ #define AX_RX_CTL_AMALL 0x0002
++ #define AX_RX_CTL_PRO 0x0001
++ #define AX_RX_CTL_STOP 0x0000
++
++#define AX_NODE_ID 0x10
++#define AX_MULFLTARY 0x16
++
++#define AX_MEDIUM_STATUS_MODE 0x22
++ #define AX_MEDIUM_GIGAMODE 0x01
++ #define AX_MEDIUM_FULL_DUPLEX 0x02
++ #define AX_MEDIUM_EN_125MHZ 0x08
++ #define AX_MEDIUM_RXFLOW_CTRLEN 0x10
++ #define AX_MEDIUM_TXFLOW_CTRLEN 0x20
++ #define AX_MEDIUM_RECEIVE_EN 0x100
++ #define AX_MEDIUM_PS 0x200
++ #define AX_MEDIUM_JUMBO_EN 0x8040
++
++#define AX_MONITOR_MOD 0x24
++ #define AX_MONITOR_MODE_RWLC 0x02
++ #define AX_MONITOR_MODE_RWMP 0x04
++ #define AX_MONITOR_MODE_PMEPOL 0x20
++ #define AX_MONITOR_MODE_PMETYPE 0x40
++
++#define AX_GPIO_CTRL 0x25
++ #define AX_GPIO_CTRL_GPIO3EN 0x80
++ #define AX_GPIO_CTRL_GPIO2EN 0x40
++ #define AX_GPIO_CTRL_GPIO1EN 0x20
++
++#define AX_PHYPWR_RSTCTL 0x26
++ #define AX_PHYPWR_RSTCTL_BZ 0x0010
++ #define AX_PHYPWR_RSTCTL_IPRL 0x0020
++ #define AX_PHYPWR_RSTCTL_AT 0x1000
++
++#define AX_RX_BULKIN_QCTRL 0x2e
++#define AX_CLK_SELECT 0x33
++ #define AX_CLK_SELECT_BCS 0x01
++ #define AX_CLK_SELECT_ACS 0x02
++ #define AX_CLK_SELECT_ULR 0x08
++
++#define AX_RXCOE_CTL 0x34
++ #define AX_RXCOE_IP 0x01
++ #define AX_RXCOE_TCP 0x02
++ #define AX_RXCOE_UDP 0x04
++ #define AX_RXCOE_TCPV6 0x20
++ #define AX_RXCOE_UDPV6 0x40
++
++#define AX_TXCOE_CTL 0x35
++ #define AX_TXCOE_IP 0x01
++ #define AX_TXCOE_TCP 0x02
++ #define AX_TXCOE_UDP 0x04
++ #define AX_TXCOE_TCPV6 0x20
++ #define AX_TXCOE_UDPV6 0x40
++
++#define AX_LEDCTRL 0x73
++
++#define GMII_PHY_PHYSR 0x11
++ #define GMII_PHY_PHYSR_SMASK 0xc000
++ #define GMII_PHY_PHYSR_GIGA 0x8000
++ #define GMII_PHY_PHYSR_100 0x4000
++ #define GMII_PHY_PHYSR_FULL 0x2000
++ #define GMII_PHY_PHYSR_LINK 0x400
++
++#define GMII_LED_ACT 0x1a
++ #define GMII_LED_ACTIVE_MASK 0xff8f
++ #define GMII_LED0_ACTIVE BIT(4)
++ #define GMII_LED1_ACTIVE BIT(5)
++ #define GMII_LED2_ACTIVE BIT(6)
++
++#define GMII_LED_LINK 0x1c
++ #define GMII_LED_LINK_MASK 0xf888
++ #define GMII_LED0_LINK_10 BIT(0)
++ #define GMII_LED0_LINK_100 BIT(1)
++ #define GMII_LED0_LINK_1000 BIT(2)
++ #define GMII_LED1_LINK_10 BIT(4)
++ #define GMII_LED1_LINK_100 BIT(5)
++ #define GMII_LED1_LINK_1000 BIT(6)
++ #define GMII_LED2_LINK_10 BIT(8)
++ #define GMII_LED2_LINK_100 BIT(9)
++ #define GMII_LED2_LINK_1000 BIT(10)
++ #define LED0_ACTIVE BIT(0)
++ #define LED0_LINK_10 BIT(1)
++ #define LED0_LINK_100 BIT(2)
++ #define LED0_LINK_1000 BIT(3)
++ #define LED0_FD BIT(4)
++ #define LED0_USB3_MASK 0x001f
++ #define LED1_ACTIVE BIT(5)
++ #define LED1_LINK_10 BIT(6)
++ #define LED1_LINK_100 BIT(7)
++ #define LED1_LINK_1000 BIT(8)
++ #define LED1_FD BIT(9)
++ #define LED1_USB3_MASK 0x03e0
++ #define LED2_ACTIVE BIT(10)
++ #define LED2_LINK_1000 BIT(13)
++ #define LED2_LINK_100 BIT(12)
++ #define LED2_LINK_10 BIT(11)
++ #define LED2_FD BIT(14)
++ #define LED_VALID BIT(15)
++ #define LED2_USB3_MASK 0x7c00
++
++#define GMII_PHYPAGE 0x1e
++#define GMII_PHY_PAGE_SELECT 0x1f
++ #define GMII_PHY_PGSEL_EXT 0x0007
++ #define GMII_PHY_PGSEL_PAGE0 0x0000
++ #define GMII_PHY_PGSEL_PAGE3 0x0003
++ #define GMII_PHY_PGSEL_PAGE5 0x0005
++
++struct ax88179_data {
++ u8 eee_enabled;
++ u8 eee_active;
++ u16 rxctl;
++ u16 reserved;
++};
++
++struct ax88179_int_data {
++ __le32 intdata1;
++ __le32 intdata2;
++};
++
++static const struct {
++ unsigned char ctrl, timer_l, timer_h, size, ifg;
++} AX88179_BULKIN_SIZE[] = {
++ {7, 0x4f, 0, 0x12, 0xff},
++ {7, 0x20, 3, 0x16, 0xff},
++ {7, 0xae, 7, 0x18, 0xff},
++ {7, 0xcc, 0x4c, 0x18, 8},
++};
++
++static int __ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data, int in_pm)
++{
++ int ret;
++ int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
++
++ BUG_ON(!dev);
++
++ if (!in_pm)
++ fn = usbnet_read_cmd;
++ else
++ fn = usbnet_read_cmd_nopm;
++
++ ret = fn(dev, cmd, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ value, index, data, size);
++
++ if (unlikely(ret < 0))
++ netdev_warn(dev->net, "Failed to read reg index 0x%04x: %d\n",
++ index, ret);
++
++ return ret;
++}
++
++static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data, int in_pm)
++{
++ int ret;
++ int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
++
++ BUG_ON(!dev);
++
++ if (!in_pm)
++ fn = usbnet_write_cmd;
++ else
++ fn = usbnet_write_cmd_nopm;
++
++ ret = fn(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ value, index, data, size);
++
++ if (unlikely(ret < 0))
++ netdev_warn(dev->net, "Failed to write reg index 0x%04x: %d\n",
++ index, ret);
++
++ return ret;
++}
++
++static void ax88179_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value,
++ u16 index, u16 size, void *data)
++{
++ u16 buf;
++
++ if (2 == size) {
++ buf = *((u16 *)data);
++ cpu_to_le16s(&buf);
++ usbnet_write_cmd_async(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR |
++ USB_RECIP_DEVICE, value, index, &buf,
++ size);
++ } else {
++ usbnet_write_cmd_async(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR |
++ USB_RECIP_DEVICE, value, index, data,
++ size);
++ }
++}
++
++static int ax88179_read_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
++ u16 index, u16 size, void *data)
++{
++ int ret;
++
++ if (2 == size) {
++ u16 buf;
++ ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 1);
++ le16_to_cpus(&buf);
++ *((u16 *)data) = buf;
++ } else if (4 == size) {
++ u32 buf;
++ ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 1);
++ le32_to_cpus(&buf);
++ *((u32 *)data) = buf;
++ } else {
++ ret = __ax88179_read_cmd(dev, cmd, value, index, size, data, 1);
++ }
++
++ return ret;
++}
++
++static int ax88179_write_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
++ u16 index, u16 size, void *data)
++{
++ int ret;
++
++ if (2 == size) {
++ u16 buf;
++ buf = *((u16 *)data);
++ cpu_to_le16s(&buf);
++ ret = __ax88179_write_cmd(dev, cmd, value, index,
++ size, &buf, 1);
++ } else {
++ ret = __ax88179_write_cmd(dev, cmd, value, index,
++ size, data, 1);
++ }
++
++ return ret;
++}
++
++static int ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data)
++{
++ int ret;
++
++ if (2 == size) {
++ u16 buf;
++ ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
++ le16_to_cpus(&buf);
++ *((u16 *)data) = buf;
++ } else if (4 == size) {
++ u32 buf;
++ ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
++ le32_to_cpus(&buf);
++ *((u32 *)data) = buf;
++ } else {
++ ret = __ax88179_read_cmd(dev, cmd, value, index, size, data, 0);
++ }
++
++ return ret;
++}
++
++static int ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data)
++{
++ int ret;
++
++ if (2 == size) {
++ u16 buf;
++ buf = *((u16 *)data);
++ cpu_to_le16s(&buf);
++ ret = __ax88179_write_cmd(dev, cmd, value, index,
++ size, &buf, 0);
++ } else {
++ ret = __ax88179_write_cmd(dev, cmd, value, index,
++ size, data, 0);
++ }
++
++ return ret;
++}
++
++static void ax88179_status(struct usbnet *dev, struct urb *urb)
++{
++ struct ax88179_int_data *event;
++ u32 link;
++
++ if (urb->actual_length < 8)
++ return;
++
++ event = urb->transfer_buffer;
++ le32_to_cpus((void *)&event->intdata1);
++
++ link = (((__force u32)event->intdata1) & AX_INT_PPLS_LINK) >> 16;
++
++ if (netif_carrier_ok(dev->net) != link) {
++ usbnet_link_change(dev, link, 1);
++ netdev_info(dev->net, "ax88179 - Link status is: %d\n", link);
++ }
++}
++
++static int ax88179_mdio_read(struct net_device *netdev, int phy_id, int loc)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u16 res;
++
++ ax88179_read_cmd(dev, AX_ACCESS_PHY, phy_id, (__u16)loc, 2, &res);
++ return res;
++}
++
++static void ax88179_mdio_write(struct net_device *netdev, int phy_id, int loc,
++ int val)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u16 res = (u16) val;
++
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, phy_id, (__u16)loc, 2, &res);
++}
++
++static inline int ax88179_phy_mmd_indirect(struct usbnet *dev, u16 prtad,
++ u16 devad)
++{
++ u16 tmp16;
++ int ret;
++
++ tmp16 = devad;
++ ret = ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ MII_MMD_CTRL, 2, &tmp16);
++
++ tmp16 = prtad;
++ ret = ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ MII_MMD_DATA, 2, &tmp16);
++
++ tmp16 = devad | MII_MMD_CTRL_NOINCR;
++ ret = ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ MII_MMD_CTRL, 2, &tmp16);
++
++ return ret;
++}
++
++static int
++ax88179_phy_read_mmd_indirect(struct usbnet *dev, u16 prtad, u16 devad)
++{
++ int ret;
++ u16 tmp16;
++
++ ax88179_phy_mmd_indirect(dev, prtad, devad);
++
++ ret = ax88179_read_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ MII_MMD_DATA, 2, &tmp16);
++ if (ret < 0)
++ return ret;
++
++ return tmp16;
++}
++
++static int
++ax88179_phy_write_mmd_indirect(struct usbnet *dev, u16 prtad, u16 devad,
++ u16 data)
++{
++ int ret;
++
++ ax88179_phy_mmd_indirect(dev, prtad, devad);
++
++ ret = ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ MII_MMD_DATA, 2, &data);
++
++ if (ret < 0)
++ return ret;
++
++ return 0;
++}
++
++static int ax88179_suspend(struct usb_interface *intf, pm_message_t message)
++{
++ struct usbnet *dev = usb_get_intfdata(intf);
++ u16 tmp16;
++ u8 tmp8;
++
++ usbnet_suspend(intf, message);
++
++ /* Disable RX path */
++ ax88179_read_cmd_nopm(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &tmp16);
++ tmp16 &= ~AX_MEDIUM_RECEIVE_EN;
++ ax88179_write_cmd_nopm(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &tmp16);
++
++ /* Force bulk-in zero length */
++ ax88179_read_cmd_nopm(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL,
++ 2, 2, &tmp16);
++
++ tmp16 |= AX_PHYPWR_RSTCTL_BZ | AX_PHYPWR_RSTCTL_IPRL;
++ ax88179_write_cmd_nopm(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL,
++ 2, 2, &tmp16);
++
++ /* change clock */
++ tmp8 = 0;
++ ax88179_write_cmd_nopm(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, &tmp8);
++
++ /* Configure RX control register => stop operation */
++ tmp16 = AX_RX_CTL_STOP;
++ ax88179_write_cmd_nopm(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, &tmp16);
++
++ return 0;
++}
++
++/* This function is used to enable the autodetach function. */
++/* This function is determined by offset 0x43 of EEPROM */
++static int ax88179_auto_detach(struct usbnet *dev, int in_pm)
++{
++ u16 tmp16;
++ u8 tmp8;
++ int (*fnr)(struct usbnet *, u8, u16, u16, u16, void *);
++ int (*fnw)(struct usbnet *, u8, u16, u16, u16, void *);
++
++ if (!in_pm) {
++ fnr = ax88179_read_cmd;
++ fnw = ax88179_write_cmd;
++ } else {
++ fnr = ax88179_read_cmd_nopm;
++ fnw = ax88179_write_cmd_nopm;
++ }
++
++ if (fnr(dev, AX_ACCESS_EEPROM, 0x43, 1, 2, &tmp16) < 0)
++ return 0;
++
++ if ((tmp16 == 0xFFFF) || (!(tmp16 & 0x0100)))
++ return 0;
++
++ /* Enable Auto Detach bit */
++ tmp8 = 0;
++ fnr(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, &tmp8);
++ tmp8 |= AX_CLK_SELECT_ULR;
++ fnw(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, &tmp8);
++
++ fnr(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL, 2, 2, &tmp16);
++ tmp16 |= AX_PHYPWR_RSTCTL_AT;
++ fnw(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL, 2, 2, &tmp16);
++
++ return 0;
++}
++
++static int ax88179_resume(struct usb_interface *intf)
++{
++ struct usbnet *dev = usb_get_intfdata(intf);
++ u16 tmp16;
++ u8 tmp8;
++
++ usbnet_link_change(dev, 0, 0);
++
++ /* Power up ethernet PHY */
++ tmp16 = 0;
++ ax88179_write_cmd_nopm(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL,
++ 2, 2, &tmp16);
++ udelay(1000);
++
++ tmp16 = AX_PHYPWR_RSTCTL_IPRL;
++ ax88179_write_cmd_nopm(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL,
++ 2, 2, &tmp16);
++ msleep(200);
++
++ /* Ethernet PHY Auto Detach*/
++ ax88179_auto_detach(dev, 1);
++
++ /* Enable clock */
++ ax88179_read_cmd_nopm(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, &tmp8);
++ tmp8 |= AX_CLK_SELECT_ACS | AX_CLK_SELECT_BCS;
++ ax88179_write_cmd_nopm(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, &tmp8);
++ msleep(100);
++
++ /* Configure RX control register => start operation */
++ tmp16 = AX_RX_CTL_DROPCRCERR | AX_RX_CTL_IPE | AX_RX_CTL_START |
++ AX_RX_CTL_AP | AX_RX_CTL_AMALL | AX_RX_CTL_AB;
++ ax88179_write_cmd_nopm(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, &tmp16);
++
++ return usbnet_resume(intf);
++}
++
++static void
++ax88179_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u8 opt;
++
++ if (ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_MONITOR_MOD,
++ 1, 1, &opt) < 0) {
++ wolinfo->supported = 0;
++ wolinfo->wolopts = 0;
++ return;
++ }
++
++ wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
++ wolinfo->wolopts = 0;
++ if (opt & AX_MONITOR_MODE_RWLC)
++ wolinfo->wolopts |= WAKE_PHY;
++ if (opt & AX_MONITOR_MODE_RWMP)
++ wolinfo->wolopts |= WAKE_MAGIC;
++}
++
++static int
++ax88179_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u8 opt = 0;
++
++ if (wolinfo->wolopts & WAKE_PHY)
++ opt |= AX_MONITOR_MODE_RWLC;
++ if (wolinfo->wolopts & WAKE_MAGIC)
++ opt |= AX_MONITOR_MODE_RWMP;
++
++ if (ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MONITOR_MOD,
++ 1, 1, &opt) < 0)
++ return -EINVAL;
++
++ return 0;
++}
++
++static int ax88179_get_eeprom_len(struct net_device *net)
++{
++ return AX_EEPROM_LEN;
++}
++
++static int
++ax88179_get_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom,
++ u8 *data)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u16 *eeprom_buff;
++ int first_word, last_word;
++ int i, ret;
++
++ if (eeprom->len == 0)
++ return -EINVAL;
++
++ eeprom->magic = AX88179_EEPROM_MAGIC;
++
++ first_word = eeprom->offset >> 1;
++ last_word = (eeprom->offset + eeprom->len - 1) >> 1;
++ eeprom_buff = kmalloc(sizeof(u16) * (last_word - first_word + 1),
++ GFP_KERNEL);
++ if (!eeprom_buff)
++ return -ENOMEM;
++
++ /* ax88179/178A returns 2 bytes from eeprom on read */
++ for (i = first_word; i <= last_word; i++) {
++ ret = __ax88179_read_cmd(dev, AX_ACCESS_EEPROM, i, 1, 2,
++ &eeprom_buff[i - first_word],
++ 0);
++ if (ret < 0) {
++ kfree(eeprom_buff);
++ return -EIO;
++ }
++ }
++
++ memcpy(data, (u8 *)eeprom_buff + (eeprom->offset & 1), eeprom->len);
++ kfree(eeprom_buff);
++ return 0;
++}
++
++static int ax88179_get_settings(struct net_device *net, struct ethtool_cmd *cmd)
++{
++ struct usbnet *dev = netdev_priv(net);
++ return mii_ethtool_gset(&dev->mii, cmd);
++}
++
++static int ax88179_set_settings(struct net_device *net, struct ethtool_cmd *cmd)
++{
++ struct usbnet *dev = netdev_priv(net);
++ return mii_ethtool_sset(&dev->mii, cmd);
++}
++
++static int
++ax88179_ethtool_get_eee(struct usbnet *dev, struct ethtool_eee *data)
++{
++ int val;
++
++ /* Get Supported EEE */
++ val = ax88179_phy_read_mmd_indirect(dev, MDIO_PCS_EEE_ABLE,
++ MDIO_MMD_PCS);
++ if (val < 0)
++ return val;
++ data->supported = mmd_eee_cap_to_ethtool_sup_t(val);
++
++ /* Get advertisement EEE */
++ val = ax88179_phy_read_mmd_indirect(dev, MDIO_AN_EEE_ADV,
++ MDIO_MMD_AN);
++ if (val < 0)
++ return val;
++ data->advertised = mmd_eee_adv_to_ethtool_adv_t(val);
++
++ /* Get LP advertisement EEE */
++ val = ax88179_phy_read_mmd_indirect(dev, MDIO_AN_EEE_LPABLE,
++ MDIO_MMD_AN);
++ if (val < 0)
++ return val;
++ data->lp_advertised = mmd_eee_adv_to_ethtool_adv_t(val);
++
++ return 0;
++}
++
++static int
++ax88179_ethtool_set_eee(struct usbnet *dev, struct ethtool_eee *data)
++{
++ u16 tmp16 = ethtool_adv_to_mmd_eee_adv_t(data->advertised);
++
++ return ax88179_phy_write_mmd_indirect(dev, MDIO_AN_EEE_ADV,
++ MDIO_MMD_AN, tmp16);
++}
++
++static int ax88179_chk_eee(struct usbnet *dev)
++{
++ struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
++ struct ax88179_data *priv = (struct ax88179_data *)dev->data;
++
++ mii_ethtool_gset(&dev->mii, &ecmd);
++
++ if (ecmd.duplex & DUPLEX_FULL) {
++ int eee_lp, eee_cap, eee_adv;
++ u32 lp, cap, adv, supported = 0;
++
++ eee_cap = ax88179_phy_read_mmd_indirect(dev,
++ MDIO_PCS_EEE_ABLE,
++ MDIO_MMD_PCS);
++ if (eee_cap < 0) {
++ priv->eee_active = 0;
++ return false;
++ }
++
++ cap = mmd_eee_cap_to_ethtool_sup_t(eee_cap);
++ if (!cap) {
++ priv->eee_active = 0;
++ return false;
++ }
++
++ eee_lp = ax88179_phy_read_mmd_indirect(dev,
++ MDIO_AN_EEE_LPABLE,
++ MDIO_MMD_AN);
++ if (eee_lp < 0) {
++ priv->eee_active = 0;
++ return false;
++ }
++
++ eee_adv = ax88179_phy_read_mmd_indirect(dev,
++ MDIO_AN_EEE_ADV,
++ MDIO_MMD_AN);
++
++ if (eee_adv < 0) {
++ priv->eee_active = 0;
++ return false;
++ }
++
++ adv = mmd_eee_adv_to_ethtool_adv_t(eee_adv);
++ lp = mmd_eee_adv_to_ethtool_adv_t(eee_lp);
++ supported = (ecmd.speed == SPEED_1000) ?
++ SUPPORTED_1000baseT_Full :
++ SUPPORTED_100baseT_Full;
++
++ if (!(lp & adv & supported)) {
++ priv->eee_active = 0;
++ return false;
++ }
++
++ priv->eee_active = 1;
++ return true;
++ }
++
++ priv->eee_active = 0;
++ return false;
++}
++
++static void ax88179_disable_eee(struct usbnet *dev)
++{
++ u16 tmp16;
++
++ tmp16 = GMII_PHY_PGSEL_PAGE3;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHY_PAGE_SELECT, 2, &tmp16);
++
++ tmp16 = 0x3246;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ MII_PHYADDR, 2, &tmp16);
++
++ tmp16 = GMII_PHY_PGSEL_PAGE0;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHY_PAGE_SELECT, 2, &tmp16);
++}
++
++static void ax88179_enable_eee(struct usbnet *dev)
++{
++ u16 tmp16;
++
++ tmp16 = GMII_PHY_PGSEL_PAGE3;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHY_PAGE_SELECT, 2, &tmp16);
++
++ tmp16 = 0x3247;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ MII_PHYADDR, 2, &tmp16);
++
++ tmp16 = GMII_PHY_PGSEL_PAGE5;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHY_PAGE_SELECT, 2, &tmp16);
++
++ tmp16 = 0x0680;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ MII_BMSR, 2, &tmp16);
++
++ tmp16 = GMII_PHY_PGSEL_PAGE0;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHY_PAGE_SELECT, 2, &tmp16);
++}
++
++static int ax88179_get_eee(struct net_device *net, struct ethtool_eee *edata)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct ax88179_data *priv = (struct ax88179_data *)dev->data;
++
++ edata->eee_enabled = priv->eee_enabled;
++ edata->eee_active = priv->eee_active;
++
++ return ax88179_ethtool_get_eee(dev, edata);
++}
++
++static int ax88179_set_eee(struct net_device *net, struct ethtool_eee *edata)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct ax88179_data *priv = (struct ax88179_data *)dev->data;
++ int ret = -EOPNOTSUPP;
++
++ priv->eee_enabled = edata->eee_enabled;
++ if (!priv->eee_enabled) {
++ ax88179_disable_eee(dev);
++ } else {
++ priv->eee_enabled = ax88179_chk_eee(dev);
++ if (!priv->eee_enabled)
++ return -EOPNOTSUPP;
++
++ ax88179_enable_eee(dev);
++ }
++
++ ret = ax88179_ethtool_set_eee(dev, edata);
++ if (ret)
++ return ret;
++
++ mii_nway_restart(&dev->mii);
++
++ usbnet_link_change(dev, 0, 0);
++
++ return ret;
++}
++
++static int ax88179_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
++{
++ struct usbnet *dev = netdev_priv(net);
++ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
++}
++
++static const struct ethtool_ops ax88179_ethtool_ops = {
++ .get_link = ethtool_op_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_wol = ax88179_get_wol,
++ .set_wol = ax88179_set_wol,
++ .get_eeprom_len = ax88179_get_eeprom_len,
++ .get_eeprom = ax88179_get_eeprom,
++ .get_settings = ax88179_get_settings,
++ .set_settings = ax88179_set_settings,
++ .get_eee = ax88179_get_eee,
++ .set_eee = ax88179_set_eee,
++ .nway_reset = usbnet_nway_reset,
++};
++
++static void ax88179_set_multicast(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct ax88179_data *data = (struct ax88179_data *)dev->data;
++ u8 *m_filter = ((u8 *)dev->data) + 12;
++
++ data->rxctl = (AX_RX_CTL_START | AX_RX_CTL_AB | AX_RX_CTL_IPE);
++
++ if (net->flags & IFF_PROMISC) {
++ data->rxctl |= AX_RX_CTL_PRO;
++ } else if (net->flags & IFF_ALLMULTI ||
++ netdev_mc_count(net) > AX_MAX_MCAST) {
++ data->rxctl |= AX_RX_CTL_AMALL;
++ } else if (netdev_mc_empty(net)) {
++ /* just broadcast and directed */
++ } else {
++ /* We use the 20 byte dev->data for our 8 byte filter buffer
++ * to avoid allocating memory that is tricky to free later
++ */
++ u32 crc_bits;
++ struct netdev_hw_addr *ha;
++
++ memset(m_filter, 0, AX_MCAST_FLTSIZE);
++
++ netdev_for_each_mc_addr(ha, net) {
++ crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
++ *(m_filter + (crc_bits >> 3)) |= (1 << (crc_bits & 7));
++ }
++
++ ax88179_write_cmd_async(dev, AX_ACCESS_MAC, AX_MULFLTARY,
++ AX_MCAST_FLTSIZE, AX_MCAST_FLTSIZE,
++ m_filter);
++
++ data->rxctl |= AX_RX_CTL_AM;
++ }
++
++ ax88179_write_cmd_async(dev, AX_ACCESS_MAC, AX_RX_CTL,
++ 2, 2, &data->rxctl);
++}
++
++static int
++ax88179_set_features(struct net_device *net, netdev_features_t features)
++{
++ u8 tmp;
++ struct usbnet *dev = netdev_priv(net);
++ netdev_features_t changed = net->features ^ features;
++
++ if (changed & NETIF_F_IP_CSUM) {
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_TXCOE_CTL, 1, 1, &tmp);
++ tmp ^= AX_TXCOE_TCP | AX_TXCOE_UDP;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_TXCOE_CTL, 1, 1, &tmp);
++ }
++
++ if (changed & NETIF_F_IPV6_CSUM) {
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_TXCOE_CTL, 1, 1, &tmp);
++ tmp ^= AX_TXCOE_TCPV6 | AX_TXCOE_UDPV6;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_TXCOE_CTL, 1, 1, &tmp);
++ }
++
++ if (changed & NETIF_F_RXCSUM) {
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_RXCOE_CTL, 1, 1, &tmp);
++ tmp ^= AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP |
++ AX_RXCOE_TCPV6 | AX_RXCOE_UDPV6;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RXCOE_CTL, 1, 1, &tmp);
++ }
++
++ return 0;
++}
++
++static int ax88179_change_mtu(struct net_device *net, int new_mtu)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u16 tmp16;
++
++ if (new_mtu <= 0 || new_mtu > 4088)
++ return -EINVAL;
++
++ net->mtu = new_mtu;
++ dev->hard_mtu = net->mtu + net->hard_header_len;
++
++ if (net->mtu > 1500) {
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &tmp16);
++ tmp16 |= AX_MEDIUM_JUMBO_EN;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &tmp16);
++ } else {
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &tmp16);
++ tmp16 &= ~AX_MEDIUM_JUMBO_EN;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &tmp16);
++ }
++
++ /* max qlen depend on hard_mtu and rx_urb_size */
++ usbnet_update_max_qlen(dev);
++
++ return 0;
++}
++
++static int ax88179_set_mac_addr(struct net_device *net, void *p)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct sockaddr *addr = p;
++ int ret;
++
++ if (netif_running(net))
++ return -EBUSY;
++ if (!is_valid_ether_addr(addr->sa_data))
++ return -EADDRNOTAVAIL;
++
++ memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
++
++ /* Set the MAC address */
++ ret = ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
++ ETH_ALEN, net->dev_addr);
++ if (ret < 0)
++ return ret;
++
++ return 0;
++}
++
++static const struct net_device_ops ax88179_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = ax88179_change_mtu,
++ .ndo_set_mac_address = ax88179_set_mac_addr,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = ax88179_ioctl,
++ .ndo_set_rx_mode = ax88179_set_multicast,
++ .ndo_set_features = ax88179_set_features,
++};
++
++static int ax88179_check_eeprom(struct usbnet *dev)
++{
++ u8 i, buf, eeprom[20];
++ u16 csum, delay = HZ / 10;
++ unsigned long jtimeout;
++
++ /* Read EEPROM content */
++ for (i = 0; i < 6; i++) {
++ buf = i;
++ if (ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_SROM_ADDR,
++ 1, 1, &buf) < 0)
++ return -EINVAL;
++
++ buf = EEP_RD;
++ if (ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_SROM_CMD,
++ 1, 1, &buf) < 0)
++ return -EINVAL;
++
++ jtimeout = jiffies + delay;
++ do {
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_SROM_CMD,
++ 1, 1, &buf);
++
++ if (time_after(jiffies, jtimeout))
++ return -EINVAL;
++
++ } while (buf & EEP_BUSY);
++
++ __ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_SROM_DATA_LOW,
++ 2, 2, &eeprom[i * 2], 0);
++
++ if ((i == 0) && (eeprom[0] == 0xFF))
++ return -EINVAL;
++ }
++
++ csum = eeprom[6] + eeprom[7] + eeprom[8] + eeprom[9];
++ csum = (csum >> 8) + (csum & 0xff);
++ if ((csum + eeprom[10]) != 0xff)
++ return -EINVAL;
++
++ return 0;
++}
++
++static int ax88179_check_efuse(struct usbnet *dev, u16 *ledmode)
++{
++ u8 i;
++ u8 efuse[64];
++ u16 csum = 0;
++
++ if (ax88179_read_cmd(dev, AX_ACCESS_EFUS, 0, 64, 64, efuse) < 0)
++ return -EINVAL;
++
++ if (*efuse == 0xFF)
++ return -EINVAL;
++
++ for (i = 0; i < 64; i++)
++ csum = csum + efuse[i];
++
++ while (csum > 255)
++ csum = (csum & 0x00FF) + ((csum >> 8) & 0x00FF);
++
++ if (csum != 0xFF)
++ return -EINVAL;
++
++ *ledmode = (efuse[51] << 8) | efuse[52];
++
++ return 0;
++}
++
++static int ax88179_convert_old_led(struct usbnet *dev, u16 *ledvalue)
++{
++ u16 led;
++
++ /* Loaded the old eFuse LED Mode */
++ if (ax88179_read_cmd(dev, AX_ACCESS_EEPROM, 0x3C, 1, 2, &led) < 0)
++ return -EINVAL;
++
++ led >>= 8;
++ switch (led) {
++ case 0xFF:
++ led = LED0_ACTIVE | LED1_LINK_10 | LED1_LINK_100 |
++ LED1_LINK_1000 | LED2_ACTIVE | LED2_LINK_10 |
++ LED2_LINK_100 | LED2_LINK_1000 | LED_VALID;
++ break;
++ case 0xFE:
++ led = LED0_ACTIVE | LED1_LINK_1000 | LED2_LINK_100 | LED_VALID;
++ break;
++ case 0xFD:
++ led = LED0_ACTIVE | LED1_LINK_1000 | LED2_LINK_100 |
++ LED2_LINK_10 | LED_VALID;
++ break;
++ case 0xFC:
++ led = LED0_ACTIVE | LED1_ACTIVE | LED1_LINK_1000 | LED2_ACTIVE |
++ LED2_LINK_100 | LED2_LINK_10 | LED_VALID;
++ break;
++ default:
++ led = LED0_ACTIVE | LED1_LINK_10 | LED1_LINK_100 |
++ LED1_LINK_1000 | LED2_ACTIVE | LED2_LINK_10 |
++ LED2_LINK_100 | LED2_LINK_1000 | LED_VALID;
++ break;
++ }
++
++ *ledvalue = led;
++
++ return 0;
++}
++
++static int ax88179_led_setting(struct usbnet *dev)
++{
++ u8 ledfd, value = 0;
++ u16 tmp, ledact, ledlink, ledvalue = 0, delay = HZ / 10;
++ unsigned long jtimeout;
++
++ /* Check AX88179 version. UA1 or UA2*/
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, GENERAL_STATUS, 1, 1, &value);
++
++ if (!(value & AX_SECLD)) { /* UA1 */
++ value = AX_GPIO_CTRL_GPIO3EN | AX_GPIO_CTRL_GPIO2EN |
++ AX_GPIO_CTRL_GPIO1EN;
++ if (ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_GPIO_CTRL,
++ 1, 1, &value) < 0)
++ return -EINVAL;
++ }
++
++ /* Check EEPROM */
++ if (!ax88179_check_eeprom(dev)) {
++ value = 0x42;
++ if (ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_SROM_ADDR,
++ 1, 1, &value) < 0)
++ return -EINVAL;
++
++ value = EEP_RD;
++ if (ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_SROM_CMD,
++ 1, 1, &value) < 0)
++ return -EINVAL;
++
++ jtimeout = jiffies + delay;
++ do {
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_SROM_CMD,
++ 1, 1, &value);
++
++ if (time_after(jiffies, jtimeout))
++ return -EINVAL;
++
++ } while (value & EEP_BUSY);
++
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_SROM_DATA_HIGH,
++ 1, 1, &value);
++ ledvalue = (value << 8);
++
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_SROM_DATA_LOW,
++ 1, 1, &value);
++ ledvalue |= value;
++
++ /* load internal ROM for defaule setting */
++ if ((ledvalue == 0xFFFF) || ((ledvalue & LED_VALID) == 0))
++ ax88179_convert_old_led(dev, &ledvalue);
++
++ } else if (!ax88179_check_efuse(dev, &ledvalue)) {
++ if ((ledvalue == 0xFFFF) || ((ledvalue & LED_VALID) == 0))
++ ax88179_convert_old_led(dev, &ledvalue);
++ } else {
++ ax88179_convert_old_led(dev, &ledvalue);
++ }
++
++ tmp = GMII_PHY_PGSEL_EXT;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHY_PAGE_SELECT, 2, &tmp);
++
++ tmp = 0x2c;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHYPAGE, 2, &tmp);
++
++ ax88179_read_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_LED_ACT, 2, &ledact);
++
++ ax88179_read_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_LED_LINK, 2, &ledlink);
++
++ ledact &= GMII_LED_ACTIVE_MASK;
++ ledlink &= GMII_LED_LINK_MASK;
++
++ if (ledvalue & LED0_ACTIVE)
++ ledact |= GMII_LED0_ACTIVE;
++
++ if (ledvalue & LED1_ACTIVE)
++ ledact |= GMII_LED1_ACTIVE;
++
++ if (ledvalue & LED2_ACTIVE)
++ ledact |= GMII_LED2_ACTIVE;
++
++ if (ledvalue & LED0_LINK_10)
++ ledlink |= GMII_LED0_LINK_10;
++
++ if (ledvalue & LED1_LINK_10)
++ ledlink |= GMII_LED1_LINK_10;
++
++ if (ledvalue & LED2_LINK_10)
++ ledlink |= GMII_LED2_LINK_10;
++
++ if (ledvalue & LED0_LINK_100)
++ ledlink |= GMII_LED0_LINK_100;
++
++ if (ledvalue & LED1_LINK_100)
++ ledlink |= GMII_LED1_LINK_100;
++
++ if (ledvalue & LED2_LINK_100)
++ ledlink |= GMII_LED2_LINK_100;
++
++ if (ledvalue & LED0_LINK_1000)
++ ledlink |= GMII_LED0_LINK_1000;
++
++ if (ledvalue & LED1_LINK_1000)
++ ledlink |= GMII_LED1_LINK_1000;
++
++ if (ledvalue & LED2_LINK_1000)
++ ledlink |= GMII_LED2_LINK_1000;
++
++ tmp = ledact;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_LED_ACT, 2, &tmp);
++
++ tmp = ledlink;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_LED_LINK, 2, &tmp);
++
++ tmp = GMII_PHY_PGSEL_PAGE0;
++ ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHY_PAGE_SELECT, 2, &tmp);
++
++ /* LED full duplex setting */
++ ledfd = 0;
++ if (ledvalue & LED0_FD)
++ ledfd |= 0x01;
++ else if ((ledvalue & LED0_USB3_MASK) == 0)
++ ledfd |= 0x02;
++
++ if (ledvalue & LED1_FD)
++ ledfd |= 0x04;
++ else if ((ledvalue & LED1_USB3_MASK) == 0)
++ ledfd |= 0x08;
++
++ if (ledvalue & LED2_FD)
++ ledfd |= 0x10;
++ else if ((ledvalue & LED2_USB3_MASK) == 0)
++ ledfd |= 0x20;
++
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_LEDCTRL, 1, 1, &ledfd);
++
++ return 0;
++}
++
++static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ u8 buf[5];
++ u16 *tmp16;
++ u8 *tmp;
++ struct ax88179_data *ax179_data = (struct ax88179_data *)dev->data;
++ struct ethtool_eee eee_data;
++
++ usbnet_get_endpoints(dev, intf);
++
++ tmp16 = (u16 *)buf;
++ tmp = (u8 *)buf;
++
++ memset(ax179_data, 0, sizeof(*ax179_data));
++
++ /* Power up ethernet PHY */
++ *tmp16 = 0;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL, 2, 2, tmp16);
++ *tmp16 = AX_PHYPWR_RSTCTL_IPRL;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL, 2, 2, tmp16);
++ msleep(200);
++
++ *tmp = AX_CLK_SELECT_ACS | AX_CLK_SELECT_BCS;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, tmp);
++ msleep(100);
++
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
++ ETH_ALEN, dev->net->dev_addr);
++ memcpy(dev->net->perm_addr, dev->net->dev_addr, ETH_ALEN);
++
++ /* RX bulk configuration */
++ memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5);
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_BULKIN_QCTRL, 5, 5, tmp);
++
++ dev->rx_urb_size = 1024 * 20;
++
++ *tmp = 0x34;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PAUSE_WATERLVL_LOW, 1, 1, tmp);
++
++ *tmp = 0x52;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PAUSE_WATERLVL_HIGH,
++ 1, 1, tmp);
++
++ dev->net->netdev_ops = &ax88179_netdev_ops;
++ dev->net->ethtool_ops = &ax88179_ethtool_ops;
++ dev->net->needed_headroom = 8;
++
++ /* Initialize MII structure */
++ dev->mii.dev = dev->net;
++ dev->mii.mdio_read = ax88179_mdio_read;
++ dev->mii.mdio_write = ax88179_mdio_write;
++ dev->mii.phy_id_mask = 0xff;
++ dev->mii.reg_num_mask = 0xff;
++ dev->mii.phy_id = 0x03;
++ dev->mii.supports_gmii = 1;
++
++ dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
++ NETIF_F_RXCSUM;
++
++ dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
++ NETIF_F_RXCSUM;
++
++ /* Enable checksum offload */
++ *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP |
++ AX_RXCOE_TCPV6 | AX_RXCOE_UDPV6;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RXCOE_CTL, 1, 1, tmp);
++
++ *tmp = AX_TXCOE_IP | AX_TXCOE_TCP | AX_TXCOE_UDP |
++ AX_TXCOE_TCPV6 | AX_TXCOE_UDPV6;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_TXCOE_CTL, 1, 1, tmp);
++
++ /* Configure RX control register => start operation */
++ *tmp16 = AX_RX_CTL_DROPCRCERR | AX_RX_CTL_IPE | AX_RX_CTL_START |
++ AX_RX_CTL_AP | AX_RX_CTL_AMALL | AX_RX_CTL_AB;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, tmp16);
++
++ *tmp = AX_MONITOR_MODE_PMETYPE | AX_MONITOR_MODE_PMEPOL |
++ AX_MONITOR_MODE_RWMP;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MONITOR_MOD, 1, 1, tmp);
++
++ /* Configure default medium type => giga */
++ *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN |
++ AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_FULL_DUPLEX |
++ AX_MEDIUM_GIGAMODE;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, tmp16);
++
++ ax88179_led_setting(dev);
++
++ ax179_data->eee_enabled = 0;
++ ax179_data->eee_active = 0;
++
++ ax88179_disable_eee(dev);
++
++ ax88179_ethtool_get_eee(dev, &eee_data);
++ eee_data.advertised = 0;
++ ax88179_ethtool_set_eee(dev, &eee_data);
++
++ /* Restart autoneg */
++ mii_nway_restart(&dev->mii);
++
++ usbnet_link_change(dev, 0, 0);
++
++ return 0;
++}
++
++static void ax88179_unbind(struct usbnet *dev, struct usb_interface *intf)
++{
++ u16 tmp16;
++
++ /* Configure RX control register => stop operation */
++ tmp16 = AX_RX_CTL_STOP;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, &tmp16);
++
++ tmp16 = 0;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, &tmp16);
++
++ /* Power down ethernet PHY */
++ tmp16 = 0;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL, 2, 2, &tmp16);
++}
++
++static void
++ax88179_rx_checksum(struct sk_buff *skb, u32 *pkt_hdr)
++{
++ skb->ip_summed = CHECKSUM_NONE;
++
++ /* checksum error bit is set */
++ if ((*pkt_hdr & AX_RXHDR_L3CSUM_ERR) ||
++ (*pkt_hdr & AX_RXHDR_L4CSUM_ERR))
++ return;
++
++ /* It must be a TCP or UDP packet with a valid checksum */
++ if (((*pkt_hdr & AX_RXHDR_L4_TYPE_MASK) == AX_RXHDR_L4_TYPE_TCP) ||
++ ((*pkt_hdr & AX_RXHDR_L4_TYPE_MASK) == AX_RXHDR_L4_TYPE_UDP))
++ skb->ip_summed = CHECKSUM_UNNECESSARY;
++}
++
++static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ struct sk_buff *ax_skb;
++ int pkt_cnt;
++ u32 rx_hdr;
++ u16 hdr_off;
++ u32 *pkt_hdr;
++
++ /* This check is no longer done by usbnet */
++ if (skb->len < dev->net->hard_header_len)
++ return 0;
++
++ skb_trim(skb, skb->len - 4);
++ memcpy(&rx_hdr, skb_tail_pointer(skb), 4);
++ le32_to_cpus(&rx_hdr);
++
++ pkt_cnt = (u16)rx_hdr;
++ hdr_off = (u16)(rx_hdr >> 16);
++ pkt_hdr = (u32 *)(skb->data + hdr_off);
++
++ while (pkt_cnt--) {
++ u16 pkt_len;
++
++ le32_to_cpus(pkt_hdr);
++ pkt_len = (*pkt_hdr >> 16) & 0x1fff;
++
++ /* Check CRC or runt packet */
++ if ((*pkt_hdr & AX_RXHDR_CRC_ERR) ||
++ (*pkt_hdr & AX_RXHDR_DROP_ERR)) {
++ skb_pull(skb, (pkt_len + 7) & 0xFFF8);
++ pkt_hdr++;
++ continue;
++ }
++
++ if (pkt_cnt == 0) {
++ /* Skip IP alignment psudo header */
++ skb_pull(skb, 2);
++ skb->len = pkt_len;
++ skb_set_tail_pointer(skb, pkt_len);
++ skb->truesize = pkt_len + sizeof(struct sk_buff);
++ ax88179_rx_checksum(skb, pkt_hdr);
++ return 1;
++ }
++
++ ax_skb = skb_clone(skb, GFP_ATOMIC);
++ if (ax_skb) {
++ ax_skb->len = pkt_len;
++ ax_skb->data = skb->data + 2;
++ skb_set_tail_pointer(ax_skb, pkt_len);
++ ax_skb->truesize = pkt_len + sizeof(struct sk_buff);
++ ax88179_rx_checksum(ax_skb, pkt_hdr);
++ usbnet_skb_return(dev, ax_skb);
++ } else {
++ return 0;
++ }
++
++ skb_pull(skb, (pkt_len + 7) & 0xFFF8);
++ pkt_hdr++;
++ }
++ return 1;
++}
++
++static struct sk_buff *
++ax88179_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
++{
++ u32 tx_hdr1, tx_hdr2;
++ int frame_size = dev->maxpacket;
++ int mss = skb_shinfo(skb)->gso_size;
++ int headroom;
++
++ tx_hdr1 = skb->len;
++ tx_hdr2 = mss;
++ if (((skb->len + 8) % frame_size) == 0)
++ tx_hdr2 |= 0x80008000; /* Enable padding */
++
++ headroom = skb_headroom(skb) - 8;
++
++ if ((skb_header_cloned(skb) || headroom < 0) &&
++ pskb_expand_head(skb, headroom < 0 ? 8 : 0, 0, GFP_ATOMIC)) {
++ dev_kfree_skb_any(skb);
++ return NULL;
++ }
++
++ skb_push(skb, 4);
++ cpu_to_le32s(&tx_hdr2);
++ skb_copy_to_linear_data(skb, &tx_hdr2, 4);
++
++ skb_push(skb, 4);
++ cpu_to_le32s(&tx_hdr1);
++ skb_copy_to_linear_data(skb, &tx_hdr1, 4);
++
++ return skb;
++}
++
++static int ax88179_link_reset(struct usbnet *dev)
++{
++ struct ax88179_data *ax179_data = (struct ax88179_data *)dev->data;
++ u8 tmp[5], link_sts;
++ u16 mode, tmp16, delay = HZ / 10;
++ u32 tmp32 = 0x40000000;
++ unsigned long jtimeout;
++
++ jtimeout = jiffies + delay;
++ while (tmp32 & 0x40000000) {
++ mode = 0;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, &mode);
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2,
++ &ax179_data->rxctl);
++
++ /*link up, check the usb device control TX FIFO full or empty*/
++ ax88179_read_cmd(dev, 0x81, 0x8c, 0, 4, &tmp32);
++
++ if (time_after(jiffies, jtimeout))
++ return 0;
++ }
++
++ mode = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN |
++ AX_MEDIUM_RXFLOW_CTRLEN;
++
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, PHYSICAL_LINK_STATUS,
++ 1, 1, &link_sts);
++
++ ax88179_read_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
++ GMII_PHY_PHYSR, 2, &tmp16);
++
++ if (!(tmp16 & GMII_PHY_PHYSR_LINK)) {
++ return 0;
++ } else if (GMII_PHY_PHYSR_GIGA == (tmp16 & GMII_PHY_PHYSR_SMASK)) {
++ mode |= AX_MEDIUM_GIGAMODE | AX_MEDIUM_EN_125MHZ;
++ if (dev->net->mtu > 1500)
++ mode |= AX_MEDIUM_JUMBO_EN;
++
++ if (link_sts & AX_USB_SS)
++ memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5);
++ else if (link_sts & AX_USB_HS)
++ memcpy(tmp, &AX88179_BULKIN_SIZE[1], 5);
++ else
++ memcpy(tmp, &AX88179_BULKIN_SIZE[3], 5);
++ } else if (GMII_PHY_PHYSR_100 == (tmp16 & GMII_PHY_PHYSR_SMASK)) {
++ mode |= AX_MEDIUM_PS;
++
++ if (link_sts & (AX_USB_SS | AX_USB_HS))
++ memcpy(tmp, &AX88179_BULKIN_SIZE[2], 5);
++ else
++ memcpy(tmp, &AX88179_BULKIN_SIZE[3], 5);
++ } else {
++ memcpy(tmp, &AX88179_BULKIN_SIZE[3], 5);
++ }
++
++ /* RX bulk configuration */
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_BULKIN_QCTRL, 5, 5, tmp);
++
++ dev->rx_urb_size = (1024 * (tmp[3] + 2));
++
++ if (tmp16 & GMII_PHY_PHYSR_FULL)
++ mode |= AX_MEDIUM_FULL_DUPLEX;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &mode);
++
++ ax179_data->eee_enabled = ax88179_chk_eee(dev);
++
++ netif_carrier_on(dev->net);
++
++ return 0;
++}
++
++static int ax88179_reset(struct usbnet *dev)
++{
++ u8 buf[5];
++ u16 *tmp16;
++ u8 *tmp;
++ struct ax88179_data *ax179_data = (struct ax88179_data *)dev->data;
++ struct ethtool_eee eee_data;
++
++ tmp16 = (u16 *)buf;
++ tmp = (u8 *)buf;
++
++ /* Power up ethernet PHY */
++ *tmp16 = 0;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL, 2, 2, tmp16);
++
++ *tmp16 = AX_PHYPWR_RSTCTL_IPRL;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL, 2, 2, tmp16);
++ msleep(200);
++
++ *tmp = AX_CLK_SELECT_ACS | AX_CLK_SELECT_BCS;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, tmp);
++ msleep(100);
++
++ /* Ethernet PHY Auto Detach*/
++ ax88179_auto_detach(dev, 0);
++
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN, ETH_ALEN,
++ dev->net->dev_addr);
++ memcpy(dev->net->perm_addr, dev->net->dev_addr, ETH_ALEN);
++
++ /* RX bulk configuration */
++ memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5);
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_BULKIN_QCTRL, 5, 5, tmp);
++
++ dev->rx_urb_size = 1024 * 20;
++
++ *tmp = 0x34;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PAUSE_WATERLVL_LOW, 1, 1, tmp);
++
++ *tmp = 0x52;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PAUSE_WATERLVL_HIGH,
++ 1, 1, tmp);
++
++ dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
++ NETIF_F_RXCSUM;
++
++ dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
++ NETIF_F_RXCSUM;
++
++ /* Enable checksum offload */
++ *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP |
++ AX_RXCOE_TCPV6 | AX_RXCOE_UDPV6;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RXCOE_CTL, 1, 1, tmp);
++
++ *tmp = AX_TXCOE_IP | AX_TXCOE_TCP | AX_TXCOE_UDP |
++ AX_TXCOE_TCPV6 | AX_TXCOE_UDPV6;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_TXCOE_CTL, 1, 1, tmp);
++
++ /* Configure RX control register => start operation */
++ *tmp16 = AX_RX_CTL_DROPCRCERR | AX_RX_CTL_IPE | AX_RX_CTL_START |
++ AX_RX_CTL_AP | AX_RX_CTL_AMALL | AX_RX_CTL_AB;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_RX_CTL, 2, 2, tmp16);
++
++ *tmp = AX_MONITOR_MODE_PMETYPE | AX_MONITOR_MODE_PMEPOL |
++ AX_MONITOR_MODE_RWMP;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MONITOR_MOD, 1, 1, tmp);
++
++ /* Configure default medium type => giga */
++ *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN |
++ AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_FULL_DUPLEX |
++ AX_MEDIUM_GIGAMODE;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, tmp16);
++
++ ax88179_led_setting(dev);
++
++ ax179_data->eee_enabled = 0;
++ ax179_data->eee_active = 0;
++
++ ax88179_disable_eee(dev);
++
++ ax88179_ethtool_get_eee(dev, &eee_data);
++ eee_data.advertised = 0;
++ ax88179_ethtool_set_eee(dev, &eee_data);
++
++ /* Restart autoneg */
++ mii_nway_restart(&dev->mii);
++
++ usbnet_link_change(dev, 0, 0);
++
++ return 0;
++}
++
++static int ax88179_stop(struct usbnet *dev)
++{
++ u16 tmp16;
++
++ ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &tmp16);
++ tmp16 &= ~AX_MEDIUM_RECEIVE_EN;
++ ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
++ 2, 2, &tmp16);
++
++ return 0;
++}
++
++static const struct driver_info ax88179_info = {
++ .description = "ASIX AX88179 USB 3.0 Gigabit Ethernet",
++ .bind = ax88179_bind,
++ .unbind = ax88179_unbind,
++ .status = ax88179_status,
++ .link_reset = ax88179_link_reset,
++ .reset = ax88179_reset,
++ .stop = ax88179_stop,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX,
++ .rx_fixup = ax88179_rx_fixup,
++ .tx_fixup = ax88179_tx_fixup,
++};
++
++static const struct driver_info ax88178a_info = {
++ .description = "ASIX AX88178A USB 2.0 Gigabit Ethernet",
++ .bind = ax88179_bind,
++ .unbind = ax88179_unbind,
++ .status = ax88179_status,
++ .link_reset = ax88179_link_reset,
++ .reset = ax88179_reset,
++ .stop = ax88179_stop,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX,
++ .rx_fixup = ax88179_rx_fixup,
++ .tx_fixup = ax88179_tx_fixup,
++};
++
++static const struct driver_info dlink_dub1312_info = {
++ .description = "D-Link DUB-1312 USB 3.0 to Gigabit Ethernet Adapter",
++ .bind = ax88179_bind,
++ .unbind = ax88179_unbind,
++ .status = ax88179_status,
++ .link_reset = ax88179_link_reset,
++ .reset = ax88179_reset,
++ .stop = ax88179_stop,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX,
++ .rx_fixup = ax88179_rx_fixup,
++ .tx_fixup = ax88179_tx_fixup,
++};
++
++static const struct driver_info sitecom_info = {
++ .description = "Sitecom USB 3.0 to Gigabit Adapter",
++ .bind = ax88179_bind,
++ .unbind = ax88179_unbind,
++ .status = ax88179_status,
++ .link_reset = ax88179_link_reset,
++ .reset = ax88179_reset,
++ .stop = ax88179_stop,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX,
++ .rx_fixup = ax88179_rx_fixup,
++ .tx_fixup = ax88179_tx_fixup,
++};
++
++static const struct driver_info samsung_info = {
++ .description = "Samsung USB Ethernet Adapter",
++ .bind = ax88179_bind,
++ .unbind = ax88179_unbind,
++ .status = ax88179_status,
++ .link_reset = ax88179_link_reset,
++ .reset = ax88179_reset,
++ .stop = ax88179_stop,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX,
++ .rx_fixup = ax88179_rx_fixup,
++ .tx_fixup = ax88179_tx_fixup,
++};
++
++static const struct driver_info lenovo_info = {
++ .description = "Lenovo OneLinkDock Gigabit LAN",
++ .bind = ax88179_bind,
++ .unbind = ax88179_unbind,
++ .status = ax88179_status,
++ .link_reset = ax88179_link_reset,
++ .reset = ax88179_reset,
++ .stop = ax88179_stop,
++ .flags = FLAG_ETHER | FLAG_FRAMING_AX,
++ .rx_fixup = ax88179_rx_fixup,
++ .tx_fixup = ax88179_tx_fixup,
++};
++
++static const struct usb_device_id products[] = {
++{
++ /* ASIX AX88179 10/100/1000 */
++ USB_DEVICE(0x0b95, 0x1790),
++ .driver_info = (unsigned long)&ax88179_info,
++}, {
++ /* ASIX AX88178A 10/100/1000 */
++ USB_DEVICE(0x0b95, 0x178a),
++ .driver_info = (unsigned long)&ax88178a_info,
++}, {
++ /* D-Link DUB-1312 USB 3.0 to Gigabit Ethernet Adapter */
++ USB_DEVICE(0x2001, 0x4a00),
++ .driver_info = (unsigned long)&dlink_dub1312_info,
++}, {
++ /* Sitecom USB 3.0 to Gigabit Adapter */
++ USB_DEVICE(0x0df6, 0x0072),
++ .driver_info = (unsigned long)&sitecom_info,
++}, {
++ /* Samsung USB Ethernet Adapter */
++ USB_DEVICE(0x04e8, 0xa100),
++ .driver_info = (unsigned long)&samsung_info,
++}, {
++ /* Lenovo OneLinkDock Gigabit LAN */
++ USB_DEVICE(0x17ef, 0x304b),
++ .driver_info = (unsigned long)&lenovo_info,
++},
++ { },
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver ax88179_178a_driver = {
++ .name = "ax88179_178a",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .suspend = ax88179_suspend,
++ .resume = ax88179_resume,
++ .reset_resume = ax88179_resume,
++ .disconnect = usbnet_disconnect,
++ .supports_autosuspend = 1,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(ax88179_178a_driver);
++
++MODULE_DESCRIPTION("ASIX AX88179/178A based USB 3.0/2.0 Gigabit Ethernet Devices");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/catc.c backports-3.18.1-1/drivers/net/usb/catc.c
+--- backports-3.18.1-1.org/drivers/net/usb/catc.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/catc.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,965 @@
++/*
++ * Copyright (c) 2001 Vojtech Pavlik
++ *
++ * CATC EL1210A NetMate USB Ethernet driver
++ *
++ * Sponsored by SuSE
++ *
++ * Based on the work of
++ * Donald Becker
++ *
++ * Old chipset support added by Simon Evans <spse@secret.org.uk> 2002
++ * - adds support for Belkin F5U011
++ */
++
++/*
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ *
++ * Should you need to contact me, the author, you can do so either by
++ * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
++ * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
++ */
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/string.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/skbuff.h>
++#include <linux/spinlock.h>
++#include <linux/ethtool.h>
++#include <linux/crc32.h>
++#include <linux/bitops.h>
++#include <linux/gfp.h>
++#include <asm/uaccess.h>
++
++#undef DEBUG
++
++#include <linux/usb.h>
++
++/*
++ * Version information.
++ */
++
++#define DRIVER_VERSION "v2.8"
++#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@suse.cz>"
++#define DRIVER_DESC "CATC EL1210A NetMate USB Ethernet driver"
++#define SHORT_DRIVER_DESC "EL1210A NetMate USB Ethernet"
++
++MODULE_AUTHOR(DRIVER_AUTHOR);
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("GPL");
++
++static const char driver_name[] = "catc";
++
++/*
++ * Some defines.
++ */
++
++#define STATS_UPDATE (HZ) /* Time between stats updates */
++#define TX_TIMEOUT (5*HZ) /* Max time the queue can be stopped */
++#define PKT_SZ 1536 /* Max Ethernet packet size */
++#define RX_MAX_BURST 15 /* Max packets per rx buffer (> 0, < 16) */
++#define TX_MAX_BURST 15 /* Max full sized packets per tx buffer (> 0) */
++#define CTRL_QUEUE 16 /* Max control requests in flight (power of two) */
++#define RX_PKT_SZ 1600 /* Max size of receive packet for F5U011 */
++
++/*
++ * Control requests.
++ */
++
++enum control_requests {
++ ReadMem = 0xf1,
++ GetMac = 0xf2,
++ Reset = 0xf4,
++ SetMac = 0xf5,
++ SetRxMode = 0xf5, /* F5U011 only */
++ WriteROM = 0xf8,
++ SetReg = 0xfa,
++ GetReg = 0xfb,
++ WriteMem = 0xfc,
++ ReadROM = 0xfd,
++};
++
++/*
++ * Registers.
++ */
++
++enum register_offsets {
++ TxBufCount = 0x20,
++ RxBufCount = 0x21,
++ OpModes = 0x22,
++ TxQed = 0x23,
++ RxQed = 0x24,
++ MaxBurst = 0x25,
++ RxUnit = 0x60,
++ EthStatus = 0x61,
++ StationAddr0 = 0x67,
++ EthStats = 0x69,
++ LEDCtrl = 0x81,
++};
++
++enum eth_stats {
++ TxSingleColl = 0x00,
++ TxMultiColl = 0x02,
++ TxExcessColl = 0x04,
++ RxFramErr = 0x06,
++};
++
++enum op_mode_bits {
++ Op3MemWaits = 0x03,
++ OpLenInclude = 0x08,
++ OpRxMerge = 0x10,
++ OpTxMerge = 0x20,
++ OpWin95bugfix = 0x40,
++ OpLoopback = 0x80,
++};
++
++enum rx_filter_bits {
++ RxEnable = 0x01,
++ RxPolarity = 0x02,
++ RxForceOK = 0x04,
++ RxMultiCast = 0x08,
++ RxPromisc = 0x10,
++ AltRxPromisc = 0x20, /* F5U011 uses different bit */
++};
++
++enum led_values {
++ LEDFast = 0x01,
++ LEDSlow = 0x02,
++ LEDFlash = 0x03,
++ LEDPulse = 0x04,
++ LEDLink = 0x08,
++};
++
++enum link_status {
++ LinkNoChange = 0,
++ LinkGood = 1,
++ LinkBad = 2
++};
++
++/*
++ * The catc struct.
++ */
++
++#define CTRL_RUNNING 0
++#define RX_RUNNING 1
++#define TX_RUNNING 2
++
++struct catc {
++ struct net_device *netdev;
++ struct usb_device *usbdev;
++
++ unsigned long flags;
++
++ unsigned int tx_ptr, tx_idx;
++ unsigned int ctrl_head, ctrl_tail;
++ spinlock_t tx_lock, ctrl_lock;
++
++ u8 tx_buf[2][TX_MAX_BURST * (PKT_SZ + 2)];
++ u8 rx_buf[RX_MAX_BURST * (PKT_SZ + 2)];
++ u8 irq_buf[2];
++ u8 ctrl_buf[64];
++ struct usb_ctrlrequest ctrl_dr;
++
++ struct timer_list timer;
++ u8 stats_buf[8];
++ u16 stats_vals[4];
++ unsigned long last_stats;
++
++ u8 multicast[64];
++
++ struct ctrl_queue {
++ u8 dir;
++ u8 request;
++ u16 value;
++ u16 index;
++ void *buf;
++ int len;
++ void (*callback)(struct catc *catc, struct ctrl_queue *q);
++ } ctrl_queue[CTRL_QUEUE];
++
++ struct urb *tx_urb, *rx_urb, *irq_urb, *ctrl_urb;
++
++ u8 is_f5u011; /* Set if device is an F5U011 */
++ u8 rxmode[2]; /* Used for F5U011 */
++ atomic_t recq_sz; /* Used for F5U011 - counter of waiting rx packets */
++};
++
++/*
++ * Useful macros.
++ */
++
++#define catc_get_mac(catc, mac) catc_ctrl_msg(catc, USB_DIR_IN, GetMac, 0, 0, mac, 6)
++#define catc_reset(catc) catc_ctrl_msg(catc, USB_DIR_OUT, Reset, 0, 0, NULL, 0)
++#define catc_set_reg(catc, reg, val) catc_ctrl_msg(catc, USB_DIR_OUT, SetReg, val, reg, NULL, 0)
++#define catc_get_reg(catc, reg, buf) catc_ctrl_msg(catc, USB_DIR_IN, GetReg, 0, reg, buf, 1)
++#define catc_write_mem(catc, addr, buf, size) catc_ctrl_msg(catc, USB_DIR_OUT, WriteMem, 0, addr, buf, size)
++#define catc_read_mem(catc, addr, buf, size) catc_ctrl_msg(catc, USB_DIR_IN, ReadMem, 0, addr, buf, size)
++
++#define f5u011_rxmode(catc, rxmode) catc_ctrl_msg(catc, USB_DIR_OUT, SetRxMode, 0, 1, rxmode, 2)
++#define f5u011_rxmode_async(catc, rxmode) catc_ctrl_async(catc, USB_DIR_OUT, SetRxMode, 0, 1, &rxmode, 2, NULL)
++#define f5u011_mchash_async(catc, hash) catc_ctrl_async(catc, USB_DIR_OUT, SetRxMode, 0, 2, &hash, 8, NULL)
++
++#define catc_set_reg_async(catc, reg, val) catc_ctrl_async(catc, USB_DIR_OUT, SetReg, val, reg, NULL, 0, NULL)
++#define catc_get_reg_async(catc, reg, cb) catc_ctrl_async(catc, USB_DIR_IN, GetReg, 0, reg, NULL, 1, cb)
++#define catc_write_mem_async(catc, addr, buf, size) catc_ctrl_async(catc, USB_DIR_OUT, WriteMem, 0, addr, buf, size, NULL)
++
++/*
++ * Receive routines.
++ */
++
++static void catc_rx_done(struct urb *urb)
++{
++ struct catc *catc = urb->context;
++ u8 *pkt_start = urb->transfer_buffer;
++ struct sk_buff *skb;
++ int pkt_len, pkt_offset = 0;
++ int status = urb->status;
++
++ if (!catc->is_f5u011) {
++ clear_bit(RX_RUNNING, &catc->flags);
++ pkt_offset = 2;
++ }
++
++ if (status) {
++ dev_dbg(&urb->dev->dev, "rx_done, status %d, length %d\n",
++ status, urb->actual_length);
++ return;
++ }
++
++ do {
++ if(!catc->is_f5u011) {
++ pkt_len = le16_to_cpup((__le16*)pkt_start);
++ if (pkt_len > urb->actual_length) {
++ catc->netdev->stats.rx_length_errors++;
++ catc->netdev->stats.rx_errors++;
++ break;
++ }
++ } else {
++ pkt_len = urb->actual_length;
++ }
++
++ if (!(skb = dev_alloc_skb(pkt_len)))
++ return;
++
++ skb_copy_to_linear_data(skb, pkt_start + pkt_offset, pkt_len);
++ skb_put(skb, pkt_len);
++
++ skb->protocol = eth_type_trans(skb, catc->netdev);
++ netif_rx(skb);
++
++ catc->netdev->stats.rx_packets++;
++ catc->netdev->stats.rx_bytes += pkt_len;
++
++ /* F5U011 only does one packet per RX */
++ if (catc->is_f5u011)
++ break;
++ pkt_start += (((pkt_len + 1) >> 6) + 1) << 6;
++
++ } while (pkt_start - (u8 *) urb->transfer_buffer < urb->actual_length);
++
++ if (catc->is_f5u011) {
++ if (atomic_read(&catc->recq_sz)) {
++ int state;
++ atomic_dec(&catc->recq_sz);
++ netdev_dbg(catc->netdev, "getting extra packet\n");
++ urb->dev = catc->usbdev;
++ if ((state = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
++ netdev_dbg(catc->netdev,
++ "submit(rx_urb) status %d\n", state);
++ }
++ } else {
++ clear_bit(RX_RUNNING, &catc->flags);
++ }
++ }
++}
++
++static void catc_irq_done(struct urb *urb)
++{
++ struct catc *catc = urb->context;
++ u8 *data = urb->transfer_buffer;
++ int status = urb->status;
++ unsigned int hasdata = 0, linksts = LinkNoChange;
++ int res;
++
++ if (!catc->is_f5u011) {
++ hasdata = data[1] & 0x80;
++ if (data[1] & 0x40)
++ linksts = LinkGood;
++ else if (data[1] & 0x20)
++ linksts = LinkBad;
++ } else {
++ hasdata = (unsigned int)(be16_to_cpup((__be16*)data) & 0x0fff);
++ if (data[0] == 0x90)
++ linksts = LinkGood;
++ else if (data[0] == 0xA0)
++ linksts = LinkBad;
++ }
++
++ switch (status) {
++ case 0: /* success */
++ break;
++ case -ECONNRESET: /* unlink */
++ case -ENOENT:
++ case -ESHUTDOWN:
++ return;
++ /* -EPIPE: should clear the halt */
++ default: /* error */
++ dev_dbg(&urb->dev->dev,
++ "irq_done, status %d, data %02x %02x.\n",
++ status, data[0], data[1]);
++ goto resubmit;
++ }
++
++ if (linksts == LinkGood) {
++ netif_carrier_on(catc->netdev);
++ netdev_dbg(catc->netdev, "link ok\n");
++ }
++
++ if (linksts == LinkBad) {
++ netif_carrier_off(catc->netdev);
++ netdev_dbg(catc->netdev, "link bad\n");
++ }
++
++ if (hasdata) {
++ if (test_and_set_bit(RX_RUNNING, &catc->flags)) {
++ if (catc->is_f5u011)
++ atomic_inc(&catc->recq_sz);
++ } else {
++ catc->rx_urb->dev = catc->usbdev;
++ if ((res = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) {
++ dev_err(&catc->usbdev->dev,
++ "submit(rx_urb) status %d\n", res);
++ }
++ }
++ }
++resubmit:
++ res = usb_submit_urb (urb, GFP_ATOMIC);
++ if (res)
++ dev_err(&catc->usbdev->dev,
++ "can't resubmit intr, %s-%s, status %d\n",
++ catc->usbdev->bus->bus_name,
++ catc->usbdev->devpath, res);
++}
++
++/*
++ * Transmit routines.
++ */
++
++static int catc_tx_run(struct catc *catc)
++{
++ int status;
++
++ if (catc->is_f5u011)
++ catc->tx_ptr = (catc->tx_ptr + 63) & ~63;
++
++ catc->tx_urb->transfer_buffer_length = catc->tx_ptr;
++ catc->tx_urb->transfer_buffer = catc->tx_buf[catc->tx_idx];
++ catc->tx_urb->dev = catc->usbdev;
++
++ if ((status = usb_submit_urb(catc->tx_urb, GFP_ATOMIC)) < 0)
++ dev_err(&catc->usbdev->dev, "submit(tx_urb), status %d\n",
++ status);
++
++ catc->tx_idx = !catc->tx_idx;
++ catc->tx_ptr = 0;
++
++ catc->netdev->trans_start = jiffies;
++ return status;
++}
++
++static void catc_tx_done(struct urb *urb)
++{
++ struct catc *catc = urb->context;
++ unsigned long flags;
++ int r, status = urb->status;
++
++ if (status == -ECONNRESET) {
++ dev_dbg(&urb->dev->dev, "Tx Reset.\n");
++ urb->status = 0;
++ catc->netdev->trans_start = jiffies;
++ catc->netdev->stats.tx_errors++;
++ clear_bit(TX_RUNNING, &catc->flags);
++ netif_wake_queue(catc->netdev);
++ return;
++ }
++
++ if (status) {
++ dev_dbg(&urb->dev->dev, "tx_done, status %d, length %d\n",
++ status, urb->actual_length);
++ return;
++ }
++
++ spin_lock_irqsave(&catc->tx_lock, flags);
++
++ if (catc->tx_ptr) {
++ r = catc_tx_run(catc);
++ if (unlikely(r < 0))
++ clear_bit(TX_RUNNING, &catc->flags);
++ } else {
++ clear_bit(TX_RUNNING, &catc->flags);
++ }
++
++ netif_wake_queue(catc->netdev);
++
++ spin_unlock_irqrestore(&catc->tx_lock, flags);
++}
++
++static netdev_tx_t catc_start_xmit(struct sk_buff *skb,
++ struct net_device *netdev)
++{
++ struct catc *catc = netdev_priv(netdev);
++ unsigned long flags;
++ int r = 0;
++ char *tx_buf;
++
++ spin_lock_irqsave(&catc->tx_lock, flags);
++
++ catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6;
++ tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr;
++ if (catc->is_f5u011)
++ *(__be16 *)tx_buf = cpu_to_be16(skb->len);
++ else
++ *(__le16 *)tx_buf = cpu_to_le16(skb->len);
++ skb_copy_from_linear_data(skb, tx_buf + 2, skb->len);
++ catc->tx_ptr += skb->len + 2;
++
++ if (!test_and_set_bit(TX_RUNNING, &catc->flags)) {
++ r = catc_tx_run(catc);
++ if (r < 0)
++ clear_bit(TX_RUNNING, &catc->flags);
++ }
++
++ if ((catc->is_f5u011 && catc->tx_ptr) ||
++ (catc->tx_ptr >= ((TX_MAX_BURST - 1) * (PKT_SZ + 2))))
++ netif_stop_queue(netdev);
++
++ spin_unlock_irqrestore(&catc->tx_lock, flags);
++
++ if (r >= 0) {
++ catc->netdev->stats.tx_bytes += skb->len;
++ catc->netdev->stats.tx_packets++;
++ }
++
++ dev_kfree_skb(skb);
++
++ return NETDEV_TX_OK;
++}
++
++static void catc_tx_timeout(struct net_device *netdev)
++{
++ struct catc *catc = netdev_priv(netdev);
++
++ dev_warn(&netdev->dev, "Transmit timed out.\n");
++ usb_unlink_urb(catc->tx_urb);
++}
++
++/*
++ * Control messages.
++ */
++
++static int catc_ctrl_msg(struct catc *catc, u8 dir, u8 request, u16 value, u16 index, void *buf, int len)
++{
++ int retval = usb_control_msg(catc->usbdev,
++ dir ? usb_rcvctrlpipe(catc->usbdev, 0) : usb_sndctrlpipe(catc->usbdev, 0),
++ request, 0x40 | dir, value, index, buf, len, 1000);
++ return retval < 0 ? retval : 0;
++}
++
++static void catc_ctrl_run(struct catc *catc)
++{
++ struct ctrl_queue *q = catc->ctrl_queue + catc->ctrl_tail;
++ struct usb_device *usbdev = catc->usbdev;
++ struct urb *urb = catc->ctrl_urb;
++ struct usb_ctrlrequest *dr = &catc->ctrl_dr;
++ int status;
++
++ dr->bRequest = q->request;
++ dr->bRequestType = 0x40 | q->dir;
++ dr->wValue = cpu_to_le16(q->value);
++ dr->wIndex = cpu_to_le16(q->index);
++ dr->wLength = cpu_to_le16(q->len);
++
++ urb->pipe = q->dir ? usb_rcvctrlpipe(usbdev, 0) : usb_sndctrlpipe(usbdev, 0);
++ urb->transfer_buffer_length = q->len;
++ urb->transfer_buffer = catc->ctrl_buf;
++ urb->setup_packet = (void *) dr;
++ urb->dev = usbdev;
++
++ if (!q->dir && q->buf && q->len)
++ memcpy(catc->ctrl_buf, q->buf, q->len);
++
++ if ((status = usb_submit_urb(catc->ctrl_urb, GFP_ATOMIC)))
++ dev_err(&catc->usbdev->dev, "submit(ctrl_urb) status %d\n",
++ status);
++}
++
++static void catc_ctrl_done(struct urb *urb)
++{
++ struct catc *catc = urb->context;
++ struct ctrl_queue *q;
++ unsigned long flags;
++ int status = urb->status;
++
++ if (status)
++ dev_dbg(&urb->dev->dev, "ctrl_done, status %d, len %d.\n",
++ status, urb->actual_length);
++
++ spin_lock_irqsave(&catc->ctrl_lock, flags);
++
++ q = catc->ctrl_queue + catc->ctrl_tail;
++
++ if (q->dir) {
++ if (q->buf && q->len)
++ memcpy(q->buf, catc->ctrl_buf, q->len);
++ else
++ q->buf = catc->ctrl_buf;
++ }
++
++ if (q->callback)
++ q->callback(catc, q);
++
++ catc->ctrl_tail = (catc->ctrl_tail + 1) & (CTRL_QUEUE - 1);
++
++ if (catc->ctrl_head != catc->ctrl_tail)
++ catc_ctrl_run(catc);
++ else
++ clear_bit(CTRL_RUNNING, &catc->flags);
++
++ spin_unlock_irqrestore(&catc->ctrl_lock, flags);
++}
++
++static int catc_ctrl_async(struct catc *catc, u8 dir, u8 request, u16 value,
++ u16 index, void *buf, int len, void (*callback)(struct catc *catc, struct ctrl_queue *q))
++{
++ struct ctrl_queue *q;
++ int retval = 0;
++ unsigned long flags;
++
++ spin_lock_irqsave(&catc->ctrl_lock, flags);
++
++ q = catc->ctrl_queue + catc->ctrl_head;
++
++ q->dir = dir;
++ q->request = request;
++ q->value = value;
++ q->index = index;
++ q->buf = buf;
++ q->len = len;
++ q->callback = callback;
++
++ catc->ctrl_head = (catc->ctrl_head + 1) & (CTRL_QUEUE - 1);
++
++ if (catc->ctrl_head == catc->ctrl_tail) {
++ dev_err(&catc->usbdev->dev, "ctrl queue full\n");
++ catc->ctrl_tail = (catc->ctrl_tail + 1) & (CTRL_QUEUE - 1);
++ retval = -1;
++ }
++
++ if (!test_and_set_bit(CTRL_RUNNING, &catc->flags))
++ catc_ctrl_run(catc);
++
++ spin_unlock_irqrestore(&catc->ctrl_lock, flags);
++
++ return retval;
++}
++
++/*
++ * Statistics.
++ */
++
++static void catc_stats_done(struct catc *catc, struct ctrl_queue *q)
++{
++ int index = q->index - EthStats;
++ u16 data, last;
++
++ catc->stats_buf[index] = *((char *)q->buf);
++
++ if (index & 1)
++ return;
++
++ data = ((u16)catc->stats_buf[index] << 8) | catc->stats_buf[index + 1];
++ last = catc->stats_vals[index >> 1];
++
++ switch (index) {
++ case TxSingleColl:
++ case TxMultiColl:
++ catc->netdev->stats.collisions += data - last;
++ break;
++ case TxExcessColl:
++ catc->netdev->stats.tx_aborted_errors += data - last;
++ catc->netdev->stats.tx_errors += data - last;
++ break;
++ case RxFramErr:
++ catc->netdev->stats.rx_frame_errors += data - last;
++ catc->netdev->stats.rx_errors += data - last;
++ break;
++ }
++
++ catc->stats_vals[index >> 1] = data;
++}
++
++static void catc_stats_timer(unsigned long data)
++{
++ struct catc *catc = (void *) data;
++ int i;
++
++ for (i = 0; i < 8; i++)
++ catc_get_reg_async(catc, EthStats + 7 - i, catc_stats_done);
++
++ mod_timer(&catc->timer, jiffies + STATS_UPDATE);
++}
++
++/*
++ * Receive modes. Broadcast, Multicast, Promisc.
++ */
++
++static void catc_multicast(unsigned char *addr, u8 *multicast)
++{
++ u32 crc;
++
++ crc = ether_crc_le(6, addr);
++ multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7);
++}
++
++static void catc_set_multicast_list(struct net_device *netdev)
++{
++ struct catc *catc = netdev_priv(netdev);
++ struct netdev_hw_addr *ha;
++ u8 broadcast[ETH_ALEN];
++ u8 rx = RxEnable | RxPolarity | RxMultiCast;
++
++ memset(broadcast, 0xff, ETH_ALEN);
++ memset(catc->multicast, 0, 64);
++
++ catc_multicast(broadcast, catc->multicast);
++ catc_multicast(netdev->dev_addr, catc->multicast);
++
++ if (netdev->flags & IFF_PROMISC) {
++ memset(catc->multicast, 0xff, 64);
++ rx |= (!catc->is_f5u011) ? RxPromisc : AltRxPromisc;
++ }
++
++ if (netdev->flags & IFF_ALLMULTI) {
++ memset(catc->multicast, 0xff, 64);
++ } else {
++ netdev_for_each_mc_addr(ha, netdev) {
++ u32 crc = ether_crc_le(6, ha->addr);
++ if (!catc->is_f5u011) {
++ catc->multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7);
++ } else {
++ catc->multicast[7-(crc >> 29)] |= 1 << ((crc >> 26) & 7);
++ }
++ }
++ }
++ if (!catc->is_f5u011) {
++ catc_set_reg_async(catc, RxUnit, rx);
++ catc_write_mem_async(catc, 0xfa80, catc->multicast, 64);
++ } else {
++ f5u011_mchash_async(catc, catc->multicast);
++ if (catc->rxmode[0] != rx) {
++ catc->rxmode[0] = rx;
++ netdev_dbg(catc->netdev,
++ "Setting RX mode to %2.2X %2.2X\n",
++ catc->rxmode[0], catc->rxmode[1]);
++ f5u011_rxmode_async(catc, catc->rxmode);
++ }
++ }
++}
++
++static void catc_get_drvinfo(struct net_device *dev,
++ struct ethtool_drvinfo *info)
++{
++ struct catc *catc = netdev_priv(dev);
++ strlcpy(info->driver, driver_name, sizeof(info->driver));
++ strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
++ usb_make_path(catc->usbdev, info->bus_info, sizeof(info->bus_info));
++}
++
++static int catc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
++{
++ struct catc *catc = netdev_priv(dev);
++ if (!catc->is_f5u011)
++ return -EOPNOTSUPP;
++
++ cmd->supported = SUPPORTED_10baseT_Half | SUPPORTED_TP;
++ cmd->advertising = ADVERTISED_10baseT_Half | ADVERTISED_TP;
++ ethtool_cmd_speed_set(cmd, SPEED_10);
++ cmd->duplex = DUPLEX_HALF;
++ cmd->port = PORT_TP;
++ cmd->phy_address = 0;
++ cmd->transceiver = XCVR_INTERNAL;
++ cmd->autoneg = AUTONEG_DISABLE;
++ cmd->maxtxpkt = 1;
++ cmd->maxrxpkt = 1;
++ return 0;
++}
++
++static const struct ethtool_ops ops = {
++ .get_drvinfo = catc_get_drvinfo,
++ .get_settings = catc_get_settings,
++ .get_link = ethtool_op_get_link
++};
++
++/*
++ * Open, close.
++ */
++
++static int catc_open(struct net_device *netdev)
++{
++ struct catc *catc = netdev_priv(netdev);
++ int status;
++
++ catc->irq_urb->dev = catc->usbdev;
++ if ((status = usb_submit_urb(catc->irq_urb, GFP_KERNEL)) < 0) {
++ dev_err(&catc->usbdev->dev, "submit(irq_urb) status %d\n",
++ status);
++ return -1;
++ }
++
++ netif_start_queue(netdev);
++
++ if (!catc->is_f5u011)
++ mod_timer(&catc->timer, jiffies + STATS_UPDATE);
++
++ return 0;
++}
++
++static int catc_stop(struct net_device *netdev)
++{
++ struct catc *catc = netdev_priv(netdev);
++
++ netif_stop_queue(netdev);
++
++ if (!catc->is_f5u011)
++ del_timer_sync(&catc->timer);
++
++ usb_kill_urb(catc->rx_urb);
++ usb_kill_urb(catc->tx_urb);
++ usb_kill_urb(catc->irq_urb);
++ usb_kill_urb(catc->ctrl_urb);
++
++ return 0;
++}
++
++static const struct net_device_ops catc_netdev_ops = {
++ .ndo_open = catc_open,
++ .ndo_stop = catc_stop,
++ .ndo_start_xmit = catc_start_xmit,
++
++ .ndo_tx_timeout = catc_tx_timeout,
++ .ndo_set_rx_mode = catc_set_multicast_list,
++ .ndo_change_mtu = eth_change_mtu,
++ .ndo_set_mac_address = eth_mac_addr,
++ .ndo_validate_addr = eth_validate_addr,
++};
++
++/*
++ * USB probe, disconnect.
++ */
++
++static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id)
++{
++ struct device *dev = &intf->dev;
++ struct usb_device *usbdev = interface_to_usbdev(intf);
++ struct net_device *netdev;
++ struct catc *catc;
++ u8 broadcast[ETH_ALEN];
++ int i, pktsz;
++
++ if (usb_set_interface(usbdev,
++ intf->altsetting->desc.bInterfaceNumber, 1)) {
++ dev_err(dev, "Can't set altsetting 1.\n");
++ return -EIO;
++ }
++
++ netdev = alloc_etherdev(sizeof(struct catc));
++ if (!netdev)
++ return -ENOMEM;
++
++ catc = netdev_priv(netdev);
++
++ netdev->netdev_ops = &catc_netdev_ops;
++ netdev->watchdog_timeo = TX_TIMEOUT;
++ netdev->ethtool_ops = &ops;
++
++ catc->usbdev = usbdev;
++ catc->netdev = netdev;
++
++ spin_lock_init(&catc->tx_lock);
++ spin_lock_init(&catc->ctrl_lock);
++
++ init_timer(&catc->timer);
++ catc->timer.data = (long) catc;
++ catc->timer.function = catc_stats_timer;
++
++ catc->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL);
++ catc->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ catc->rx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ catc->irq_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if ((!catc->ctrl_urb) || (!catc->tx_urb) ||
++ (!catc->rx_urb) || (!catc->irq_urb)) {
++ dev_err(&intf->dev, "No free urbs available.\n");
++ usb_free_urb(catc->ctrl_urb);
++ usb_free_urb(catc->tx_urb);
++ usb_free_urb(catc->rx_urb);
++ usb_free_urb(catc->irq_urb);
++ free_netdev(netdev);
++ return -ENOMEM;
++ }
++
++ /* The F5U011 has the same vendor/product as the netmate but a device version of 0x130 */
++ if (le16_to_cpu(usbdev->descriptor.idVendor) == 0x0423 &&
++ le16_to_cpu(usbdev->descriptor.idProduct) == 0xa &&
++ le16_to_cpu(catc->usbdev->descriptor.bcdDevice) == 0x0130) {
++ dev_dbg(dev, "Testing for f5u011\n");
++ catc->is_f5u011 = 1;
++ atomic_set(&catc->recq_sz, 0);
++ pktsz = RX_PKT_SZ;
++ } else {
++ pktsz = RX_MAX_BURST * (PKT_SZ + 2);
++ }
++
++ usb_fill_control_urb(catc->ctrl_urb, usbdev, usb_sndctrlpipe(usbdev, 0),
++ NULL, NULL, 0, catc_ctrl_done, catc);
++
++ usb_fill_bulk_urb(catc->tx_urb, usbdev, usb_sndbulkpipe(usbdev, 1),
++ NULL, 0, catc_tx_done, catc);
++
++ usb_fill_bulk_urb(catc->rx_urb, usbdev, usb_rcvbulkpipe(usbdev, 1),
++ catc->rx_buf, pktsz, catc_rx_done, catc);
++
++ usb_fill_int_urb(catc->irq_urb, usbdev, usb_rcvintpipe(usbdev, 2),
++ catc->irq_buf, 2, catc_irq_done, catc, 1);
++
++ if (!catc->is_f5u011) {
++ dev_dbg(dev, "Checking memory size\n");
++
++ i = 0x12345678;
++ catc_write_mem(catc, 0x7a80, &i, 4);
++ i = 0x87654321;
++ catc_write_mem(catc, 0xfa80, &i, 4);
++ catc_read_mem(catc, 0x7a80, &i, 4);
++
++ switch (i) {
++ case 0x12345678:
++ catc_set_reg(catc, TxBufCount, 8);
++ catc_set_reg(catc, RxBufCount, 32);
++ dev_dbg(dev, "64k Memory\n");
++ break;
++ default:
++ dev_warn(&intf->dev,
++ "Couldn't detect memory size, assuming 32k\n");
++ case 0x87654321:
++ catc_set_reg(catc, TxBufCount, 4);
++ catc_set_reg(catc, RxBufCount, 16);
++ dev_dbg(dev, "32k Memory\n");
++ break;
++ }
++
++ dev_dbg(dev, "Getting MAC from SEEROM.\n");
++
++ catc_get_mac(catc, netdev->dev_addr);
++
++ dev_dbg(dev, "Setting MAC into registers.\n");
++
++ for (i = 0; i < 6; i++)
++ catc_set_reg(catc, StationAddr0 - i, netdev->dev_addr[i]);
++
++ dev_dbg(dev, "Filling the multicast list.\n");
++
++ memset(broadcast, 0xff, ETH_ALEN);
++ catc_multicast(broadcast, catc->multicast);
++ catc_multicast(netdev->dev_addr, catc->multicast);
++ catc_write_mem(catc, 0xfa80, catc->multicast, 64);
++
++ dev_dbg(dev, "Clearing error counters.\n");
++
++ for (i = 0; i < 8; i++)
++ catc_set_reg(catc, EthStats + i, 0);
++ catc->last_stats = jiffies;
++
++ dev_dbg(dev, "Enabling.\n");
++
++ catc_set_reg(catc, MaxBurst, RX_MAX_BURST);
++ catc_set_reg(catc, OpModes, OpTxMerge | OpRxMerge | OpLenInclude | Op3MemWaits);
++ catc_set_reg(catc, LEDCtrl, LEDLink);
++ catc_set_reg(catc, RxUnit, RxEnable | RxPolarity | RxMultiCast);
++ } else {
++ dev_dbg(dev, "Performing reset\n");
++ catc_reset(catc);
++ catc_get_mac(catc, netdev->dev_addr);
++
++ dev_dbg(dev, "Setting RX Mode\n");
++ catc->rxmode[0] = RxEnable | RxPolarity | RxMultiCast;
++ catc->rxmode[1] = 0;
++ f5u011_rxmode(catc, catc->rxmode);
++ }
++ dev_dbg(dev, "Init done.\n");
++ printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, %pM.\n",
++ netdev->name, (catc->is_f5u011) ? "Belkin F5U011" : "CATC EL1210A NetMate",
++ usbdev->bus->bus_name, usbdev->devpath, netdev->dev_addr);
++ usb_set_intfdata(intf, catc);
++
++ SET_NETDEV_DEV(netdev, &intf->dev);
++ if (register_netdev(netdev) != 0) {
++ usb_set_intfdata(intf, NULL);
++ usb_free_urb(catc->ctrl_urb);
++ usb_free_urb(catc->tx_urb);
++ usb_free_urb(catc->rx_urb);
++ usb_free_urb(catc->irq_urb);
++ free_netdev(netdev);
++ return -EIO;
++ }
++ return 0;
++}
++
++static void catc_disconnect(struct usb_interface *intf)
++{
++ struct catc *catc = usb_get_intfdata(intf);
++
++ usb_set_intfdata(intf, NULL);
++ if (catc) {
++ unregister_netdev(catc->netdev);
++ usb_free_urb(catc->ctrl_urb);
++ usb_free_urb(catc->tx_urb);
++ usb_free_urb(catc->rx_urb);
++ usb_free_urb(catc->irq_urb);
++ free_netdev(catc->netdev);
++ }
++}
++
++/*
++ * Module functions and tables.
++ */
++
++static struct usb_device_id catc_id_table [] = {
++ { USB_DEVICE(0x0423, 0xa) }, /* CATC Netmate, Belkin F5U011 */
++ { USB_DEVICE(0x0423, 0xc) }, /* CATC Netmate II, Belkin F5U111 */
++ { USB_DEVICE(0x08d1, 0x1) }, /* smartBridges smartNIC */
++ { }
++};
++
++MODULE_DEVICE_TABLE(usb, catc_id_table);
++
++static struct usb_driver catc_driver = {
++ .name = driver_name,
++ .probe = catc_probe,
++ .disconnect = catc_disconnect,
++ .id_table = catc_id_table,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(catc_driver);
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc_eem.c backports-3.18.1-1/drivers/net/usb/cdc_eem.c
+--- backports-3.18.1-1.org/drivers/net/usb/cdc_eem.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/cdc_eem.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,381 @@
++/*
++ * USB CDC EEM network interface driver
++ * Copyright (C) 2009 Oberthur Technologies
++ * by Omar Laazimani, Olivier Condemine
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ctype.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/crc32.h>
++#include <linux/usb/cdc.h>
++#include <linux/usb/usbnet.h>
++#include <linux/gfp.h>
++#include <linux/if_vlan.h>
++
++
++/*
++ * This driver is an implementation of the CDC "Ethernet Emulation
++ * Model" (EEM) specification, which encapsulates Ethernet frames
++ * for transport over USB using a simpler USB device model than the
++ * previous CDC "Ethernet Control Model" (ECM, or "CDC Ethernet").
++ *
++ * For details, see www.usb.org/developers/devclass_docs/CDC_EEM10.pdf
++ *
++ * This version has been tested with GIGAntIC WuaoW SIM Smart Card on 2.6.24,
++ * 2.6.27 and 2.6.30rc2 kernel.
++ * It has also been validated on Openmoko Om 2008.12 (based on 2.6.24 kernel).
++ * build on 23-April-2009
++ */
++
++#define EEM_HEAD 2 /* 2 byte header */
++
++/*-------------------------------------------------------------------------*/
++
++static void eem_linkcmd_complete(struct urb *urb)
++{
++ dev_kfree_skb(urb->context);
++ usb_free_urb(urb);
++}
++
++static void eem_linkcmd(struct usbnet *dev, struct sk_buff *skb)
++{
++ struct urb *urb;
++ int status;
++
++ urb = usb_alloc_urb(0, GFP_ATOMIC);
++ if (!urb)
++ goto fail;
++
++ usb_fill_bulk_urb(urb, dev->udev, dev->out,
++ skb->data, skb->len, eem_linkcmd_complete, skb);
++
++ status = usb_submit_urb(urb, GFP_ATOMIC);
++ if (status) {
++ usb_free_urb(urb);
++fail:
++ dev_kfree_skb(skb);
++ netdev_warn(dev->net, "link cmd failure\n");
++ return;
++ }
++}
++
++static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int status = 0;
++
++ status = usbnet_get_endpoints(dev, intf);
++ if (status < 0) {
++ usb_set_intfdata(intf, NULL);
++ usb_driver_release_interface(driver_of(intf), intf);
++ return status;
++ }
++
++ /* no jumbogram (16K) support for now */
++
++ dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN + VLAN_HLEN;
++ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
++
++ return 0;
++}
++
++/*
++ * EEM permits packing multiple Ethernet frames into USB transfers
++ * (a "bundle"), but for TX we don't try to do that.
++ */
++static struct sk_buff *eem_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
++ gfp_t flags)
++{
++ struct sk_buff *skb2 = NULL;
++ u16 len = skb->len;
++ u32 crc = 0;
++ int padlen = 0;
++
++ /* When ((len + EEM_HEAD + ETH_FCS_LEN) % dev->maxpacket) is
++ * zero, stick two bytes of zero length EEM packet on the end.
++ * Else the framework would add invalid single byte padding,
++ * since it can't know whether ZLPs will be handled right by
++ * all the relevant hardware and software.
++ */
++ if (!((len + EEM_HEAD + ETH_FCS_LEN) % dev->maxpacket))
++ padlen += 2;
++
++ if (!skb_cloned(skb)) {
++ int headroom = skb_headroom(skb);
++ int tailroom = skb_tailroom(skb);
++
++ if ((tailroom >= ETH_FCS_LEN + padlen) &&
++ (headroom >= EEM_HEAD))
++ goto done;
++
++ if ((headroom + tailroom)
++ > (EEM_HEAD + ETH_FCS_LEN + padlen)) {
++ skb->data = memmove(skb->head +
++ EEM_HEAD,
++ skb->data,
++ skb->len);
++ skb_set_tail_pointer(skb, len);
++ goto done;
++ }
++ }
++
++ skb2 = skb_copy_expand(skb, EEM_HEAD, ETH_FCS_LEN + padlen, flags);
++ if (!skb2)
++ return NULL;
++
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++
++done:
++ /* we don't use the "no Ethernet CRC" option */
++ crc = crc32_le(~0, skb->data, skb->len);
++ crc = ~crc;
++
++ put_unaligned_le32(crc, skb_put(skb, 4));
++
++ /* EEM packet header format:
++ * b0..13: length of ethernet frame
++ * b14: bmCRC (1 == valid Ethernet CRC)
++ * b15: bmType (0 == data)
++ */
++ len = skb->len;
++ put_unaligned_le16(BIT(14) | len, skb_push(skb, 2));
++
++ /* Bundle a zero length EEM packet if needed */
++ if (padlen)
++ put_unaligned_le16(0, skb_put(skb, 2));
++
++ return skb;
++}
++
++static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ /*
++ * Our task here is to strip off framing, leaving skb with one
++ * data frame for the usbnet framework code to process. But we
++ * may have received multiple EEM payloads, or command payloads.
++ * So we must process _everything_ as if it's a header, except
++ * maybe the last data payload
++ *
++ * REVISIT the framework needs updating so that when we consume
++ * all payloads (the last or only message was a command, or a
++ * zero length EEM packet) that is not accounted as an rx_error.
++ */
++ do {
++ struct sk_buff *skb2 = NULL;
++ u16 header;
++ u16 len = 0;
++
++ /* incomplete EEM header? */
++ if (skb->len < EEM_HEAD)
++ return 0;
++
++ /*
++ * EEM packet header format:
++ * b0..14: EEM type dependent (Data or Command)
++ * b15: bmType
++ */
++ header = get_unaligned_le16(skb->data);
++ skb_pull(skb, EEM_HEAD);
++
++ /*
++ * The bmType bit helps to denote when EEM
++ * packet is data or command :
++ * bmType = 0 : EEM data payload
++ * bmType = 1 : EEM (link) command
++ */
++ if (header & BIT(15)) {
++ u16 bmEEMCmd;
++
++ /*
++ * EEM (link) command packet:
++ * b0..10: bmEEMCmdParam
++ * b11..13: bmEEMCmd
++ * b14: bmReserved (must be 0)
++ * b15: 1 (EEM command)
++ */
++ if (header & BIT(14)) {
++ netdev_dbg(dev->net, "reserved command %04x\n",
++ header);
++ continue;
++ }
++
++ bmEEMCmd = (header >> 11) & 0x7;
++ switch (bmEEMCmd) {
++
++ /* Responding to echo requests is mandatory. */
++ case 0: /* Echo command */
++ len = header & 0x7FF;
++
++ /* bogus command? */
++ if (skb->len < len)
++ return 0;
++
++ skb2 = skb_clone(skb, GFP_ATOMIC);
++ if (unlikely(!skb2))
++ goto next;
++ skb_trim(skb2, len);
++ put_unaligned_le16(BIT(15) | (1 << 11) | len,
++ skb_push(skb2, 2));
++ eem_linkcmd(dev, skb2);
++ break;
++
++ /*
++ * Host may choose to ignore hints.
++ * - suspend: peripheral ready to suspend
++ * - response: suggest N millisec polling
++ * - response complete: suggest N sec polling
++ *
++ * Suspend is reported and maybe heeded.
++ */
++ case 2: /* Suspend hint */
++ usbnet_device_suggests_idle(dev);
++ continue;
++ case 3: /* Response hint */
++ case 4: /* Response complete hint */
++ continue;
++
++ /*
++ * Hosts should never receive host-to-peripheral
++ * or reserved command codes; or responses to an
++ * echo command we didn't send.
++ */
++ case 1: /* Echo response */
++ case 5: /* Tickle */
++ default: /* reserved */
++ netdev_warn(dev->net,
++ "unexpected link command %d\n",
++ bmEEMCmd);
++ continue;
++ }
++
++ } else {
++ u32 crc, crc2;
++ int is_last;
++
++ /* zero length EEM packet? */
++ if (header == 0)
++ continue;
++
++ /*
++ * EEM data packet header :
++ * b0..13: length of ethernet frame
++ * b14: bmCRC
++ * b15: 0 (EEM data)
++ */
++ len = header & 0x3FFF;
++
++ /* bogus EEM payload? */
++ if (skb->len < len)
++ return 0;
++
++ /* bogus ethernet frame? */
++ if (len < (ETH_HLEN + ETH_FCS_LEN))
++ goto next;
++
++ /*
++ * Treat the last payload differently: framework
++ * code expects our "fixup" to have stripped off
++ * headers, so "skb" is a data packet (or error).
++ * Else if it's not the last payload, keep "skb"
++ * for further processing.
++ */
++ is_last = (len == skb->len);
++ if (is_last)
++ skb2 = skb;
++ else {
++ skb2 = skb_clone(skb, GFP_ATOMIC);
++ if (unlikely(!skb2))
++ return 0;
++ }
++
++ /*
++ * The bmCRC helps to denote when the CRC field in
++ * the Ethernet frame contains a calculated CRC:
++ * bmCRC = 1 : CRC is calculated
++ * bmCRC = 0 : CRC = 0xDEADBEEF
++ */
++ if (header & BIT(14)) {
++ crc = get_unaligned_le32(skb2->data
++ + len - ETH_FCS_LEN);
++ crc2 = ~crc32_le(~0, skb2->data, skb2->len
++ - ETH_FCS_LEN);
++ } else {
++ crc = get_unaligned_be32(skb2->data
++ + len - ETH_FCS_LEN);
++ crc2 = 0xdeadbeef;
++ }
++ skb_trim(skb2, len - ETH_FCS_LEN);
++
++ if (is_last)
++ return crc == crc2;
++
++ if (unlikely(crc != crc2)) {
++ dev->net->stats.rx_errors++;
++ dev_kfree_skb_any(skb2);
++ } else
++ usbnet_skb_return(dev, skb2);
++ }
++
++next:
++ skb_pull(skb, len);
++ } while (skb->len);
++
++ return 1;
++}
++
++static const struct driver_info eem_info = {
++ .description = "CDC EEM Device",
++ .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
++ .bind = eem_bind,
++ .rx_fixup = eem_rx_fixup,
++ .tx_fixup = eem_tx_fixup,
++};
++
++/*-------------------------------------------------------------------------*/
++
++static const struct usb_device_id products[] = {
++{
++ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_EEM,
++ USB_CDC_PROTO_EEM),
++ .driver_info = (unsigned long) &eem_info,
++},
++{
++ /* EMPTY == end of list */
++},
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver eem_driver = {
++ .name = "cdc_eem",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(eem_driver);
++
++MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>");
++MODULE_DESCRIPTION("USB CDC EEM");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc-phonet.c backports-3.18.1-1/drivers/net/usb/cdc-phonet.c
+--- backports-3.18.1-1.org/drivers/net/usb/cdc-phonet.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/cdc-phonet.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,466 @@
++/*
++ * phonet.c -- USB CDC Phonet host driver
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation. All rights reserved.
++ *
++ * Author: Rémi Denis-Courmont
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA
++ */
++
++#include <linux/kernel.h>
++#include <linux/mm.h>
++#include <linux/module.h>
++#include <linux/gfp.h>
++#include <linux/usb.h>
++#include <linux/usb/cdc.h>
++#include <linux/netdevice.h>
++#include <linux/if_arp.h>
++#include <linux/if_phonet.h>
++#include <linux/phonet.h>
++
++#define PN_MEDIA_USB 0x1B
++
++static const unsigned rxq_size = 17;
++
++struct usbpn_dev {
++ struct net_device *dev;
++
++ struct usb_interface *intf, *data_intf;
++ struct usb_device *usb;
++ unsigned int tx_pipe, rx_pipe;
++ u8 active_setting;
++ u8 disconnected;
++
++ unsigned tx_queue;
++ spinlock_t tx_lock;
++
++ spinlock_t rx_lock;
++ struct sk_buff *rx_skb;
++ struct urb *urbs[0];
++};
++
++static void tx_complete(struct urb *req);
++static void rx_complete(struct urb *req);
++
++/*
++ * Network device callbacks
++ */
++static netdev_tx_t usbpn_xmit(struct sk_buff *skb, struct net_device *dev)
++{
++ struct usbpn_dev *pnd = netdev_priv(dev);
++ struct urb *req = NULL;
++ unsigned long flags;
++ int err;
++
++ if (skb->protocol != htons(ETH_P_PHONET))
++ goto drop;
++
++ req = usb_alloc_urb(0, GFP_ATOMIC);
++ if (!req)
++ goto drop;
++ usb_fill_bulk_urb(req, pnd->usb, pnd->tx_pipe, skb->data, skb->len,
++ tx_complete, skb);
++ req->transfer_flags = URB_ZERO_PACKET;
++ err = usb_submit_urb(req, GFP_ATOMIC);
++ if (err) {
++ usb_free_urb(req);
++ goto drop;
++ }
++
++ spin_lock_irqsave(&pnd->tx_lock, flags);
++ pnd->tx_queue++;
++ if (pnd->tx_queue >= dev->tx_queue_len)
++ netif_stop_queue(dev);
++ spin_unlock_irqrestore(&pnd->tx_lock, flags);
++ return NETDEV_TX_OK;
++
++drop:
++ dev_kfree_skb(skb);
++ dev->stats.tx_dropped++;
++ return NETDEV_TX_OK;
++}
++
++static void tx_complete(struct urb *req)
++{
++ struct sk_buff *skb = req->context;
++ struct net_device *dev = skb->dev;
++ struct usbpn_dev *pnd = netdev_priv(dev);
++ int status = req->status;
++
++ switch (status) {
++ case 0:
++ dev->stats.tx_bytes += skb->len;
++ break;
++
++ case -ENOENT:
++ case -ECONNRESET:
++ case -ESHUTDOWN:
++ dev->stats.tx_aborted_errors++;
++ default:
++ dev->stats.tx_errors++;
++ dev_dbg(&dev->dev, "TX error (%d)\n", status);
++ }
++ dev->stats.tx_packets++;
++
++ spin_lock(&pnd->tx_lock);
++ pnd->tx_queue--;
++ netif_wake_queue(dev);
++ spin_unlock(&pnd->tx_lock);
++
++ dev_kfree_skb_any(skb);
++ usb_free_urb(req);
++}
++
++static int rx_submit(struct usbpn_dev *pnd, struct urb *req, gfp_t gfp_flags)
++{
++ struct net_device *dev = pnd->dev;
++ struct page *page;
++ int err;
++
++ page = __skb_alloc_page(gfp_flags | __GFP_NOMEMALLOC, NULL);
++ if (!page)
++ return -ENOMEM;
++
++ usb_fill_bulk_urb(req, pnd->usb, pnd->rx_pipe, page_address(page),
++ PAGE_SIZE, rx_complete, dev);
++ req->transfer_flags = 0;
++ err = usb_submit_urb(req, gfp_flags);
++ if (unlikely(err)) {
++ dev_dbg(&dev->dev, "RX submit error (%d)\n", err);
++ put_page(page);
++ }
++ return err;
++}
++
++static void rx_complete(struct urb *req)
++{
++ struct net_device *dev = req->context;
++ struct usbpn_dev *pnd = netdev_priv(dev);
++ struct page *page = virt_to_page(req->transfer_buffer);
++ struct sk_buff *skb;
++ unsigned long flags;
++ int status = req->status;
++
++ switch (status) {
++ case 0:
++ spin_lock_irqsave(&pnd->rx_lock, flags);
++ skb = pnd->rx_skb;
++ if (!skb) {
++ skb = pnd->rx_skb = netdev_alloc_skb(dev, 12);
++ if (likely(skb)) {
++ /* Can't use pskb_pull() on page in IRQ */
++ memcpy(skb_put(skb, 1), page_address(page), 1);
++ skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
++ page, 1, req->actual_length,
++ PAGE_SIZE);
++ page = NULL;
++ }
++ } else {
++ skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
++ page, 0, req->actual_length,
++ PAGE_SIZE);
++ page = NULL;
++ }
++ if (req->actual_length < PAGE_SIZE)
++ pnd->rx_skb = NULL; /* Last fragment */
++ else
++ skb = NULL;
++ spin_unlock_irqrestore(&pnd->rx_lock, flags);
++ if (skb) {
++ skb->protocol = htons(ETH_P_PHONET);
++ skb_reset_mac_header(skb);
++ __skb_pull(skb, 1);
++ skb->dev = dev;
++ dev->stats.rx_packets++;
++ dev->stats.rx_bytes += skb->len;
++
++ netif_rx(skb);
++ }
++ goto resubmit;
++
++ case -ENOENT:
++ case -ECONNRESET:
++ case -ESHUTDOWN:
++ req = NULL;
++ break;
++
++ case -EOVERFLOW:
++ dev->stats.rx_over_errors++;
++ dev_dbg(&dev->dev, "RX overflow\n");
++ break;
++
++ case -EILSEQ:
++ dev->stats.rx_crc_errors++;
++ break;
++ }
++
++ dev->stats.rx_errors++;
++resubmit:
++ if (page)
++ put_page(page);
++ if (req)
++ rx_submit(pnd, req, GFP_ATOMIC | __GFP_COLD);
++}
++
++static int usbpn_close(struct net_device *dev);
++
++static int usbpn_open(struct net_device *dev)
++{
++ struct usbpn_dev *pnd = netdev_priv(dev);
++ int err;
++ unsigned i;
++ unsigned num = pnd->data_intf->cur_altsetting->desc.bInterfaceNumber;
++
++ err = usb_set_interface(pnd->usb, num, pnd->active_setting);
++ if (err)
++ return err;
++
++ for (i = 0; i < rxq_size; i++) {
++ struct urb *req = usb_alloc_urb(0, GFP_KERNEL);
++
++ if (!req || rx_submit(pnd, req, GFP_KERNEL | __GFP_COLD)) {
++ usb_free_urb(req);
++ usbpn_close(dev);
++ return -ENOMEM;
++ }
++ pnd->urbs[i] = req;
++ }
++
++ netif_wake_queue(dev);
++ return 0;
++}
++
++static int usbpn_close(struct net_device *dev)
++{
++ struct usbpn_dev *pnd = netdev_priv(dev);
++ unsigned i;
++ unsigned num = pnd->data_intf->cur_altsetting->desc.bInterfaceNumber;
++
++ netif_stop_queue(dev);
++
++ for (i = 0; i < rxq_size; i++) {
++ struct urb *req = pnd->urbs[i];
++
++ if (!req)
++ continue;
++ usb_kill_urb(req);
++ usb_free_urb(req);
++ pnd->urbs[i] = NULL;
++ }
++
++ return usb_set_interface(pnd->usb, num, !pnd->active_setting);
++}
++
++static int usbpn_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
++{
++ struct if_phonet_req *req = (struct if_phonet_req *)ifr;
++
++ switch (cmd) {
++ case SIOCPNGAUTOCONF:
++ req->ifr_phonet_autoconf.device = PN_DEV_PC;
++ return 0;
++ }
++ return -ENOIOCTLCMD;
++}
++
++static int usbpn_set_mtu(struct net_device *dev, int new_mtu)
++{
++ if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU))
++ return -EINVAL;
++
++ dev->mtu = new_mtu;
++ return 0;
++}
++
++static const struct net_device_ops usbpn_ops = {
++ .ndo_open = usbpn_open,
++ .ndo_stop = usbpn_close,
++ .ndo_start_xmit = usbpn_xmit,
++ .ndo_do_ioctl = usbpn_ioctl,
++ .ndo_change_mtu = usbpn_set_mtu,
++};
++
++static void usbpn_setup(struct net_device *dev)
++{
++ dev->features = 0;
++ dev->netdev_ops = &usbpn_ops,
++ dev->header_ops = &phonet_header_ops;
++ dev->type = ARPHRD_PHONET;
++ dev->flags = IFF_POINTOPOINT | IFF_NOARP;
++ dev->mtu = PHONET_MAX_MTU;
++ dev->hard_header_len = 1;
++ dev->dev_addr[0] = PN_MEDIA_USB;
++ dev->addr_len = 1;
++ dev->tx_queue_len = 3;
++
++ dev->destructor = free_netdev;
++}
++
++/*
++ * USB driver callbacks
++ */
++static struct usb_device_id usbpn_ids[] = {
++ {
++ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
++ | USB_DEVICE_ID_MATCH_INT_CLASS
++ | USB_DEVICE_ID_MATCH_INT_SUBCLASS,
++ .idVendor = 0x0421, /* Nokia */
++ .bInterfaceClass = USB_CLASS_COMM,
++ .bInterfaceSubClass = 0xFE,
++ },
++ { },
++};
++
++MODULE_DEVICE_TABLE(usb, usbpn_ids);
++
++static struct usb_driver usbpn_driver;
++
++static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
++{
++ static const char ifname[] = "usbpn%d";
++ const struct usb_cdc_union_desc *union_header = NULL;
++ const struct usb_host_interface *data_desc;
++ struct usb_interface *data_intf;
++ struct usb_device *usbdev = interface_to_usbdev(intf);
++ struct net_device *dev;
++ struct usbpn_dev *pnd;
++ u8 *data;
++ int phonet = 0;
++ int len, err;
++
++ data = intf->altsetting->extra;
++ len = intf->altsetting->extralen;
++ while (len >= 3) {
++ u8 dlen = data[0];
++ if (dlen < 3)
++ return -EINVAL;
++
++ /* bDescriptorType */
++ if (data[1] == USB_DT_CS_INTERFACE) {
++ /* bDescriptorSubType */
++ switch (data[2]) {
++ case USB_CDC_UNION_TYPE:
++ if (union_header || dlen < 5)
++ break;
++ union_header =
++ (struct usb_cdc_union_desc *)data;
++ break;
++ case 0xAB:
++ phonet = 1;
++ break;
++ }
++ }
++ data += dlen;
++ len -= dlen;
++ }
++
++ if (!union_header || !phonet)
++ return -EINVAL;
++
++ data_intf = usb_ifnum_to_if(usbdev, union_header->bSlaveInterface0);
++ if (data_intf == NULL)
++ return -ENODEV;
++ /* Data interface has one inactive and one active setting */
++ if (data_intf->num_altsetting != 2)
++ return -EINVAL;
++ if (data_intf->altsetting[0].desc.bNumEndpoints == 0 &&
++ data_intf->altsetting[1].desc.bNumEndpoints == 2)
++ data_desc = data_intf->altsetting + 1;
++ else
++ if (data_intf->altsetting[0].desc.bNumEndpoints == 2 &&
++ data_intf->altsetting[1].desc.bNumEndpoints == 0)
++ data_desc = data_intf->altsetting;
++ else
++ return -EINVAL;
++
++ dev = alloc_netdev(sizeof(*pnd) + sizeof(pnd->urbs[0]) * rxq_size,
++ ifname, NET_NAME_UNKNOWN, usbpn_setup);
++ if (!dev)
++ return -ENOMEM;
++
++ pnd = netdev_priv(dev);
++ SET_NETDEV_DEV(dev, &intf->dev);
++
++ pnd->dev = dev;
++ pnd->usb = usbdev;
++ pnd->intf = intf;
++ pnd->data_intf = data_intf;
++ spin_lock_init(&pnd->tx_lock);
++ spin_lock_init(&pnd->rx_lock);
++ /* Endpoints */
++ if (usb_pipein(data_desc->endpoint[0].desc.bEndpointAddress)) {
++ pnd->rx_pipe = usb_rcvbulkpipe(usbdev,
++ data_desc->endpoint[0].desc.bEndpointAddress);
++ pnd->tx_pipe = usb_sndbulkpipe(usbdev,
++ data_desc->endpoint[1].desc.bEndpointAddress);
++ } else {
++ pnd->rx_pipe = usb_rcvbulkpipe(usbdev,
++ data_desc->endpoint[1].desc.bEndpointAddress);
++ pnd->tx_pipe = usb_sndbulkpipe(usbdev,
++ data_desc->endpoint[0].desc.bEndpointAddress);
++ }
++ pnd->active_setting = data_desc - data_intf->altsetting;
++
++ err = usb_driver_claim_interface(&usbpn_driver, data_intf, pnd);
++ if (err)
++ goto out;
++
++ /* Force inactive mode until the network device is brought UP */
++ usb_set_interface(usbdev, union_header->bSlaveInterface0,
++ !pnd->active_setting);
++ usb_set_intfdata(intf, pnd);
++
++ err = register_netdev(dev);
++ if (err) {
++ usb_driver_release_interface(&usbpn_driver, data_intf);
++ goto out;
++ }
++
++ dev_dbg(&dev->dev, "USB CDC Phonet device found\n");
++ return 0;
++
++out:
++ usb_set_intfdata(intf, NULL);
++ free_netdev(dev);
++ return err;
++}
++
++static void usbpn_disconnect(struct usb_interface *intf)
++{
++ struct usbpn_dev *pnd = usb_get_intfdata(intf);
++
++ if (pnd->disconnected)
++ return;
++
++ pnd->disconnected = 1;
++ usb_driver_release_interface(&usbpn_driver,
++ (pnd->intf == intf) ? pnd->data_intf : pnd->intf);
++ unregister_netdev(pnd->dev);
++}
++
++static struct usb_driver usbpn_driver = {
++ .name = "cdc_phonet",
++ .probe = usbpn_probe,
++ .disconnect = usbpn_disconnect,
++ .id_table = usbpn_ids,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(usbpn_driver);
++
++MODULE_AUTHOR("Remi Denis-Courmont");
++MODULE_DESCRIPTION("USB CDC Phonet host interface");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc_subset.c backports-3.18.1-1/drivers/net/usb/cdc_subset.c
+--- backports-3.18.1-1.org/drivers/net/usb/cdc_subset.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/cdc_subset.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,369 @@
++/*
++ * Simple "CDC Subset" USB Networking Links
++ * Copyright (C) 2000-2005 by David Brownell
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/kmod.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/usb/usbnet.h>
++
++
++/*
++ * This supports simple USB network links that don't require any special
++ * framing or hardware control operations. The protocol used here is a
++ * strict subset of CDC Ethernet, with three basic differences reflecting
++ * the goal that almost any hardware should run it:
++ *
++ * - Minimal runtime control: one interface, no altsettings, and
++ * no vendor or class specific control requests. If a device is
++ * configured, it is allowed to exchange packets with the host.
++ * Fancier models would mean not working on some hardware.
++ *
++ * - Minimal manufacturing control: no IEEE "Organizationally
++ * Unique ID" required, or an EEPROMs to store one. Each host uses
++ * one random "locally assigned" Ethernet address instead, which can
++ * of course be overridden using standard tools like "ifconfig".
++ * (With 2^46 such addresses, same-net collisions are quite rare.)
++ *
++ * - There is no additional framing data for USB. Packets are written
++ * exactly as in CDC Ethernet, starting with an Ethernet header and
++ * terminated by a short packet. However, the host will never send a
++ * zero length packet; some systems can't handle those robustly.
++ *
++ * Anything that can transmit and receive USB bulk packets can implement
++ * this protocol. That includes both smart peripherals and quite a lot
++ * of "host-to-host" USB cables (which embed two devices back-to-back).
++ *
++ * Note that although Linux may use many of those host-to-host links
++ * with this "cdc_subset" framing, that doesn't mean there may not be a
++ * better approach. Handling the "other end unplugs/replugs" scenario
++ * well tends to require chip-specific vendor requests. Also, Windows
++ * peers at the other end of host-to-host cables may expect their own
++ * framing to be used rather than this "cdc_subset" model.
++ */
++
++#if defined(CONFIG_USB_EPSON2888) || defined(CONFIG_USB_ARMLINUX)
++/* PDA style devices are always connected if present */
++static int always_connected (struct usbnet *dev)
++{
++ return 0;
++}
++#endif
++
++#ifdef CONFIG_USB_ALI_M5632
++#define HAVE_HARDWARE
++
++/*-------------------------------------------------------------------------
++ *
++ * ALi M5632 driver ... does high speed
++ *
++ * NOTE that the MS-Windows drivers for this chip use some funky and
++ * (naturally) undocumented 7-byte prefix to each packet, so this is a
++ * case where we don't currently interoperate. Also, once you unplug
++ * one end of the cable, you need to replug the other end too ... since
++ * chip docs are unavailable, there's no way to reset the relevant state
++ * short of a power cycle.
++ *
++ *-------------------------------------------------------------------------*/
++
++static void m5632_recover(struct usbnet *dev)
++{
++ struct usb_device *udev = dev->udev;
++ struct usb_interface *intf = dev->intf;
++ int r;
++
++ r = usb_lock_device_for_reset(udev, intf);
++ if (r < 0)
++ return;
++
++ usb_reset_device(udev);
++ usb_unlock_device(udev);
++}
++
++static const struct driver_info ali_m5632_info = {
++ .description = "ALi M5632",
++ .flags = FLAG_POINTTOPOINT,
++ .recover = m5632_recover,
++};
++
++#endif
++
++#ifdef CONFIG_USB_AN2720
++#define HAVE_HARDWARE
++
++/*-------------------------------------------------------------------------
++ *
++ * AnchorChips 2720 driver ... http://www.cypress.com
++ *
++ * This doesn't seem to have a way to detect whether the peer is
++ * connected, or need any reset handshaking. It's got pretty big
++ * internal buffers (handles most of a frame's worth of data).
++ * Chip data sheets don't describe any vendor control messages.
++ *
++ *-------------------------------------------------------------------------*/
++
++static const struct driver_info an2720_info = {
++ .description = "AnchorChips/Cypress 2720",
++ .flags = FLAG_POINTTOPOINT,
++ // no reset available!
++ // no check_connect available!
++
++ .in = 2, .out = 2, // direction distinguishes these
++};
++
++#endif /* CONFIG_USB_AN2720 */
++
++\f
++#ifdef CONFIG_USB_BELKIN
++#define HAVE_HARDWARE
++
++/*-------------------------------------------------------------------------
++ *
++ * Belkin F5U104 ... two NetChip 2280 devices + Atmel AVR microcontroller
++ *
++ * ... also two eTEK designs, including one sold as "Advance USBNET"
++ *
++ *-------------------------------------------------------------------------*/
++
++static const struct driver_info belkin_info = {
++ .description = "Belkin, eTEK, or compatible",
++ .flags = FLAG_POINTTOPOINT,
++};
++
++#endif /* CONFIG_USB_BELKIN */
++
++
++\f
++#ifdef CONFIG_USB_EPSON2888
++#define HAVE_HARDWARE
++
++/*-------------------------------------------------------------------------
++ *
++ * EPSON USB clients
++ *
++ * This is the same idea as Linux PDAs (below) except the firmware in the
++ * device might not be Tux-powered. Epson provides reference firmware that
++ * implements this interface. Product developers can reuse or modify that
++ * code, such as by using their own product and vendor codes.
++ *
++ * Support was from Juro Bystricky <bystricky.juro@erd.epson.com>
++ *
++ *-------------------------------------------------------------------------*/
++
++static const struct driver_info epson2888_info = {
++ .description = "Epson USB Device",
++ .check_connect = always_connected,
++ .flags = FLAG_POINTTOPOINT,
++
++ .in = 4, .out = 3,
++};
++
++#endif /* CONFIG_USB_EPSON2888 */
++
++\f
++/*-------------------------------------------------------------------------
++ *
++ * info from Jonathan McDowell <noodles@earth.li>
++ *
++ *-------------------------------------------------------------------------*/
++#ifdef CONFIG_USB_KC2190
++#define HAVE_HARDWARE
++static const struct driver_info kc2190_info = {
++ .description = "KC Technology KC-190",
++ .flags = FLAG_POINTTOPOINT,
++};
++#endif /* CONFIG_USB_KC2190 */
++
++\f
++#ifdef CONFIG_USB_ARMLINUX
++#define HAVE_HARDWARE
++
++/*-------------------------------------------------------------------------
++ *
++ * Intel's SA-1100 chip integrates basic USB support, and is used
++ * in PDAs like some iPaqs, the Yopy, some Zaurus models, and more.
++ * When they run Linux, arch/arm/mach-sa1100/usb-eth.c may be used to
++ * network using minimal USB framing data.
++ *
++ * This describes the driver currently in standard ARM Linux kernels.
++ * The Zaurus uses a different driver (see later).
++ *
++ * PXA25x and PXA210 use XScale cores (ARM v5TE) with better USB support
++ * and different USB endpoint numbering than the SA1100 devices. The
++ * mach-pxa/usb-eth.c driver re-uses the device ids from mach-sa1100
++ * so we rely on the endpoint descriptors.
++ *
++ *-------------------------------------------------------------------------*/
++
++static const struct driver_info linuxdev_info = {
++ .description = "Linux Device",
++ .check_connect = always_connected,
++ .flags = FLAG_POINTTOPOINT,
++};
++
++static const struct driver_info yopy_info = {
++ .description = "Yopy",
++ .check_connect = always_connected,
++ .flags = FLAG_POINTTOPOINT,
++};
++
++static const struct driver_info blob_info = {
++ .description = "Boot Loader OBject",
++ .check_connect = always_connected,
++ .flags = FLAG_POINTTOPOINT,
++};
++
++#endif /* CONFIG_USB_ARMLINUX */
++
++\f
++/*-------------------------------------------------------------------------*/
++
++#ifndef HAVE_HARDWARE
++#warning You need to configure some hardware for this driver
++#endif
++
++/*
++ * chip vendor names won't normally be on the cables, and
++ * may not be on the device.
++ */
++
++static const struct usb_device_id products [] = {
++
++#ifdef CONFIG_USB_ALI_M5632
++{
++ USB_DEVICE (0x0402, 0x5632), // ALi defaults
++ .driver_info = (unsigned long) &ali_m5632_info,
++},
++{
++ USB_DEVICE (0x182d,0x207c), // SiteCom CN-124
++ .driver_info = (unsigned long) &ali_m5632_info,
++},
++#endif
++
++#ifdef CONFIG_USB_AN2720
++{
++ USB_DEVICE (0x0547, 0x2720), // AnchorChips defaults
++ .driver_info = (unsigned long) &an2720_info,
++}, {
++ USB_DEVICE (0x0547, 0x2727), // Xircom PGUNET
++ .driver_info = (unsigned long) &an2720_info,
++},
++#endif
++
++#ifdef CONFIG_USB_BELKIN
++{
++ USB_DEVICE (0x050d, 0x0004), // Belkin
++ .driver_info = (unsigned long) &belkin_info,
++}, {
++ USB_DEVICE (0x056c, 0x8100), // eTEK
++ .driver_info = (unsigned long) &belkin_info,
++}, {
++ USB_DEVICE (0x0525, 0x9901), // Advance USBNET (eTEK)
++ .driver_info = (unsigned long) &belkin_info,
++},
++#endif
++
++#ifdef CONFIG_USB_EPSON2888
++{
++ USB_DEVICE (0x0525, 0x2888), // EPSON USB client
++ .driver_info = (unsigned long) &epson2888_info,
++},
++#endif
++
++#ifdef CONFIG_USB_KC2190
++{
++ USB_DEVICE (0x050f, 0x0190), // KC-190
++ .driver_info = (unsigned long) &kc2190_info,
++},
++#endif
++
++#ifdef CONFIG_USB_ARMLINUX
++/*
++ * SA-1100 using standard ARM Linux kernels, or compatible.
++ * Often used when talking to Linux PDAs (iPaq, Yopy, etc).
++ * The sa-1100 "usb-eth" driver handles the basic framing.
++ *
++ * PXA25x or PXA210 ... these use a "usb-eth" driver much like
++ * the sa1100 one, but hardware uses different endpoint numbers.
++ *
++ * Or the Linux "Ethernet" gadget on hardware that can't talk
++ * CDC Ethernet (e.g., no altsettings), in either of two modes:
++ * - acting just like the old "usb-eth" firmware, though
++ * the implementation is different
++ * - supporting RNDIS as the first/default configuration for
++ * MS-Windows interop; Linux needs to use the other config
++ */
++{
++ // 1183 = 0x049F, both used as hex values?
++ // Compaq "Itsy" vendor/product id
++ USB_DEVICE (0x049F, 0x505A), // usb-eth, or compatible
++ .driver_info = (unsigned long) &linuxdev_info,
++}, {
++ USB_DEVICE (0x0E7E, 0x1001), // G.Mate "Yopy"
++ .driver_info = (unsigned long) &yopy_info,
++}, {
++ USB_DEVICE (0x8086, 0x07d3), // "blob" bootloader
++ .driver_info = (unsigned long) &blob_info,
++}, {
++ USB_DEVICE (0x1286, 0x8001), // "blob" bootloader
++ .driver_info = (unsigned long) &blob_info,
++}, {
++ // Linux Ethernet/RNDIS gadget, mostly on PXA, second config
++ // e.g. Gumstix, current OpenZaurus, ... or anything else
++ // that just enables this gadget option.
++ USB_DEVICE (0x0525, 0xa4a2),
++ .driver_info = (unsigned long) &linuxdev_info,
++},
++#endif
++
++ { }, // END
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++/*-------------------------------------------------------------------------*/
++static int dummy_prereset(struct usb_interface *intf)
++{
++ return 0;
++}
++
++static int dummy_postreset(struct usb_interface *intf)
++{
++ return 0;
++}
++
++static struct usb_driver cdc_subset_driver = {
++ .name = "cdc_subset",
++ .probe = usbnet_probe,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .pre_reset = dummy_prereset,
++ .post_reset = dummy_postreset,
++ .disconnect = usbnet_disconnect,
++ .id_table = products,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(cdc_subset_driver);
++
++MODULE_AUTHOR("David Brownell");
++MODULE_DESCRIPTION("Simple 'CDC Subset' USB networking links");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1-1/drivers/net/usb/cx82310_eth.c
+--- backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/cx82310_eth.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,326 @@
++/*
++ * Driver for USB ethernet port of Conexant CX82310-based ADSL routers
++ * Copyright (C) 2010 by Ondrej Zary
++ * some parts inspired by the cxacru driver
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/usb/usbnet.h>
++
++enum cx82310_cmd {
++ CMD_START = 0x84, /* no effect? */
++ CMD_STOP = 0x85, /* no effect? */
++ CMD_GET_STATUS = 0x90, /* returns nothing? */
++ CMD_GET_MAC_ADDR = 0x91, /* read MAC address */
++ CMD_GET_LINK_STATUS = 0x92, /* not useful, link is always up */
++ CMD_ETHERNET_MODE = 0x99, /* unknown, needed during init */
++};
++
++enum cx82310_status {
++ STATUS_UNDEFINED,
++ STATUS_SUCCESS,
++ STATUS_ERROR,
++ STATUS_UNSUPPORTED,
++ STATUS_UNIMPLEMENTED,
++ STATUS_PARAMETER_ERROR,
++ STATUS_DBG_LOOPBACK,
++};
++
++#define CMD_PACKET_SIZE 64
++/* first command after power on can take around 8 seconds */
++#define CMD_TIMEOUT 15000
++#define CMD_REPLY_RETRY 5
++
++#define CX82310_MTU 1514
++#define CMD_EP 0x01
++
++/*
++ * execute control command
++ * - optionally send some data (command parameters)
++ * - optionally wait for the reply
++ * - optionally read some data from the reply
++ */
++static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply,
++ u8 *wdata, int wlen, u8 *rdata, int rlen)
++{
++ int actual_len, retries, ret;
++ struct usb_device *udev = dev->udev;
++ u8 *buf = kzalloc(CMD_PACKET_SIZE, GFP_KERNEL);
++
++ if (!buf)
++ return -ENOMEM;
++
++ /* create command packet */
++ buf[0] = cmd;
++ if (wdata)
++ memcpy(buf + 4, wdata, min_t(int, wlen, CMD_PACKET_SIZE - 4));
++
++ /* send command packet */
++ ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, CMD_EP), buf,
++ CMD_PACKET_SIZE, &actual_len, CMD_TIMEOUT);
++ if (ret < 0) {
++ dev_err(&dev->udev->dev, "send command %#x: error %d\n",
++ cmd, ret);
++ goto end;
++ }
++
++ if (reply) {
++ /* wait for reply, retry if it's empty */
++ for (retries = 0; retries < CMD_REPLY_RETRY; retries++) {
++ ret = usb_bulk_msg(udev, usb_rcvbulkpipe(udev, CMD_EP),
++ buf, CMD_PACKET_SIZE, &actual_len,
++ CMD_TIMEOUT);
++ if (ret < 0) {
++ dev_err(&dev->udev->dev,
++ "reply receive error %d\n", ret);
++ goto end;
++ }
++ if (actual_len > 0)
++ break;
++ }
++ if (actual_len == 0) {
++ dev_err(&dev->udev->dev, "no reply to command %#x\n",
++ cmd);
++ ret = -EIO;
++ goto end;
++ }
++ if (buf[0] != cmd) {
++ dev_err(&dev->udev->dev,
++ "got reply to command %#x, expected: %#x\n",
++ buf[0], cmd);
++ ret = -EIO;
++ goto end;
++ }
++ if (buf[1] != STATUS_SUCCESS) {
++ dev_err(&dev->udev->dev, "command %#x failed: %#x\n",
++ cmd, buf[1]);
++ ret = -EIO;
++ goto end;
++ }
++ if (rdata)
++ memcpy(rdata, buf + 4,
++ min_t(int, rlen, CMD_PACKET_SIZE - 4));
++ }
++end:
++ kfree(buf);
++ return ret;
++}
++
++#define partial_len data[0] /* length of partial packet data */
++#define partial_rem data[1] /* remaining (missing) data length */
++#define partial_data data[2] /* partial packet data */
++
++static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int ret;
++ char buf[15];
++ struct usb_device *udev = dev->udev;
++
++ /* avoid ADSL modems - continue only if iProduct is "USB NET CARD" */
++ if (usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) > 0
++ && strcmp(buf, "USB NET CARD")) {
++ dev_info(&udev->dev, "ignoring: probably an ADSL modem\n");
++ return -ENODEV;
++ }
++
++ ret = usbnet_get_endpoints(dev, intf);
++ if (ret)
++ return ret;
++
++ /*
++ * this must not include ethernet header as the device can send partial
++ * packets with no header (and sometimes even empty URBs)
++ */
++ dev->net->hard_header_len = 0;
++ /* we can send at most 1514 bytes of data (+ 2-byte header) per URB */
++ dev->hard_mtu = CX82310_MTU + 2;
++ /* we can receive URBs up to 4KB from the device */
++ dev->rx_urb_size = 4096;
++
++ dev->partial_data = (unsigned long) kmalloc(dev->hard_mtu, GFP_KERNEL);
++ if (!dev->partial_data)
++ return -ENOMEM;
++
++ /* enable ethernet mode (?) */
++ ret = cx82310_cmd(dev, CMD_ETHERNET_MODE, true, "\x01", 1, NULL, 0);
++ if (ret) {
++ dev_err(&udev->dev, "unable to enable ethernet mode: %d\n",
++ ret);
++ goto err;
++ }
++
++ /* get the MAC address */
++ ret = cx82310_cmd(dev, CMD_GET_MAC_ADDR, true, NULL, 0,
++ dev->net->dev_addr, ETH_ALEN);
++ if (ret) {
++ dev_err(&udev->dev, "unable to read MAC address: %d\n", ret);
++ goto err;
++ }
++
++ /* start (does not seem to have any effect?) */
++ ret = cx82310_cmd(dev, CMD_START, false, NULL, 0, NULL, 0);
++ if (ret)
++ goto err;
++
++ return 0;
++err:
++ kfree((void *)dev->partial_data);
++ return ret;
++}
++
++static void cx82310_unbind(struct usbnet *dev, struct usb_interface *intf)
++{
++ kfree((void *)dev->partial_data);
++}
++
++/*
++ * RX is NOT easy - we can receive multiple packets per skb, each having 2-byte
++ * packet length at the beginning.
++ * The last packet might be incomplete (when it crosses the 4KB URB size),
++ * continuing in the next skb (without any headers).
++ * If a packet has odd length, there is one extra byte at the end (before next
++ * packet or at the end of the URB).
++ */
++static int cx82310_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ int len;
++ struct sk_buff *skb2;
++
++ /*
++ * If the last skb ended with an incomplete packet, this skb contains
++ * end of that packet at the beginning.
++ */
++ if (dev->partial_rem) {
++ len = dev->partial_len + dev->partial_rem;
++ skb2 = alloc_skb(len, GFP_ATOMIC);
++ if (!skb2)
++ return 0;
++ skb_put(skb2, len);
++ memcpy(skb2->data, (void *)dev->partial_data,
++ dev->partial_len);
++ memcpy(skb2->data + dev->partial_len, skb->data,
++ dev->partial_rem);
++ usbnet_skb_return(dev, skb2);
++ skb_pull(skb, (dev->partial_rem + 1) & ~1);
++ dev->partial_rem = 0;
++ if (skb->len < 2)
++ return 1;
++ }
++
++ /* a skb can contain multiple packets */
++ while (skb->len > 1) {
++ /* first two bytes are packet length */
++ len = skb->data[0] | (skb->data[1] << 8);
++ skb_pull(skb, 2);
++
++ /* if last packet in the skb, let usbnet to process it */
++ if (len == skb->len || len + 1 == skb->len) {
++ skb_trim(skb, len);
++ break;
++ }
++
++ if (len > CX82310_MTU) {
++ dev_err(&dev->udev->dev, "RX packet too long: %d B\n",
++ len);
++ return 0;
++ }
++
++ /* incomplete packet, save it for the next skb */
++ if (len > skb->len) {
++ dev->partial_len = skb->len;
++ dev->partial_rem = len - skb->len;
++ memcpy((void *)dev->partial_data, skb->data,
++ dev->partial_len);
++ skb_pull(skb, skb->len);
++ break;
++ }
++
++ skb2 = alloc_skb(len, GFP_ATOMIC);
++ if (!skb2)
++ return 0;
++ skb_put(skb2, len);
++ memcpy(skb2->data, skb->data, len);
++ /* process the packet */
++ usbnet_skb_return(dev, skb2);
++
++ skb_pull(skb, (len + 1) & ~1);
++ }
++
++ /* let usbnet process the last packet */
++ return 1;
++}
++
++/* TX is easy, just add 2 bytes of length at the beginning */
++static struct sk_buff *cx82310_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
++ gfp_t flags)
++{
++ int len = skb->len;
++
++ if (skb_headroom(skb) < 2) {
++ struct sk_buff *skb2 = skb_copy_expand(skb, 2, 0, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (!skb)
++ return NULL;
++ }
++ skb_push(skb, 2);
++
++ skb->data[0] = len;
++ skb->data[1] = len >> 8;
++
++ return skb;
++}
++
++
++static const struct driver_info cx82310_info = {
++ .description = "Conexant CX82310 USB ethernet",
++ .flags = FLAG_ETHER,
++ .bind = cx82310_bind,
++ .unbind = cx82310_unbind,
++ .rx_fixup = cx82310_rx_fixup,
++ .tx_fixup = cx82310_tx_fixup,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ USB_DEVICE_AND_INTERFACE_INFO(0x0572, 0xcb01, 0xff, 0, 0),
++ .driver_info = (unsigned long) &cx82310_info
++ },
++ { },
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver cx82310_driver = {
++ .name = "cx82310_eth",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(cx82310_driver);
++
++MODULE_AUTHOR("Ondrej Zary");
++MODULE_DESCRIPTION("Conexant CX82310-based ADSL router USB ethernet driver");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/dm9601.c backports-3.18.1-1/drivers/net/usb/dm9601.c
+--- backports-3.18.1-1.org/drivers/net/usb/dm9601.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/dm9601.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,647 @@
++/*
++ * Davicom DM96xx USB 10/100Mbps ethernet devices
++ *
++ * Peter Korsgaard <jacmet@sunsite.dk>
++ *
++ * This file is licensed under the terms of the GNU General Public License
++ * version 2. This program is licensed "as is" without any warranty of any
++ * kind, whether express or implied.
++ */
++
++//#define DEBUG
++
++#include <linux/module.h>
++#include <linux/sched.h>
++#include <linux/stddef.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/crc32.h>
++#include <linux/usb/usbnet.h>
++#include <linux/slab.h>
++
++/* datasheet:
++ http://ptm2.cc.utu.fi/ftp/network/cards/DM9601/From_NET/DM9601-DS-P01-930914.pdf
++*/
++
++/* control requests */
++#define DM_READ_REGS 0x00
++#define DM_WRITE_REGS 0x01
++#define DM_READ_MEMS 0x02
++#define DM_WRITE_REG 0x03
++#define DM_WRITE_MEMS 0x05
++#define DM_WRITE_MEM 0x07
++
++/* registers */
++#define DM_NET_CTRL 0x00
++#define DM_RX_CTRL 0x05
++#define DM_SHARED_CTRL 0x0b
++#define DM_SHARED_ADDR 0x0c
++#define DM_SHARED_DATA 0x0d /* low + high */
++#define DM_PHY_ADDR 0x10 /* 6 bytes */
++#define DM_MCAST_ADDR 0x16 /* 8 bytes */
++#define DM_GPR_CTRL 0x1e
++#define DM_GPR_DATA 0x1f
++#define DM_CHIP_ID 0x2c
++#define DM_MODE_CTRL 0x91 /* only on dm9620 */
++
++/* chip id values */
++#define ID_DM9601 0
++#define ID_DM9620 1
++
++#define DM_MAX_MCAST 64
++#define DM_MCAST_SIZE 8
++#define DM_EEPROM_LEN 256
++#define DM_TX_OVERHEAD 2 /* 2 byte header */
++#define DM_RX_OVERHEAD 7 /* 3 byte header + 4 byte crc tail */
++#define DM_TIMEOUT 1000
++
++static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data)
++{
++ int err;
++ err = usbnet_read_cmd(dev, DM_READ_REGS,
++ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ 0, reg, data, length);
++ if(err != length && err >= 0)
++ err = -EINVAL;
++ return err;
++}
++
++static int dm_read_reg(struct usbnet *dev, u8 reg, u8 *value)
++{
++ return dm_read(dev, reg, 1, value);
++}
++
++static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)
++{
++ int err;
++ err = usbnet_write_cmd(dev, DM_WRITE_REGS,
++ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ 0, reg, data, length);
++
++ if (err >= 0 && err < length)
++ err = -EINVAL;
++ return err;
++}
++
++static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value)
++{
++ return usbnet_write_cmd(dev, DM_WRITE_REG,
++ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ value, reg, NULL, 0);
++}
++
++static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
++{
++ usbnet_write_cmd_async(dev, DM_WRITE_REGS,
++ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ 0, reg, data, length);
++}
++
++static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
++{
++ usbnet_write_cmd_async(dev, DM_WRITE_REG,
++ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ value, reg, NULL, 0);
++}
++
++static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *value)
++{
++ int ret, i;
++
++ mutex_lock(&dev->phy_mutex);
++
++ dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg);
++ dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0xc : 0x4);
++
++ for (i = 0; i < DM_TIMEOUT; i++) {
++ u8 tmp = 0;
++
++ udelay(1);
++ ret = dm_read_reg(dev, DM_SHARED_CTRL, &tmp);
++ if (ret < 0)
++ goto out;
++
++ /* ready */
++ if ((tmp & 1) == 0)
++ break;
++ }
++
++ if (i == DM_TIMEOUT) {
++ netdev_err(dev->net, "%s read timed out!\n", phy ? "phy" : "eeprom");
++ ret = -EIO;
++ goto out;
++ }
++
++ dm_write_reg(dev, DM_SHARED_CTRL, 0x0);
++ ret = dm_read(dev, DM_SHARED_DATA, 2, value);
++
++ netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n",
++ phy, reg, *value, ret);
++
++ out:
++ mutex_unlock(&dev->phy_mutex);
++ return ret;
++}
++
++static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 value)
++{
++ int ret, i;
++
++ mutex_lock(&dev->phy_mutex);
++
++ ret = dm_write(dev, DM_SHARED_DATA, 2, &value);
++ if (ret < 0)
++ goto out;
++
++ dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg);
++ dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1a : 0x12);
++
++ for (i = 0; i < DM_TIMEOUT; i++) {
++ u8 tmp = 0;
++
++ udelay(1);
++ ret = dm_read_reg(dev, DM_SHARED_CTRL, &tmp);
++ if (ret < 0)
++ goto out;
++
++ /* ready */
++ if ((tmp & 1) == 0)
++ break;
++ }
++
++ if (i == DM_TIMEOUT) {
++ netdev_err(dev->net, "%s write timed out!\n", phy ? "phy" : "eeprom");
++ ret = -EIO;
++ goto out;
++ }
++
++ dm_write_reg(dev, DM_SHARED_CTRL, 0x0);
++
++out:
++ mutex_unlock(&dev->phy_mutex);
++ return ret;
++}
++
++static int dm_read_eeprom_word(struct usbnet *dev, u8 offset, void *value)
++{
++ return dm_read_shared_word(dev, 0, offset, value);
++}
++
++
++
++static int dm9601_get_eeprom_len(struct net_device *dev)
++{
++ return DM_EEPROM_LEN;
++}
++
++static int dm9601_get_eeprom(struct net_device *net,
++ struct ethtool_eeprom *eeprom, u8 * data)
++{
++ struct usbnet *dev = netdev_priv(net);
++ __le16 *ebuf = (__le16 *) data;
++ int i;
++
++ /* access is 16bit */
++ if ((eeprom->offset % 2) || (eeprom->len % 2))
++ return -EINVAL;
++
++ for (i = 0; i < eeprom->len / 2; i++) {
++ if (dm_read_eeprom_word(dev, eeprom->offset / 2 + i,
++ &ebuf[i]) < 0)
++ return -EINVAL;
++ }
++ return 0;
++}
++
++static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++
++ __le16 res;
++
++ if (phy_id) {
++ netdev_dbg(dev->net, "Only internal phy supported\n");
++ return 0;
++ }
++
++ dm_read_shared_word(dev, 1, loc, &res);
++
++ netdev_dbg(dev->net,
++ "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",
++ phy_id, loc, le16_to_cpu(res));
++
++ return le16_to_cpu(res);
++}
++
++static void dm9601_mdio_write(struct net_device *netdev, int phy_id, int loc,
++ int val)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ __le16 res = cpu_to_le16(val);
++
++ if (phy_id) {
++ netdev_dbg(dev->net, "Only internal phy supported\n");
++ return;
++ }
++
++ netdev_dbg(dev->net, "dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n",
++ phy_id, loc, val);
++
++ dm_write_shared_word(dev, 1, loc, res);
++}
++
++static void dm9601_get_drvinfo(struct net_device *net,
++ struct ethtool_drvinfo *info)
++{
++ /* Inherit standard device info */
++ usbnet_get_drvinfo(net, info);
++ info->eedump_len = DM_EEPROM_LEN;
++}
++
++static u32 dm9601_get_link(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ return mii_link_ok(&dev->mii);
++}
++
++static int dm9601_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
++}
++
++static const struct ethtool_ops dm9601_ethtool_ops = {
++ .get_drvinfo = dm9601_get_drvinfo,
++ .get_link = dm9601_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_eeprom_len = dm9601_get_eeprom_len,
++ .get_eeprom = dm9601_get_eeprom,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .nway_reset = usbnet_nway_reset,
++};
++
++static void dm9601_set_multicast(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++ /* We use the 20 byte dev->data for our 8 byte filter buffer
++ * to avoid allocating memory that is tricky to free later */
++ u8 *hashes = (u8 *) & dev->data;
++ u8 rx_ctl = 0x31;
++
++ memset(hashes, 0x00, DM_MCAST_SIZE);
++ hashes[DM_MCAST_SIZE - 1] |= 0x80; /* broadcast address */
++
++ if (net->flags & IFF_PROMISC) {
++ rx_ctl |= 0x02;
++ } else if (net->flags & IFF_ALLMULTI ||
++ netdev_mc_count(net) > DM_MAX_MCAST) {
++ rx_ctl |= 0x08;
++ } else if (!netdev_mc_empty(net)) {
++ struct netdev_hw_addr *ha;
++
++ netdev_for_each_mc_addr(ha, net) {
++ u32 crc = ether_crc(ETH_ALEN, ha->addr) >> 26;
++ hashes[crc >> 3] |= 1 << (crc & 0x7);
++ }
++ }
++
++ dm_write_async(dev, DM_MCAST_ADDR, DM_MCAST_SIZE, hashes);
++ dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl);
++}
++
++static void __dm9601_set_mac_address(struct usbnet *dev)
++{
++ dm_write_async(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr);
++}
++
++static int dm9601_set_mac_address(struct net_device *net, void *p)
++{
++ struct sockaddr *addr = p;
++ struct usbnet *dev = netdev_priv(net);
++
++ if (!is_valid_ether_addr(addr->sa_data)) {
++ dev_err(&net->dev, "not setting invalid mac address %pM\n",
++ addr->sa_data);
++ return -EINVAL;
++ }
++
++ memcpy(net->dev_addr, addr->sa_data, net->addr_len);
++ __dm9601_set_mac_address(dev);
++
++ return 0;
++}
++
++static const struct net_device_ops dm9601_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = dm9601_ioctl,
++ .ndo_set_rx_mode = dm9601_set_multicast,
++ .ndo_set_mac_address = dm9601_set_mac_address,
++};
++
++static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int ret;
++ u8 mac[ETH_ALEN], id;
++
++ ret = usbnet_get_endpoints(dev, intf);
++ if (ret)
++ goto out;
++
++ dev->net->netdev_ops = &dm9601_netdev_ops;
++ dev->net->ethtool_ops = &dm9601_ethtool_ops;
++ dev->net->hard_header_len += DM_TX_OVERHEAD;
++ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
++
++ /* dm9620/21a require room for 4 byte padding, even in dm9601
++ * mode, so we need +1 to be able to receive full size
++ * ethernet frames.
++ */
++ dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD + 1;
++
++ dev->mii.dev = dev->net;
++ dev->mii.mdio_read = dm9601_mdio_read;
++ dev->mii.mdio_write = dm9601_mdio_write;
++ dev->mii.phy_id_mask = 0x1f;
++ dev->mii.reg_num_mask = 0x1f;
++
++ /* reset */
++ dm_write_reg(dev, DM_NET_CTRL, 1);
++ udelay(20);
++
++ /* read MAC */
++ if (dm_read(dev, DM_PHY_ADDR, ETH_ALEN, mac) < 0) {
++ printk(KERN_ERR "Error reading MAC address\n");
++ ret = -ENODEV;
++ goto out;
++ }
++
++ /*
++ * Overwrite the auto-generated address only with good ones.
++ */
++ if (is_valid_ether_addr(mac))
++ memcpy(dev->net->dev_addr, mac, ETH_ALEN);
++ else {
++ printk(KERN_WARNING
++ "dm9601: No valid MAC address in EEPROM, using %pM\n",
++ dev->net->dev_addr);
++ __dm9601_set_mac_address(dev);
++ }
++
++ if (dm_read_reg(dev, DM_CHIP_ID, &id) < 0) {
++ netdev_err(dev->net, "Error reading chip ID\n");
++ ret = -ENODEV;
++ goto out;
++ }
++
++ /* put dm9620 devices in dm9601 mode */
++ if (id == ID_DM9620) {
++ u8 mode;
++
++ if (dm_read_reg(dev, DM_MODE_CTRL, &mode) < 0) {
++ netdev_err(dev->net, "Error reading MODE_CTRL\n");
++ ret = -ENODEV;
++ goto out;
++ }
++ dm_write_reg(dev, DM_MODE_CTRL, mode & 0x7f);
++ }
++
++ /* power up phy */
++ dm_write_reg(dev, DM_GPR_CTRL, 1);
++ dm_write_reg(dev, DM_GPR_DATA, 0);
++
++ /* receive broadcast packets */
++ dm9601_set_multicast(dev->net);
++
++ dm9601_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
++ dm9601_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
++ ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
++ mii_nway_restart(&dev->mii);
++
++out:
++ return ret;
++}
++
++static int dm9601_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ u8 status;
++ int len;
++
++ /* format:
++ b1: rx status
++ b2: packet length (incl crc) low
++ b3: packet length (incl crc) high
++ b4..n-4: packet data
++ bn-3..bn: ethernet crc
++ */
++
++ if (unlikely(skb->len < DM_RX_OVERHEAD)) {
++ dev_err(&dev->udev->dev, "unexpected tiny rx frame\n");
++ return 0;
++ }
++
++ status = skb->data[0];
++ len = (skb->data[1] | (skb->data[2] << 8)) - 4;
++
++ if (unlikely(status & 0xbf)) {
++ if (status & 0x01) dev->net->stats.rx_fifo_errors++;
++ if (status & 0x02) dev->net->stats.rx_crc_errors++;
++ if (status & 0x04) dev->net->stats.rx_frame_errors++;
++ if (status & 0x20) dev->net->stats.rx_missed_errors++;
++ if (status & 0x90) dev->net->stats.rx_length_errors++;
++ return 0;
++ }
++
++ skb_pull(skb, 3);
++ skb_trim(skb, len);
++
++ return 1;
++}
++
++static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
++ gfp_t flags)
++{
++ int len, pad;
++
++ /* format:
++ b1: packet length low
++ b2: packet length high
++ b3..n: packet data
++ */
++
++ len = skb->len + DM_TX_OVERHEAD;
++
++ /* workaround for dm962x errata with tx fifo getting out of
++ * sync if a USB bulk transfer retry happens right after a
++ * packet with odd / maxpacket length by adding up to 3 bytes
++ * padding.
++ */
++ while ((len & 1) || !(len % dev->maxpacket))
++ len++;
++
++ len -= DM_TX_OVERHEAD; /* hw header doesn't count as part of length */
++ pad = len - skb->len;
++
++ if (skb_headroom(skb) < DM_TX_OVERHEAD || skb_tailroom(skb) < pad) {
++ struct sk_buff *skb2;
++
++ skb2 = skb_copy_expand(skb, DM_TX_OVERHEAD, pad, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (!skb)
++ return NULL;
++ }
++
++ __skb_push(skb, DM_TX_OVERHEAD);
++
++ if (pad) {
++ memset(skb->data + skb->len, 0, pad);
++ __skb_put(skb, pad);
++ }
++
++ skb->data[0] = len;
++ skb->data[1] = len >> 8;
++
++ return skb;
++}
++
++static void dm9601_status(struct usbnet *dev, struct urb *urb)
++{
++ int link;
++ u8 *buf;
++
++ /* format:
++ b0: net status
++ b1: tx status 1
++ b2: tx status 2
++ b3: rx status
++ b4: rx overflow
++ b5: rx count
++ b6: tx count
++ b7: gpr
++ */
++
++ if (urb->actual_length < 8)
++ return;
++
++ buf = urb->transfer_buffer;
++
++ link = !!(buf[0] & 0x40);
++ if (netif_carrier_ok(dev->net) != link) {
++ usbnet_link_change(dev, link, 1);
++ netdev_dbg(dev->net, "Link Status is: %d\n", link);
++ }
++}
++
++static int dm9601_link_reset(struct usbnet *dev)
++{
++ struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
++
++ mii_check_media(&dev->mii, 1, 1);
++ mii_ethtool_gset(&dev->mii, &ecmd);
++
++ netdev_dbg(dev->net, "link_reset() speed: %u duplex: %d\n",
++ ethtool_cmd_speed(&ecmd), ecmd.duplex);
++
++ return 0;
++}
++
++static const struct driver_info dm9601_info = {
++ .description = "Davicom DM96xx USB 10/100 Ethernet",
++ .flags = FLAG_ETHER | FLAG_LINK_INTR,
++ .bind = dm9601_bind,
++ .rx_fixup = dm9601_rx_fixup,
++ .tx_fixup = dm9601_tx_fixup,
++ .status = dm9601_status,
++ .link_reset = dm9601_link_reset,
++ .reset = dm9601_link_reset,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ USB_DEVICE(0x07aa, 0x9601), /* Corega FEther USB-TXC */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x6688), /* ZT6688 USB NIC */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x0268), /* ShanTou ST268 USB NIC */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x8515), /* ADMtek ADM8515 USB NIC */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0fe6, 0x9700), /* DM9601 USB to Fast Ethernet Adapter */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x9000), /* DM9000E */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x9620), /* DM9620 USB to Fast Ethernet Adapter */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x9621), /* DM9621A USB to Fast Ethernet Adapter */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x9622), /* DM9622 USB to Fast Ethernet Adapter */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x0269), /* DM962OA USB to Fast Ethernet Adapter */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {
++ USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */
++ .driver_info = (unsigned long)&dm9601_info,
++ },
++ {}, // END
++};
++
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver dm9601_driver = {
++ .name = "dm9601",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(dm9601_driver);
++
++MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
++MODULE_DESCRIPTION("Davicom DM96xx USB 10/100 ethernet devices");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/gl620a.c backports-3.18.1-1/drivers/net/usb/gl620a.c
+--- backports-3.18.1-1.org/drivers/net/usb/gl620a.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/gl620a.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,242 @@
++/*
++ * GeneSys GL620USB-A based links
++ * Copyright (C) 2001 by Jiun-Jie Huang <huangjj@genesyslogic.com.tw>
++ * Copyright (C) 2001 by Stanislav Brabec <utx@penguin.cz>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++// #define DEBUG // error path messages, extra info
++// #define VERBOSE // more; success messages
++
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/usb/usbnet.h>
++#include <linux/gfp.h>
++
++
++/*
++ * GeneSys GL620USB-A (www.genesyslogic.com.tw)
++ *
++ * ... should partially interop with the Win32 driver for this hardware.
++ * The GeneSys docs imply there's some NDIS issue motivating this framing.
++ *
++ * Some info from GeneSys:
++ * - GL620USB-A is full duplex; GL620USB is only half duplex for bulk.
++ * (Some cables, like the BAFO-100c, use the half duplex version.)
++ * - For the full duplex model, the low bit of the version code says
++ * which side is which ("left/right").
++ * - For the half duplex type, a control/interrupt handshake settles
++ * the transfer direction. (That's disabled here, partially coded.)
++ * A control URB would block until other side writes an interrupt.
++ *
++ * Original code from Jiun-Jie Huang <huangjj@genesyslogic.com.tw>
++ * and merged into "usbnet" by Stanislav Brabec <utx@penguin.cz>.
++ */
++
++// control msg write command
++#define GENELINK_CONNECT_WRITE 0xF0
++// interrupt pipe index
++#define GENELINK_INTERRUPT_PIPE 0x03
++// interrupt read buffer size
++#define INTERRUPT_BUFSIZE 0x08
++// interrupt pipe interval value
++#define GENELINK_INTERRUPT_INTERVAL 0x10
++// max transmit packet number per transmit
++#define GL_MAX_TRANSMIT_PACKETS 32
++// max packet length
++#define GL_MAX_PACKET_LEN 1514
++// max receive buffer size
++#define GL_RCV_BUF_SIZE \
++ (((GL_MAX_PACKET_LEN + 4) * GL_MAX_TRANSMIT_PACKETS) + 4)
++
++struct gl_packet {
++ __le32 packet_length;
++ char packet_data [1];
++};
++
++struct gl_header {
++ __le32 packet_count;
++ struct gl_packet packets;
++};
++
++static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ struct gl_header *header;
++ struct gl_packet *packet;
++ struct sk_buff *gl_skb;
++ u32 size;
++ u32 count;
++
++ /* This check is no longer done by usbnet */
++ if (skb->len < dev->net->hard_header_len)
++ return 0;
++
++ header = (struct gl_header *) skb->data;
++
++ // get the packet count of the received skb
++ count = le32_to_cpu(header->packet_count);
++ if (count > GL_MAX_TRANSMIT_PACKETS) {
++ netdev_dbg(dev->net,
++ "genelink: invalid received packet count %u\n",
++ count);
++ return 0;
++ }
++
++ // set the current packet pointer to the first packet
++ packet = &header->packets;
++
++ // decrement the length for the packet count size 4 bytes
++ skb_pull(skb, 4);
++
++ while (count > 1) {
++ // get the packet length
++ size = le32_to_cpu(packet->packet_length);
++
++ // this may be a broken packet
++ if (size > GL_MAX_PACKET_LEN) {
++ netdev_dbg(dev->net, "genelink: invalid rx length %d\n",
++ size);
++ return 0;
++ }
++
++ // allocate the skb for the individual packet
++ gl_skb = alloc_skb(size, GFP_ATOMIC);
++ if (gl_skb) {
++
++ // copy the packet data to the new skb
++ memcpy(skb_put(gl_skb, size),
++ packet->packet_data, size);
++ usbnet_skb_return(dev, gl_skb);
++ }
++
++ // advance to the next packet
++ packet = (struct gl_packet *)&packet->packet_data[size];
++ count--;
++
++ // shift the data pointer to the next gl_packet
++ skb_pull(skb, size + 4);
++ }
++
++ // skip the packet length field 4 bytes
++ skb_pull(skb, 4);
++
++ if (skb->len > GL_MAX_PACKET_LEN) {
++ netdev_dbg(dev->net, "genelink: invalid rx length %d\n",
++ skb->len);
++ return 0;
++ }
++ return 1;
++}
++
++static struct sk_buff *
++genelink_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
++{
++ int padlen;
++ int length = skb->len;
++ int headroom = skb_headroom(skb);
++ int tailroom = skb_tailroom(skb);
++ __le32 *packet_count;
++ __le32 *packet_len;
++
++ // FIXME: magic numbers, bleech
++ padlen = ((skb->len + (4 + 4*1)) % 64) ? 0 : 1;
++
++ if ((!skb_cloned(skb))
++ && ((headroom + tailroom) >= (padlen + (4 + 4*1)))) {
++ if ((headroom < (4 + 4*1)) || (tailroom < padlen)) {
++ skb->data = memmove(skb->head + (4 + 4*1),
++ skb->data, skb->len);
++ skb_set_tail_pointer(skb, skb->len);
++ }
++ } else {
++ struct sk_buff *skb2;
++ skb2 = skb_copy_expand(skb, (4 + 4*1) , padlen, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (!skb)
++ return NULL;
++ }
++
++ // attach the packet count to the header
++ packet_count = (__le32 *) skb_push(skb, (4 + 4*1));
++ packet_len = packet_count + 1;
++
++ *packet_count = cpu_to_le32(1);
++ *packet_len = cpu_to_le32(length);
++
++ // add padding byte
++ if ((skb->len % dev->maxpacket) == 0)
++ skb_put(skb, 1);
++
++ return skb;
++}
++
++static int genelink_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ dev->hard_mtu = GL_RCV_BUF_SIZE;
++ dev->net->hard_header_len += 4;
++ dev->in = usb_rcvbulkpipe(dev->udev, dev->driver_info->in);
++ dev->out = usb_sndbulkpipe(dev->udev, dev->driver_info->out);
++ return 0;
++}
++
++static const struct driver_info genelink_info = {
++ .description = "Genesys GeneLink",
++ .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_GL | FLAG_NO_SETINT,
++ .bind = genelink_bind,
++ .rx_fixup = genelink_rx_fixup,
++ .tx_fixup = genelink_tx_fixup,
++
++ .in = 1, .out = 2,
++
++#ifdef GENELINK_ACK
++ .check_connect =genelink_check_connect,
++#endif
++};
++
++static const struct usb_device_id products [] = {
++
++{
++ USB_DEVICE(0x05e3, 0x0502), // GL620USB-A
++ .driver_info = (unsigned long) &genelink_info,
++},
++ /* NOT: USB_DEVICE(0x05e3, 0x0501), // GL620USB
++ * that's half duplex, not currently supported
++ */
++ { }, // END
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver gl620a_driver = {
++ .name = "gl620a",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(gl620a_driver);
++
++MODULE_AUTHOR("Jiun-Jie Huang");
++MODULE_DESCRIPTION("GL620-USB-A Host-to-Host Link cables");
++MODULE_LICENSE("GPL");
++
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drivers/net/usb/hso.c
+--- backports-3.18.1-1.org/drivers/net/usb/hso.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/hso.c 2015-01-03 13:42:25.000000000 +0100
+@@ -0,0 +1,3326 @@
++/******************************************************************************
++ *
++ * Driver for Option High Speed Mobile Devices.
++ *
++ * Copyright (C) 2008 Option International
++ * Filip Aben <f.aben@option.com>
++ * Denis Joseph Barrow <d.barow@option.com>
++ * Jan Dumon <j.dumon@option.com>
++ * Copyright (C) 2007 Andrew Bird (Sphere Systems Ltd)
++ * <ajb@spheresystems.co.uk>
++ * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
++ * Copyright (C) 2008 Novell, Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++ * USA
++ *
++ *
++ *****************************************************************************/
++
++/******************************************************************************
++ *
++ * Description of the device:
++ *
++ * Interface 0: Contains the IP network interface on the bulk end points.
++ * The multiplexed serial ports are using the interrupt and
++ * control endpoints.
++ * Interrupt contains a bitmap telling which multiplexed
++ * serialport needs servicing.
++ *
++ * Interface 1: Diagnostics port, uses bulk only, do not submit urbs until the
++ * port is opened, as this have a huge impact on the network port
++ * throughput.
++ *
++ * Interface 2: Standard modem interface - circuit switched interface, this
++ * can be used to make a standard ppp connection however it
++ * should not be used in conjunction with the IP network interface
++ * enabled for USB performance reasons i.e. if using this set
++ * ideally disable_net=1.
++ *
++ *****************************************************************************/
++
++#include <linux/sched.h>
++#include <linux/slab.h>
++#include <linux/init.h>
++#include <linux/delay.h>
++#include <linux/netdevice.h>
++#include <linux/module.h>
++#include <linux/ethtool.h>
++#include <linux/usb.h>
++#include <linux/timer.h>
++#include <linux/tty.h>
++#include <linux/tty_driver.h>
++#include <linux/tty_flip.h>
++#include <linux/kmod.h>
++#include <linux/rfkill.h>
++#include <linux/ip.h>
++#include <linux/uaccess.h>
++#include <linux/usb/cdc.h>
++#include <net/arp.h>
++#include <asm/byteorder.h>
++#include <linux/serial_core.h>
++#include <linux/serial.h>
++#include <asm/local.h>
++
++#define MOD_AUTHOR "Option Wireless"
++#define MOD_DESCRIPTION "USB High Speed Option driver"
++#define MOD_LICENSE "GPL"
++
++#define HSO_MAX_NET_DEVICES 10
++#define HSO__MAX_MTU 2048
++#define DEFAULT_MTU 1500
++#define DEFAULT_MRU 1500
++
++#define CTRL_URB_RX_SIZE 1024
++#define CTRL_URB_TX_SIZE 64
++
++#define BULK_URB_RX_SIZE 4096
++#define BULK_URB_TX_SIZE 8192
++
++#define MUX_BULK_RX_BUF_SIZE HSO__MAX_MTU
++#define MUX_BULK_TX_BUF_SIZE HSO__MAX_MTU
++#define MUX_BULK_RX_BUF_COUNT 4
++#define USB_TYPE_OPTION_VENDOR 0x20
++
++/* These definitions are used with the struct hso_net flags element */
++/* - use *_bit operations on it. (bit indices not values.) */
++#define HSO_NET_RUNNING 0
++
++#define HSO_NET_TX_TIMEOUT (HZ*10)
++
++#define HSO_SERIAL_MAGIC 0x48534f31
++
++/* Number of ttys to handle */
++#define HSO_SERIAL_TTY_MINORS 256
++
++#define MAX_RX_URBS 2
++
++/*****************************************************************************/
++/* Debugging functions */
++/*****************************************************************************/
++#define D__(lvl_, fmt, arg...) \
++ do { \
++ printk(lvl_ "[%d:%s]: " fmt "\n", \
++ __LINE__, __func__, ## arg); \
++ } while (0)
++
++#define D_(lvl, args...) \
++ do { \
++ if (lvl & debug) \
++ D__(KERN_INFO, args); \
++ } while (0)
++
++#define D1(args...) D_(0x01, ##args)
++#define D2(args...) D_(0x02, ##args)
++#define D3(args...) D_(0x04, ##args)
++#define D4(args...) D_(0x08, ##args)
++#define D5(args...) D_(0x10, ##args)
++
++/*****************************************************************************/
++/* Enumerators */
++/*****************************************************************************/
++enum pkt_parse_state {
++ WAIT_IP,
++ WAIT_DATA,
++ WAIT_SYNC
++};
++
++/*****************************************************************************/
++/* Structs */
++/*****************************************************************************/
++
++struct hso_shared_int {
++ struct usb_endpoint_descriptor *intr_endp;
++ void *shared_intr_buf;
++ struct urb *shared_intr_urb;
++ struct usb_device *usb;
++ int use_count;
++ int ref_count;
++ struct mutex shared_int_lock;
++};
++
++struct hso_net {
++ struct hso_device *parent;
++ struct net_device *net;
++ struct rfkill *rfkill;
++
++ struct usb_endpoint_descriptor *in_endp;
++ struct usb_endpoint_descriptor *out_endp;
++
++ struct urb *mux_bulk_rx_urb_pool[MUX_BULK_RX_BUF_COUNT];
++ struct urb *mux_bulk_tx_urb;
++ void *mux_bulk_rx_buf_pool[MUX_BULK_RX_BUF_COUNT];
++ void *mux_bulk_tx_buf;
++
++ struct sk_buff *skb_rx_buf;
++ struct sk_buff *skb_tx_buf;
++
++ enum pkt_parse_state rx_parse_state;
++ spinlock_t net_lock;
++
++ unsigned short rx_buf_size;
++ unsigned short rx_buf_missing;
++ struct iphdr rx_ip_hdr;
++
++ unsigned long flags;
++};
++
++enum rx_ctrl_state{
++ RX_IDLE,
++ RX_SENT,
++ RX_PENDING
++};
++
++#define BM_REQUEST_TYPE (0xa1)
++#define B_NOTIFICATION (0x20)
++#define W_VALUE (0x0)
++#define W_LENGTH (0x2)
++
++#define B_OVERRUN (0x1<<6)
++#define B_PARITY (0x1<<5)
++#define B_FRAMING (0x1<<4)
++#define B_RING_SIGNAL (0x1<<3)
++#define B_BREAK (0x1<<2)
++#define B_TX_CARRIER (0x1<<1)
++#define B_RX_CARRIER (0x1<<0)
++
++struct hso_serial_state_notification {
++ u8 bmRequestType;
++ u8 bNotification;
++ u16 wValue;
++ u16 wIndex;
++ u16 wLength;
++ u16 UART_state_bitmap;
++} __packed;
++
++struct hso_tiocmget {
++ struct mutex mutex;
++ wait_queue_head_t waitq;
++ int intr_completed;
++ struct usb_endpoint_descriptor *endp;
++ struct urb *urb;
++ struct hso_serial_state_notification serial_state_notification;
++ u16 prev_UART_state_bitmap;
++ struct uart_icount icount;
++};
++
++
++struct hso_serial {
++ struct hso_device *parent;
++ int magic;
++ u8 minor;
++
++ struct hso_shared_int *shared_int;
++
++ /* rx/tx urb could be either a bulk urb or a control urb depending
++ on which serial port it is used on. */
++ struct urb *rx_urb[MAX_RX_URBS];
++ u8 num_rx_urbs;
++ u8 *rx_data[MAX_RX_URBS];
++ u16 rx_data_length; /* should contain allocated length */
++
++ struct urb *tx_urb;
++ u8 *tx_data;
++ u8 *tx_buffer;
++ u16 tx_data_length; /* should contain allocated length */
++ u16 tx_data_count;
++ u16 tx_buffer_count;
++ struct usb_ctrlrequest ctrl_req_tx;
++ struct usb_ctrlrequest ctrl_req_rx;
++
++ struct usb_endpoint_descriptor *in_endp;
++ struct usb_endpoint_descriptor *out_endp;
++
++ enum rx_ctrl_state rx_state;
++ u8 rts_state;
++ u8 dtr_state;
++ unsigned tx_urb_used:1;
++
++ struct tty_port port;
++ /* from usb_serial_port */
++ spinlock_t serial_lock;
++
++ int (*write_data) (struct hso_serial *serial);
++ struct hso_tiocmget *tiocmget;
++ /* Hacks required to get flow control
++ * working on the serial receive buffers
++ * so as not to drop characters on the floor.
++ */
++ int curr_rx_urb_idx;
++ u8 rx_urb_filled[MAX_RX_URBS];
++ struct tasklet_struct unthrottle_tasklet;
++};
++
++struct hso_device {
++ union {
++ struct hso_serial *dev_serial;
++ struct hso_net *dev_net;
++ } port_data;
++
++ u32 port_spec;
++
++ u8 is_active;
++ u8 usb_gone;
++ struct work_struct async_get_intf;
++ struct work_struct async_put_intf;
++ struct work_struct reset_device;
++
++ struct usb_device *usb;
++ struct usb_interface *interface;
++
++ struct device *dev;
++ struct kref ref;
++ struct mutex mutex;
++};
++
++/* Type of interface */
++#define HSO_INTF_MASK 0xFF00
++#define HSO_INTF_MUX 0x0100
++#define HSO_INTF_BULK 0x0200
++
++/* Type of port */
++#define HSO_PORT_MASK 0xFF
++#define HSO_PORT_NO_PORT 0x0
++#define HSO_PORT_CONTROL 0x1
++#define HSO_PORT_APP 0x2
++#define HSO_PORT_GPS 0x3
++#define HSO_PORT_PCSC 0x4
++#define HSO_PORT_APP2 0x5
++#define HSO_PORT_GPS_CONTROL 0x6
++#define HSO_PORT_MSD 0x7
++#define HSO_PORT_VOICE 0x8
++#define HSO_PORT_DIAG2 0x9
++#define HSO_PORT_DIAG 0x10
++#define HSO_PORT_MODEM 0x11
++#define HSO_PORT_NETWORK 0x12
++
++/* Additional device info */
++#define HSO_INFO_MASK 0xFF000000
++#define HSO_INFO_CRC_BUG 0x01000000
++
++/*****************************************************************************/
++/* Prototypes */
++/*****************************************************************************/
++/* Serial driver functions */
++static int hso_serial_tiocmset(struct tty_struct *tty,
++ unsigned int set, unsigned int clear);
++static void ctrl_callback(struct urb *urb);
++static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial);
++static void hso_kick_transmit(struct hso_serial *serial);
++/* Helper functions */
++static int hso_mux_submit_intr_urb(struct hso_shared_int *mux_int,
++ struct usb_device *usb, gfp_t gfp);
++static void handle_usb_error(int status, const char *function,
++ struct hso_device *hso_dev);
++static struct usb_endpoint_descriptor *hso_get_ep(struct usb_interface *intf,
++ int type, int dir);
++static int hso_get_mux_ports(struct usb_interface *intf, unsigned char *ports);
++static void hso_free_interface(struct usb_interface *intf);
++static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags);
++static int hso_stop_serial_device(struct hso_device *hso_dev);
++static int hso_start_net_device(struct hso_device *hso_dev);
++static void hso_free_shared_int(struct hso_shared_int *shared_int);
++static int hso_stop_net_device(struct hso_device *hso_dev);
++static void hso_serial_ref_free(struct kref *ref);
++static void hso_std_serial_read_bulk_callback(struct urb *urb);
++static int hso_mux_serial_read(struct hso_serial *serial);
++static void async_get_intf(struct work_struct *data);
++static void async_put_intf(struct work_struct *data);
++static int hso_put_activity(struct hso_device *hso_dev);
++static int hso_get_activity(struct hso_device *hso_dev);
++static void tiocmget_intr_callback(struct urb *urb);
++static void reset_device(struct work_struct *data);
++/*****************************************************************************/
++/* Helping functions */
++/*****************************************************************************/
++
++/* #define DEBUG */
++
++static inline struct hso_net *dev2net(struct hso_device *hso_dev)
++{
++ return hso_dev->port_data.dev_net;
++}
++
++static inline struct hso_serial *dev2ser(struct hso_device *hso_dev)
++{
++ return hso_dev->port_data.dev_serial;
++}
++
++/* Debugging functions */
++#ifdef DEBUG
++static void dbg_dump(int line_count, const char *func_name, unsigned char *buf,
++ unsigned int len)
++{
++ static char name[255];
++
++ sprintf(name, "hso[%d:%s]", line_count, func_name);
++ print_hex_dump_bytes(name, DUMP_PREFIX_NONE, buf, len);
++}
++
++#define DUMP(buf_, len_) \
++ dbg_dump(__LINE__, __func__, (unsigned char *)buf_, len_)
++
++#define DUMP1(buf_, len_) \
++ do { \
++ if (0x01 & debug) \
++ DUMP(buf_, len_); \
++ } while (0)
++#else
++#define DUMP(buf_, len_)
++#define DUMP1(buf_, len_)
++#endif
++
++/* module parameters */
++static int debug;
++static int tty_major;
++static int disable_net;
++
++/* driver info */
++static const char driver_name[] = "hso";
++static const char tty_filename[] = "ttyHS";
++static const char *version = __FILE__ ": " MOD_AUTHOR;
++/* the usb driver itself (registered in hso_init) */
++static struct usb_driver hso_driver;
++/* serial structures */
++static struct tty_driver *tty_drv;
++static struct hso_device *serial_table[HSO_SERIAL_TTY_MINORS];
++static struct hso_device *network_table[HSO_MAX_NET_DEVICES];
++static spinlock_t serial_table_lock;
++
++static const s32 default_port_spec[] = {
++ HSO_INTF_MUX | HSO_PORT_NETWORK,
++ HSO_INTF_BULK | HSO_PORT_DIAG,
++ HSO_INTF_BULK | HSO_PORT_MODEM,
++ 0
++};
++
++static const s32 icon321_port_spec[] = {
++ HSO_INTF_MUX | HSO_PORT_NETWORK,
++ HSO_INTF_BULK | HSO_PORT_DIAG2,
++ HSO_INTF_BULK | HSO_PORT_MODEM,
++ HSO_INTF_BULK | HSO_PORT_DIAG,
++ 0
++};
++
++#define default_port_device(vendor, product) \
++ USB_DEVICE(vendor, product), \
++ .driver_info = (kernel_ulong_t)default_port_spec
++
++#define icon321_port_device(vendor, product) \
++ USB_DEVICE(vendor, product), \
++ .driver_info = (kernel_ulong_t)icon321_port_spec
++
++/* list of devices we support */
++static const struct usb_device_id hso_ids[] = {
++ {default_port_device(0x0af0, 0x6711)},
++ {default_port_device(0x0af0, 0x6731)},
++ {default_port_device(0x0af0, 0x6751)},
++ {default_port_device(0x0af0, 0x6771)},
++ {default_port_device(0x0af0, 0x6791)},
++ {default_port_device(0x0af0, 0x6811)},
++ {default_port_device(0x0af0, 0x6911)},
++ {default_port_device(0x0af0, 0x6951)},
++ {default_port_device(0x0af0, 0x6971)},
++ {default_port_device(0x0af0, 0x7011)},
++ {default_port_device(0x0af0, 0x7031)},
++ {default_port_device(0x0af0, 0x7051)},
++ {default_port_device(0x0af0, 0x7071)},
++ {default_port_device(0x0af0, 0x7111)},
++ {default_port_device(0x0af0, 0x7211)},
++ {default_port_device(0x0af0, 0x7251)},
++ {default_port_device(0x0af0, 0x7271)},
++ {default_port_device(0x0af0, 0x7311)},
++ {default_port_device(0x0af0, 0xc031)}, /* Icon-Edge */
++ {icon321_port_device(0x0af0, 0xd013)}, /* Module HSxPA */
++ {icon321_port_device(0x0af0, 0xd031)}, /* Icon-321 */
++ {icon321_port_device(0x0af0, 0xd033)}, /* Icon-322 */
++ {USB_DEVICE(0x0af0, 0x7301)}, /* GE40x */
++ {USB_DEVICE(0x0af0, 0x7361)}, /* GE40x */
++ {USB_DEVICE(0x0af0, 0x7381)}, /* GE40x */
++ {USB_DEVICE(0x0af0, 0x7401)}, /* GI 0401 */
++ {USB_DEVICE(0x0af0, 0x7501)}, /* GTM 382 */
++ {USB_DEVICE(0x0af0, 0x7601)}, /* GE40x */
++ {USB_DEVICE(0x0af0, 0x7701)},
++ {USB_DEVICE(0x0af0, 0x7706)},
++ {USB_DEVICE(0x0af0, 0x7801)},
++ {USB_DEVICE(0x0af0, 0x7901)},
++ {USB_DEVICE(0x0af0, 0x7A01)},
++ {USB_DEVICE(0x0af0, 0x7A05)},
++ {USB_DEVICE(0x0af0, 0x8200)},
++ {USB_DEVICE(0x0af0, 0x8201)},
++ {USB_DEVICE(0x0af0, 0x8300)},
++ {USB_DEVICE(0x0af0, 0x8302)},
++ {USB_DEVICE(0x0af0, 0x8304)},
++ {USB_DEVICE(0x0af0, 0x8400)},
++ {USB_DEVICE(0x0af0, 0x8600)},
++ {USB_DEVICE(0x0af0, 0x8800)},
++ {USB_DEVICE(0x0af0, 0x8900)},
++ {USB_DEVICE(0x0af0, 0x9000)},
++ {USB_DEVICE(0x0af0, 0x9200)}, /* Option GTM671WFS */
++ {USB_DEVICE(0x0af0, 0xd035)},
++ {USB_DEVICE(0x0af0, 0xd055)},
++ {USB_DEVICE(0x0af0, 0xd155)},
++ {USB_DEVICE(0x0af0, 0xd255)},
++ {USB_DEVICE(0x0af0, 0xd057)},
++ {USB_DEVICE(0x0af0, 0xd157)},
++ {USB_DEVICE(0x0af0, 0xd257)},
++ {USB_DEVICE(0x0af0, 0xd357)},
++ {USB_DEVICE(0x0af0, 0xd058)},
++ {USB_DEVICE(0x0af0, 0xc100)},
++ {}
++};
++MODULE_DEVICE_TABLE(usb, hso_ids);
++
++/* Sysfs attribute */
++static ssize_t hso_sysfs_show_porttype(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct hso_device *hso_dev = dev_get_drvdata(dev);
++ char *port_name;
++
++ if (!hso_dev)
++ return 0;
++
++ switch (hso_dev->port_spec & HSO_PORT_MASK) {
++ case HSO_PORT_CONTROL:
++ port_name = "Control";
++ break;
++ case HSO_PORT_APP:
++ port_name = "Application";
++ break;
++ case HSO_PORT_APP2:
++ port_name = "Application2";
++ break;
++ case HSO_PORT_GPS:
++ port_name = "GPS";
++ break;
++ case HSO_PORT_GPS_CONTROL:
++ port_name = "GPS Control";
++ break;
++ case HSO_PORT_PCSC:
++ port_name = "PCSC";
++ break;
++ case HSO_PORT_DIAG:
++ port_name = "Diagnostic";
++ break;
++ case HSO_PORT_DIAG2:
++ port_name = "Diagnostic2";
++ break;
++ case HSO_PORT_MODEM:
++ port_name = "Modem";
++ break;
++ case HSO_PORT_NETWORK:
++ port_name = "Network";
++ break;
++ default:
++ port_name = "Unknown";
++ break;
++ }
++
++ return sprintf(buf, "%s\n", port_name);
++}
++static DEVICE_ATTR(hsotype, S_IRUGO, hso_sysfs_show_porttype, NULL);
++
++static int hso_urb_to_index(struct hso_serial *serial, struct urb *urb)
++{
++ int idx;
++
++ for (idx = 0; idx < serial->num_rx_urbs; idx++)
++ if (serial->rx_urb[idx] == urb)
++ return idx;
++ dev_err(serial->parent->dev, "hso_urb_to_index failed\n");
++ return -1;
++}
++
++/* converts mux value to a port spec value */
++static u32 hso_mux_to_port(int mux)
++{
++ u32 result;
++
++ switch (mux) {
++ case 0x1:
++ result = HSO_PORT_CONTROL;
++ break;
++ case 0x2:
++ result = HSO_PORT_APP;
++ break;
++ case 0x4:
++ result = HSO_PORT_PCSC;
++ break;
++ case 0x8:
++ result = HSO_PORT_GPS;
++ break;
++ case 0x10:
++ result = HSO_PORT_APP2;
++ break;
++ default:
++ result = HSO_PORT_NO_PORT;
++ }
++ return result;
++}
++
++/* converts port spec value to a mux value */
++static u32 hso_port_to_mux(int port)
++{
++ u32 result;
++
++ switch (port & HSO_PORT_MASK) {
++ case HSO_PORT_CONTROL:
++ result = 0x0;
++ break;
++ case HSO_PORT_APP:
++ result = 0x1;
++ break;
++ case HSO_PORT_PCSC:
++ result = 0x2;
++ break;
++ case HSO_PORT_GPS:
++ result = 0x3;
++ break;
++ case HSO_PORT_APP2:
++ result = 0x4;
++ break;
++ default:
++ result = 0x0;
++ }
++ return result;
++}
++
++static struct hso_serial *get_serial_by_shared_int_and_type(
++ struct hso_shared_int *shared_int,
++ int mux)
++{
++ int i, port;
++
++ port = hso_mux_to_port(mux);
++
++ for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
++ if (serial_table[i] &&
++ (dev2ser(serial_table[i])->shared_int == shared_int) &&
++ ((serial_table[i]->port_spec & HSO_PORT_MASK) == port)) {
++ return dev2ser(serial_table[i]);
++ }
++ }
++
++ return NULL;
++}
++
++static struct hso_serial *get_serial_by_index(unsigned index)
++{
++ struct hso_serial *serial = NULL;
++ unsigned long flags;
++
++ spin_lock_irqsave(&serial_table_lock, flags);
++ if (serial_table[index])
++ serial = dev2ser(serial_table[index]);
++ spin_unlock_irqrestore(&serial_table_lock, flags);
++
++ return serial;
++}
++
++static int get_free_serial_index(void)
++{
++ int index;
++ unsigned long flags;
++
++ spin_lock_irqsave(&serial_table_lock, flags);
++ for (index = 0; index < HSO_SERIAL_TTY_MINORS; index++) {
++ if (serial_table[index] == NULL) {
++ spin_unlock_irqrestore(&serial_table_lock, flags);
++ return index;
++ }
++ }
++ spin_unlock_irqrestore(&serial_table_lock, flags);
++
++ printk(KERN_ERR "%s: no free serial devices in table\n", __func__);
++ return -1;
++}
++
++static void set_serial_by_index(unsigned index, struct hso_serial *serial)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&serial_table_lock, flags);
++ if (serial)
++ serial_table[index] = serial->parent;
++ else
++ serial_table[index] = NULL;
++ spin_unlock_irqrestore(&serial_table_lock, flags);
++}
++
++static void handle_usb_error(int status, const char *function,
++ struct hso_device *hso_dev)
++{
++ char *explanation;
++
++ switch (status) {
++ case -ENODEV:
++ explanation = "no device";
++ break;
++ case -ENOENT:
++ explanation = "endpoint not enabled";
++ break;
++ case -EPIPE:
++ explanation = "endpoint stalled";
++ break;
++ case -ENOSPC:
++ explanation = "not enough bandwidth";
++ break;
++ case -ESHUTDOWN:
++ explanation = "device disabled";
++ break;
++ case -EHOSTUNREACH:
++ explanation = "device suspended";
++ break;
++ case -EINVAL:
++ case -EAGAIN:
++ case -EFBIG:
++ case -EMSGSIZE:
++ explanation = "internal error";
++ break;
++ case -EILSEQ:
++ case -EPROTO:
++ case -ETIME:
++ case -ETIMEDOUT:
++ explanation = "protocol error";
++ if (hso_dev)
++ schedule_work(&hso_dev->reset_device);
++ break;
++ default:
++ explanation = "unknown status";
++ break;
++ }
++
++ /* log a meaningful explanation of an USB status */
++ D1("%s: received USB status - %s (%d)", function, explanation, status);
++}
++
++/* Network interface functions */
++
++/* called when net interface is brought up by ifconfig */
++static int hso_net_open(struct net_device *net)
++{
++ struct hso_net *odev = netdev_priv(net);
++ unsigned long flags = 0;
++
++ if (!odev) {
++ dev_err(&net->dev, "No net device !\n");
++ return -ENODEV;
++ }
++
++ odev->skb_tx_buf = NULL;
++
++ /* setup environment */
++ spin_lock_irqsave(&odev->net_lock, flags);
++ odev->rx_parse_state = WAIT_IP;
++ odev->rx_buf_size = 0;
++ odev->rx_buf_missing = sizeof(struct iphdr);
++ spin_unlock_irqrestore(&odev->net_lock, flags);
++
++ /* We are up and running. */
++ set_bit(HSO_NET_RUNNING, &odev->flags);
++ hso_start_net_device(odev->parent);
++
++ /* Tell the kernel we are ready to start receiving from it */
++ netif_start_queue(net);
++
++ return 0;
++}
++
++/* called when interface is brought down by ifconfig */
++static int hso_net_close(struct net_device *net)
++{
++ struct hso_net *odev = netdev_priv(net);
++
++ /* we don't need the queue anymore */
++ netif_stop_queue(net);
++ /* no longer running */
++ clear_bit(HSO_NET_RUNNING, &odev->flags);
++
++ hso_stop_net_device(odev->parent);
++
++ /* done */
++ return 0;
++}
++
++/* USB tells is xmit done, we should start the netqueue again */
++static void write_bulk_callback(struct urb *urb)
++{
++ struct hso_net *odev = urb->context;
++ int status = urb->status;
++
++ /* Sanity check */
++ if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) {
++ dev_err(&urb->dev->dev, "%s: device not running\n", __func__);
++ return;
++ }
++
++ /* Do we still have a valid kernel network device? */
++ if (!netif_device_present(odev->net)) {
++ dev_err(&urb->dev->dev, "%s: net device not present\n",
++ __func__);
++ return;
++ }
++
++ /* log status, but don't act on it, we don't need to resubmit anything
++ * anyhow */
++ if (status)
++ handle_usb_error(status, __func__, odev->parent);
++
++ hso_put_activity(odev->parent);
++
++ /* Tell the network interface we are ready for another frame */
++ netif_wake_queue(odev->net);
++}
++
++/* called by kernel when we need to transmit a packet */
++static netdev_tx_t hso_net_start_xmit(struct sk_buff *skb,
++ struct net_device *net)
++{
++ struct hso_net *odev = netdev_priv(net);
++ int result;
++
++ /* Tell the kernel, "No more frames 'til we are done with this one." */
++ netif_stop_queue(net);
++ if (hso_get_activity(odev->parent) == -EAGAIN) {
++ odev->skb_tx_buf = skb;
++ return NETDEV_TX_OK;
++ }
++
++ /* log if asked */
++ DUMP1(skb->data, skb->len);
++ /* Copy it from kernel memory to OUR memory */
++ memcpy(odev->mux_bulk_tx_buf, skb->data, skb->len);
++ D1("len: %d/%d", skb->len, MUX_BULK_TX_BUF_SIZE);
++
++ /* Fill in the URB for shipping it out. */
++ usb_fill_bulk_urb(odev->mux_bulk_tx_urb,
++ odev->parent->usb,
++ usb_sndbulkpipe(odev->parent->usb,
++ odev->out_endp->
++ bEndpointAddress & 0x7F),
++ odev->mux_bulk_tx_buf, skb->len, write_bulk_callback,
++ odev);
++
++ /* Deal with the Zero Length packet problem, I hope */
++ odev->mux_bulk_tx_urb->transfer_flags |= URB_ZERO_PACKET;
++
++ /* Send the URB on its merry way. */
++ result = usb_submit_urb(odev->mux_bulk_tx_urb, GFP_ATOMIC);
++ if (result) {
++ dev_warn(&odev->parent->interface->dev,
++ "failed mux_bulk_tx_urb %d\n", result);
++ net->stats.tx_errors++;
++ netif_start_queue(net);
++ } else {
++ net->stats.tx_packets++;
++ net->stats.tx_bytes += skb->len;
++ }
++ dev_kfree_skb(skb);
++ /* we're done */
++ return NETDEV_TX_OK;
++}
++
++static const struct ethtool_ops ops = {
++ .get_link = ethtool_op_get_link
++};
++
++/* called when a packet did not ack after watchdogtimeout */
++static void hso_net_tx_timeout(struct net_device *net)
++{
++ struct hso_net *odev = netdev_priv(net);
++
++ if (!odev)
++ return;
++
++ /* Tell syslog we are hosed. */
++ dev_warn(&net->dev, "Tx timed out.\n");
++
++ /* Tear the waiting frame off the list */
++ if (odev->mux_bulk_tx_urb &&
++ (odev->mux_bulk_tx_urb->status == -EINPROGRESS))
++ usb_unlink_urb(odev->mux_bulk_tx_urb);
++
++ /* Update statistics */
++ net->stats.tx_errors++;
++}
++
++/* make a real packet from the received USB buffer */
++static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
++ unsigned int count, unsigned char is_eop)
++{
++ unsigned short temp_bytes;
++ unsigned short buffer_offset = 0;
++ unsigned short frame_len;
++ unsigned char *tmp_rx_buf;
++
++ /* log if needed */
++ D1("Rx %d bytes", count);
++ DUMP(ip_pkt, min(128, (int)count));
++
++ while (count) {
++ switch (odev->rx_parse_state) {
++ case WAIT_IP:
++ /* waiting for IP header. */
++ /* wanted bytes - size of ip header */
++ temp_bytes =
++ (count <
++ odev->rx_buf_missing) ? count : odev->
++ rx_buf_missing;
++
++ memcpy(((unsigned char *)(&odev->rx_ip_hdr)) +
++ odev->rx_buf_size, ip_pkt + buffer_offset,
++ temp_bytes);
++
++ odev->rx_buf_size += temp_bytes;
++ buffer_offset += temp_bytes;
++ odev->rx_buf_missing -= temp_bytes;
++ count -= temp_bytes;
++
++ if (!odev->rx_buf_missing) {
++ /* header is complete allocate an sk_buffer and
++ * continue to WAIT_DATA */
++ frame_len = ntohs(odev->rx_ip_hdr.tot_len);
++
++ if ((frame_len > DEFAULT_MRU) ||
++ (frame_len < sizeof(struct iphdr))) {
++ dev_err(&odev->net->dev,
++ "Invalid frame (%d) length\n",
++ frame_len);
++ odev->rx_parse_state = WAIT_SYNC;
++ continue;
++ }
++ /* Allocate an sk_buff */
++ odev->skb_rx_buf = netdev_alloc_skb(odev->net,
++ frame_len);
++ if (!odev->skb_rx_buf) {
++ /* We got no receive buffer. */
++ D1("could not allocate memory");
++ odev->rx_parse_state = WAIT_SYNC;
++ return;
++ }
++
++ /* Copy what we got so far. make room for iphdr
++ * after tail. */
++ tmp_rx_buf =
++ skb_put(odev->skb_rx_buf,
++ sizeof(struct iphdr));
++ memcpy(tmp_rx_buf, (char *)&(odev->rx_ip_hdr),
++ sizeof(struct iphdr));
++
++ /* ETH_HLEN */
++ odev->rx_buf_size = sizeof(struct iphdr);
++
++ /* Filip actually use .tot_len */
++ odev->rx_buf_missing =
++ frame_len - sizeof(struct iphdr);
++ odev->rx_parse_state = WAIT_DATA;
++ }
++ break;
++
++ case WAIT_DATA:
++ temp_bytes = (count < odev->rx_buf_missing)
++ ? count : odev->rx_buf_missing;
++
++ /* Copy the rest of the bytes that are left in the
++ * buffer into the waiting sk_buf. */
++ /* Make room for temp_bytes after tail. */
++ tmp_rx_buf = skb_put(odev->skb_rx_buf, temp_bytes);
++ memcpy(tmp_rx_buf, ip_pkt + buffer_offset, temp_bytes);
++
++ odev->rx_buf_missing -= temp_bytes;
++ count -= temp_bytes;
++ buffer_offset += temp_bytes;
++ odev->rx_buf_size += temp_bytes;
++ if (!odev->rx_buf_missing) {
++ /* Packet is complete. Inject into stack. */
++ /* We have IP packet here */
++ odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP);
++ skb_reset_mac_header(odev->skb_rx_buf);
++
++ /* Ship it off to the kernel */
++ netif_rx(odev->skb_rx_buf);
++ /* No longer our buffer. */
++ odev->skb_rx_buf = NULL;
++
++ /* update out statistics */
++ odev->net->stats.rx_packets++;
++
++ odev->net->stats.rx_bytes += odev->rx_buf_size;
++
++ odev->rx_buf_size = 0;
++ odev->rx_buf_missing = sizeof(struct iphdr);
++ odev->rx_parse_state = WAIT_IP;
++ }
++ break;
++
++ case WAIT_SYNC:
++ D1(" W_S");
++ count = 0;
++ break;
++ default:
++ D1(" ");
++ count--;
++ break;
++ }
++ }
++
++ /* Recovery mechanism for WAIT_SYNC state. */
++ if (is_eop) {
++ if (odev->rx_parse_state == WAIT_SYNC) {
++ odev->rx_parse_state = WAIT_IP;
++ odev->rx_buf_size = 0;
++ odev->rx_buf_missing = sizeof(struct iphdr);
++ }
++ }
++}
++
++static void fix_crc_bug(struct urb *urb, __le16 max_packet_size)
++{
++ static const u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF };
++ u32 rest = urb->actual_length % le16_to_cpu(max_packet_size);
++
++ if (((rest == 5) || (rest == 6)) &&
++ !memcmp(((u8 *)urb->transfer_buffer) + urb->actual_length - 4,
++ crc_check, 4)) {
++ urb->actual_length -= 4;
++ }
++}
++
++/* Moving data from usb to kernel (in interrupt state) */
++static void read_bulk_callback(struct urb *urb)
++{
++ struct hso_net *odev = urb->context;
++ struct net_device *net;
++ int result;
++ int status = urb->status;
++
++ /* is al ok? (Filip: Who's Al ?) */
++ if (status) {
++ handle_usb_error(status, __func__, odev->parent);
++ return;
++ }
++
++ /* Sanity check */
++ if (!odev || !test_bit(HSO_NET_RUNNING, &odev->flags)) {
++ D1("BULK IN callback but driver is not active!");
++ return;
++ }
++ usb_mark_last_busy(urb->dev);
++
++ net = odev->net;
++
++ if (!netif_device_present(net)) {
++ /* Somebody killed our network interface... */
++ return;
++ }
++
++ if (odev->parent->port_spec & HSO_INFO_CRC_BUG)
++ fix_crc_bug(urb, odev->in_endp->wMaxPacketSize);
++
++ /* do we even have a packet? */
++ if (urb->actual_length) {
++ /* Handle the IP stream, add header and push it onto network
++ * stack if the packet is complete. */
++ spin_lock(&odev->net_lock);
++ packetizeRx(odev, urb->transfer_buffer, urb->actual_length,
++ (urb->transfer_buffer_length >
++ urb->actual_length) ? 1 : 0);
++ spin_unlock(&odev->net_lock);
++ }
++
++ /* We are done with this URB, resubmit it. Prep the USB to wait for
++ * another frame. Reuse same as received. */
++ usb_fill_bulk_urb(urb,
++ odev->parent->usb,
++ usb_rcvbulkpipe(odev->parent->usb,
++ odev->in_endp->
++ bEndpointAddress & 0x7F),
++ urb->transfer_buffer, MUX_BULK_RX_BUF_SIZE,
++ read_bulk_callback, odev);
++
++ /* Give this to the USB subsystem so it can tell us when more data
++ * arrives. */
++ result = usb_submit_urb(urb, GFP_ATOMIC);
++ if (result)
++ dev_warn(&odev->parent->interface->dev,
++ "%s failed submit mux_bulk_rx_urb %d\n", __func__,
++ result);
++}
++
++/* Serial driver functions */
++
++static void hso_init_termios(struct ktermios *termios)
++{
++ /*
++ * The default requirements for this device are:
++ */
++ termios->c_iflag &=
++ ~(IGNBRK /* disable ignore break */
++ | BRKINT /* disable break causes interrupt */
++ | PARMRK /* disable mark parity errors */
++ | ISTRIP /* disable clear high bit of input characters */
++ | INLCR /* disable translate NL to CR */
++ | IGNCR /* disable ignore CR */
++ | ICRNL /* disable translate CR to NL */
++ | IXON); /* disable enable XON/XOFF flow control */
++
++ /* disable postprocess output characters */
++ termios->c_oflag &= ~OPOST;
++
++ termios->c_lflag &=
++ ~(ECHO /* disable echo input characters */
++ | ECHONL /* disable echo new line */
++ | ICANON /* disable erase, kill, werase, and rprnt
++ special characters */
++ | ISIG /* disable interrupt, quit, and suspend special
++ characters */
++ | IEXTEN); /* disable non-POSIX special characters */
++
++ termios->c_cflag &=
++ ~(CSIZE /* no size */
++ | PARENB /* disable parity bit */
++ | CBAUD /* clear current baud rate */
++ | CBAUDEX); /* clear current buad rate */
++
++ termios->c_cflag |= CS8; /* character size 8 bits */
++
++ /* baud rate 115200 */
++ tty_termios_encode_baud_rate(termios, 115200, 115200);
++}
++
++static void _hso_serial_set_termios(struct tty_struct *tty,
++ struct ktermios *old)
++{
++ struct hso_serial *serial = tty->driver_data;
++
++ if (!serial) {
++ printk(KERN_ERR "%s: no tty structures", __func__);
++ return;
++ }
++
++ D4("port %d", serial->minor);
++
++ /*
++ * Fix up unsupported bits
++ */
++ tty->termios.c_iflag &= ~IXON; /* disable enable XON/XOFF flow control */
++
++ tty->termios.c_cflag &=
++ ~(CSIZE /* no size */
++ | PARENB /* disable parity bit */
++ | CBAUD /* clear current baud rate */
++ | CBAUDEX); /* clear current buad rate */
++
++ tty->termios.c_cflag |= CS8; /* character size 8 bits */
++
++ /* baud rate 115200 */
++ tty_encode_baud_rate(tty, 115200, 115200);
++}
++
++static void hso_resubmit_rx_bulk_urb(struct hso_serial *serial, struct urb *urb)
++{
++ int result;
++ /* We are done with this URB, resubmit it. Prep the USB to wait for
++ * another frame */
++ usb_fill_bulk_urb(urb, serial->parent->usb,
++ usb_rcvbulkpipe(serial->parent->usb,
++ serial->in_endp->
++ bEndpointAddress & 0x7F),
++ urb->transfer_buffer, serial->rx_data_length,
++ hso_std_serial_read_bulk_callback, serial);
++ /* Give this to the USB subsystem so it can tell us when more data
++ * arrives. */
++ result = usb_submit_urb(urb, GFP_ATOMIC);
++ if (result) {
++ dev_err(&urb->dev->dev, "%s failed submit serial rx_urb %d\n",
++ __func__, result);
++ }
++}
++
++
++
++
++static void put_rxbuf_data_and_resubmit_bulk_urb(struct hso_serial *serial)
++{
++ int count;
++ struct urb *curr_urb;
++
++ while (serial->rx_urb_filled[serial->curr_rx_urb_idx]) {
++ curr_urb = serial->rx_urb[serial->curr_rx_urb_idx];
++ count = put_rxbuf_data(curr_urb, serial);
++ if (count == -1)
++ return;
++ if (count == 0) {
++ serial->curr_rx_urb_idx++;
++ if (serial->curr_rx_urb_idx >= serial->num_rx_urbs)
++ serial->curr_rx_urb_idx = 0;
++ hso_resubmit_rx_bulk_urb(serial, curr_urb);
++ }
++ }
++}
++
++static void put_rxbuf_data_and_resubmit_ctrl_urb(struct hso_serial *serial)
++{
++ int count = 0;
++ struct urb *urb;
++
++ urb = serial->rx_urb[0];
++ if (atomic_read(&serial->port.count) > 0) {
++ count = put_rxbuf_data(urb, serial);
++ if (count == -1)
++ return;
++ }
++ /* Re issue a read as long as we receive data. */
++
++ if (count == 0 && ((urb->actual_length != 0) ||
++ (serial->rx_state == RX_PENDING))) {
++ serial->rx_state = RX_SENT;
++ hso_mux_serial_read(serial);
++ } else
++ serial->rx_state = RX_IDLE;
++}
++
++
++/* read callback for Diag and CS port */
++static void hso_std_serial_read_bulk_callback(struct urb *urb)
++{
++ struct hso_serial *serial = urb->context;
++ int status = urb->status;
++
++ D4("\n--- Got serial_read_bulk callback %02x ---", status);
++
++ /* sanity check */
++ if (!serial) {
++ D1("serial == NULL");
++ return;
++ }
++ if (status) {
++ handle_usb_error(status, __func__, serial->parent);
++ return;
++ }
++
++ D1("Actual length = %d\n", urb->actual_length);
++ DUMP1(urb->transfer_buffer, urb->actual_length);
++
++ /* Anyone listening? */
++ if (atomic_read(&serial->port.count) == 0)
++ return;
++
++ if (serial->parent->port_spec & HSO_INFO_CRC_BUG)
++ fix_crc_bug(urb, serial->in_endp->wMaxPacketSize);
++ /* Valid data, handle RX data */
++ spin_lock(&serial->serial_lock);
++ serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1;
++ put_rxbuf_data_and_resubmit_bulk_urb(serial);
++ spin_unlock(&serial->serial_lock);
++}
++
++/*
++ * This needs to be a tasklet otherwise we will
++ * end up recursively calling this function.
++ */
++static void hso_unthrottle_tasklet(struct hso_serial *serial)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&serial->serial_lock, flags);
++ if ((serial->parent->port_spec & HSO_INTF_MUX))
++ put_rxbuf_data_and_resubmit_ctrl_urb(serial);
++ else
++ put_rxbuf_data_and_resubmit_bulk_urb(serial);
++ spin_unlock_irqrestore(&serial->serial_lock, flags);
++}
++
++static void hso_unthrottle(struct tty_struct *tty)
++{
++ struct hso_serial *serial = tty->driver_data;
++
++ tasklet_hi_schedule(&serial->unthrottle_tasklet);
++}
++
++/* open the requested serial port */
++static int hso_serial_open(struct tty_struct *tty, struct file *filp)
++{
++ struct hso_serial *serial = get_serial_by_index(tty->index);
++ int result;
++
++ /* sanity check */
++ if (serial == NULL || serial->magic != HSO_SERIAL_MAGIC) {
++ WARN_ON(1);
++ tty->driver_data = NULL;
++ D1("Failed to open port");
++ return -ENODEV;
++ }
++
++ mutex_lock(&serial->parent->mutex);
++ result = usb_autopm_get_interface(serial->parent->interface);
++ if (result < 0)
++ goto err_out;
++
++ D1("Opening %d", serial->minor);
++ kref_get(&serial->parent->ref);
++
++ /* setup */
++ tty->driver_data = serial;
++ tty_port_tty_set(&serial->port, tty);
++
++ /* check for port already opened, if not set the termios */
++ if (atomic_inc_return(&serial->port.count) == 1) {
++ serial->rx_state = RX_IDLE;
++ /* Force default termio settings */
++ _hso_serial_set_termios(tty, NULL);
++ tasklet_init(&serial->unthrottle_tasklet,
++ (void (*)(unsigned long))hso_unthrottle_tasklet,
++ (unsigned long)serial);
++ result = hso_start_serial_device(serial->parent, GFP_KERNEL);
++ if (result) {
++ hso_stop_serial_device(serial->parent);
++ atomic_dec(&serial->port.count);
++ kref_put(&serial->parent->ref, hso_serial_ref_free);
++ }
++ } else {
++ D1("Port was already open");
++ }
++
++ usb_autopm_put_interface(serial->parent->interface);
++
++ /* done */
++ if (result)
++ hso_serial_tiocmset(tty, TIOCM_RTS | TIOCM_DTR, 0);
++err_out:
++ mutex_unlock(&serial->parent->mutex);
++ return result;
++}
++
++/* close the requested serial port */
++static void hso_serial_close(struct tty_struct *tty, struct file *filp)
++{
++ struct hso_serial *serial = tty->driver_data;
++ u8 usb_gone;
++
++ D1("Closing serial port");
++
++ /* Open failed, no close cleanup required */
++ if (serial == NULL)
++ return;
++
++ mutex_lock(&serial->parent->mutex);
++ usb_gone = serial->parent->usb_gone;
++
++ if (!usb_gone)
++ usb_autopm_get_interface(serial->parent->interface);
++
++ /* reset the rts and dtr */
++ /* do the actual close */
++ atomic_dec(&serial->port.count);
++
++ if (atomic_read(&serial->port.count) <= 0) {
++ atomic_set(&serial->port.count, 0);
++ tty_port_tty_set(&serial->port, NULL);
++ if (!usb_gone)
++ hso_stop_serial_device(serial->parent);
++ tasklet_kill(&serial->unthrottle_tasklet);
++ }
++
++ if (!usb_gone)
++ usb_autopm_put_interface(serial->parent->interface);
++
++ mutex_unlock(&serial->parent->mutex);
++
++ kref_put(&serial->parent->ref, hso_serial_ref_free);
++}
++
++/* close the requested serial port */
++static int hso_serial_write(struct tty_struct *tty, const unsigned char *buf,
++ int count)
++{
++ struct hso_serial *serial = tty->driver_data;
++ int space, tx_bytes;
++ unsigned long flags;
++
++ /* sanity check */
++ if (serial == NULL) {
++ printk(KERN_ERR "%s: serial is NULL\n", __func__);
++ return -ENODEV;
++ }
++
++ spin_lock_irqsave(&serial->serial_lock, flags);
++
++ space = serial->tx_data_length - serial->tx_buffer_count;
++ tx_bytes = (count < space) ? count : space;
++
++ if (!tx_bytes)
++ goto out;
++
++ memcpy(serial->tx_buffer + serial->tx_buffer_count, buf, tx_bytes);
++ serial->tx_buffer_count += tx_bytes;
++
++out:
++ spin_unlock_irqrestore(&serial->serial_lock, flags);
++
++ hso_kick_transmit(serial);
++ /* done */
++ return tx_bytes;
++}
++
++/* how much room is there for writing */
++static int hso_serial_write_room(struct tty_struct *tty)
++{
++ struct hso_serial *serial = tty->driver_data;
++ int room;
++ unsigned long flags;
++
++ spin_lock_irqsave(&serial->serial_lock, flags);
++ room = serial->tx_data_length - serial->tx_buffer_count;
++ spin_unlock_irqrestore(&serial->serial_lock, flags);
++
++ /* return free room */
++ return room;
++}
++
++/* setup the term */
++static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
++{
++ struct hso_serial *serial = tty->driver_data;
++ unsigned long flags;
++
++ if (old)
++ D5("Termios called with: cflags new[%d] - old[%d]",
++ tty->termios.c_cflag, old->c_cflag);
++
++ /* the actual setup */
++ spin_lock_irqsave(&serial->serial_lock, flags);
++ if (atomic_read(&serial->port.count))
++ _hso_serial_set_termios(tty, old);
++ else
++ tty->termios = *old;
++ spin_unlock_irqrestore(&serial->serial_lock, flags);
++
++ /* done */
++}
++
++/* how many characters in the buffer */
++static int hso_serial_chars_in_buffer(struct tty_struct *tty)
++{
++ struct hso_serial *serial = tty->driver_data;
++ int chars;
++ unsigned long flags;
++
++ /* sanity check */
++ if (serial == NULL)
++ return 0;
++
++ spin_lock_irqsave(&serial->serial_lock, flags);
++ chars = serial->tx_buffer_count;
++ spin_unlock_irqrestore(&serial->serial_lock, flags);
++
++ return chars;
++}
++static int tiocmget_submit_urb(struct hso_serial *serial,
++ struct hso_tiocmget *tiocmget,
++ struct usb_device *usb)
++{
++ int result;
++
++ if (serial->parent->usb_gone)
++ return -ENODEV;
++ usb_fill_int_urb(tiocmget->urb, usb,
++ usb_rcvintpipe(usb,
++ tiocmget->endp->
++ bEndpointAddress & 0x7F),
++ &tiocmget->serial_state_notification,
++ sizeof(struct hso_serial_state_notification),
++ tiocmget_intr_callback, serial,
++ tiocmget->endp->bInterval);
++ result = usb_submit_urb(tiocmget->urb, GFP_ATOMIC);
++ if (result) {
++ dev_warn(&usb->dev, "%s usb_submit_urb failed %d\n", __func__,
++ result);
++ }
++ return result;
++
++}
++
++static void tiocmget_intr_callback(struct urb *urb)
++{
++ struct hso_serial *serial = urb->context;
++ struct hso_tiocmget *tiocmget;
++ int status = urb->status;
++ u16 UART_state_bitmap, prev_UART_state_bitmap;
++ struct uart_icount *icount;
++ struct hso_serial_state_notification *serial_state_notification;
++ struct usb_device *usb;
++ int if_num;
++
++ /* Sanity checks */
++ if (!serial)
++ return;
++ if (status) {
++ handle_usb_error(status, __func__, serial->parent);
++ return;
++ }
++
++ /* tiocmget is only supported on HSO_PORT_MODEM */
++ tiocmget = serial->tiocmget;
++ if (!tiocmget)
++ return;
++ BUG_ON((serial->parent->port_spec & HSO_PORT_MASK) != HSO_PORT_MODEM);
++
++ usb = serial->parent->usb;
++ if_num = serial->parent->interface->altsetting->desc.bInterfaceNumber;
++
++ /* wIndex should be the USB interface number of the port to which the
++ * notification applies, which should always be the Modem port.
++ */
++ serial_state_notification = &tiocmget->serial_state_notification;
++ if (serial_state_notification->bmRequestType != BM_REQUEST_TYPE ||
++ serial_state_notification->bNotification != B_NOTIFICATION ||
++ le16_to_cpu(serial_state_notification->wValue) != W_VALUE ||
++ le16_to_cpu(serial_state_notification->wIndex) != if_num ||
++ le16_to_cpu(serial_state_notification->wLength) != W_LENGTH) {
++ dev_warn(&usb->dev,
++ "hso received invalid serial state notification\n");
++ DUMP(serial_state_notification,
++ sizeof(struct hso_serial_state_notification));
++ } else {
++
++ UART_state_bitmap = le16_to_cpu(serial_state_notification->
++ UART_state_bitmap);
++ prev_UART_state_bitmap = tiocmget->prev_UART_state_bitmap;
++ icount = &tiocmget->icount;
++ spin_lock(&serial->serial_lock);
++ if ((UART_state_bitmap & B_OVERRUN) !=
++ (prev_UART_state_bitmap & B_OVERRUN))
++ icount->parity++;
++ if ((UART_state_bitmap & B_PARITY) !=
++ (prev_UART_state_bitmap & B_PARITY))
++ icount->parity++;
++ if ((UART_state_bitmap & B_FRAMING) !=
++ (prev_UART_state_bitmap & B_FRAMING))
++ icount->frame++;
++ if ((UART_state_bitmap & B_RING_SIGNAL) &&
++ !(prev_UART_state_bitmap & B_RING_SIGNAL))
++ icount->rng++;
++ if ((UART_state_bitmap & B_BREAK) !=
++ (prev_UART_state_bitmap & B_BREAK))
++ icount->brk++;
++ if ((UART_state_bitmap & B_TX_CARRIER) !=
++ (prev_UART_state_bitmap & B_TX_CARRIER))
++ icount->dsr++;
++ if ((UART_state_bitmap & B_RX_CARRIER) !=
++ (prev_UART_state_bitmap & B_RX_CARRIER))
++ icount->dcd++;
++ tiocmget->prev_UART_state_bitmap = UART_state_bitmap;
++ spin_unlock(&serial->serial_lock);
++ tiocmget->intr_completed = 1;
++ wake_up_interruptible(&tiocmget->waitq);
++ }
++ memset(serial_state_notification, 0,
++ sizeof(struct hso_serial_state_notification));
++ tiocmget_submit_urb(serial,
++ tiocmget,
++ serial->parent->usb);
++}
++
++/*
++ * next few functions largely stolen from drivers/serial/serial_core.c
++ */
++/* Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
++ * - mask passed in arg for lines of interest
++ * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking)
++ * Caller should use TIOCGICOUNT to see which one it was
++ */
++static int
++hso_wait_modem_status(struct hso_serial *serial, unsigned long arg)
++{
++ DECLARE_WAITQUEUE(wait, current);
++ struct uart_icount cprev, cnow;
++ struct hso_tiocmget *tiocmget;
++ int ret;
++
++ tiocmget = serial->tiocmget;
++ if (!tiocmget)
++ return -ENOENT;
++ /*
++ * note the counters on entry
++ */
++ spin_lock_irq(&serial->serial_lock);
++ memcpy(&cprev, &tiocmget->icount, sizeof(struct uart_icount));
++ spin_unlock_irq(&serial->serial_lock);
++ add_wait_queue(&tiocmget->waitq, &wait);
++ for (;;) {
++ spin_lock_irq(&serial->serial_lock);
++ memcpy(&cnow, &tiocmget->icount, sizeof(struct uart_icount));
++ spin_unlock_irq(&serial->serial_lock);
++ set_current_state(TASK_INTERRUPTIBLE);
++ if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
++ ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
++ ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd))) {
++ ret = 0;
++ break;
++ }
++ schedule();
++ /* see if a signal did it */
++ if (signal_pending(current)) {
++ ret = -ERESTARTSYS;
++ break;
++ }
++ cprev = cnow;
++ }
++ current->state = TASK_RUNNING;
++ remove_wait_queue(&tiocmget->waitq, &wait);
++
++ return ret;
++}
++
++/*
++ * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
++ * Return: write counters to the user passed counter struct
++ * NB: both 1->0 and 0->1 transitions are counted except for
++ * RI where only 0->1 is counted.
++ */
++static int hso_get_count(struct tty_struct *tty,
++ struct serial_icounter_struct *icount)
++{
++ struct uart_icount cnow;
++ struct hso_serial *serial = tty->driver_data;
++ struct hso_tiocmget *tiocmget = serial->tiocmget;
++
++ memset(icount, 0, sizeof(struct serial_icounter_struct));
++
++ if (!tiocmget)
++ return -ENOENT;
++ spin_lock_irq(&serial->serial_lock);
++ memcpy(&cnow, &tiocmget->icount, sizeof(struct uart_icount));
++ spin_unlock_irq(&serial->serial_lock);
++
++ icount->cts = cnow.cts;
++ icount->dsr = cnow.dsr;
++ icount->rng = cnow.rng;
++ icount->dcd = cnow.dcd;
++ icount->rx = cnow.rx;
++ icount->tx = cnow.tx;
++ icount->frame = cnow.frame;
++ icount->overrun = cnow.overrun;
++ icount->parity = cnow.parity;
++ icount->brk = cnow.brk;
++ icount->buf_overrun = cnow.buf_overrun;
++
++ return 0;
++}
++
++
++static int hso_serial_tiocmget(struct tty_struct *tty)
++{
++ int retval;
++ struct hso_serial *serial = tty->driver_data;
++ struct hso_tiocmget *tiocmget;
++ u16 UART_state_bitmap;
++
++ /* sanity check */
++ if (!serial) {
++ D1("no tty structures");
++ return -EINVAL;
++ }
++ spin_lock_irq(&serial->serial_lock);
++ retval = ((serial->rts_state) ? TIOCM_RTS : 0) |
++ ((serial->dtr_state) ? TIOCM_DTR : 0);
++ tiocmget = serial->tiocmget;
++ if (tiocmget) {
++
++ UART_state_bitmap = le16_to_cpu(
++ tiocmget->prev_UART_state_bitmap);
++ if (UART_state_bitmap & B_RING_SIGNAL)
++ retval |= TIOCM_RNG;
++ if (UART_state_bitmap & B_RX_CARRIER)
++ retval |= TIOCM_CD;
++ if (UART_state_bitmap & B_TX_CARRIER)
++ retval |= TIOCM_DSR;
++ }
++ spin_unlock_irq(&serial->serial_lock);
++ return retval;
++}
++
++static int hso_serial_tiocmset(struct tty_struct *tty,
++ unsigned int set, unsigned int clear)
++{
++ int val = 0;
++ unsigned long flags;
++ int if_num;
++ struct hso_serial *serial = tty->driver_data;
++
++ /* sanity check */
++ if (!serial) {
++ D1("no tty structures");
++ return -EINVAL;
++ }
++
++ if ((serial->parent->port_spec & HSO_PORT_MASK) != HSO_PORT_MODEM)
++ return -EINVAL;
++
++ if_num = serial->parent->interface->altsetting->desc.bInterfaceNumber;
++
++ spin_lock_irqsave(&serial->serial_lock, flags);
++ if (set & TIOCM_RTS)
++ serial->rts_state = 1;
++ if (set & TIOCM_DTR)
++ serial->dtr_state = 1;
++
++ if (clear & TIOCM_RTS)
++ serial->rts_state = 0;
++ if (clear & TIOCM_DTR)
++ serial->dtr_state = 0;
++
++ if (serial->dtr_state)
++ val |= 0x01;
++ if (serial->rts_state)
++ val |= 0x02;
++
++ spin_unlock_irqrestore(&serial->serial_lock, flags);
++
++ return usb_control_msg(serial->parent->usb,
++ usb_rcvctrlpipe(serial->parent->usb, 0), 0x22,
++ 0x21, val, if_num, NULL, 0,
++ USB_CTRL_SET_TIMEOUT);
++}
++
++static int hso_serial_ioctl(struct tty_struct *tty,
++ unsigned int cmd, unsigned long arg)
++{
++ struct hso_serial *serial = tty->driver_data;
++ int ret = 0;
++ D4("IOCTL cmd: %d, arg: %ld", cmd, arg);
++
++ if (!serial)
++ return -ENODEV;
++ switch (cmd) {
++ case TIOCMIWAIT:
++ ret = hso_wait_modem_status(serial, arg);
++ break;
++ default:
++ ret = -ENOIOCTLCMD;
++ break;
++ }
++ return ret;
++}
++
++
++/* starts a transmit */
++static void hso_kick_transmit(struct hso_serial *serial)
++{
++ u8 *temp;
++ unsigned long flags;
++ int res;
++
++ spin_lock_irqsave(&serial->serial_lock, flags);
++ if (!serial->tx_buffer_count)
++ goto out;
++
++ if (serial->tx_urb_used)
++ goto out;
++
++ /* Wakeup USB interface if necessary */
++ if (hso_get_activity(serial->parent) == -EAGAIN)
++ goto out;
++
++ /* Switch pointers around to avoid memcpy */
++ temp = serial->tx_buffer;
++ serial->tx_buffer = serial->tx_data;
++ serial->tx_data = temp;
++ serial->tx_data_count = serial->tx_buffer_count;
++ serial->tx_buffer_count = 0;
++
++ /* If temp is set, it means we switched buffers */
++ if (temp && serial->write_data) {
++ res = serial->write_data(serial);
++ if (res >= 0)
++ serial->tx_urb_used = 1;
++ }
++out:
++ spin_unlock_irqrestore(&serial->serial_lock, flags);
++}
++
++/* make a request (for reading and writing data to muxed serial port) */
++static int mux_device_request(struct hso_serial *serial, u8 type, u16 port,
++ struct urb *ctrl_urb,
++ struct usb_ctrlrequest *ctrl_req,
++ u8 *ctrl_urb_data, u32 size)
++{
++ int result;
++ int pipe;
++
++ /* Sanity check */
++ if (!serial || !ctrl_urb || !ctrl_req) {
++ printk(KERN_ERR "%s: Wrong arguments\n", __func__);
++ return -EINVAL;
++ }
++
++ /* initialize */
++ ctrl_req->wValue = 0;
++ ctrl_req->wIndex = cpu_to_le16(hso_port_to_mux(port));
++ ctrl_req->wLength = cpu_to_le16(size);
++
++ if (type == USB_CDC_GET_ENCAPSULATED_RESPONSE) {
++ /* Reading command */
++ ctrl_req->bRequestType = USB_DIR_IN |
++ USB_TYPE_OPTION_VENDOR |
++ USB_RECIP_INTERFACE;
++ ctrl_req->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
++ pipe = usb_rcvctrlpipe(serial->parent->usb, 0);
++ } else {
++ /* Writing command */
++ ctrl_req->bRequestType = USB_DIR_OUT |
++ USB_TYPE_OPTION_VENDOR |
++ USB_RECIP_INTERFACE;
++ ctrl_req->bRequest = USB_CDC_SEND_ENCAPSULATED_COMMAND;
++ pipe = usb_sndctrlpipe(serial->parent->usb, 0);
++ }
++ /* syslog */
++ D2("%s command (%02x) len: %d, port: %d",
++ type == USB_CDC_GET_ENCAPSULATED_RESPONSE ? "Read" : "Write",
++ ctrl_req->bRequestType, ctrl_req->wLength, port);
++
++ /* Load ctrl urb */
++ ctrl_urb->transfer_flags = 0;
++ usb_fill_control_urb(ctrl_urb,
++ serial->parent->usb,
++ pipe,
++ (u8 *) ctrl_req,
++ ctrl_urb_data, size, ctrl_callback, serial);
++ /* Send it on merry way */
++ result = usb_submit_urb(ctrl_urb, GFP_ATOMIC);
++ if (result) {
++ dev_err(&ctrl_urb->dev->dev,
++ "%s failed submit ctrl_urb %d type %d\n", __func__,
++ result, type);
++ return result;
++ }
++
++ /* done */
++ return size;
++}
++
++/* called by intr_callback when read occurs */
++static int hso_mux_serial_read(struct hso_serial *serial)
++{
++ if (!serial)
++ return -EINVAL;
++
++ /* clean data */
++ memset(serial->rx_data[0], 0, CTRL_URB_RX_SIZE);
++ /* make the request */
++
++ if (serial->num_rx_urbs != 1) {
++ dev_err(&serial->parent->interface->dev,
++ "ERROR: mux'd reads with multiple buffers "
++ "not possible\n");
++ return 0;
++ }
++ return mux_device_request(serial,
++ USB_CDC_GET_ENCAPSULATED_RESPONSE,
++ serial->parent->port_spec & HSO_PORT_MASK,
++ serial->rx_urb[0],
++ &serial->ctrl_req_rx,
++ serial->rx_data[0], serial->rx_data_length);
++}
++
++/* used for muxed serial port callback (muxed serial read) */
++static void intr_callback(struct urb *urb)
++{
++ struct hso_shared_int *shared_int = urb->context;
++ struct hso_serial *serial;
++ unsigned char *port_req;
++ int status = urb->status;
++ int i;
++
++ usb_mark_last_busy(urb->dev);
++
++ /* sanity check */
++ if (!shared_int)
++ return;
++
++ /* status check */
++ if (status) {
++ handle_usb_error(status, __func__, NULL);
++ return;
++ }
++ D4("\n--- Got intr callback 0x%02X ---", status);
++
++ /* what request? */
++ port_req = urb->transfer_buffer;
++ D4(" port_req = 0x%.2X\n", *port_req);
++ /* loop over all muxed ports to find the one sending this */
++ for (i = 0; i < 8; i++) {
++ /* max 8 channels on MUX */
++ if (*port_req & (1 << i)) {
++ serial = get_serial_by_shared_int_and_type(shared_int,
++ (1 << i));
++ if (serial != NULL) {
++ D1("Pending read interrupt on port %d\n", i);
++ spin_lock(&serial->serial_lock);
++ if (serial->rx_state == RX_IDLE &&
++ atomic_read(&serial->port.count) > 0) {
++ /* Setup and send a ctrl req read on
++ * port i */
++ if (!serial->rx_urb_filled[0]) {
++ serial->rx_state = RX_SENT;
++ hso_mux_serial_read(serial);
++ } else
++ serial->rx_state = RX_PENDING;
++ } else {
++ D1("Already a read pending on "
++ "port %d or port not open\n", i);
++ }
++ spin_unlock(&serial->serial_lock);
++ }
++ }
++ }
++ /* Resubmit interrupt urb */
++ hso_mux_submit_intr_urb(shared_int, urb->dev, GFP_ATOMIC);
++}
++
++/* called for writing to muxed serial port */
++static int hso_mux_serial_write_data(struct hso_serial *serial)
++{
++ if (NULL == serial)
++ return -EINVAL;
++
++ return mux_device_request(serial,
++ USB_CDC_SEND_ENCAPSULATED_COMMAND,
++ serial->parent->port_spec & HSO_PORT_MASK,
++ serial->tx_urb,
++ &serial->ctrl_req_tx,
++ serial->tx_data, serial->tx_data_count);
++}
++
++/* write callback for Diag and CS port */
++static void hso_std_serial_write_bulk_callback(struct urb *urb)
++{
++ struct hso_serial *serial = urb->context;
++ int status = urb->status;
++
++ /* sanity check */
++ if (!serial) {
++ D1("serial == NULL");
++ return;
++ }
++
++ spin_lock(&serial->serial_lock);
++ serial->tx_urb_used = 0;
++ spin_unlock(&serial->serial_lock);
++ if (status) {
++ handle_usb_error(status, __func__, serial->parent);
++ return;
++ }
++ hso_put_activity(serial->parent);
++ tty_port_tty_wakeup(&serial->port);
++ hso_kick_transmit(serial);
++
++ D1(" ");
++}
++
++/* called for writing diag or CS serial port */
++static int hso_std_serial_write_data(struct hso_serial *serial)
++{
++ int count = serial->tx_data_count;
++ int result;
++
++ usb_fill_bulk_urb(serial->tx_urb,
++ serial->parent->usb,
++ usb_sndbulkpipe(serial->parent->usb,
++ serial->out_endp->
++ bEndpointAddress & 0x7F),
++ serial->tx_data, serial->tx_data_count,
++ hso_std_serial_write_bulk_callback, serial);
++
++ result = usb_submit_urb(serial->tx_urb, GFP_ATOMIC);
++ if (result) {
++ dev_warn(&serial->parent->usb->dev,
++ "Failed to submit urb - res %d\n", result);
++ return result;
++ }
++
++ return count;
++}
++
++/* callback after read or write on muxed serial port */
++static void ctrl_callback(struct urb *urb)
++{
++ struct hso_serial *serial = urb->context;
++ struct usb_ctrlrequest *req;
++ int status = urb->status;
++
++ /* sanity check */
++ if (!serial)
++ return;
++
++ spin_lock(&serial->serial_lock);
++ serial->tx_urb_used = 0;
++ spin_unlock(&serial->serial_lock);
++ if (status) {
++ handle_usb_error(status, __func__, serial->parent);
++ return;
++ }
++
++ /* what request? */
++ req = (struct usb_ctrlrequest *)(urb->setup_packet);
++ D4("\n--- Got muxed ctrl callback 0x%02X ---", status);
++ D4("Actual length of urb = %d\n", urb->actual_length);
++ DUMP1(urb->transfer_buffer, urb->actual_length);
++
++ if (req->bRequestType ==
++ (USB_DIR_IN | USB_TYPE_OPTION_VENDOR | USB_RECIP_INTERFACE)) {
++ /* response to a read command */
++ serial->rx_urb_filled[0] = 1;
++ spin_lock(&serial->serial_lock);
++ put_rxbuf_data_and_resubmit_ctrl_urb(serial);
++ spin_unlock(&serial->serial_lock);
++ } else {
++ hso_put_activity(serial->parent);
++ tty_port_tty_wakeup(&serial->port);
++ /* response to a write command */
++ hso_kick_transmit(serial);
++ }
++}
++
++/* handle RX data for serial port */
++static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial)
++{
++ struct tty_struct *tty;
++ int count;
++
++ /* Sanity check */
++ if (urb == NULL || serial == NULL) {
++ D1("serial = NULL");
++ return -2;
++ }
++
++ tty = tty_port_tty_get(&serial->port);
++
++ if (tty && test_bit(TTY_THROTTLED, &tty->flags)) {
++ tty_kref_put(tty);
++ return -1;
++ }
++
++ /* Push data to tty */
++ D1("data to push to tty");
++ count = tty_buffer_request_room(&serial->port, urb->actual_length);
++ if (count >= urb->actual_length) {
++ tty_insert_flip_string(&serial->port, urb->transfer_buffer,
++ urb->actual_length);
++ tty_flip_buffer_push(&serial->port);
++ } else {
++ dev_warn(&serial->parent->usb->dev,
++ "dropping data, %d bytes lost\n", urb->actual_length);
++ }
++
++ tty_kref_put(tty);
++
++ serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 0;
++
++ return 0;
++}
++
++
++/* Base driver functions */
++
++static void hso_log_port(struct hso_device *hso_dev)
++{
++ char *port_type;
++ char port_dev[20];
++
++ switch (hso_dev->port_spec & HSO_PORT_MASK) {
++ case HSO_PORT_CONTROL:
++ port_type = "Control";
++ break;
++ case HSO_PORT_APP:
++ port_type = "Application";
++ break;
++ case HSO_PORT_GPS:
++ port_type = "GPS";
++ break;
++ case HSO_PORT_GPS_CONTROL:
++ port_type = "GPS control";
++ break;
++ case HSO_PORT_APP2:
++ port_type = "Application2";
++ break;
++ case HSO_PORT_PCSC:
++ port_type = "PCSC";
++ break;
++ case HSO_PORT_DIAG:
++ port_type = "Diagnostic";
++ break;
++ case HSO_PORT_DIAG2:
++ port_type = "Diagnostic2";
++ break;
++ case HSO_PORT_MODEM:
++ port_type = "Modem";
++ break;
++ case HSO_PORT_NETWORK:
++ port_type = "Network";
++ break;
++ default:
++ port_type = "Unknown";
++ break;
++ }
++ if ((hso_dev->port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) {
++ sprintf(port_dev, "%s", dev2net(hso_dev)->net->name);
++ } else
++ sprintf(port_dev, "/dev/%s%d", tty_filename,
++ dev2ser(hso_dev)->minor);
++
++ dev_dbg(&hso_dev->interface->dev, "HSO: Found %s port %s\n",
++ port_type, port_dev);
++}
++
++static int hso_start_net_device(struct hso_device *hso_dev)
++{
++ int i, result = 0;
++ struct hso_net *hso_net = dev2net(hso_dev);
++
++ if (!hso_net)
++ return -ENODEV;
++
++ /* send URBs for all read buffers */
++ for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
++
++ /* Prep a receive URB */
++ usb_fill_bulk_urb(hso_net->mux_bulk_rx_urb_pool[i],
++ hso_dev->usb,
++ usb_rcvbulkpipe(hso_dev->usb,
++ hso_net->in_endp->
++ bEndpointAddress & 0x7F),
++ hso_net->mux_bulk_rx_buf_pool[i],
++ MUX_BULK_RX_BUF_SIZE, read_bulk_callback,
++ hso_net);
++
++ /* Put it out there so the device can send us stuff */
++ result = usb_submit_urb(hso_net->mux_bulk_rx_urb_pool[i],
++ GFP_NOIO);
++ if (result)
++ dev_warn(&hso_dev->usb->dev,
++ "%s failed mux_bulk_rx_urb[%d] %d\n", __func__,
++ i, result);
++ }
++
++ return result;
++}
++
++static int hso_stop_net_device(struct hso_device *hso_dev)
++{
++ int i;
++ struct hso_net *hso_net = dev2net(hso_dev);
++
++ if (!hso_net)
++ return -ENODEV;
++
++ for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
++ if (hso_net->mux_bulk_rx_urb_pool[i])
++ usb_kill_urb(hso_net->mux_bulk_rx_urb_pool[i]);
++
++ }
++ if (hso_net->mux_bulk_tx_urb)
++ usb_kill_urb(hso_net->mux_bulk_tx_urb);
++
++ return 0;
++}
++
++static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags)
++{
++ int i, result = 0;
++ struct hso_serial *serial = dev2ser(hso_dev);
++
++ if (!serial)
++ return -ENODEV;
++
++ /* If it is not the MUX port fill in and submit a bulk urb (already
++ * allocated in hso_serial_start) */
++ if (!(serial->parent->port_spec & HSO_INTF_MUX)) {
++ for (i = 0; i < serial->num_rx_urbs; i++) {
++ usb_fill_bulk_urb(serial->rx_urb[i],
++ serial->parent->usb,
++ usb_rcvbulkpipe(serial->parent->usb,
++ serial->in_endp->
++ bEndpointAddress &
++ 0x7F),
++ serial->rx_data[i],
++ serial->rx_data_length,
++ hso_std_serial_read_bulk_callback,
++ serial);
++ result = usb_submit_urb(serial->rx_urb[i], flags);
++ if (result) {
++ dev_warn(&serial->parent->usb->dev,
++ "Failed to submit urb - res %d\n",
++ result);
++ break;
++ }
++ }
++ } else {
++ mutex_lock(&serial->shared_int->shared_int_lock);
++ if (!serial->shared_int->use_count) {
++ result =
++ hso_mux_submit_intr_urb(serial->shared_int,
++ hso_dev->usb, flags);
++ }
++ serial->shared_int->use_count++;
++ mutex_unlock(&serial->shared_int->shared_int_lock);
++ }
++ if (serial->tiocmget)
++ tiocmget_submit_urb(serial,
++ serial->tiocmget,
++ serial->parent->usb);
++ return result;
++}
++
++static int hso_stop_serial_device(struct hso_device *hso_dev)
++{
++ int i;
++ struct hso_serial *serial = dev2ser(hso_dev);
++ struct hso_tiocmget *tiocmget;
++
++ if (!serial)
++ return -ENODEV;
++
++ for (i = 0; i < serial->num_rx_urbs; i++) {
++ if (serial->rx_urb[i]) {
++ usb_kill_urb(serial->rx_urb[i]);
++ serial->rx_urb_filled[i] = 0;
++ }
++ }
++ serial->curr_rx_urb_idx = 0;
++
++ if (serial->tx_urb)
++ usb_kill_urb(serial->tx_urb);
++
++ if (serial->shared_int) {
++ mutex_lock(&serial->shared_int->shared_int_lock);
++ if (serial->shared_int->use_count &&
++ (--serial->shared_int->use_count == 0)) {
++ struct urb *urb;
++
++ urb = serial->shared_int->shared_intr_urb;
++ if (urb)
++ usb_kill_urb(urb);
++ }
++ mutex_unlock(&serial->shared_int->shared_int_lock);
++ }
++ tiocmget = serial->tiocmget;
++ if (tiocmget) {
++ wake_up_interruptible(&tiocmget->waitq);
++ usb_kill_urb(tiocmget->urb);
++ }
++
++ return 0;
++}
++
++static void hso_serial_common_free(struct hso_serial *serial)
++{
++ int i;
++
++ if (serial->parent->dev)
++ device_remove_file(serial->parent->dev, &dev_attr_hsotype);
++
++ tty_unregister_device(tty_drv, serial->minor);
++
++ for (i = 0; i < serial->num_rx_urbs; i++) {
++ /* unlink and free RX URB */
++ usb_free_urb(serial->rx_urb[i]);
++ /* free the RX buffer */
++ kfree(serial->rx_data[i]);
++ }
++
++ /* unlink and free TX URB */
++ usb_free_urb(serial->tx_urb);
++ kfree(serial->tx_data);
++ tty_port_destroy(&serial->port);
++}
++
++static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
++ int rx_size, int tx_size)
++{
++ struct device *dev;
++ int minor;
++ int i;
++
++ tty_port_init(&serial->port);
++
++ minor = get_free_serial_index();
++ if (minor < 0)
++ goto exit;
++
++ /* register our minor number */
++ serial->parent->dev = tty_port_register_device(&serial->port, tty_drv,
++ minor, &serial->parent->interface->dev);
++ dev = serial->parent->dev;
++ dev_set_drvdata(dev, serial->parent);
++ i = device_create_file(dev, &dev_attr_hsotype);
++
++ /* fill in specific data for later use */
++ serial->minor = minor;
++ serial->magic = HSO_SERIAL_MAGIC;
++ spin_lock_init(&serial->serial_lock);
++ serial->num_rx_urbs = num_urbs;
++
++ /* RX, allocate urb and initialize */
++
++ /* prepare our RX buffer */
++ serial->rx_data_length = rx_size;
++ for (i = 0; i < serial->num_rx_urbs; i++) {
++ serial->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
++ if (!serial->rx_urb[i]) {
++ dev_err(dev, "Could not allocate urb?\n");
++ goto exit;
++ }
++ serial->rx_urb[i]->transfer_buffer = NULL;
++ serial->rx_urb[i]->transfer_buffer_length = 0;
++ serial->rx_data[i] = kzalloc(serial->rx_data_length,
++ GFP_KERNEL);
++ if (!serial->rx_data[i])
++ goto exit;
++ }
++
++ /* TX, allocate urb and initialize */
++ serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!serial->tx_urb) {
++ dev_err(dev, "Could not allocate urb?\n");
++ goto exit;
++ }
++ serial->tx_urb->transfer_buffer = NULL;
++ serial->tx_urb->transfer_buffer_length = 0;
++ /* prepare our TX buffer */
++ serial->tx_data_count = 0;
++ serial->tx_buffer_count = 0;
++ serial->tx_data_length = tx_size;
++ serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL);
++ if (!serial->tx_data)
++ goto exit;
++
++ serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL);
++ if (!serial->tx_buffer)
++ goto exit;
++
++ return 0;
++exit:
++ hso_serial_common_free(serial);
++ return -1;
++}
++
++/* Creates a general hso device */
++static struct hso_device *hso_create_device(struct usb_interface *intf,
++ int port_spec)
++{
++ struct hso_device *hso_dev;
++
++ hso_dev = kzalloc(sizeof(*hso_dev), GFP_ATOMIC);
++ if (!hso_dev)
++ return NULL;
++
++ hso_dev->port_spec = port_spec;
++ hso_dev->usb = interface_to_usbdev(intf);
++ hso_dev->interface = intf;
++ kref_init(&hso_dev->ref);
++ mutex_init(&hso_dev->mutex);
++
++ INIT_WORK(&hso_dev->async_get_intf, async_get_intf);
++ INIT_WORK(&hso_dev->async_put_intf, async_put_intf);
++ INIT_WORK(&hso_dev->reset_device, reset_device);
++
++ return hso_dev;
++}
++
++/* Removes a network device in the network device table */
++static int remove_net_device(struct hso_device *hso_dev)
++{
++ int i;
++
++ for (i = 0; i < HSO_MAX_NET_DEVICES; i++) {
++ if (network_table[i] == hso_dev) {
++ network_table[i] = NULL;
++ break;
++ }
++ }
++ if (i == HSO_MAX_NET_DEVICES)
++ return -1;
++ return 0;
++}
++
++/* Frees our network device */
++static void hso_free_net_device(struct hso_device *hso_dev)
++{
++ int i;
++ struct hso_net *hso_net = dev2net(hso_dev);
++
++ if (!hso_net)
++ return;
++
++ remove_net_device(hso_net->parent);
++
++ if (hso_net->net)
++ unregister_netdev(hso_net->net);
++
++ /* start freeing */
++ for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
++ usb_free_urb(hso_net->mux_bulk_rx_urb_pool[i]);
++ kfree(hso_net->mux_bulk_rx_buf_pool[i]);
++ hso_net->mux_bulk_rx_buf_pool[i] = NULL;
++ }
++ usb_free_urb(hso_net->mux_bulk_tx_urb);
++ kfree(hso_net->mux_bulk_tx_buf);
++ hso_net->mux_bulk_tx_buf = NULL;
++
++ if (hso_net->net)
++ free_netdev(hso_net->net);
++
++ kfree(hso_dev);
++}
++
++static const struct net_device_ops hso_netdev_ops = {
++ .ndo_open = hso_net_open,
++ .ndo_stop = hso_net_close,
++ .ndo_start_xmit = hso_net_start_xmit,
++ .ndo_tx_timeout = hso_net_tx_timeout,
++};
++
++/* initialize the network interface */
++static void hso_net_init(struct net_device *net)
++{
++ struct hso_net *hso_net = netdev_priv(net);
++
++ D1("sizeof hso_net is %d", (int)sizeof(*hso_net));
++
++ /* fill in the other fields */
++ net->netdev_ops = &hso_netdev_ops;
++ net->watchdog_timeo = HSO_NET_TX_TIMEOUT;
++ net->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
++ net->type = ARPHRD_NONE;
++ net->mtu = DEFAULT_MTU - 14;
++ net->tx_queue_len = 10;
++ net->ethtool_ops = &ops;
++
++ /* and initialize the semaphore */
++ spin_lock_init(&hso_net->net_lock);
++}
++
++/* Adds a network device in the network device table */
++static int add_net_device(struct hso_device *hso_dev)
++{
++ int i;
++
++ for (i = 0; i < HSO_MAX_NET_DEVICES; i++) {
++ if (network_table[i] == NULL) {
++ network_table[i] = hso_dev;
++ break;
++ }
++ }
++ if (i == HSO_MAX_NET_DEVICES)
++ return -1;
++ return 0;
++}
++
++static int hso_rfkill_set_block(void *data, bool blocked)
++{
++ struct hso_device *hso_dev = data;
++ int enabled = !blocked;
++ int rv;
++
++ mutex_lock(&hso_dev->mutex);
++ if (hso_dev->usb_gone)
++ rv = 0;
++ else
++ rv = usb_control_msg(hso_dev->usb, usb_rcvctrlpipe(hso_dev->usb, 0),
++ enabled ? 0x82 : 0x81, 0x40, 0, 0, NULL, 0,
++ USB_CTRL_SET_TIMEOUT);
++ mutex_unlock(&hso_dev->mutex);
++ return rv;
++}
++
++static const struct rfkill_ops hso_rfkill_ops = {
++ .set_block = hso_rfkill_set_block,
++};
++
++/* Creates and sets up everything for rfkill */
++static void hso_create_rfkill(struct hso_device *hso_dev,
++ struct usb_interface *interface)
++{
++ struct hso_net *hso_net = dev2net(hso_dev);
++ struct device *dev = &hso_net->net->dev;
++ char *rfkn;
++
++ rfkn = kzalloc(20, GFP_KERNEL);
++ if (!rfkn)
++ dev_err(dev, "%s - Out of memory\n", __func__);
++
++ snprintf(rfkn, 20, "hso-%d",
++ interface->altsetting->desc.bInterfaceNumber);
++
++ hso_net->rfkill = rfkill_alloc(rfkn,
++ &interface_to_usbdev(interface)->dev,
++ RFKILL_TYPE_WWAN,
++ &hso_rfkill_ops, hso_dev);
++ if (!hso_net->rfkill) {
++ dev_err(dev, "%s - Out of memory\n", __func__);
++ kfree(rfkn);
++ return;
++ }
++ if (rfkill_register(hso_net->rfkill) < 0) {
++ rfkill_destroy(hso_net->rfkill);
++ kfree(rfkn);
++ hso_net->rfkill = NULL;
++ dev_err(dev, "%s - Failed to register rfkill\n", __func__);
++ return;
++ }
++}
++
++static struct device_type hso_type = {
++ .name = "wwan",
++};
++
++/* Creates our network device */
++static struct hso_device *hso_create_net_device(struct usb_interface *interface,
++ int port_spec)
++{
++ int result, i;
++ struct net_device *net;
++ struct hso_net *hso_net;
++ struct hso_device *hso_dev;
++
++ hso_dev = hso_create_device(interface, port_spec);
++ if (!hso_dev)
++ return NULL;
++
++ /* allocate our network device, then we can put in our private data */
++ /* call hso_net_init to do the basic initialization */
++ net = alloc_netdev(sizeof(struct hso_net), "hso%d", NET_NAME_UNKNOWN,
++ hso_net_init);
++ if (!net) {
++ dev_err(&interface->dev, "Unable to create ethernet device\n");
++ goto exit;
++ }
++
++ hso_net = netdev_priv(net);
++
++ hso_dev->port_data.dev_net = hso_net;
++ hso_net->net = net;
++ hso_net->parent = hso_dev;
++
++ hso_net->in_endp = hso_get_ep(interface, USB_ENDPOINT_XFER_BULK,
++ USB_DIR_IN);
++ if (!hso_net->in_endp) {
++ dev_err(&interface->dev, "Can't find BULK IN endpoint\n");
++ goto exit;
++ }
++ hso_net->out_endp = hso_get_ep(interface, USB_ENDPOINT_XFER_BULK,
++ USB_DIR_OUT);
++ if (!hso_net->out_endp) {
++ dev_err(&interface->dev, "Can't find BULK OUT endpoint\n");
++ goto exit;
++ }
++ SET_NETDEV_DEV(net, &interface->dev);
++ SET_NETDEV_DEVTYPE(net, &hso_type);
++
++ /* registering our net device */
++ result = register_netdev(net);
++ if (result) {
++ dev_err(&interface->dev, "Failed to register device\n");
++ goto exit;
++ }
++
++ /* start allocating */
++ for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
++ hso_net->mux_bulk_rx_urb_pool[i] = usb_alloc_urb(0, GFP_KERNEL);
++ if (!hso_net->mux_bulk_rx_urb_pool[i]) {
++ dev_err(&interface->dev, "Could not allocate rx urb\n");
++ goto exit;
++ }
++ hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE,
++ GFP_KERNEL);
++ if (!hso_net->mux_bulk_rx_buf_pool[i])
++ goto exit;
++ }
++ hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!hso_net->mux_bulk_tx_urb) {
++ dev_err(&interface->dev, "Could not allocate tx urb\n");
++ goto exit;
++ }
++ hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL);
++ if (!hso_net->mux_bulk_tx_buf)
++ goto exit;
++
++ add_net_device(hso_dev);
++
++ hso_log_port(hso_dev);
++
++ hso_create_rfkill(hso_dev, interface);
++
++ return hso_dev;
++exit:
++ hso_free_net_device(hso_dev);
++ return NULL;
++}
++
++static void hso_free_tiomget(struct hso_serial *serial)
++{
++ struct hso_tiocmget *tiocmget;
++ if (!serial)
++ return;
++ tiocmget = serial->tiocmget;
++ if (tiocmget) {
++ usb_free_urb(tiocmget->urb);
++ tiocmget->urb = NULL;
++ serial->tiocmget = NULL;
++ kfree(tiocmget);
++ }
++}
++
++/* Frees an AT channel ( goes for both mux and non-mux ) */
++static void hso_free_serial_device(struct hso_device *hso_dev)
++{
++ struct hso_serial *serial = dev2ser(hso_dev);
++
++ if (!serial)
++ return;
++ set_serial_by_index(serial->minor, NULL);
++
++ hso_serial_common_free(serial);
++
++ if (serial->shared_int) {
++ mutex_lock(&serial->shared_int->shared_int_lock);
++ if (--serial->shared_int->ref_count == 0)
++ hso_free_shared_int(serial->shared_int);
++ else
++ mutex_unlock(&serial->shared_int->shared_int_lock);
++ }
++ hso_free_tiomget(serial);
++ kfree(serial);
++ kfree(hso_dev);
++}
++
++/* Creates a bulk AT channel */
++static struct hso_device *hso_create_bulk_serial_device(
++ struct usb_interface *interface, int port)
++{
++ struct hso_device *hso_dev;
++ struct hso_serial *serial;
++ int num_urbs;
++ struct hso_tiocmget *tiocmget;
++
++ hso_dev = hso_create_device(interface, port);
++ if (!hso_dev)
++ return NULL;
++
++ serial = kzalloc(sizeof(*serial), GFP_KERNEL);
++ if (!serial)
++ goto exit;
++
++ serial->parent = hso_dev;
++ hso_dev->port_data.dev_serial = serial;
++
++ if ((port & HSO_PORT_MASK) == HSO_PORT_MODEM) {
++ num_urbs = 2;
++ serial->tiocmget = kzalloc(sizeof(struct hso_tiocmget),
++ GFP_KERNEL);
++ /* it isn't going to break our heart if serial->tiocmget
++ * allocation fails don't bother checking this.
++ */
++ if (serial->tiocmget) {
++ tiocmget = serial->tiocmget;
++ tiocmget->urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (tiocmget->urb) {
++ mutex_init(&tiocmget->mutex);
++ init_waitqueue_head(&tiocmget->waitq);
++ tiocmget->endp = hso_get_ep(
++ interface,
++ USB_ENDPOINT_XFER_INT,
++ USB_DIR_IN);
++ } else
++ hso_free_tiomget(serial);
++ }
++ }
++ else
++ num_urbs = 1;
++
++ if (hso_serial_common_create(serial, num_urbs, BULK_URB_RX_SIZE,
++ BULK_URB_TX_SIZE))
++ goto exit;
++
++ serial->in_endp = hso_get_ep(interface, USB_ENDPOINT_XFER_BULK,
++ USB_DIR_IN);
++ if (!serial->in_endp) {
++ dev_err(&interface->dev, "Failed to find BULK IN ep\n");
++ goto exit2;
++ }
++
++ if (!
++ (serial->out_endp =
++ hso_get_ep(interface, USB_ENDPOINT_XFER_BULK, USB_DIR_OUT))) {
++ dev_err(&interface->dev, "Failed to find BULK IN ep\n");
++ goto exit2;
++ }
++
++ serial->write_data = hso_std_serial_write_data;
++
++ /* and record this serial */
++ set_serial_by_index(serial->minor, serial);
++
++ /* setup the proc dirs and files if needed */
++ hso_log_port(hso_dev);
++
++ /* done, return it */
++ return hso_dev;
++
++exit2:
++ hso_serial_common_free(serial);
++exit:
++ hso_free_tiomget(serial);
++ kfree(serial);
++ kfree(hso_dev);
++ return NULL;
++}
++
++/* Creates a multiplexed AT channel */
++static
++struct hso_device *hso_create_mux_serial_device(struct usb_interface *interface,
++ int port,
++ struct hso_shared_int *mux)
++{
++ struct hso_device *hso_dev;
++ struct hso_serial *serial;
++ int port_spec;
++
++ port_spec = HSO_INTF_MUX;
++ port_spec &= ~HSO_PORT_MASK;
++
++ port_spec |= hso_mux_to_port(port);
++ if ((port_spec & HSO_PORT_MASK) == HSO_PORT_NO_PORT)
++ return NULL;
++
++ hso_dev = hso_create_device(interface, port_spec);
++ if (!hso_dev)
++ return NULL;
++
++ serial = kzalloc(sizeof(*serial), GFP_KERNEL);
++ if (!serial)
++ goto exit;
++
++ hso_dev->port_data.dev_serial = serial;
++ serial->parent = hso_dev;
++
++ if (hso_serial_common_create
++ (serial, 1, CTRL_URB_RX_SIZE, CTRL_URB_TX_SIZE))
++ goto exit;
++
++ serial->tx_data_length--;
++ serial->write_data = hso_mux_serial_write_data;
++
++ serial->shared_int = mux;
++ mutex_lock(&serial->shared_int->shared_int_lock);
++ serial->shared_int->ref_count++;
++ mutex_unlock(&serial->shared_int->shared_int_lock);
++
++ /* and record this serial */
++ set_serial_by_index(serial->minor, serial);
++
++ /* setup the proc dirs and files if needed */
++ hso_log_port(hso_dev);
++
++ /* done, return it */
++ return hso_dev;
++
++exit:
++ if (serial) {
++ tty_unregister_device(tty_drv, serial->minor);
++ kfree(serial);
++ }
++ if (hso_dev)
++ kfree(hso_dev);
++ return NULL;
++
++}
++
++static void hso_free_shared_int(struct hso_shared_int *mux)
++{
++ usb_free_urb(mux->shared_intr_urb);
++ kfree(mux->shared_intr_buf);
++ mutex_unlock(&mux->shared_int_lock);
++ kfree(mux);
++}
++
++static
++struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface)
++{
++ struct hso_shared_int *mux = kzalloc(sizeof(*mux), GFP_KERNEL);
++
++ if (!mux)
++ return NULL;
++
++ mux->intr_endp = hso_get_ep(interface, USB_ENDPOINT_XFER_INT,
++ USB_DIR_IN);
++ if (!mux->intr_endp) {
++ dev_err(&interface->dev, "Can't find INT IN endpoint\n");
++ goto exit;
++ }
++
++ mux->shared_intr_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!mux->shared_intr_urb) {
++ dev_err(&interface->dev, "Could not allocate intr urb?\n");
++ goto exit;
++ }
++ mux->shared_intr_buf =
++ kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize),
++ GFP_KERNEL);
++ if (!mux->shared_intr_buf)
++ goto exit;
++
++ mutex_init(&mux->shared_int_lock);
++
++ return mux;
++
++exit:
++ kfree(mux->shared_intr_buf);
++ usb_free_urb(mux->shared_intr_urb);
++ kfree(mux);
++ return NULL;
++}
++
++/* Gets the port spec for a certain interface */
++static int hso_get_config_data(struct usb_interface *interface)
++{
++ struct usb_device *usbdev = interface_to_usbdev(interface);
++ u8 *config_data = kmalloc(17, GFP_KERNEL);
++ u32 if_num = interface->altsetting->desc.bInterfaceNumber;
++ s32 result;
++
++ if (!config_data)
++ return -ENOMEM;
++ if (usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
++ 0x86, 0xC0, 0, 0, config_data, 17,
++ USB_CTRL_SET_TIMEOUT) != 0x11) {
++ kfree(config_data);
++ return -EIO;
++ }
++
++ switch (config_data[if_num]) {
++ case 0x0:
++ result = 0;
++ break;
++ case 0x1:
++ result = HSO_PORT_DIAG;
++ break;
++ case 0x2:
++ result = HSO_PORT_GPS;
++ break;
++ case 0x3:
++ result = HSO_PORT_GPS_CONTROL;
++ break;
++ case 0x4:
++ result = HSO_PORT_APP;
++ break;
++ case 0x5:
++ result = HSO_PORT_APP2;
++ break;
++ case 0x6:
++ result = HSO_PORT_CONTROL;
++ break;
++ case 0x7:
++ result = HSO_PORT_NETWORK;
++ break;
++ case 0x8:
++ result = HSO_PORT_MODEM;
++ break;
++ case 0x9:
++ result = HSO_PORT_MSD;
++ break;
++ case 0xa:
++ result = HSO_PORT_PCSC;
++ break;
++ case 0xb:
++ result = HSO_PORT_VOICE;
++ break;
++ default:
++ result = 0;
++ }
++
++ if (result)
++ result |= HSO_INTF_BULK;
++
++ if (config_data[16] & 0x1)
++ result |= HSO_INFO_CRC_BUG;
++
++ kfree(config_data);
++ return result;
++}
++
++/* called once for each interface upon device insertion */
++static int hso_probe(struct usb_interface *interface,
++ const struct usb_device_id *id)
++{
++ int mux, i, if_num, port_spec;
++ unsigned char port_mask;
++ struct hso_device *hso_dev = NULL;
++ struct hso_shared_int *shared_int;
++ struct hso_device *tmp_dev = NULL;
++
++ if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
++ dev_err(&interface->dev, "Not our interface\n");
++ return -ENODEV;
++ }
++
++ if_num = interface->altsetting->desc.bInterfaceNumber;
++
++ /* Get the interface/port specification from either driver_info or from
++ * the device itself */
++ if (id->driver_info)
++ port_spec = ((u32 *)(id->driver_info))[if_num];
++ else
++ port_spec = hso_get_config_data(interface);
++
++ /* Check if we need to switch to alt interfaces prior to port
++ * configuration */
++ if (interface->num_altsetting > 1)
++ usb_set_interface(interface_to_usbdev(interface), if_num, 1);
++ interface->needs_remote_wakeup = 1;
++
++ /* Allocate new hso device(s) */
++ switch (port_spec & HSO_INTF_MASK) {
++ case HSO_INTF_MUX:
++ if ((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) {
++ /* Create the network device */
++ if (!disable_net) {
++ hso_dev = hso_create_net_device(interface,
++ port_spec);
++ if (!hso_dev)
++ goto exit;
++ tmp_dev = hso_dev;
++ }
++ }
++
++ if (hso_get_mux_ports(interface, &port_mask))
++ /* TODO: de-allocate everything */
++ goto exit;
++
++ shared_int = hso_create_shared_int(interface);
++ if (!shared_int)
++ goto exit;
++
++ for (i = 1, mux = 0; i < 0x100; i = i << 1, mux++) {
++ if (port_mask & i) {
++ hso_dev = hso_create_mux_serial_device(
++ interface, i, shared_int);
++ if (!hso_dev)
++ goto exit;
++ }
++ }
++
++ if (tmp_dev)
++ hso_dev = tmp_dev;
++ break;
++
++ case HSO_INTF_BULK:
++ /* It's a regular bulk interface */
++ if ((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) {
++ if (!disable_net)
++ hso_dev =
++ hso_create_net_device(interface, port_spec);
++ } else {
++ hso_dev =
++ hso_create_bulk_serial_device(interface, port_spec);
++ }
++ if (!hso_dev)
++ goto exit;
++ break;
++ default:
++ goto exit;
++ }
++
++ /* save our data pointer in this device */
++ usb_set_intfdata(interface, hso_dev);
++
++ /* done */
++ return 0;
++exit:
++ hso_free_interface(interface);
++ return -ENODEV;
++}
++
++/* device removed, cleaning up */
++static void hso_disconnect(struct usb_interface *interface)
++{
++ hso_free_interface(interface);
++
++ /* remove reference of our private data */
++ usb_set_intfdata(interface, NULL);
++}
++
++static void async_get_intf(struct work_struct *data)
++{
++ struct hso_device *hso_dev =
++ container_of(data, struct hso_device, async_get_intf);
++ usb_autopm_get_interface(hso_dev->interface);
++}
++
++static void async_put_intf(struct work_struct *data)
++{
++ struct hso_device *hso_dev =
++ container_of(data, struct hso_device, async_put_intf);
++ usb_autopm_put_interface(hso_dev->interface);
++}
++
++static int hso_get_activity(struct hso_device *hso_dev)
++{
++ if (hso_dev->usb->state == USB_STATE_SUSPENDED) {
++ if (!hso_dev->is_active) {
++ hso_dev->is_active = 1;
++ schedule_work(&hso_dev->async_get_intf);
++ }
++ }
++
++ if (hso_dev->usb->state != USB_STATE_CONFIGURED)
++ return -EAGAIN;
++
++ usb_mark_last_busy(hso_dev->usb);
++
++ return 0;
++}
++
++static int hso_put_activity(struct hso_device *hso_dev)
++{
++ if (hso_dev->usb->state != USB_STATE_SUSPENDED) {
++ if (hso_dev->is_active) {
++ hso_dev->is_active = 0;
++ schedule_work(&hso_dev->async_put_intf);
++ return -EAGAIN;
++ }
++ }
++ hso_dev->is_active = 0;
++ return 0;
++}
++
++/* called by kernel when we need to suspend device */
++static int hso_suspend(struct usb_interface *iface, pm_message_t message)
++{
++ int i, result;
++
++ /* Stop all serial ports */
++ for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
++ if (serial_table[i] && (serial_table[i]->interface == iface)) {
++ result = hso_stop_serial_device(serial_table[i]);
++ if (result)
++ goto out;
++ }
++ }
++
++ /* Stop all network ports */
++ for (i = 0; i < HSO_MAX_NET_DEVICES; i++) {
++ if (network_table[i] &&
++ (network_table[i]->interface == iface)) {
++ result = hso_stop_net_device(network_table[i]);
++ if (result)
++ goto out;
++ }
++ }
++
++out:
++ return 0;
++}
++
++/* called by kernel when we need to resume device */
++static int hso_resume(struct usb_interface *iface)
++{
++ int i, result = 0;
++ struct hso_net *hso_net;
++
++ /* Start all serial ports */
++ for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
++ if (serial_table[i] && (serial_table[i]->interface == iface)) {
++ if (atomic_read(&dev2ser(serial_table[i])->port.count)) {
++ result =
++ hso_start_serial_device(serial_table[i], GFP_NOIO);
++ hso_kick_transmit(dev2ser(serial_table[i]));
++ if (result)
++ goto out;
++ }
++ }
++ }
++
++ /* Start all network ports */
++ for (i = 0; i < HSO_MAX_NET_DEVICES; i++) {
++ if (network_table[i] &&
++ (network_table[i]->interface == iface)) {
++ hso_net = dev2net(network_table[i]);
++ if (hso_net->flags & IFF_UP) {
++ /* First transmit any lingering data,
++ then restart the device. */
++ if (hso_net->skb_tx_buf) {
++ dev_dbg(&iface->dev,
++ "Transmitting"
++ " lingering data\n");
++ hso_net_start_xmit(hso_net->skb_tx_buf,
++ hso_net->net);
++ hso_net->skb_tx_buf = NULL;
++ }
++ result = hso_start_net_device(network_table[i]);
++ if (result)
++ goto out;
++ }
++ }
++ }
++
++out:
++ return result;
++}
++
++static void reset_device(struct work_struct *data)
++{
++ struct hso_device *hso_dev =
++ container_of(data, struct hso_device, reset_device);
++ struct usb_device *usb = hso_dev->usb;
++ int result;
++
++ if (hso_dev->usb_gone) {
++ D1("No reset during disconnect\n");
++ } else {
++ result = usb_lock_device_for_reset(usb, hso_dev->interface);
++ if (result < 0)
++ D1("unable to lock device for reset: %d\n", result);
++ else {
++ usb_reset_device(usb);
++ usb_unlock_device(usb);
++ }
++ }
++}
++
++static void hso_serial_ref_free(struct kref *ref)
++{
++ struct hso_device *hso_dev = container_of(ref, struct hso_device, ref);
++
++ hso_free_serial_device(hso_dev);
++}
++
++static void hso_free_interface(struct usb_interface *interface)
++{
++ struct hso_serial *hso_dev;
++ int i;
++
++ for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
++ if (serial_table[i] &&
++ (serial_table[i]->interface == interface)) {
++ hso_dev = dev2ser(serial_table[i]);
++ tty_port_tty_hangup(&hso_dev->port, false);
++ mutex_lock(&hso_dev->parent->mutex);
++ hso_dev->parent->usb_gone = 1;
++ mutex_unlock(&hso_dev->parent->mutex);
++ kref_put(&serial_table[i]->ref, hso_serial_ref_free);
++ }
++ }
++
++ for (i = 0; i < HSO_MAX_NET_DEVICES; i++) {
++ if (network_table[i] &&
++ (network_table[i]->interface == interface)) {
++ struct rfkill *rfk = dev2net(network_table[i])->rfkill;
++ /* hso_stop_net_device doesn't stop the net queue since
++ * traffic needs to start it again when suspended */
++ netif_stop_queue(dev2net(network_table[i])->net);
++ hso_stop_net_device(network_table[i]);
++ cancel_work_sync(&network_table[i]->async_put_intf);
++ cancel_work_sync(&network_table[i]->async_get_intf);
++ if (rfk) {
++ rfkill_unregister(rfk);
++ rfkill_destroy(rfk);
++ }
++ hso_free_net_device(network_table[i]);
++ }
++ }
++}
++
++/* Helper functions */
++
++/* Get the endpoint ! */
++static struct usb_endpoint_descriptor *hso_get_ep(struct usb_interface *intf,
++ int type, int dir)
++{
++ int i;
++ struct usb_host_interface *iface = intf->cur_altsetting;
++ struct usb_endpoint_descriptor *endp;
++
++ for (i = 0; i < iface->desc.bNumEndpoints; i++) {
++ endp = &iface->endpoint[i].desc;
++ if (((endp->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == dir) &&
++ (usb_endpoint_type(endp) == type))
++ return endp;
++ }
++
++ return NULL;
++}
++
++/* Get the byte that describes which ports are enabled */
++static int hso_get_mux_ports(struct usb_interface *intf, unsigned char *ports)
++{
++ int i;
++ struct usb_host_interface *iface = intf->cur_altsetting;
++
++ if (iface->extralen == 3) {
++ *ports = iface->extra[2];
++ return 0;
++ }
++
++ for (i = 0; i < iface->desc.bNumEndpoints; i++) {
++ if (iface->endpoint[i].extralen == 3) {
++ *ports = iface->endpoint[i].extra[2];
++ return 0;
++ }
++ }
++
++ return -1;
++}
++
++/* interrupt urb needs to be submitted, used for serial read of muxed port */
++static int hso_mux_submit_intr_urb(struct hso_shared_int *shared_int,
++ struct usb_device *usb, gfp_t gfp)
++{
++ int result;
++
++ usb_fill_int_urb(shared_int->shared_intr_urb, usb,
++ usb_rcvintpipe(usb,
++ shared_int->intr_endp->bEndpointAddress & 0x7F),
++ shared_int->shared_intr_buf,
++ 1,
++ intr_callback, shared_int,
++ shared_int->intr_endp->bInterval);
++
++ result = usb_submit_urb(shared_int->shared_intr_urb, gfp);
++ if (result)
++ dev_warn(&usb->dev, "%s failed mux_intr_urb %d\n", __func__,
++ result);
++
++ return result;
++}
++
++/* operations setup of the serial interface */
++static const struct tty_operations hso_serial_ops = {
++ .open = hso_serial_open,
++ .close = hso_serial_close,
++ .write = hso_serial_write,
++ .write_room = hso_serial_write_room,
++ .ioctl = hso_serial_ioctl,
++ .set_termios = hso_serial_set_termios,
++ .chars_in_buffer = hso_serial_chars_in_buffer,
++ .tiocmget = hso_serial_tiocmget,
++ .tiocmset = hso_serial_tiocmset,
++ .get_icount = hso_get_count,
++ .unthrottle = hso_unthrottle
++};
++
++static struct usb_driver hso_driver = {
++ .name = driver_name,
++ .probe = hso_probe,
++ .disconnect = hso_disconnect,
++ .id_table = hso_ids,
++ .suspend = hso_suspend,
++ .resume = hso_resume,
++ .reset_resume = hso_resume,
++ .supports_autosuspend = 1,
++ .disable_hub_initiated_lpm = 1,
++};
++
++static int __init hso_init(void)
++{
++ int i;
++ int result;
++
++ /* put it in the log */
++ printk(KERN_INFO "hso: %s\n", version);
++
++ /* Initialise the serial table semaphore and table */
++ spin_lock_init(&serial_table_lock);
++ for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++)
++ serial_table[i] = NULL;
++
++ /* allocate our driver using the proper amount of supported minors */
++ tty_drv = alloc_tty_driver(HSO_SERIAL_TTY_MINORS);
++ if (!tty_drv)
++ return -ENOMEM;
++
++ /* fill in all needed values */
++ tty_drv->driver_name = driver_name;
++ tty_drv->name = tty_filename;
++
++ /* if major number is provided as parameter, use that one */
++ if (tty_major)
++ tty_drv->major = tty_major;
++
++ tty_drv->minor_start = 0;
++ tty_drv->type = TTY_DRIVER_TYPE_SERIAL;
++ tty_drv->subtype = SERIAL_TYPE_NORMAL;
++ tty_drv->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
++ tty_drv->init_termios = tty_std_termios;
++ hso_init_termios(&tty_drv->init_termios);
++ tty_set_operations(tty_drv, &hso_serial_ops);
++
++ /* register the tty driver */
++ result = tty_register_driver(tty_drv);
++ if (result) {
++ printk(KERN_ERR "%s - tty_register_driver failed(%d)\n",
++ __func__, result);
++ goto err_free_tty;
++ }
++
++ /* register this module as an usb driver */
++ result = usb_register(&hso_driver);
++ if (result) {
++ printk(KERN_ERR "Could not register hso driver? error: %d\n",
++ result);
++ goto err_unreg_tty;
++ }
++
++ /* done */
++ return 0;
++err_unreg_tty:
++ tty_unregister_driver(tty_drv);
++err_free_tty:
++ put_tty_driver(tty_drv);
++ return result;
++}
++
++static void __exit hso_exit(void)
++{
++ printk(KERN_INFO "hso: unloaded\n");
++
++ tty_unregister_driver(tty_drv);
++ put_tty_driver(tty_drv);
++ /* deregister the usb driver */
++ usb_deregister(&hso_driver);
++}
++
++/* Module definitions */
++module_init(hso_init);
++module_exit(hso_exit);
++
++MODULE_AUTHOR(MOD_AUTHOR);
++MODULE_DESCRIPTION(MOD_DESCRIPTION);
++MODULE_LICENSE(MOD_LICENSE);
++
++/* change the debug level (eg: insmod hso.ko debug=0x04) */
++MODULE_PARM_DESC(debug, "Level of debug [0x01 | 0x02 | 0x04 | 0x08 | 0x10]");
++module_param(debug, int, S_IRUGO | S_IWUSR);
++
++/* set the major tty number (eg: insmod hso.ko tty_major=245) */
++MODULE_PARM_DESC(tty_major, "Set the major tty number");
++module_param(tty_major, int, S_IRUGO | S_IWUSR);
++
++/* disable network interface (eg: insmod hso.ko disable_net=1) */
++MODULE_PARM_DESC(disable_net, "Disable the network interface");
++module_param(disable_net, int, S_IRUGO | S_IWUSR);
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/huawei_cdc_ncm.c backports-3.18.1-1/drivers/net/usb/huawei_cdc_ncm.c
+--- backports-3.18.1-1.org/drivers/net/usb/huawei_cdc_ncm.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/huawei_cdc_ncm.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,221 @@
++/* huawei_cdc_ncm.c - handles Huawei devices using the CDC NCM protocol as
++ * transport layer.
++ * Copyright (C) 2013 Enrico Mioso <mrkiko.rs@gmail.com>
++ *
++ *
++ * ABSTRACT:
++ * This driver handles devices resembling the CDC NCM standard, but
++ * encapsulating another protocol inside it. An example are some Huawei 3G
++ * devices, exposing an embedded AT channel where you can set up the NCM
++ * connection.
++ * This code has been heavily inspired by the cdc_mbim.c driver, which is
++ * Copyright (c) 2012 Smith Micro Software, Inc.
++ * Copyright (c) 2012 Bjørn Mork <bjorn@mork.no>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * version 2 as published by the Free Software Foundation.
++ */
++
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/ethtool.h>
++#include <linux/if_vlan.h>
++#include <linux/ip.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/usb/cdc.h>
++#include <linux/usb/usbnet.h>
++#include <linux/usb/cdc-wdm.h>
++#include <linux/usb/cdc_ncm.h>
++
++/* Driver data */
++struct huawei_cdc_ncm_state {
++ struct cdc_ncm_ctx *ctx;
++ atomic_t pmcount;
++ struct usb_driver *subdriver;
++ struct usb_interface *control;
++ struct usb_interface *data;
++};
++
++static int huawei_cdc_ncm_manage_power(struct usbnet *usbnet_dev, int on)
++{
++ struct huawei_cdc_ncm_state *drvstate = (void *)&usbnet_dev->data;
++ int rv;
++
++ if ((on && atomic_add_return(1, &drvstate->pmcount) == 1) ||
++ (!on && atomic_dec_and_test(&drvstate->pmcount))) {
++ rv = usb_autopm_get_interface(usbnet_dev->intf);
++ usbnet_dev->intf->needs_remote_wakeup = on;
++ if (!rv)
++ usb_autopm_put_interface(usbnet_dev->intf);
++ }
++ return 0;
++}
++
++static int huawei_cdc_ncm_wdm_manage_power(struct usb_interface *intf,
++ int status)
++{
++ struct usbnet *usbnet_dev = usb_get_intfdata(intf);
++
++ /* can be called while disconnecting */
++ if (!usbnet_dev)
++ return 0;
++
++ return huawei_cdc_ncm_manage_power(usbnet_dev, status);
++}
++
++
++static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev,
++ struct usb_interface *intf)
++{
++ struct cdc_ncm_ctx *ctx;
++ struct usb_driver *subdriver = ERR_PTR(-ENODEV);
++ int ret = -ENODEV;
++ struct huawei_cdc_ncm_state *drvstate = (void *)&usbnet_dev->data;
++
++ /* altsetting should always be 1 for NCM devices - so we hard-coded
++ * it here
++ */
++ ret = cdc_ncm_bind_common(usbnet_dev, intf, 1);
++ if (ret)
++ goto err;
++
++ ctx = drvstate->ctx;
++
++ if (usbnet_dev->status)
++ /* The wMaxCommand buffer must be big enough to hold
++ * any message from the modem. Experience has shown
++ * that some replies are more than 256 bytes long
++ */
++ subdriver = usb_cdc_wdm_register(ctx->control,
++ &usbnet_dev->status->desc,
++ 1024, /* wMaxCommand */
++ huawei_cdc_ncm_wdm_manage_power);
++ if (IS_ERR(subdriver)) {
++ ret = PTR_ERR(subdriver);
++ cdc_ncm_unbind(usbnet_dev, intf);
++ goto err;
++ }
++
++ /* Prevent usbnet from using the status descriptor */
++ usbnet_dev->status = NULL;
++
++ drvstate->subdriver = subdriver;
++
++err:
++ return ret;
++}
++
++static void huawei_cdc_ncm_unbind(struct usbnet *usbnet_dev,
++ struct usb_interface *intf)
++{
++ struct huawei_cdc_ncm_state *drvstate = (void *)&usbnet_dev->data;
++ struct cdc_ncm_ctx *ctx = drvstate->ctx;
++
++ if (drvstate->subdriver && drvstate->subdriver->disconnect)
++ drvstate->subdriver->disconnect(ctx->control);
++ drvstate->subdriver = NULL;
++
++ cdc_ncm_unbind(usbnet_dev, intf);
++}
++
++static int huawei_cdc_ncm_suspend(struct usb_interface *intf,
++ pm_message_t message)
++{
++ int ret = 0;
++ struct usbnet *usbnet_dev = usb_get_intfdata(intf);
++ struct huawei_cdc_ncm_state *drvstate = (void *)&usbnet_dev->data;
++ struct cdc_ncm_ctx *ctx = drvstate->ctx;
++
++ if (ctx == NULL) {
++ ret = -ENODEV;
++ goto error;
++ }
++
++ ret = usbnet_suspend(intf, message);
++ if (ret < 0)
++ goto error;
++
++ if (intf == ctx->control &&
++ drvstate->subdriver &&
++ drvstate->subdriver->suspend)
++ ret = drvstate->subdriver->suspend(intf, message);
++ if (ret < 0)
++ usbnet_resume(intf);
++
++error:
++ return ret;
++}
++
++static int huawei_cdc_ncm_resume(struct usb_interface *intf)
++{
++ int ret = 0;
++ struct usbnet *usbnet_dev = usb_get_intfdata(intf);
++ struct huawei_cdc_ncm_state *drvstate = (void *)&usbnet_dev->data;
++ bool callsub;
++ struct cdc_ncm_ctx *ctx = drvstate->ctx;
++
++ /* should we call subdriver's resume function? */
++ callsub =
++ (intf == ctx->control &&
++ drvstate->subdriver &&
++ drvstate->subdriver->resume);
++
++ if (callsub)
++ ret = drvstate->subdriver->resume(intf);
++ if (ret < 0)
++ goto err;
++ ret = usbnet_resume(intf);
++ if (ret < 0 && callsub)
++ drvstate->subdriver->suspend(intf, PMSG_SUSPEND);
++err:
++ return ret;
++}
++
++static const struct driver_info huawei_cdc_ncm_info = {
++ .description = "Huawei CDC NCM device",
++ .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN,
++ .bind = huawei_cdc_ncm_bind,
++ .unbind = huawei_cdc_ncm_unbind,
++ .manage_power = huawei_cdc_ncm_manage_power,
++ .rx_fixup = cdc_ncm_rx_fixup,
++ .tx_fixup = cdc_ncm_tx_fixup,
++};
++
++static const struct usb_device_id huawei_cdc_ncm_devs[] = {
++ /* Huawei NCM devices disguised as vendor specific */
++ { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16),
++ .driver_info = (unsigned long)&huawei_cdc_ncm_info,
++ },
++ { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46),
++ .driver_info = (unsigned long)&huawei_cdc_ncm_info,
++ },
++ { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76),
++ .driver_info = (unsigned long)&huawei_cdc_ncm_info,
++ },
++ { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x03, 0x16),
++ .driver_info = (unsigned long)&huawei_cdc_ncm_info,
++ },
++
++ /* Terminating entry */
++ {
++ },
++};
++MODULE_DEVICE_TABLE(usb, huawei_cdc_ncm_devs);
++
++static struct usb_driver huawei_cdc_ncm_driver = {
++ .name = "huawei_cdc_ncm",
++ .id_table = huawei_cdc_ncm_devs,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = huawei_cdc_ncm_suspend,
++ .resume = huawei_cdc_ncm_resume,
++ .reset_resume = huawei_cdc_ncm_resume,
++ .supports_autosuspend = 1,
++ .disable_hub_initiated_lpm = 1,
++};
++module_usb_driver(huawei_cdc_ncm_driver);
++MODULE_AUTHOR("Enrico Mioso <mrkiko.rs@gmail.com>");
++MODULE_DESCRIPTION("USB CDC NCM host driver with encapsulated protocol support");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/int51x1.c backports-3.18.1-1/drivers/net/usb/int51x1.c
+--- backports-3.18.1-1.org/drivers/net/usb/int51x1.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/int51x1.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,199 @@
++/*
++ * Copyright (c) 2009 Peter Holik
++ *
++ * Intellon usb PLC (Powerline Communications) usb net driver
++ *
++ * http://www.tandel.be/downloads/INT51X1_Datasheet.pdf
++ *
++ * Based on the work of Jan 'RedBully' Seiffert
++ */
++
++/*
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or.
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/ctype.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/slab.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/usb/usbnet.h>
++
++#define INT51X1_VENDOR_ID 0x09e1
++#define INT51X1_PRODUCT_ID 0x5121
++
++#define INT51X1_HEADER_SIZE 2 /* 2 byte header */
++
++#define PACKET_TYPE_PROMISCUOUS (1 << 0)
++#define PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */
++#define PACKET_TYPE_DIRECTED (1 << 2)
++#define PACKET_TYPE_BROADCAST (1 << 3)
++#define PACKET_TYPE_MULTICAST (1 << 4) /* filtered */
++
++#define SET_ETHERNET_PACKET_FILTER 0x43
++
++static int int51x1_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ int len;
++
++ if (!(pskb_may_pull(skb, INT51X1_HEADER_SIZE))) {
++ netdev_err(dev->net, "unexpected tiny rx frame\n");
++ return 0;
++ }
++
++ len = le16_to_cpu(*(__le16 *)&skb->data[skb->len - 2]);
++
++ skb_trim(skb, len);
++
++ return 1;
++}
++
++static struct sk_buff *int51x1_tx_fixup(struct usbnet *dev,
++ struct sk_buff *skb, gfp_t flags)
++{
++ int pack_len = skb->len;
++ int pack_with_header_len = pack_len + INT51X1_HEADER_SIZE;
++ int headroom = skb_headroom(skb);
++ int tailroom = skb_tailroom(skb);
++ int need_tail = 0;
++ __le16 *len;
++
++ /* if packet and our header is smaler than 64 pad to 64 (+ ZLP) */
++ if ((pack_with_header_len) < dev->maxpacket)
++ need_tail = dev->maxpacket - pack_with_header_len + 1;
++ /*
++ * usbnet would send a ZLP if packetlength mod urbsize == 0 for us,
++ * but we need to know ourself, because this would add to the length
++ * we send down to the device...
++ */
++ else if (!(pack_with_header_len % dev->maxpacket))
++ need_tail = 1;
++
++ if (!skb_cloned(skb) &&
++ (headroom + tailroom >= need_tail + INT51X1_HEADER_SIZE)) {
++ if (headroom < INT51X1_HEADER_SIZE || tailroom < need_tail) {
++ skb->data = memmove(skb->head + INT51X1_HEADER_SIZE,
++ skb->data, skb->len);
++ skb_set_tail_pointer(skb, skb->len);
++ }
++ } else {
++ struct sk_buff *skb2;
++
++ skb2 = skb_copy_expand(skb,
++ INT51X1_HEADER_SIZE,
++ need_tail,
++ flags);
++ dev_kfree_skb_any(skb);
++ if (!skb2)
++ return NULL;
++ skb = skb2;
++ }
++
++ pack_len += need_tail;
++ pack_len &= 0x07ff;
++
++ len = (__le16 *) __skb_push(skb, INT51X1_HEADER_SIZE);
++ *len = cpu_to_le16(pack_len);
++
++ if(need_tail)
++ memset(__skb_put(skb, need_tail), 0, need_tail);
++
++ return skb;
++}
++
++static void int51x1_set_multicast(struct net_device *netdev)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u16 filter = PACKET_TYPE_DIRECTED | PACKET_TYPE_BROADCAST;
++
++ if (netdev->flags & IFF_PROMISC) {
++ /* do not expect to see traffic of other PLCs */
++ filter |= PACKET_TYPE_PROMISCUOUS;
++ netdev_info(dev->net, "promiscuous mode enabled\n");
++ } else if (!netdev_mc_empty(netdev) ||
++ (netdev->flags & IFF_ALLMULTI)) {
++ filter |= PACKET_TYPE_ALL_MULTICAST;
++ netdev_dbg(dev->net, "receive all multicast enabled\n");
++ } else {
++ /* ~PROMISCUOUS, ~MULTICAST */
++ netdev_dbg(dev->net, "receive own packets only\n");
++ }
++
++ usbnet_write_cmd_async(dev, SET_ETHERNET_PACKET_FILTER,
++ USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
++ filter, 0, NULL, 0);
++}
++
++static const struct net_device_ops int51x1_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_set_mac_address = eth_mac_addr,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_set_rx_mode = int51x1_set_multicast,
++};
++
++static int int51x1_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int status = usbnet_get_ethernet_addr(dev, 3);
++
++ if (status)
++ return status;
++
++ dev->net->hard_header_len += INT51X1_HEADER_SIZE;
++ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
++ dev->net->netdev_ops = &int51x1_netdev_ops;
++
++ return usbnet_get_endpoints(dev, intf);
++}
++
++static const struct driver_info int51x1_info = {
++ .description = "Intellon usb powerline adapter",
++ .bind = int51x1_bind,
++ .rx_fixup = int51x1_rx_fixup,
++ .tx_fixup = int51x1_tx_fixup,
++ .in = 1,
++ .out = 2,
++ .flags = FLAG_ETHER,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ USB_DEVICE(INT51X1_VENDOR_ID, INT51X1_PRODUCT_ID),
++ .driver_info = (unsigned long) &int51x1_info,
++ },
++ {},
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver int51x1_driver = {
++ .name = "int51x1",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(int51x1_driver);
++
++MODULE_AUTHOR("Peter Holik");
++MODULE_DESCRIPTION("Intellon usb powerline adapter");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/ipheth.c backports-3.18.1-1/drivers/net/usb/ipheth.c
+--- backports-3.18.1-1.org/drivers/net/usb/ipheth.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/ipheth.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,588 @@
++/*
++ * ipheth.c - Apple iPhone USB Ethernet driver
++ *
++ * Copyright (c) 2009 Diego Giagio <diego@giagio.com>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of GIAGIO.COM nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * Alternatively, provided that this notice is retained in full, this
++ * software may be distributed under the terms of the GNU General
++ * Public License ("GPL") version 2, in which case the provisions of the
++ * GPL apply INSTEAD OF those given above.
++ *
++ * The provided data structures and external interfaces from this code
++ * are not restricted to be used by modules with a GPL compatible license.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
++ * DAMAGE.
++ *
++ *
++ * Attention: iPhone device must be paired, otherwise it won't respond to our
++ * driver. For more info: http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/errno.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/usb.h>
++#include <linux/workqueue.h>
++
++#define USB_VENDOR_APPLE 0x05ac
++#define USB_PRODUCT_IPHONE 0x1290
++#define USB_PRODUCT_IPHONE_3G 0x1292
++#define USB_PRODUCT_IPHONE_3GS 0x1294
++#define USB_PRODUCT_IPHONE_4 0x1297
++#define USB_PRODUCT_IPAD 0x129a
++#define USB_PRODUCT_IPAD_2 0x12a2
++#define USB_PRODUCT_IPAD_3 0x12a6
++#define USB_PRODUCT_IPAD_MINI 0x12ab
++#define USB_PRODUCT_IPHONE_4_VZW 0x129c
++#define USB_PRODUCT_IPHONE_4S 0x12a0
++#define USB_PRODUCT_IPHONE_5 0x12a8
++
++#define IPHETH_USBINTF_CLASS 255
++#define IPHETH_USBINTF_SUBCLASS 253
++#define IPHETH_USBINTF_PROTO 1
++
++#define IPHETH_BUF_SIZE 1516
++#define IPHETH_IP_ALIGN 2 /* padding at front of URB */
++#define IPHETH_TX_TIMEOUT (5 * HZ)
++
++#define IPHETH_INTFNUM 2
++#define IPHETH_ALT_INTFNUM 1
++
++#define IPHETH_CTRL_ENDP 0x00
++#define IPHETH_CTRL_BUF_SIZE 0x40
++#define IPHETH_CTRL_TIMEOUT (5 * HZ)
++
++#define IPHETH_CMD_GET_MACADDR 0x00
++#define IPHETH_CMD_CARRIER_CHECK 0x45
++
++#define IPHETH_CARRIER_CHECK_TIMEOUT round_jiffies_relative(1 * HZ)
++#define IPHETH_CARRIER_ON 0x04
++
++static struct usb_device_id ipheth_table[] = {
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_3G,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_3GS,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPAD,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPAD_2,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPAD_3,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPAD_MINI,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { USB_DEVICE_AND_INTERFACE_INFO(
++ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_5,
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
++ IPHETH_USBINTF_PROTO) },
++ { }
++};
++MODULE_DEVICE_TABLE(usb, ipheth_table);
++
++struct ipheth_device {
++ struct usb_device *udev;
++ struct usb_interface *intf;
++ struct net_device *net;
++ struct sk_buff *tx_skb;
++ struct urb *tx_urb;
++ struct urb *rx_urb;
++ unsigned char *tx_buf;
++ unsigned char *rx_buf;
++ unsigned char *ctrl_buf;
++ u8 bulk_in;
++ u8 bulk_out;
++ struct delayed_work carrier_work;
++};
++
++static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags);
++
++static int ipheth_alloc_urbs(struct ipheth_device *iphone)
++{
++ struct urb *tx_urb = NULL;
++ struct urb *rx_urb = NULL;
++ u8 *tx_buf = NULL;
++ u8 *rx_buf = NULL;
++
++ tx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (tx_urb == NULL)
++ goto error_nomem;
++
++ rx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (rx_urb == NULL)
++ goto free_tx_urb;
++
++ tx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
++ GFP_KERNEL, &tx_urb->transfer_dma);
++ if (tx_buf == NULL)
++ goto free_rx_urb;
++
++ rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
++ GFP_KERNEL, &rx_urb->transfer_dma);
++ if (rx_buf == NULL)
++ goto free_tx_buf;
++
++
++ iphone->tx_urb = tx_urb;
++ iphone->rx_urb = rx_urb;
++ iphone->tx_buf = tx_buf;
++ iphone->rx_buf = rx_buf;
++ return 0;
++
++free_tx_buf:
++ usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
++ tx_urb->transfer_dma);
++free_rx_urb:
++ usb_free_urb(rx_urb);
++free_tx_urb:
++ usb_free_urb(tx_urb);
++error_nomem:
++ return -ENOMEM;
++}
++
++static void ipheth_free_urbs(struct ipheth_device *iphone)
++{
++ usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
++ iphone->rx_urb->transfer_dma);
++ usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
++ iphone->tx_urb->transfer_dma);
++ usb_free_urb(iphone->rx_urb);
++ usb_free_urb(iphone->tx_urb);
++}
++
++static void ipheth_kill_urbs(struct ipheth_device *dev)
++{
++ usb_kill_urb(dev->tx_urb);
++ usb_kill_urb(dev->rx_urb);
++}
++
++static void ipheth_rcvbulk_callback(struct urb *urb)
++{
++ struct ipheth_device *dev;
++ struct sk_buff *skb;
++ int status;
++ char *buf;
++ int len;
++
++ dev = urb->context;
++ if (dev == NULL)
++ return;
++
++ status = urb->status;
++ switch (status) {
++ case -ENOENT:
++ case -ECONNRESET:
++ case -ESHUTDOWN:
++ return;
++ case 0:
++ break;
++ default:
++ dev_err(&dev->intf->dev, "%s: urb status: %d\n",
++ __func__, status);
++ return;
++ }
++
++ if (urb->actual_length <= IPHETH_IP_ALIGN) {
++ dev->net->stats.rx_length_errors++;
++ return;
++ }
++ len = urb->actual_length - IPHETH_IP_ALIGN;
++ buf = urb->transfer_buffer + IPHETH_IP_ALIGN;
++
++ skb = dev_alloc_skb(len);
++ if (!skb) {
++ dev_err(&dev->intf->dev, "%s: dev_alloc_skb: -ENOMEM\n",
++ __func__);
++ dev->net->stats.rx_dropped++;
++ return;
++ }
++
++ memcpy(skb_put(skb, len), buf, len);
++ skb->dev = dev->net;
++ skb->protocol = eth_type_trans(skb, dev->net);
++
++ dev->net->stats.rx_packets++;
++ dev->net->stats.rx_bytes += len;
++
++ netif_rx(skb);
++ ipheth_rx_submit(dev, GFP_ATOMIC);
++}
++
++static void ipheth_sndbulk_callback(struct urb *urb)
++{
++ struct ipheth_device *dev;
++ int status = urb->status;
++
++ dev = urb->context;
++ if (dev == NULL)
++ return;
++
++ if (status != 0 &&
++ status != -ENOENT &&
++ status != -ECONNRESET &&
++ status != -ESHUTDOWN)
++ dev_err(&dev->intf->dev, "%s: urb status: %d\n",
++ __func__, status);
++
++ dev_kfree_skb_irq(dev->tx_skb);
++ netif_wake_queue(dev->net);
++}
++
++static int ipheth_carrier_set(struct ipheth_device *dev)
++{
++ struct usb_device *udev = dev->udev;
++ int retval;
++
++ retval = usb_control_msg(udev,
++ usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP),
++ IPHETH_CMD_CARRIER_CHECK, /* request */
++ 0xc0, /* request type */
++ 0x00, /* value */
++ 0x02, /* index */
++ dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE,
++ IPHETH_CTRL_TIMEOUT);
++ if (retval < 0) {
++ dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n",
++ __func__, retval);
++ return retval;
++ }
++
++ if (dev->ctrl_buf[0] == IPHETH_CARRIER_ON)
++ netif_carrier_on(dev->net);
++ else
++ netif_carrier_off(dev->net);
++
++ return 0;
++}
++
++static void ipheth_carrier_check_work(struct work_struct *work)
++{
++ struct ipheth_device *dev = container_of(work, struct ipheth_device,
++ carrier_work.work);
++
++ ipheth_carrier_set(dev);
++ schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);
++}
++
++static int ipheth_get_macaddr(struct ipheth_device *dev)
++{
++ struct usb_device *udev = dev->udev;
++ struct net_device *net = dev->net;
++ int retval;
++
++ retval = usb_control_msg(udev,
++ usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP),
++ IPHETH_CMD_GET_MACADDR, /* request */
++ 0xc0, /* request type */
++ 0x00, /* value */
++ 0x02, /* index */
++ dev->ctrl_buf,
++ IPHETH_CTRL_BUF_SIZE,
++ IPHETH_CTRL_TIMEOUT);
++ if (retval < 0) {
++ dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n",
++ __func__, retval);
++ } else if (retval < ETH_ALEN) {
++ dev_err(&dev->intf->dev,
++ "%s: usb_control_msg: short packet: %d bytes\n",
++ __func__, retval);
++ retval = -EINVAL;
++ } else {
++ memcpy(net->dev_addr, dev->ctrl_buf, ETH_ALEN);
++ retval = 0;
++ }
++
++ return retval;
++}
++
++static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags)
++{
++ struct usb_device *udev = dev->udev;
++ int retval;
++
++ usb_fill_bulk_urb(dev->rx_urb, udev,
++ usb_rcvbulkpipe(udev, dev->bulk_in),
++ dev->rx_buf, IPHETH_BUF_SIZE,
++ ipheth_rcvbulk_callback,
++ dev);
++ dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
++
++ retval = usb_submit_urb(dev->rx_urb, mem_flags);
++ if (retval)
++ dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
++ __func__, retval);
++ return retval;
++}
++
++static int ipheth_open(struct net_device *net)
++{
++ struct ipheth_device *dev = netdev_priv(net);
++ struct usb_device *udev = dev->udev;
++ int retval = 0;
++
++ usb_set_interface(udev, IPHETH_INTFNUM, IPHETH_ALT_INTFNUM);
++
++ retval = ipheth_carrier_set(dev);
++ if (retval)
++ return retval;
++
++ retval = ipheth_rx_submit(dev, GFP_KERNEL);
++ if (retval)
++ return retval;
++
++ schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);
++ netif_start_queue(net);
++ return retval;
++}
++
++static int ipheth_close(struct net_device *net)
++{
++ struct ipheth_device *dev = netdev_priv(net);
++
++ cancel_delayed_work_sync(&dev->carrier_work);
++ netif_stop_queue(net);
++ return 0;
++}
++
++static int ipheth_tx(struct sk_buff *skb, struct net_device *net)
++{
++ struct ipheth_device *dev = netdev_priv(net);
++ struct usb_device *udev = dev->udev;
++ int retval;
++
++ /* Paranoid */
++ if (skb->len > IPHETH_BUF_SIZE) {
++ WARN(1, "%s: skb too large: %d bytes\n", __func__, skb->len);
++ dev->net->stats.tx_dropped++;
++ dev_kfree_skb_irq(skb);
++ return NETDEV_TX_OK;
++ }
++
++ memcpy(dev->tx_buf, skb->data, skb->len);
++ if (skb->len < IPHETH_BUF_SIZE)
++ memset(dev->tx_buf + skb->len, 0, IPHETH_BUF_SIZE - skb->len);
++
++ usb_fill_bulk_urb(dev->tx_urb, udev,
++ usb_sndbulkpipe(udev, dev->bulk_out),
++ dev->tx_buf, IPHETH_BUF_SIZE,
++ ipheth_sndbulk_callback,
++ dev);
++ dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
++
++ retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC);
++ if (retval) {
++ dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
++ __func__, retval);
++ dev->net->stats.tx_errors++;
++ dev_kfree_skb_irq(skb);
++ } else {
++ dev->tx_skb = skb;
++
++ dev->net->stats.tx_packets++;
++ dev->net->stats.tx_bytes += skb->len;
++ netif_stop_queue(net);
++ }
++
++ return NETDEV_TX_OK;
++}
++
++static void ipheth_tx_timeout(struct net_device *net)
++{
++ struct ipheth_device *dev = netdev_priv(net);
++
++ dev_err(&dev->intf->dev, "%s: TX timeout\n", __func__);
++ dev->net->stats.tx_errors++;
++ usb_unlink_urb(dev->tx_urb);
++}
++
++static u32 ipheth_ethtool_op_get_link(struct net_device *net)
++{
++ struct ipheth_device *dev = netdev_priv(net);
++ return netif_carrier_ok(dev->net);
++}
++
++static const struct ethtool_ops ops = {
++ .get_link = ipheth_ethtool_op_get_link
++};
++
++static const struct net_device_ops ipheth_netdev_ops = {
++ .ndo_open = ipheth_open,
++ .ndo_stop = ipheth_close,
++ .ndo_start_xmit = ipheth_tx,
++ .ndo_tx_timeout = ipheth_tx_timeout,
++};
++
++static int ipheth_probe(struct usb_interface *intf,
++ const struct usb_device_id *id)
++{
++ struct usb_device *udev = interface_to_usbdev(intf);
++ struct usb_host_interface *hintf;
++ struct usb_endpoint_descriptor *endp;
++ struct ipheth_device *dev;
++ struct net_device *netdev;
++ int i;
++ int retval;
++
++ netdev = alloc_etherdev(sizeof(struct ipheth_device));
++ if (!netdev)
++ return -ENOMEM;
++
++ netdev->netdev_ops = &ipheth_netdev_ops;
++ netdev->watchdog_timeo = IPHETH_TX_TIMEOUT;
++ strcpy(netdev->name, "eth%d");
++
++ dev = netdev_priv(netdev);
++ dev->udev = udev;
++ dev->net = netdev;
++ dev->intf = intf;
++
++ /* Set up endpoints */
++ hintf = usb_altnum_to_altsetting(intf, IPHETH_ALT_INTFNUM);
++ if (hintf == NULL) {
++ retval = -ENODEV;
++ dev_err(&intf->dev, "Unable to find alternate settings interface\n");
++ goto err_endpoints;
++ }
++
++ for (i = 0; i < hintf->desc.bNumEndpoints; i++) {
++ endp = &hintf->endpoint[i].desc;
++ if (usb_endpoint_is_bulk_in(endp))
++ dev->bulk_in = endp->bEndpointAddress;
++ else if (usb_endpoint_is_bulk_out(endp))
++ dev->bulk_out = endp->bEndpointAddress;
++ }
++ if (!(dev->bulk_in && dev->bulk_out)) {
++ retval = -ENODEV;
++ dev_err(&intf->dev, "Unable to find endpoints\n");
++ goto err_endpoints;
++ }
++
++ dev->ctrl_buf = kmalloc(IPHETH_CTRL_BUF_SIZE, GFP_KERNEL);
++ if (dev->ctrl_buf == NULL) {
++ retval = -ENOMEM;
++ goto err_alloc_ctrl_buf;
++ }
++
++ retval = ipheth_get_macaddr(dev);
++ if (retval)
++ goto err_get_macaddr;
++
++ INIT_DELAYED_WORK(&dev->carrier_work, ipheth_carrier_check_work);
++
++ retval = ipheth_alloc_urbs(dev);
++ if (retval) {
++ dev_err(&intf->dev, "error allocating urbs: %d\n", retval);
++ goto err_alloc_urbs;
++ }
++
++ usb_set_intfdata(intf, dev);
++
++ SET_NETDEV_DEV(netdev, &intf->dev);
++ netdev->ethtool_ops = &ops;
++
++ retval = register_netdev(netdev);
++ if (retval) {
++ dev_err(&intf->dev, "error registering netdev: %d\n", retval);
++ retval = -EIO;
++ goto err_register_netdev;
++ }
++
++ dev_info(&intf->dev, "Apple iPhone USB Ethernet device attached\n");
++ return 0;
++
++err_register_netdev:
++ ipheth_free_urbs(dev);
++err_alloc_urbs:
++err_get_macaddr:
++err_alloc_ctrl_buf:
++ kfree(dev->ctrl_buf);
++err_endpoints:
++ free_netdev(netdev);
++ return retval;
++}
++
++static void ipheth_disconnect(struct usb_interface *intf)
++{
++ struct ipheth_device *dev;
++
++ dev = usb_get_intfdata(intf);
++ if (dev != NULL) {
++ unregister_netdev(dev->net);
++ ipheth_kill_urbs(dev);
++ ipheth_free_urbs(dev);
++ kfree(dev->ctrl_buf);
++ free_netdev(dev->net);
++ }
++ usb_set_intfdata(intf, NULL);
++ dev_info(&intf->dev, "Apple iPhone USB Ethernet now disconnected\n");
++}
++
++static struct usb_driver ipheth_driver = {
++ .name = "ipheth",
++ .probe = ipheth_probe,
++ .disconnect = ipheth_disconnect,
++ .id_table = ipheth_table,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(ipheth_driver);
++
++MODULE_AUTHOR("Diego Giagio <diego@giagio.com>");
++MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver");
++MODULE_LICENSE("Dual BSD/GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/kalmia.c backports-3.18.1-1/drivers/net/usb/kalmia.c
+--- backports-3.18.1-1.org/drivers/net/usb/kalmia.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/kalmia.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,366 @@
++/*
++ * USB network interface driver for Samsung Kalmia based LTE USB modem like the
++ * Samsung GT-B3730 and GT-B3710.
++ *
++ * Copyright (C) 2011 Marius Bjoernstad Kotsbak <marius@kotsbak.com>
++ *
++ * Sponsored by Quicklink Video Distribution Services Ltd.
++ *
++ * Based on the cdc_eem module.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ */
++
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ctype.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/crc32.h>
++#include <linux/usb/cdc.h>
++#include <linux/usb/usbnet.h>
++#include <linux/gfp.h>
++
++/*
++ * The Samsung Kalmia based LTE USB modems have a CDC ACM port for modem control
++ * handled by the "option" module and an ethernet data port handled by this
++ * module.
++ *
++ * The stick must first be switched into modem mode by usb_modeswitch
++ * or similar tool. Then the modem gets sent two initialization packets by
++ * this module, which gives the MAC address of the device. User space can then
++ * connect the modem using AT commands through the ACM port and then use
++ * DHCP on the network interface exposed by this module. Network packets are
++ * sent to and from the modem in a proprietary format discovered after watching
++ * the behavior of the windows driver for the modem.
++ *
++ * More information about the use of the modem is available in usb_modeswitch
++ * forum and the project page:
++ *
++ * http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=465
++ * https://github.com/mkotsbak/Samsung-GT-B3730-linux-driver
++ */
++
++/* #define DEBUG */
++/* #define VERBOSE */
++
++#define KALMIA_HEADER_LENGTH 6
++#define KALMIA_ALIGN_SIZE 4
++#define KALMIA_USB_TIMEOUT 10000
++
++/*-------------------------------------------------------------------------*/
++
++static int
++kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len,
++ u8 *buffer, u8 expected_len)
++{
++ int act_len;
++ int status;
++
++ netdev_dbg(dev->net, "Sending init packet");
++
++ status = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 0x02),
++ init_msg, init_msg_len, &act_len, KALMIA_USB_TIMEOUT);
++ if (status != 0) {
++ netdev_err(dev->net,
++ "Error sending init packet. Status %i, length %i\n",
++ status, act_len);
++ return status;
++ }
++ else if (act_len != init_msg_len) {
++ netdev_err(dev->net,
++ "Did not send all of init packet. Bytes sent: %i",
++ act_len);
++ }
++ else {
++ netdev_dbg(dev->net, "Successfully sent init packet.");
++ }
++
++ status = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, 0x81),
++ buffer, expected_len, &act_len, KALMIA_USB_TIMEOUT);
++
++ if (status != 0)
++ netdev_err(dev->net,
++ "Error receiving init result. Status %i, length %i\n",
++ status, act_len);
++ else if (act_len != expected_len)
++ netdev_err(dev->net, "Unexpected init result length: %i\n",
++ act_len);
++
++ return status;
++}
++
++static int
++kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr)
++{
++ static const char init_msg_1[] =
++ { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
++ 0x00, 0x00 };
++ static const char init_msg_2[] =
++ { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4,
++ 0x00, 0x00 };
++ static const int buflen = 28;
++ char *usb_buf;
++ int status;
++
++ usb_buf = kmalloc(buflen, GFP_DMA | GFP_KERNEL);
++ if (!usb_buf)
++ return -ENOMEM;
++
++ memcpy(usb_buf, init_msg_1, 12);
++ status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_1)
++ / sizeof(init_msg_1[0]), usb_buf, 24);
++ if (status != 0)
++ return status;
++
++ memcpy(usb_buf, init_msg_2, 12);
++ status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2)
++ / sizeof(init_msg_2[0]), usb_buf, 28);
++ if (status != 0)
++ return status;
++
++ memcpy(ethernet_addr, usb_buf + 10, ETH_ALEN);
++
++ kfree(usb_buf);
++ return status;
++}
++
++static int
++kalmia_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int status;
++ u8 ethernet_addr[ETH_ALEN];
++
++ /* Don't bind to AT command interface */
++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
++ return -EINVAL;
++
++ dev->in = usb_rcvbulkpipe(dev->udev, 0x81 & USB_ENDPOINT_NUMBER_MASK);
++ dev->out = usb_sndbulkpipe(dev->udev, 0x02 & USB_ENDPOINT_NUMBER_MASK);
++ dev->status = NULL;
++
++ dev->net->hard_header_len += KALMIA_HEADER_LENGTH;
++ dev->hard_mtu = 1400;
++ dev->rx_urb_size = dev->hard_mtu * 10; // Found as optimal after testing
++
++ status = kalmia_init_and_get_ethernet_addr(dev, ethernet_addr);
++
++ if (status < 0) {
++ usb_set_intfdata(intf, NULL);
++ usb_driver_release_interface(driver_of(intf), intf);
++ return status;
++ }
++
++ memcpy(dev->net->dev_addr, ethernet_addr, ETH_ALEN);
++
++ return status;
++}
++
++static struct sk_buff *
++kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
++{
++ struct sk_buff *skb2 = NULL;
++ u16 content_len;
++ unsigned char *header_start;
++ unsigned char ether_type_1, ether_type_2;
++ u8 remainder, padlen = 0;
++
++ if (!skb_cloned(skb)) {
++ int headroom = skb_headroom(skb);
++ int tailroom = skb_tailroom(skb);
++
++ if ((tailroom >= KALMIA_ALIGN_SIZE) && (headroom
++ >= KALMIA_HEADER_LENGTH))
++ goto done;
++
++ if ((headroom + tailroom) > (KALMIA_HEADER_LENGTH
++ + KALMIA_ALIGN_SIZE)) {
++ skb->data = memmove(skb->head + KALMIA_HEADER_LENGTH,
++ skb->data, skb->len);
++ skb_set_tail_pointer(skb, skb->len);
++ goto done;
++ }
++ }
++
++ skb2 = skb_copy_expand(skb, KALMIA_HEADER_LENGTH,
++ KALMIA_ALIGN_SIZE, flags);
++ if (!skb2)
++ return NULL;
++
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++
++done:
++ header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
++ ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12];
++ ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13];
++
++ netdev_dbg(dev->net, "Sending etherType: %02x%02x", ether_type_1,
++ ether_type_2);
++
++ /* According to empiric data for data packages */
++ header_start[0] = 0x57;
++ header_start[1] = 0x44;
++ content_len = skb->len - KALMIA_HEADER_LENGTH;
++
++ put_unaligned_le16(content_len, &header_start[2]);
++ header_start[4] = ether_type_1;
++ header_start[5] = ether_type_2;
++
++ /* Align to 4 bytes by padding with zeros */
++ remainder = skb->len % KALMIA_ALIGN_SIZE;
++ if (remainder > 0) {
++ padlen = KALMIA_ALIGN_SIZE - remainder;
++ memset(skb_put(skb, padlen), 0, padlen);
++ }
++
++ netdev_dbg(dev->net,
++ "Sending package with length %i and padding %i. Header: %6phC.",
++ content_len, padlen, header_start);
++
++ return skb;
++}
++
++static int
++kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ /*
++ * Our task here is to strip off framing, leaving skb with one
++ * data frame for the usbnet framework code to process.
++ */
++ static const u8 HEADER_END_OF_USB_PACKET[] =
++ { 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 };
++ static const u8 EXPECTED_UNKNOWN_HEADER_1[] =
++ { 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 };
++ static const u8 EXPECTED_UNKNOWN_HEADER_2[] =
++ { 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 };
++ int i = 0;
++
++ /* incomplete header? */
++ if (skb->len < KALMIA_HEADER_LENGTH)
++ return 0;
++
++ do {
++ struct sk_buff *skb2 = NULL;
++ u8 *header_start;
++ u16 usb_packet_length, ether_packet_length;
++ int is_last;
++
++ header_start = skb->data;
++
++ if (unlikely(header_start[0] != 0x57 || header_start[1] != 0x44)) {
++ if (!memcmp(header_start, EXPECTED_UNKNOWN_HEADER_1,
++ sizeof(EXPECTED_UNKNOWN_HEADER_1)) || !memcmp(
++ header_start, EXPECTED_UNKNOWN_HEADER_2,
++ sizeof(EXPECTED_UNKNOWN_HEADER_2))) {
++ netdev_dbg(dev->net,
++ "Received expected unknown frame header: %6phC. Package length: %i\n",
++ header_start,
++ skb->len - KALMIA_HEADER_LENGTH);
++ }
++ else {
++ netdev_err(dev->net,
++ "Received unknown frame header: %6phC. Package length: %i\n",
++ header_start,
++ skb->len - KALMIA_HEADER_LENGTH);
++ return 0;
++ }
++ }
++ else
++ netdev_dbg(dev->net,
++ "Received header: %6phC. Package length: %i\n",
++ header_start, skb->len - KALMIA_HEADER_LENGTH);
++
++ /* subtract start header and end header */
++ usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH);
++ ether_packet_length = get_unaligned_le16(&header_start[2]);
++ skb_pull(skb, KALMIA_HEADER_LENGTH);
++
++ /* Some small packets misses end marker */
++ if (usb_packet_length < ether_packet_length) {
++ ether_packet_length = usb_packet_length
++ + KALMIA_HEADER_LENGTH;
++ is_last = true;
++ }
++ else {
++ netdev_dbg(dev->net, "Correct package length #%i", i
++ + 1);
++
++ is_last = (memcmp(skb->data + ether_packet_length,
++ HEADER_END_OF_USB_PACKET,
++ sizeof(HEADER_END_OF_USB_PACKET)) == 0);
++ if (!is_last) {
++ header_start = skb->data + ether_packet_length;
++ netdev_dbg(dev->net,
++ "End header: %6phC. Package length: %i\n",
++ header_start,
++ skb->len - KALMIA_HEADER_LENGTH);
++ }
++ }
++
++ if (is_last) {
++ skb2 = skb;
++ }
++ else {
++ skb2 = skb_clone(skb, GFP_ATOMIC);
++ if (unlikely(!skb2))
++ return 0;
++ }
++
++ skb_trim(skb2, ether_packet_length);
++
++ if (is_last) {
++ return 1;
++ }
++ else {
++ usbnet_skb_return(dev, skb2);
++ skb_pull(skb, ether_packet_length);
++ }
++
++ i++;
++ }
++ while (skb->len);
++
++ return 1;
++}
++
++static const struct driver_info kalmia_info = {
++ .description = "Samsung Kalmia LTE USB dongle",
++ .flags = FLAG_WWAN,
++ .bind = kalmia_bind,
++ .rx_fixup = kalmia_rx_fixup,
++ .tx_fixup = kalmia_tx_fixup
++};
++
++/*-------------------------------------------------------------------------*/
++
++static const struct usb_device_id products[] = {
++ /* The unswitched USB ID, to get the module auto loaded: */
++ { USB_DEVICE(0x04e8, 0x689a) },
++ /* The stick swithed into modem (by e.g. usb_modeswitch): */
++ { USB_DEVICE(0x04e8, 0x6889),
++ .driver_info = (unsigned long) &kalmia_info, },
++ { /* EMPTY == end of list */} };
++MODULE_DEVICE_TABLE( usb, products);
++
++static struct usb_driver kalmia_driver = {
++ .name = "kalmia",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(kalmia_driver);
++
++MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>");
++MODULE_DESCRIPTION("Samsung Kalmia USB network driver");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/kaweth.c backports-3.18.1-1/drivers/net/usb/kaweth.c
+--- backports-3.18.1-1.org/drivers/net/usb/kaweth.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/kaweth.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,1331 @@
++/****************************************************************
++ *
++ * kaweth.c - driver for KL5KUSB101 based USB->Ethernet
++ *
++ * (c) 2000 Interlan Communications
++ * (c) 2000 Stephane Alnet
++ * (C) 2001 Brad Hards
++ * (C) 2002 Oliver Neukum
++ *
++ * Original author: The Zapman <zapman@interlan.net>
++ * Inspired by, and much credit goes to Michael Rothwell
++ * <rothwell@interlan.net> for the test equipment, help, and patience
++ * Based off of (and with thanks to) Petko Manolov's pegaus.c driver.
++ * Also many thanks to Joel Silverman and Ed Surprenant at Kawasaki
++ * for providing the firmware and driver resources.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ *
++ ****************************************************************/
++
++/* TODO:
++ * Develop test procedures for USB net interfaces
++ * Run test procedures
++ * Fix bugs from previous two steps
++ * Snoop other OSs for any tricks we're not doing
++ * Reduce arbitrary timeouts
++ * Smart multicast support
++ * Temporary MAC change support
++ * Tunable SOFs parameter - ioctl()?
++ * Ethernet stats collection
++ * Code formatting improvements
++ */
++
++#include <linux/module.h>
++#include <linux/slab.h>
++#include <linux/string.h>
++#include <linux/delay.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/usb.h>
++#include <linux/types.h>
++#include <linux/ethtool.h>
++#include <linux/dma-mapping.h>
++#include <linux/wait.h>
++#include <linux/firmware.h>
++#include <asm/uaccess.h>
++#include <asm/byteorder.h>
++
++#undef DEBUG
++
++#define KAWETH_MTU 1514
++#define KAWETH_BUF_SIZE 1664
++#define KAWETH_TX_TIMEOUT (5 * HZ)
++#define KAWETH_SCRATCH_SIZE 32
++#define KAWETH_FIRMWARE_BUF_SIZE 4096
++#define KAWETH_CONTROL_TIMEOUT (30000)
++
++#define KAWETH_STATUS_BROKEN 0x0000001
++#define KAWETH_STATUS_CLOSING 0x0000002
++#define KAWETH_STATUS_SUSPENDING 0x0000004
++
++#define KAWETH_STATUS_BLOCKED (KAWETH_STATUS_CLOSING | KAWETH_STATUS_SUSPENDING)
++
++#define KAWETH_PACKET_FILTER_PROMISCUOUS 0x01
++#define KAWETH_PACKET_FILTER_ALL_MULTICAST 0x02
++#define KAWETH_PACKET_FILTER_DIRECTED 0x04
++#define KAWETH_PACKET_FILTER_BROADCAST 0x08
++#define KAWETH_PACKET_FILTER_MULTICAST 0x10
++
++/* Table 7 */
++#define KAWETH_COMMAND_GET_ETHERNET_DESC 0x00
++#define KAWETH_COMMAND_MULTICAST_FILTERS 0x01
++#define KAWETH_COMMAND_SET_PACKET_FILTER 0x02
++#define KAWETH_COMMAND_STATISTICS 0x03
++#define KAWETH_COMMAND_SET_TEMP_MAC 0x06
++#define KAWETH_COMMAND_GET_TEMP_MAC 0x07
++#define KAWETH_COMMAND_SET_URB_SIZE 0x08
++#define KAWETH_COMMAND_SET_SOFS_WAIT 0x09
++#define KAWETH_COMMAND_SCAN 0xFF
++
++#define KAWETH_SOFS_TO_WAIT 0x05
++
++#define INTBUFFERSIZE 4
++
++#define STATE_OFFSET 0
++#define STATE_MASK 0x40
++#define STATE_SHIFT 5
++
++#define IS_BLOCKED(s) (s & KAWETH_STATUS_BLOCKED)
++
++
++MODULE_AUTHOR("Michael Zappe <zapman@interlan.net>, Stephane Alnet <stephane@u-picardie.fr>, Brad Hards <bhards@bigpond.net.au> and Oliver Neukum <oliver@neukum.org>");
++MODULE_DESCRIPTION("KL5USB101 USB Ethernet driver");
++MODULE_LICENSE("GPL");
++MODULE_FIRMWARE("kaweth/new_code.bin");
++MODULE_FIRMWARE("kaweth/new_code_fix.bin");
++MODULE_FIRMWARE("kaweth/trigger_code.bin");
++MODULE_FIRMWARE("kaweth/trigger_code_fix.bin");
++
++static const char driver_name[] = "kaweth";
++
++static int kaweth_probe(
++ struct usb_interface *intf,
++ const struct usb_device_id *id /* from id_table */
++ );
++static void kaweth_disconnect(struct usb_interface *intf);
++static int kaweth_internal_control_msg(struct usb_device *usb_dev,
++ unsigned int pipe,
++ struct usb_ctrlrequest *cmd, void *data,
++ int len, int timeout);
++static int kaweth_suspend(struct usb_interface *intf, pm_message_t message);
++static int kaweth_resume(struct usb_interface *intf);
++
++/****************************************************************
++ * usb_device_id
++ ****************************************************************/
++static struct usb_device_id usb_klsi_table[] = {
++ { USB_DEVICE(0x03e8, 0x0008) }, /* AOX Endpoints USB Ethernet */
++ { USB_DEVICE(0x04bb, 0x0901) }, /* I-O DATA USB-ET/T */
++ { USB_DEVICE(0x0506, 0x03e8) }, /* 3Com 3C19250 */
++ { USB_DEVICE(0x0506, 0x11f8) }, /* 3Com 3C460 */
++ { USB_DEVICE(0x0557, 0x2002) }, /* ATEN USB Ethernet */
++ { USB_DEVICE(0x0557, 0x4000) }, /* D-Link DSB-650C */
++ { USB_DEVICE(0x0565, 0x0002) }, /* Peracom Enet */
++ { USB_DEVICE(0x0565, 0x0003) }, /* Optus@Home UEP1045A */
++ { USB_DEVICE(0x0565, 0x0005) }, /* Peracom Enet2 */
++ { USB_DEVICE(0x05e9, 0x0008) }, /* KLSI KL5KUSB101B */
++ { USB_DEVICE(0x05e9, 0x0009) }, /* KLSI KL5KUSB101B (Board change) */
++ { USB_DEVICE(0x066b, 0x2202) }, /* Linksys USB10T */
++ { USB_DEVICE(0x06e1, 0x0008) }, /* ADS USB-10BT */
++ { USB_DEVICE(0x06e1, 0x0009) }, /* ADS USB-10BT */
++ { USB_DEVICE(0x0707, 0x0100) }, /* SMC 2202USB */
++ { USB_DEVICE(0x07aa, 0x0001) }, /* Correga K.K. */
++ { USB_DEVICE(0x07b8, 0x4000) }, /* D-Link DU-E10 */
++ { USB_DEVICE(0x07c9, 0xb010) }, /* Allied Telesyn AT-USB10 USB Ethernet Adapter */
++ { USB_DEVICE(0x0846, 0x1001) }, /* NetGear EA-101 */
++ { USB_DEVICE(0x0846, 0x1002) }, /* NetGear EA-101 */
++ { USB_DEVICE(0x085a, 0x0008) }, /* PortGear Ethernet Adapter */
++ { USB_DEVICE(0x085a, 0x0009) }, /* PortGear Ethernet Adapter */
++ { USB_DEVICE(0x087d, 0x5704) }, /* Jaton USB Ethernet Device Adapter */
++ { USB_DEVICE(0x0951, 0x0008) }, /* Kingston Technology USB Ethernet Adapter */
++ { USB_DEVICE(0x095a, 0x3003) }, /* Portsmith Express Ethernet Adapter */
++ { USB_DEVICE(0x10bd, 0x1427) }, /* ASANTE USB To Ethernet Adapter */
++ { USB_DEVICE(0x1342, 0x0204) }, /* Mobility USB-Ethernet Adapter */
++ { USB_DEVICE(0x13d2, 0x0400) }, /* Shark Pocket Adapter */
++ { USB_DEVICE(0x1485, 0x0001) }, /* Silicom U2E */
++ { USB_DEVICE(0x1485, 0x0002) }, /* Psion Dacom Gold Port Ethernet */
++ { USB_DEVICE(0x1645, 0x0005) }, /* Entrega E45 */
++ { USB_DEVICE(0x1645, 0x0008) }, /* Entrega USB Ethernet Adapter */
++ { USB_DEVICE(0x1645, 0x8005) }, /* PortGear Ethernet Adapter */
++ { USB_DEVICE(0x1668, 0x0323) }, /* Actiontec USB Ethernet */
++ { USB_DEVICE(0x2001, 0x4000) }, /* D-link DSB-650C */
++ {} /* Null terminator */
++};
++
++MODULE_DEVICE_TABLE (usb, usb_klsi_table);
++
++/****************************************************************
++ * kaweth_driver
++ ****************************************************************/
++static struct usb_driver kaweth_driver = {
++ .name = driver_name,
++ .probe = kaweth_probe,
++ .disconnect = kaweth_disconnect,
++ .suspend = kaweth_suspend,
++ .resume = kaweth_resume,
++ .id_table = usb_klsi_table,
++ .supports_autosuspend = 1,
++ .disable_hub_initiated_lpm = 1,
++};
++
++typedef __u8 eth_addr_t[6];
++
++/****************************************************************
++ * usb_eth_dev
++ ****************************************************************/
++struct usb_eth_dev {
++ char *name;
++ __u16 vendor;
++ __u16 device;
++ void *pdata;
++};
++
++/****************************************************************
++ * kaweth_ethernet_configuration
++ * Refer Table 8
++ ****************************************************************/
++struct kaweth_ethernet_configuration
++{
++ __u8 size;
++ __u8 reserved1;
++ __u8 reserved2;
++ eth_addr_t hw_addr;
++ __u32 statistics_mask;
++ __le16 segment_size;
++ __u16 max_multicast_filters;
++ __u8 reserved3;
++} __packed;
++
++/****************************************************************
++ * kaweth_device
++ ****************************************************************/
++struct kaweth_device
++{
++ spinlock_t device_lock;
++
++ __u32 status;
++ int end;
++ int suspend_lowmem_rx;
++ int suspend_lowmem_ctrl;
++ int linkstate;
++ int opened;
++ struct delayed_work lowmem_work;
++
++ struct usb_device *dev;
++ struct usb_interface *intf;
++ struct net_device *net;
++ wait_queue_head_t term_wait;
++
++ struct urb *rx_urb;
++ struct urb *tx_urb;
++ struct urb *irq_urb;
++
++ dma_addr_t intbufferhandle;
++ __u8 *intbuffer;
++ dma_addr_t rxbufferhandle;
++ __u8 *rx_buf;
++
++
++ struct sk_buff *tx_skb;
++
++ __u8 *firmware_buf;
++ __u8 scratch[KAWETH_SCRATCH_SIZE];
++ __u16 packet_filter_bitmap;
++
++ struct kaweth_ethernet_configuration configuration;
++
++ struct net_device_stats stats;
++};
++
++/****************************************************************
++ * kaweth_control
++ ****************************************************************/
++static int kaweth_control(struct kaweth_device *kaweth,
++ unsigned int pipe,
++ __u8 request,
++ __u8 requesttype,
++ __u16 value,
++ __u16 index,
++ void *data,
++ __u16 size,
++ int timeout)
++{
++ struct usb_ctrlrequest *dr;
++ int retval;
++
++ netdev_dbg(kaweth->net, "kaweth_control()\n");
++
++ if(in_interrupt()) {
++ netdev_dbg(kaweth->net, "in_interrupt()\n");
++ return -EBUSY;
++ }
++
++ dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
++ if (!dr)
++ return -ENOMEM;
++
++ dr->bRequestType = requesttype;
++ dr->bRequest = request;
++ dr->wValue = cpu_to_le16(value);
++ dr->wIndex = cpu_to_le16(index);
++ dr->wLength = cpu_to_le16(size);
++
++ retval = kaweth_internal_control_msg(kaweth->dev,
++ pipe,
++ dr,
++ data,
++ size,
++ timeout);
++
++ kfree(dr);
++ return retval;
++}
++
++/****************************************************************
++ * kaweth_read_configuration
++ ****************************************************************/
++static int kaweth_read_configuration(struct kaweth_device *kaweth)
++{
++ int retval;
++
++ netdev_dbg(kaweth->net, "Reading kaweth configuration\n");
++
++ retval = kaweth_control(kaweth,
++ usb_rcvctrlpipe(kaweth->dev, 0),
++ KAWETH_COMMAND_GET_ETHERNET_DESC,
++ USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE,
++ 0,
++ 0,
++ (void *)&kaweth->configuration,
++ sizeof(kaweth->configuration),
++ KAWETH_CONTROL_TIMEOUT);
++
++ return retval;
++}
++
++/****************************************************************
++ * kaweth_set_urb_size
++ ****************************************************************/
++static int kaweth_set_urb_size(struct kaweth_device *kaweth, __u16 urb_size)
++{
++ int retval;
++
++ netdev_dbg(kaweth->net, "Setting URB size to %d\n", (unsigned)urb_size);
++
++ retval = kaweth_control(kaweth,
++ usb_sndctrlpipe(kaweth->dev, 0),
++ KAWETH_COMMAND_SET_URB_SIZE,
++ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
++ urb_size,
++ 0,
++ (void *)&kaweth->scratch,
++ 0,
++ KAWETH_CONTROL_TIMEOUT);
++
++ return retval;
++}
++
++/****************************************************************
++ * kaweth_set_sofs_wait
++ ****************************************************************/
++static int kaweth_set_sofs_wait(struct kaweth_device *kaweth, __u16 sofs_wait)
++{
++ int retval;
++
++ netdev_dbg(kaweth->net, "Set SOFS wait to %d\n", (unsigned)sofs_wait);
++
++ retval = kaweth_control(kaweth,
++ usb_sndctrlpipe(kaweth->dev, 0),
++ KAWETH_COMMAND_SET_SOFS_WAIT,
++ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
++ sofs_wait,
++ 0,
++ (void *)&kaweth->scratch,
++ 0,
++ KAWETH_CONTROL_TIMEOUT);
++
++ return retval;
++}
++
++/****************************************************************
++ * kaweth_set_receive_filter
++ ****************************************************************/
++static int kaweth_set_receive_filter(struct kaweth_device *kaweth,
++ __u16 receive_filter)
++{
++ int retval;
++
++ netdev_dbg(kaweth->net, "Set receive filter to %d\n",
++ (unsigned)receive_filter);
++
++ retval = kaweth_control(kaweth,
++ usb_sndctrlpipe(kaweth->dev, 0),
++ KAWETH_COMMAND_SET_PACKET_FILTER,
++ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
++ receive_filter,
++ 0,
++ (void *)&kaweth->scratch,
++ 0,
++ KAWETH_CONTROL_TIMEOUT);
++
++ return retval;
++}
++
++/****************************************************************
++ * kaweth_download_firmware
++ ****************************************************************/
++static int kaweth_download_firmware(struct kaweth_device *kaweth,
++ const char *fwname,
++ __u8 interrupt,
++ __u8 type)
++{
++ const struct firmware *fw;
++ int data_len;
++ int ret;
++
++ ret = request_firmware(&fw, fwname, &kaweth->dev->dev);
++ if (ret) {
++ dev_err(&kaweth->intf->dev, "Firmware request failed\n");
++ return ret;
++ }
++
++ if (fw->size > KAWETH_FIRMWARE_BUF_SIZE) {
++ dev_err(&kaweth->intf->dev, "Firmware too big: %zu\n",
++ fw->size);
++ release_firmware(fw);
++ return -ENOSPC;
++ }
++ data_len = fw->size;
++ memcpy(kaweth->firmware_buf, fw->data, fw->size);
++
++ release_firmware(fw);
++
++ kaweth->firmware_buf[2] = (data_len & 0xFF) - 7;
++ kaweth->firmware_buf[3] = data_len >> 8;
++ kaweth->firmware_buf[4] = type;
++ kaweth->firmware_buf[5] = interrupt;
++
++ netdev_dbg(kaweth->net, "High: %i, Low:%i\n", kaweth->firmware_buf[3],
++ kaweth->firmware_buf[2]);
++
++ netdev_dbg(kaweth->net,
++ "Downloading firmware at %p to kaweth device at %p\n",
++ kaweth->firmware_buf, kaweth);
++ netdev_dbg(kaweth->net, "Firmware length: %d\n", data_len);
++
++ return kaweth_control(kaweth,
++ usb_sndctrlpipe(kaweth->dev, 0),
++ KAWETH_COMMAND_SCAN,
++ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
++ 0,
++ 0,
++ (void *)kaweth->firmware_buf,
++ data_len,
++ KAWETH_CONTROL_TIMEOUT);
++}
++
++/****************************************************************
++ * kaweth_trigger_firmware
++ ****************************************************************/
++static int kaweth_trigger_firmware(struct kaweth_device *kaweth,
++ __u8 interrupt)
++{
++ kaweth->firmware_buf[0] = 0xB6;
++ kaweth->firmware_buf[1] = 0xC3;
++ kaweth->firmware_buf[2] = 0x01;
++ kaweth->firmware_buf[3] = 0x00;
++ kaweth->firmware_buf[4] = 0x06;
++ kaweth->firmware_buf[5] = interrupt;
++ kaweth->firmware_buf[6] = 0x00;
++ kaweth->firmware_buf[7] = 0x00;
++
++ netdev_dbg(kaweth->net, "Triggering firmware\n");
++
++ return kaweth_control(kaweth,
++ usb_sndctrlpipe(kaweth->dev, 0),
++ KAWETH_COMMAND_SCAN,
++ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
++ 0,
++ 0,
++ (void *)kaweth->firmware_buf,
++ 8,
++ KAWETH_CONTROL_TIMEOUT);
++}
++
++/****************************************************************
++ * kaweth_reset
++ ****************************************************************/
++static int kaweth_reset(struct kaweth_device *kaweth)
++{
++ int result;
++
++ netdev_dbg(kaweth->net, "kaweth_reset(%p)\n", kaweth);
++ result = usb_reset_configuration(kaweth->dev);
++ mdelay(10);
++
++ netdev_dbg(kaweth->net, "kaweth_reset() returns %d.\n", result);
++
++ return result;
++}
++
++static void kaweth_usb_receive(struct urb *);
++static int kaweth_resubmit_rx_urb(struct kaweth_device *, gfp_t);
++
++/****************************************************************
++ int_callback
++*****************************************************************/
++
++static void kaweth_resubmit_int_urb(struct kaweth_device *kaweth, gfp_t mf)
++{
++ int status;
++
++ status = usb_submit_urb (kaweth->irq_urb, mf);
++ if (unlikely(status == -ENOMEM)) {
++ kaweth->suspend_lowmem_ctrl = 1;
++ schedule_delayed_work(&kaweth->lowmem_work, HZ/4);
++ } else {
++ kaweth->suspend_lowmem_ctrl = 0;
++ }
++
++ if (status)
++ dev_err(&kaweth->intf->dev,
++ "can't resubmit intr, %s-%s, status %d\n",
++ kaweth->dev->bus->bus_name,
++ kaweth->dev->devpath, status);
++}
++
++static void int_callback(struct urb *u)
++{
++ struct kaweth_device *kaweth = u->context;
++ int act_state;
++ int status = u->status;
++
++ switch (status) {
++ case 0: /* success */
++ break;
++ case -ECONNRESET: /* unlink */
++ case -ENOENT:
++ case -ESHUTDOWN:
++ return;
++ /* -EPIPE: should clear the halt */
++ default: /* error */
++ goto resubmit;
++ }
++
++ /* we check the link state to report changes */
++ if (kaweth->linkstate != (act_state = ( kaweth->intbuffer[STATE_OFFSET] | STATE_MASK) >> STATE_SHIFT)) {
++ if (act_state)
++ netif_carrier_on(kaweth->net);
++ else
++ netif_carrier_off(kaweth->net);
++
++ kaweth->linkstate = act_state;
++ }
++resubmit:
++ kaweth_resubmit_int_urb(kaweth, GFP_ATOMIC);
++}
++
++static void kaweth_resubmit_tl(struct work_struct *work)
++{
++ struct kaweth_device *kaweth =
++ container_of(work, struct kaweth_device, lowmem_work.work);
++
++ if (IS_BLOCKED(kaweth->status))
++ return;
++
++ if (kaweth->suspend_lowmem_rx)
++ kaweth_resubmit_rx_urb(kaweth, GFP_NOIO);
++
++ if (kaweth->suspend_lowmem_ctrl)
++ kaweth_resubmit_int_urb(kaweth, GFP_NOIO);
++}
++
++
++/****************************************************************
++ * kaweth_resubmit_rx_urb
++ ****************************************************************/
++static int kaweth_resubmit_rx_urb(struct kaweth_device *kaweth,
++ gfp_t mem_flags)
++{
++ int result;
++
++ usb_fill_bulk_urb(kaweth->rx_urb,
++ kaweth->dev,
++ usb_rcvbulkpipe(kaweth->dev, 1),
++ kaweth->rx_buf,
++ KAWETH_BUF_SIZE,
++ kaweth_usb_receive,
++ kaweth);
++ kaweth->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
++ kaweth->rx_urb->transfer_dma = kaweth->rxbufferhandle;
++
++ if((result = usb_submit_urb(kaweth->rx_urb, mem_flags))) {
++ if (result == -ENOMEM) {
++ kaweth->suspend_lowmem_rx = 1;
++ schedule_delayed_work(&kaweth->lowmem_work, HZ/4);
++ }
++ dev_err(&kaweth->intf->dev, "resubmitting rx_urb %d failed\n",
++ result);
++ } else {
++ kaweth->suspend_lowmem_rx = 0;
++ }
++
++ return result;
++}
++
++static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth);
++
++/****************************************************************
++ * kaweth_usb_receive
++ ****************************************************************/
++static void kaweth_usb_receive(struct urb *urb)
++{
++ struct device *dev = &urb->dev->dev;
++ struct kaweth_device *kaweth = urb->context;
++ struct net_device *net = kaweth->net;
++ int status = urb->status;
++
++ int count = urb->actual_length;
++ int count2 = urb->transfer_buffer_length;
++
++ __u16 pkt_len = le16_to_cpup((__le16 *)kaweth->rx_buf);
++
++ struct sk_buff *skb;
++
++ if (unlikely(status == -EPIPE)) {
++ kaweth->stats.rx_errors++;
++ kaweth->end = 1;
++ wake_up(&kaweth->term_wait);
++ dev_dbg(dev, "Status was -EPIPE.\n");
++ return;
++ }
++ if (unlikely(status == -ECONNRESET || status == -ESHUTDOWN)) {
++ /* we are killed - set a flag and wake the disconnect handler */
++ kaweth->end = 1;
++ wake_up(&kaweth->term_wait);
++ dev_dbg(dev, "Status was -ECONNRESET or -ESHUTDOWN.\n");
++ return;
++ }
++ if (unlikely(status == -EPROTO || status == -ETIME ||
++ status == -EILSEQ)) {
++ kaweth->stats.rx_errors++;
++ dev_dbg(dev, "Status was -EPROTO, -ETIME, or -EILSEQ.\n");
++ return;
++ }
++ if (unlikely(status == -EOVERFLOW)) {
++ kaweth->stats.rx_errors++;
++ dev_dbg(dev, "Status was -EOVERFLOW.\n");
++ }
++ spin_lock(&kaweth->device_lock);
++ if (IS_BLOCKED(kaweth->status)) {
++ spin_unlock(&kaweth->device_lock);
++ return;
++ }
++ spin_unlock(&kaweth->device_lock);
++
++ if(status && status != -EREMOTEIO && count != 1) {
++ dev_err(&kaweth->intf->dev,
++ "%s RX status: %d count: %d packet_len: %d\n",
++ net->name, status, count, (int)pkt_len);
++ kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
++ return;
++ }
++
++ if(kaweth->net && (count > 2)) {
++ if(pkt_len > (count - 2)) {
++ dev_err(&kaweth->intf->dev,
++ "Packet length too long for USB frame (pkt_len: %x, count: %x)\n",
++ pkt_len, count);
++ dev_err(&kaweth->intf->dev, "Packet len & 2047: %x\n",
++ pkt_len & 2047);
++ dev_err(&kaweth->intf->dev, "Count 2: %x\n", count2);
++ kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
++ return;
++ }
++
++ if(!(skb = dev_alloc_skb(pkt_len+2))) {
++ kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
++ return;
++ }
++
++ skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
++
++ skb_copy_to_linear_data(skb, kaweth->rx_buf + 2, pkt_len);
++
++ skb_put(skb, pkt_len);
++
++ skb->protocol = eth_type_trans(skb, net);
++
++ netif_rx(skb);
++
++ kaweth->stats.rx_packets++;
++ kaweth->stats.rx_bytes += pkt_len;
++ }
++
++ kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
++}
++
++/****************************************************************
++ * kaweth_open
++ ****************************************************************/
++static int kaweth_open(struct net_device *net)
++{
++ struct kaweth_device *kaweth = netdev_priv(net);
++ int res;
++
++ netdev_dbg(kaweth->net, "Opening network device.\n");
++
++ res = usb_autopm_get_interface(kaweth->intf);
++ if (res) {
++ dev_err(&kaweth->intf->dev, "Interface cannot be resumed.\n");
++ return -EIO;
++ }
++ res = kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL);
++ if (res)
++ goto err_out;
++
++ usb_fill_int_urb(
++ kaweth->irq_urb,
++ kaweth->dev,
++ usb_rcvintpipe(kaweth->dev, 3),
++ kaweth->intbuffer,
++ INTBUFFERSIZE,
++ int_callback,
++ kaweth,
++ 250); /* overriding the descriptor */
++ kaweth->irq_urb->transfer_dma = kaweth->intbufferhandle;
++ kaweth->irq_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
++
++ res = usb_submit_urb(kaweth->irq_urb, GFP_KERNEL);
++ if (res) {
++ usb_kill_urb(kaweth->rx_urb);
++ goto err_out;
++ }
++ kaweth->opened = 1;
++
++ netif_start_queue(net);
++
++ kaweth_async_set_rx_mode(kaweth);
++ return 0;
++
++err_out:
++ usb_autopm_put_interface(kaweth->intf);
++ return -EIO;
++}
++
++/****************************************************************
++ * kaweth_kill_urbs
++ ****************************************************************/
++static void kaweth_kill_urbs(struct kaweth_device *kaweth)
++{
++ usb_kill_urb(kaweth->irq_urb);
++ usb_kill_urb(kaweth->rx_urb);
++ usb_kill_urb(kaweth->tx_urb);
++
++ cancel_delayed_work_sync(&kaweth->lowmem_work);
++
++ /* a scheduled work may have resubmitted,
++ we hit them again */
++ usb_kill_urb(kaweth->irq_urb);
++ usb_kill_urb(kaweth->rx_urb);
++}
++
++/****************************************************************
++ * kaweth_close
++ ****************************************************************/
++static int kaweth_close(struct net_device *net)
++{
++ struct kaweth_device *kaweth = netdev_priv(net);
++
++ netif_stop_queue(net);
++ kaweth->opened = 0;
++
++ kaweth->status |= KAWETH_STATUS_CLOSING;
++
++ kaweth_kill_urbs(kaweth);
++
++ kaweth->status &= ~KAWETH_STATUS_CLOSING;
++
++ usb_autopm_put_interface(kaweth->intf);
++
++ return 0;
++}
++
++static u32 kaweth_get_link(struct net_device *dev)
++{
++ struct kaweth_device *kaweth = netdev_priv(dev);
++
++ return kaweth->linkstate;
++}
++
++static const struct ethtool_ops ops = {
++ .get_link = kaweth_get_link
++};
++
++/****************************************************************
++ * kaweth_usb_transmit_complete
++ ****************************************************************/
++static void kaweth_usb_transmit_complete(struct urb *urb)
++{
++ struct kaweth_device *kaweth = urb->context;
++ struct sk_buff *skb = kaweth->tx_skb;
++ int status = urb->status;
++
++ if (unlikely(status != 0))
++ if (status != -ENOENT)
++ dev_dbg(&urb->dev->dev, "%s: TX status %d.\n",
++ kaweth->net->name, status);
++
++ netif_wake_queue(kaweth->net);
++ dev_kfree_skb_irq(skb);
++}
++
++/****************************************************************
++ * kaweth_start_xmit
++ ****************************************************************/
++static netdev_tx_t kaweth_start_xmit(struct sk_buff *skb,
++ struct net_device *net)
++{
++ struct kaweth_device *kaweth = netdev_priv(net);
++ __le16 *private_header;
++
++ int res;
++
++ spin_lock_irq(&kaweth->device_lock);
++
++ kaweth_async_set_rx_mode(kaweth);
++ netif_stop_queue(net);
++ if (IS_BLOCKED(kaweth->status)) {
++ goto skip;
++ }
++
++ /* We now decide whether we can put our special header into the sk_buff */
++ if (skb_cloned(skb) || skb_headroom(skb) < 2) {
++ /* no such luck - we make our own */
++ struct sk_buff *copied_skb;
++ copied_skb = skb_copy_expand(skb, 2, 0, GFP_ATOMIC);
++ dev_kfree_skb_irq(skb);
++ skb = copied_skb;
++ if (!copied_skb) {
++ kaweth->stats.tx_errors++;
++ netif_start_queue(net);
++ spin_unlock_irq(&kaweth->device_lock);
++ return NETDEV_TX_OK;
++ }
++ }
++
++ private_header = (__le16 *)__skb_push(skb, 2);
++ *private_header = cpu_to_le16(skb->len-2);
++ kaweth->tx_skb = skb;
++
++ usb_fill_bulk_urb(kaweth->tx_urb,
++ kaweth->dev,
++ usb_sndbulkpipe(kaweth->dev, 2),
++ private_header,
++ skb->len,
++ kaweth_usb_transmit_complete,
++ kaweth);
++ kaweth->end = 0;
++
++ if((res = usb_submit_urb(kaweth->tx_urb, GFP_ATOMIC)))
++ {
++ dev_warn(&net->dev, "kaweth failed tx_urb %d\n", res);
++skip:
++ kaweth->stats.tx_errors++;
++
++ netif_start_queue(net);
++ dev_kfree_skb_irq(skb);
++ }
++ else
++ {
++ kaweth->stats.tx_packets++;
++ kaweth->stats.tx_bytes += skb->len;
++ }
++
++ spin_unlock_irq(&kaweth->device_lock);
++
++ return NETDEV_TX_OK;
++}
++
++/****************************************************************
++ * kaweth_set_rx_mode
++ ****************************************************************/
++static void kaweth_set_rx_mode(struct net_device *net)
++{
++ struct kaweth_device *kaweth = netdev_priv(net);
++
++ __u16 packet_filter_bitmap = KAWETH_PACKET_FILTER_DIRECTED |
++ KAWETH_PACKET_FILTER_BROADCAST |
++ KAWETH_PACKET_FILTER_MULTICAST;
++
++ netdev_dbg(net, "Setting Rx mode to %d\n", packet_filter_bitmap);
++
++ netif_stop_queue(net);
++
++ if (net->flags & IFF_PROMISC) {
++ packet_filter_bitmap |= KAWETH_PACKET_FILTER_PROMISCUOUS;
++ }
++ else if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) {
++ packet_filter_bitmap |= KAWETH_PACKET_FILTER_ALL_MULTICAST;
++ }
++
++ kaweth->packet_filter_bitmap = packet_filter_bitmap;
++ netif_wake_queue(net);
++}
++
++/****************************************************************
++ * kaweth_async_set_rx_mode
++ ****************************************************************/
++static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth)
++{
++ int result;
++ __u16 packet_filter_bitmap = kaweth->packet_filter_bitmap;
++
++ kaweth->packet_filter_bitmap = 0;
++ if (packet_filter_bitmap == 0)
++ return;
++
++ if (in_interrupt())
++ return;
++
++ result = kaweth_control(kaweth,
++ usb_sndctrlpipe(kaweth->dev, 0),
++ KAWETH_COMMAND_SET_PACKET_FILTER,
++ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
++ packet_filter_bitmap,
++ 0,
++ (void *)&kaweth->scratch,
++ 0,
++ KAWETH_CONTROL_TIMEOUT);
++
++ if(result < 0) {
++ dev_err(&kaweth->intf->dev, "Failed to set Rx mode: %d\n",
++ result);
++ }
++ else {
++ netdev_dbg(kaweth->net, "Set Rx mode to %d\n",
++ packet_filter_bitmap);
++ }
++}
++
++/****************************************************************
++ * kaweth_netdev_stats
++ ****************************************************************/
++static struct net_device_stats *kaweth_netdev_stats(struct net_device *dev)
++{
++ struct kaweth_device *kaweth = netdev_priv(dev);
++ return &kaweth->stats;
++}
++
++/****************************************************************
++ * kaweth_tx_timeout
++ ****************************************************************/
++static void kaweth_tx_timeout(struct net_device *net)
++{
++ struct kaweth_device *kaweth = netdev_priv(net);
++
++ dev_warn(&net->dev, "%s: Tx timed out. Resetting.\n", net->name);
++ kaweth->stats.tx_errors++;
++ net->trans_start = jiffies;
++
++ usb_unlink_urb(kaweth->tx_urb);
++}
++
++/****************************************************************
++ * kaweth_suspend
++ ****************************************************************/
++static int kaweth_suspend(struct usb_interface *intf, pm_message_t message)
++{
++ struct kaweth_device *kaweth = usb_get_intfdata(intf);
++ unsigned long flags;
++
++ dev_dbg(&intf->dev, "Suspending device\n");
++ spin_lock_irqsave(&kaweth->device_lock, flags);
++ kaweth->status |= KAWETH_STATUS_SUSPENDING;
++ spin_unlock_irqrestore(&kaweth->device_lock, flags);
++
++ kaweth_kill_urbs(kaweth);
++ return 0;
++}
++
++/****************************************************************
++ * kaweth_resume
++ ****************************************************************/
++static int kaweth_resume(struct usb_interface *intf)
++{
++ struct kaweth_device *kaweth = usb_get_intfdata(intf);
++ unsigned long flags;
++
++ dev_dbg(&intf->dev, "Resuming device\n");
++ spin_lock_irqsave(&kaweth->device_lock, flags);
++ kaweth->status &= ~KAWETH_STATUS_SUSPENDING;
++ spin_unlock_irqrestore(&kaweth->device_lock, flags);
++
++ if (!kaweth->opened)
++ return 0;
++ kaweth_resubmit_rx_urb(kaweth, GFP_NOIO);
++ kaweth_resubmit_int_urb(kaweth, GFP_NOIO);
++
++ return 0;
++}
++
++/****************************************************************
++ * kaweth_probe
++ ****************************************************************/
++
++
++static const struct net_device_ops kaweth_netdev_ops = {
++ .ndo_open = kaweth_open,
++ .ndo_stop = kaweth_close,
++ .ndo_start_xmit = kaweth_start_xmit,
++ .ndo_tx_timeout = kaweth_tx_timeout,
++ .ndo_set_rx_mode = kaweth_set_rx_mode,
++ .ndo_get_stats = kaweth_netdev_stats,
++ .ndo_change_mtu = eth_change_mtu,
++ .ndo_set_mac_address = eth_mac_addr,
++ .ndo_validate_addr = eth_validate_addr,
++};
++
++static int kaweth_probe(
++ struct usb_interface *intf,
++ const struct usb_device_id *id /* from id_table */
++ )
++{
++ struct device *dev = &intf->dev;
++ struct usb_device *udev = interface_to_usbdev(intf);
++ struct kaweth_device *kaweth;
++ struct net_device *netdev;
++ const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
++ int result = 0;
++
++ dev_dbg(dev,
++ "Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x\n",
++ udev->devnum, le16_to_cpu(udev->descriptor.idVendor),
++ le16_to_cpu(udev->descriptor.idProduct),
++ le16_to_cpu(udev->descriptor.bcdDevice));
++
++ dev_dbg(dev, "Device at %p\n", udev);
++
++ dev_dbg(dev, "Descriptor length: %x type: %x\n",
++ (int)udev->descriptor.bLength,
++ (int)udev->descriptor.bDescriptorType);
++
++ netdev = alloc_etherdev(sizeof(*kaweth));
++ if (!netdev)
++ return -ENOMEM;
++
++ kaweth = netdev_priv(netdev);
++ kaweth->dev = udev;
++ kaweth->net = netdev;
++
++ spin_lock_init(&kaweth->device_lock);
++ init_waitqueue_head(&kaweth->term_wait);
++
++ dev_dbg(dev, "Resetting.\n");
++
++ kaweth_reset(kaweth);
++
++ /*
++ * If high byte of bcdDevice is nonzero, firmware is already
++ * downloaded. Don't try to do it again, or we'll hang the device.
++ */
++
++ if (le16_to_cpu(udev->descriptor.bcdDevice) >> 8) {
++ dev_info(dev, "Firmware present in device.\n");
++ } else {
++ /* Download the firmware */
++ dev_info(dev, "Downloading firmware...\n");
++ kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL);
++ if ((result = kaweth_download_firmware(kaweth,
++ "kaweth/new_code.bin",
++ 100,
++ 2)) < 0) {
++ dev_err(dev, "Error downloading firmware (%d)\n",
++ result);
++ goto err_fw;
++ }
++
++ if ((result = kaweth_download_firmware(kaweth,
++ "kaweth/new_code_fix.bin",
++ 100,
++ 3)) < 0) {
++ dev_err(dev, "Error downloading firmware fix (%d)\n",
++ result);
++ goto err_fw;
++ }
++
++ if ((result = kaweth_download_firmware(kaweth,
++ "kaweth/trigger_code.bin",
++ 126,
++ 2)) < 0) {
++ dev_err(dev, "Error downloading trigger code (%d)\n",
++ result);
++ goto err_fw;
++
++ }
++
++ if ((result = kaweth_download_firmware(kaweth,
++ "kaweth/trigger_code_fix.bin",
++ 126,
++ 3)) < 0) {
++ dev_err(dev, "Error downloading trigger code fix (%d)\n", result);
++ goto err_fw;
++ }
++
++
++ if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) {
++ dev_err(dev, "Error triggering firmware (%d)\n", result);
++ goto err_fw;
++ }
++
++ /* Device will now disappear for a moment... */
++ dev_info(dev, "Firmware loaded. I'll be back...\n");
++err_fw:
++ free_page((unsigned long)kaweth->firmware_buf);
++ free_netdev(netdev);
++ return -EIO;
++ }
++
++ result = kaweth_read_configuration(kaweth);
++
++ if(result < 0) {
++ dev_err(dev, "Error reading configuration (%d), no net device created\n", result);
++ goto err_free_netdev;
++ }
++
++ dev_info(dev, "Statistics collection: %x\n", kaweth->configuration.statistics_mask);
++ dev_info(dev, "Multicast filter limit: %x\n", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1));
++ dev_info(dev, "MTU: %d\n", le16_to_cpu(kaweth->configuration.segment_size));
++ dev_info(dev, "Read MAC address %pM\n", kaweth->configuration.hw_addr);
++
++ if(!memcmp(&kaweth->configuration.hw_addr,
++ &bcast_addr,
++ sizeof(bcast_addr))) {
++ dev_err(dev, "Firmware not functioning properly, no net device created\n");
++ goto err_free_netdev;
++ }
++
++ if(kaweth_set_urb_size(kaweth, KAWETH_BUF_SIZE) < 0) {
++ dev_dbg(dev, "Error setting URB size\n");
++ goto err_free_netdev;
++ }
++
++ if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) {
++ dev_err(dev, "Error setting SOFS wait\n");
++ goto err_free_netdev;
++ }
++
++ result = kaweth_set_receive_filter(kaweth,
++ KAWETH_PACKET_FILTER_DIRECTED |
++ KAWETH_PACKET_FILTER_BROADCAST |
++ KAWETH_PACKET_FILTER_MULTICAST);
++
++ if(result < 0) {
++ dev_err(dev, "Error setting receive filter\n");
++ goto err_free_netdev;
++ }
++
++ dev_dbg(dev, "Initializing net device.\n");
++
++ kaweth->intf = intf;
++
++ kaweth->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!kaweth->tx_urb)
++ goto err_free_netdev;
++ kaweth->rx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!kaweth->rx_urb)
++ goto err_only_tx;
++ kaweth->irq_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!kaweth->irq_urb)
++ goto err_tx_and_rx;
++
++ kaweth->intbuffer = usb_alloc_coherent( kaweth->dev,
++ INTBUFFERSIZE,
++ GFP_KERNEL,
++ &kaweth->intbufferhandle);
++ if (!kaweth->intbuffer)
++ goto err_tx_and_rx_and_irq;
++ kaweth->rx_buf = usb_alloc_coherent( kaweth->dev,
++ KAWETH_BUF_SIZE,
++ GFP_KERNEL,
++ &kaweth->rxbufferhandle);
++ if (!kaweth->rx_buf)
++ goto err_all_but_rxbuf;
++
++ memcpy(netdev->broadcast, &bcast_addr, sizeof(bcast_addr));
++ memcpy(netdev->dev_addr, &kaweth->configuration.hw_addr,
++ sizeof(kaweth->configuration.hw_addr));
++
++ netdev->netdev_ops = &kaweth_netdev_ops;
++ netdev->watchdog_timeo = KAWETH_TX_TIMEOUT;
++ netdev->mtu = le16_to_cpu(kaweth->configuration.segment_size);
++ netdev->ethtool_ops = &ops;
++
++ /* kaweth is zeroed as part of alloc_netdev */
++ INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl);
++ usb_set_intfdata(intf, kaweth);
++
++#if 0
++// dma_supported() is deeply broken on almost all architectures
++ if (dma_supported (dev, 0xffffffffffffffffULL))
++ kaweth->net->features |= NETIF_F_HIGHDMA;
++#endif
++
++ SET_NETDEV_DEV(netdev, dev);
++ if (register_netdev(netdev) != 0) {
++ dev_err(dev, "Error registering netdev.\n");
++ goto err_intfdata;
++ }
++
++ dev_info(dev, "kaweth interface created at %s\n",
++ kaweth->net->name);
++
++ dev_dbg(dev, "Kaweth probe returning.\n");
++
++ return 0;
++
++err_intfdata:
++ usb_set_intfdata(intf, NULL);
++ usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
++err_all_but_rxbuf:
++ usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
++err_tx_and_rx_and_irq:
++ usb_free_urb(kaweth->irq_urb);
++err_tx_and_rx:
++ usb_free_urb(kaweth->rx_urb);
++err_only_tx:
++ usb_free_urb(kaweth->tx_urb);
++err_free_netdev:
++ free_netdev(netdev);
++
++ return -EIO;
++}
++
++/****************************************************************
++ * kaweth_disconnect
++ ****************************************************************/
++static void kaweth_disconnect(struct usb_interface *intf)
++{
++ struct kaweth_device *kaweth = usb_get_intfdata(intf);
++ struct net_device *netdev;
++
++ dev_info(&intf->dev, "Unregistering\n");
++
++ usb_set_intfdata(intf, NULL);
++ if (!kaweth) {
++ dev_warn(&intf->dev, "unregistering non-existent device\n");
++ return;
++ }
++ netdev = kaweth->net;
++
++ netdev_dbg(kaweth->net, "Unregistering net device\n");
++ unregister_netdev(netdev);
++
++ usb_free_urb(kaweth->rx_urb);
++ usb_free_urb(kaweth->tx_urb);
++ usb_free_urb(kaweth->irq_urb);
++
++ usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
++ usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
++
++ free_netdev(netdev);
++}
++
++
++// FIXME this completion stuff is a modified clone of
++// an OLD version of some stuff in usb.c ...
++struct usb_api_data {
++ wait_queue_head_t wqh;
++ int done;
++};
++
++/*-------------------------------------------------------------------*
++ * completion handler for compatibility wrappers (sync control/bulk) *
++ *-------------------------------------------------------------------*/
++static void usb_api_blocking_completion(struct urb *urb)
++{
++ struct usb_api_data *awd = (struct usb_api_data *)urb->context;
++
++ awd->done=1;
++ wake_up(&awd->wqh);
++}
++
++/*-------------------------------------------------------------------*
++ * COMPATIBILITY STUFF *
++ *-------------------------------------------------------------------*/
++
++// Starts urb and waits for completion or timeout
++static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
++{
++ struct usb_api_data awd;
++ int status;
++
++ init_waitqueue_head(&awd.wqh);
++ awd.done = 0;
++
++ urb->context = &awd;
++ status = usb_submit_urb(urb, GFP_NOIO);
++ if (status) {
++ // something went wrong
++ usb_free_urb(urb);
++ return status;
++ }
++
++ if (!wait_event_timeout(awd.wqh, awd.done, timeout)) {
++ // timeout
++ dev_warn(&urb->dev->dev, "usb_control/bulk_msg: timeout\n");
++ usb_kill_urb(urb); // remove urb safely
++ status = -ETIMEDOUT;
++ }
++ else {
++ status = urb->status;
++ }
++
++ if (actual_length) {
++ *actual_length = urb->actual_length;
++ }
++
++ usb_free_urb(urb);
++ return status;
++}
++
++/*-------------------------------------------------------------------*/
++// returns status (negative) or length (positive)
++static int kaweth_internal_control_msg(struct usb_device *usb_dev,
++ unsigned int pipe,
++ struct usb_ctrlrequest *cmd, void *data,
++ int len, int timeout)
++{
++ struct urb *urb;
++ int retv;
++ int length = 0; /* shut up GCC */
++
++ urb = usb_alloc_urb(0, GFP_ATOMIC);
++ if (!urb)
++ return -ENOMEM;
++
++ usb_fill_control_urb(urb, usb_dev, pipe, (unsigned char*)cmd, data,
++ len, usb_api_blocking_completion, NULL);
++
++ retv = usb_start_wait_urb(urb, timeout, &length);
++ if (retv < 0) {
++ return retv;
++ }
++ else {
++ return length;
++ }
++}
++
++module_usb_driver(kaweth_driver);
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/drivers/net/usb/Kconfig
+--- backports-3.18.1-1.org/drivers/net/usb/Kconfig 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/Kconfig 2015-01-03 15:19:02.310281530 +0100
+@@ -13,7 +13,6 @@
+ if USB_NET_DRIVERS
+
+ config USB_CATC
+- depends on n
+ tristate "USB CATC NetMate-based Ethernet device support"
+ depends on m
+ depends on CRC32
+@@ -34,7 +33,6 @@
+ module will be called catc.
+
+ config USB_KAWETH
+- depends on n
+ tristate "USB KLSI KL5USB101-based ethernet device support"
+ depends on m
+ ---help---
+@@ -75,7 +73,6 @@
+ module will be called kaweth.
+
+ config USB_PEGASUS
+- depends on n
+ tristate "USB Pegasus/Pegasus-II based ethernet device support"
+ depends on m
+ select BACKPORT_MII
+@@ -92,7 +89,6 @@
+ module will be called pegasus.
+
+ config USB_RTL8150
+- depends on n
+ tristate "USB RTL8150 based ethernet device support"
+ depends on m
+ select BACKPORT_MII
+@@ -105,7 +101,6 @@
+ module will be called rtl8150.
+
+ config USB_RTL8152
+- depends on n
+ tristate "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
+ depends on m
+ select BACKPORT_MII
+@@ -153,7 +148,6 @@
+ module will be called usbnet.
+
+ config USB_NET_AX8817X
+- depends on n
+ tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters"
+ depends on m
+ depends on USB_USBNET
+@@ -183,7 +177,6 @@
+ what other networking devices you have in use.
+
+ config USB_NET_AX88179_178A
+- depends on n
+ tristate "ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet"
+ depends on m
+ depends on USB_USBNET
+@@ -232,7 +225,6 @@
+ name is used instead.
+
+ config USB_NET_CDC_EEM
+- depends on n
+ tristate "CDC EEM support"
+ depends on m
+ depends on USB_USBNET
+@@ -268,7 +260,6 @@
+ * Ericsson F5521gw Mobile Broadband Module
+
+ config USB_NET_HUAWEI_CDC_NCM
+- depends on n
+ tristate "Huawei NCM embedded AT channel support"
+ depends on m
+ depends on USB_USBNET
+@@ -304,7 +295,6 @@
+ module will be called cdc_mbim.
+
+ config USB_NET_DM9601
+- depends on n
+ tristate "Davicom DM96xx based USB 10/100 ethernet devices"
+ depends on m
+ depends on USB_USBNET
+@@ -314,7 +304,6 @@
+ based USB 10/100 Ethernet adapters.
+
+ config USB_NET_SR9700
+- depends on n
+ tristate "CoreChip-sz SR9700 based USB 1.1 10/100 ethernet devices"
+ depends on m
+ depends on USB_USBNET
+@@ -324,7 +313,6 @@
+ 10/100 Ethernet adapters.
+
+ config USB_NET_SR9800
+- depends on n
+ tristate "CoreChip-sz SR9800 based USB 2.0 10/100 ethernet devices"
+ depends on m
+ depends on USB_USBNET
+@@ -341,7 +329,6 @@
+ module will be called sr9800.
+
+ config USB_NET_SMSC75XX
+- depends on n
+ tristate "SMSC LAN75XX based USB 2.0 gigabit ethernet devices"
+ depends on m
+ depends on USB_USBNET
+@@ -353,7 +340,6 @@
+ Gigabit Ethernet adapters.
+
+ config USB_NET_SMSC95XX
+- depends on n
+ tristate "SMSC LAN95XX based USB 2.0 10/100 ethernet devices"
+ depends on m
+ depends on USB_USBNET
+@@ -365,7 +351,6 @@
+ 10/100 Ethernet adapters.
+
+ config USB_NET_GL620A
+- depends on n
+ tristate "GeneSys GL620USB-A based cables"
+ depends on m
+ depends on USB_USBNET
+@@ -376,7 +361,6 @@
+ Note that the half-duplex "GL620USB" is not supported.
+
+ config USB_NET_NET1080
+- depends on n
+ tristate "NetChip 1080 based cables (Laplink, ...)"
+ depends on m
+ default y
+@@ -387,7 +371,6 @@
+ optionally with LEDs that indicate traffic
+
+ config USB_NET_PLUSB
+- depends on n
+ tristate "Prolific PL-2301/2302/25A1 based cables"
+ depends on m
+ # if the handshake/init/reset problems, from original 'plusb',
+@@ -398,7 +381,6 @@
+ with one of these chips.
+
+ config USB_NET_MCS7830
+- depends on n
+ tristate "MosChip MCS7830 based Ethernet adapters"
+ depends on m
+ depends on USB_USBNET
+@@ -424,7 +406,6 @@
+ (and for) Microsoft; it isn't an "Open" ecosystem or market.
+
+ config USB_NET_CDC_SUBSET
+- depends on n
+ tristate "Simple USB Network Links (CDC Ethernet subset)"
+ depends on m
+ depends on USB_USBNET
+@@ -496,7 +477,6 @@
+ with one of these chips.
+
+ config USB_NET_ZAURUS
+- depends on n
+ tristate "Sharp Zaurus (stock ROMs) and compatible"
+ depends on m
+ depends on USB_USBNET
+@@ -516,7 +496,6 @@
+ some cases CDC MDLM) protocol, not "g_ether".
+
+ config USB_NET_CX82310_ETH
+- depends on n
+ tristate "Conexant CX82310 USB ethernet port"
+ depends on m
+ depends on USB_USBNET
+@@ -526,7 +505,6 @@
+ it will not work with ADSL modems (use cxacru driver instead).
+
+ config USB_NET_KALMIA
+- depends on n
+ tristate "Samsung Kalmia based LTE USB modem"
+ depends on m
+ depends on USB_USBNET
+@@ -561,7 +539,6 @@
+ module will be called qmi_wwan.
+
+ config USB_HSO
+- depends on n
+ tristate "Option USB High Speed Mobile Devices"
+ depends on m
+ depends on USB && RFKILL && TTY
+@@ -574,7 +551,6 @@
+ module will be called hso.
+
+ config USB_NET_INT51X1
+- depends on n
+ tristate "Intellon PLC based usb adapter"
+ depends on m
+ depends on USB_USBNET
+@@ -584,7 +560,6 @@
+ INT51x1/INT5200 chip, like the "devolo dLan duo".
+
+ config USB_CDC_PHONET
+- depends on n
+ tristate "CDC Phonet support"
+ depends on m
+ depends on PHONET
+@@ -594,7 +569,6 @@
+ "PC suite" USB profile.
+
+ config USB_IPHETH
+- depends on n
+ tristate "Apple iPhone USB Ethernet driver"
+ depends on m
+ default n
+@@ -618,11 +592,10 @@
+ module will be called sierra_net.
+
+ config USB_VL600
+- depends on n
+ tristate "LG VL600 modem dongle"
+ depends on m
+ depends on USB_NET_CDCETHER && TTY
+- select USB_ACM
++# depends on USB_ACM
+ help
+ Select this if you want to use an LG Electronics 4G/LTE usb modem
+ called VL600. This driver only handles the ethernet
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/lg-vl600.c backports-3.18.1-1/drivers/net/usb/lg-vl600.c
+--- backports-3.18.1-1.org/drivers/net/usb/lg-vl600.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/lg-vl600.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,353 @@
++/*
++ * Ethernet interface part of the LG VL600 LTE modem (4G dongle)
++ *
++ * Copyright (C) 2011 Intel Corporation
++ * Author: Andrzej Zaborowski <balrogg@gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/usb/cdc.h>
++#include <linux/usb/usbnet.h>
++#include <linux/if_ether.h>
++#include <linux/if_arp.h>
++#include <linux/inetdevice.h>
++#include <linux/module.h>
++
++/*
++ * The device has a CDC ACM port for modem control (it claims to be
++ * CDC ACM anyway) and a CDC Ethernet port for actual network data.
++ * It will however ignore data on both ports that is not encapsulated
++ * in a specific way, any data returned is also encapsulated the same
++ * way. The headers don't seem to follow any popular standard.
++ *
++ * This driver adds and strips these headers from the ethernet frames
++ * sent/received from the CDC Ethernet port. The proprietary header
++ * replaces the standard ethernet header in a packet so only actual
++ * ethernet frames are allowed. The headers allow some form of
++ * multiplexing by using non standard values of the .h_proto field.
++ * Windows/Mac drivers do send a couple of such frames to the device
++ * during initialisation, with protocol set to 0x0906 or 0x0b06 and (what
++ * seems to be) a flag in the .dummy_flags. This doesn't seem necessary
++ * for modem operation but can possibly be used for GPS or other funcitons.
++ */
++
++struct vl600_frame_hdr {
++ __le32 len;
++ __le32 serial;
++ __le32 pkt_cnt;
++ __le32 dummy_flags;
++ __le32 dummy;
++ __le32 magic;
++} __attribute__((packed));
++
++struct vl600_pkt_hdr {
++ __le32 dummy[2];
++ __le32 len;
++ __be16 h_proto;
++} __attribute__((packed));
++
++struct vl600_state {
++ struct sk_buff *current_rx_buf;
++};
++
++static int vl600_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ int ret;
++ struct vl600_state *s = kzalloc(sizeof(struct vl600_state), GFP_KERNEL);
++
++ if (!s)
++ return -ENOMEM;
++
++ ret = usbnet_cdc_bind(dev, intf);
++ if (ret) {
++ kfree(s);
++ return ret;
++ }
++
++ dev->driver_priv = s;
++
++ /* ARP packets don't go through, but they're also of no use. The
++ * subnet has only two hosts anyway: us and the gateway / DHCP
++ * server (probably simulated by modem firmware or network operator)
++ * whose address changes everytime we connect to the intarwebz and
++ * who doesn't bother answering ARP requests either. So hardware
++ * addresses have no meaning, the destination and the source of every
++ * packet depend only on whether it is on the IN or OUT endpoint. */
++ dev->net->flags |= IFF_NOARP;
++ /* IPv6 NDP relies on multicast. Enable it by default. */
++ dev->net->flags |= IFF_MULTICAST;
++
++ return ret;
++}
++
++static void vl600_unbind(struct usbnet *dev, struct usb_interface *intf)
++{
++ struct vl600_state *s = dev->driver_priv;
++
++ if (s->current_rx_buf)
++ dev_kfree_skb(s->current_rx_buf);
++
++ kfree(s);
++
++ return usbnet_cdc_unbind(dev, intf);
++}
++
++static int vl600_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ struct vl600_frame_hdr *frame;
++ struct vl600_pkt_hdr *packet;
++ struct ethhdr *ethhdr;
++ int packet_len, count;
++ struct sk_buff *buf = skb;
++ struct sk_buff *clone;
++ struct vl600_state *s = dev->driver_priv;
++
++ /* Frame lengths are generally 4B multiplies but every couple of
++ * hours there's an odd number of bytes sized yet correct frame,
++ * so don't require this. */
++
++ /* Allow a packet (or multiple packets batched together) to be
++ * split across many frames. We don't allow a new batch to
++ * begin in the same frame another one is ending however, and no
++ * leading or trailing pad bytes. */
++ if (s->current_rx_buf) {
++ frame = (struct vl600_frame_hdr *) s->current_rx_buf->data;
++ if (skb->len + s->current_rx_buf->len >
++ le32_to_cpup(&frame->len)) {
++ netif_err(dev, ifup, dev->net, "Fragment too long\n");
++ dev->net->stats.rx_length_errors++;
++ goto error;
++ }
++
++ buf = s->current_rx_buf;
++ memcpy(skb_put(buf, skb->len), skb->data, skb->len);
++ } else if (skb->len < 4) {
++ netif_err(dev, ifup, dev->net, "Frame too short\n");
++ dev->net->stats.rx_length_errors++;
++ goto error;
++ }
++
++ frame = (struct vl600_frame_hdr *) buf->data;
++ /* Yes, check that frame->magic == 0x53544448 (or 0x44544d48),
++ * otherwise we may run out of memory w/a bad packet */
++ if (ntohl(frame->magic) != 0x53544448 &&
++ ntohl(frame->magic) != 0x44544d48)
++ goto error;
++
++ if (buf->len < sizeof(*frame) ||
++ buf->len != le32_to_cpup(&frame->len)) {
++ /* Save this fragment for later assembly */
++ if (s->current_rx_buf)
++ return 0;
++
++ s->current_rx_buf = skb_copy_expand(skb, 0,
++ le32_to_cpup(&frame->len), GFP_ATOMIC);
++ if (!s->current_rx_buf) {
++ netif_err(dev, ifup, dev->net, "Reserving %i bytes "
++ "for packet assembly failed.\n",
++ le32_to_cpup(&frame->len));
++ dev->net->stats.rx_errors++;
++ }
++
++ return 0;
++ }
++
++ count = le32_to_cpup(&frame->pkt_cnt);
++
++ skb_pull(buf, sizeof(*frame));
++
++ while (count--) {
++ if (buf->len < sizeof(*packet)) {
++ netif_err(dev, ifup, dev->net, "Packet too short\n");
++ goto error;
++ }
++
++ packet = (struct vl600_pkt_hdr *) buf->data;
++ packet_len = sizeof(*packet) + le32_to_cpup(&packet->len);
++ if (packet_len > buf->len) {
++ netif_err(dev, ifup, dev->net,
++ "Bad packet length stored in header\n");
++ goto error;
++ }
++
++ /* Packet header is same size as the ethernet header
++ * (sizeof(*packet) == sizeof(*ethhdr)), additionally
++ * the h_proto field is in the same place so we just leave it
++ * alone and fill in the remaining fields.
++ */
++ ethhdr = (struct ethhdr *) skb->data;
++ if (be16_to_cpup(ðhdr->h_proto) == ETH_P_ARP &&
++ buf->len > 0x26) {
++ /* Copy the addresses from packet contents */
++ memcpy(ethhdr->h_source,
++ &buf->data[sizeof(*ethhdr) + 0x8],
++ ETH_ALEN);
++ memcpy(ethhdr->h_dest,
++ &buf->data[sizeof(*ethhdr) + 0x12],
++ ETH_ALEN);
++ } else {
++ memset(ethhdr->h_source, 0, ETH_ALEN);
++ memcpy(ethhdr->h_dest, dev->net->dev_addr, ETH_ALEN);
++
++ /* Inbound IPv6 packets have an IPv4 ethertype (0x800)
++ * for some reason. Peek at the L3 header to check
++ * for IPv6 packets, and set the ethertype to IPv6
++ * (0x86dd) so Linux can understand it.
++ */
++ if ((buf->data[sizeof(*ethhdr)] & 0xf0) == 0x60)
++ ethhdr->h_proto = htons(ETH_P_IPV6);
++ }
++
++ if (count) {
++ /* Not the last packet in this batch */
++ clone = skb_clone(buf, GFP_ATOMIC);
++ if (!clone)
++ goto error;
++
++ skb_trim(clone, packet_len);
++ usbnet_skb_return(dev, clone);
++
++ skb_pull(buf, (packet_len + 3) & ~3);
++ } else {
++ skb_trim(buf, packet_len);
++
++ if (s->current_rx_buf) {
++ usbnet_skb_return(dev, buf);
++ s->current_rx_buf = NULL;
++ return 0;
++ }
++
++ return 1;
++ }
++ }
++
++error:
++ if (s->current_rx_buf) {
++ dev_kfree_skb_any(s->current_rx_buf);
++ s->current_rx_buf = NULL;
++ }
++ dev->net->stats.rx_errors++;
++ return 0;
++}
++
++static struct sk_buff *vl600_tx_fixup(struct usbnet *dev,
++ struct sk_buff *skb, gfp_t flags)
++{
++ struct sk_buff *ret;
++ struct vl600_frame_hdr *frame;
++ struct vl600_pkt_hdr *packet;
++ static uint32_t serial = 1;
++ int orig_len = skb->len - sizeof(struct ethhdr);
++ int full_len = (skb->len + sizeof(struct vl600_frame_hdr) + 3) & ~3;
++
++ frame = (struct vl600_frame_hdr *) skb->data;
++ if (skb->len > sizeof(*frame) && skb->len == le32_to_cpup(&frame->len))
++ return skb; /* Already encapsulated? */
++
++ if (skb->len < sizeof(struct ethhdr))
++ /* Drop, device can only deal with ethernet packets */
++ return NULL;
++
++ if (!skb_cloned(skb)) {
++ int headroom = skb_headroom(skb);
++ int tailroom = skb_tailroom(skb);
++
++ if (tailroom >= full_len - skb->len - sizeof(*frame) &&
++ headroom >= sizeof(*frame))
++ /* There's enough head and tail room */
++ goto encapsulate;
++
++ if (headroom + tailroom + skb->len >= full_len) {
++ /* There's enough total room, just readjust */
++ skb->data = memmove(skb->head + sizeof(*frame),
++ skb->data, skb->len);
++ skb_set_tail_pointer(skb, skb->len);
++ goto encapsulate;
++ }
++ }
++
++ /* Alloc a new skb with the required size */
++ ret = skb_copy_expand(skb, sizeof(struct vl600_frame_hdr), full_len -
++ skb->len - sizeof(struct vl600_frame_hdr), flags);
++ dev_kfree_skb_any(skb);
++ if (!ret)
++ return ret;
++ skb = ret;
++
++encapsulate:
++ /* Packet header is same size as ethernet packet header
++ * (sizeof(*packet) == sizeof(struct ethhdr)), additionally the
++ * h_proto field is in the same place so we just leave it alone and
++ * overwrite the remaining fields.
++ */
++ packet = (struct vl600_pkt_hdr *) skb->data;
++ /* The VL600 wants IPv6 packets to have an IPv4 ethertype
++ * Since this modem only supports IPv4 and IPv6, just set all
++ * frames to 0x0800 (ETH_P_IP)
++ */
++ packet->h_proto = htons(ETH_P_IP);
++ memset(&packet->dummy, 0, sizeof(packet->dummy));
++ packet->len = cpu_to_le32(orig_len);
++
++ frame = (struct vl600_frame_hdr *) skb_push(skb, sizeof(*frame));
++ memset(frame, 0, sizeof(*frame));
++ frame->len = cpu_to_le32(full_len);
++ frame->serial = cpu_to_le32(serial++);
++ frame->pkt_cnt = cpu_to_le32(1);
++
++ if (skb->len < full_len) /* Pad */
++ skb_put(skb, full_len - skb->len);
++
++ return skb;
++}
++
++static const struct driver_info vl600_info = {
++ .description = "LG VL600 modem",
++ .flags = FLAG_RX_ASSEMBLE | FLAG_WWAN,
++ .bind = vl600_bind,
++ .unbind = vl600_unbind,
++ .status = usbnet_cdc_status,
++ .rx_fixup = vl600_rx_fixup,
++ .tx_fixup = vl600_tx_fixup,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
++ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
++ .driver_info = (unsigned long) &vl600_info,
++ },
++ {}, /* End */
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver lg_vl600_driver = {
++ .name = "lg-vl600",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(lg_vl600_driver);
++
++MODULE_AUTHOR("Anrzej Zaborowski");
++MODULE_DESCRIPTION("LG-VL600 modem's ethernet link");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/Makefile backports-3.18.1-1/drivers/net/usb/Makefile
+--- backports-3.18.1-1.org/drivers/net/usb/Makefile 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/Makefile 2015-01-03 13:49:51.269970813 +0100
+@@ -1,39 +1,35 @@
+-#
+-# Makefile for USB Network drivers
+-#
+-#
+-#obj-$(CPTCFG_USB_CATC) += catc.o
+-#obj-$(CPTCFG_USB_KAWETH) += kaweth.o
+-#obj-$(CPTCFG_USB_PEGASUS) += pegasus.o
+-#obj-$(CPTCFG_USB_RTL8150) += rtl8150.o
+-#obj-$(CPTCFG_USB_RTL8152) += r8152.o
+-#obj-$(CPTCFG_USB_HSO) += hso.o
+-#obj-$(CPTCFG_USB_NET_AX8817X) += asix.o
+-#obj-$(CPTCFG_USB_NET_AX88179_178A) += ax88179_178a.o
++obj-$(CPTCFG_USB_CATC) += catc.o
++obj-$(CPTCFG_USB_KAWETH) += kaweth.o
++obj-$(CPTCFG_USB_PEGASUS) += pegasus.o
++obj-$(CPTCFG_USB_RTL8150) += rtl8150.o
++obj-$(CPTCFG_USB_RTL8152) += r8152.o
++obj-$(CPTCFG_USB_HSO) += hso.o
++obj-$(CPTCFG_USB_NET_AX8817X) += asix.o
++asix-y := asix_devices.o asix_common.o ax88172a.o
++obj-$(CPTCFG_USB_NET_AX88179_178A) += ax88179_178a.o
+ obj-$(CPTCFG_USB_NET_CDCETHER) += cdc_ether.o
+-#obj-$(CPTCFG_USB_NET_CDC_EEM) += cdc_eem.o
+-#obj-$(CPTCFG_USB_NET_DM9601) += dm9601.o
+-#obj-$(CPTCFG_USB_NET_SR9700) += sr9700.o
+-#obj-$(CPTCFG_USB_NET_SR9800) += sr9800.o
+-#obj-$(CPTCFG_USB_NET_SMSC75XX) += smsc75xx.o
+-#obj-$(CPTCFG_USB_NET_SMSC95XX) += smsc95xx.o
+-#obj-$(CPTCFG_USB_NET_GL620A) += gl620a.o
+-#obj-$(CPTCFG_USB_NET_NET1080) += net1080.o
+-#obj-$(CPTCFG_USB_NET_PLUSB) += plusb.o
++obj-$(CPTCFG_USB_NET_CDC_EEM) += cdc_eem.o
++obj-$(CPTCFG_USB_NET_DM9601) += dm9601.o
++obj-$(CPTCFG_USB_NET_SR9700) += sr9700.o
++obj-$(CPTCFG_USB_NET_SR9800) += sr9800.o
++obj-$(CPTCFG_USB_NET_SMSC75XX) += smsc75xx.o
++obj-$(CPTCFG_USB_NET_SMSC95XX) += smsc95xx.o
++obj-$(CPTCFG_USB_NET_GL620A) += gl620a.o
++obj-$(CPTCFG_USB_NET_NET1080) += net1080.o
++obj-$(CPTCFG_USB_NET_PLUSB) += plusb.o
+ obj-$(CPTCFG_USB_NET_RNDIS_HOST) += rndis_host.o
+-#obj-$(CPTCFG_USB_NET_CDC_SUBSET) += cdc_subset.o
+-#obj-$(CPTCFG_USB_NET_ZAURUS) += zaurus.o
+-#obj-$(CPTCFG_USB_NET_MCS7830) += mcs7830.o
++obj-$(CPTCFG_USB_NET_CDC_SUBSET) += cdc_subset.o
++obj-$(CPTCFG_USB_NET_ZAURUS) += zaurus.o
++obj-$(CPTCFG_USB_NET_MCS7830) += mcs7830.o
+ obj-$(CPTCFG_USB_USBNET) += usbnet.o
+-#obj-$(CPTCFG_USB_NET_INT51X1) += int51x1.o
+-#obj-$(CPTCFG_USB_CDC_PHONET) += cdc-phonet.o
+-#obj-$(CPTCFG_USB_NET_KALMIA) += kalmia.o
+-#obj-$(CPTCFG_USB_IPHETH) += ipheth.o
++obj-$(CPTCFG_USB_NET_INT51X1) += int51x1.o
++obj-$(CPTCFG_USB_CDC_PHONET) += cdc-phonet.o
++obj-$(CPTCFG_USB_NET_KALMIA) += kalmia.o
++obj-$(CPTCFG_USB_IPHETH) += ipheth.o
+ obj-$(CPTCFG_USB_SIERRA_NET) += sierra_net.o
+-#obj-$(CPTCFG_USB_NET_CX82310_ETH) += cx82310_eth.o
++obj-$(CPTCFG_USB_NET_CX82310_ETH) += cx82310_eth.o
+ obj-$(CPTCFG_USB_NET_CDC_NCM) += cdc_ncm.o
+-#obj-$(CPTCFG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o
+-#obj-$(CPTCFG_USB_VL600) += lg-vl600.o
++obj-$(CPTCFG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o
++obj-$(CPTCFG_USB_VL600) += lg-vl600.o
+ obj-$(CPTCFG_USB_NET_QMI_WWAN) += qmi_wwan.o
+ obj-$(CPTCFG_USB_NET_CDC_MBIM) += cdc_mbim.o
+-
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/mcs7830.c backports-3.18.1-1/drivers/net/usb/mcs7830.c
+--- backports-3.18.1-1.org/drivers/net/usb/mcs7830.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/mcs7830.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,643 @@
++/*
++ * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices
++ *
++ * based on usbnet.c, asix.c and the vendor provided mcs7830 driver
++ *
++ * Copyright (C) 2010 Andreas Mohr <andi@lisas.de>
++ * Copyright (C) 2006 Arnd Bergmann <arnd@arndb.de>
++ * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
++ * Copyright (C) 2005 Phil Chang <pchang23@sbcglobal.net>
++ * Copyright (c) 2002-2003 TiVo Inc.
++ *
++ * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!).
++ *
++ * 2010-12-19: add 7832 USB PID ("functionality same as MCS7830"),
++ * per active notification by manufacturer
++ *
++ * TODO:
++ * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?)
++ * - implement ethtool_ops get_pauseparam/set_pauseparam
++ * via HIF_REG_PAUSE_THRESHOLD (>= revision C only!)
++ * - implement get_eeprom/[set_eeprom]
++ * - switch PHY on/off on ifup/ifdown (perhaps in usbnet.c, via MII)
++ * - mcs7830_get_regs() handling is weird: for rev 2 we return 32 regs,
++ * can access only ~ 24, remaining user buffer is uninitialized garbage
++ * - anything else?
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/crc32.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/slab.h>
++#include <linux/usb.h>
++#include <linux/usb/usbnet.h>
++
++/* requests */
++#define MCS7830_RD_BMREQ (USB_DIR_IN | USB_TYPE_VENDOR | \
++ USB_RECIP_DEVICE)
++#define MCS7830_WR_BMREQ (USB_DIR_OUT | USB_TYPE_VENDOR | \
++ USB_RECIP_DEVICE)
++#define MCS7830_RD_BREQ 0x0E
++#define MCS7830_WR_BREQ 0x0D
++
++#define MCS7830_CTRL_TIMEOUT 1000
++#define MCS7830_MAX_MCAST 64
++
++#define MCS7830_VENDOR_ID 0x9710
++#define MCS7832_PRODUCT_ID 0x7832
++#define MCS7830_PRODUCT_ID 0x7830
++#define MCS7730_PRODUCT_ID 0x7730
++
++#define SITECOM_VENDOR_ID 0x0DF6
++#define LN_030_PRODUCT_ID 0x0021
++
++#define MCS7830_MII_ADVERTISE (ADVERTISE_PAUSE_CAP | ADVERTISE_100FULL | \
++ ADVERTISE_100HALF | ADVERTISE_10FULL | \
++ ADVERTISE_10HALF | ADVERTISE_CSMA)
++
++/* HIF_REG_XX corresponding index value */
++enum {
++ HIF_REG_MULTICAST_HASH = 0x00,
++ HIF_REG_PACKET_GAP1 = 0x08,
++ HIF_REG_PACKET_GAP2 = 0x09,
++ HIF_REG_PHY_DATA = 0x0a,
++ HIF_REG_PHY_CMD1 = 0x0c,
++ HIF_REG_PHY_CMD1_READ = 0x40,
++ HIF_REG_PHY_CMD1_WRITE = 0x20,
++ HIF_REG_PHY_CMD1_PHYADDR = 0x01,
++ HIF_REG_PHY_CMD2 = 0x0d,
++ HIF_REG_PHY_CMD2_PEND_FLAG_BIT = 0x80,
++ HIF_REG_PHY_CMD2_READY_FLAG_BIT = 0x40,
++ HIF_REG_CONFIG = 0x0e,
++ /* hmm, spec sez: "R/W", "Except bit 3" (likely TXENABLE). */
++ HIF_REG_CONFIG_CFG = 0x80,
++ HIF_REG_CONFIG_SPEED100 = 0x40,
++ HIF_REG_CONFIG_FULLDUPLEX_ENABLE = 0x20,
++ HIF_REG_CONFIG_RXENABLE = 0x10,
++ HIF_REG_CONFIG_TXENABLE = 0x08,
++ HIF_REG_CONFIG_SLEEPMODE = 0x04,
++ HIF_REG_CONFIG_ALLMULTICAST = 0x02,
++ HIF_REG_CONFIG_PROMISCUOUS = 0x01,
++ HIF_REG_ETHERNET_ADDR = 0x0f,
++ HIF_REG_FRAME_DROP_COUNTER = 0x15, /* 0..ff; reset: 0 */
++ HIF_REG_PAUSE_THRESHOLD = 0x16,
++ HIF_REG_PAUSE_THRESHOLD_DEFAULT = 0,
++};
++
++/* Trailing status byte in Ethernet Rx frame */
++enum {
++ MCS7830_RX_SHORT_FRAME = 0x01, /* < 64 bytes */
++ MCS7830_RX_LENGTH_ERROR = 0x02, /* framelen != Ethernet length field */
++ MCS7830_RX_ALIGNMENT_ERROR = 0x04, /* non-even number of nibbles */
++ MCS7830_RX_CRC_ERROR = 0x08,
++ MCS7830_RX_LARGE_FRAME = 0x10, /* > 1518 bytes */
++ MCS7830_RX_FRAME_CORRECT = 0x20, /* frame is correct */
++ /* [7:6] reserved */
++};
++
++struct mcs7830_data {
++ u8 multi_filter[8];
++ u8 config;
++};
++
++static const char driver_name[] = "MOSCHIP usb-ethernet driver";
++
++static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data)
++{
++ return usbnet_read_cmd(dev, MCS7830_RD_BREQ, MCS7830_RD_BMREQ,
++ 0x0000, index, data, size);
++}
++
++static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, const void *data)
++{
++ return usbnet_write_cmd(dev, MCS7830_WR_BREQ, MCS7830_WR_BMREQ,
++ 0x0000, index, data, size);
++}
++
++static void mcs7830_set_reg_async(struct usbnet *dev, u16 index, u16 size, void *data)
++{
++ usbnet_write_cmd_async(dev, MCS7830_WR_BREQ, MCS7830_WR_BMREQ,
++ 0x0000, index, data, size);
++}
++
++static int mcs7830_hif_get_mac_address(struct usbnet *dev, unsigned char *addr)
++{
++ int ret = mcs7830_get_reg(dev, HIF_REG_ETHERNET_ADDR, ETH_ALEN, addr);
++ if (ret < 0)
++ return ret;
++ return 0;
++}
++
++static int mcs7830_hif_set_mac_address(struct usbnet *dev, unsigned char *addr)
++{
++ int ret = mcs7830_set_reg(dev, HIF_REG_ETHERNET_ADDR, ETH_ALEN, addr);
++
++ if (ret < 0)
++ return ret;
++ return 0;
++}
++
++static int mcs7830_set_mac_address(struct net_device *netdev, void *p)
++{
++ int ret;
++ struct usbnet *dev = netdev_priv(netdev);
++ struct sockaddr *addr = p;
++
++ if (netif_running(netdev))
++ return -EBUSY;
++
++ if (!is_valid_ether_addr(addr->sa_data))
++ return -EADDRNOTAVAIL;
++
++ ret = mcs7830_hif_set_mac_address(dev, addr->sa_data);
++
++ if (ret < 0)
++ return ret;
++
++ /* it worked --> adopt it on netdev side */
++ memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
++
++ return 0;
++}
++
++static int mcs7830_read_phy(struct usbnet *dev, u8 index)
++{
++ int ret;
++ int i;
++ __le16 val;
++
++ u8 cmd[2] = {
++ HIF_REG_PHY_CMD1_READ | HIF_REG_PHY_CMD1_PHYADDR,
++ HIF_REG_PHY_CMD2_PEND_FLAG_BIT | index,
++ };
++
++ mutex_lock(&dev->phy_mutex);
++ /* write the MII command */
++ ret = mcs7830_set_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
++ if (ret < 0)
++ goto out;
++
++ /* wait for the data to become valid, should be within < 1ms */
++ for (i = 0; i < 10; i++) {
++ ret = mcs7830_get_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
++ if ((ret < 0) || (cmd[1] & HIF_REG_PHY_CMD2_READY_FLAG_BIT))
++ break;
++ ret = -EIO;
++ msleep(1);
++ }
++ if (ret < 0)
++ goto out;
++
++ /* read actual register contents */
++ ret = mcs7830_get_reg(dev, HIF_REG_PHY_DATA, 2, &val);
++ if (ret < 0)
++ goto out;
++ ret = le16_to_cpu(val);
++ dev_dbg(&dev->udev->dev, "read PHY reg %02x: %04x (%d tries)\n",
++ index, val, i);
++out:
++ mutex_unlock(&dev->phy_mutex);
++ return ret;
++}
++
++static int mcs7830_write_phy(struct usbnet *dev, u8 index, u16 val)
++{
++ int ret;
++ int i;
++ __le16 le_val;
++
++ u8 cmd[2] = {
++ HIF_REG_PHY_CMD1_WRITE | HIF_REG_PHY_CMD1_PHYADDR,
++ HIF_REG_PHY_CMD2_PEND_FLAG_BIT | (index & 0x1F),
++ };
++
++ mutex_lock(&dev->phy_mutex);
++
++ /* write the new register contents */
++ le_val = cpu_to_le16(val);
++ ret = mcs7830_set_reg(dev, HIF_REG_PHY_DATA, 2, &le_val);
++ if (ret < 0)
++ goto out;
++
++ /* write the MII command */
++ ret = mcs7830_set_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
++ if (ret < 0)
++ goto out;
++
++ /* wait for the command to be accepted by the PHY */
++ for (i = 0; i < 10; i++) {
++ ret = mcs7830_get_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
++ if ((ret < 0) || (cmd[1] & HIF_REG_PHY_CMD2_READY_FLAG_BIT))
++ break;
++ ret = -EIO;
++ msleep(1);
++ }
++ if (ret < 0)
++ goto out;
++
++ ret = 0;
++ dev_dbg(&dev->udev->dev, "write PHY reg %02x: %04x (%d tries)\n",
++ index, val, i);
++out:
++ mutex_unlock(&dev->phy_mutex);
++ return ret;
++}
++
++/*
++ * This algorithm comes from the original mcs7830 version 1.4 driver,
++ * not sure if it is needed.
++ */
++static int mcs7830_set_autoneg(struct usbnet *dev, int ptrUserPhyMode)
++{
++ int ret;
++ /* Enable all media types */
++ ret = mcs7830_write_phy(dev, MII_ADVERTISE, MCS7830_MII_ADVERTISE);
++
++ /* First reset BMCR */
++ if (!ret)
++ ret = mcs7830_write_phy(dev, MII_BMCR, 0x0000);
++ /* Enable Auto Neg */
++ if (!ret)
++ ret = mcs7830_write_phy(dev, MII_BMCR, BMCR_ANENABLE);
++ /* Restart Auto Neg (Keep the Enable Auto Neg Bit Set) */
++ if (!ret)
++ ret = mcs7830_write_phy(dev, MII_BMCR,
++ BMCR_ANENABLE | BMCR_ANRESTART );
++ return ret;
++}
++
++
++/*
++ * if we can read register 22, the chip revision is C or higher
++ */
++static int mcs7830_get_rev(struct usbnet *dev)
++{
++ u8 dummy[2];
++ int ret;
++ ret = mcs7830_get_reg(dev, HIF_REG_FRAME_DROP_COUNTER, 2, dummy);
++ if (ret > 0)
++ return 2; /* Rev C or later */
++ return 1; /* earlier revision */
++}
++
++/*
++ * On rev. C we need to set the pause threshold
++ */
++static void mcs7830_rev_C_fixup(struct usbnet *dev)
++{
++ u8 pause_threshold = HIF_REG_PAUSE_THRESHOLD_DEFAULT;
++ int retry;
++
++ for (retry = 0; retry < 2; retry++) {
++ if (mcs7830_get_rev(dev) == 2) {
++ dev_info(&dev->udev->dev, "applying rev.C fixup\n");
++ mcs7830_set_reg(dev, HIF_REG_PAUSE_THRESHOLD,
++ 1, &pause_threshold);
++ }
++ msleep(1);
++ }
++}
++
++static int mcs7830_mdio_read(struct net_device *netdev, int phy_id,
++ int location)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ return mcs7830_read_phy(dev, location);
++}
++
++static void mcs7830_mdio_write(struct net_device *netdev, int phy_id,
++ int location, int val)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ mcs7830_write_phy(dev, location, val);
++}
++
++static int mcs7830_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
++{
++ struct usbnet *dev = netdev_priv(net);
++ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
++}
++
++static inline struct mcs7830_data *mcs7830_get_data(struct usbnet *dev)
++{
++ return (struct mcs7830_data *)&dev->data;
++}
++
++static void mcs7830_hif_update_multicast_hash(struct usbnet *dev)
++{
++ struct mcs7830_data *data = mcs7830_get_data(dev);
++ mcs7830_set_reg_async(dev, HIF_REG_MULTICAST_HASH,
++ sizeof data->multi_filter,
++ data->multi_filter);
++}
++
++static void mcs7830_hif_update_config(struct usbnet *dev)
++{
++ /* implementation specific to data->config
++ (argument needs to be heap-based anyway - USB DMA!) */
++ struct mcs7830_data *data = mcs7830_get_data(dev);
++ mcs7830_set_reg_async(dev, HIF_REG_CONFIG, 1, &data->config);
++}
++
++static void mcs7830_data_set_multicast(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct mcs7830_data *data = mcs7830_get_data(dev);
++
++ memset(data->multi_filter, 0, sizeof data->multi_filter);
++
++ data->config = HIF_REG_CONFIG_TXENABLE;
++
++ /* this should not be needed, but it doesn't work otherwise */
++ data->config |= HIF_REG_CONFIG_ALLMULTICAST;
++
++ if (net->flags & IFF_PROMISC) {
++ data->config |= HIF_REG_CONFIG_PROMISCUOUS;
++ } else if (net->flags & IFF_ALLMULTI ||
++ netdev_mc_count(net) > MCS7830_MAX_MCAST) {
++ data->config |= HIF_REG_CONFIG_ALLMULTICAST;
++ } else if (netdev_mc_empty(net)) {
++ /* just broadcast and directed */
++ } else {
++ /* We use the 20 byte dev->data
++ * for our 8 byte filter buffer
++ * to avoid allocating memory that
++ * is tricky to free later */
++ struct netdev_hw_addr *ha;
++ u32 crc_bits;
++
++ /* Build the multicast hash filter. */
++ netdev_for_each_mc_addr(ha, net) {
++ crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
++ data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7);
++ }
++ }
++}
++
++static int mcs7830_apply_base_config(struct usbnet *dev)
++{
++ int ret;
++
++ /* re-configure known MAC (suspend case etc.) */
++ ret = mcs7830_hif_set_mac_address(dev, dev->net->dev_addr);
++ if (ret) {
++ dev_info(&dev->udev->dev, "Cannot set MAC address\n");
++ goto out;
++ }
++
++ /* Set up PHY */
++ ret = mcs7830_set_autoneg(dev, 0);
++ if (ret) {
++ dev_info(&dev->udev->dev, "Cannot set autoneg\n");
++ goto out;
++ }
++
++ mcs7830_hif_update_multicast_hash(dev);
++ mcs7830_hif_update_config(dev);
++
++ mcs7830_rev_C_fixup(dev);
++ ret = 0;
++out:
++ return ret;
++}
++
++/* credits go to asix_set_multicast */
++static void mcs7830_set_multicast(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ mcs7830_data_set_multicast(net);
++
++ mcs7830_hif_update_multicast_hash(dev);
++ mcs7830_hif_update_config(dev);
++}
++
++static int mcs7830_get_regs_len(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ switch (mcs7830_get_rev(dev)) {
++ case 1:
++ return 21;
++ case 2:
++ return 32;
++ }
++ return 0;
++}
++
++static void mcs7830_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *drvinfo)
++{
++ usbnet_get_drvinfo(net, drvinfo);
++ drvinfo->regdump_len = mcs7830_get_regs_len(net);
++}
++
++static void mcs7830_get_regs(struct net_device *net, struct ethtool_regs *regs, void *data)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ regs->version = mcs7830_get_rev(dev);
++ mcs7830_get_reg(dev, 0, regs->len, data);
++}
++
++static const struct ethtool_ops mcs7830_ethtool_ops = {
++ .get_drvinfo = mcs7830_get_drvinfo,
++ .get_regs_len = mcs7830_get_regs_len,
++ .get_regs = mcs7830_get_regs,
++
++ /* common usbnet calls */
++ .get_link = usbnet_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .nway_reset = usbnet_nway_reset,
++};
++
++static const struct net_device_ops mcs7830_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = mcs7830_ioctl,
++ .ndo_set_rx_mode = mcs7830_set_multicast,
++ .ndo_set_mac_address = mcs7830_set_mac_address,
++};
++
++static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev)
++{
++ struct net_device *net = dev->net;
++ int ret;
++ int retry;
++
++ /* Initial startup: Gather MAC address setting from EEPROM */
++ ret = -EINVAL;
++ for (retry = 0; retry < 5 && ret; retry++)
++ ret = mcs7830_hif_get_mac_address(dev, net->dev_addr);
++ if (ret) {
++ dev_warn(&dev->udev->dev, "Cannot read MAC address\n");
++ goto out;
++ }
++
++ mcs7830_data_set_multicast(net);
++
++ ret = mcs7830_apply_base_config(dev);
++ if (ret)
++ goto out;
++
++ net->ethtool_ops = &mcs7830_ethtool_ops;
++ net->netdev_ops = &mcs7830_netdev_ops;
++
++ /* reserve space for the status byte on rx */
++ dev->rx_urb_size = ETH_FRAME_LEN + 1;
++
++ dev->mii.mdio_read = mcs7830_mdio_read;
++ dev->mii.mdio_write = mcs7830_mdio_write;
++ dev->mii.dev = net;
++ dev->mii.phy_id_mask = 0x3f;
++ dev->mii.reg_num_mask = 0x1f;
++ dev->mii.phy_id = *((u8 *) net->dev_addr + 1);
++
++ ret = usbnet_get_endpoints(dev, udev);
++out:
++ return ret;
++}
++
++/* The chip always appends a status byte that we need to strip */
++static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ u8 status;
++
++ /* This check is no longer done by usbnet */
++ if (skb->len < dev->net->hard_header_len) {
++ dev_err(&dev->udev->dev, "unexpected tiny rx frame\n");
++ return 0;
++ }
++
++ skb_trim(skb, skb->len - 1);
++ status = skb->data[skb->len];
++
++ if (status != MCS7830_RX_FRAME_CORRECT) {
++ dev_dbg(&dev->udev->dev, "rx fixup status %x\n", status);
++
++ /* hmm, perhaps usbnet.c already sees a globally visible
++ frame error and increments rx_errors on its own already? */
++ dev->net->stats.rx_errors++;
++
++ if (status & (MCS7830_RX_SHORT_FRAME
++ |MCS7830_RX_LENGTH_ERROR
++ |MCS7830_RX_LARGE_FRAME))
++ dev->net->stats.rx_length_errors++;
++ if (status & MCS7830_RX_ALIGNMENT_ERROR)
++ dev->net->stats.rx_frame_errors++;
++ if (status & MCS7830_RX_CRC_ERROR)
++ dev->net->stats.rx_crc_errors++;
++ }
++
++ return skb->len > 0;
++}
++
++static void mcs7830_status(struct usbnet *dev, struct urb *urb)
++{
++ u8 *buf = urb->transfer_buffer;
++ bool link, link_changed;
++
++ if (urb->actual_length < 16)
++ return;
++
++ link = !(buf[1] == 0x20);
++ link_changed = netif_carrier_ok(dev->net) != link;
++ if (link_changed) {
++ usbnet_link_change(dev, link, 0);
++ netdev_dbg(dev->net, "Link Status is: %d\n", link);
++ }
++}
++
++static const struct driver_info moschip_info = {
++ .description = "MOSCHIP 7830/7832/7730 usb-NET adapter",
++ .bind = mcs7830_bind,
++ .rx_fixup = mcs7830_rx_fixup,
++ .flags = FLAG_ETHER | FLAG_LINK_INTR,
++ .status = mcs7830_status,
++ .in = 1,
++ .out = 2,
++};
++
++static const struct driver_info sitecom_info = {
++ .description = "Sitecom LN-30 usb-NET adapter",
++ .bind = mcs7830_bind,
++ .rx_fixup = mcs7830_rx_fixup,
++ .flags = FLAG_ETHER | FLAG_LINK_INTR,
++ .status = mcs7830_status,
++ .in = 1,
++ .out = 2,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ USB_DEVICE(MCS7830_VENDOR_ID, MCS7832_PRODUCT_ID),
++ .driver_info = (unsigned long) &moschip_info,
++ },
++ {
++ USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID),
++ .driver_info = (unsigned long) &moschip_info,
++ },
++ {
++ USB_DEVICE(MCS7830_VENDOR_ID, MCS7730_PRODUCT_ID),
++ .driver_info = (unsigned long) &moschip_info,
++ },
++ {
++ USB_DEVICE(SITECOM_VENDOR_ID, LN_030_PRODUCT_ID),
++ .driver_info = (unsigned long) &sitecom_info,
++ },
++ {},
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static int mcs7830_reset_resume (struct usb_interface *intf)
++{
++ /* YES, this function is successful enough that ethtool -d
++ does show same output pre-/post-suspend */
++
++ struct usbnet *dev = usb_get_intfdata(intf);
++
++ mcs7830_apply_base_config(dev);
++
++ usbnet_resume(intf);
++
++ return 0;
++}
++
++static struct usb_driver mcs7830_driver = {
++ .name = driver_name,
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .reset_resume = mcs7830_reset_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(mcs7830_driver);
++
++MODULE_DESCRIPTION("USB to network adapter MCS7830)");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/net1080.c backports-3.18.1-1/drivers/net/usb/net1080.c
+--- backports-3.18.1-1.org/drivers/net/usb/net1080.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/net1080.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,544 @@
++/*
++ * Net1080 based USB host-to-host cables
++ * Copyright (C) 2000-2005 by David Brownell
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++// #define DEBUG // error path messages, extra info
++// #define VERBOSE // more; success messages
++
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/usb/usbnet.h>
++#include <linux/slab.h>
++
++#include <asm/unaligned.h>
++
++
++/*
++ * Netchip 1080 driver ... http://www.netchip.com
++ * (Sept 2004: End-of-life announcement has been sent.)
++ * Used in (some) LapLink cables
++ */
++
++#define frame_errors data[1]
++
++/*
++ * NetChip framing of ethernet packets, supporting additional error
++ * checks for links that may drop bulk packets from inside messages.
++ * Odd USB length == always short read for last usb packet.
++ * - nc_header
++ * - Ethernet header (14 bytes)
++ * - payload
++ * - (optional padding byte, if needed so length becomes odd)
++ * - nc_trailer
++ *
++ * This framing is to be avoided for non-NetChip devices.
++ */
++
++struct nc_header { // packed:
++ __le16 hdr_len; // sizeof nc_header (LE, all)
++ __le16 packet_len; // payload size (including ethhdr)
++ __le16 packet_id; // detects dropped packets
++#define MIN_HEADER 6
++
++ // all else is optional, and must start with:
++ // __le16 vendorId; // from usb-if
++ // __le16 productId;
++} __packed;
++
++#define PAD_BYTE ((unsigned char)0xAC)
++
++struct nc_trailer {
++ __le16 packet_id;
++} __packed;
++
++// packets may use FLAG_FRAMING_NC and optional pad
++#define FRAMED_SIZE(mtu) (sizeof (struct nc_header) \
++ + sizeof (struct ethhdr) \
++ + (mtu) \
++ + 1 \
++ + sizeof (struct nc_trailer))
++
++#define MIN_FRAMED FRAMED_SIZE(0)
++
++/* packets _could_ be up to 64KB... */
++#define NC_MAX_PACKET 32767
++
++
++/*
++ * Zero means no timeout; else, how long a 64 byte bulk packet may be queued
++ * before the hardware drops it. If that's done, the driver will need to
++ * frame network packets to guard against the dropped USB packets. The win32
++ * driver sets this for both sides of the link.
++ */
++#define NC_READ_TTL_MS ((u8)255) // ms
++
++/*
++ * We ignore most registers and EEPROM contents.
++ */
++#define REG_USBCTL ((u8)0x04)
++#define REG_TTL ((u8)0x10)
++#define REG_STATUS ((u8)0x11)
++
++/*
++ * Vendor specific requests to read/write data
++ */
++#define REQUEST_REGISTER ((u8)0x10)
++#define REQUEST_EEPROM ((u8)0x11)
++
++static int
++nc_vendor_read(struct usbnet *dev, u8 req, u8 regnum, u16 *retval_ptr)
++{
++ int status = usbnet_read_cmd(dev, req,
++ USB_DIR_IN | USB_TYPE_VENDOR |
++ USB_RECIP_DEVICE,
++ 0, regnum, retval_ptr,
++ sizeof *retval_ptr);
++ if (status > 0)
++ status = 0;
++ if (!status)
++ le16_to_cpus(retval_ptr);
++ return status;
++}
++
++static inline int
++nc_register_read(struct usbnet *dev, u8 regnum, u16 *retval_ptr)
++{
++ return nc_vendor_read(dev, REQUEST_REGISTER, regnum, retval_ptr);
++}
++
++// no retval ... can become async, usable in_interrupt()
++static void
++nc_vendor_write(struct usbnet *dev, u8 req, u8 regnum, u16 value)
++{
++ usbnet_write_cmd(dev, req,
++ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ value, regnum, NULL, 0);
++}
++
++static inline void
++nc_register_write(struct usbnet *dev, u8 regnum, u16 value)
++{
++ nc_vendor_write(dev, REQUEST_REGISTER, regnum, value);
++}
++
++
++#if 0
++static void nc_dump_registers(struct usbnet *dev)
++{
++ u8 reg;
++ u16 *vp = kmalloc(sizeof (u16));
++
++ if (!vp)
++ return;
++
++ netdev_dbg(dev->net, "registers:\n");
++ for (reg = 0; reg < 0x20; reg++) {
++ int retval;
++
++ // reading some registers is trouble
++ if (reg >= 0x08 && reg <= 0xf)
++ continue;
++ if (reg >= 0x12 && reg <= 0x1e)
++ continue;
++
++ retval = nc_register_read(dev, reg, vp);
++ if (retval < 0)
++ netdev_dbg(dev->net, "reg [0x%x] ==> error %d\n",
++ reg, retval);
++ else
++ netdev_dbg(dev->net, "reg [0x%x] = 0x%x\n", reg, *vp);
++ }
++ kfree(vp);
++}
++#endif
++
++
++/*-------------------------------------------------------------------------*/
++
++/*
++ * Control register
++ */
++
++#define USBCTL_WRITABLE_MASK 0x1f0f
++// bits 15-13 reserved, r/o
++#define USBCTL_ENABLE_LANG (1 << 12)
++#define USBCTL_ENABLE_MFGR (1 << 11)
++#define USBCTL_ENABLE_PROD (1 << 10)
++#define USBCTL_ENABLE_SERIAL (1 << 9)
++#define USBCTL_ENABLE_DEFAULTS (1 << 8)
++// bits 7-4 reserved, r/o
++#define USBCTL_FLUSH_OTHER (1 << 3)
++#define USBCTL_FLUSH_THIS (1 << 2)
++#define USBCTL_DISCONN_OTHER (1 << 1)
++#define USBCTL_DISCONN_THIS (1 << 0)
++
++static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
++{
++ netif_dbg(dev, link, dev->net,
++ "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s; this%s%s; other%s%s; r/o 0x%x\n",
++ dev->udev->bus->bus_name, dev->udev->devpath,
++ usbctl,
++ (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "",
++ (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "",
++ (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "",
++ (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "",
++ (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "",
++
++ (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "",
++ (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "",
++
++ (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "",
++ (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
++
++ usbctl & ~USBCTL_WRITABLE_MASK);
++}
++
++/*-------------------------------------------------------------------------*/
++
++/*
++ * Status register
++ */
++
++#define STATUS_PORT_A (1 << 15)
++
++#define STATUS_CONN_OTHER (1 << 14)
++#define STATUS_SUSPEND_OTHER (1 << 13)
++#define STATUS_MAILBOX_OTHER (1 << 12)
++#define STATUS_PACKETS_OTHER(n) (((n) >> 8) & 0x03)
++
++#define STATUS_CONN_THIS (1 << 6)
++#define STATUS_SUSPEND_THIS (1 << 5)
++#define STATUS_MAILBOX_THIS (1 << 4)
++#define STATUS_PACKETS_THIS(n) (((n) >> 0) & 0x03)
++
++#define STATUS_UNSPEC_MASK 0x0c8c
++#define STATUS_NOISE_MASK ((u16)~(0x0303|STATUS_UNSPEC_MASK))
++
++
++static inline void nc_dump_status(struct usbnet *dev, u16 status)
++{
++ netif_dbg(dev, link, dev->net,
++ "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n",
++ dev->udev->bus->bus_name, dev->udev->devpath,
++ status,
++
++ // XXX the packet counts don't seem right
++ // (1 at reset, not 0); maybe UNSPEC too
++
++ (status & STATUS_PORT_A) ? 'A' : 'B',
++ STATUS_PACKETS_THIS(status),
++ (status & STATUS_CONN_THIS) ? " CON" : "",
++ (status & STATUS_SUSPEND_THIS) ? " SUS" : "",
++ (status & STATUS_MAILBOX_THIS) ? " MBOX" : "",
++
++ STATUS_PACKETS_OTHER(status),
++ (status & STATUS_CONN_OTHER) ? " CON" : "",
++ (status & STATUS_SUSPEND_OTHER) ? " SUS" : "",
++ (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "",
++
++ status & STATUS_UNSPEC_MASK);
++}
++
++/*-------------------------------------------------------------------------*/
++
++/*
++ * TTL register
++ */
++
++#define TTL_THIS(ttl) (0x00ff & ttl)
++#define TTL_OTHER(ttl) (0x00ff & (ttl >> 8))
++#define MK_TTL(this,other) ((u16)(((other)<<8)|(0x00ff&(this))))
++
++static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl)
++{
++ netif_dbg(dev, link, dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n",
++ dev->udev->bus->bus_name, dev->udev->devpath,
++ ttl, TTL_THIS(ttl), TTL_OTHER(ttl));
++}
++
++/*-------------------------------------------------------------------------*/
++
++static int net1080_reset(struct usbnet *dev)
++{
++ u16 usbctl, status, ttl;
++ u16 vp;
++ int retval;
++
++ // nc_dump_registers(dev);
++
++ if ((retval = nc_register_read(dev, REG_STATUS, &vp)) < 0) {
++ netdev_dbg(dev->net, "can't read %s-%s status: %d\n",
++ dev->udev->bus->bus_name, dev->udev->devpath, retval);
++ goto done;
++ }
++ status = vp;
++ nc_dump_status(dev, status);
++
++ if ((retval = nc_register_read(dev, REG_USBCTL, &vp)) < 0) {
++ netdev_dbg(dev->net, "can't read USBCTL, %d\n", retval);
++ goto done;
++ }
++ usbctl = vp;
++ nc_dump_usbctl(dev, usbctl);
++
++ nc_register_write(dev, REG_USBCTL,
++ USBCTL_FLUSH_THIS | USBCTL_FLUSH_OTHER);
++
++ if ((retval = nc_register_read(dev, REG_TTL, &vp)) < 0) {
++ netdev_dbg(dev->net, "can't read TTL, %d\n", retval);
++ goto done;
++ }
++ ttl = vp;
++ // nc_dump_ttl(dev, ttl);
++
++ nc_register_write(dev, REG_TTL,
++ MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) );
++ netdev_dbg(dev->net, "assigned TTL, %d ms\n", NC_READ_TTL_MS);
++
++ netif_info(dev, link, dev->net, "port %c, peer %sconnected\n",
++ (status & STATUS_PORT_A) ? 'A' : 'B',
++ (status & STATUS_CONN_OTHER) ? "" : "dis");
++ retval = 0;
++
++done:
++ return retval;
++}
++
++static int net1080_check_connect(struct usbnet *dev)
++{
++ int retval;
++ u16 status;
++ u16 vp;
++
++ retval = nc_register_read(dev, REG_STATUS, &vp);
++ status = vp;
++ if (retval != 0) {
++ netdev_dbg(dev->net, "net1080_check_conn read - %d\n", retval);
++ return retval;
++ }
++ if ((status & STATUS_CONN_OTHER) != STATUS_CONN_OTHER)
++ return -ENOLINK;
++ return 0;
++}
++
++static void nc_ensure_sync(struct usbnet *dev)
++{
++ if (++dev->frame_errors <= 5)
++ return;
++
++ if (usbnet_write_cmd_async(dev, REQUEST_REGISTER,
++ USB_DIR_OUT | USB_TYPE_VENDOR |
++ USB_RECIP_DEVICE,
++ USBCTL_FLUSH_THIS |
++ USBCTL_FLUSH_OTHER,
++ REG_USBCTL, NULL, 0))
++ return;
++
++ netif_dbg(dev, rx_err, dev->net,
++ "flush net1080; too many framing errors\n");
++ dev->frame_errors = 0;
++}
++
++static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ struct nc_header *header;
++ struct nc_trailer *trailer;
++ u16 hdr_len, packet_len;
++
++ /* This check is no longer done by usbnet */
++ if (skb->len < dev->net->hard_header_len)
++ return 0;
++
++ if (!(skb->len & 0x01)) {
++ netdev_dbg(dev->net, "rx framesize %d range %d..%d mtu %d\n",
++ skb->len, dev->net->hard_header_len, dev->hard_mtu,
++ dev->net->mtu);
++ dev->net->stats.rx_frame_errors++;
++ nc_ensure_sync(dev);
++ return 0;
++ }
++
++ header = (struct nc_header *) skb->data;
++ hdr_len = le16_to_cpup(&header->hdr_len);
++ packet_len = le16_to_cpup(&header->packet_len);
++ if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) {
++ dev->net->stats.rx_frame_errors++;
++ netdev_dbg(dev->net, "packet too big, %d\n", packet_len);
++ nc_ensure_sync(dev);
++ return 0;
++ } else if (hdr_len < MIN_HEADER) {
++ dev->net->stats.rx_frame_errors++;
++ netdev_dbg(dev->net, "header too short, %d\n", hdr_len);
++ nc_ensure_sync(dev);
++ return 0;
++ } else if (hdr_len > MIN_HEADER) {
++ // out of band data for us?
++ netdev_dbg(dev->net, "header OOB, %d bytes\n", hdr_len - MIN_HEADER);
++ nc_ensure_sync(dev);
++ // switch (vendor/product ids) { ... }
++ }
++ skb_pull(skb, hdr_len);
++
++ trailer = (struct nc_trailer *)
++ (skb->data + skb->len - sizeof *trailer);
++ skb_trim(skb, skb->len - sizeof *trailer);
++
++ if ((packet_len & 0x01) == 0) {
++ if (skb->data [packet_len] != PAD_BYTE) {
++ dev->net->stats.rx_frame_errors++;
++ netdev_dbg(dev->net, "bad pad\n");
++ return 0;
++ }
++ skb_trim(skb, skb->len - 1);
++ }
++ if (skb->len != packet_len) {
++ dev->net->stats.rx_frame_errors++;
++ netdev_dbg(dev->net, "bad packet len %d (expected %d)\n",
++ skb->len, packet_len);
++ nc_ensure_sync(dev);
++ return 0;
++ }
++ if (header->packet_id != get_unaligned(&trailer->packet_id)) {
++ dev->net->stats.rx_fifo_errors++;
++ netdev_dbg(dev->net, "(2+ dropped) rx packet_id mismatch 0x%x 0x%x\n",
++ le16_to_cpu(header->packet_id),
++ le16_to_cpu(trailer->packet_id));
++ return 0;
++ }
++#if 0
++ netdev_dbg(dev->net, "frame <rx h %d p %d id %d\n", header->hdr_len,
++ header->packet_len, header->packet_id);
++#endif
++ dev->frame_errors = 0;
++ return 1;
++}
++
++static struct sk_buff *
++net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
++{
++ struct sk_buff *skb2;
++ struct nc_header *header = NULL;
++ struct nc_trailer *trailer = NULL;
++ int padlen = sizeof (struct nc_trailer);
++ int len = skb->len;
++
++ if (!((len + padlen + sizeof (struct nc_header)) & 0x01))
++ padlen++;
++ if (!skb_cloned(skb)) {
++ int headroom = skb_headroom(skb);
++ int tailroom = skb_tailroom(skb);
++
++ if (padlen <= tailroom &&
++ sizeof(struct nc_header) <= headroom)
++ /* There's enough head and tail room */
++ goto encapsulate;
++
++ if ((sizeof (struct nc_header) + padlen) <
++ (headroom + tailroom)) {
++ /* There's enough total room, so just readjust */
++ skb->data = memmove(skb->head
++ + sizeof (struct nc_header),
++ skb->data, skb->len);
++ skb_set_tail_pointer(skb, len);
++ goto encapsulate;
++ }
++ }
++
++ /* Create a new skb to use with the correct size */
++ skb2 = skb_copy_expand(skb,
++ sizeof (struct nc_header),
++ padlen,
++ flags);
++ dev_kfree_skb_any(skb);
++ if (!skb2)
++ return skb2;
++ skb = skb2;
++
++encapsulate:
++ /* header first */
++ header = (struct nc_header *) skb_push(skb, sizeof *header);
++ header->hdr_len = cpu_to_le16(sizeof (*header));
++ header->packet_len = cpu_to_le16(len);
++ header->packet_id = cpu_to_le16((u16)dev->xid++);
++
++ /* maybe pad; then trailer */
++ if (!((skb->len + sizeof *trailer) & 0x01))
++ *skb_put(skb, 1) = PAD_BYTE;
++ trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer);
++ put_unaligned(header->packet_id, &trailer->packet_id);
++#if 0
++ netdev_dbg(dev->net, "frame >tx h %d p %d id %d\n",
++ header->hdr_len, header->packet_len,
++ header->packet_id);
++#endif
++ return skb;
++}
++
++static int net1080_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ unsigned extra = sizeof (struct nc_header)
++ + 1
++ + sizeof (struct nc_trailer);
++
++ dev->net->hard_header_len += extra;
++ dev->rx_urb_size = dev->net->hard_header_len + dev->net->mtu;
++ dev->hard_mtu = NC_MAX_PACKET;
++ return usbnet_get_endpoints (dev, intf);
++}
++
++static const struct driver_info net1080_info = {
++ .description = "NetChip TurboCONNECT",
++ .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_NC,
++ .bind = net1080_bind,
++ .reset = net1080_reset,
++ .check_connect = net1080_check_connect,
++ .rx_fixup = net1080_rx_fixup,
++ .tx_fixup = net1080_tx_fixup,
++};
++
++static const struct usb_device_id products [] = {
++{
++ USB_DEVICE(0x0525, 0x1080), // NetChip ref design
++ .driver_info = (unsigned long) &net1080_info,
++}, {
++ USB_DEVICE(0x06D0, 0x0622), // Laplink Gold
++ .driver_info = (unsigned long) &net1080_info,
++},
++ { }, // END
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver net1080_driver = {
++ .name = "net1080",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(net1080_driver);
++
++MODULE_AUTHOR("David Brownell");
++MODULE_DESCRIPTION("NetChip 1080 based USB Host-to-Host Links");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/pegasus.c backports-3.18.1-1/drivers/net/usb/pegasus.c
+--- backports-3.18.1-1.org/drivers/net/usb/pegasus.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/pegasus.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,1335 @@
++/*
++ * Copyright (c) 1999-2013 Petko Manolov (petkan@nucleusys.com)
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * ChangeLog:
++ * .... Most of the time spent on reading sources & docs.
++ * v0.2.x First official release for the Linux kernel.
++ * v0.3.0 Beutified and structured, some bugs fixed.
++ * v0.3.x URBifying bulk requests and bugfixing. First relatively
++ * stable release. Still can touch device's registers only
++ * from top-halves.
++ * v0.4.0 Control messages remained unurbified are now URBs.
++ * Now we can touch the HW at any time.
++ * v0.4.9 Control urbs again use process context to wait. Argh...
++ * Some long standing bugs (enable_net_traffic) fixed.
++ * Also nasty trick about resubmiting control urb from
++ * interrupt context used. Please let me know how it
++ * behaves. Pegasus II support added since this version.
++ * TODO: suppressing HCD warnings spewage on disconnect.
++ * v0.4.13 Ethernet address is now set at probe(), not at open()
++ * time as this seems to break dhcpd.
++ * v0.5.0 branch to 2.5.x kernels
++ * v0.5.1 ethtool support added
++ * v0.5.5 rx socket buffers are in a pool and the their allocation
++ * is out of the interrupt routine.
++ * ...
++ * v0.9.3 simplified [get|set]_register(s), async update registers
++ * logic revisited, receive skb_pool removed.
++ */
++
++#include <linux/sched.h>
++#include <linux/slab.h>
++#include <linux/init.h>
++#include <linux/delay.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/module.h>
++#include <asm/byteorder.h>
++#include <asm/uaccess.h>
++#include "pegasus.h"
++
++/*
++ * Version Information
++ */
++#define DRIVER_VERSION "v0.9.3 (2013/04/25)"
++#define DRIVER_AUTHOR "Petko Manolov <petkan@nucleusys.com>"
++#define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver"
++
++static const char driver_name[] = "pegasus";
++
++#undef PEGASUS_WRITE_EEPROM
++#define BMSR_MEDIA (BMSR_10HALF | BMSR_10FULL | BMSR_100HALF | \
++ BMSR_100FULL | BMSR_ANEGCAPABLE)
++
++static bool loopback;
++static bool mii_mode;
++static char *devid;
++
++static struct usb_eth_dev usb_dev_id[] = {
++#define PEGASUS_DEV(pn, vid, pid, flags) \
++ {.name = pn, .vendor = vid, .device = pid, .private = flags},
++#define PEGASUS_DEV_CLASS(pn, vid, pid, dclass, flags) \
++ PEGASUS_DEV(pn, vid, pid, flags)
++#include "pegasus.h"
++#undef PEGASUS_DEV
++#undef PEGASUS_DEV_CLASS
++ {NULL, 0, 0, 0},
++ {NULL, 0, 0, 0}
++};
++
++static struct usb_device_id pegasus_ids[] = {
++#define PEGASUS_DEV(pn, vid, pid, flags) \
++ {.match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = vid, .idProduct = pid},
++/*
++ * The Belkin F8T012xx1 bluetooth adaptor has the same vendor and product
++ * IDs as the Belkin F5D5050, so we need to teach the pegasus driver to
++ * ignore adaptors belonging to the "Wireless" class 0xE0. For this one
++ * case anyway, seeing as the pegasus is for "Wired" adaptors.
++ */
++#define PEGASUS_DEV_CLASS(pn, vid, pid, dclass, flags) \
++ {.match_flags = (USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_CLASS), \
++ .idVendor = vid, .idProduct = pid, .bDeviceClass = dclass},
++#include "pegasus.h"
++#undef PEGASUS_DEV
++#undef PEGASUS_DEV_CLASS
++ {},
++ {}
++};
++
++MODULE_AUTHOR(DRIVER_AUTHOR);
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("GPL");
++module_param(loopback, bool, 0);
++module_param(mii_mode, bool, 0);
++module_param(devid, charp, 0);
++MODULE_PARM_DESC(loopback, "Enable MAC loopback mode (bit 0)");
++MODULE_PARM_DESC(mii_mode, "Enable HomePNA mode (bit 0),default=MII mode = 0");
++MODULE_PARM_DESC(devid, "The format is: 'DEV_name:VendorID:DeviceID:Flags'");
++
++/* use ethtool to change the level for any given device */
++static int msg_level = -1;
++module_param(msg_level, int, 0);
++MODULE_PARM_DESC(msg_level, "Override default message level");
++
++MODULE_DEVICE_TABLE(usb, pegasus_ids);
++static const struct net_device_ops pegasus_netdev_ops;
++
++/*****/
++
++static void async_ctrl_callback(struct urb *urb)
++{
++ struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
++ int status = urb->status;
++
++ if (status < 0)
++ dev_dbg(&urb->dev->dev, "%s failed with %d", __func__, status);
++ kfree(req);
++ usb_free_urb(urb);
++}
++
++static int get_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data)
++{
++ int ret;
++
++ ret = usb_control_msg(pegasus->usb, usb_rcvctrlpipe(pegasus->usb, 0),
++ PEGASUS_REQ_GET_REGS, PEGASUS_REQT_READ, 0,
++ indx, data, size, 1000);
++ if (ret < 0)
++ netif_dbg(pegasus, drv, pegasus->net,
++ "%s returned %d\n", __func__, ret);
++ return ret;
++}
++
++static int set_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data)
++{
++ int ret;
++
++ ret = usb_control_msg(pegasus->usb, usb_sndctrlpipe(pegasus->usb, 0),
++ PEGASUS_REQ_SET_REGS, PEGASUS_REQT_WRITE, 0,
++ indx, data, size, 100);
++ if (ret < 0)
++ netif_dbg(pegasus, drv, pegasus->net,
++ "%s returned %d\n", __func__, ret);
++ return ret;
++}
++
++static int set_register(pegasus_t *pegasus, __u16 indx, __u8 data)
++{
++ int ret;
++
++ ret = usb_control_msg(pegasus->usb, usb_sndctrlpipe(pegasus->usb, 0),
++ PEGASUS_REQ_SET_REG, PEGASUS_REQT_WRITE, data,
++ indx, &data, 1, 1000);
++ if (ret < 0)
++ netif_dbg(pegasus, drv, pegasus->net,
++ "%s returned %d\n", __func__, ret);
++ return ret;
++}
++
++static int update_eth_regs_async(pegasus_t *pegasus)
++{
++ int ret = -ENOMEM;
++ struct urb *async_urb;
++ struct usb_ctrlrequest *req;
++
++ req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
++ if (req == NULL)
++ return ret;
++
++ async_urb = usb_alloc_urb(0, GFP_ATOMIC);
++ if (async_urb == NULL) {
++ kfree(req);
++ return ret;
++ }
++ req->bRequestType = PEGASUS_REQT_WRITE;
++ req->bRequest = PEGASUS_REQ_SET_REGS;
++ req->wValue = cpu_to_le16(0);
++ req->wIndex = cpu_to_le16(EthCtrl0);
++ req->wLength = cpu_to_le16(3);
++
++ usb_fill_control_urb(async_urb, pegasus->usb,
++ usb_sndctrlpipe(pegasus->usb, 0), (void *)req,
++ pegasus->eth_regs, 3, async_ctrl_callback, req);
++
++ ret = usb_submit_urb(async_urb, GFP_ATOMIC);
++ if (ret) {
++ if (ret == -ENODEV)
++ netif_device_detach(pegasus->net);
++ netif_err(pegasus, drv, pegasus->net,
++ "%s returned %d\n", __func__, ret);
++ }
++ return ret;
++}
++
++static int __mii_op(pegasus_t *p, __u8 phy, __u8 indx, __u16 *regd, __u8 cmd)
++{
++ int i;
++ __u8 data[4] = { phy, 0, 0, indx };
++ __le16 regdi;
++ int ret = -ETIMEDOUT;
++
++ if (cmd & PHY_WRITE) {
++ __le16 *t = (__le16 *) & data[1];
++ *t = cpu_to_le16(*regd);
++ }
++ set_register(p, PhyCtrl, 0);
++ set_registers(p, PhyAddr, sizeof(data), data);
++ set_register(p, PhyCtrl, (indx | cmd));
++ for (i = 0; i < REG_TIMEOUT; i++) {
++ ret = get_registers(p, PhyCtrl, 1, data);
++ if (ret < 0)
++ goto fail;
++ if (data[0] & PHY_DONE)
++ break;
++ }
++ if (i >= REG_TIMEOUT)
++ goto fail;
++ if (cmd & PHY_READ) {
++ ret = get_registers(p, PhyData, 2, ®di);
++ *regd = le16_to_cpu(regdi);
++ return ret;
++ }
++ return 0;
++fail:
++ netif_dbg(p, drv, p->net, "%s failed\n", __func__);
++ return ret;
++}
++
++/* Returns non-negative int on success, error on failure */
++static int read_mii_word(pegasus_t *pegasus, __u8 phy, __u8 indx, __u16 *regd)
++{
++ return __mii_op(pegasus, phy, indx, regd, PHY_READ);
++}
++
++/* Returns zero on success, error on failure */
++static int write_mii_word(pegasus_t *pegasus, __u8 phy, __u8 indx, __u16 *regd)
++{
++ return __mii_op(pegasus, phy, indx, regd, PHY_WRITE);
++}
++
++static int mdio_read(struct net_device *dev, int phy_id, int loc)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++ u16 res;
++
++ read_mii_word(pegasus, phy_id, loc, &res);
++ return (int)res;
++}
++
++static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++ u16 data = val;
++
++ write_mii_word(pegasus, phy_id, loc, &data);
++}
++
++static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)
++{
++ int i;
++ __u8 tmp;
++ __le16 retdatai;
++ int ret;
++
++ set_register(pegasus, EpromCtrl, 0);
++ set_register(pegasus, EpromOffset, index);
++ set_register(pegasus, EpromCtrl, EPROM_READ);
++
++ for (i = 0; i < REG_TIMEOUT; i++) {
++ ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
++ if (tmp & EPROM_DONE)
++ break;
++ if (ret == -ESHUTDOWN)
++ goto fail;
++ }
++ if (i >= REG_TIMEOUT)
++ goto fail;
++
++ ret = get_registers(pegasus, EpromData, 2, &retdatai);
++ *retdata = le16_to_cpu(retdatai);
++ return ret;
++
++fail:
++ netif_warn(pegasus, drv, pegasus->net, "%s failed\n", __func__);
++ return -ETIMEDOUT;
++}
++
++#ifdef PEGASUS_WRITE_EEPROM
++static inline void enable_eprom_write(pegasus_t *pegasus)
++{
++ __u8 tmp;
++
++ get_registers(pegasus, EthCtrl2, 1, &tmp);
++ set_register(pegasus, EthCtrl2, tmp | EPROM_WR_ENABLE);
++}
++
++static inline void disable_eprom_write(pegasus_t *pegasus)
++{
++ __u8 tmp;
++
++ get_registers(pegasus, EthCtrl2, 1, &tmp);
++ set_register(pegasus, EpromCtrl, 0);
++ set_register(pegasus, EthCtrl2, tmp & ~EPROM_WR_ENABLE);
++}
++
++static int write_eprom_word(pegasus_t *pegasus, __u8 index, __u16 data)
++{
++ int i;
++ __u8 tmp, d[4] = { 0x3f, 0, 0, EPROM_WRITE };
++ int ret;
++ __le16 le_data = cpu_to_le16(data);
++
++ set_registers(pegasus, EpromOffset, 4, d);
++ enable_eprom_write(pegasus);
++ set_register(pegasus, EpromOffset, index);
++ set_registers(pegasus, EpromData, 2, &le_data);
++ set_register(pegasus, EpromCtrl, EPROM_WRITE);
++
++ for (i = 0; i < REG_TIMEOUT; i++) {
++ ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
++ if (ret == -ESHUTDOWN)
++ goto fail;
++ if (tmp & EPROM_DONE)
++ break;
++ }
++ disable_eprom_write(pegasus);
++ if (i >= REG_TIMEOUT)
++ goto fail;
++
++ return ret;
++
++fail:
++ netif_warn(pegasus, drv, pegasus->net, "%s failed\n", __func__);
++ return -ETIMEDOUT;
++}
++#endif /* PEGASUS_WRITE_EEPROM */
++
++static inline void get_node_id(pegasus_t *pegasus, __u8 *id)
++{
++ int i;
++ __u16 w16;
++
++ for (i = 0; i < 3; i++) {
++ read_eprom_word(pegasus, i, &w16);
++ ((__le16 *) id)[i] = cpu_to_le16(w16);
++ }
++}
++
++static void set_ethernet_addr(pegasus_t *pegasus)
++{
++ __u8 node_id[6];
++
++ if (pegasus->features & PEGASUS_II) {
++ get_registers(pegasus, 0x10, sizeof(node_id), node_id);
++ } else {
++ get_node_id(pegasus, node_id);
++ set_registers(pegasus, EthID, sizeof(node_id), node_id);
++ }
++ memcpy(pegasus->net->dev_addr, node_id, sizeof(node_id));
++}
++
++static inline int reset_mac(pegasus_t *pegasus)
++{
++ __u8 data = 0x8;
++ int i;
++
++ set_register(pegasus, EthCtrl1, data);
++ for (i = 0; i < REG_TIMEOUT; i++) {
++ get_registers(pegasus, EthCtrl1, 1, &data);
++ if (~data & 0x08) {
++ if (loopback)
++ break;
++ if (mii_mode && (pegasus->features & HAS_HOME_PNA))
++ set_register(pegasus, Gpio1, 0x34);
++ else
++ set_register(pegasus, Gpio1, 0x26);
++ set_register(pegasus, Gpio0, pegasus->features);
++ set_register(pegasus, Gpio0, DEFAULT_GPIO_SET);
++ break;
++ }
++ }
++ if (i == REG_TIMEOUT)
++ return -ETIMEDOUT;
++
++ if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_LINKSYS ||
++ usb_dev_id[pegasus->dev_index].vendor == VENDOR_DLINK) {
++ set_register(pegasus, Gpio0, 0x24);
++ set_register(pegasus, Gpio0, 0x26);
++ }
++ if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_ELCON) {
++ __u16 auxmode;
++ read_mii_word(pegasus, 3, 0x1b, &auxmode);
++ auxmode |= 4;
++ write_mii_word(pegasus, 3, 0x1b, &auxmode);
++ }
++
++ return 0;
++}
++
++static int enable_net_traffic(struct net_device *dev, struct usb_device *usb)
++{
++ __u16 linkpart;
++ __u8 data[4];
++ pegasus_t *pegasus = netdev_priv(dev);
++ int ret;
++
++ read_mii_word(pegasus, pegasus->phy, MII_LPA, &linkpart);
++ data[0] = 0xc9;
++ data[1] = 0;
++ if (linkpart & (ADVERTISE_100FULL | ADVERTISE_10FULL))
++ data[1] |= 0x20; /* set full duplex */
++ if (linkpart & (ADVERTISE_100FULL | ADVERTISE_100HALF))
++ data[1] |= 0x10; /* set 100 Mbps */
++ if (mii_mode)
++ data[1] = 0;
++ data[2] = loopback ? 0x09 : 0x01;
++
++ memcpy(pegasus->eth_regs, data, sizeof(data));
++ ret = set_registers(pegasus, EthCtrl0, 3, data);
++
++ if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_LINKSYS ||
++ usb_dev_id[pegasus->dev_index].vendor == VENDOR_LINKSYS2 ||
++ usb_dev_id[pegasus->dev_index].vendor == VENDOR_DLINK) {
++ u16 auxmode;
++ read_mii_word(pegasus, 0, 0x1b, &auxmode);
++ auxmode |= 4;
++ write_mii_word(pegasus, 0, 0x1b, &auxmode);
++ }
++
++ return ret;
++}
++
++static void read_bulk_callback(struct urb *urb)
++{
++ pegasus_t *pegasus = urb->context;
++ struct net_device *net;
++ int rx_status, count = urb->actual_length;
++ int status = urb->status;
++ u8 *buf = urb->transfer_buffer;
++ __u16 pkt_len;
++
++ if (!pegasus)
++ return;
++
++ net = pegasus->net;
++ if (!netif_device_present(net) || !netif_running(net))
++ return;
++
++ switch (status) {
++ case 0:
++ break;
++ case -ETIME:
++ netif_dbg(pegasus, rx_err, net, "reset MAC\n");
++ pegasus->flags &= ~PEGASUS_RX_BUSY;
++ break;
++ case -EPIPE: /* stall, or disconnect from TT */
++ /* FIXME schedule work to clear the halt */
++ netif_warn(pegasus, rx_err, net, "no rx stall recovery\n");
++ return;
++ case -ENOENT:
++ case -ECONNRESET:
++ case -ESHUTDOWN:
++ netif_dbg(pegasus, ifdown, net, "rx unlink, %d\n", status);
++ return;
++ default:
++ netif_dbg(pegasus, rx_err, net, "RX status %d\n", status);
++ goto goon;
++ }
++
++ if (!count || count < 4)
++ goto goon;
++
++ rx_status = buf[count - 2];
++ if (rx_status & 0x1e) {
++ netif_dbg(pegasus, rx_err, net,
++ "RX packet error %x\n", rx_status);
++ pegasus->stats.rx_errors++;
++ if (rx_status & 0x06) /* long or runt */
++ pegasus->stats.rx_length_errors++;
++ if (rx_status & 0x08)
++ pegasus->stats.rx_crc_errors++;
++ if (rx_status & 0x10) /* extra bits */
++ pegasus->stats.rx_frame_errors++;
++ goto goon;
++ }
++ if (pegasus->chip == 0x8513) {
++ pkt_len = le32_to_cpu(*(__le32 *)urb->transfer_buffer);
++ pkt_len &= 0x0fff;
++ pegasus->rx_skb->data += 2;
++ } else {
++ pkt_len = buf[count - 3] << 8;
++ pkt_len += buf[count - 4];
++ pkt_len &= 0xfff;
++ pkt_len -= 8;
++ }
++
++ /*
++ * If the packet is unreasonably long, quietly drop it rather than
++ * kernel panicing by calling skb_put.
++ */
++ if (pkt_len > PEGASUS_MTU)
++ goto goon;
++
++ /*
++ * at this point we are sure pegasus->rx_skb != NULL
++ * so we go ahead and pass up the packet.
++ */
++ skb_put(pegasus->rx_skb, pkt_len);
++ pegasus->rx_skb->protocol = eth_type_trans(pegasus->rx_skb, net);
++ netif_rx(pegasus->rx_skb);
++ pegasus->stats.rx_packets++;
++ pegasus->stats.rx_bytes += pkt_len;
++
++ if (pegasus->flags & PEGASUS_UNPLUG)
++ return;
++
++ pegasus->rx_skb = __netdev_alloc_skb_ip_align(pegasus->net, PEGASUS_MTU,
++ GFP_ATOMIC);
++
++ if (pegasus->rx_skb == NULL)
++ goto tl_sched;
++goon:
++ usb_fill_bulk_urb(pegasus->rx_urb, pegasus->usb,
++ usb_rcvbulkpipe(pegasus->usb, 1),
++ pegasus->rx_skb->data, PEGASUS_MTU + 8,
++ read_bulk_callback, pegasus);
++ rx_status = usb_submit_urb(pegasus->rx_urb, GFP_ATOMIC);
++ if (rx_status == -ENODEV)
++ netif_device_detach(pegasus->net);
++ else if (rx_status) {
++ pegasus->flags |= PEGASUS_RX_URB_FAIL;
++ goto tl_sched;
++ } else {
++ pegasus->flags &= ~PEGASUS_RX_URB_FAIL;
++ }
++
++ return;
++
++tl_sched:
++ tasklet_schedule(&pegasus->rx_tl);
++}
++
++static void rx_fixup(unsigned long data)
++{
++ pegasus_t *pegasus;
++ int status;
++
++ pegasus = (pegasus_t *) data;
++ if (pegasus->flags & PEGASUS_UNPLUG)
++ return;
++
++ if (pegasus->flags & PEGASUS_RX_URB_FAIL)
++ if (pegasus->rx_skb)
++ goto try_again;
++ if (pegasus->rx_skb == NULL)
++ pegasus->rx_skb = __netdev_alloc_skb_ip_align(pegasus->net,
++ PEGASUS_MTU,
++ GFP_ATOMIC);
++ if (pegasus->rx_skb == NULL) {
++ netif_warn(pegasus, rx_err, pegasus->net, "low on memory\n");
++ tasklet_schedule(&pegasus->rx_tl);
++ return;
++ }
++ usb_fill_bulk_urb(pegasus->rx_urb, pegasus->usb,
++ usb_rcvbulkpipe(pegasus->usb, 1),
++ pegasus->rx_skb->data, PEGASUS_MTU + 8,
++ read_bulk_callback, pegasus);
++try_again:
++ status = usb_submit_urb(pegasus->rx_urb, GFP_ATOMIC);
++ if (status == -ENODEV)
++ netif_device_detach(pegasus->net);
++ else if (status) {
++ pegasus->flags |= PEGASUS_RX_URB_FAIL;
++ tasklet_schedule(&pegasus->rx_tl);
++ } else {
++ pegasus->flags &= ~PEGASUS_RX_URB_FAIL;
++ }
++}
++
++static void write_bulk_callback(struct urb *urb)
++{
++ pegasus_t *pegasus = urb->context;
++ struct net_device *net;
++ int status = urb->status;
++
++ if (!pegasus)
++ return;
++
++ net = pegasus->net;
++
++ if (!netif_device_present(net) || !netif_running(net))
++ return;
++
++ switch (status) {
++ case -EPIPE:
++ /* FIXME schedule_work() to clear the tx halt */
++ netif_stop_queue(net);
++ netif_warn(pegasus, tx_err, net, "no tx stall recovery\n");
++ return;
++ case -ENOENT:
++ case -ECONNRESET:
++ case -ESHUTDOWN:
++ netif_dbg(pegasus, ifdown, net, "tx unlink, %d\n", status);
++ return;
++ default:
++ netif_info(pegasus, tx_err, net, "TX status %d\n", status);
++ /* FALL THROUGH */
++ case 0:
++ break;
++ }
++
++ net->trans_start = jiffies; /* prevent tx timeout */
++ netif_wake_queue(net);
++}
++
++static void intr_callback(struct urb *urb)
++{
++ pegasus_t *pegasus = urb->context;
++ struct net_device *net;
++ int res, status = urb->status;
++
++ if (!pegasus)
++ return;
++ net = pegasus->net;
++
++ switch (status) {
++ case 0:
++ break;
++ case -ECONNRESET: /* unlink */
++ case -ENOENT:
++ case -ESHUTDOWN:
++ return;
++ default:
++ /* some Pegasus-I products report LOTS of data
++ * toggle errors... avoid log spamming
++ */
++ netif_dbg(pegasus, timer, net, "intr status %d\n", status);
++ }
++
++ if (urb->actual_length >= 6) {
++ u8 *d = urb->transfer_buffer;
++
++ /* byte 0 == tx_status1, reg 2B */
++ if (d[0] & (TX_UNDERRUN|EXCESSIVE_COL
++ |LATE_COL|JABBER_TIMEOUT)) {
++ pegasus->stats.tx_errors++;
++ if (d[0] & TX_UNDERRUN)
++ pegasus->stats.tx_fifo_errors++;
++ if (d[0] & (EXCESSIVE_COL | JABBER_TIMEOUT))
++ pegasus->stats.tx_aborted_errors++;
++ if (d[0] & LATE_COL)
++ pegasus->stats.tx_window_errors++;
++ }
++
++ /* d[5].LINK_STATUS lies on some adapters.
++ * d[0].NO_CARRIER kicks in only with failed TX.
++ * ... so monitoring with MII may be safest.
++ */
++
++ /* bytes 3-4 == rx_lostpkt, reg 2E/2F */
++ pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4];
++ }
++
++ res = usb_submit_urb(urb, GFP_ATOMIC);
++ if (res == -ENODEV)
++ netif_device_detach(pegasus->net);
++ if (res)
++ netif_err(pegasus, timer, net,
++ "can't resubmit interrupt urb, %d\n", res);
++}
++
++static void pegasus_tx_timeout(struct net_device *net)
++{
++ pegasus_t *pegasus = netdev_priv(net);
++ netif_warn(pegasus, timer, net, "tx timeout\n");
++ usb_unlink_urb(pegasus->tx_urb);
++ pegasus->stats.tx_errors++;
++}
++
++static netdev_tx_t pegasus_start_xmit(struct sk_buff *skb,
++ struct net_device *net)
++{
++ pegasus_t *pegasus = netdev_priv(net);
++ int count = ((skb->len + 2) & 0x3f) ? skb->len + 2 : skb->len + 3;
++ int res;
++ __u16 l16 = skb->len;
++
++ netif_stop_queue(net);
++
++ ((__le16 *) pegasus->tx_buff)[0] = cpu_to_le16(l16);
++ skb_copy_from_linear_data(skb, pegasus->tx_buff + 2, skb->len);
++ usb_fill_bulk_urb(pegasus->tx_urb, pegasus->usb,
++ usb_sndbulkpipe(pegasus->usb, 2),
++ pegasus->tx_buff, count,
++ write_bulk_callback, pegasus);
++ if ((res = usb_submit_urb(pegasus->tx_urb, GFP_ATOMIC))) {
++ netif_warn(pegasus, tx_err, net, "fail tx, %d\n", res);
++ switch (res) {
++ case -EPIPE: /* stall, or disconnect from TT */
++ /* cleanup should already have been scheduled */
++ break;
++ case -ENODEV: /* disconnect() upcoming */
++ case -EPERM:
++ netif_device_detach(pegasus->net);
++ break;
++ default:
++ pegasus->stats.tx_errors++;
++ netif_start_queue(net);
++ }
++ } else {
++ pegasus->stats.tx_packets++;
++ pegasus->stats.tx_bytes += skb->len;
++ }
++ dev_kfree_skb(skb);
++
++ return NETDEV_TX_OK;
++}
++
++static struct net_device_stats *pegasus_netdev_stats(struct net_device *dev)
++{
++ return &((pegasus_t *) netdev_priv(dev))->stats;
++}
++
++static inline void disable_net_traffic(pegasus_t *pegasus)
++{
++ __le16 tmp = cpu_to_le16(0);
++
++ set_registers(pegasus, EthCtrl0, sizeof(tmp), &tmp);
++}
++
++static inline void get_interrupt_interval(pegasus_t *pegasus)
++{
++ u16 data;
++ u8 interval;
++
++ read_eprom_word(pegasus, 4, &data);
++ interval = data >> 8;
++ if (pegasus->usb->speed != USB_SPEED_HIGH) {
++ if (interval < 0x80) {
++ netif_info(pegasus, timer, pegasus->net,
++ "intr interval changed from %ums to %ums\n",
++ interval, 0x80);
++ interval = 0x80;
++ data = (data & 0x00FF) | ((u16)interval << 8);
++#ifdef PEGASUS_WRITE_EEPROM
++ write_eprom_word(pegasus, 4, data);
++#endif
++ }
++ }
++ pegasus->intr_interval = interval;
++}
++
++static void set_carrier(struct net_device *net)
++{
++ pegasus_t *pegasus = netdev_priv(net);
++ u16 tmp;
++
++ if (read_mii_word(pegasus, pegasus->phy, MII_BMSR, &tmp))
++ return;
++
++ if (tmp & BMSR_LSTATUS)
++ netif_carrier_on(net);
++ else
++ netif_carrier_off(net);
++}
++
++static void free_all_urbs(pegasus_t *pegasus)
++{
++ usb_free_urb(pegasus->intr_urb);
++ usb_free_urb(pegasus->tx_urb);
++ usb_free_urb(pegasus->rx_urb);
++}
++
++static void unlink_all_urbs(pegasus_t *pegasus)
++{
++ usb_kill_urb(pegasus->intr_urb);
++ usb_kill_urb(pegasus->tx_urb);
++ usb_kill_urb(pegasus->rx_urb);
++}
++
++static int alloc_urbs(pegasus_t *pegasus)
++{
++ int res = -ENOMEM;
++
++ pegasus->rx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!pegasus->rx_urb) {
++ return res;
++ }
++ pegasus->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!pegasus->tx_urb) {
++ usb_free_urb(pegasus->rx_urb);
++ return res;
++ }
++ pegasus->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!pegasus->intr_urb) {
++ usb_free_urb(pegasus->tx_urb);
++ usb_free_urb(pegasus->rx_urb);
++ return res;
++ }
++
++ return 0;
++}
++
++static int pegasus_open(struct net_device *net)
++{
++ pegasus_t *pegasus = netdev_priv(net);
++ int res=-ENOMEM;
++
++ if (pegasus->rx_skb == NULL)
++ pegasus->rx_skb = __netdev_alloc_skb_ip_align(pegasus->net,
++ PEGASUS_MTU,
++ GFP_KERNEL);
++ if (!pegasus->rx_skb)
++ goto exit;
++
++ res = set_registers(pegasus, EthID, 6, net->dev_addr);
++
++ usb_fill_bulk_urb(pegasus->rx_urb, pegasus->usb,
++ usb_rcvbulkpipe(pegasus->usb, 1),
++ pegasus->rx_skb->data, PEGASUS_MTU + 8,
++ read_bulk_callback, pegasus);
++ if ((res = usb_submit_urb(pegasus->rx_urb, GFP_KERNEL))) {
++ if (res == -ENODEV)
++ netif_device_detach(pegasus->net);
++ netif_dbg(pegasus, ifup, net, "failed rx_urb, %d\n", res);
++ goto exit;
++ }
++
++ usb_fill_int_urb(pegasus->intr_urb, pegasus->usb,
++ usb_rcvintpipe(pegasus->usb, 3),
++ pegasus->intr_buff, sizeof(pegasus->intr_buff),
++ intr_callback, pegasus, pegasus->intr_interval);
++ if ((res = usb_submit_urb(pegasus->intr_urb, GFP_KERNEL))) {
++ if (res == -ENODEV)
++ netif_device_detach(pegasus->net);
++ netif_dbg(pegasus, ifup, net, "failed intr_urb, %d\n", res);
++ usb_kill_urb(pegasus->rx_urb);
++ goto exit;
++ }
++ res = enable_net_traffic(net, pegasus->usb);
++ if (res < 0) {
++ netif_dbg(pegasus, ifup, net,
++ "can't enable_net_traffic() - %d\n", res);
++ res = -EIO;
++ usb_kill_urb(pegasus->rx_urb);
++ usb_kill_urb(pegasus->intr_urb);
++ goto exit;
++ }
++ set_carrier(net);
++ netif_start_queue(net);
++ netif_dbg(pegasus, ifup, net, "open\n");
++ res = 0;
++exit:
++ return res;
++}
++
++static int pegasus_close(struct net_device *net)
++{
++ pegasus_t *pegasus = netdev_priv(net);
++
++ netif_stop_queue(net);
++ if (!(pegasus->flags & PEGASUS_UNPLUG))
++ disable_net_traffic(pegasus);
++ tasklet_kill(&pegasus->rx_tl);
++ unlink_all_urbs(pegasus);
++
++ return 0;
++}
++
++static void pegasus_get_drvinfo(struct net_device *dev,
++ struct ethtool_drvinfo *info)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++
++ strlcpy(info->driver, driver_name, sizeof(info->driver));
++ strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
++ usb_make_path(pegasus->usb, info->bus_info, sizeof(info->bus_info));
++}
++
++/* also handles three patterns of some kind in hardware */
++#define WOL_SUPPORTED (WAKE_MAGIC|WAKE_PHY)
++
++static void
++pegasus_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++
++ wol->supported = WAKE_MAGIC | WAKE_PHY;
++ wol->wolopts = pegasus->wolopts;
++}
++
++static int
++pegasus_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++ u8 reg78 = 0x04;
++ int ret;
++
++ if (wol->wolopts & ~WOL_SUPPORTED)
++ return -EINVAL;
++
++ if (wol->wolopts & WAKE_MAGIC)
++ reg78 |= 0x80;
++ if (wol->wolopts & WAKE_PHY)
++ reg78 |= 0x40;
++ /* FIXME this 0x10 bit still needs to get set in the chip... */
++ if (wol->wolopts)
++ pegasus->eth_regs[0] |= 0x10;
++ else
++ pegasus->eth_regs[0] &= ~0x10;
++ pegasus->wolopts = wol->wolopts;
++
++ ret = set_register(pegasus, WakeupControl, reg78);
++ if (!ret)
++ ret = device_set_wakeup_enable(&pegasus->usb->dev,
++ wol->wolopts);
++ return ret;
++}
++
++static inline void pegasus_reset_wol(struct net_device *dev)
++{
++ struct ethtool_wolinfo wol;
++
++ memset(&wol, 0, sizeof wol);
++ (void) pegasus_set_wol(dev, &wol);
++}
++
++static int
++pegasus_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
++{
++ pegasus_t *pegasus;
++
++ pegasus = netdev_priv(dev);
++ mii_ethtool_gset(&pegasus->mii, ecmd);
++ return 0;
++}
++
++static int
++pegasus_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++ return mii_ethtool_sset(&pegasus->mii, ecmd);
++}
++
++static int pegasus_nway_reset(struct net_device *dev)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++ return mii_nway_restart(&pegasus->mii);
++}
++
++static u32 pegasus_get_link(struct net_device *dev)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++ return mii_link_ok(&pegasus->mii);
++}
++
++static u32 pegasus_get_msglevel(struct net_device *dev)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++ return pegasus->msg_enable;
++}
++
++static void pegasus_set_msglevel(struct net_device *dev, u32 v)
++{
++ pegasus_t *pegasus = netdev_priv(dev);
++ pegasus->msg_enable = v;
++}
++
++static const struct ethtool_ops ops = {
++ .get_drvinfo = pegasus_get_drvinfo,
++ .get_settings = pegasus_get_settings,
++ .set_settings = pegasus_set_settings,
++ .nway_reset = pegasus_nway_reset,
++ .get_link = pegasus_get_link,
++ .get_msglevel = pegasus_get_msglevel,
++ .set_msglevel = pegasus_set_msglevel,
++ .get_wol = pegasus_get_wol,
++ .set_wol = pegasus_set_wol,
++};
++
++static int pegasus_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
++{
++ __u16 *data = (__u16 *) &rq->ifr_ifru;
++ pegasus_t *pegasus = netdev_priv(net);
++ int res;
++
++ switch (cmd) {
++ case SIOCDEVPRIVATE:
++ data[0] = pegasus->phy;
++ case SIOCDEVPRIVATE + 1:
++ read_mii_word(pegasus, data[0], data[1] & 0x1f, &data[3]);
++ res = 0;
++ break;
++ case SIOCDEVPRIVATE + 2:
++ if (!capable(CAP_NET_ADMIN))
++ return -EPERM;
++ write_mii_word(pegasus, pegasus->phy, data[1] & 0x1f, &data[2]);
++ res = 0;
++ break;
++ default:
++ res = -EOPNOTSUPP;
++ }
++ return res;
++}
++
++static void pegasus_set_multicast(struct net_device *net)
++{
++ pegasus_t *pegasus = netdev_priv(net);
++
++ if (net->flags & IFF_PROMISC) {
++ pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS;
++ netif_info(pegasus, link, net, "Promiscuous mode enabled\n");
++ } else if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) {
++ pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST;
++ pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
++ netif_dbg(pegasus, link, net, "set allmulti\n");
++ } else {
++ pegasus->eth_regs[EthCtrl0] &= ~RX_MULTICAST;
++ pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
++ }
++ update_eth_regs_async(pegasus);
++}
++
++static __u8 mii_phy_probe(pegasus_t *pegasus)
++{
++ int i;
++ __u16 tmp;
++
++ for (i = 0; i < 32; i++) {
++ read_mii_word(pegasus, i, MII_BMSR, &tmp);
++ if (tmp == 0 || tmp == 0xffff || (tmp & BMSR_MEDIA) == 0)
++ continue;
++ else
++ return i;
++ }
++
++ return 0xff;
++}
++
++static inline void setup_pegasus_II(pegasus_t *pegasus)
++{
++ __u8 data = 0xa5;
++
++ set_register(pegasus, Reg1d, 0);
++ set_register(pegasus, Reg7b, 1);
++ mdelay(100);
++ if ((pegasus->features & HAS_HOME_PNA) && mii_mode)
++ set_register(pegasus, Reg7b, 0);
++ else
++ set_register(pegasus, Reg7b, 2);
++
++ set_register(pegasus, 0x83, data);
++ get_registers(pegasus, 0x83, 1, &data);
++
++ if (data == 0xa5)
++ pegasus->chip = 0x8513;
++ else
++ pegasus->chip = 0;
++
++ set_register(pegasus, 0x80, 0xc0);
++ set_register(pegasus, 0x83, 0xff);
++ set_register(pegasus, 0x84, 0x01);
++
++ if (pegasus->features & HAS_HOME_PNA && mii_mode)
++ set_register(pegasus, Reg81, 6);
++ else
++ set_register(pegasus, Reg81, 2);
++}
++
++
++static int pegasus_count;
++static struct workqueue_struct *pegasus_workqueue;
++#define CARRIER_CHECK_DELAY (2 * HZ)
++
++static void check_carrier(struct work_struct *work)
++{
++ pegasus_t *pegasus = container_of(work, pegasus_t, carrier_check.work);
++ set_carrier(pegasus->net);
++ if (!(pegasus->flags & PEGASUS_UNPLUG)) {
++ queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
++ CARRIER_CHECK_DELAY);
++ }
++}
++
++static int pegasus_blacklisted(struct usb_device *udev)
++{
++ struct usb_device_descriptor *udd = &udev->descriptor;
++
++ /* Special quirk to keep the driver from handling the Belkin Bluetooth
++ * dongle which happens to have the same ID.
++ */
++ if ((udd->idVendor == cpu_to_le16(VENDOR_BELKIN)) &&
++ (udd->idProduct == cpu_to_le16(0x0121)) &&
++ (udd->bDeviceClass == USB_CLASS_WIRELESS_CONTROLLER) &&
++ (udd->bDeviceProtocol == 1))
++ return 1;
++
++ return 0;
++}
++
++/* we rely on probe() and remove() being serialized so we
++ * don't need extra locking on pegasus_count.
++ */
++static void pegasus_dec_workqueue(void)
++{
++ pegasus_count--;
++ if (pegasus_count == 0) {
++ destroy_workqueue(pegasus_workqueue);
++ pegasus_workqueue = NULL;
++ }
++}
++
++static int pegasus_probe(struct usb_interface *intf,
++ const struct usb_device_id *id)
++{
++ struct usb_device *dev = interface_to_usbdev(intf);
++ struct net_device *net;
++ pegasus_t *pegasus;
++ int dev_index = id - pegasus_ids;
++ int res = -ENOMEM;
++
++ if (pegasus_blacklisted(dev))
++ return -ENODEV;
++
++ if (pegasus_count == 0) {
++ pegasus_workqueue = create_singlethread_workqueue("pegasus");
++ if (!pegasus_workqueue)
++ return -ENOMEM;
++ }
++ pegasus_count++;
++
++ net = alloc_etherdev(sizeof(struct pegasus));
++ if (!net)
++ goto out;
++
++ pegasus = netdev_priv(net);
++ pegasus->dev_index = dev_index;
++
++ res = alloc_urbs(pegasus);
++ if (res < 0) {
++ dev_err(&intf->dev, "can't allocate %s\n", "urbs");
++ goto out1;
++ }
++
++ tasklet_init(&pegasus->rx_tl, rx_fixup, (unsigned long) pegasus);
++
++ INIT_DELAYED_WORK(&pegasus->carrier_check, check_carrier);
++
++ pegasus->intf = intf;
++ pegasus->usb = dev;
++ pegasus->net = net;
++
++
++ net->watchdog_timeo = PEGASUS_TX_TIMEOUT;
++ net->netdev_ops = &pegasus_netdev_ops;
++ net->ethtool_ops = &ops;
++ pegasus->mii.dev = net;
++ pegasus->mii.mdio_read = mdio_read;
++ pegasus->mii.mdio_write = mdio_write;
++ pegasus->mii.phy_id_mask = 0x1f;
++ pegasus->mii.reg_num_mask = 0x1f;
++ pegasus->msg_enable = netif_msg_init(msg_level, NETIF_MSG_DRV
++ | NETIF_MSG_PROBE | NETIF_MSG_LINK);
++
++ pegasus->features = usb_dev_id[dev_index].private;
++ get_interrupt_interval(pegasus);
++ if (reset_mac(pegasus)) {
++ dev_err(&intf->dev, "can't reset MAC\n");
++ res = -EIO;
++ goto out2;
++ }
++ set_ethernet_addr(pegasus);
++ if (pegasus->features & PEGASUS_II) {
++ dev_info(&intf->dev, "setup Pegasus II specific registers\n");
++ setup_pegasus_II(pegasus);
++ }
++ pegasus->phy = mii_phy_probe(pegasus);
++ if (pegasus->phy == 0xff) {
++ dev_warn(&intf->dev, "can't locate MII phy, using default\n");
++ pegasus->phy = 1;
++ }
++ pegasus->mii.phy_id = pegasus->phy;
++ usb_set_intfdata(intf, pegasus);
++ SET_NETDEV_DEV(net, &intf->dev);
++ pegasus_reset_wol(net);
++ res = register_netdev(net);
++ if (res)
++ goto out3;
++ queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
++ CARRIER_CHECK_DELAY);
++ dev_info(&intf->dev, "%s, %s, %pM\n", net->name,
++ usb_dev_id[dev_index].name, net->dev_addr);
++ return 0;
++
++out3:
++ usb_set_intfdata(intf, NULL);
++out2:
++ free_all_urbs(pegasus);
++out1:
++ free_netdev(net);
++out:
++ pegasus_dec_workqueue();
++ return res;
++}
++
++static void pegasus_disconnect(struct usb_interface *intf)
++{
++ struct pegasus *pegasus = usb_get_intfdata(intf);
++
++ usb_set_intfdata(intf, NULL);
++ if (!pegasus) {
++ dev_dbg(&intf->dev, "unregistering non-bound device?\n");
++ return;
++ }
++
++ pegasus->flags |= PEGASUS_UNPLUG;
++ cancel_delayed_work(&pegasus->carrier_check);
++ unregister_netdev(pegasus->net);
++ unlink_all_urbs(pegasus);
++ free_all_urbs(pegasus);
++ if (pegasus->rx_skb != NULL) {
++ dev_kfree_skb(pegasus->rx_skb);
++ pegasus->rx_skb = NULL;
++ }
++ free_netdev(pegasus->net);
++ pegasus_dec_workqueue();
++}
++
++static int pegasus_suspend(struct usb_interface *intf, pm_message_t message)
++{
++ struct pegasus *pegasus = usb_get_intfdata(intf);
++
++ netif_device_detach(pegasus->net);
++ cancel_delayed_work(&pegasus->carrier_check);
++ if (netif_running(pegasus->net)) {
++ usb_kill_urb(pegasus->rx_urb);
++ usb_kill_urb(pegasus->intr_urb);
++ }
++ return 0;
++}
++
++static int pegasus_resume(struct usb_interface *intf)
++{
++ struct pegasus *pegasus = usb_get_intfdata(intf);
++
++ netif_device_attach(pegasus->net);
++ if (netif_running(pegasus->net)) {
++ pegasus->rx_urb->status = 0;
++ pegasus->rx_urb->actual_length = 0;
++ read_bulk_callback(pegasus->rx_urb);
++
++ pegasus->intr_urb->status = 0;
++ pegasus->intr_urb->actual_length = 0;
++ intr_callback(pegasus->intr_urb);
++ }
++ queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
++ CARRIER_CHECK_DELAY);
++ return 0;
++}
++
++static const struct net_device_ops pegasus_netdev_ops = {
++ .ndo_open = pegasus_open,
++ .ndo_stop = pegasus_close,
++ .ndo_do_ioctl = pegasus_ioctl,
++ .ndo_start_xmit = pegasus_start_xmit,
++ .ndo_set_rx_mode = pegasus_set_multicast,
++ .ndo_get_stats = pegasus_netdev_stats,
++ .ndo_tx_timeout = pegasus_tx_timeout,
++ .ndo_change_mtu = eth_change_mtu,
++ .ndo_set_mac_address = eth_mac_addr,
++ .ndo_validate_addr = eth_validate_addr,
++};
++
++static struct usb_driver pegasus_driver = {
++ .name = driver_name,
++ .probe = pegasus_probe,
++ .disconnect = pegasus_disconnect,
++ .id_table = pegasus_ids,
++ .suspend = pegasus_suspend,
++ .resume = pegasus_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++static void __init parse_id(char *id)
++{
++ unsigned int vendor_id = 0, device_id = 0, flags = 0, i = 0;
++ char *token, *name = NULL;
++
++ if ((token = strsep(&id, ":")) != NULL)
++ name = token;
++ /* name now points to a null terminated string*/
++ if ((token = strsep(&id, ":")) != NULL)
++ vendor_id = simple_strtoul(token, NULL, 16);
++ if ((token = strsep(&id, ":")) != NULL)
++ device_id = simple_strtoul(token, NULL, 16);
++ flags = simple_strtoul(id, NULL, 16);
++ pr_info("%s: new device %s, vendor ID 0x%04x, device ID 0x%04x, flags: 0x%x\n",
++ driver_name, name, vendor_id, device_id, flags);
++
++ if (vendor_id > 0x10000 || vendor_id == 0)
++ return;
++ if (device_id > 0x10000 || device_id == 0)
++ return;
++
++ for (i = 0; usb_dev_id[i].name; i++);
++ usb_dev_id[i].name = name;
++ usb_dev_id[i].vendor = vendor_id;
++ usb_dev_id[i].device = device_id;
++ usb_dev_id[i].private = flags;
++ pegasus_ids[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE;
++ pegasus_ids[i].idVendor = vendor_id;
++ pegasus_ids[i].idProduct = device_id;
++}
++
++static int __init pegasus_init(void)
++{
++ pr_info("%s: %s, " DRIVER_DESC "\n", driver_name, DRIVER_VERSION);
++ if (devid)
++ parse_id(devid);
++ return usb_register(&pegasus_driver);
++}
++
++static void __exit pegasus_exit(void)
++{
++ usb_deregister(&pegasus_driver);
++}
++
++module_init(pegasus_init);
++module_exit(pegasus_exit);
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/pegasus.h backports-3.18.1-1/drivers/net/usb/pegasus.h
+--- backports-3.18.1-1.org/drivers/net/usb/pegasus.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/pegasus.h 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,308 @@
++/*
++ * Copyright (c) 1999-2013 Petko Manolov (petkan@nucleusys.com)
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++
++#ifndef PEGASUS_DEV
++
++#define PEGASUS_II 0x80000000
++#define HAS_HOME_PNA 0x40000000
++
++#define PEGASUS_MTU 1536
++
++#define EPROM_WRITE 0x01
++#define EPROM_READ 0x02
++#define EPROM_DONE 0x04
++#define EPROM_WR_ENABLE 0x10
++#define EPROM_LOAD 0x20
++
++#define PHY_DONE 0x80
++#define PHY_READ 0x40
++#define PHY_WRITE 0x20
++#define DEFAULT_GPIO_RESET 0x24
++#define DEFAULT_GPIO_SET 0x26
++
++#define PEGASUS_PRESENT 0x00000001
++#define PEGASUS_TX_BUSY 0x00000004
++#define PEGASUS_RX_BUSY 0x00000008
++#define CTRL_URB_RUNNING 0x00000010
++#define CTRL_URB_SLEEP 0x00000020
++#define PEGASUS_UNPLUG 0x00000040
++#define PEGASUS_RX_URB_FAIL 0x00000080
++
++#define RX_MULTICAST 2
++#define RX_PROMISCUOUS 4
++
++#define REG_TIMEOUT (HZ)
++#define PEGASUS_TX_TIMEOUT (HZ*10)
++
++#define TX_UNDERRUN 0x80
++#define EXCESSIVE_COL 0x40
++#define LATE_COL 0x20
++#define NO_CARRIER 0x10
++#define LOSS_CARRIER 0x08
++#define JABBER_TIMEOUT 0x04
++
++#define LINK_STATUS 0x01
++
++#define PEGASUS_REQT_READ 0xc0
++#define PEGASUS_REQT_WRITE 0x40
++#define PEGASUS_REQ_GET_REGS 0xf0
++#define PEGASUS_REQ_SET_REGS 0xf1
++#define PEGASUS_REQ_SET_REG PEGASUS_REQ_SET_REGS
++
++enum pegasus_registers {
++ EthCtrl0 = 0,
++ EthCtrl1 = 1,
++ EthCtrl2 = 2,
++ EthID = 0x10,
++ Reg1d = 0x1d,
++ EpromOffset = 0x20,
++ EpromData = 0x21, /* 0x21 low, 0x22 high byte */
++ EpromCtrl = 0x23,
++ PhyAddr = 0x25,
++ PhyData = 0x26, /* 0x26 low, 0x27 high byte */
++ PhyCtrl = 0x28,
++ UsbStst = 0x2a,
++ EthTxStat0 = 0x2b,
++ EthTxStat1 = 0x2c,
++ EthRxStat = 0x2d,
++ WakeupControl = 0x78,
++ Reg7b = 0x7b,
++ Gpio0 = 0x7e,
++ Gpio1 = 0x7f,
++ Reg81 = 0x81,
++};
++
++
++typedef struct pegasus {
++ struct usb_device *usb;
++ struct usb_interface *intf;
++ struct net_device *net;
++ struct net_device_stats stats;
++ struct mii_if_info mii;
++ unsigned flags;
++ unsigned features;
++ u32 msg_enable;
++ u32 wolopts;
++ int dev_index;
++ int intr_interval;
++ struct tasklet_struct rx_tl;
++ struct delayed_work carrier_check;
++ struct urb *rx_urb, *tx_urb, *intr_urb;
++ struct sk_buff *rx_skb;
++ int chip;
++ unsigned char intr_buff[8];
++ __u8 tx_buff[PEGASUS_MTU];
++ __u8 eth_regs[4];
++ __u8 phy;
++ __u8 gpio_res;
++} pegasus_t;
++
++
++struct usb_eth_dev {
++ char *name;
++ __u16 vendor;
++ __u16 device;
++ __u32 private; /* LSB is gpio reset value */
++};
++
++#define VENDOR_3COM 0x0506
++#define VENDOR_ABOCOM 0x07b8
++#define VENDOR_ACCTON 0x083a
++#define VENDOR_ADMTEK 0x07a6
++#define VENDOR_AEILAB 0x3334
++#define VENDOR_ALLIEDTEL 0x07c9
++#define VENDOR_ATEN 0x0557
++#define VENDOR_BELKIN 0x050d
++#define VENDOR_BILLIONTON 0x08dd
++#define VENDOR_COMPAQ 0x049f
++#define VENDOR_COREGA 0x07aa
++#define VENDOR_DLINK 0x2001
++#define VENDOR_ELCON 0x0db7
++#define VENDOR_ELECOM 0x056e
++#define VENDOR_ELSA 0x05cc
++#define VENDOR_GIGABYTE 0x1044
++#define VENDOR_HAWKING 0x0e66
++#define VENDOR_HP 0x03f0
++#define VENDOR_IODATA 0x04bb
++#define VENDOR_KINGSTON 0x0951
++#define VENDOR_LANEED 0x056e
++#define VENDOR_LINKSYS 0x066b
++#define VENDOR_LINKSYS2 0x077b
++#define VENDOR_MELCO 0x0411
++#define VENDOR_MICROSOFT 0x045e
++#define VENDOR_MOBILITY 0x1342
++#define VENDOR_NETGEAR 0x0846
++#define VENDOR_OCT 0x0b39
++#define VENDOR_SMARTBRIDGES 0x08d1
++#define VENDOR_SMC 0x0707
++#define VENDOR_SOHOWARE 0x15e8
++#define VENDOR_SIEMENS 0x067c
++
++
++#else /* PEGASUS_DEV */
++
++PEGASUS_DEV("3Com USB Ethernet 3C460B", VENDOR_3COM, 0x4601,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("ATEN USB Ethernet UC-110T", VENDOR_ATEN, 0x2007,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("USB HPNA/Ethernet", VENDOR_ABOCOM, 0x110c,
++ DEFAULT_GPIO_RESET | PEGASUS_II | HAS_HOME_PNA)
++PEGASUS_DEV("USB HPNA/Ethernet", VENDOR_ABOCOM, 0x4104,
++ DEFAULT_GPIO_RESET | HAS_HOME_PNA)
++PEGASUS_DEV("USB HPNA/Ethernet", VENDOR_ABOCOM, 0x4004,
++ DEFAULT_GPIO_RESET | HAS_HOME_PNA)
++PEGASUS_DEV("USB HPNA/Ethernet", VENDOR_ABOCOM, 0x4007,
++ DEFAULT_GPIO_RESET | HAS_HOME_PNA)
++PEGASUS_DEV("USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0x4102,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0x4002,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0x400b,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0x400c,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0xabc1,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("USB 10/100 Fast Ethernet", VENDOR_ABOCOM, 0x200c,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Accton USB 10/100 Ethernet Adapter", VENDOR_ACCTON, 0x1046,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("SpeedStream USB 10/100 Ethernet", VENDOR_ACCTON, 0x5046,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Philips USB 10/100 Ethernet", VENDOR_ACCTON, 0xb004,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("ADMtek ADM8511 \"Pegasus II\" USB Ethernet",
++ VENDOR_ADMTEK, 0x8511,
++ DEFAULT_GPIO_RESET | PEGASUS_II | HAS_HOME_PNA)
++PEGASUS_DEV("ADMtek ADM8513 \"Pegasus II\" USB Ethernet",
++ VENDOR_ADMTEK, 0x8513,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("ADMtek ADM8515 \"Pegasus II\" USB-2.0 Ethernet",
++ VENDOR_ADMTEK, 0x8515,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("ADMtek AN986 \"Pegasus\" USB Ethernet (evaluation board)",
++ VENDOR_ADMTEK, 0x0986,
++ DEFAULT_GPIO_RESET | HAS_HOME_PNA)
++PEGASUS_DEV("AN986A USB MAC", VENDOR_ADMTEK, 1986,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("AEI USB Fast Ethernet Adapter", VENDOR_AEILAB, 0x1701,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++/*
++ * Distinguish between this Belkin adaptor and the Belkin bluetooth adaptors
++ * with the same product IDs by checking the device class too.
++ */
++PEGASUS_DEV_CLASS("Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121, 0x00,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Belkin F5U122 10/100 USB Ethernet", VENDOR_BELKIN, 0x0122,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,
++ DEFAULT_GPIO_RESET | HAS_HOME_PNA)
++PEGASUS_DEV("iPAQ Networking 10/100 USB", VENDOR_COMPAQ, 0x8511,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Billionton USBEL-100", VENDOR_BILLIONTON, 0x0988,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("Billionton USBE-100", VENDOR_BILLIONTON, 0x8511,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Corega FEther USB-TX", VENDOR_COREGA, 0x0004,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("Corega FEther USB-TXS", VENDOR_COREGA, 0x000d,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("D-Link DSB-650TX", VENDOR_DLINK, 0x4001,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("D-Link DSB-650TX", VENDOR_DLINK, 0x4002,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("D-Link DSB-650TX", VENDOR_DLINK, 0x4102,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("D-Link DSB-650TX", VENDOR_DLINK, 0x400b,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("D-Link DSB-650TX", VENDOR_DLINK, 0x200c,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("D-Link DSB-650TX(PNA)", VENDOR_DLINK, 0x4003,
++ DEFAULT_GPIO_RESET | HAS_HOME_PNA)
++PEGASUS_DEV("D-Link DSB-650", VENDOR_DLINK, 0xabc1,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("GOLDPFEIL USB Adapter", VENDOR_ELCON, 0x0002,
++ DEFAULT_GPIO_RESET | PEGASUS_II | HAS_HOME_PNA)
++PEGASUS_DEV("ELECOM USB Ethernet LD-USB20", VENDOR_ELECOM, 0x4010,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("EasiDock Ethernet", VENDOR_MOBILITY, 0x0304,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("Elsa Micolink USB2Ethernet", VENDOR_ELSA, 0x3000,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("GIGABYTE GN-BR402W Wireless Router", VENDOR_GIGABYTE, 0x8002,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("Hawking UF100 10/100 Ethernet", VENDOR_HAWKING, 0x400c,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("HP hn210c Ethernet USB", VENDOR_HP, 0x811c,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("IO DATA USB ET/TX", VENDOR_IODATA, 0x0904,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("IO DATA USB ET/TX-S", VENDOR_IODATA, 0x0913,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("IO DATA USB ETX-US2", VENDOR_IODATA, 0x093a,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Kingston KNU101TX Ethernet", VENDOR_KINGSTON, 0x000a,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x4002,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("LANEED USB Ethernet LD-USBL/TX", VENDOR_LANEED, 0x4005,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x400b,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("LANEED USB Ethernet LD-USB/T", VENDOR_LANEED, 0xabc1,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x200c,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Linksys USB10TX", VENDOR_LINKSYS, 0x2202,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("Linksys USB100TX", VENDOR_LINKSYS, 0x2203,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("Linksys USB100TX", VENDOR_LINKSYS, 0x2204,
++ DEFAULT_GPIO_RESET | HAS_HOME_PNA)
++PEGASUS_DEV("Linksys USB10T Ethernet Adapter", VENDOR_LINKSYS, 0x2206,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Linksys USBVPN1", VENDOR_LINKSYS2, 0x08b4,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("Linksys USB USB100TX", VENDOR_LINKSYS, 0x400b,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Linksys USB10TX", VENDOR_LINKSYS, 0x200c,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("MELCO/BUFFALO LUA-TX", VENDOR_MELCO, 0x0001,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("MELCO/BUFFALO LUA-TX", VENDOR_MELCO, 0x0005,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("MELCO/BUFFALO LUA2-TX", VENDOR_MELCO, 0x0009,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("Microsoft MN-110", VENDOR_MICROSOFT, 0x007a,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("NETGEAR FA101", VENDOR_NETGEAR, 0x1020,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("OCT Inc.", VENDOR_OCT, 0x0109,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("OCT USB TO Ethernet", VENDOR_OCT, 0x0901,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("smartNIC 2 PnP Adapter", VENDOR_SMARTBRIDGES, 0x0003,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("SMC 202 USB Ethernet", VENDOR_SMC, 0x0200,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("SMC 2206 USB Ethernet", VENDOR_SMC, 0x0201,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("SOHOware NUB100 Ethernet", VENDOR_SOHOWARE, 0x9100,
++ DEFAULT_GPIO_RESET)
++PEGASUS_DEV("SOHOware NUB110 Ethernet", VENDOR_SOHOWARE, 0x9110,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++PEGASUS_DEV("SpeedStream USB 10/100 Ethernet", VENDOR_SIEMENS, 0x1001,
++ DEFAULT_GPIO_RESET | PEGASUS_II)
++
++
++#endif /* PEGASUS_DEV */
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/plusb.c backports-3.18.1-1/drivers/net/usb/plusb.c
+--- backports-3.18.1-1.org/drivers/net/usb/plusb.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/plusb.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,157 @@
++/*
++ * PL-2301/2302 USB host-to-host link cables
++ * Copyright (C) 2000-2005 by David Brownell
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++// #define DEBUG // error path messages, extra info
++// #define VERBOSE // more; success messages
++
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/usb/usbnet.h>
++
++
++/*
++ * Prolific PL-2301/PL-2302 driver ... http://www.prolific.com.tw/
++ *
++ * The protocol and handshaking used here should be bug-compatible
++ * with the Linux 2.2 "plusb" driver, by Deti Fliegl.
++ *
++ * HEADS UP: this handshaking isn't all that robust. This driver
++ * gets confused easily if you unplug one end of the cable then
++ * try to connect it again; you'll need to restart both ends. The
++ * "naplink" software (used by some PlayStation/2 deveopers) does
++ * the handshaking much better! Also, sometimes this hardware
++ * seems to get wedged under load. Prolific docs are weak, and
++ * don't identify differences between PL2301 and PL2302, much less
++ * anything to explain the different PL2302 versions observed.
++ *
++ * NOTE: pl2501 has several modes, including pl2301 and pl2302
++ * compatibility. Some docs suggest the difference between 2301
++ * and 2302 is only to make MS-Windows use a different driver...
++ *
++ * pl25a1 glue based on patch from Tony Gibbs. Prolific "docs" on
++ * this chip are as usual incomplete about what control messages
++ * are supported.
++ */
++
++/*
++ * Bits 0-4 can be used for software handshaking; they're set from
++ * one end, cleared from the other, "read" with the interrupt byte.
++ */
++#define PL_S_EN (1<<7) /* (feature only) suspend enable */
++/* reserved bit -- rx ready (6) ? */
++#define PL_TX_READY (1<<5) /* (interrupt only) transmit ready */
++#define PL_RESET_OUT (1<<4) /* reset output pipe */
++#define PL_RESET_IN (1<<3) /* reset input pipe */
++#define PL_TX_C (1<<2) /* transmission complete */
++#define PL_TX_REQ (1<<1) /* transmission received */
++#define PL_PEER_E (1<<0) /* peer exists */
++
++static inline int
++pl_vendor_req(struct usbnet *dev, u8 req, u8 val, u8 index)
++{
++ return usbnet_read_cmd(dev, req,
++ USB_DIR_IN | USB_TYPE_VENDOR |
++ USB_RECIP_DEVICE,
++ val, index, NULL, 0);
++}
++
++static inline int
++pl_clear_QuickLink_features(struct usbnet *dev, int val)
++{
++ return pl_vendor_req(dev, 1, (u8) val, 0);
++}
++
++static inline int
++pl_set_QuickLink_features(struct usbnet *dev, int val)
++{
++ return pl_vendor_req(dev, 3, (u8) val, 0);
++}
++
++static int pl_reset(struct usbnet *dev)
++{
++ int status;
++
++ /* some units seem to need this reset, others reject it utterly.
++ * FIXME be more like "naplink" or windows drivers.
++ */
++ status = pl_set_QuickLink_features(dev,
++ PL_S_EN|PL_RESET_OUT|PL_RESET_IN|PL_PEER_E);
++ if (status != 0 && netif_msg_probe(dev))
++ netif_dbg(dev, link, dev->net, "pl_reset --> %d\n", status);
++ return 0;
++}
++
++static const struct driver_info prolific_info = {
++ .description = "Prolific PL-2301/PL-2302/PL-25A1",
++ .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT,
++ /* some PL-2302 versions seem to fail usb_set_interface() */
++ .reset = pl_reset,
++};
++
++
++/*-------------------------------------------------------------------------*/
++
++/*
++ * Proilific's name won't normally be on the cables, and
++ * may not be on the device.
++ */
++
++static const struct usb_device_id products [] = {
++
++/* full speed cables */
++{
++ USB_DEVICE(0x067b, 0x0000), // PL-2301
++ .driver_info = (unsigned long) &prolific_info,
++}, {
++ USB_DEVICE(0x067b, 0x0001), // PL-2302
++ .driver_info = (unsigned long) &prolific_info,
++},
++
++/* high speed cables */
++{
++ USB_DEVICE(0x067b, 0x25a1), /* PL-25A1, no eeprom */
++ .driver_info = (unsigned long) &prolific_info,
++}, {
++ USB_DEVICE(0x050d, 0x258a), /* Belkin F5U258/F5U279 (PL-25A1) */
++ .driver_info = (unsigned long) &prolific_info,
++},
++
++ { }, // END
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver plusb_driver = {
++ .name = "plusb",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(plusb_driver);
++
++MODULE_AUTHOR("David Brownell");
++MODULE_DESCRIPTION("Prolific PL-2301/2302/25A1 USB Host to Host Link Driver");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/drivers/net/usb/r8152.c
+--- backports-3.18.1-1.org/drivers/net/usb/r8152.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/r8152.c 2015-01-03 13:42:25.000000000 +0100
+@@ -0,0 +1,3913 @@
++/*
++ * Copyright (c) 2014 Realtek Semiconductor Corp. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * version 2 as published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/signal.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/mii.h>
++#include <linux/ethtool.h>
++#include <linux/usb.h>
++#include <linux/crc32.h>
++#include <linux/if_vlan.h>
++#include <linux/uaccess.h>
++#include <linux/list.h>
++#include <linux/ip.h>
++#include <linux/ipv6.h>
++#include <net/ip6_checksum.h>
++#include <uapi/linux/mdio.h>
++#include <linux/mdio.h>
++
++/* Version Information */
++#define DRIVER_VERSION "v1.07.0 (2014/10/09)"
++#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>"
++#define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
++#define MODULENAME "r8152"
++
++#define R8152_PHY_ID 32
++
++#define PLA_IDR 0xc000
++#define PLA_RCR 0xc010
++#define PLA_RMS 0xc016
++#define PLA_RXFIFO_CTRL0 0xc0a0
++#define PLA_RXFIFO_CTRL1 0xc0a4
++#define PLA_RXFIFO_CTRL2 0xc0a8
++#define PLA_FMC 0xc0b4
++#define PLA_CFG_WOL 0xc0b6
++#define PLA_TEREDO_CFG 0xc0bc
++#define PLA_MAR 0xcd00
++#define PLA_BACKUP 0xd000
++#define PAL_BDC_CR 0xd1a0
++#define PLA_TEREDO_TIMER 0xd2cc
++#define PLA_REALWOW_TIMER 0xd2e8
++#define PLA_LEDSEL 0xdd90
++#define PLA_LED_FEATURE 0xdd92
++#define PLA_PHYAR 0xde00
++#define PLA_BOOT_CTRL 0xe004
++#define PLA_GPHY_INTR_IMR 0xe022
++#define PLA_EEE_CR 0xe040
++#define PLA_EEEP_CR 0xe080
++#define PLA_MAC_PWR_CTRL 0xe0c0
++#define PLA_MAC_PWR_CTRL2 0xe0ca
++#define PLA_MAC_PWR_CTRL3 0xe0cc
++#define PLA_MAC_PWR_CTRL4 0xe0ce
++#define PLA_WDT6_CTRL 0xe428
++#define PLA_TCR0 0xe610
++#define PLA_TCR1 0xe612
++#define PLA_MTPS 0xe615
++#define PLA_TXFIFO_CTRL 0xe618
++#define PLA_RSTTALLY 0xe800
++#define PLA_CR 0xe813
++#define PLA_CRWECR 0xe81c
++#define PLA_CONFIG12 0xe81e /* CONFIG1, CONFIG2 */
++#define PLA_CONFIG34 0xe820 /* CONFIG3, CONFIG4 */
++#define PLA_CONFIG5 0xe822
++#define PLA_PHY_PWR 0xe84c
++#define PLA_OOB_CTRL 0xe84f
++#define PLA_CPCR 0xe854
++#define PLA_MISC_0 0xe858
++#define PLA_MISC_1 0xe85a
++#define PLA_OCP_GPHY_BASE 0xe86c
++#define PLA_TALLYCNT 0xe890
++#define PLA_SFF_STS_7 0xe8de
++#define PLA_PHYSTATUS 0xe908
++#define PLA_BP_BA 0xfc26
++#define PLA_BP_0 0xfc28
++#define PLA_BP_1 0xfc2a
++#define PLA_BP_2 0xfc2c
++#define PLA_BP_3 0xfc2e
++#define PLA_BP_4 0xfc30
++#define PLA_BP_5 0xfc32
++#define PLA_BP_6 0xfc34
++#define PLA_BP_7 0xfc36
++#define PLA_BP_EN 0xfc38
++
++#define USB_U2P3_CTRL 0xb460
++#define USB_DEV_STAT 0xb808
++#define USB_USB_CTRL 0xd406
++#define USB_PHY_CTRL 0xd408
++#define USB_TX_AGG 0xd40a
++#define USB_RX_BUF_TH 0xd40c
++#define USB_USB_TIMER 0xd428
++#define USB_RX_EARLY_AGG 0xd42c
++#define USB_PM_CTRL_STATUS 0xd432
++#define USB_TX_DMA 0xd434
++#define USB_TOLERANCE 0xd490
++#define USB_LPM_CTRL 0xd41a
++#define USB_UPS_CTRL 0xd800
++#define USB_MISC_0 0xd81a
++#define USB_POWER_CUT 0xd80a
++#define USB_AFE_CTRL2 0xd824
++#define USB_WDT11_CTRL 0xe43c
++#define USB_BP_BA 0xfc26
++#define USB_BP_0 0xfc28
++#define USB_BP_1 0xfc2a
++#define USB_BP_2 0xfc2c
++#define USB_BP_3 0xfc2e
++#define USB_BP_4 0xfc30
++#define USB_BP_5 0xfc32
++#define USB_BP_6 0xfc34
++#define USB_BP_7 0xfc36
++#define USB_BP_EN 0xfc38
++
++/* OCP Registers */
++#define OCP_ALDPS_CONFIG 0x2010
++#define OCP_EEE_CONFIG1 0x2080
++#define OCP_EEE_CONFIG2 0x2092
++#define OCP_EEE_CONFIG3 0x2094
++#define OCP_BASE_MII 0xa400
++#define OCP_EEE_AR 0xa41a
++#define OCP_EEE_DATA 0xa41c
++#define OCP_PHY_STATUS 0xa420
++#define OCP_POWER_CFG 0xa430
++#define OCP_EEE_CFG 0xa432
++#define OCP_SRAM_ADDR 0xa436
++#define OCP_SRAM_DATA 0xa438
++#define OCP_DOWN_SPEED 0xa442
++#define OCP_EEE_ABLE 0xa5c4
++#define OCP_EEE_ADV 0xa5d0
++#define OCP_EEE_LPABLE 0xa5d2
++#define OCP_ADC_CFG 0xbc06
++
++/* SRAM Register */
++#define SRAM_LPF_CFG 0x8012
++#define SRAM_10M_AMP1 0x8080
++#define SRAM_10M_AMP2 0x8082
++#define SRAM_IMPEDANCE 0x8084
++
++/* PLA_RCR */
++#define RCR_AAP 0x00000001
++#define RCR_APM 0x00000002
++#define RCR_AM 0x00000004
++#define RCR_AB 0x00000008
++#define RCR_ACPT_ALL (RCR_AAP | RCR_APM | RCR_AM | RCR_AB)
++
++/* PLA_RXFIFO_CTRL0 */
++#define RXFIFO_THR1_NORMAL 0x00080002
++#define RXFIFO_THR1_OOB 0x01800003
++
++/* PLA_RXFIFO_CTRL1 */
++#define RXFIFO_THR2_FULL 0x00000060
++#define RXFIFO_THR2_HIGH 0x00000038
++#define RXFIFO_THR2_OOB 0x0000004a
++#define RXFIFO_THR2_NORMAL 0x00a0
++
++/* PLA_RXFIFO_CTRL2 */
++#define RXFIFO_THR3_FULL 0x00000078
++#define RXFIFO_THR3_HIGH 0x00000048
++#define RXFIFO_THR3_OOB 0x0000005a
++#define RXFIFO_THR3_NORMAL 0x0110
++
++/* PLA_TXFIFO_CTRL */
++#define TXFIFO_THR_NORMAL 0x00400008
++#define TXFIFO_THR_NORMAL2 0x01000008
++
++/* PLA_FMC */
++#define FMC_FCR_MCU_EN 0x0001
++
++/* PLA_EEEP_CR */
++#define EEEP_CR_EEEP_TX 0x0002
++
++/* PLA_WDT6_CTRL */
++#define WDT6_SET_MODE 0x0010
++
++/* PLA_TCR0 */
++#define TCR0_TX_EMPTY 0x0800
++#define TCR0_AUTO_FIFO 0x0080
++
++/* PLA_TCR1 */
++#define VERSION_MASK 0x7cf0
++
++/* PLA_MTPS */
++#define MTPS_JUMBO (12 * 1024 / 64)
++#define MTPS_DEFAULT (6 * 1024 / 64)
++
++/* PLA_RSTTALLY */
++#define TALLY_RESET 0x0001
++
++/* PLA_CR */
++#define CR_RST 0x10
++#define CR_RE 0x08
++#define CR_TE 0x04
++
++/* PLA_CRWECR */
++#define CRWECR_NORAML 0x00
++#define CRWECR_CONFIG 0xc0
++
++/* PLA_OOB_CTRL */
++#define NOW_IS_OOB 0x80
++#define TXFIFO_EMPTY 0x20
++#define RXFIFO_EMPTY 0x10
++#define LINK_LIST_READY 0x02
++#define DIS_MCU_CLROOB 0x01
++#define FIFO_EMPTY (TXFIFO_EMPTY | RXFIFO_EMPTY)
++
++/* PLA_MISC_1 */
++#define RXDY_GATED_EN 0x0008
++
++/* PLA_SFF_STS_7 */
++#define RE_INIT_LL 0x8000
++#define MCU_BORW_EN 0x4000
++
++/* PLA_CPCR */
++#define CPCR_RX_VLAN 0x0040
++
++/* PLA_CFG_WOL */
++#define MAGIC_EN 0x0001
++
++/* PLA_TEREDO_CFG */
++#define TEREDO_SEL 0x8000
++#define TEREDO_WAKE_MASK 0x7f00
++#define TEREDO_RS_EVENT_MASK 0x00fe
++#define OOB_TEREDO_EN 0x0001
++
++/* PAL_BDC_CR */
++#define ALDPS_PROXY_MODE 0x0001
++
++/* PLA_CONFIG34 */
++#define LINK_ON_WAKE_EN 0x0010
++#define LINK_OFF_WAKE_EN 0x0008
++
++/* PLA_CONFIG5 */
++#define BWF_EN 0x0040
++#define MWF_EN 0x0020
++#define UWF_EN 0x0010
++#define LAN_WAKE_EN 0x0002
++
++/* PLA_LED_FEATURE */
++#define LED_MODE_MASK 0x0700
++
++/* PLA_PHY_PWR */
++#define TX_10M_IDLE_EN 0x0080
++#define PFM_PWM_SWITCH 0x0040
++
++/* PLA_MAC_PWR_CTRL */
++#define D3_CLK_GATED_EN 0x00004000
++#define MCU_CLK_RATIO 0x07010f07
++#define MCU_CLK_RATIO_MASK 0x0f0f0f0f
++#define ALDPS_SPDWN_RATIO 0x0f87
++
++/* PLA_MAC_PWR_CTRL2 */
++#define EEE_SPDWN_RATIO 0x8007
++
++/* PLA_MAC_PWR_CTRL3 */
++#define PKT_AVAIL_SPDWN_EN 0x0100
++#define SUSPEND_SPDWN_EN 0x0004
++#define U1U2_SPDWN_EN 0x0002
++#define L1_SPDWN_EN 0x0001
++
++/* PLA_MAC_PWR_CTRL4 */
++#define PWRSAVE_SPDWN_EN 0x1000
++#define RXDV_SPDWN_EN 0x0800
++#define TX10MIDLE_EN 0x0100
++#define TP100_SPDWN_EN 0x0020
++#define TP500_SPDWN_EN 0x0010
++#define TP1000_SPDWN_EN 0x0008
++#define EEE_SPDWN_EN 0x0001
++
++/* PLA_GPHY_INTR_IMR */
++#define GPHY_STS_MSK 0x0001
++#define SPEED_DOWN_MSK 0x0002
++#define SPDWN_RXDV_MSK 0x0004
++#define SPDWN_LINKCHG_MSK 0x0008
++
++/* PLA_PHYAR */
++#define PHYAR_FLAG 0x80000000
++
++/* PLA_EEE_CR */
++#define EEE_RX_EN 0x0001
++#define EEE_TX_EN 0x0002
++
++/* PLA_BOOT_CTRL */
++#define AUTOLOAD_DONE 0x0002
++
++/* USB_DEV_STAT */
++#define STAT_SPEED_MASK 0x0006
++#define STAT_SPEED_HIGH 0x0000
++#define STAT_SPEED_FULL 0x0002
++
++/* USB_TX_AGG */
++#define TX_AGG_MAX_THRESHOLD 0x03
++
++/* USB_RX_BUF_TH */
++#define RX_THR_SUPPER 0x0c350180
++#define RX_THR_HIGH 0x7a120180
++#define RX_THR_SLOW 0xffff0180
++
++/* USB_TX_DMA */
++#define TEST_MODE_DISABLE 0x00000001
++#define TX_SIZE_ADJUST1 0x00000100
++
++/* USB_UPS_CTRL */
++#define POWER_CUT 0x0100
++
++/* USB_PM_CTRL_STATUS */
++#define RESUME_INDICATE 0x0001
++
++/* USB_USB_CTRL */
++#define RX_AGG_DISABLE 0x0010
++
++/* USB_U2P3_CTRL */
++#define U2P3_ENABLE 0x0001
++
++/* USB_POWER_CUT */
++#define PWR_EN 0x0001
++#define PHASE2_EN 0x0008
++
++/* USB_MISC_0 */
++#define PCUT_STATUS 0x0001
++
++/* USB_RX_EARLY_AGG */
++#define EARLY_AGG_SUPPER 0x0e832981
++#define EARLY_AGG_HIGH 0x0e837a12
++#define EARLY_AGG_SLOW 0x0e83ffff
++
++/* USB_WDT11_CTRL */
++#define TIMER11_EN 0x0001
++
++/* USB_LPM_CTRL */
++#define LPM_TIMER_MASK 0x0c
++#define LPM_TIMER_500MS 0x04 /* 500 ms */
++#define LPM_TIMER_500US 0x0c /* 500 us */
++
++/* USB_AFE_CTRL2 */
++#define SEN_VAL_MASK 0xf800
++#define SEN_VAL_NORMAL 0xa000
++#define SEL_RXIDLE 0x0100
++
++/* OCP_ALDPS_CONFIG */
++#define ENPWRSAVE 0x8000
++#define ENPDNPS 0x0200
++#define LINKENA 0x0100
++#define DIS_SDSAVE 0x0010
++
++/* OCP_PHY_STATUS */
++#define PHY_STAT_MASK 0x0007
++#define PHY_STAT_LAN_ON 3
++#define PHY_STAT_PWRDN 5
++
++/* OCP_POWER_CFG */
++#define EEE_CLKDIV_EN 0x8000
++#define EN_ALDPS 0x0004
++#define EN_10M_PLLOFF 0x0001
++
++/* OCP_EEE_CONFIG1 */
++#define RG_TXLPI_MSK_HFDUP 0x8000
++#define RG_MATCLR_EN 0x4000
++#define EEE_10_CAP 0x2000
++#define EEE_NWAY_EN 0x1000
++#define TX_QUIET_EN 0x0200
++#define RX_QUIET_EN 0x0100
++#define sd_rise_time_mask 0x0070
++#define sd_rise_time(x) (min(x, 7) << 4) /* bit 4 ~ 6 */
++#define RG_RXLPI_MSK_HFDUP 0x0008
++#define SDFALLTIME 0x0007 /* bit 0 ~ 2 */
++
++/* OCP_EEE_CONFIG2 */
++#define RG_LPIHYS_NUM 0x7000 /* bit 12 ~ 15 */
++#define RG_DACQUIET_EN 0x0400
++#define RG_LDVQUIET_EN 0x0200
++#define RG_CKRSEL 0x0020
++#define RG_EEEPRG_EN 0x0010
++
++/* OCP_EEE_CONFIG3 */
++#define fast_snr_mask 0xff80
++#define fast_snr(x) (min(x, 0x1ff) << 7) /* bit 7 ~ 15 */
++#define RG_LFS_SEL 0x0060 /* bit 6 ~ 5 */
++#define MSK_PH 0x0006 /* bit 0 ~ 3 */
++
++/* OCP_EEE_AR */
++/* bit[15:14] function */
++#define FUN_ADDR 0x0000
++#define FUN_DATA 0x4000
++/* bit[4:0] device addr */
++
++/* OCP_EEE_CFG */
++#define CTAP_SHORT_EN 0x0040
++#define EEE10_EN 0x0010
++
++/* OCP_DOWN_SPEED */
++#define EN_10M_BGOFF 0x0080
++
++/* OCP_ADC_CFG */
++#define CKADSEL_L 0x0100
++#define ADC_EN 0x0080
++#define EN_EMI_L 0x0040
++
++/* SRAM_LPF_CFG */
++#define LPF_AUTO_TUNE 0x8000
++
++/* SRAM_10M_AMP1 */
++#define GDAC_IB_UPALL 0x0008
++
++/* SRAM_10M_AMP2 */
++#define AMP_DN 0x0200
++
++/* SRAM_IMPEDANCE */
++#define RX_DRIVING_MASK 0x6000
++
++enum rtl_register_content {
++ _1000bps = 0x10,
++ _100bps = 0x08,
++ _10bps = 0x04,
++ LINK_STATUS = 0x02,
++ FULL_DUP = 0x01,
++};
++
++#define RTL8152_MAX_TX 4
++#define RTL8152_MAX_RX 10
++#define INTBUFSIZE 2
++#define CRC_SIZE 4
++#define TX_ALIGN 4
++#define RX_ALIGN 8
++
++#define INTR_LINK 0x0004
++
++#define RTL8152_REQT_READ 0xc0
++#define RTL8152_REQT_WRITE 0x40
++#define RTL8152_REQ_GET_REGS 0x05
++#define RTL8152_REQ_SET_REGS 0x05
++
++#define BYTE_EN_DWORD 0xff
++#define BYTE_EN_WORD 0x33
++#define BYTE_EN_BYTE 0x11
++#define BYTE_EN_SIX_BYTES 0x3f
++#define BYTE_EN_START_MASK 0x0f
++#define BYTE_EN_END_MASK 0xf0
++
++#define RTL8153_MAX_PACKET 9216 /* 9K */
++#define RTL8153_MAX_MTU (RTL8153_MAX_PACKET - VLAN_ETH_HLEN - VLAN_HLEN)
++#define RTL8152_RMS (VLAN_ETH_FRAME_LEN + VLAN_HLEN)
++#define RTL8153_RMS RTL8153_MAX_PACKET
++#define RTL8152_TX_TIMEOUT (5 * HZ)
++
++/* rtl8152 flags */
++enum rtl8152_flags {
++ RTL8152_UNPLUG = 0,
++ RTL8152_SET_RX_MODE,
++ WORK_ENABLE,
++ RTL8152_LINK_CHG,
++ SELECTIVE_SUSPEND,
++ PHY_RESET,
++ SCHEDULE_TASKLET,
++};
++
++/* Define these values to match your device */
++#define VENDOR_ID_REALTEK 0x0bda
++#define PRODUCT_ID_RTL8152 0x8152
++#define PRODUCT_ID_RTL8153 0x8153
++
++#define VENDOR_ID_SAMSUNG 0x04e8
++#define PRODUCT_ID_SAMSUNG 0xa101
++
++#define MCU_TYPE_PLA 0x0100
++#define MCU_TYPE_USB 0x0000
++
++#define REALTEK_USB_DEVICE(vend, prod) \
++ USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC)
++
++struct tally_counter {
++ __le64 tx_packets;
++ __le64 rx_packets;
++ __le64 tx_errors;
++ __le32 rx_errors;
++ __le16 rx_missed;
++ __le16 align_errors;
++ __le32 tx_one_collision;
++ __le32 tx_multi_collision;
++ __le64 rx_unicast;
++ __le64 rx_broadcast;
++ __le32 rx_multicast;
++ __le16 tx_aborted;
++ __le16 tx_underun;
++};
++
++struct rx_desc {
++ __le32 opts1;
++#define RX_LEN_MASK 0x7fff
++
++ __le32 opts2;
++#define RD_UDP_CS (1 << 23)
++#define RD_TCP_CS (1 << 22)
++#define RD_IPV6_CS (1 << 20)
++#define RD_IPV4_CS (1 << 19)
++
++ __le32 opts3;
++#define IPF (1 << 23) /* IP checksum fail */
++#define UDPF (1 << 22) /* UDP checksum fail */
++#define TCPF (1 << 21) /* TCP checksum fail */
++#define RX_VLAN_TAG (1 << 16)
++
++ __le32 opts4;
++ __le32 opts5;
++ __le32 opts6;
++};
++
++struct tx_desc {
++ __le32 opts1;
++#define TX_FS (1 << 31) /* First segment of a packet */
++#define TX_LS (1 << 30) /* Final segment of a packet */
++#define GTSENDV4 (1 << 28)
++#define GTSENDV6 (1 << 27)
++#define GTTCPHO_SHIFT 18
++#define GTTCPHO_MAX 0x7fU
++#define TX_LEN_MAX 0x3ffffU
++
++ __le32 opts2;
++#define UDP_CS (1 << 31) /* Calculate UDP/IP checksum */
++#define TCP_CS (1 << 30) /* Calculate TCP/IP checksum */
++#define IPV4_CS (1 << 29) /* Calculate IPv4 checksum */
++#define IPV6_CS (1 << 28) /* Calculate IPv6 checksum */
++#define MSS_SHIFT 17
++#define MSS_MAX 0x7ffU
++#define TCPHO_SHIFT 17
++#define TCPHO_MAX 0x7ffU
++#define TX_VLAN_TAG (1 << 16)
++};
++
++struct r8152;
++
++struct rx_agg {
++ struct list_head list;
++ struct urb *urb;
++ struct r8152 *context;
++ void *buffer;
++ void *head;
++};
++
++struct tx_agg {
++ struct list_head list;
++ struct urb *urb;
++ struct r8152 *context;
++ void *buffer;
++ void *head;
++ u32 skb_num;
++ u32 skb_len;
++};
++
++struct r8152 {
++ unsigned long flags;
++ struct usb_device *udev;
++ struct tasklet_struct tl;
++ struct usb_interface *intf;
++ struct net_device *netdev;
++ struct urb *intr_urb;
++ struct tx_agg tx_info[RTL8152_MAX_TX];
++ struct rx_agg rx_info[RTL8152_MAX_RX];
++ struct list_head rx_done, tx_free;
++ struct sk_buff_head tx_queue;
++ spinlock_t rx_lock, tx_lock;
++ struct delayed_work schedule;
++ struct mii_if_info mii;
++ struct mutex control; /* use for hw setting */
++
++ struct rtl_ops {
++ void (*init)(struct r8152 *);
++ int (*enable)(struct r8152 *);
++ void (*disable)(struct r8152 *);
++ void (*up)(struct r8152 *);
++ void (*down)(struct r8152 *);
++ void (*unload)(struct r8152 *);
++ int (*eee_get)(struct r8152 *, struct ethtool_eee *);
++ int (*eee_set)(struct r8152 *, struct ethtool_eee *);
++ } __no_const rtl_ops;
++
++ int intr_interval;
++ u32 saved_wolopts;
++ u32 msg_enable;
++ u32 tx_qlen;
++ u16 ocp_base;
++ u8 *intr_buff;
++ u8 version;
++ u8 speed;
++};
++
++enum rtl_version {
++ RTL_VER_UNKNOWN = 0,
++ RTL_VER_01,
++ RTL_VER_02,
++ RTL_VER_03,
++ RTL_VER_04,
++ RTL_VER_05,
++ RTL_VER_MAX
++};
++
++enum tx_csum_stat {
++ TX_CSUM_SUCCESS = 0,
++ TX_CSUM_TSO,
++ TX_CSUM_NONE
++};
++
++/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
++ * The RTL chips use a 64 element hash table based on the Ethernet CRC.
++ */
++static const int multicast_filter_limit = 32;
++static unsigned int agg_buf_sz = 16384;
++
++#define RTL_LIMITED_TSO_SIZE (agg_buf_sz - sizeof(struct tx_desc) - \
++ VLAN_ETH_HLEN - VLAN_HLEN)
++
++static
++int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
++{
++ int ret;
++ void *tmp;
++
++ tmp = kmalloc(size, GFP_KERNEL);
++ if (!tmp)
++ return -ENOMEM;
++
++ ret = usb_control_msg(tp->udev, usb_rcvctrlpipe(tp->udev, 0),
++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ,
++ value, index, tmp, size, 500);
++
++ memcpy(data, tmp, size);
++ kfree(tmp);
++
++ return ret;
++}
++
++static
++int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
++{
++ int ret;
++ void *tmp;
++
++ tmp = kmemdup(data, size, GFP_KERNEL);
++ if (!tmp)
++ return -ENOMEM;
++
++ ret = usb_control_msg(tp->udev, usb_sndctrlpipe(tp->udev, 0),
++ RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE,
++ value, index, tmp, size, 500);
++
++ kfree(tmp);
++
++ return ret;
++}
++
++static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
++ void *data, u16 type)
++{
++ u16 limit = 64;
++ int ret = 0;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return -ENODEV;
++
++ /* both size and indix must be 4 bytes align */
++ if ((size & 3) || !size || (index & 3) || !data)
++ return -EPERM;
++
++ if ((u32)index + (u32)size > 0xffff)
++ return -EPERM;
++
++ while (size) {
++ if (size > limit) {
++ ret = get_registers(tp, index, type, limit, data);
++ if (ret < 0)
++ break;
++
++ index += limit;
++ data += limit;
++ size -= limit;
++ } else {
++ ret = get_registers(tp, index, type, size, data);
++ if (ret < 0)
++ break;
++
++ index += size;
++ data += size;
++ size = 0;
++ break;
++ }
++ }
++
++ return ret;
++}
++
++static int generic_ocp_write(struct r8152 *tp, u16 index, u16 byteen,
++ u16 size, void *data, u16 type)
++{
++ int ret;
++ u16 byteen_start, byteen_end, byen;
++ u16 limit = 512;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return -ENODEV;
++
++ /* both size and indix must be 4 bytes align */
++ if ((size & 3) || !size || (index & 3) || !data)
++ return -EPERM;
++
++ if ((u32)index + (u32)size > 0xffff)
++ return -EPERM;
++
++ byteen_start = byteen & BYTE_EN_START_MASK;
++ byteen_end = byteen & BYTE_EN_END_MASK;
++
++ byen = byteen_start | (byteen_start << 4);
++ ret = set_registers(tp, index, type | byen, 4, data);
++ if (ret < 0)
++ goto error1;
++
++ index += 4;
++ data += 4;
++ size -= 4;
++
++ if (size) {
++ size -= 4;
++
++ while (size) {
++ if (size > limit) {
++ ret = set_registers(tp, index,
++ type | BYTE_EN_DWORD,
++ limit, data);
++ if (ret < 0)
++ goto error1;
++
++ index += limit;
++ data += limit;
++ size -= limit;
++ } else {
++ ret = set_registers(tp, index,
++ type | BYTE_EN_DWORD,
++ size, data);
++ if (ret < 0)
++ goto error1;
++
++ index += size;
++ data += size;
++ size = 0;
++ break;
++ }
++ }
++
++ byen = byteen_end | (byteen_end >> 4);
++ ret = set_registers(tp, index, type | byen, 4, data);
++ if (ret < 0)
++ goto error1;
++ }
++
++error1:
++ return ret;
++}
++
++static inline
++int pla_ocp_read(struct r8152 *tp, u16 index, u16 size, void *data)
++{
++ return generic_ocp_read(tp, index, size, data, MCU_TYPE_PLA);
++}
++
++static inline
++int pla_ocp_write(struct r8152 *tp, u16 index, u16 byteen, u16 size, void *data)
++{
++ return generic_ocp_write(tp, index, byteen, size, data, MCU_TYPE_PLA);
++}
++
++static inline
++int usb_ocp_read(struct r8152 *tp, u16 index, u16 size, void *data)
++{
++ return generic_ocp_read(tp, index, size, data, MCU_TYPE_USB);
++}
++
++static inline
++int usb_ocp_write(struct r8152 *tp, u16 index, u16 byteen, u16 size, void *data)
++{
++ return generic_ocp_write(tp, index, byteen, size, data, MCU_TYPE_USB);
++}
++
++static u32 ocp_read_dword(struct r8152 *tp, u16 type, u16 index)
++{
++ __le32 data;
++
++ generic_ocp_read(tp, index, sizeof(data), &data, type);
++
++ return __le32_to_cpu(data);
++}
++
++static void ocp_write_dword(struct r8152 *tp, u16 type, u16 index, u32 data)
++{
++ __le32 tmp = __cpu_to_le32(data);
++
++ generic_ocp_write(tp, index, BYTE_EN_DWORD, sizeof(tmp), &tmp, type);
++}
++
++static u16 ocp_read_word(struct r8152 *tp, u16 type, u16 index)
++{
++ u32 data;
++ __le32 tmp;
++ u8 shift = index & 2;
++
++ index &= ~3;
++
++ generic_ocp_read(tp, index, sizeof(tmp), &tmp, type);
++
++ data = __le32_to_cpu(tmp);
++ data >>= (shift * 8);
++ data &= 0xffff;
++
++ return (u16)data;
++}
++
++static void ocp_write_word(struct r8152 *tp, u16 type, u16 index, u32 data)
++{
++ u32 mask = 0xffff;
++ __le32 tmp;
++ u16 byen = BYTE_EN_WORD;
++ u8 shift = index & 2;
++
++ data &= mask;
++
++ if (index & 2) {
++ byen <<= shift;
++ mask <<= (shift * 8);
++ data <<= (shift * 8);
++ index &= ~3;
++ }
++
++ generic_ocp_read(tp, index, sizeof(tmp), &tmp, type);
++
++ data |= __le32_to_cpu(tmp) & ~mask;
++ tmp = __cpu_to_le32(data);
++
++ generic_ocp_write(tp, index, byen, sizeof(tmp), &tmp, type);
++}
++
++static u8 ocp_read_byte(struct r8152 *tp, u16 type, u16 index)
++{
++ u32 data;
++ __le32 tmp;
++ u8 shift = index & 3;
++
++ index &= ~3;
++
++ generic_ocp_read(tp, index, sizeof(tmp), &tmp, type);
++
++ data = __le32_to_cpu(tmp);
++ data >>= (shift * 8);
++ data &= 0xff;
++
++ return (u8)data;
++}
++
++static void ocp_write_byte(struct r8152 *tp, u16 type, u16 index, u32 data)
++{
++ u32 mask = 0xff;
++ __le32 tmp;
++ u16 byen = BYTE_EN_BYTE;
++ u8 shift = index & 3;
++
++ data &= mask;
++
++ if (index & 3) {
++ byen <<= shift;
++ mask <<= (shift * 8);
++ data <<= (shift * 8);
++ index &= ~3;
++ }
++
++ generic_ocp_read(tp, index, sizeof(tmp), &tmp, type);
++
++ data |= __le32_to_cpu(tmp) & ~mask;
++ tmp = __cpu_to_le32(data);
++
++ generic_ocp_write(tp, index, byen, sizeof(tmp), &tmp, type);
++}
++
++static u16 ocp_reg_read(struct r8152 *tp, u16 addr)
++{
++ u16 ocp_base, ocp_index;
++
++ ocp_base = addr & 0xf000;
++ if (ocp_base != tp->ocp_base) {
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, ocp_base);
++ tp->ocp_base = ocp_base;
++ }
++
++ ocp_index = (addr & 0x0fff) | 0xb000;
++ return ocp_read_word(tp, MCU_TYPE_PLA, ocp_index);
++}
++
++static void ocp_reg_write(struct r8152 *tp, u16 addr, u16 data)
++{
++ u16 ocp_base, ocp_index;
++
++ ocp_base = addr & 0xf000;
++ if (ocp_base != tp->ocp_base) {
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, ocp_base);
++ tp->ocp_base = ocp_base;
++ }
++
++ ocp_index = (addr & 0x0fff) | 0xb000;
++ ocp_write_word(tp, MCU_TYPE_PLA, ocp_index, data);
++}
++
++static inline void r8152_mdio_write(struct r8152 *tp, u32 reg_addr, u32 value)
++{
++ ocp_reg_write(tp, OCP_BASE_MII + reg_addr * 2, value);
++}
++
++static inline int r8152_mdio_read(struct r8152 *tp, u32 reg_addr)
++{
++ return ocp_reg_read(tp, OCP_BASE_MII + reg_addr * 2);
++}
++
++static void sram_write(struct r8152 *tp, u16 addr, u16 data)
++{
++ ocp_reg_write(tp, OCP_SRAM_ADDR, addr);
++ ocp_reg_write(tp, OCP_SRAM_DATA, data);
++}
++
++static u16 sram_read(struct r8152 *tp, u16 addr)
++{
++ ocp_reg_write(tp, OCP_SRAM_ADDR, addr);
++ return ocp_reg_read(tp, OCP_SRAM_DATA);
++}
++
++static int read_mii_word(struct net_device *netdev, int phy_id, int reg)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++ int ret;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return -ENODEV;
++
++ if (phy_id != R8152_PHY_ID)
++ return -EINVAL;
++
++ ret = r8152_mdio_read(tp, reg);
++
++ return ret;
++}
++
++static
++void write_mii_word(struct net_device *netdev, int phy_id, int reg, int val)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ if (phy_id != R8152_PHY_ID)
++ return;
++
++ r8152_mdio_write(tp, reg, val);
++}
++
++static int
++r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags);
++
++static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++ struct sockaddr *addr = p;
++ int ret = -EADDRNOTAVAIL;
++
++ if (!is_valid_ether_addr(addr->sa_data))
++ goto out1;
++
++ ret = usb_autopm_get_interface(tp->intf);
++ if (ret < 0)
++ goto out1;
++
++ mutex_lock(&tp->control);
++
++ memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
++
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
++ pla_ocp_write(tp, PLA_IDR, BYTE_EN_SIX_BYTES, 8, addr->sa_data);
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++out1:
++ return ret;
++}
++
++static int set_ethernet_addr(struct r8152 *tp)
++{
++ struct net_device *dev = tp->netdev;
++ struct sockaddr sa;
++ int ret;
++
++ if (tp->version == RTL_VER_01)
++ ret = pla_ocp_read(tp, PLA_IDR, 8, sa.sa_data);
++ else
++ ret = pla_ocp_read(tp, PLA_BACKUP, 8, sa.sa_data);
++
++ if (ret < 0) {
++ netif_err(tp, probe, dev, "Get ether addr fail\n");
++ } else if (!is_valid_ether_addr(sa.sa_data)) {
++ netif_err(tp, probe, dev, "Invalid ether addr %pM\n",
++ sa.sa_data);
++ eth_hw_addr_random(dev);
++ ether_addr_copy(sa.sa_data, dev->dev_addr);
++ ret = rtl8152_set_mac_address(dev, &sa);
++ netif_info(tp, probe, dev, "Random ether addr %pM\n",
++ sa.sa_data);
++ } else {
++ if (tp->version == RTL_VER_01)
++ ether_addr_copy(dev->dev_addr, sa.sa_data);
++ else
++ ret = rtl8152_set_mac_address(dev, &sa);
++ }
++
++ return ret;
++}
++
++static void read_bulk_callback(struct urb *urb)
++{
++ struct net_device *netdev;
++ int status = urb->status;
++ struct rx_agg *agg;
++ struct r8152 *tp;
++ int result;
++
++ agg = urb->context;
++ if (!agg)
++ return;
++
++ tp = agg->context;
++ if (!tp)
++ return;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ if (!test_bit(WORK_ENABLE, &tp->flags))
++ return;
++
++ netdev = tp->netdev;
++
++ /* When link down, the driver would cancel all bulks. */
++ /* This avoid the re-submitting bulk */
++ if (!netif_carrier_ok(netdev))
++ return;
++
++ usb_mark_last_busy(tp->udev);
++
++ switch (status) {
++ case 0:
++ if (urb->actual_length < ETH_ZLEN)
++ break;
++
++ spin_lock(&tp->rx_lock);
++ list_add_tail(&agg->list, &tp->rx_done);
++ spin_unlock(&tp->rx_lock);
++ tasklet_schedule(&tp->tl);
++ return;
++ case -ESHUTDOWN:
++ set_bit(RTL8152_UNPLUG, &tp->flags);
++ netif_device_detach(tp->netdev);
++ return;
++ case -ENOENT:
++ return; /* the urb is in unlink state */
++ case -ETIME:
++ if (net_ratelimit())
++ netdev_warn(netdev, "maybe reset is needed?\n");
++ break;
++ default:
++ if (net_ratelimit())
++ netdev_warn(netdev, "Rx status %d\n", status);
++ break;
++ }
++
++ result = r8152_submit_rx(tp, agg, GFP_ATOMIC);
++ if (result == -ENODEV) {
++ netif_device_detach(tp->netdev);
++ } else if (result) {
++ spin_lock(&tp->rx_lock);
++ list_add_tail(&agg->list, &tp->rx_done);
++ spin_unlock(&tp->rx_lock);
++ tasklet_schedule(&tp->tl);
++ }
++}
++
++static void write_bulk_callback(struct urb *urb)
++{
++ struct net_device_stats *stats;
++ struct net_device *netdev;
++ struct tx_agg *agg;
++ struct r8152 *tp;
++ int status = urb->status;
++
++ agg = urb->context;
++ if (!agg)
++ return;
++
++ tp = agg->context;
++ if (!tp)
++ return;
++
++ netdev = tp->netdev;
++ stats = &netdev->stats;
++ if (status) {
++ if (net_ratelimit())
++ netdev_warn(netdev, "Tx status %d\n", status);
++ stats->tx_errors += agg->skb_num;
++ } else {
++ stats->tx_packets += agg->skb_num;
++ stats->tx_bytes += agg->skb_len;
++ }
++
++ spin_lock(&tp->tx_lock);
++ list_add_tail(&agg->list, &tp->tx_free);
++ spin_unlock(&tp->tx_lock);
++
++ usb_autopm_put_interface_async(tp->intf);
++
++ if (!netif_carrier_ok(netdev))
++ return;
++
++ if (!test_bit(WORK_ENABLE, &tp->flags))
++ return;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ if (!skb_queue_empty(&tp->tx_queue))
++ tasklet_schedule(&tp->tl);
++}
++
++static void intr_callback(struct urb *urb)
++{
++ struct r8152 *tp;
++ __le16 *d;
++ int status = urb->status;
++ int res;
++
++ tp = urb->context;
++ if (!tp)
++ return;
++
++ if (!test_bit(WORK_ENABLE, &tp->flags))
++ return;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ switch (status) {
++ case 0: /* success */
++ break;
++ case -ECONNRESET: /* unlink */
++ case -ESHUTDOWN:
++ netif_device_detach(tp->netdev);
++ case -ENOENT:
++ case -EPROTO:
++ netif_info(tp, intr, tp->netdev,
++ "Stop submitting intr, status %d\n", status);
++ return;
++ case -EOVERFLOW:
++ netif_info(tp, intr, tp->netdev, "intr status -EOVERFLOW\n");
++ goto resubmit;
++ /* -EPIPE: should clear the halt */
++ default:
++ netif_info(tp, intr, tp->netdev, "intr status %d\n", status);
++ goto resubmit;
++ }
++
++ d = urb->transfer_buffer;
++ if (INTR_LINK & __le16_to_cpu(d[0])) {
++ if (!(tp->speed & LINK_STATUS)) {
++ set_bit(RTL8152_LINK_CHG, &tp->flags);
++ schedule_delayed_work(&tp->schedule, 0);
++ }
++ } else {
++ if (tp->speed & LINK_STATUS) {
++ set_bit(RTL8152_LINK_CHG, &tp->flags);
++ schedule_delayed_work(&tp->schedule, 0);
++ }
++ }
++
++resubmit:
++ res = usb_submit_urb(urb, GFP_ATOMIC);
++ if (res == -ENODEV)
++ netif_device_detach(tp->netdev);
++ else if (res)
++ netif_err(tp, intr, tp->netdev,
++ "can't resubmit intr, status %d\n", res);
++}
++
++static inline void *rx_agg_align(void *data)
++{
++ return (void *)ALIGN((uintptr_t)data, RX_ALIGN);
++}
++
++static inline void *tx_agg_align(void *data)
++{
++ return (void *)ALIGN((uintptr_t)data, TX_ALIGN);
++}
++
++static void free_all_mem(struct r8152 *tp)
++{
++ int i;
++
++ for (i = 0; i < RTL8152_MAX_RX; i++) {
++ usb_free_urb(tp->rx_info[i].urb);
++ tp->rx_info[i].urb = NULL;
++
++ kfree(tp->rx_info[i].buffer);
++ tp->rx_info[i].buffer = NULL;
++ tp->rx_info[i].head = NULL;
++ }
++
++ for (i = 0; i < RTL8152_MAX_TX; i++) {
++ usb_free_urb(tp->tx_info[i].urb);
++ tp->tx_info[i].urb = NULL;
++
++ kfree(tp->tx_info[i].buffer);
++ tp->tx_info[i].buffer = NULL;
++ tp->tx_info[i].head = NULL;
++ }
++
++ usb_free_urb(tp->intr_urb);
++ tp->intr_urb = NULL;
++
++ kfree(tp->intr_buff);
++ tp->intr_buff = NULL;
++}
++
++static int alloc_all_mem(struct r8152 *tp)
++{
++ struct net_device *netdev = tp->netdev;
++ struct usb_interface *intf = tp->intf;
++ struct usb_host_interface *alt = intf->cur_altsetting;
++ struct usb_host_endpoint *ep_intr = alt->endpoint + 2;
++ struct urb *urb;
++ int node, i;
++ u8 *buf;
++
++ node = netdev->dev.parent ? dev_to_node(netdev->dev.parent) : -1;
++
++ spin_lock_init(&tp->rx_lock);
++ spin_lock_init(&tp->tx_lock);
++ INIT_LIST_HEAD(&tp->rx_done);
++ INIT_LIST_HEAD(&tp->tx_free);
++ skb_queue_head_init(&tp->tx_queue);
++
++ for (i = 0; i < RTL8152_MAX_RX; i++) {
++ buf = kmalloc_node(agg_buf_sz, GFP_KERNEL, node);
++ if (!buf)
++ goto err1;
++
++ if (buf != rx_agg_align(buf)) {
++ kfree(buf);
++ buf = kmalloc_node(agg_buf_sz + RX_ALIGN, GFP_KERNEL,
++ node);
++ if (!buf)
++ goto err1;
++ }
++
++ urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!urb) {
++ kfree(buf);
++ goto err1;
++ }
++
++ INIT_LIST_HEAD(&tp->rx_info[i].list);
++ tp->rx_info[i].context = tp;
++ tp->rx_info[i].urb = urb;
++ tp->rx_info[i].buffer = buf;
++ tp->rx_info[i].head = rx_agg_align(buf);
++ }
++
++ for (i = 0; i < RTL8152_MAX_TX; i++) {
++ buf = kmalloc_node(agg_buf_sz, GFP_KERNEL, node);
++ if (!buf)
++ goto err1;
++
++ if (buf != tx_agg_align(buf)) {
++ kfree(buf);
++ buf = kmalloc_node(agg_buf_sz + TX_ALIGN, GFP_KERNEL,
++ node);
++ if (!buf)
++ goto err1;
++ }
++
++ urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!urb) {
++ kfree(buf);
++ goto err1;
++ }
++
++ INIT_LIST_HEAD(&tp->tx_info[i].list);
++ tp->tx_info[i].context = tp;
++ tp->tx_info[i].urb = urb;
++ tp->tx_info[i].buffer = buf;
++ tp->tx_info[i].head = tx_agg_align(buf);
++
++ list_add_tail(&tp->tx_info[i].list, &tp->tx_free);
++ }
++
++ tp->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!tp->intr_urb)
++ goto err1;
++
++ tp->intr_buff = kmalloc(INTBUFSIZE, GFP_KERNEL);
++ if (!tp->intr_buff)
++ goto err1;
++
++ tp->intr_interval = (int)ep_intr->desc.bInterval;
++ usb_fill_int_urb(tp->intr_urb, tp->udev, usb_rcvintpipe(tp->udev, 3),
++ tp->intr_buff, INTBUFSIZE, intr_callback,
++ tp, tp->intr_interval);
++
++ return 0;
++
++err1:
++ free_all_mem(tp);
++ return -ENOMEM;
++}
++
++static struct tx_agg *r8152_get_tx_agg(struct r8152 *tp)
++{
++ struct tx_agg *agg = NULL;
++ unsigned long flags;
++
++ if (list_empty(&tp->tx_free))
++ return NULL;
++
++ spin_lock_irqsave(&tp->tx_lock, flags);
++ if (!list_empty(&tp->tx_free)) {
++ struct list_head *cursor;
++
++ cursor = tp->tx_free.next;
++ list_del_init(cursor);
++ agg = list_entry(cursor, struct tx_agg, list);
++ }
++ spin_unlock_irqrestore(&tp->tx_lock, flags);
++
++ return agg;
++}
++
++static inline __be16 get_protocol(struct sk_buff *skb)
++{
++ __be16 protocol;
++
++ if (skb->protocol == htons(ETH_P_8021Q))
++ protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
++ else
++ protocol = skb->protocol;
++
++ return protocol;
++}
++
++/* r8152_csum_workaround()
++ * The hw limites the value the transport offset. When the offset is out of the
++ * range, calculate the checksum by sw.
++ */
++static void r8152_csum_workaround(struct r8152 *tp, struct sk_buff *skb,
++ struct sk_buff_head *list)
++{
++ if (skb_shinfo(skb)->gso_size) {
++ netdev_features_t features = tp->netdev->features;
++ struct sk_buff_head seg_list;
++ struct sk_buff *segs, *nskb;
++
++ features &= ~(NETIF_F_SG | NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
++ segs = skb_gso_segment(skb, features);
++ if (IS_ERR(segs) || !segs)
++ goto drop;
++
++ __skb_queue_head_init(&seg_list);
++
++ do {
++ nskb = segs;
++ segs = segs->next;
++ nskb->next = NULL;
++ __skb_queue_tail(&seg_list, nskb);
++ } while (segs);
++
++ skb_queue_splice(&seg_list, list);
++ dev_kfree_skb(skb);
++ } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
++ if (skb_checksum_help(skb) < 0)
++ goto drop;
++
++ __skb_queue_head(list, skb);
++ } else {
++ struct net_device_stats *stats;
++
++drop:
++ stats = &tp->netdev->stats;
++ stats->tx_dropped++;
++ dev_kfree_skb(skb);
++ }
++}
++
++/* msdn_giant_send_check()
++ * According to the document of microsoft, the TCP Pseudo Header excludes the
++ * packet length for IPv6 TCP large packets.
++ */
++static int msdn_giant_send_check(struct sk_buff *skb)
++{
++ const struct ipv6hdr *ipv6h;
++ struct tcphdr *th;
++ int ret;
++
++ ret = skb_cow_head(skb, 0);
++ if (ret)
++ return ret;
++
++ ipv6h = ipv6_hdr(skb);
++ th = tcp_hdr(skb);
++
++ th->check = 0;
++ th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0);
++
++ return ret;
++}
++
++static inline void rtl_tx_vlan_tag(struct tx_desc *desc, struct sk_buff *skb)
++{
++ if (vlan_tx_tag_present(skb)) {
++ u32 opts2;
++
++ opts2 = TX_VLAN_TAG | swab16(vlan_tx_tag_get(skb));
++ desc->opts2 |= cpu_to_le32(opts2);
++ }
++}
++
++static inline void rtl_rx_vlan_tag(struct rx_desc *desc, struct sk_buff *skb)
++{
++ u32 opts2 = le32_to_cpu(desc->opts2);
++
++ if (opts2 & RX_VLAN_TAG)
++ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
++ swab16(opts2 & 0xffff));
++}
++
++static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
++ struct sk_buff *skb, u32 len, u32 transport_offset)
++{
++ u32 mss = skb_shinfo(skb)->gso_size;
++ u32 opts1, opts2 = 0;
++ int ret = TX_CSUM_SUCCESS;
++
++ WARN_ON_ONCE(len > TX_LEN_MAX);
++
++ opts1 = len | TX_FS | TX_LS;
++
++ if (mss) {
++ if (transport_offset > GTTCPHO_MAX) {
++ netif_warn(tp, tx_err, tp->netdev,
++ "Invalid transport offset 0x%x for TSO\n",
++ transport_offset);
++ ret = TX_CSUM_TSO;
++ goto unavailable;
++ }
++
++ switch (get_protocol(skb)) {
++ case htons(ETH_P_IP):
++ opts1 |= GTSENDV4;
++ break;
++
++ case htons(ETH_P_IPV6):
++ if (msdn_giant_send_check(skb)) {
++ ret = TX_CSUM_TSO;
++ goto unavailable;
++ }
++ opts1 |= GTSENDV6;
++ break;
++
++ default:
++ WARN_ON_ONCE(1);
++ break;
++ }
++
++ opts1 |= transport_offset << GTTCPHO_SHIFT;
++ opts2 |= min(mss, MSS_MAX) << MSS_SHIFT;
++ } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
++ u8 ip_protocol;
++
++ if (transport_offset > TCPHO_MAX) {
++ netif_warn(tp, tx_err, tp->netdev,
++ "Invalid transport offset 0x%x\n",
++ transport_offset);
++ ret = TX_CSUM_NONE;
++ goto unavailable;
++ }
++
++ switch (get_protocol(skb)) {
++ case htons(ETH_P_IP):
++ opts2 |= IPV4_CS;
++ ip_protocol = ip_hdr(skb)->protocol;
++ break;
++
++ case htons(ETH_P_IPV6):
++ opts2 |= IPV6_CS;
++ ip_protocol = ipv6_hdr(skb)->nexthdr;
++ break;
++
++ default:
++ ip_protocol = IPPROTO_RAW;
++ break;
++ }
++
++ if (ip_protocol == IPPROTO_TCP)
++ opts2 |= TCP_CS;
++ else if (ip_protocol == IPPROTO_UDP)
++ opts2 |= UDP_CS;
++ else
++ WARN_ON_ONCE(1);
++
++ opts2 |= transport_offset << TCPHO_SHIFT;
++ }
++
++ desc->opts2 = cpu_to_le32(opts2);
++ desc->opts1 = cpu_to_le32(opts1);
++
++unavailable:
++ return ret;
++}
++
++static int r8152_tx_agg_fill(struct r8152 *tp, struct tx_agg *agg)
++{
++ struct sk_buff_head skb_head, *tx_queue = &tp->tx_queue;
++ int remain, ret;
++ u8 *tx_data;
++
++ __skb_queue_head_init(&skb_head);
++ spin_lock(&tx_queue->lock);
++ skb_queue_splice_init(tx_queue, &skb_head);
++ spin_unlock(&tx_queue->lock);
++
++ tx_data = agg->head;
++ agg->skb_num = 0;
++ agg->skb_len = 0;
++ remain = agg_buf_sz;
++
++ while (remain >= ETH_ZLEN + sizeof(struct tx_desc)) {
++ struct tx_desc *tx_desc;
++ struct sk_buff *skb;
++ unsigned int len;
++ u32 offset;
++
++ skb = __skb_dequeue(&skb_head);
++ if (!skb)
++ break;
++
++ len = skb->len + sizeof(*tx_desc);
++
++ if (len > remain) {
++ __skb_queue_head(&skb_head, skb);
++ break;
++ }
++
++ tx_data = tx_agg_align(tx_data);
++ tx_desc = (struct tx_desc *)tx_data;
++
++ offset = (u32)skb_transport_offset(skb);
++
++ if (r8152_tx_csum(tp, tx_desc, skb, skb->len, offset)) {
++ r8152_csum_workaround(tp, skb, &skb_head);
++ continue;
++ }
++
++ rtl_tx_vlan_tag(tx_desc, skb);
++
++ tx_data += sizeof(*tx_desc);
++
++ len = skb->len;
++ if (skb_copy_bits(skb, 0, tx_data, len) < 0) {
++ struct net_device_stats *stats = &tp->netdev->stats;
++
++ stats->tx_dropped++;
++ dev_kfree_skb_any(skb);
++ tx_data -= sizeof(*tx_desc);
++ continue;
++ }
++
++ tx_data += len;
++ agg->skb_len += len;
++ agg->skb_num++;
++
++ dev_kfree_skb_any(skb);
++
++ remain = agg_buf_sz - (int)(tx_agg_align(tx_data) - agg->head);
++ }
++
++ if (!skb_queue_empty(&skb_head)) {
++ spin_lock(&tx_queue->lock);
++ skb_queue_splice(&skb_head, tx_queue);
++ spin_unlock(&tx_queue->lock);
++ }
++
++ netif_tx_lock(tp->netdev);
++
++ if (netif_queue_stopped(tp->netdev) &&
++ skb_queue_len(&tp->tx_queue) < tp->tx_qlen)
++ netif_wake_queue(tp->netdev);
++
++ netif_tx_unlock(tp->netdev);
++
++ ret = usb_autopm_get_interface_async(tp->intf);
++ if (ret < 0)
++ goto out_tx_fill;
++
++ usb_fill_bulk_urb(agg->urb, tp->udev, usb_sndbulkpipe(tp->udev, 2),
++ agg->head, (int)(tx_data - (u8 *)agg->head),
++ (usb_complete_t)write_bulk_callback, agg);
++
++ ret = usb_submit_urb(agg->urb, GFP_ATOMIC);
++ if (ret < 0)
++ usb_autopm_put_interface_async(tp->intf);
++
++out_tx_fill:
++ return ret;
++}
++
++static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc)
++{
++ u8 checksum = CHECKSUM_NONE;
++ u32 opts2, opts3;
++
++ if (tp->version == RTL_VER_01)
++ goto return_result;
++
++ opts2 = le32_to_cpu(rx_desc->opts2);
++ opts3 = le32_to_cpu(rx_desc->opts3);
++
++ if (opts2 & RD_IPV4_CS) {
++ if (opts3 & IPF)
++ checksum = CHECKSUM_NONE;
++ else if ((opts2 & RD_UDP_CS) && (opts3 & UDPF))
++ checksum = CHECKSUM_NONE;
++ else if ((opts2 & RD_TCP_CS) && (opts3 & TCPF))
++ checksum = CHECKSUM_NONE;
++ else
++ checksum = CHECKSUM_UNNECESSARY;
++ } else if (RD_IPV6_CS) {
++ if ((opts2 & RD_UDP_CS) && !(opts3 & UDPF))
++ checksum = CHECKSUM_UNNECESSARY;
++ else if ((opts2 & RD_TCP_CS) && !(opts3 & TCPF))
++ checksum = CHECKSUM_UNNECESSARY;
++ }
++
++return_result:
++ return checksum;
++}
++
++static void rx_bottom(struct r8152 *tp)
++{
++ unsigned long flags;
++ struct list_head *cursor, *next, rx_queue;
++
++ if (list_empty(&tp->rx_done))
++ return;
++
++ INIT_LIST_HEAD(&rx_queue);
++ spin_lock_irqsave(&tp->rx_lock, flags);
++ list_splice_init(&tp->rx_done, &rx_queue);
++ spin_unlock_irqrestore(&tp->rx_lock, flags);
++
++ list_for_each_safe(cursor, next, &rx_queue) {
++ struct rx_desc *rx_desc;
++ struct rx_agg *agg;
++ int len_used = 0;
++ struct urb *urb;
++ u8 *rx_data;
++ int ret;
++
++ list_del_init(cursor);
++
++ agg = list_entry(cursor, struct rx_agg, list);
++ urb = agg->urb;
++ if (urb->actual_length < ETH_ZLEN)
++ goto submit;
++
++ rx_desc = agg->head;
++ rx_data = agg->head;
++ len_used += sizeof(struct rx_desc);
++
++ while (urb->actual_length > len_used) {
++ struct net_device *netdev = tp->netdev;
++ struct net_device_stats *stats = &netdev->stats;
++ unsigned int pkt_len;
++ struct sk_buff *skb;
++
++ pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK;
++ if (pkt_len < ETH_ZLEN)
++ break;
++
++ len_used += pkt_len;
++ if (urb->actual_length < len_used)
++ break;
++
++ pkt_len -= CRC_SIZE;
++ rx_data += sizeof(struct rx_desc);
++
++ skb = netdev_alloc_skb_ip_align(netdev, pkt_len);
++ if (!skb) {
++ stats->rx_dropped++;
++ goto find_next_rx;
++ }
++
++ skb->ip_summed = r8152_rx_csum(tp, rx_desc);
++ memcpy(skb->data, rx_data, pkt_len);
++ skb_put(skb, pkt_len);
++ skb->protocol = eth_type_trans(skb, netdev);
++ rtl_rx_vlan_tag(rx_desc, skb);
++ netif_receive_skb(skb);
++ stats->rx_packets++;
++ stats->rx_bytes += pkt_len;
++
++find_next_rx:
++ rx_data = rx_agg_align(rx_data + pkt_len + CRC_SIZE);
++ rx_desc = (struct rx_desc *)rx_data;
++ len_used = (int)(rx_data - (u8 *)agg->head);
++ len_used += sizeof(struct rx_desc);
++ }
++
++submit:
++ ret = r8152_submit_rx(tp, agg, GFP_ATOMIC);
++ if (ret && ret != -ENODEV) {
++ spin_lock_irqsave(&tp->rx_lock, flags);
++ list_add_tail(&agg->list, &tp->rx_done);
++ spin_unlock_irqrestore(&tp->rx_lock, flags);
++ tasklet_schedule(&tp->tl);
++ }
++ }
++}
++
++static void tx_bottom(struct r8152 *tp)
++{
++ int res;
++
++ do {
++ struct tx_agg *agg;
++
++ if (skb_queue_empty(&tp->tx_queue))
++ break;
++
++ agg = r8152_get_tx_agg(tp);
++ if (!agg)
++ break;
++
++ res = r8152_tx_agg_fill(tp, agg);
++ if (res) {
++ struct net_device *netdev = tp->netdev;
++
++ if (res == -ENODEV) {
++ netif_device_detach(netdev);
++ } else {
++ struct net_device_stats *stats = &netdev->stats;
++ unsigned long flags;
++
++ netif_warn(tp, tx_err, netdev,
++ "failed tx_urb %d\n", res);
++ stats->tx_dropped += agg->skb_num;
++
++ spin_lock_irqsave(&tp->tx_lock, flags);
++ list_add_tail(&agg->list, &tp->tx_free);
++ spin_unlock_irqrestore(&tp->tx_lock, flags);
++ }
++ }
++ } while (res == 0);
++}
++
++static void bottom_half(unsigned long data)
++{
++ struct r8152 *tp;
++
++ tp = (struct r8152 *)data;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ if (!test_bit(WORK_ENABLE, &tp->flags))
++ return;
++
++ /* When link down, the driver would cancel all bulks. */
++ /* This avoid the re-submitting bulk */
++ if (!netif_carrier_ok(tp->netdev))
++ return;
++
++ rx_bottom(tp);
++ tx_bottom(tp);
++}
++
++static
++int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags)
++{
++ usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1),
++ agg->head, agg_buf_sz,
++ (usb_complete_t)read_bulk_callback, agg);
++
++ return usb_submit_urb(agg->urb, mem_flags);
++}
++
++static void rtl_drop_queued_tx(struct r8152 *tp)
++{
++ struct net_device_stats *stats = &tp->netdev->stats;
++ struct sk_buff_head skb_head, *tx_queue = &tp->tx_queue;
++ struct sk_buff *skb;
++
++ if (skb_queue_empty(tx_queue))
++ return;
++
++ __skb_queue_head_init(&skb_head);
++ spin_lock_bh(&tx_queue->lock);
++ skb_queue_splice_init(tx_queue, &skb_head);
++ spin_unlock_bh(&tx_queue->lock);
++
++ while ((skb = __skb_dequeue(&skb_head))) {
++ dev_kfree_skb(skb);
++ stats->tx_dropped++;
++ }
++}
++
++static void rtl8152_tx_timeout(struct net_device *netdev)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++ int i;
++
++ netif_warn(tp, tx_err, netdev, "Tx timeout\n");
++ for (i = 0; i < RTL8152_MAX_TX; i++)
++ usb_unlink_urb(tp->tx_info[i].urb);
++}
++
++static void rtl8152_set_rx_mode(struct net_device *netdev)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++
++ if (tp->speed & LINK_STATUS) {
++ set_bit(RTL8152_SET_RX_MODE, &tp->flags);
++ schedule_delayed_work(&tp->schedule, 0);
++ }
++}
++
++static void _rtl8152_set_rx_mode(struct net_device *netdev)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++ u32 mc_filter[2]; /* Multicast hash filter */
++ __le32 tmp[2];
++ u32 ocp_data;
++
++ clear_bit(RTL8152_SET_RX_MODE, &tp->flags);
++ netif_stop_queue(netdev);
++ ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
++ ocp_data &= ~RCR_ACPT_ALL;
++ ocp_data |= RCR_AB | RCR_APM;
++
++ if (netdev->flags & IFF_PROMISC) {
++ /* Unconditionally log net taps. */
++ netif_notice(tp, link, netdev, "Promiscuous mode enabled\n");
++ ocp_data |= RCR_AM | RCR_AAP;
++ mc_filter[1] = 0xffffffff;
++ mc_filter[0] = 0xffffffff;
++ } else if ((netdev_mc_count(netdev) > multicast_filter_limit) ||
++ (netdev->flags & IFF_ALLMULTI)) {
++ /* Too many to filter perfectly -- accept all multicasts. */
++ ocp_data |= RCR_AM;
++ mc_filter[1] = 0xffffffff;
++ mc_filter[0] = 0xffffffff;
++ } else {
++ struct netdev_hw_addr *ha;
++
++ mc_filter[1] = 0;
++ mc_filter[0] = 0;
++ netdev_for_each_mc_addr(ha, netdev) {
++ int bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
++
++ mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
++ ocp_data |= RCR_AM;
++ }
++ }
++
++ tmp[0] = __cpu_to_le32(swab32(mc_filter[1]));
++ tmp[1] = __cpu_to_le32(swab32(mc_filter[0]));
++
++ pla_ocp_write(tp, PLA_MAR, BYTE_EN_DWORD, sizeof(tmp), tmp);
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
++ netif_wake_queue(netdev);
++}
++
++static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb,
++ struct net_device *netdev)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++
++ skb_tx_timestamp(skb);
++
++ skb_queue_tail(&tp->tx_queue, skb);
++
++ if (!list_empty(&tp->tx_free)) {
++ if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
++ set_bit(SCHEDULE_TASKLET, &tp->flags);
++ schedule_delayed_work(&tp->schedule, 0);
++ } else {
++ usb_mark_last_busy(tp->udev);
++ tasklet_schedule(&tp->tl);
++ }
++ } else if (skb_queue_len(&tp->tx_queue) > tp->tx_qlen) {
++ netif_stop_queue(netdev);
++ }
++
++ return NETDEV_TX_OK;
++}
++
++static void r8152b_reset_packet_filter(struct r8152 *tp)
++{
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_FMC);
++ ocp_data &= ~FMC_FCR_MCU_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_FMC, ocp_data);
++ ocp_data |= FMC_FCR_MCU_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_FMC, ocp_data);
++}
++
++static void rtl8152_nic_reset(struct r8152 *tp)
++{
++ int i;
++
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, CR_RST);
++
++ for (i = 0; i < 1000; i++) {
++ if (!(ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CR) & CR_RST))
++ break;
++ usleep_range(100, 400);
++ }
++}
++
++static void set_tx_qlen(struct r8152 *tp)
++{
++ struct net_device *netdev = tp->netdev;
++
++ tp->tx_qlen = agg_buf_sz / (netdev->mtu + VLAN_ETH_HLEN + VLAN_HLEN +
++ sizeof(struct tx_desc));
++}
++
++static inline u8 rtl8152_get_speed(struct r8152 *tp)
++{
++ return ocp_read_byte(tp, MCU_TYPE_PLA, PLA_PHYSTATUS);
++}
++
++static void rtl_set_eee_plus(struct r8152 *tp)
++{
++ u32 ocp_data;
++ u8 speed;
++
++ speed = rtl8152_get_speed(tp);
++ if (speed & _10bps) {
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR);
++ ocp_data |= EEEP_CR_EEEP_TX;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR, ocp_data);
++ } else {
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR);
++ ocp_data &= ~EEEP_CR_EEEP_TX;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR, ocp_data);
++ }
++}
++
++static void rxdy_gated_en(struct r8152 *tp, bool enable)
++{
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MISC_1);
++ if (enable)
++ ocp_data |= RXDY_GATED_EN;
++ else
++ ocp_data &= ~RXDY_GATED_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data);
++}
++
++static int rtl_start_rx(struct r8152 *tp)
++{
++ int i, ret = 0;
++
++ INIT_LIST_HEAD(&tp->rx_done);
++ for (i = 0; i < RTL8152_MAX_RX; i++) {
++ INIT_LIST_HEAD(&tp->rx_info[i].list);
++ ret = r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL);
++ if (ret)
++ break;
++ }
++
++ return ret;
++}
++
++static int rtl_stop_rx(struct r8152 *tp)
++{
++ int i;
++
++ for (i = 0; i < RTL8152_MAX_RX; i++)
++ usb_kill_urb(tp->rx_info[i].urb);
++
++ return 0;
++}
++
++static int rtl_enable(struct r8152 *tp)
++{
++ u32 ocp_data;
++
++ r8152b_reset_packet_filter(tp);
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CR);
++ ocp_data |= CR_RE | CR_TE;
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, ocp_data);
++
++ rxdy_gated_en(tp, false);
++
++ return rtl_start_rx(tp);
++}
++
++static int rtl8152_enable(struct r8152 *tp)
++{
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return -ENODEV;
++
++ set_tx_qlen(tp);
++ rtl_set_eee_plus(tp);
++
++ return rtl_enable(tp);
++}
++
++static void r8153_set_rx_agg(struct r8152 *tp)
++{
++ u8 speed;
++
++ speed = rtl8152_get_speed(tp);
++ if (speed & _1000bps) {
++ if (tp->udev->speed == USB_SPEED_SUPER) {
++ ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH,
++ RX_THR_SUPPER);
++ ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_EARLY_AGG,
++ EARLY_AGG_SUPPER);
++ } else {
++ ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH,
++ RX_THR_HIGH);
++ ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_EARLY_AGG,
++ EARLY_AGG_HIGH);
++ }
++ } else {
++ ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH, RX_THR_SLOW);
++ ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_EARLY_AGG,
++ EARLY_AGG_SLOW);
++ }
++}
++
++static int rtl8153_enable(struct r8152 *tp)
++{
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return -ENODEV;
++
++ set_tx_qlen(tp);
++ rtl_set_eee_plus(tp);
++ r8153_set_rx_agg(tp);
++
++ return rtl_enable(tp);
++}
++
++static void rtl_disable(struct r8152 *tp)
++{
++ u32 ocp_data;
++ int i;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
++ rtl_drop_queued_tx(tp);
++ return;
++ }
++
++ ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
++ ocp_data &= ~RCR_ACPT_ALL;
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
++
++ rtl_drop_queued_tx(tp);
++
++ for (i = 0; i < RTL8152_MAX_TX; i++)
++ usb_kill_urb(tp->tx_info[i].urb);
++
++ rxdy_gated_en(tp, true);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if ((ocp_data & FIFO_EMPTY) == FIFO_EMPTY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ for (i = 0; i < 1000; i++) {
++ if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0) & TCR0_TX_EMPTY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ rtl_stop_rx(tp);
++
++ rtl8152_nic_reset(tp);
++}
++
++static void r8152_power_cut_en(struct r8152 *tp, bool enable)
++{
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_UPS_CTRL);
++ if (enable)
++ ocp_data |= POWER_CUT;
++ else
++ ocp_data &= ~POWER_CUT;
++ ocp_write_word(tp, MCU_TYPE_USB, USB_UPS_CTRL, ocp_data);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_PM_CTRL_STATUS);
++ ocp_data &= ~RESUME_INDICATE;
++ ocp_write_word(tp, MCU_TYPE_USB, USB_PM_CTRL_STATUS, ocp_data);
++}
++
++static void rtl_rx_vlan_en(struct r8152 *tp, bool enable)
++{
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CPCR);
++ if (enable)
++ ocp_data |= CPCR_RX_VLAN;
++ else
++ ocp_data &= ~CPCR_RX_VLAN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_CPCR, ocp_data);
++}
++
++static int rtl8152_set_features(struct net_device *dev,
++ netdev_features_t features)
++{
++ netdev_features_t changed = features ^ dev->features;
++ struct r8152 *tp = netdev_priv(dev);
++ int ret;
++
++ ret = usb_autopm_get_interface(tp->intf);
++ if (ret < 0)
++ goto out;
++
++ mutex_lock(&tp->control);
++
++ if (changed & NETIF_F_HW_VLAN_CTAG_RX) {
++ if (features & NETIF_F_HW_VLAN_CTAG_RX)
++ rtl_rx_vlan_en(tp, true);
++ else
++ rtl_rx_vlan_en(tp, false);
++ }
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++
++out:
++ return ret;
++}
++
++#define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
++
++static u32 __rtl_get_wol(struct r8152 *tp)
++{
++ u32 ocp_data;
++ u32 wolopts = 0;
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CONFIG5);
++ if (!(ocp_data & LAN_WAKE_EN))
++ return 0;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34);
++ if (ocp_data & LINK_ON_WAKE_EN)
++ wolopts |= WAKE_PHY;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG5);
++ if (ocp_data & UWF_EN)
++ wolopts |= WAKE_UCAST;
++ if (ocp_data & BWF_EN)
++ wolopts |= WAKE_BCAST;
++ if (ocp_data & MWF_EN)
++ wolopts |= WAKE_MCAST;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL);
++ if (ocp_data & MAGIC_EN)
++ wolopts |= WAKE_MAGIC;
++
++ return wolopts;
++}
++
++static void __rtl_set_wol(struct r8152 *tp, u32 wolopts)
++{
++ u32 ocp_data;
++
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34);
++ ocp_data &= ~LINK_ON_WAKE_EN;
++ if (wolopts & WAKE_PHY)
++ ocp_data |= LINK_ON_WAKE_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ocp_data);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG5);
++ ocp_data &= ~(UWF_EN | BWF_EN | MWF_EN | LAN_WAKE_EN);
++ if (wolopts & WAKE_UCAST)
++ ocp_data |= UWF_EN;
++ if (wolopts & WAKE_BCAST)
++ ocp_data |= BWF_EN;
++ if (wolopts & WAKE_MCAST)
++ ocp_data |= MWF_EN;
++ if (wolopts & WAKE_ANY)
++ ocp_data |= LAN_WAKE_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG5, ocp_data);
++
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL);
++ ocp_data &= ~MAGIC_EN;
++ if (wolopts & WAKE_MAGIC)
++ ocp_data |= MAGIC_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL, ocp_data);
++
++ if (wolopts & WAKE_ANY)
++ device_set_wakeup_enable(&tp->udev->dev, true);
++ else
++ device_set_wakeup_enable(&tp->udev->dev, false);
++}
++
++static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable)
++{
++ if (enable) {
++ u32 ocp_data;
++
++ __rtl_set_wol(tp, WAKE_ANY);
++
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34);
++ ocp_data |= LINK_OFF_WAKE_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ocp_data);
++
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
++ } else {
++ __rtl_set_wol(tp, tp->saved_wolopts);
++ }
++}
++
++static void rtl_phy_reset(struct r8152 *tp)
++{
++ u16 data;
++ int i;
++
++ clear_bit(PHY_RESET, &tp->flags);
++
++ data = r8152_mdio_read(tp, MII_BMCR);
++
++ /* don't reset again before the previous one complete */
++ if (data & BMCR_RESET)
++ return;
++
++ data |= BMCR_RESET;
++ r8152_mdio_write(tp, MII_BMCR, data);
++
++ for (i = 0; i < 50; i++) {
++ msleep(20);
++ if ((r8152_mdio_read(tp, MII_BMCR) & BMCR_RESET) == 0)
++ break;
++ }
++}
++
++static void r8153_teredo_off(struct r8152 *tp)
++{
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG);
++ ocp_data &= ~(TEREDO_SEL | TEREDO_RS_EVENT_MASK | OOB_TEREDO_EN);
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG, ocp_data);
++
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_WDT6_CTRL, WDT6_SET_MODE);
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_REALWOW_TIMER, 0);
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TEREDO_TIMER, 0);
++}
++
++static void r8152b_disable_aldps(struct r8152 *tp)
++{
++ ocp_reg_write(tp, OCP_ALDPS_CONFIG, ENPDNPS | LINKENA | DIS_SDSAVE);
++ msleep(20);
++}
++
++static inline void r8152b_enable_aldps(struct r8152 *tp)
++{
++ ocp_reg_write(tp, OCP_ALDPS_CONFIG, ENPWRSAVE | ENPDNPS |
++ LINKENA | DIS_SDSAVE);
++}
++
++static void rtl8152_disable(struct r8152 *tp)
++{
++ r8152b_disable_aldps(tp);
++ rtl_disable(tp);
++ r8152b_enable_aldps(tp);
++}
++
++static void r8152b_hw_phy_cfg(struct r8152 *tp)
++{
++ u16 data;
++
++ data = r8152_mdio_read(tp, MII_BMCR);
++ if (data & BMCR_PDOWN) {
++ data &= ~BMCR_PDOWN;
++ r8152_mdio_write(tp, MII_BMCR, data);
++ }
++
++ set_bit(PHY_RESET, &tp->flags);
++}
++
++static void r8152b_exit_oob(struct r8152 *tp)
++{
++ u32 ocp_data;
++ int i;
++
++ ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
++ ocp_data &= ~RCR_ACPT_ALL;
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
++
++ rxdy_gated_en(tp, true);
++ r8153_teredo_off(tp);
++ r8152b_hw_phy_cfg(tp);
++
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, 0x00);
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ ocp_data &= ~NOW_IS_OOB;
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
++ ocp_data &= ~MCU_BORW_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if (ocp_data & LINK_LIST_READY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
++ ocp_data |= RE_INIT_LL;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if (ocp_data & LINK_LIST_READY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ rtl8152_nic_reset(tp);
++
++ /* rx share fifo credit full threshold */
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_NORMAL);
++
++ if (tp->udev->speed == USB_SPEED_FULL ||
++ tp->udev->speed == USB_SPEED_LOW) {
++ /* rx share fifo credit near full threshold */
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1,
++ RXFIFO_THR2_FULL);
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL2,
++ RXFIFO_THR3_FULL);
++ } else {
++ /* rx share fifo credit near full threshold */
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1,
++ RXFIFO_THR2_HIGH);
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL2,
++ RXFIFO_THR3_HIGH);
++ }
++
++ /* TX share fifo free credit full threshold */
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL, TXFIFO_THR_NORMAL);
++
++ ocp_write_byte(tp, MCU_TYPE_USB, USB_TX_AGG, TX_AGG_MAX_THRESHOLD);
++ ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH, RX_THR_HIGH);
++ ocp_write_dword(tp, MCU_TYPE_USB, USB_TX_DMA,
++ TEST_MODE_DISABLE | TX_SIZE_ADJUST1);
++
++ rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX);
++
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8152_RMS);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0);
++ ocp_data |= TCR0_AUTO_FIFO;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_TCR0, ocp_data);
++}
++
++static void r8152b_enter_oob(struct r8152 *tp)
++{
++ u32 ocp_data;
++ int i;
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ ocp_data &= ~NOW_IS_OOB;
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
++
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_OOB);
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, RXFIFO_THR2_OOB);
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL2, RXFIFO_THR3_OOB);
++
++ rtl_disable(tp);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if (ocp_data & LINK_LIST_READY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
++ ocp_data |= RE_INIT_LL;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if (ocp_data & LINK_LIST_READY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8152_RMS);
++
++ rtl_rx_vlan_en(tp, true);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
++ ocp_data |= ALDPS_PROXY_MODE;
++ ocp_write_word(tp, MCU_TYPE_PLA, PAL_BDC_CR, ocp_data);
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
++
++ rxdy_gated_en(tp, false);
++
++ ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
++ ocp_data |= RCR_APM | RCR_AM | RCR_AB;
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
++}
++
++static void r8153_hw_phy_cfg(struct r8152 *tp)
++{
++ u32 ocp_data;
++ u16 data;
++
++ ocp_reg_write(tp, OCP_ADC_CFG, CKADSEL_L | ADC_EN | EN_EMI_L);
++ data = r8152_mdio_read(tp, MII_BMCR);
++ if (data & BMCR_PDOWN) {
++ data &= ~BMCR_PDOWN;
++ r8152_mdio_write(tp, MII_BMCR, data);
++ }
++
++ if (tp->version == RTL_VER_03) {
++ data = ocp_reg_read(tp, OCP_EEE_CFG);
++ data &= ~CTAP_SHORT_EN;
++ ocp_reg_write(tp, OCP_EEE_CFG, data);
++ }
++
++ data = ocp_reg_read(tp, OCP_POWER_CFG);
++ data |= EEE_CLKDIV_EN;
++ ocp_reg_write(tp, OCP_POWER_CFG, data);
++
++ data = ocp_reg_read(tp, OCP_DOWN_SPEED);
++ data |= EN_10M_BGOFF;
++ ocp_reg_write(tp, OCP_DOWN_SPEED, data);
++ data = ocp_reg_read(tp, OCP_POWER_CFG);
++ data |= EN_10M_PLLOFF;
++ ocp_reg_write(tp, OCP_POWER_CFG, data);
++ data = sram_read(tp, SRAM_IMPEDANCE);
++ data &= ~RX_DRIVING_MASK;
++ sram_write(tp, SRAM_IMPEDANCE, data);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR);
++ ocp_data |= PFM_PWM_SWITCH;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR, ocp_data);
++
++ data = sram_read(tp, SRAM_LPF_CFG);
++ data |= LPF_AUTO_TUNE;
++ sram_write(tp, SRAM_LPF_CFG, data);
++
++ data = sram_read(tp, SRAM_10M_AMP1);
++ data |= GDAC_IB_UPALL;
++ sram_write(tp, SRAM_10M_AMP1, data);
++ data = sram_read(tp, SRAM_10M_AMP2);
++ data |= AMP_DN;
++ sram_write(tp, SRAM_10M_AMP2, data);
++
++ set_bit(PHY_RESET, &tp->flags);
++}
++
++static void r8153_u1u2en(struct r8152 *tp, bool enable)
++{
++ u8 u1u2[8];
++
++ if (enable)
++ memset(u1u2, 0xff, sizeof(u1u2));
++ else
++ memset(u1u2, 0x00, sizeof(u1u2));
++
++ usb_ocp_write(tp, USB_TOLERANCE, BYTE_EN_SIX_BYTES, sizeof(u1u2), u1u2);
++}
++
++static void r8153_u2p3en(struct r8152 *tp, bool enable)
++{
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_U2P3_CTRL);
++ if (enable)
++ ocp_data |= U2P3_ENABLE;
++ else
++ ocp_data &= ~U2P3_ENABLE;
++ ocp_write_word(tp, MCU_TYPE_USB, USB_U2P3_CTRL, ocp_data);
++}
++
++static void r8153_power_cut_en(struct r8152 *tp, bool enable)
++{
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_POWER_CUT);
++ if (enable)
++ ocp_data |= PWR_EN | PHASE2_EN;
++ else
++ ocp_data &= ~(PWR_EN | PHASE2_EN);
++ ocp_write_word(tp, MCU_TYPE_USB, USB_POWER_CUT, ocp_data);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0);
++ ocp_data &= ~PCUT_STATUS;
++ ocp_write_word(tp, MCU_TYPE_USB, USB_MISC_0, ocp_data);
++}
++
++static void r8153_first_init(struct r8152 *tp)
++{
++ u32 ocp_data;
++ int i;
++
++ rxdy_gated_en(tp, true);
++ r8153_teredo_off(tp);
++
++ ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
++ ocp_data &= ~RCR_ACPT_ALL;
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
++
++ r8153_hw_phy_cfg(tp);
++
++ rtl8152_nic_reset(tp);
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ ocp_data &= ~NOW_IS_OOB;
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
++ ocp_data &= ~MCU_BORW_EN;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if (ocp_data & LINK_LIST_READY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
++ ocp_data |= RE_INIT_LL;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if (ocp_data & LINK_LIST_READY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX);
++
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8153_RMS);
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_MTPS, MTPS_JUMBO);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0);
++ ocp_data |= TCR0_AUTO_FIFO;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_TCR0, ocp_data);
++
++ rtl8152_nic_reset(tp);
++
++ /* rx share fifo credit full threshold */
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_NORMAL);
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, RXFIFO_THR2_NORMAL);
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL2, RXFIFO_THR3_NORMAL);
++ /* TX share fifo free credit full threshold */
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL, TXFIFO_THR_NORMAL2);
++
++ /* rx aggregation */
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
++ ocp_data &= ~RX_AGG_DISABLE;
++ ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
++}
++
++static void r8153_enter_oob(struct r8152 *tp)
++{
++ u32 ocp_data;
++ int i;
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ ocp_data &= ~NOW_IS_OOB;
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
++
++ rtl_disable(tp);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if (ocp_data & LINK_LIST_READY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
++ ocp_data |= RE_INIT_LL;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data);
++
++ for (i = 0; i < 1000; i++) {
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ if (ocp_data & LINK_LIST_READY)
++ break;
++ usleep_range(1000, 2000);
++ }
++
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8153_RMS);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG);
++ ocp_data &= ~TEREDO_WAKE_MASK;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG, ocp_data);
++
++ rtl_rx_vlan_en(tp, true);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
++ ocp_data |= ALDPS_PROXY_MODE;
++ ocp_write_word(tp, MCU_TYPE_PLA, PAL_BDC_CR, ocp_data);
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
++ ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
++ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
++
++ rxdy_gated_en(tp, false);
++
++ ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
++ ocp_data |= RCR_APM | RCR_AM | RCR_AB;
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
++}
++
++static void r8153_disable_aldps(struct r8152 *tp)
++{
++ u16 data;
++
++ data = ocp_reg_read(tp, OCP_POWER_CFG);
++ data &= ~EN_ALDPS;
++ ocp_reg_write(tp, OCP_POWER_CFG, data);
++ msleep(20);
++}
++
++static void r8153_enable_aldps(struct r8152 *tp)
++{
++ u16 data;
++
++ data = ocp_reg_read(tp, OCP_POWER_CFG);
++ data |= EN_ALDPS;
++ ocp_reg_write(tp, OCP_POWER_CFG, data);
++}
++
++static void rtl8153_disable(struct r8152 *tp)
++{
++ r8153_disable_aldps(tp);
++ rtl_disable(tp);
++ r8153_enable_aldps(tp);
++}
++
++static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
++{
++ u16 bmcr, anar, gbcr;
++ int ret = 0;
++
++ cancel_delayed_work_sync(&tp->schedule);
++ anar = r8152_mdio_read(tp, MII_ADVERTISE);
++ anar &= ~(ADVERTISE_10HALF | ADVERTISE_10FULL |
++ ADVERTISE_100HALF | ADVERTISE_100FULL);
++ if (tp->mii.supports_gmii) {
++ gbcr = r8152_mdio_read(tp, MII_CTRL1000);
++ gbcr &= ~(ADVERTISE_1000FULL | ADVERTISE_1000HALF);
++ } else {
++ gbcr = 0;
++ }
++
++ if (autoneg == AUTONEG_DISABLE) {
++ if (speed == SPEED_10) {
++ bmcr = 0;
++ anar |= ADVERTISE_10HALF | ADVERTISE_10FULL;
++ } else if (speed == SPEED_100) {
++ bmcr = BMCR_SPEED100;
++ anar |= ADVERTISE_100HALF | ADVERTISE_100FULL;
++ } else if (speed == SPEED_1000 && tp->mii.supports_gmii) {
++ bmcr = BMCR_SPEED1000;
++ gbcr |= ADVERTISE_1000FULL | ADVERTISE_1000HALF;
++ } else {
++ ret = -EINVAL;
++ goto out;
++ }
++
++ if (duplex == DUPLEX_FULL)
++ bmcr |= BMCR_FULLDPLX;
++ } else {
++ if (speed == SPEED_10) {
++ if (duplex == DUPLEX_FULL)
++ anar |= ADVERTISE_10HALF | ADVERTISE_10FULL;
++ else
++ anar |= ADVERTISE_10HALF;
++ } else if (speed == SPEED_100) {
++ if (duplex == DUPLEX_FULL) {
++ anar |= ADVERTISE_10HALF | ADVERTISE_10FULL;
++ anar |= ADVERTISE_100HALF | ADVERTISE_100FULL;
++ } else {
++ anar |= ADVERTISE_10HALF;
++ anar |= ADVERTISE_100HALF;
++ }
++ } else if (speed == SPEED_1000 && tp->mii.supports_gmii) {
++ if (duplex == DUPLEX_FULL) {
++ anar |= ADVERTISE_10HALF | ADVERTISE_10FULL;
++ anar |= ADVERTISE_100HALF | ADVERTISE_100FULL;
++ gbcr |= ADVERTISE_1000FULL | ADVERTISE_1000HALF;
++ } else {
++ anar |= ADVERTISE_10HALF;
++ anar |= ADVERTISE_100HALF;
++ gbcr |= ADVERTISE_1000HALF;
++ }
++ } else {
++ ret = -EINVAL;
++ goto out;
++ }
++
++ bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
++ }
++
++ if (test_bit(PHY_RESET, &tp->flags))
++ bmcr |= BMCR_RESET;
++
++ if (tp->mii.supports_gmii)
++ r8152_mdio_write(tp, MII_CTRL1000, gbcr);
++
++ r8152_mdio_write(tp, MII_ADVERTISE, anar);
++ r8152_mdio_write(tp, MII_BMCR, bmcr);
++
++ if (test_bit(PHY_RESET, &tp->flags)) {
++ int i;
++
++ clear_bit(PHY_RESET, &tp->flags);
++ for (i = 0; i < 50; i++) {
++ msleep(20);
++ if ((r8152_mdio_read(tp, MII_BMCR) & BMCR_RESET) == 0)
++ break;
++ }
++ }
++
++out:
++
++ return ret;
++}
++
++static void rtl8152_up(struct r8152 *tp)
++{
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ r8152b_disable_aldps(tp);
++ r8152b_exit_oob(tp);
++ r8152b_enable_aldps(tp);
++}
++
++static void rtl8152_down(struct r8152 *tp)
++{
++ if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
++ rtl_drop_queued_tx(tp);
++ return;
++ }
++
++ r8152_power_cut_en(tp, false);
++ r8152b_disable_aldps(tp);
++ r8152b_enter_oob(tp);
++ r8152b_enable_aldps(tp);
++}
++
++static void rtl8153_up(struct r8152 *tp)
++{
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ r8153_disable_aldps(tp);
++ r8153_first_init(tp);
++ r8153_enable_aldps(tp);
++}
++
++static void rtl8153_down(struct r8152 *tp)
++{
++ if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
++ rtl_drop_queued_tx(tp);
++ return;
++ }
++
++ r8153_u1u2en(tp, false);
++ r8153_power_cut_en(tp, false);
++ r8153_disable_aldps(tp);
++ r8153_enter_oob(tp);
++ r8153_enable_aldps(tp);
++}
++
++static void set_carrier(struct r8152 *tp)
++{
++ struct net_device *netdev = tp->netdev;
++ u8 speed;
++
++ clear_bit(RTL8152_LINK_CHG, &tp->flags);
++ speed = rtl8152_get_speed(tp);
++
++ if (speed & LINK_STATUS) {
++ if (!(tp->speed & LINK_STATUS)) {
++ tp->rtl_ops.enable(tp);
++ set_bit(RTL8152_SET_RX_MODE, &tp->flags);
++ netif_carrier_on(netdev);
++ }
++ } else {
++ if (tp->speed & LINK_STATUS) {
++ netif_carrier_off(netdev);
++ tasklet_disable(&tp->tl);
++ tp->rtl_ops.disable(tp);
++ tasklet_enable(&tp->tl);
++ }
++ }
++ tp->speed = speed;
++}
++
++static void rtl_work_func_t(struct work_struct *work)
++{
++ struct r8152 *tp = container_of(work, struct r8152, schedule.work);
++
++ if (usb_autopm_get_interface(tp->intf) < 0)
++ return;
++
++ if (!test_bit(WORK_ENABLE, &tp->flags))
++ goto out1;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ goto out1;
++
++ if (!mutex_trylock(&tp->control)) {
++ schedule_delayed_work(&tp->schedule, 0);
++ goto out1;
++ }
++
++ if (test_bit(RTL8152_LINK_CHG, &tp->flags))
++ set_carrier(tp);
++
++ if (test_bit(RTL8152_SET_RX_MODE, &tp->flags))
++ _rtl8152_set_rx_mode(tp->netdev);
++
++ if (test_bit(SCHEDULE_TASKLET, &tp->flags) &&
++ (tp->speed & LINK_STATUS)) {
++ clear_bit(SCHEDULE_TASKLET, &tp->flags);
++ tasklet_schedule(&tp->tl);
++ }
++
++ if (test_bit(PHY_RESET, &tp->flags))
++ rtl_phy_reset(tp);
++
++ mutex_unlock(&tp->control);
++
++out1:
++ usb_autopm_put_interface(tp->intf);
++}
++
++static int rtl8152_open(struct net_device *netdev)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++ int res = 0;
++
++ res = alloc_all_mem(tp);
++ if (res)
++ goto out;
++
++ /* set speed to 0 to avoid autoresume try to submit rx */
++ tp->speed = 0;
++
++ res = usb_autopm_get_interface(tp->intf);
++ if (res < 0) {
++ free_all_mem(tp);
++ goto out;
++ }
++
++ mutex_lock(&tp->control);
++
++ /* The WORK_ENABLE may be set when autoresume occurs */
++ if (test_bit(WORK_ENABLE, &tp->flags)) {
++ clear_bit(WORK_ENABLE, &tp->flags);
++ usb_kill_urb(tp->intr_urb);
++ cancel_delayed_work_sync(&tp->schedule);
++
++ /* disable the tx/rx, if the workqueue has enabled them. */
++ if (tp->speed & LINK_STATUS)
++ tp->rtl_ops.disable(tp);
++ }
++
++ tp->rtl_ops.up(tp);
++
++ rtl8152_set_speed(tp, AUTONEG_ENABLE,
++ tp->mii.supports_gmii ? SPEED_1000 : SPEED_100,
++ DUPLEX_FULL);
++ tp->speed = 0;
++ netif_carrier_off(netdev);
++ netif_start_queue(netdev);
++ set_bit(WORK_ENABLE, &tp->flags);
++
++ res = usb_submit_urb(tp->intr_urb, GFP_KERNEL);
++ if (res) {
++ if (res == -ENODEV)
++ netif_device_detach(tp->netdev);
++ netif_warn(tp, ifup, netdev, "intr_urb submit failed: %d\n",
++ res);
++ free_all_mem(tp);
++ }
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++
++out:
++ return res;
++}
++
++static int rtl8152_close(struct net_device *netdev)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++ int res = 0;
++
++ clear_bit(WORK_ENABLE, &tp->flags);
++ usb_kill_urb(tp->intr_urb);
++ cancel_delayed_work_sync(&tp->schedule);
++ netif_stop_queue(netdev);
++
++ res = usb_autopm_get_interface(tp->intf);
++ if (res < 0) {
++ rtl_drop_queued_tx(tp);
++ } else {
++ mutex_lock(&tp->control);
++
++ /* The autosuspend may have been enabled and wouldn't
++ * be disable when autoresume occurs, because the
++ * netif_running() would be false.
++ */
++ rtl_runtime_suspend_enable(tp, false);
++
++ tasklet_disable(&tp->tl);
++ tp->rtl_ops.down(tp);
++ tasklet_enable(&tp->tl);
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++ }
++
++ free_all_mem(tp);
++
++ return res;
++}
++
++static inline void r8152_mmd_indirect(struct r8152 *tp, u16 dev, u16 reg)
++{
++ ocp_reg_write(tp, OCP_EEE_AR, FUN_ADDR | dev);
++ ocp_reg_write(tp, OCP_EEE_DATA, reg);
++ ocp_reg_write(tp, OCP_EEE_AR, FUN_DATA | dev);
++}
++
++static u16 r8152_mmd_read(struct r8152 *tp, u16 dev, u16 reg)
++{
++ u16 data;
++
++ r8152_mmd_indirect(tp, dev, reg);
++ data = ocp_reg_read(tp, OCP_EEE_DATA);
++ ocp_reg_write(tp, OCP_EEE_AR, 0x0000);
++
++ return data;
++}
++
++static void r8152_mmd_write(struct r8152 *tp, u16 dev, u16 reg, u16 data)
++{
++ r8152_mmd_indirect(tp, dev, reg);
++ ocp_reg_write(tp, OCP_EEE_DATA, data);
++ ocp_reg_write(tp, OCP_EEE_AR, 0x0000);
++}
++
++static void r8152_eee_en(struct r8152 *tp, bool enable)
++{
++ u16 config1, config2, config3;
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR);
++ config1 = ocp_reg_read(tp, OCP_EEE_CONFIG1) & ~sd_rise_time_mask;
++ config2 = ocp_reg_read(tp, OCP_EEE_CONFIG2);
++ config3 = ocp_reg_read(tp, OCP_EEE_CONFIG3) & ~fast_snr_mask;
++
++ if (enable) {
++ ocp_data |= EEE_RX_EN | EEE_TX_EN;
++ config1 |= EEE_10_CAP | EEE_NWAY_EN | TX_QUIET_EN | RX_QUIET_EN;
++ config1 |= sd_rise_time(1);
++ config2 |= RG_DACQUIET_EN | RG_LDVQUIET_EN;
++ config3 |= fast_snr(42);
++ } else {
++ ocp_data &= ~(EEE_RX_EN | EEE_TX_EN);
++ config1 &= ~(EEE_10_CAP | EEE_NWAY_EN | TX_QUIET_EN |
++ RX_QUIET_EN);
++ config1 |= sd_rise_time(7);
++ config2 &= ~(RG_DACQUIET_EN | RG_LDVQUIET_EN);
++ config3 |= fast_snr(511);
++ }
++
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_CR, ocp_data);
++ ocp_reg_write(tp, OCP_EEE_CONFIG1, config1);
++ ocp_reg_write(tp, OCP_EEE_CONFIG2, config2);
++ ocp_reg_write(tp, OCP_EEE_CONFIG3, config3);
++}
++
++static void r8152b_enable_eee(struct r8152 *tp)
++{
++ r8152_eee_en(tp, true);
++ r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, MDIO_EEE_100TX);
++}
++
++static void r8153_eee_en(struct r8152 *tp, bool enable)
++{
++ u32 ocp_data;
++ u16 config;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR);
++ config = ocp_reg_read(tp, OCP_EEE_CFG);
++
++ if (enable) {
++ ocp_data |= EEE_RX_EN | EEE_TX_EN;
++ config |= EEE10_EN;
++ } else {
++ ocp_data &= ~(EEE_RX_EN | EEE_TX_EN);
++ config &= ~EEE10_EN;
++ }
++
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_CR, ocp_data);
++ ocp_reg_write(tp, OCP_EEE_CFG, config);
++}
++
++static void r8153_enable_eee(struct r8152 *tp)
++{
++ r8153_eee_en(tp, true);
++ ocp_reg_write(tp, OCP_EEE_ADV, MDIO_EEE_1000T | MDIO_EEE_100TX);
++}
++
++static void r8152b_enable_fc(struct r8152 *tp)
++{
++ u16 anar;
++
++ anar = r8152_mdio_read(tp, MII_ADVERTISE);
++ anar |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
++ r8152_mdio_write(tp, MII_ADVERTISE, anar);
++}
++
++static void rtl_tally_reset(struct r8152 *tp)
++{
++ u32 ocp_data;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY);
++ ocp_data |= TALLY_RESET;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
++}
++
++static void r8152b_init(struct r8152 *tp)
++{
++ u32 ocp_data;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ r8152b_disable_aldps(tp);
++
++ if (tp->version == RTL_VER_01) {
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE);
++ ocp_data &= ~LED_MODE_MASK;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE, ocp_data);
++ }
++
++ r8152_power_cut_en(tp, false);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR);
++ ocp_data |= TX_10M_IDLE_EN | PFM_PWM_SWITCH;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR, ocp_data);
++ ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL);
++ ocp_data &= ~MCU_CLK_RATIO_MASK;
++ ocp_data |= MCU_CLK_RATIO | D3_CLK_GATED_EN;
++ ocp_write_dword(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, ocp_data);
++ ocp_data = GPHY_STS_MSK | SPEED_DOWN_MSK |
++ SPDWN_RXDV_MSK | SPDWN_LINKCHG_MSK;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_GPHY_INTR_IMR, ocp_data);
++
++ r8152b_enable_eee(tp);
++ r8152b_enable_aldps(tp);
++ r8152b_enable_fc(tp);
++ rtl_tally_reset(tp);
++
++ /* enable rx aggregation */
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
++ ocp_data &= ~RX_AGG_DISABLE;
++ ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
++}
++
++static void r8153_init(struct r8152 *tp)
++{
++ u32 ocp_data;
++ int i;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ r8153_disable_aldps(tp);
++ r8153_u1u2en(tp, false);
++
++ for (i = 0; i < 500; i++) {
++ if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) &
++ AUTOLOAD_DONE)
++ break;
++ msleep(20);
++ }
++
++ for (i = 0; i < 500; i++) {
++ ocp_data = ocp_reg_read(tp, OCP_PHY_STATUS) & PHY_STAT_MASK;
++ if (ocp_data == PHY_STAT_LAN_ON || ocp_data == PHY_STAT_PWRDN)
++ break;
++ msleep(20);
++ }
++
++ r8153_u2p3en(tp, false);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_WDT11_CTRL);
++ ocp_data &= ~TIMER11_EN;
++ ocp_write_word(tp, MCU_TYPE_USB, USB_WDT11_CTRL, ocp_data);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE);
++ ocp_data &= ~LED_MODE_MASK;
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE, ocp_data);
++
++ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_LPM_CTRL);
++ ocp_data &= ~LPM_TIMER_MASK;
++ if (tp->udev->speed == USB_SPEED_SUPER)
++ ocp_data |= LPM_TIMER_500US;
++ else
++ ocp_data |= LPM_TIMER_500MS;
++ ocp_write_byte(tp, MCU_TYPE_USB, USB_LPM_CTRL, ocp_data);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_AFE_CTRL2);
++ ocp_data &= ~SEN_VAL_MASK;
++ ocp_data |= SEN_VAL_NORMAL | SEL_RXIDLE;
++ ocp_write_word(tp, MCU_TYPE_USB, USB_AFE_CTRL2, ocp_data);
++
++ r8153_power_cut_en(tp, false);
++ r8153_u1u2en(tp, true);
++
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, ALDPS_SPDWN_RATIO);
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, EEE_SPDWN_RATIO);
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3,
++ PKT_AVAIL_SPDWN_EN | SUSPEND_SPDWN_EN |
++ U1U2_SPDWN_EN | L1_SPDWN_EN);
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4,
++ PWRSAVE_SPDWN_EN | RXDV_SPDWN_EN | TX10MIDLE_EN |
++ TP100_SPDWN_EN | TP500_SPDWN_EN | TP1000_SPDWN_EN |
++ EEE_SPDWN_EN);
++
++ r8153_enable_eee(tp);
++ r8153_enable_aldps(tp);
++ r8152b_enable_fc(tp);
++ rtl_tally_reset(tp);
++}
++
++static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
++{
++ struct r8152 *tp = usb_get_intfdata(intf);
++ struct net_device *netdev = tp->netdev;
++ int ret = 0;
++
++ mutex_lock(&tp->control);
++
++ if (PMSG_IS_AUTO(message)) {
++ if (netif_running(netdev) && work_busy(&tp->schedule.work)) {
++ ret = -EBUSY;
++ goto out1;
++ }
++
++ set_bit(SELECTIVE_SUSPEND, &tp->flags);
++ } else {
++ netif_device_detach(netdev);
++ }
++
++ if (netif_running(netdev) && test_bit(WORK_ENABLE, &tp->flags)) {
++ clear_bit(WORK_ENABLE, &tp->flags);
++ usb_kill_urb(tp->intr_urb);
++ tasklet_disable(&tp->tl);
++ if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
++ rtl_stop_rx(tp);
++ rtl_runtime_suspend_enable(tp, true);
++ } else {
++ cancel_delayed_work_sync(&tp->schedule);
++ tp->rtl_ops.down(tp);
++ }
++ tasklet_enable(&tp->tl);
++ }
++out1:
++ mutex_unlock(&tp->control);
++
++ return ret;
++}
++
++static int rtl8152_resume(struct usb_interface *intf)
++{
++ struct r8152 *tp = usb_get_intfdata(intf);
++
++ mutex_lock(&tp->control);
++
++ if (!test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
++ tp->rtl_ops.init(tp);
++ netif_device_attach(tp->netdev);
++ }
++
++ if (netif_running(tp->netdev)) {
++ if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
++ rtl_runtime_suspend_enable(tp, false);
++ clear_bit(SELECTIVE_SUSPEND, &tp->flags);
++ set_bit(WORK_ENABLE, &tp->flags);
++ if (tp->speed & LINK_STATUS)
++ rtl_start_rx(tp);
++ } else {
++ tp->rtl_ops.up(tp);
++ rtl8152_set_speed(tp, AUTONEG_ENABLE,
++ tp->mii.supports_gmii ?
++ SPEED_1000 : SPEED_100,
++ DUPLEX_FULL);
++ tp->speed = 0;
++ netif_carrier_off(tp->netdev);
++ set_bit(WORK_ENABLE, &tp->flags);
++ }
++ usb_submit_urb(tp->intr_urb, GFP_KERNEL);
++ } else if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
++ clear_bit(SELECTIVE_SUSPEND, &tp->flags);
++ }
++
++ mutex_unlock(&tp->control);
++
++ return 0;
++}
++
++static void rtl8152_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
++{
++ struct r8152 *tp = netdev_priv(dev);
++
++ if (usb_autopm_get_interface(tp->intf) < 0)
++ return;
++
++ mutex_lock(&tp->control);
++
++ wol->supported = WAKE_ANY;
++ wol->wolopts = __rtl_get_wol(tp);
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++}
++
++static int rtl8152_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
++{
++ struct r8152 *tp = netdev_priv(dev);
++ int ret;
++
++ ret = usb_autopm_get_interface(tp->intf);
++ if (ret < 0)
++ goto out_set_wol;
++
++ mutex_lock(&tp->control);
++
++ __rtl_set_wol(tp, wol->wolopts);
++ tp->saved_wolopts = wol->wolopts & WAKE_ANY;
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++
++out_set_wol:
++ return ret;
++}
++
++static u32 rtl8152_get_msglevel(struct net_device *dev)
++{
++ struct r8152 *tp = netdev_priv(dev);
++
++ return tp->msg_enable;
++}
++
++static void rtl8152_set_msglevel(struct net_device *dev, u32 value)
++{
++ struct r8152 *tp = netdev_priv(dev);
++
++ tp->msg_enable = value;
++}
++
++static void rtl8152_get_drvinfo(struct net_device *netdev,
++ struct ethtool_drvinfo *info)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++
++ strlcpy(info->driver, MODULENAME, sizeof(info->driver));
++ strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
++ usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info));
++}
++
++static
++int rtl8152_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++ int ret;
++
++ if (!tp->mii.mdio_read)
++ return -EOPNOTSUPP;
++
++ ret = usb_autopm_get_interface(tp->intf);
++ if (ret < 0)
++ goto out;
++
++ mutex_lock(&tp->control);
++
++ ret = mii_ethtool_gset(&tp->mii, cmd);
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++
++out:
++ return ret;
++}
++
++static int rtl8152_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
++{
++ struct r8152 *tp = netdev_priv(dev);
++ int ret;
++
++ ret = usb_autopm_get_interface(tp->intf);
++ if (ret < 0)
++ goto out;
++
++ mutex_lock(&tp->control);
++
++ ret = rtl8152_set_speed(tp, cmd->autoneg, cmd->speed, cmd->duplex);
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++
++out:
++ return ret;
++}
++
++static const char rtl8152_gstrings[][ETH_GSTRING_LEN] = {
++ "tx_packets",
++ "rx_packets",
++ "tx_errors",
++ "rx_errors",
++ "rx_missed",
++ "align_errors",
++ "tx_single_collisions",
++ "tx_multi_collisions",
++ "rx_unicast",
++ "rx_broadcast",
++ "rx_multicast",
++ "tx_aborted",
++ "tx_underrun",
++};
++
++static int rtl8152_get_sset_count(struct net_device *dev, int sset)
++{
++ switch (sset) {
++ case ETH_SS_STATS:
++ return ARRAY_SIZE(rtl8152_gstrings);
++ default:
++ return -EOPNOTSUPP;
++ }
++}
++
++static void rtl8152_get_ethtool_stats(struct net_device *dev,
++ struct ethtool_stats *stats, u64 *data)
++{
++ struct r8152 *tp = netdev_priv(dev);
++ struct tally_counter tally;
++
++ if (usb_autopm_get_interface(tp->intf) < 0)
++ return;
++
++ generic_ocp_read(tp, PLA_TALLYCNT, sizeof(tally), &tally, MCU_TYPE_PLA);
++
++ usb_autopm_put_interface(tp->intf);
++
++ data[0] = le64_to_cpu(tally.tx_packets);
++ data[1] = le64_to_cpu(tally.rx_packets);
++ data[2] = le64_to_cpu(tally.tx_errors);
++ data[3] = le32_to_cpu(tally.rx_errors);
++ data[4] = le16_to_cpu(tally.rx_missed);
++ data[5] = le16_to_cpu(tally.align_errors);
++ data[6] = le32_to_cpu(tally.tx_one_collision);
++ data[7] = le32_to_cpu(tally.tx_multi_collision);
++ data[8] = le64_to_cpu(tally.rx_unicast);
++ data[9] = le64_to_cpu(tally.rx_broadcast);
++ data[10] = le32_to_cpu(tally.rx_multicast);
++ data[11] = le16_to_cpu(tally.tx_aborted);
++ data[12] = le16_to_cpu(tally.tx_underun);
++}
++
++static void rtl8152_get_strings(struct net_device *dev, u32 stringset, u8 *data)
++{
++ switch (stringset) {
++ case ETH_SS_STATS:
++ memcpy(data, *rtl8152_gstrings, sizeof(rtl8152_gstrings));
++ break;
++ }
++}
++
++static int r8152_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
++{
++ u32 ocp_data, lp, adv, supported = 0;
++ u16 val;
++
++ val = r8152_mmd_read(tp, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE);
++ supported = mmd_eee_cap_to_ethtool_sup_t(val);
++
++ val = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV);
++ adv = mmd_eee_adv_to_ethtool_adv_t(val);
++
++ val = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_LPABLE);
++ lp = mmd_eee_adv_to_ethtool_adv_t(val);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR);
++ ocp_data &= EEE_RX_EN | EEE_TX_EN;
++
++ eee->eee_enabled = !!ocp_data;
++ eee->eee_active = !!(supported & adv & lp);
++ eee->supported = supported;
++ eee->advertised = adv;
++ eee->lp_advertised = lp;
++
++ return 0;
++}
++
++static int r8152_set_eee(struct r8152 *tp, struct ethtool_eee *eee)
++{
++ u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised);
++
++ r8152_eee_en(tp, eee->eee_enabled);
++
++ if (!eee->eee_enabled)
++ val = 0;
++
++ r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val);
++
++ return 0;
++}
++
++static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
++{
++ u32 ocp_data, lp, adv, supported = 0;
++ u16 val;
++
++ val = ocp_reg_read(tp, OCP_EEE_ABLE);
++ supported = mmd_eee_cap_to_ethtool_sup_t(val);
++
++ val = ocp_reg_read(tp, OCP_EEE_ADV);
++ adv = mmd_eee_adv_to_ethtool_adv_t(val);
++
++ val = ocp_reg_read(tp, OCP_EEE_LPABLE);
++ lp = mmd_eee_adv_to_ethtool_adv_t(val);
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR);
++ ocp_data &= EEE_RX_EN | EEE_TX_EN;
++
++ eee->eee_enabled = !!ocp_data;
++ eee->eee_active = !!(supported & adv & lp);
++ eee->supported = supported;
++ eee->advertised = adv;
++ eee->lp_advertised = lp;
++
++ return 0;
++}
++
++static int r8153_set_eee(struct r8152 *tp, struct ethtool_eee *eee)
++{
++ u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised);
++
++ r8153_eee_en(tp, eee->eee_enabled);
++
++ if (!eee->eee_enabled)
++ val = 0;
++
++ ocp_reg_write(tp, OCP_EEE_ADV, val);
++
++ return 0;
++}
++
++static int
++rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata)
++{
++ struct r8152 *tp = netdev_priv(net);
++ int ret;
++
++ ret = usb_autopm_get_interface(tp->intf);
++ if (ret < 0)
++ goto out;
++
++ mutex_lock(&tp->control);
++
++ ret = tp->rtl_ops.eee_get(tp, edata);
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++
++out:
++ return ret;
++}
++
++static int
++rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata)
++{
++ struct r8152 *tp = netdev_priv(net);
++ int ret;
++
++ ret = usb_autopm_get_interface(tp->intf);
++ if (ret < 0)
++ goto out;
++
++ mutex_lock(&tp->control);
++
++ ret = tp->rtl_ops.eee_set(tp, edata);
++ if (!ret)
++ ret = mii_nway_restart(&tp->mii);
++
++ mutex_unlock(&tp->control);
++
++ usb_autopm_put_interface(tp->intf);
++
++out:
++ return ret;
++}
++
++static struct ethtool_ops ops = {
++ .get_drvinfo = rtl8152_get_drvinfo,
++ .get_settings = rtl8152_get_settings,
++ .set_settings = rtl8152_set_settings,
++ .get_link = ethtool_op_get_link,
++ .get_msglevel = rtl8152_get_msglevel,
++ .set_msglevel = rtl8152_set_msglevel,
++ .get_wol = rtl8152_get_wol,
++ .set_wol = rtl8152_set_wol,
++ .get_strings = rtl8152_get_strings,
++ .get_sset_count = rtl8152_get_sset_count,
++ .get_ethtool_stats = rtl8152_get_ethtool_stats,
++ .get_eee = rtl_ethtool_get_eee,
++ .set_eee = rtl_ethtool_set_eee,
++};
++
++static int rtl8152_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
++{
++ struct r8152 *tp = netdev_priv(netdev);
++ struct mii_ioctl_data *data = if_mii(rq);
++ int res;
++
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return -ENODEV;
++
++ res = usb_autopm_get_interface(tp->intf);
++ if (res < 0)
++ goto out;
++
++ switch (cmd) {
++ case SIOCGMIIPHY:
++ data->phy_id = R8152_PHY_ID; /* Internal PHY */
++ break;
++
++ case SIOCGMIIREG:
++ mutex_lock(&tp->control);
++ data->val_out = r8152_mdio_read(tp, data->reg_num);
++ mutex_unlock(&tp->control);
++ break;
++
++ case SIOCSMIIREG:
++ if (!capable(CAP_NET_ADMIN)) {
++ res = -EPERM;
++ break;
++ }
++ mutex_lock(&tp->control);
++ r8152_mdio_write(tp, data->reg_num, data->val_in);
++ mutex_unlock(&tp->control);
++ break;
++
++ default:
++ res = -EOPNOTSUPP;
++ }
++
++ usb_autopm_put_interface(tp->intf);
++
++out:
++ return res;
++}
++
++static int rtl8152_change_mtu(struct net_device *dev, int new_mtu)
++{
++ struct r8152 *tp = netdev_priv(dev);
++
++ switch (tp->version) {
++ case RTL_VER_01:
++ case RTL_VER_02:
++ return eth_change_mtu(dev, new_mtu);
++ default:
++ break;
++ }
++
++ if (new_mtu < 68 || new_mtu > RTL8153_MAX_MTU)
++ return -EINVAL;
++
++ dev->mtu = new_mtu;
++
++ return 0;
++}
++
++static const struct net_device_ops rtl8152_netdev_ops = {
++ .ndo_open = rtl8152_open,
++ .ndo_stop = rtl8152_close,
++ .ndo_do_ioctl = rtl8152_ioctl,
++ .ndo_start_xmit = rtl8152_start_xmit,
++ .ndo_tx_timeout = rtl8152_tx_timeout,
++ .ndo_set_features = rtl8152_set_features,
++ .ndo_set_rx_mode = rtl8152_set_rx_mode,
++ .ndo_set_mac_address = rtl8152_set_mac_address,
++ .ndo_change_mtu = rtl8152_change_mtu,
++ .ndo_validate_addr = eth_validate_addr,
++};
++
++static void r8152b_get_version(struct r8152 *tp)
++{
++ u32 ocp_data;
++ u16 version;
++
++ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR1);
++ version = (u16)(ocp_data & VERSION_MASK);
++
++ switch (version) {
++ case 0x4c00:
++ tp->version = RTL_VER_01;
++ break;
++ case 0x4c10:
++ tp->version = RTL_VER_02;
++ break;
++ case 0x5c00:
++ tp->version = RTL_VER_03;
++ tp->mii.supports_gmii = 1;
++ break;
++ case 0x5c10:
++ tp->version = RTL_VER_04;
++ tp->mii.supports_gmii = 1;
++ break;
++ case 0x5c20:
++ tp->version = RTL_VER_05;
++ tp->mii.supports_gmii = 1;
++ break;
++ default:
++ netif_info(tp, probe, tp->netdev,
++ "Unknown version 0x%04x\n", version);
++ break;
++ }
++}
++
++static void rtl8152_unload(struct r8152 *tp)
++{
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ if (tp->version != RTL_VER_01)
++ r8152_power_cut_en(tp, true);
++}
++
++static void rtl8153_unload(struct r8152 *tp)
++{
++ if (test_bit(RTL8152_UNPLUG, &tp->flags))
++ return;
++
++ r8153_power_cut_en(tp, false);
++}
++
++static int rtl_ops_init(struct r8152 *tp, const struct usb_device_id *id)
++{
++ struct rtl_ops *ops = &tp->rtl_ops;
++ int ret = -ENODEV;
++
++ switch (id->idVendor) {
++ case VENDOR_ID_REALTEK:
++ switch (id->idProduct) {
++ case PRODUCT_ID_RTL8152:
++ ops->init = r8152b_init;
++ ops->enable = rtl8152_enable;
++ ops->disable = rtl8152_disable;
++ ops->up = rtl8152_up;
++ ops->down = rtl8152_down;
++ ops->unload = rtl8152_unload;
++ ops->eee_get = r8152_get_eee;
++ ops->eee_set = r8152_set_eee;
++ ret = 0;
++ break;
++ case PRODUCT_ID_RTL8153:
++ ops->init = r8153_init;
++ ops->enable = rtl8153_enable;
++ ops->disable = rtl8153_disable;
++ ops->up = rtl8153_up;
++ ops->down = rtl8153_down;
++ ops->unload = rtl8153_unload;
++ ops->eee_get = r8153_get_eee;
++ ops->eee_set = r8153_set_eee;
++ ret = 0;
++ break;
++ default:
++ break;
++ }
++ break;
++
++ case VENDOR_ID_SAMSUNG:
++ switch (id->idProduct) {
++ case PRODUCT_ID_SAMSUNG:
++ ops->init = r8153_init;
++ ops->enable = rtl8153_enable;
++ ops->disable = rtl8153_disable;
++ ops->up = rtl8153_up;
++ ops->down = rtl8153_down;
++ ops->unload = rtl8153_unload;
++ ops->eee_get = r8153_get_eee;
++ ops->eee_set = r8153_set_eee;
++ ret = 0;
++ break;
++ default:
++ break;
++ }
++ break;
++
++ default:
++ break;
++ }
++
++ if (ret)
++ netif_err(tp, probe, tp->netdev, "Unknown Device\n");
++
++ return ret;
++}
++
++static int rtl8152_probe(struct usb_interface *intf,
++ const struct usb_device_id *id)
++{
++ struct usb_device *udev = interface_to_usbdev(intf);
++ struct r8152 *tp;
++ struct net_device *netdev;
++ int ret;
++
++ if (udev->actconfig->desc.bConfigurationValue != 1) {
++ usb_driver_set_configuration(udev, 1);
++ return -ENODEV;
++ }
++
++ usb_reset_device(udev);
++ netdev = alloc_etherdev(sizeof(struct r8152));
++ if (!netdev) {
++ dev_err(&intf->dev, "Out of memory\n");
++ return -ENOMEM;
++ }
++
++ SET_NETDEV_DEV(netdev, &intf->dev);
++ tp = netdev_priv(netdev);
++ tp->msg_enable = 0x7FFF;
++
++ tp->udev = udev;
++ tp->netdev = netdev;
++ tp->intf = intf;
++
++ ret = rtl_ops_init(tp, id);
++ if (ret)
++ goto out;
++
++ tasklet_init(&tp->tl, bottom_half, (unsigned long)tp);
++ mutex_init(&tp->control);
++ INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);
++
++ netdev->netdev_ops = &rtl8152_netdev_ops;
++ netdev->watchdog_timeo = RTL8152_TX_TIMEOUT;
++
++ netdev->features |= NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_SG |
++ NETIF_F_TSO | NETIF_F_FRAGLIST | NETIF_F_IPV6_CSUM |
++ NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_RX |
++ NETIF_F_HW_VLAN_CTAG_TX;
++ netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_SG |
++ NETIF_F_TSO | NETIF_F_FRAGLIST |
++ NETIF_F_IPV6_CSUM | NETIF_F_TSO6 |
++ NETIF_F_HW_VLAN_CTAG_RX |
++ NETIF_F_HW_VLAN_CTAG_TX;
++ netdev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
++ NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
++ NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
++
++ netdev->ethtool_ops = &ops;
++ netif_set_gso_max_size(netdev, RTL_LIMITED_TSO_SIZE);
++
++ tp->mii.dev = netdev;
++ tp->mii.mdio_read = read_mii_word;
++ tp->mii.mdio_write = write_mii_word;
++ tp->mii.phy_id_mask = 0x3f;
++ tp->mii.reg_num_mask = 0x1f;
++ tp->mii.phy_id = R8152_PHY_ID;
++ tp->mii.supports_gmii = 0;
++
++ intf->needs_remote_wakeup = 1;
++
++ r8152b_get_version(tp);
++ tp->rtl_ops.init(tp);
++ set_ethernet_addr(tp);
++
++ usb_set_intfdata(intf, tp);
++
++ ret = register_netdev(netdev);
++ if (ret != 0) {
++ netif_err(tp, probe, netdev, "couldn't register the device\n");
++ goto out1;
++ }
++
++ tp->saved_wolopts = __rtl_get_wol(tp);
++ if (tp->saved_wolopts)
++ device_set_wakeup_enable(&udev->dev, true);
++ else
++ device_set_wakeup_enable(&udev->dev, false);
++
++ netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION);
++
++ return 0;
++
++out1:
++ usb_set_intfdata(intf, NULL);
++out:
++ free_netdev(netdev);
++ return ret;
++}
++
++static void rtl8152_disconnect(struct usb_interface *intf)
++{
++ struct r8152 *tp = usb_get_intfdata(intf);
++
++ usb_set_intfdata(intf, NULL);
++ if (tp) {
++ struct usb_device *udev = tp->udev;
++
++ if (udev->state == USB_STATE_NOTATTACHED)
++ set_bit(RTL8152_UNPLUG, &tp->flags);
++
++ tasklet_kill(&tp->tl);
++ unregister_netdev(tp->netdev);
++ tp->rtl_ops.unload(tp);
++ free_netdev(tp->netdev);
++ }
++}
++
++/* table of devices that work with this driver */
++static struct usb_device_id rtl8152_table[] = {
++ {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)},
++ {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)},
++ {USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)},
++ {}
++};
++
++MODULE_DEVICE_TABLE(usb, rtl8152_table);
++
++static struct usb_driver rtl8152_driver = {
++ .name = MODULENAME,
++ .id_table = rtl8152_table,
++ .probe = rtl8152_probe,
++ .disconnect = rtl8152_disconnect,
++ .suspend = rtl8152_suspend,
++ .resume = rtl8152_resume,
++ .reset_resume = rtl8152_resume,
++ .supports_autosuspend = 1,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(rtl8152_driver);
++
++MODULE_AUTHOR(DRIVER_AUTHOR);
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/rtl8150.c backports-3.18.1-1/drivers/net/usb/rtl8150.c
+--- backports-3.18.1-1.org/drivers/net/usb/rtl8150.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/rtl8150.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,950 @@
++/*
++ * Copyright (c) 2002 Petko Manolov (petkan@users.sourceforge.net)
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * version 2 as published by the Free Software Foundation.
++ */
++
++#include <linux/signal.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/mii.h>
++#include <linux/ethtool.h>
++#include <linux/usb.h>
++#include <asm/uaccess.h>
++
++/* Version Information */
++#define DRIVER_VERSION "v0.6.2 (2004/08/27)"
++#define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>"
++#define DRIVER_DESC "rtl8150 based usb-ethernet driver"
++
++#define IDR 0x0120
++#define MAR 0x0126
++#define CR 0x012e
++#define TCR 0x012f
++#define RCR 0x0130
++#define TSR 0x0132
++#define RSR 0x0133
++#define CON0 0x0135
++#define CON1 0x0136
++#define MSR 0x0137
++#define PHYADD 0x0138
++#define PHYDAT 0x0139
++#define PHYCNT 0x013b
++#define GPPC 0x013d
++#define BMCR 0x0140
++#define BMSR 0x0142
++#define ANAR 0x0144
++#define ANLP 0x0146
++#define AER 0x0148
++#define CSCR 0x014C /* This one has the link status */
++#define CSCR_LINK_STATUS (1 << 3)
++
++#define IDR_EEPROM 0x1202
++
++#define PHY_READ 0
++#define PHY_WRITE 0x20
++#define PHY_GO 0x40
++
++#define MII_TIMEOUT 10
++#define INTBUFSIZE 8
++
++#define RTL8150_REQT_READ 0xc0
++#define RTL8150_REQT_WRITE 0x40
++#define RTL8150_REQ_GET_REGS 0x05
++#define RTL8150_REQ_SET_REGS 0x05
++
++
++/* Transmit status register errors */
++#define TSR_ECOL (1<<5)
++#define TSR_LCOL (1<<4)
++#define TSR_LOSS_CRS (1<<3)
++#define TSR_JBR (1<<2)
++#define TSR_ERRORS (TSR_ECOL | TSR_LCOL | TSR_LOSS_CRS | TSR_JBR)
++/* Receive status register errors */
++#define RSR_CRC (1<<2)
++#define RSR_FAE (1<<1)
++#define RSR_ERRORS (RSR_CRC | RSR_FAE)
++
++/* Media status register definitions */
++#define MSR_DUPLEX (1<<4)
++#define MSR_SPEED (1<<3)
++#define MSR_LINK (1<<2)
++
++/* Interrupt pipe data */
++#define INT_TSR 0x00
++#define INT_RSR 0x01
++#define INT_MSR 0x02
++#define INT_WAKSR 0x03
++#define INT_TXOK_CNT 0x04
++#define INT_RXLOST_CNT 0x05
++#define INT_CRERR_CNT 0x06
++#define INT_COL_CNT 0x07
++
++
++#define RTL8150_MTU 1540
++#define RTL8150_TX_TIMEOUT (HZ)
++#define RX_SKB_POOL_SIZE 4
++
++/* rtl8150 flags */
++#define RTL8150_HW_CRC 0
++#define RX_REG_SET 1
++#define RTL8150_UNPLUG 2
++#define RX_URB_FAIL 3
++
++/* Define these values to match your device */
++#define VENDOR_ID_REALTEK 0x0bda
++#define VENDOR_ID_MELCO 0x0411
++#define VENDOR_ID_MICRONET 0x3980
++#define VENDOR_ID_LONGSHINE 0x07b8
++#define VENDOR_ID_OQO 0x1557
++#define VENDOR_ID_ZYXEL 0x0586
++
++#define PRODUCT_ID_RTL8150 0x8150
++#define PRODUCT_ID_LUAKTX 0x0012
++#define PRODUCT_ID_LCS8138TX 0x401a
++#define PRODUCT_ID_SP128AR 0x0003
++#define PRODUCT_ID_PRESTIGE 0x401a
++
++#undef EEPROM_WRITE
++
++/* table of devices that work with this driver */
++static struct usb_device_id rtl8150_table[] = {
++ {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8150)},
++ {USB_DEVICE(VENDOR_ID_MELCO, PRODUCT_ID_LUAKTX)},
++ {USB_DEVICE(VENDOR_ID_MICRONET, PRODUCT_ID_SP128AR)},
++ {USB_DEVICE(VENDOR_ID_LONGSHINE, PRODUCT_ID_LCS8138TX)},
++ {USB_DEVICE(VENDOR_ID_OQO, PRODUCT_ID_RTL8150)},
++ {USB_DEVICE(VENDOR_ID_ZYXEL, PRODUCT_ID_PRESTIGE)},
++ {}
++};
++
++MODULE_DEVICE_TABLE(usb, rtl8150_table);
++
++struct rtl8150 {
++ unsigned long flags;
++ struct usb_device *udev;
++ struct tasklet_struct tl;
++ struct net_device *netdev;
++ struct urb *rx_urb, *tx_urb, *intr_urb;
++ struct sk_buff *tx_skb, *rx_skb;
++ struct sk_buff *rx_skb_pool[RX_SKB_POOL_SIZE];
++ spinlock_t rx_pool_lock;
++ struct usb_ctrlrequest dr;
++ int intr_interval;
++ u8 *intr_buff;
++ u8 phy;
++};
++
++typedef struct rtl8150 rtl8150_t;
++
++struct async_req {
++ struct usb_ctrlrequest dr;
++ u16 rx_creg;
++};
++
++static const char driver_name [] = "rtl8150";
++
++/*
++**
++** device related part of the code
++**
++*/
++static int get_registers(rtl8150_t * dev, u16 indx, u16 size, void *data)
++{
++ return usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
++ RTL8150_REQ_GET_REGS, RTL8150_REQT_READ,
++ indx, 0, data, size, 500);
++}
++
++static int set_registers(rtl8150_t * dev, u16 indx, u16 size, void *data)
++{
++ return usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
++ RTL8150_REQ_SET_REGS, RTL8150_REQT_WRITE,
++ indx, 0, data, size, 500);
++}
++
++static void async_set_reg_cb(struct urb *urb)
++{
++ struct async_req *req = (struct async_req *)urb->context;
++ int status = urb->status;
++
++ if (status < 0)
++ dev_dbg(&urb->dev->dev, "%s failed with %d", __func__, status);
++ kfree(req);
++ usb_free_urb(urb);
++}
++
++static int async_set_registers(rtl8150_t *dev, u16 indx, u16 size, u16 reg)
++{
++ int res = -ENOMEM;
++ struct urb *async_urb;
++ struct async_req *req;
++
++ req = kmalloc(sizeof(struct async_req), GFP_ATOMIC);
++ if (req == NULL)
++ return res;
++ async_urb = usb_alloc_urb(0, GFP_ATOMIC);
++ if (async_urb == NULL) {
++ kfree(req);
++ return res;
++ }
++ req->rx_creg = cpu_to_le16(reg);
++ req->dr.bRequestType = RTL8150_REQT_WRITE;
++ req->dr.bRequest = RTL8150_REQ_SET_REGS;
++ req->dr.wIndex = 0;
++ req->dr.wValue = cpu_to_le16(indx);
++ req->dr.wLength = cpu_to_le16(size);
++ usb_fill_control_urb(async_urb, dev->udev,
++ usb_sndctrlpipe(dev->udev, 0), (void *)&req->dr,
++ &req->rx_creg, size, async_set_reg_cb, req);
++ res = usb_submit_urb(async_urb, GFP_ATOMIC);
++ if (res) {
++ if (res == -ENODEV)
++ netif_device_detach(dev->netdev);
++ dev_err(&dev->udev->dev, "%s failed with %d\n", __func__, res);
++ }
++ return res;
++}
++
++static int read_mii_word(rtl8150_t * dev, u8 phy, __u8 indx, u16 * reg)
++{
++ int i;
++ u8 data[3], tmp;
++
++ data[0] = phy;
++ data[1] = data[2] = 0;
++ tmp = indx | PHY_READ | PHY_GO;
++ i = 0;
++
++ set_registers(dev, PHYADD, sizeof(data), data);
++ set_registers(dev, PHYCNT, 1, &tmp);
++ do {
++ get_registers(dev, PHYCNT, 1, data);
++ } while ((data[0] & PHY_GO) && (i++ < MII_TIMEOUT));
++
++ if (i <= MII_TIMEOUT) {
++ get_registers(dev, PHYDAT, 2, data);
++ *reg = data[0] | (data[1] << 8);
++ return 0;
++ } else
++ return 1;
++}
++
++static int write_mii_word(rtl8150_t * dev, u8 phy, __u8 indx, u16 reg)
++{
++ int i;
++ u8 data[3], tmp;
++
++ data[0] = phy;
++ data[1] = reg & 0xff;
++ data[2] = (reg >> 8) & 0xff;
++ tmp = indx | PHY_WRITE | PHY_GO;
++ i = 0;
++
++ set_registers(dev, PHYADD, sizeof(data), data);
++ set_registers(dev, PHYCNT, 1, &tmp);
++ do {
++ get_registers(dev, PHYCNT, 1, data);
++ } while ((data[0] & PHY_GO) && (i++ < MII_TIMEOUT));
++
++ if (i <= MII_TIMEOUT)
++ return 0;
++ else
++ return 1;
++}
++
++static inline void set_ethernet_addr(rtl8150_t * dev)
++{
++ u8 node_id[6];
++
++ get_registers(dev, IDR, sizeof(node_id), node_id);
++ memcpy(dev->netdev->dev_addr, node_id, sizeof(node_id));
++}
++
++static int rtl8150_set_mac_address(struct net_device *netdev, void *p)
++{
++ struct sockaddr *addr = p;
++ rtl8150_t *dev = netdev_priv(netdev);
++
++ if (netif_running(netdev))
++ return -EBUSY;
++
++ memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
++ netdev_dbg(netdev, "Setting MAC address to %pM\n", netdev->dev_addr);
++ /* Set the IDR registers. */
++ set_registers(dev, IDR, netdev->addr_len, netdev->dev_addr);
++#ifdef EEPROM_WRITE
++ {
++ int i;
++ u8 cr;
++ /* Get the CR contents. */
++ get_registers(dev, CR, 1, &cr);
++ /* Set the WEPROM bit (eeprom write enable). */
++ cr |= 0x20;
++ set_registers(dev, CR, 1, &cr);
++ /* Write the MAC address into eeprom. Eeprom writes must be word-sized,
++ so we need to split them up. */
++ for (i = 0; i * 2 < netdev->addr_len; i++) {
++ set_registers(dev, IDR_EEPROM + (i * 2), 2,
++ netdev->dev_addr + (i * 2));
++ }
++ /* Clear the WEPROM bit (preventing accidental eeprom writes). */
++ cr &= 0xdf;
++ set_registers(dev, CR, 1, &cr);
++ }
++#endif
++ return 0;
++}
++
++static int rtl8150_reset(rtl8150_t * dev)
++{
++ u8 data = 0x10;
++ int i = HZ;
++
++ set_registers(dev, CR, 1, &data);
++ do {
++ get_registers(dev, CR, 1, &data);
++ } while ((data & 0x10) && --i);
++
++ return (i > 0) ? 1 : 0;
++}
++
++static int alloc_all_urbs(rtl8150_t * dev)
++{
++ dev->rx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!dev->rx_urb)
++ return 0;
++ dev->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!dev->tx_urb) {
++ usb_free_urb(dev->rx_urb);
++ return 0;
++ }
++ dev->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
++ if (!dev->intr_urb) {
++ usb_free_urb(dev->rx_urb);
++ usb_free_urb(dev->tx_urb);
++ return 0;
++ }
++
++ return 1;
++}
++
++static void free_all_urbs(rtl8150_t * dev)
++{
++ usb_free_urb(dev->rx_urb);
++ usb_free_urb(dev->tx_urb);
++ usb_free_urb(dev->intr_urb);
++}
++
++static void unlink_all_urbs(rtl8150_t * dev)
++{
++ usb_kill_urb(dev->rx_urb);
++ usb_kill_urb(dev->tx_urb);
++ usb_kill_urb(dev->intr_urb);
++}
++
++static inline struct sk_buff *pull_skb(rtl8150_t *dev)
++{
++ struct sk_buff *skb;
++ int i;
++
++ for (i = 0; i < RX_SKB_POOL_SIZE; i++) {
++ if (dev->rx_skb_pool[i]) {
++ skb = dev->rx_skb_pool[i];
++ dev->rx_skb_pool[i] = NULL;
++ return skb;
++ }
++ }
++ return NULL;
++}
++
++static void read_bulk_callback(struct urb *urb)
++{
++ rtl8150_t *dev;
++ unsigned pkt_len, res;
++ struct sk_buff *skb;
++ struct net_device *netdev;
++ u16 rx_stat;
++ int status = urb->status;
++ int result;
++
++ dev = urb->context;
++ if (!dev)
++ return;
++ if (test_bit(RTL8150_UNPLUG, &dev->flags))
++ return;
++ netdev = dev->netdev;
++ if (!netif_device_present(netdev))
++ return;
++
++ switch (status) {
++ case 0:
++ break;
++ case -ENOENT:
++ return; /* the urb is in unlink state */
++ case -ETIME:
++ if (printk_ratelimit())
++ dev_warn(&urb->dev->dev, "may be reset is needed?..\n");
++ goto goon;
++ default:
++ if (printk_ratelimit())
++ dev_warn(&urb->dev->dev, "Rx status %d\n", status);
++ goto goon;
++ }
++
++ if (!dev->rx_skb)
++ goto resched;
++ /* protect against short packets (tell me why we got some?!?) */
++ if (urb->actual_length < 4)
++ goto goon;
++
++ res = urb->actual_length;
++ rx_stat = le16_to_cpu(*(__le16 *)(urb->transfer_buffer + res - 4));
++ pkt_len = res - 4;
++
++ skb_put(dev->rx_skb, pkt_len);
++ dev->rx_skb->protocol = eth_type_trans(dev->rx_skb, netdev);
++ netif_rx(dev->rx_skb);
++ netdev->stats.rx_packets++;
++ netdev->stats.rx_bytes += pkt_len;
++
++ spin_lock(&dev->rx_pool_lock);
++ skb = pull_skb(dev);
++ spin_unlock(&dev->rx_pool_lock);
++ if (!skb)
++ goto resched;
++
++ dev->rx_skb = skb;
++goon:
++ usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
++ dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
++ result = usb_submit_urb(dev->rx_urb, GFP_ATOMIC);
++ if (result == -ENODEV)
++ netif_device_detach(dev->netdev);
++ else if (result) {
++ set_bit(RX_URB_FAIL, &dev->flags);
++ goto resched;
++ } else {
++ clear_bit(RX_URB_FAIL, &dev->flags);
++ }
++
++ return;
++resched:
++ tasklet_schedule(&dev->tl);
++}
++
++static void write_bulk_callback(struct urb *urb)
++{
++ rtl8150_t *dev;
++ int status = urb->status;
++
++ dev = urb->context;
++ if (!dev)
++ return;
++ dev_kfree_skb_irq(dev->tx_skb);
++ if (!netif_device_present(dev->netdev))
++ return;
++ if (status)
++ dev_info(&urb->dev->dev, "%s: Tx status %d\n",
++ dev->netdev->name, status);
++ dev->netdev->trans_start = jiffies;
++ netif_wake_queue(dev->netdev);
++}
++
++static void intr_callback(struct urb *urb)
++{
++ rtl8150_t *dev;
++ __u8 *d;
++ int status = urb->status;
++ int res;
++
++ dev = urb->context;
++ if (!dev)
++ return;
++ switch (status) {
++ case 0: /* success */
++ break;
++ case -ECONNRESET: /* unlink */
++ case -ENOENT:
++ case -ESHUTDOWN:
++ return;
++ /* -EPIPE: should clear the halt */
++ default:
++ dev_info(&urb->dev->dev, "%s: intr status %d\n",
++ dev->netdev->name, status);
++ goto resubmit;
++ }
++
++ d = urb->transfer_buffer;
++ if (d[0] & TSR_ERRORS) {
++ dev->netdev->stats.tx_errors++;
++ if (d[INT_TSR] & (TSR_ECOL | TSR_JBR))
++ dev->netdev->stats.tx_aborted_errors++;
++ if (d[INT_TSR] & TSR_LCOL)
++ dev->netdev->stats.tx_window_errors++;
++ if (d[INT_TSR] & TSR_LOSS_CRS)
++ dev->netdev->stats.tx_carrier_errors++;
++ }
++ /* Report link status changes to the network stack */
++ if ((d[INT_MSR] & MSR_LINK) == 0) {
++ if (netif_carrier_ok(dev->netdev)) {
++ netif_carrier_off(dev->netdev);
++ netdev_dbg(dev->netdev, "%s: LINK LOST\n", __func__);
++ }
++ } else {
++ if (!netif_carrier_ok(dev->netdev)) {
++ netif_carrier_on(dev->netdev);
++ netdev_dbg(dev->netdev, "%s: LINK CAME BACK\n", __func__);
++ }
++ }
++
++resubmit:
++ res = usb_submit_urb (urb, GFP_ATOMIC);
++ if (res == -ENODEV)
++ netif_device_detach(dev->netdev);
++ else if (res)
++ dev_err(&dev->udev->dev,
++ "can't resubmit intr, %s-%s/input0, status %d\n",
++ dev->udev->bus->bus_name, dev->udev->devpath, res);
++}
++
++static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message)
++{
++ rtl8150_t *dev = usb_get_intfdata(intf);
++
++ netif_device_detach(dev->netdev);
++
++ if (netif_running(dev->netdev)) {
++ usb_kill_urb(dev->rx_urb);
++ usb_kill_urb(dev->intr_urb);
++ }
++ return 0;
++}
++
++static int rtl8150_resume(struct usb_interface *intf)
++{
++ rtl8150_t *dev = usb_get_intfdata(intf);
++
++ netif_device_attach(dev->netdev);
++ if (netif_running(dev->netdev)) {
++ dev->rx_urb->status = 0;
++ dev->rx_urb->actual_length = 0;
++ read_bulk_callback(dev->rx_urb);
++
++ dev->intr_urb->status = 0;
++ dev->intr_urb->actual_length = 0;
++ intr_callback(dev->intr_urb);
++ }
++ return 0;
++}
++
++/*
++**
++** network related part of the code
++**
++*/
++
++static void fill_skb_pool(rtl8150_t *dev)
++{
++ struct sk_buff *skb;
++ int i;
++
++ for (i = 0; i < RX_SKB_POOL_SIZE; i++) {
++ if (dev->rx_skb_pool[i])
++ continue;
++ skb = dev_alloc_skb(RTL8150_MTU + 2);
++ if (!skb) {
++ return;
++ }
++ skb_reserve(skb, 2);
++ dev->rx_skb_pool[i] = skb;
++ }
++}
++
++static void free_skb_pool(rtl8150_t *dev)
++{
++ int i;
++
++ for (i = 0; i < RX_SKB_POOL_SIZE; i++)
++ if (dev->rx_skb_pool[i])
++ dev_kfree_skb(dev->rx_skb_pool[i]);
++}
++
++static void rx_fixup(unsigned long data)
++{
++ struct rtl8150 *dev = (struct rtl8150 *)data;
++ struct sk_buff *skb;
++ int status;
++
++ spin_lock_irq(&dev->rx_pool_lock);
++ fill_skb_pool(dev);
++ spin_unlock_irq(&dev->rx_pool_lock);
++ if (test_bit(RX_URB_FAIL, &dev->flags))
++ if (dev->rx_skb)
++ goto try_again;
++ spin_lock_irq(&dev->rx_pool_lock);
++ skb = pull_skb(dev);
++ spin_unlock_irq(&dev->rx_pool_lock);
++ if (skb == NULL)
++ goto tlsched;
++ dev->rx_skb = skb;
++ usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
++ dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
++try_again:
++ status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC);
++ if (status == -ENODEV) {
++ netif_device_detach(dev->netdev);
++ } else if (status) {
++ set_bit(RX_URB_FAIL, &dev->flags);
++ goto tlsched;
++ } else {
++ clear_bit(RX_URB_FAIL, &dev->flags);
++ }
++
++ return;
++tlsched:
++ tasklet_schedule(&dev->tl);
++}
++
++static int enable_net_traffic(rtl8150_t * dev)
++{
++ u8 cr, tcr, rcr, msr;
++
++ if (!rtl8150_reset(dev)) {
++ dev_warn(&dev->udev->dev, "device reset failed\n");
++ }
++ /* RCR bit7=1 attach Rx info at the end; =0 HW CRC (which is broken) */
++ rcr = 0x9e;
++ tcr = 0xd8;
++ cr = 0x0c;
++ if (!(rcr & 0x80))
++ set_bit(RTL8150_HW_CRC, &dev->flags);
++ set_registers(dev, RCR, 1, &rcr);
++ set_registers(dev, TCR, 1, &tcr);
++ set_registers(dev, CR, 1, &cr);
++ get_registers(dev, MSR, 1, &msr);
++
++ return 0;
++}
++
++static void disable_net_traffic(rtl8150_t * dev)
++{
++ u8 cr;
++
++ get_registers(dev, CR, 1, &cr);
++ cr &= 0xf3;
++ set_registers(dev, CR, 1, &cr);
++}
++
++static void rtl8150_tx_timeout(struct net_device *netdev)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++ dev_warn(&netdev->dev, "Tx timeout.\n");
++ usb_unlink_urb(dev->tx_urb);
++ netdev->stats.tx_errors++;
++}
++
++static void rtl8150_set_multicast(struct net_device *netdev)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++ u16 rx_creg = 0x9e;
++
++ netif_stop_queue(netdev);
++ if (netdev->flags & IFF_PROMISC) {
++ rx_creg |= 0x0001;
++ dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name);
++ } else if (!netdev_mc_empty(netdev) ||
++ (netdev->flags & IFF_ALLMULTI)) {
++ rx_creg &= 0xfffe;
++ rx_creg |= 0x0002;
++ dev_info(&netdev->dev, "%s: allmulti set\n", netdev->name);
++ } else {
++ /* ~RX_MULTICAST, ~RX_PROMISCUOUS */
++ rx_creg &= 0x00fc;
++ }
++ async_set_registers(dev, RCR, sizeof(rx_creg), rx_creg);
++ netif_wake_queue(netdev);
++}
++
++static netdev_tx_t rtl8150_start_xmit(struct sk_buff *skb,
++ struct net_device *netdev)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++ int count, res;
++
++ netif_stop_queue(netdev);
++ count = (skb->len < 60) ? 60 : skb->len;
++ count = (count & 0x3f) ? count : count + 1;
++ dev->tx_skb = skb;
++ usb_fill_bulk_urb(dev->tx_urb, dev->udev, usb_sndbulkpipe(dev->udev, 2),
++ skb->data, count, write_bulk_callback, dev);
++ if ((res = usb_submit_urb(dev->tx_urb, GFP_ATOMIC))) {
++ /* Can we get/handle EPIPE here? */
++ if (res == -ENODEV)
++ netif_device_detach(dev->netdev);
++ else {
++ dev_warn(&netdev->dev, "failed tx_urb %d\n", res);
++ netdev->stats.tx_errors++;
++ netif_start_queue(netdev);
++ }
++ } else {
++ netdev->stats.tx_packets++;
++ netdev->stats.tx_bytes += skb->len;
++ netdev->trans_start = jiffies;
++ }
++
++ return NETDEV_TX_OK;
++}
++
++
++static void set_carrier(struct net_device *netdev)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++ short tmp;
++
++ get_registers(dev, CSCR, 2, &tmp);
++ if (tmp & CSCR_LINK_STATUS)
++ netif_carrier_on(netdev);
++ else
++ netif_carrier_off(netdev);
++}
++
++static int rtl8150_open(struct net_device *netdev)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++ int res;
++
++ if (dev->rx_skb == NULL)
++ dev->rx_skb = pull_skb(dev);
++ if (!dev->rx_skb)
++ return -ENOMEM;
++
++ set_registers(dev, IDR, 6, netdev->dev_addr);
++
++ usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
++ dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
++ if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) {
++ if (res == -ENODEV)
++ netif_device_detach(dev->netdev);
++ dev_warn(&netdev->dev, "rx_urb submit failed: %d\n", res);
++ return res;
++ }
++ usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3),
++ dev->intr_buff, INTBUFSIZE, intr_callback,
++ dev, dev->intr_interval);
++ if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) {
++ if (res == -ENODEV)
++ netif_device_detach(dev->netdev);
++ dev_warn(&netdev->dev, "intr_urb submit failed: %d\n", res);
++ usb_kill_urb(dev->rx_urb);
++ return res;
++ }
++ enable_net_traffic(dev);
++ set_carrier(netdev);
++ netif_start_queue(netdev);
++
++ return res;
++}
++
++static int rtl8150_close(struct net_device *netdev)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++ int res = 0;
++
++ netif_stop_queue(netdev);
++ if (!test_bit(RTL8150_UNPLUG, &dev->flags))
++ disable_net_traffic(dev);
++ unlink_all_urbs(dev);
++
++ return res;
++}
++
++static void rtl8150_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *info)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++
++ strlcpy(info->driver, driver_name, sizeof(info->driver));
++ strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
++ usb_make_path(dev->udev, info->bus_info, sizeof(info->bus_info));
++}
++
++static int rtl8150_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++ short lpa, bmcr;
++
++ ecmd->supported = (SUPPORTED_10baseT_Half |
++ SUPPORTED_10baseT_Full |
++ SUPPORTED_100baseT_Half |
++ SUPPORTED_100baseT_Full |
++ SUPPORTED_Autoneg |
++ SUPPORTED_TP | SUPPORTED_MII);
++ ecmd->port = PORT_TP;
++ ecmd->transceiver = XCVR_INTERNAL;
++ ecmd->phy_address = dev->phy;
++ get_registers(dev, BMCR, 2, &bmcr);
++ get_registers(dev, ANLP, 2, &lpa);
++ if (bmcr & BMCR_ANENABLE) {
++ u32 speed = ((lpa & (LPA_100HALF | LPA_100FULL)) ?
++ SPEED_100 : SPEED_10);
++ ethtool_cmd_speed_set(ecmd, speed);
++ ecmd->autoneg = AUTONEG_ENABLE;
++ if (speed == SPEED_100)
++ ecmd->duplex = (lpa & LPA_100FULL) ?
++ DUPLEX_FULL : DUPLEX_HALF;
++ else
++ ecmd->duplex = (lpa & LPA_10FULL) ?
++ DUPLEX_FULL : DUPLEX_HALF;
++ } else {
++ ecmd->autoneg = AUTONEG_DISABLE;
++ ethtool_cmd_speed_set(ecmd, ((bmcr & BMCR_SPEED100) ?
++ SPEED_100 : SPEED_10));
++ ecmd->duplex = (bmcr & BMCR_FULLDPLX) ?
++ DUPLEX_FULL : DUPLEX_HALF;
++ }
++ return 0;
++}
++
++static const struct ethtool_ops ops = {
++ .get_drvinfo = rtl8150_get_drvinfo,
++ .get_settings = rtl8150_get_settings,
++ .get_link = ethtool_op_get_link
++};
++
++static int rtl8150_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
++{
++ rtl8150_t *dev = netdev_priv(netdev);
++ u16 *data = (u16 *) & rq->ifr_ifru;
++ int res = 0;
++
++ switch (cmd) {
++ case SIOCDEVPRIVATE:
++ data[0] = dev->phy;
++ case SIOCDEVPRIVATE + 1:
++ read_mii_word(dev, dev->phy, (data[1] & 0x1f), &data[3]);
++ break;
++ case SIOCDEVPRIVATE + 2:
++ if (!capable(CAP_NET_ADMIN))
++ return -EPERM;
++ write_mii_word(dev, dev->phy, (data[1] & 0x1f), data[2]);
++ break;
++ default:
++ res = -EOPNOTSUPP;
++ }
++
++ return res;
++}
++
++static const struct net_device_ops rtl8150_netdev_ops = {
++ .ndo_open = rtl8150_open,
++ .ndo_stop = rtl8150_close,
++ .ndo_do_ioctl = rtl8150_ioctl,
++ .ndo_start_xmit = rtl8150_start_xmit,
++ .ndo_tx_timeout = rtl8150_tx_timeout,
++ .ndo_set_rx_mode = rtl8150_set_multicast,
++ .ndo_set_mac_address = rtl8150_set_mac_address,
++
++ .ndo_change_mtu = eth_change_mtu,
++ .ndo_validate_addr = eth_validate_addr,
++};
++
++static int rtl8150_probe(struct usb_interface *intf,
++ const struct usb_device_id *id)
++{
++ struct usb_device *udev = interface_to_usbdev(intf);
++ rtl8150_t *dev;
++ struct net_device *netdev;
++
++ netdev = alloc_etherdev(sizeof(rtl8150_t));
++ if (!netdev)
++ return -ENOMEM;
++
++ dev = netdev_priv(netdev);
++
++ dev->intr_buff = kmalloc(INTBUFSIZE, GFP_KERNEL);
++ if (!dev->intr_buff) {
++ free_netdev(netdev);
++ return -ENOMEM;
++ }
++
++ tasklet_init(&dev->tl, rx_fixup, (unsigned long)dev);
++ spin_lock_init(&dev->rx_pool_lock);
++
++ dev->udev = udev;
++ dev->netdev = netdev;
++ netdev->netdev_ops = &rtl8150_netdev_ops;
++ netdev->watchdog_timeo = RTL8150_TX_TIMEOUT;
++ netdev->ethtool_ops = &ops;
++ dev->intr_interval = 100; /* 100ms */
++
++ if (!alloc_all_urbs(dev)) {
++ dev_err(&intf->dev, "out of memory\n");
++ goto out;
++ }
++ if (!rtl8150_reset(dev)) {
++ dev_err(&intf->dev, "couldn't reset the device\n");
++ goto out1;
++ }
++ fill_skb_pool(dev);
++ set_ethernet_addr(dev);
++
++ usb_set_intfdata(intf, dev);
++ SET_NETDEV_DEV(netdev, &intf->dev);
++ if (register_netdev(netdev) != 0) {
++ dev_err(&intf->dev, "couldn't register the device\n");
++ goto out2;
++ }
++
++ dev_info(&intf->dev, "%s: rtl8150 is detected\n", netdev->name);
++
++ return 0;
++
++out2:
++ usb_set_intfdata(intf, NULL);
++ free_skb_pool(dev);
++out1:
++ free_all_urbs(dev);
++out:
++ kfree(dev->intr_buff);
++ free_netdev(netdev);
++ return -EIO;
++}
++
++static void rtl8150_disconnect(struct usb_interface *intf)
++{
++ rtl8150_t *dev = usb_get_intfdata(intf);
++
++ usb_set_intfdata(intf, NULL);
++ if (dev) {
++ set_bit(RTL8150_UNPLUG, &dev->flags);
++ tasklet_kill(&dev->tl);
++ unregister_netdev(dev->netdev);
++ unlink_all_urbs(dev);
++ free_all_urbs(dev);
++ free_skb_pool(dev);
++ if (dev->rx_skb)
++ dev_kfree_skb(dev->rx_skb);
++ kfree(dev->intr_buff);
++ free_netdev(dev->netdev);
++ }
++}
++
++static struct usb_driver rtl8150_driver = {
++ .name = driver_name,
++ .probe = rtl8150_probe,
++ .disconnect = rtl8150_disconnect,
++ .id_table = rtl8150_table,
++ .suspend = rtl8150_suspend,
++ .resume = rtl8150_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(rtl8150_driver);
++
++MODULE_AUTHOR(DRIVER_AUTHOR);
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc75xx.c backports-3.18.1-1/drivers/net/usb/smsc75xx.c
+--- backports-3.18.1-1.org/drivers/net/usb/smsc75xx.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/smsc75xx.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,2286 @@
++ /***************************************************************************
++ *
++ * Copyright (C) 2007-2010 SMSC
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ *
++ *****************************************************************************/
++
++#include <linux/module.h>
++#include <linux/kmod.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/bitrev.h>
++#include <linux/crc16.h>
++#include <linux/crc32.h>
++#include <linux/usb/usbnet.h>
++#include <linux/slab.h>
++#include "smsc75xx.h"
++
++#define SMSC_CHIPNAME "smsc75xx"
++#define SMSC_DRIVER_VERSION "1.0.0"
++#define HS_USB_PKT_SIZE (512)
++#define FS_USB_PKT_SIZE (64)
++#define DEFAULT_HS_BURST_CAP_SIZE (16 * 1024 + 5 * HS_USB_PKT_SIZE)
++#define DEFAULT_FS_BURST_CAP_SIZE (6 * 1024 + 33 * FS_USB_PKT_SIZE)
++#define DEFAULT_BULK_IN_DELAY (0x00002000)
++#define MAX_SINGLE_PACKET_SIZE (9000)
++#define LAN75XX_EEPROM_MAGIC (0x7500)
++#define EEPROM_MAC_OFFSET (0x01)
++#define DEFAULT_TX_CSUM_ENABLE (true)
++#define DEFAULT_RX_CSUM_ENABLE (true)
++#define SMSC75XX_INTERNAL_PHY_ID (1)
++#define SMSC75XX_TX_OVERHEAD (8)
++#define MAX_RX_FIFO_SIZE (20 * 1024)
++#define MAX_TX_FIFO_SIZE (12 * 1024)
++#define USB_VENDOR_ID_SMSC (0x0424)
++#define USB_PRODUCT_ID_LAN7500 (0x7500)
++#define USB_PRODUCT_ID_LAN7505 (0x7505)
++#define RXW_PADDING 2
++#define SUPPORTED_WAKE (WAKE_PHY | WAKE_UCAST | WAKE_BCAST | \
++ WAKE_MCAST | WAKE_ARP | WAKE_MAGIC)
++
++#define SUSPEND_SUSPEND0 (0x01)
++#define SUSPEND_SUSPEND1 (0x02)
++#define SUSPEND_SUSPEND2 (0x04)
++#define SUSPEND_SUSPEND3 (0x08)
++#define SUSPEND_ALLMODES (SUSPEND_SUSPEND0 | SUSPEND_SUSPEND1 | \
++ SUSPEND_SUSPEND2 | SUSPEND_SUSPEND3)
++
++struct smsc75xx_priv {
++ struct usbnet *dev;
++ u32 rfe_ctl;
++ u32 wolopts;
++ u32 multicast_hash_table[DP_SEL_VHF_HASH_LEN];
++ struct mutex dataport_mutex;
++ spinlock_t rfe_ctl_lock;
++ struct work_struct set_multicast;
++ u8 suspend_flags;
++};
++
++struct usb_context {
++ struct usb_ctrlrequest req;
++ struct usbnet *dev;
++};
++
++static bool turbo_mode = true;
++module_param(turbo_mode, bool, 0644);
++MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
++
++static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index,
++ u32 *data, int in_pm)
++{
++ u32 buf;
++ int ret;
++ int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
++
++ BUG_ON(!dev);
++
++ if (!in_pm)
++ fn = usbnet_read_cmd;
++ else
++ fn = usbnet_read_cmd_nopm;
++
++ ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
++ | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ 0, index, &buf, 4);
++ if (unlikely(ret < 0))
++ netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
++ index, ret);
++
++ le32_to_cpus(&buf);
++ *data = buf;
++
++ return ret;
++}
++
++static int __must_check __smsc75xx_write_reg(struct usbnet *dev, u32 index,
++ u32 data, int in_pm)
++{
++ u32 buf;
++ int ret;
++ int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
++
++ BUG_ON(!dev);
++
++ if (!in_pm)
++ fn = usbnet_write_cmd;
++ else
++ fn = usbnet_write_cmd_nopm;
++
++ buf = data;
++ cpu_to_le32s(&buf);
++
++ ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
++ | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ 0, index, &buf, 4);
++ if (unlikely(ret < 0))
++ netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",
++ index, ret);
++
++ return ret;
++}
++
++static int __must_check smsc75xx_read_reg_nopm(struct usbnet *dev, u32 index,
++ u32 *data)
++{
++ return __smsc75xx_read_reg(dev, index, data, 1);
++}
++
++static int __must_check smsc75xx_write_reg_nopm(struct usbnet *dev, u32 index,
++ u32 data)
++{
++ return __smsc75xx_write_reg(dev, index, data, 1);
++}
++
++static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index,
++ u32 *data)
++{
++ return __smsc75xx_read_reg(dev, index, data, 0);
++}
++
++static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index,
++ u32 data)
++{
++ return __smsc75xx_write_reg(dev, index, data, 0);
++}
++
++/* Loop until the read is completed with timeout
++ * called with phy_mutex held */
++static __must_check int __smsc75xx_phy_wait_not_busy(struct usbnet *dev,
++ int in_pm)
++{
++ unsigned long start_time = jiffies;
++ u32 val;
++ int ret;
++
++ do {
++ ret = __smsc75xx_read_reg(dev, MII_ACCESS, &val, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading MII_ACCESS\n");
++ return ret;
++ }
++
++ if (!(val & MII_ACCESS_BUSY))
++ return 0;
++ } while (!time_after(jiffies, start_time + HZ));
++
++ return -EIO;
++}
++
++static int __smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx,
++ int in_pm)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u32 val, addr;
++ int ret;
++
++ mutex_lock(&dev->phy_mutex);
++
++ /* confirm MII not busy */
++ ret = __smsc75xx_phy_wait_not_busy(dev, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "MII is busy in smsc75xx_mdio_read\n");
++ goto done;
++ }
++
++ /* set the address, index & direction (read from PHY) */
++ phy_id &= dev->mii.phy_id_mask;
++ idx &= dev->mii.reg_num_mask;
++ addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
++ | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
++ | MII_ACCESS_READ | MII_ACCESS_BUSY;
++ ret = __smsc75xx_write_reg(dev, MII_ACCESS, addr, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing MII_ACCESS\n");
++ goto done;
++ }
++
++ ret = __smsc75xx_phy_wait_not_busy(dev, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Timed out reading MII reg %02X\n", idx);
++ goto done;
++ }
++
++ ret = __smsc75xx_read_reg(dev, MII_DATA, &val, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading MII_DATA\n");
++ goto done;
++ }
++
++ ret = (u16)(val & 0xFFFF);
++
++done:
++ mutex_unlock(&dev->phy_mutex);
++ return ret;
++}
++
++static void __smsc75xx_mdio_write(struct net_device *netdev, int phy_id,
++ int idx, int regval, int in_pm)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u32 val, addr;
++ int ret;
++
++ mutex_lock(&dev->phy_mutex);
++
++ /* confirm MII not busy */
++ ret = __smsc75xx_phy_wait_not_busy(dev, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "MII is busy in smsc75xx_mdio_write\n");
++ goto done;
++ }
++
++ val = regval;
++ ret = __smsc75xx_write_reg(dev, MII_DATA, val, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing MII_DATA\n");
++ goto done;
++ }
++
++ /* set the address, index & direction (write to PHY) */
++ phy_id &= dev->mii.phy_id_mask;
++ idx &= dev->mii.reg_num_mask;
++ addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
++ | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
++ | MII_ACCESS_WRITE | MII_ACCESS_BUSY;
++ ret = __smsc75xx_write_reg(dev, MII_ACCESS, addr, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing MII_ACCESS\n");
++ goto done;
++ }
++
++ ret = __smsc75xx_phy_wait_not_busy(dev, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Timed out writing MII reg %02X\n", idx);
++ goto done;
++ }
++
++done:
++ mutex_unlock(&dev->phy_mutex);
++}
++
++static int smsc75xx_mdio_read_nopm(struct net_device *netdev, int phy_id,
++ int idx)
++{
++ return __smsc75xx_mdio_read(netdev, phy_id, idx, 1);
++}
++
++static void smsc75xx_mdio_write_nopm(struct net_device *netdev, int phy_id,
++ int idx, int regval)
++{
++ __smsc75xx_mdio_write(netdev, phy_id, idx, regval, 1);
++}
++
++static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
++{
++ return __smsc75xx_mdio_read(netdev, phy_id, idx, 0);
++}
++
++static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
++ int regval)
++{
++ __smsc75xx_mdio_write(netdev, phy_id, idx, regval, 0);
++}
++
++static int smsc75xx_wait_eeprom(struct usbnet *dev)
++{
++ unsigned long start_time = jiffies;
++ u32 val;
++ int ret;
++
++ do {
++ ret = smsc75xx_read_reg(dev, E2P_CMD, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading E2P_CMD\n");
++ return ret;
++ }
++
++ if (!(val & E2P_CMD_BUSY) || (val & E2P_CMD_TIMEOUT))
++ break;
++ udelay(40);
++ } while (!time_after(jiffies, start_time + HZ));
++
++ if (val & (E2P_CMD_TIMEOUT | E2P_CMD_BUSY)) {
++ netdev_warn(dev->net, "EEPROM read operation timeout\n");
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static int smsc75xx_eeprom_confirm_not_busy(struct usbnet *dev)
++{
++ unsigned long start_time = jiffies;
++ u32 val;
++ int ret;
++
++ do {
++ ret = smsc75xx_read_reg(dev, E2P_CMD, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading E2P_CMD\n");
++ return ret;
++ }
++
++ if (!(val & E2P_CMD_BUSY))
++ return 0;
++
++ udelay(40);
++ } while (!time_after(jiffies, start_time + HZ));
++
++ netdev_warn(dev->net, "EEPROM is busy\n");
++ return -EIO;
++}
++
++static int smsc75xx_read_eeprom(struct usbnet *dev, u32 offset, u32 length,
++ u8 *data)
++{
++ u32 val;
++ int i, ret;
++
++ BUG_ON(!dev);
++ BUG_ON(!data);
++
++ ret = smsc75xx_eeprom_confirm_not_busy(dev);
++ if (ret)
++ return ret;
++
++ for (i = 0; i < length; i++) {
++ val = E2P_CMD_BUSY | E2P_CMD_READ | (offset & E2P_CMD_ADDR);
++ ret = smsc75xx_write_reg(dev, E2P_CMD, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing E2P_CMD\n");
++ return ret;
++ }
++
++ ret = smsc75xx_wait_eeprom(dev);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc75xx_read_reg(dev, E2P_DATA, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading E2P_DATA\n");
++ return ret;
++ }
++
++ data[i] = val & 0xFF;
++ offset++;
++ }
++
++ return 0;
++}
++
++static int smsc75xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length,
++ u8 *data)
++{
++ u32 val;
++ int i, ret;
++
++ BUG_ON(!dev);
++ BUG_ON(!data);
++
++ ret = smsc75xx_eeprom_confirm_not_busy(dev);
++ if (ret)
++ return ret;
++
++ /* Issue write/erase enable command */
++ val = E2P_CMD_BUSY | E2P_CMD_EWEN;
++ ret = smsc75xx_write_reg(dev, E2P_CMD, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing E2P_CMD\n");
++ return ret;
++ }
++
++ ret = smsc75xx_wait_eeprom(dev);
++ if (ret < 0)
++ return ret;
++
++ for (i = 0; i < length; i++) {
++
++ /* Fill data register */
++ val = data[i];
++ ret = smsc75xx_write_reg(dev, E2P_DATA, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing E2P_DATA\n");
++ return ret;
++ }
++
++ /* Send "write" command */
++ val = E2P_CMD_BUSY | E2P_CMD_WRITE | (offset & E2P_CMD_ADDR);
++ ret = smsc75xx_write_reg(dev, E2P_CMD, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing E2P_CMD\n");
++ return ret;
++ }
++
++ ret = smsc75xx_wait_eeprom(dev);
++ if (ret < 0)
++ return ret;
++
++ offset++;
++ }
++
++ return 0;
++}
++
++static int smsc75xx_dataport_wait_not_busy(struct usbnet *dev)
++{
++ int i, ret;
++
++ for (i = 0; i < 100; i++) {
++ u32 dp_sel;
++ ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading DP_SEL\n");
++ return ret;
++ }
++
++ if (dp_sel & DP_SEL_DPRDY)
++ return 0;
++
++ udelay(40);
++ }
++
++ netdev_warn(dev->net, "smsc75xx_dataport_wait_not_busy timed out\n");
++
++ return -EIO;
++}
++
++static int smsc75xx_dataport_write(struct usbnet *dev, u32 ram_select, u32 addr,
++ u32 length, u32 *buf)
++{
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ u32 dp_sel;
++ int i, ret;
++
++ mutex_lock(&pdata->dataport_mutex);
++
++ ret = smsc75xx_dataport_wait_not_busy(dev);
++ if (ret < 0) {
++ netdev_warn(dev->net, "smsc75xx_dataport_write busy on entry\n");
++ goto done;
++ }
++
++ ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading DP_SEL\n");
++ goto done;
++ }
++
++ dp_sel &= ~DP_SEL_RSEL;
++ dp_sel |= ram_select;
++ ret = smsc75xx_write_reg(dev, DP_SEL, dp_sel);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing DP_SEL\n");
++ goto done;
++ }
++
++ for (i = 0; i < length; i++) {
++ ret = smsc75xx_write_reg(dev, DP_ADDR, addr + i);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing DP_ADDR\n");
++ goto done;
++ }
++
++ ret = smsc75xx_write_reg(dev, DP_DATA, buf[i]);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing DP_DATA\n");
++ goto done;
++ }
++
++ ret = smsc75xx_write_reg(dev, DP_CMD, DP_CMD_WRITE);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing DP_CMD\n");
++ goto done;
++ }
++
++ ret = smsc75xx_dataport_wait_not_busy(dev);
++ if (ret < 0) {
++ netdev_warn(dev->net, "smsc75xx_dataport_write timeout\n");
++ goto done;
++ }
++ }
++
++done:
++ mutex_unlock(&pdata->dataport_mutex);
++ return ret;
++}
++
++/* returns hash bit number for given MAC address */
++static u32 smsc75xx_hash(char addr[ETH_ALEN])
++{
++ return (ether_crc(ETH_ALEN, addr) >> 23) & 0x1ff;
++}
++
++static void smsc75xx_deferred_multicast_write(struct work_struct *param)
++{
++ struct smsc75xx_priv *pdata =
++ container_of(param, struct smsc75xx_priv, set_multicast);
++ struct usbnet *dev = pdata->dev;
++ int ret;
++
++ netif_dbg(dev, drv, dev->net, "deferred multicast write 0x%08x\n",
++ pdata->rfe_ctl);
++
++ smsc75xx_dataport_write(dev, DP_SEL_VHF, DP_SEL_VHF_VLAN_LEN,
++ DP_SEL_VHF_HASH_LEN, pdata->multicast_hash_table);
++
++ ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl);
++ if (ret < 0)
++ netdev_warn(dev->net, "Error writing RFE_CRL\n");
++}
++
++static void smsc75xx_set_multicast(struct net_device *netdev)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ unsigned long flags;
++ int i;
++
++ spin_lock_irqsave(&pdata->rfe_ctl_lock, flags);
++
++ pdata->rfe_ctl &=
++ ~(RFE_CTL_AU | RFE_CTL_AM | RFE_CTL_DPF | RFE_CTL_MHF);
++ pdata->rfe_ctl |= RFE_CTL_AB;
++
++ for (i = 0; i < DP_SEL_VHF_HASH_LEN; i++)
++ pdata->multicast_hash_table[i] = 0;
++
++ if (dev->net->flags & IFF_PROMISC) {
++ netif_dbg(dev, drv, dev->net, "promiscuous mode enabled\n");
++ pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_AU;
++ } else if (dev->net->flags & IFF_ALLMULTI) {
++ netif_dbg(dev, drv, dev->net, "receive all multicast enabled\n");
++ pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF;
++ } else if (!netdev_mc_empty(dev->net)) {
++ struct netdev_hw_addr *ha;
++
++ netif_dbg(dev, drv, dev->net, "receive multicast hash filter\n");
++
++ pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF;
++
++ netdev_for_each_mc_addr(ha, netdev) {
++ u32 bitnum = smsc75xx_hash(ha->addr);
++ pdata->multicast_hash_table[bitnum / 32] |=
++ (1 << (bitnum % 32));
++ }
++ } else {
++ netif_dbg(dev, drv, dev->net, "receive own packets only\n");
++ pdata->rfe_ctl |= RFE_CTL_DPF;
++ }
++
++ spin_unlock_irqrestore(&pdata->rfe_ctl_lock, flags);
++
++ /* defer register writes to a sleepable context */
++ schedule_work(&pdata->set_multicast);
++}
++
++static int smsc75xx_update_flowcontrol(struct usbnet *dev, u8 duplex,
++ u16 lcladv, u16 rmtadv)
++{
++ u32 flow = 0, fct_flow = 0;
++ int ret;
++
++ if (duplex == DUPLEX_FULL) {
++ u8 cap = mii_resolve_flowctrl_fdx(lcladv, rmtadv);
++
++ if (cap & FLOW_CTRL_TX) {
++ flow = (FLOW_TX_FCEN | 0xFFFF);
++ /* set fct_flow thresholds to 20% and 80% */
++ fct_flow = (8 << 8) | 32;
++ }
++
++ if (cap & FLOW_CTRL_RX)
++ flow |= FLOW_RX_FCEN;
++
++ netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n",
++ (cap & FLOW_CTRL_RX ? "enabled" : "disabled"),
++ (cap & FLOW_CTRL_TX ? "enabled" : "disabled"));
++ } else {
++ netif_dbg(dev, link, dev->net, "half duplex\n");
++ }
++
++ ret = smsc75xx_write_reg(dev, FLOW, flow);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing FLOW\n");
++ return ret;
++ }
++
++ ret = smsc75xx_write_reg(dev, FCT_FLOW, fct_flow);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing FCT_FLOW\n");
++ return ret;
++ }
++
++ return 0;
++}
++
++static int smsc75xx_link_reset(struct usbnet *dev)
++{
++ struct mii_if_info *mii = &dev->mii;
++ struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
++ u16 lcladv, rmtadv;
++ int ret;
++
++ /* write to clear phy interrupt status */
++ smsc75xx_mdio_write(dev->net, mii->phy_id, PHY_INT_SRC,
++ PHY_INT_SRC_CLEAR_ALL);
++
++ ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing INT_STS\n");
++ return ret;
++ }
++
++ mii_check_media(mii, 1, 1);
++ mii_ethtool_gset(&dev->mii, &ecmd);
++ lcladv = smsc75xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE);
++ rmtadv = smsc75xx_mdio_read(dev->net, mii->phy_id, MII_LPA);
++
++ netif_dbg(dev, link, dev->net, "speed: %u duplex: %d lcladv: %04x rmtadv: %04x\n",
++ ethtool_cmd_speed(&ecmd), ecmd.duplex, lcladv, rmtadv);
++
++ return smsc75xx_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv);
++}
++
++static void smsc75xx_status(struct usbnet *dev, struct urb *urb)
++{
++ u32 intdata;
++
++ if (urb->actual_length != 4) {
++ netdev_warn(dev->net, "unexpected urb length %d\n",
++ urb->actual_length);
++ return;
++ }
++
++ memcpy(&intdata, urb->transfer_buffer, 4);
++ le32_to_cpus(&intdata);
++
++ netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata);
++
++ if (intdata & INT_ENP_PHY_INT)
++ usbnet_defer_kevent(dev, EVENT_LINK_RESET);
++ else
++ netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n",
++ intdata);
++}
++
++static int smsc75xx_ethtool_get_eeprom_len(struct net_device *net)
++{
++ return MAX_EEPROM_SIZE;
++}
++
++static int smsc75xx_ethtool_get_eeprom(struct net_device *netdev,
++ struct ethtool_eeprom *ee, u8 *data)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++
++ ee->magic = LAN75XX_EEPROM_MAGIC;
++
++ return smsc75xx_read_eeprom(dev, ee->offset, ee->len, data);
++}
++
++static int smsc75xx_ethtool_set_eeprom(struct net_device *netdev,
++ struct ethtool_eeprom *ee, u8 *data)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++
++ if (ee->magic != LAN75XX_EEPROM_MAGIC) {
++ netdev_warn(dev->net, "EEPROM: magic value mismatch: 0x%x\n",
++ ee->magic);
++ return -EINVAL;
++ }
++
++ return smsc75xx_write_eeprom(dev, ee->offset, ee->len, data);
++}
++
++static void smsc75xx_ethtool_get_wol(struct net_device *net,
++ struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++
++ wolinfo->supported = SUPPORTED_WAKE;
++ wolinfo->wolopts = pdata->wolopts;
++}
++
++static int smsc75xx_ethtool_set_wol(struct net_device *net,
++ struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ int ret;
++
++ pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE;
++
++ ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts);
++ if (ret < 0)
++ netdev_warn(dev->net, "device_set_wakeup_enable error %d\n", ret);
++
++ return ret;
++}
++
++static const struct ethtool_ops smsc75xx_ethtool_ops = {
++ .get_link = usbnet_get_link,
++ .nway_reset = usbnet_nway_reset,
++ .get_drvinfo = usbnet_get_drvinfo,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .get_eeprom_len = smsc75xx_ethtool_get_eeprom_len,
++ .get_eeprom = smsc75xx_ethtool_get_eeprom,
++ .set_eeprom = smsc75xx_ethtool_set_eeprom,
++ .get_wol = smsc75xx_ethtool_get_wol,
++ .set_wol = smsc75xx_ethtool_set_wol,
++};
++
++static int smsc75xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++
++ if (!netif_running(netdev))
++ return -EINVAL;
++
++ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
++}
++
++static void smsc75xx_init_mac_address(struct usbnet *dev)
++{
++ /* try reading mac address from EEPROM */
++ if (smsc75xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
++ dev->net->dev_addr) == 0) {
++ if (is_valid_ether_addr(dev->net->dev_addr)) {
++ /* eeprom values are valid so use them */
++ netif_dbg(dev, ifup, dev->net,
++ "MAC address read from EEPROM\n");
++ return;
++ }
++ }
++
++ /* no eeprom, or eeprom values are invalid. generate random MAC */
++ eth_hw_addr_random(dev->net);
++ netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");
++}
++
++static int smsc75xx_set_mac_address(struct usbnet *dev)
++{
++ u32 addr_lo = dev->net->dev_addr[0] | dev->net->dev_addr[1] << 8 |
++ dev->net->dev_addr[2] << 16 | dev->net->dev_addr[3] << 24;
++ u32 addr_hi = dev->net->dev_addr[4] | dev->net->dev_addr[5] << 8;
++
++ int ret = smsc75xx_write_reg(dev, RX_ADDRH, addr_hi);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write RX_ADDRH: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_write_reg(dev, RX_ADDRL, addr_lo);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write RX_ADDRL: %d\n", ret);
++ return ret;
++ }
++
++ addr_hi |= ADDR_FILTX_FB_VALID;
++ ret = smsc75xx_write_reg(dev, ADDR_FILTX, addr_hi);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write ADDR_FILTX: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_write_reg(dev, ADDR_FILTX + 4, addr_lo);
++ if (ret < 0)
++ netdev_warn(dev->net, "Failed to write ADDR_FILTX+4: %d\n", ret);
++
++ return ret;
++}
++
++static int smsc75xx_phy_initialize(struct usbnet *dev)
++{
++ int bmcr, ret, timeout = 0;
++
++ /* Initialize MII structure */
++ dev->mii.dev = dev->net;
++ dev->mii.mdio_read = smsc75xx_mdio_read;
++ dev->mii.mdio_write = smsc75xx_mdio_write;
++ dev->mii.phy_id_mask = 0x1f;
++ dev->mii.reg_num_mask = 0x1f;
++ dev->mii.supports_gmii = 1;
++ dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID;
++
++ /* reset phy and wait for reset to complete */
++ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
++
++ do {
++ msleep(10);
++ bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
++ if (bmcr < 0) {
++ netdev_warn(dev->net, "Error reading MII_BMCR\n");
++ return bmcr;
++ }
++ timeout++;
++ } while ((bmcr & BMCR_RESET) && (timeout < 100));
++
++ if (timeout >= 100) {
++ netdev_warn(dev->net, "timeout on PHY Reset\n");
++ return -EIO;
++ }
++
++ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
++ ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
++ ADVERTISE_PAUSE_ASYM);
++ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
++ ADVERTISE_1000FULL);
++
++ /* read and write to clear phy interrupt status */
++ ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PHY_INT_SRC\n");
++ return ret;
++ }
++
++ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff);
++
++ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
++ PHY_INT_MASK_DEFAULT);
++ mii_nway_restart(&dev->mii);
++
++ netif_dbg(dev, ifup, dev->net, "phy initialised successfully\n");
++ return 0;
++}
++
++static int smsc75xx_set_rx_max_frame_length(struct usbnet *dev, int size)
++{
++ int ret = 0;
++ u32 buf;
++ bool rxenabled;
++
++ ret = smsc75xx_read_reg(dev, MAC_RX, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read MAC_RX: %d\n", ret);
++ return ret;
++ }
++
++ rxenabled = ((buf & MAC_RX_RXEN) != 0);
++
++ if (rxenabled) {
++ buf &= ~MAC_RX_RXEN;
++ ret = smsc75xx_write_reg(dev, MAC_RX, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret);
++ return ret;
++ }
++ }
++
++ /* add 4 to size for FCS */
++ buf &= ~MAC_RX_MAX_SIZE;
++ buf |= (((size + 4) << MAC_RX_MAX_SIZE_SHIFT) & MAC_RX_MAX_SIZE);
++
++ ret = smsc75xx_write_reg(dev, MAC_RX, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret);
++ return ret;
++ }
++
++ if (rxenabled) {
++ buf |= MAC_RX_RXEN;
++ ret = smsc75xx_write_reg(dev, MAC_RX, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret);
++ return ret;
++ }
++ }
++
++ return 0;
++}
++
++static int smsc75xx_change_mtu(struct net_device *netdev, int new_mtu)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ int ret;
++
++ if (new_mtu > MAX_SINGLE_PACKET_SIZE)
++ return -EINVAL;
++
++ ret = smsc75xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to set mac rx frame length\n");
++ return ret;
++ }
++
++ return usbnet_change_mtu(netdev, new_mtu);
++}
++
++/* Enable or disable Rx checksum offload engine */
++static int smsc75xx_set_features(struct net_device *netdev,
++ netdev_features_t features)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ unsigned long flags;
++ int ret;
++
++ spin_lock_irqsave(&pdata->rfe_ctl_lock, flags);
++
++ if (features & NETIF_F_RXCSUM)
++ pdata->rfe_ctl |= RFE_CTL_TCPUDP_CKM | RFE_CTL_IP_CKM;
++ else
++ pdata->rfe_ctl &= ~(RFE_CTL_TCPUDP_CKM | RFE_CTL_IP_CKM);
++
++ spin_unlock_irqrestore(&pdata->rfe_ctl_lock, flags);
++ /* it's racing here! */
++
++ ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl);
++ if (ret < 0)
++ netdev_warn(dev->net, "Error writing RFE_CTL\n");
++
++ return ret;
++}
++
++static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
++{
++ int timeout = 0;
++
++ do {
++ u32 buf;
++ int ret;
++
++ ret = __smsc75xx_read_reg(dev, PMT_CTL, &buf, in_pm);
++
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret);
++ return ret;
++ }
++
++ if (buf & PMT_CTL_DEV_RDY)
++ return 0;
++
++ msleep(10);
++ timeout++;
++ } while (timeout < 100);
++
++ netdev_warn(dev->net, "timeout waiting for device ready\n");
++ return -EIO;
++}
++
++static int smsc75xx_reset(struct usbnet *dev)
++{
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ u32 buf;
++ int ret = 0, timeout;
++
++ netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset\n");
++
++ ret = smsc75xx_wait_ready(dev, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "device not ready in smsc75xx_reset\n");
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
++ return ret;
++ }
++
++ buf |= HW_CFG_LRST;
++
++ ret = smsc75xx_write_reg(dev, HW_CFG, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write HW_CFG: %d\n", ret);
++ return ret;
++ }
++
++ timeout = 0;
++ do {
++ msleep(10);
++ ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
++ return ret;
++ }
++ timeout++;
++ } while ((buf & HW_CFG_LRST) && (timeout < 100));
++
++ if (timeout >= 100) {
++ netdev_warn(dev->net, "timeout on completion of Lite Reset\n");
++ return -EIO;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "Lite reset complete, resetting PHY\n");
++
++ ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret);
++ return ret;
++ }
++
++ buf |= PMT_CTL_PHY_RST;
++
++ ret = smsc75xx_write_reg(dev, PMT_CTL, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write PMT_CTL: %d\n", ret);
++ return ret;
++ }
++
++ timeout = 0;
++ do {
++ msleep(10);
++ ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret);
++ return ret;
++ }
++ timeout++;
++ } while ((buf & PMT_CTL_PHY_RST) && (timeout < 100));
++
++ if (timeout >= 100) {
++ netdev_warn(dev->net, "timeout waiting for PHY Reset\n");
++ return -EIO;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "PHY reset complete\n");
++
++ ret = smsc75xx_set_mac_address(dev);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to set mac address\n");
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "MAC Address: %pM\n",
++ dev->net->dev_addr);
++
++ ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG : 0x%08x\n",
++ buf);
++
++ buf |= HW_CFG_BIR;
++
++ ret = smsc75xx_write_reg(dev, HW_CFG, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write HW_CFG: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG after writing HW_CFG_BIR: 0x%08x\n",
++ buf);
++
++ if (!turbo_mode) {
++ buf = 0;
++ dev->rx_urb_size = MAX_SINGLE_PACKET_SIZE;
++ } else if (dev->udev->speed == USB_SPEED_HIGH) {
++ buf = DEFAULT_HS_BURST_CAP_SIZE / HS_USB_PKT_SIZE;
++ dev->rx_urb_size = DEFAULT_HS_BURST_CAP_SIZE;
++ } else {
++ buf = DEFAULT_FS_BURST_CAP_SIZE / FS_USB_PKT_SIZE;
++ dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n",
++ (ulong)dev->rx_urb_size);
++
++ ret = smsc75xx_write_reg(dev, BURST_CAP, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write BURST_CAP: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, BURST_CAP, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net,
++ "Read Value from BURST_CAP after writing: 0x%08x\n", buf);
++
++ ret = smsc75xx_write_reg(dev, BULK_IN_DLY, DEFAULT_BULK_IN_DELAY);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write BULK_IN_DLY: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, BULK_IN_DLY, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net,
++ "Read Value from BULK_IN_DLY after writing: 0x%08x\n", buf);
++
++ if (turbo_mode) {
++ ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x\n", buf);
++
++ buf |= (HW_CFG_MEF | HW_CFG_BCE);
++
++ ret = smsc75xx_write_reg(dev, HW_CFG, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write HW_CFG: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x\n", buf);
++ }
++
++ /* set FIFO sizes */
++ buf = (MAX_RX_FIFO_SIZE - 512) / 512;
++ ret = smsc75xx_write_reg(dev, FCT_RX_FIFO_END, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write FCT_RX_FIFO_END: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "FCT_RX_FIFO_END set to 0x%08x\n", buf);
++
++ buf = (MAX_TX_FIFO_SIZE - 512) / 512;
++ ret = smsc75xx_write_reg(dev, FCT_TX_FIFO_END, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write FCT_TX_FIFO_END: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "FCT_TX_FIFO_END set to 0x%08x\n", buf);
++
++ ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write INT_STS: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, ID_REV, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", buf);
++
++ ret = smsc75xx_read_reg(dev, E2P_CMD, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read E2P_CMD: %d\n", ret);
++ return ret;
++ }
++
++ /* only set default GPIO/LED settings if no EEPROM is detected */
++ if (!(buf & E2P_CMD_LOADED)) {
++ ret = smsc75xx_read_reg(dev, LED_GPIO_CFG, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read LED_GPIO_CFG: %d\n", ret);
++ return ret;
++ }
++
++ buf &= ~(LED_GPIO_CFG_LED2_FUN_SEL | LED_GPIO_CFG_LED10_FUN_SEL);
++ buf |= LED_GPIO_CFG_LEDGPIO_EN | LED_GPIO_CFG_LED2_FUN_SEL;
++
++ ret = smsc75xx_write_reg(dev, LED_GPIO_CFG, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write LED_GPIO_CFG: %d\n", ret);
++ return ret;
++ }
++ }
++
++ ret = smsc75xx_write_reg(dev, FLOW, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write FLOW: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_write_reg(dev, FCT_FLOW, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write FCT_FLOW: %d\n", ret);
++ return ret;
++ }
++
++ /* Don't need rfe_ctl_lock during initialisation */
++ ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read RFE_CTL: %d\n", ret);
++ return ret;
++ }
++
++ pdata->rfe_ctl |= RFE_CTL_AB | RFE_CTL_DPF;
++
++ ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write RFE_CTL: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read RFE_CTL: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "RFE_CTL set to 0x%08x\n",
++ pdata->rfe_ctl);
++
++ /* Enable or disable checksum offload engines */
++ smsc75xx_set_features(dev->net, dev->net->features);
++
++ smsc75xx_set_multicast(dev->net);
++
++ ret = smsc75xx_phy_initialize(dev);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to initialize PHY: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, INT_EP_CTL, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read INT_EP_CTL: %d\n", ret);
++ return ret;
++ }
++
++ /* enable PHY interrupts */
++ buf |= INT_ENP_PHY_INT;
++
++ ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write INT_EP_CTL: %d\n", ret);
++ return ret;
++ }
++
++ /* allow mac to detect speed and duplex from phy */
++ ret = smsc75xx_read_reg(dev, MAC_CR, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read MAC_CR: %d\n", ret);
++ return ret;
++ }
++
++ buf |= (MAC_CR_ADD | MAC_CR_ASD);
++ ret = smsc75xx_write_reg(dev, MAC_CR, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write MAC_CR: %d\n", ret);
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, MAC_TX, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read MAC_TX: %d\n", ret);
++ return ret;
++ }
++
++ buf |= MAC_TX_TXEN;
++
++ ret = smsc75xx_write_reg(dev, MAC_TX, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write MAC_TX: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "MAC_TX set to 0x%08x\n", buf);
++
++ ret = smsc75xx_read_reg(dev, FCT_TX_CTL, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read FCT_TX_CTL: %d\n", ret);
++ return ret;
++ }
++
++ buf |= FCT_TX_CTL_EN;
++
++ ret = smsc75xx_write_reg(dev, FCT_TX_CTL, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write FCT_TX_CTL: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "FCT_TX_CTL set to 0x%08x\n", buf);
++
++ ret = smsc75xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to set max rx frame length\n");
++ return ret;
++ }
++
++ ret = smsc75xx_read_reg(dev, MAC_RX, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read MAC_RX: %d\n", ret);
++ return ret;
++ }
++
++ buf |= MAC_RX_RXEN;
++
++ ret = smsc75xx_write_reg(dev, MAC_RX, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "MAC_RX set to 0x%08x\n", buf);
++
++ ret = smsc75xx_read_reg(dev, FCT_RX_CTL, &buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read FCT_RX_CTL: %d\n", ret);
++ return ret;
++ }
++
++ buf |= FCT_RX_CTL_EN;
++
++ ret = smsc75xx_write_reg(dev, FCT_RX_CTL, buf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write FCT_RX_CTL: %d\n", ret);
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "FCT_RX_CTL set to 0x%08x\n", buf);
++
++ netif_dbg(dev, ifup, dev->net, "smsc75xx_reset, return 0\n");
++ return 0;
++}
++
++static const struct net_device_ops smsc75xx_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = smsc75xx_change_mtu,
++ .ndo_set_mac_address = eth_mac_addr,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = smsc75xx_ioctl,
++ .ndo_set_rx_mode = smsc75xx_set_multicast,
++ .ndo_set_features = smsc75xx_set_features,
++};
++
++static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ struct smsc75xx_priv *pdata = NULL;
++ int ret;
++
++ printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n");
++
++ ret = usbnet_get_endpoints(dev, intf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "usbnet_get_endpoints failed: %d\n", ret);
++ return ret;
++ }
++
++ dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc75xx_priv),
++ GFP_KERNEL);
++
++ pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ if (!pdata)
++ return -ENOMEM;
++
++ pdata->dev = dev;
++
++ spin_lock_init(&pdata->rfe_ctl_lock);
++ mutex_init(&pdata->dataport_mutex);
++
++ INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write);
++
++ if (DEFAULT_TX_CSUM_ENABLE)
++ dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
++
++ if (DEFAULT_RX_CSUM_ENABLE)
++ dev->net->features |= NETIF_F_RXCSUM;
++
++ dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
++ NETIF_F_RXCSUM;
++
++ ret = smsc75xx_wait_ready(dev, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "device not ready in smsc75xx_bind\n");
++ return ret;
++ }
++
++ smsc75xx_init_mac_address(dev);
++
++ /* Init all registers */
++ ret = smsc75xx_reset(dev);
++ if (ret < 0) {
++ netdev_warn(dev->net, "smsc75xx_reset error %d\n", ret);
++ return ret;
++ }
++
++ dev->net->netdev_ops = &smsc75xx_netdev_ops;
++ dev->net->ethtool_ops = &smsc75xx_ethtool_ops;
++ dev->net->flags |= IFF_MULTICAST;
++ dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD;
++ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
++ return 0;
++}
++
++static void smsc75xx_unbind(struct usbnet *dev, struct usb_interface *intf)
++{
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ if (pdata) {
++ netif_dbg(dev, ifdown, dev->net, "free pdata\n");
++ kfree(pdata);
++ pdata = NULL;
++ dev->data[0] = 0;
++ }
++}
++
++static u16 smsc_crc(const u8 *buffer, size_t len)
++{
++ return bitrev16(crc16(0xFFFF, buffer, len));
++}
++
++static int smsc75xx_write_wuff(struct usbnet *dev, int filter, u32 wuf_cfg,
++ u32 wuf_mask1)
++{
++ int cfg_base = WUF_CFGX + filter * 4;
++ int mask_base = WUF_MASKX + filter * 16;
++ int ret;
++
++ ret = smsc75xx_write_reg(dev, cfg_base, wuf_cfg);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUF_CFGX\n");
++ return ret;
++ }
++
++ ret = smsc75xx_write_reg(dev, mask_base, wuf_mask1);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUF_MASKX\n");
++ return ret;
++ }
++
++ ret = smsc75xx_write_reg(dev, mask_base + 4, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUF_MASKX\n");
++ return ret;
++ }
++
++ ret = smsc75xx_write_reg(dev, mask_base + 8, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUF_MASKX\n");
++ return ret;
++ }
++
++ ret = smsc75xx_write_reg(dev, mask_base + 12, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUF_MASKX\n");
++ return ret;
++ }
++
++ return 0;
++}
++
++static int smsc75xx_enter_suspend0(struct usbnet *dev)
++{
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ u32 val;
++ int ret;
++
++ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PMT_CTL\n");
++ return ret;
++ }
++
++ val &= (~(PMT_CTL_SUS_MODE | PMT_CTL_PHY_RST));
++ val |= PMT_CTL_SUS_MODE_0 | PMT_CTL_WOL_EN | PMT_CTL_WUPS;
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ return ret;
++ }
++
++ pdata->suspend_flags |= SUSPEND_SUSPEND0;
++
++ return 0;
++}
++
++static int smsc75xx_enter_suspend1(struct usbnet *dev)
++{
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ u32 val;
++ int ret;
++
++ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PMT_CTL\n");
++ return ret;
++ }
++
++ val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST);
++ val |= PMT_CTL_SUS_MODE_1;
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ return ret;
++ }
++
++ /* clear wol status, enable energy detection */
++ val &= ~PMT_CTL_WUPS;
++ val |= (PMT_CTL_WUPS_ED | PMT_CTL_ED_EN);
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ return ret;
++ }
++
++ pdata->suspend_flags |= SUSPEND_SUSPEND1;
++
++ return 0;
++}
++
++static int smsc75xx_enter_suspend2(struct usbnet *dev)
++{
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ u32 val;
++ int ret;
++
++ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PMT_CTL\n");
++ return ret;
++ }
++
++ val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST);
++ val |= PMT_CTL_SUS_MODE_2;
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ return ret;
++ }
++
++ pdata->suspend_flags |= SUSPEND_SUSPEND2;
++
++ return 0;
++}
++
++static int smsc75xx_enter_suspend3(struct usbnet *dev)
++{
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ u32 val;
++ int ret;
++
++ ret = smsc75xx_read_reg_nopm(dev, FCT_RX_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading FCT_RX_CTL\n");
++ return ret;
++ }
++
++ if (val & FCT_RX_CTL_RXUSED) {
++ netdev_dbg(dev->net, "rx fifo not empty in autosuspend\n");
++ return -EBUSY;
++ }
++
++ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PMT_CTL\n");
++ return ret;
++ }
++
++ val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST);
++ val |= PMT_CTL_SUS_MODE_3 | PMT_CTL_RES_CLR_WKP_EN;
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ return ret;
++ }
++
++ /* clear wol status */
++ val &= ~PMT_CTL_WUPS;
++ val |= PMT_CTL_WUPS_WOL;
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ return ret;
++ }
++
++ pdata->suspend_flags |= SUSPEND_SUSPEND3;
++
++ return 0;
++}
++
++static int smsc75xx_enable_phy_wakeup_interrupts(struct usbnet *dev, u16 mask)
++{
++ struct mii_if_info *mii = &dev->mii;
++ int ret;
++
++ netdev_dbg(dev->net, "enabling PHY wakeup interrupts\n");
++
++ /* read to clear */
++ ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_SRC);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PHY_INT_SRC\n");
++ return ret;
++ }
++
++ /* enable interrupt source */
++ ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_MASK);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PHY_INT_MASK\n");
++ return ret;
++ }
++
++ ret |= mask;
++
++ smsc75xx_mdio_write_nopm(dev->net, mii->phy_id, PHY_INT_MASK, ret);
++
++ return 0;
++}
++
++static int smsc75xx_link_ok_nopm(struct usbnet *dev)
++{
++ struct mii_if_info *mii = &dev->mii;
++ int ret;
++
++ /* first, a dummy read, needed to latch some MII phys */
++ ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading MII_BMSR\n");
++ return ret;
++ }
++
++ ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading MII_BMSR\n");
++ return ret;
++ }
++
++ return !!(ret & BMSR_LSTATUS);
++}
++
++static int smsc75xx_autosuspend(struct usbnet *dev, u32 link_up)
++{
++ int ret;
++
++ if (!netif_running(dev->net)) {
++ /* interface is ifconfig down so fully power down hw */
++ netdev_dbg(dev->net, "autosuspend entering SUSPEND2\n");
++ return smsc75xx_enter_suspend2(dev);
++ }
++
++ if (!link_up) {
++ /* link is down so enter EDPD mode */
++ netdev_dbg(dev->net, "autosuspend entering SUSPEND1\n");
++
++ /* enable PHY wakeup events for if cable is attached */
++ ret = smsc75xx_enable_phy_wakeup_interrupts(dev,
++ PHY_INT_MASK_ANEG_COMP);
++ if (ret < 0) {
++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n");
++ return ret;
++ }
++
++ netdev_info(dev->net, "entering SUSPEND1 mode\n");
++ return smsc75xx_enter_suspend1(dev);
++ }
++
++ /* enable PHY wakeup events so we remote wakeup if cable is pulled */
++ ret = smsc75xx_enable_phy_wakeup_interrupts(dev,
++ PHY_INT_MASK_LINK_DOWN);
++ if (ret < 0) {
++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n");
++ return ret;
++ }
++
++ netdev_dbg(dev->net, "autosuspend entering SUSPEND3\n");
++ return smsc75xx_enter_suspend3(dev);
++}
++
++static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
++{
++ struct usbnet *dev = usb_get_intfdata(intf);
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ u32 val, link_up;
++ int ret;
++
++ ret = usbnet_suspend(intf, message);
++ if (ret < 0) {
++ netdev_warn(dev->net, "usbnet_suspend error\n");
++ return ret;
++ }
++
++ if (pdata->suspend_flags) {
++ netdev_warn(dev->net, "error during last resume\n");
++ pdata->suspend_flags = 0;
++ }
++
++ /* determine if link is up using only _nopm functions */
++ link_up = smsc75xx_link_ok_nopm(dev);
++
++ if (message.event == PM_EVENT_AUTO_SUSPEND) {
++ ret = smsc75xx_autosuspend(dev, link_up);
++ goto done;
++ }
++
++ /* if we get this far we're not autosuspending */
++ /* if no wol options set, or if link is down and we're not waking on
++ * PHY activity, enter lowest power SUSPEND2 mode
++ */
++ if (!(pdata->wolopts & SUPPORTED_WAKE) ||
++ !(link_up || (pdata->wolopts & WAKE_PHY))) {
++ netdev_info(dev->net, "entering SUSPEND2 mode\n");
++
++ /* disable energy detect (link up) & wake up events */
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ goto done;
++ }
++
++ val &= ~(WUCSR_MPEN | WUCSR_WUEN);
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ goto done;
++ }
++
++ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PMT_CTL\n");
++ goto done;
++ }
++
++ val &= ~(PMT_CTL_ED_EN | PMT_CTL_WOL_EN);
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ goto done;
++ }
++
++ ret = smsc75xx_enter_suspend2(dev);
++ goto done;
++ }
++
++ if (pdata->wolopts & WAKE_PHY) {
++ ret = smsc75xx_enable_phy_wakeup_interrupts(dev,
++ (PHY_INT_MASK_ANEG_COMP | PHY_INT_MASK_LINK_DOWN));
++ if (ret < 0) {
++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n");
++ goto done;
++ }
++
++ /* if link is down then configure EDPD and enter SUSPEND1,
++ * otherwise enter SUSPEND0 below
++ */
++ if (!link_up) {
++ struct mii_if_info *mii = &dev->mii;
++ netdev_info(dev->net, "entering SUSPEND1 mode\n");
++
++ /* enable energy detect power-down mode */
++ ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id,
++ PHY_MODE_CTRL_STS);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PHY_MODE_CTRL_STS\n");
++ goto done;
++ }
++
++ ret |= MODE_CTRL_STS_EDPWRDOWN;
++
++ smsc75xx_mdio_write_nopm(dev->net, mii->phy_id,
++ PHY_MODE_CTRL_STS, ret);
++
++ /* enter SUSPEND1 mode */
++ ret = smsc75xx_enter_suspend1(dev);
++ goto done;
++ }
++ }
++
++ if (pdata->wolopts & (WAKE_MCAST | WAKE_ARP)) {
++ int i, filter = 0;
++
++ /* disable all filters */
++ for (i = 0; i < WUF_NUM; i++) {
++ ret = smsc75xx_write_reg_nopm(dev, WUF_CFGX + i * 4, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUF_CFGX\n");
++ goto done;
++ }
++ }
++
++ if (pdata->wolopts & WAKE_MCAST) {
++ const u8 mcast[] = {0x01, 0x00, 0x5E};
++ netdev_info(dev->net, "enabling multicast detection\n");
++
++ val = WUF_CFGX_EN | WUF_CFGX_ATYPE_MULTICAST
++ | smsc_crc(mcast, 3);
++ ret = smsc75xx_write_wuff(dev, filter++, val, 0x0007);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing wakeup filter\n");
++ goto done;
++ }
++ }
++
++ if (pdata->wolopts & WAKE_ARP) {
++ const u8 arp[] = {0x08, 0x06};
++ netdev_info(dev->net, "enabling ARP detection\n");
++
++ val = WUF_CFGX_EN | WUF_CFGX_ATYPE_ALL | (0x0C << 16)
++ | smsc_crc(arp, 2);
++ ret = smsc75xx_write_wuff(dev, filter++, val, 0x0003);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing wakeup filter\n");
++ goto done;
++ }
++ }
++
++ /* clear any pending pattern match packet status */
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ goto done;
++ }
++
++ val |= WUCSR_WUFR;
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ goto done;
++ }
++
++ netdev_info(dev->net, "enabling packet match detection\n");
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ goto done;
++ }
++
++ val |= WUCSR_WUEN;
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ goto done;
++ }
++ } else {
++ netdev_info(dev->net, "disabling packet match detection\n");
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ goto done;
++ }
++
++ val &= ~WUCSR_WUEN;
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ goto done;
++ }
++ }
++
++ /* disable magic, bcast & unicast wakeup sources */
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ goto done;
++ }
++
++ val &= ~(WUCSR_MPEN | WUCSR_BCST_EN | WUCSR_PFDA_EN);
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ goto done;
++ }
++
++ if (pdata->wolopts & WAKE_PHY) {
++ netdev_info(dev->net, "enabling PHY wakeup\n");
++
++ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PMT_CTL\n");
++ goto done;
++ }
++
++ /* clear wol status, enable energy detection */
++ val &= ~PMT_CTL_WUPS;
++ val |= (PMT_CTL_WUPS_ED | PMT_CTL_ED_EN);
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ goto done;
++ }
++ }
++
++ if (pdata->wolopts & WAKE_MAGIC) {
++ netdev_info(dev->net, "enabling magic packet wakeup\n");
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ goto done;
++ }
++
++ /* clear any pending magic packet status */
++ val |= WUCSR_MPR | WUCSR_MPEN;
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ goto done;
++ }
++ }
++
++ if (pdata->wolopts & WAKE_BCAST) {
++ netdev_info(dev->net, "enabling broadcast detection\n");
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ goto done;
++ }
++
++ val |= WUCSR_BCAST_FR | WUCSR_BCST_EN;
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ goto done;
++ }
++ }
++
++ if (pdata->wolopts & WAKE_UCAST) {
++ netdev_info(dev->net, "enabling unicast detection\n");
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ goto done;
++ }
++
++ val |= WUCSR_WUFR | WUCSR_PFDA_EN;
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ goto done;
++ }
++ }
++
++ /* enable receiver to enable frame reception */
++ ret = smsc75xx_read_reg_nopm(dev, MAC_RX, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read MAC_RX: %d\n", ret);
++ goto done;
++ }
++
++ val |= MAC_RX_RXEN;
++
++ ret = smsc75xx_write_reg_nopm(dev, MAC_RX, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret);
++ goto done;
++ }
++
++ /* some wol options are enabled, so enter SUSPEND0 */
++ netdev_info(dev->net, "entering SUSPEND0 mode\n");
++ ret = smsc75xx_enter_suspend0(dev);
++
++done:
++ /*
++ * TODO: resume() might need to handle the suspend failure
++ * in system sleep
++ */
++ if (ret && PMSG_IS_AUTO(message))
++ usbnet_resume(intf);
++ return ret;
++}
++
++static int smsc75xx_resume(struct usb_interface *intf)
++{
++ struct usbnet *dev = usb_get_intfdata(intf);
++ struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
++ u8 suspend_flags = pdata->suspend_flags;
++ int ret;
++ u32 val;
++
++ netdev_dbg(dev->net, "resume suspend_flags=0x%02x\n", suspend_flags);
++
++ /* do this first to ensure it's cleared even in error case */
++ pdata->suspend_flags = 0;
++
++ if (suspend_flags & SUSPEND_ALLMODES) {
++ /* Disable wakeup sources */
++ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading WUCSR\n");
++ return ret;
++ }
++
++ val &= ~(WUCSR_WUEN | WUCSR_MPEN | WUCSR_PFDA_EN
++ | WUCSR_BCST_EN);
++
++ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing WUCSR\n");
++ return ret;
++ }
++
++ /* clear wake-up status */
++ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PMT_CTL\n");
++ return ret;
++ }
++
++ val &= ~PMT_CTL_WOL_EN;
++ val |= PMT_CTL_WUPS;
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ return ret;
++ }
++ }
++
++ if (suspend_flags & SUSPEND_SUSPEND2) {
++ netdev_info(dev->net, "resuming from SUSPEND2\n");
++
++ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading PMT_CTL\n");
++ return ret;
++ }
++
++ val |= PMT_CTL_PHY_PWRUP;
++
++ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing PMT_CTL\n");
++ return ret;
++ }
++ }
++
++ ret = smsc75xx_wait_ready(dev, 1);
++ if (ret < 0) {
++ netdev_warn(dev->net, "device not ready in smsc75xx_resume\n");
++ return ret;
++ }
++
++ return usbnet_resume(intf);
++}
++
++static void smsc75xx_rx_csum_offload(struct usbnet *dev, struct sk_buff *skb,
++ u32 rx_cmd_a, u32 rx_cmd_b)
++{
++ if (!(dev->net->features & NETIF_F_RXCSUM) ||
++ unlikely(rx_cmd_a & RX_CMD_A_LCSM)) {
++ skb->ip_summed = CHECKSUM_NONE;
++ } else {
++ skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT));
++ skb->ip_summed = CHECKSUM_COMPLETE;
++ }
++}
++
++static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ /* This check is no longer done by usbnet */
++ if (skb->len < dev->net->hard_header_len)
++ return 0;
++
++ while (skb->len > 0) {
++ u32 rx_cmd_a, rx_cmd_b, align_count, size;
++ struct sk_buff *ax_skb;
++ unsigned char *packet;
++
++ memcpy(&rx_cmd_a, skb->data, sizeof(rx_cmd_a));
++ le32_to_cpus(&rx_cmd_a);
++ skb_pull(skb, 4);
++
++ memcpy(&rx_cmd_b, skb->data, sizeof(rx_cmd_b));
++ le32_to_cpus(&rx_cmd_b);
++ skb_pull(skb, 4 + RXW_PADDING);
++
++ packet = skb->data;
++
++ /* get the packet length */
++ size = (rx_cmd_a & RX_CMD_A_LEN) - RXW_PADDING;
++ align_count = (4 - ((size + RXW_PADDING) % 4)) % 4;
++
++ if (unlikely(rx_cmd_a & RX_CMD_A_RED)) {
++ netif_dbg(dev, rx_err, dev->net,
++ "Error rx_cmd_a=0x%08x\n", rx_cmd_a);
++ dev->net->stats.rx_errors++;
++ dev->net->stats.rx_dropped++;
++
++ if (rx_cmd_a & RX_CMD_A_FCS)
++ dev->net->stats.rx_crc_errors++;
++ else if (rx_cmd_a & (RX_CMD_A_LONG | RX_CMD_A_RUNT))
++ dev->net->stats.rx_frame_errors++;
++ } else {
++ /* MAX_SINGLE_PACKET_SIZE + 4(CRC) + 2(COE) + 4(Vlan) */
++ if (unlikely(size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12))) {
++ netif_dbg(dev, rx_err, dev->net,
++ "size err rx_cmd_a=0x%08x\n",
++ rx_cmd_a);
++ return 0;
++ }
++
++ /* last frame in this batch */
++ if (skb->len == size) {
++ smsc75xx_rx_csum_offload(dev, skb, rx_cmd_a,
++ rx_cmd_b);
++
++ skb_trim(skb, skb->len - 4); /* remove fcs */
++ skb->truesize = size + sizeof(struct sk_buff);
++
++ return 1;
++ }
++
++ ax_skb = skb_clone(skb, GFP_ATOMIC);
++ if (unlikely(!ax_skb)) {
++ netdev_warn(dev->net, "Error allocating skb\n");
++ return 0;
++ }
++
++ ax_skb->len = size;
++ ax_skb->data = packet;
++ skb_set_tail_pointer(ax_skb, size);
++
++ smsc75xx_rx_csum_offload(dev, ax_skb, rx_cmd_a,
++ rx_cmd_b);
++
++ skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
++ ax_skb->truesize = size + sizeof(struct sk_buff);
++
++ usbnet_skb_return(dev, ax_skb);
++ }
++
++ skb_pull(skb, size);
++
++ /* padding bytes before the next frame starts */
++ if (skb->len)
++ skb_pull(skb, align_count);
++ }
++
++ if (unlikely(skb->len < 0)) {
++ netdev_warn(dev->net, "invalid rx length<0 %d\n", skb->len);
++ return 0;
++ }
++
++ return 1;
++}
++
++static struct sk_buff *smsc75xx_tx_fixup(struct usbnet *dev,
++ struct sk_buff *skb, gfp_t flags)
++{
++ u32 tx_cmd_a, tx_cmd_b;
++
++ if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
++ struct sk_buff *skb2 =
++ skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (!skb)
++ return NULL;
++ }
++
++ tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS;
++
++ if (skb->ip_summed == CHECKSUM_PARTIAL)
++ tx_cmd_a |= TX_CMD_A_IPE | TX_CMD_A_TPE;
++
++ if (skb_is_gso(skb)) {
++ u16 mss = max(skb_shinfo(skb)->gso_size, TX_MSS_MIN);
++ tx_cmd_b = (mss << TX_CMD_B_MSS_SHIFT) & TX_CMD_B_MSS;
++
++ tx_cmd_a |= TX_CMD_A_LSO;
++ } else {
++ tx_cmd_b = 0;
++ }
++
++ skb_push(skb, 4);
++ cpu_to_le32s(&tx_cmd_b);
++ memcpy(skb->data, &tx_cmd_b, 4);
++
++ skb_push(skb, 4);
++ cpu_to_le32s(&tx_cmd_a);
++ memcpy(skb->data, &tx_cmd_a, 4);
++
++ return skb;
++}
++
++static int smsc75xx_manage_power(struct usbnet *dev, int on)
++{
++ dev->intf->needs_remote_wakeup = on;
++ return 0;
++}
++
++static const struct driver_info smsc75xx_info = {
++ .description = "smsc75xx USB 2.0 Gigabit Ethernet",
++ .bind = smsc75xx_bind,
++ .unbind = smsc75xx_unbind,
++ .link_reset = smsc75xx_link_reset,
++ .reset = smsc75xx_reset,
++ .rx_fixup = smsc75xx_rx_fixup,
++ .tx_fixup = smsc75xx_tx_fixup,
++ .status = smsc75xx_status,
++ .manage_power = smsc75xx_manage_power,
++ .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ /* SMSC7500 USB Gigabit Ethernet Device */
++ USB_DEVICE(USB_VENDOR_ID_SMSC, USB_PRODUCT_ID_LAN7500),
++ .driver_info = (unsigned long) &smsc75xx_info,
++ },
++ {
++ /* SMSC7500 USB Gigabit Ethernet Device */
++ USB_DEVICE(USB_VENDOR_ID_SMSC, USB_PRODUCT_ID_LAN7505),
++ .driver_info = (unsigned long) &smsc75xx_info,
++ },
++ { }, /* END */
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver smsc75xx_driver = {
++ .name = SMSC_CHIPNAME,
++ .id_table = products,
++ .probe = usbnet_probe,
++ .suspend = smsc75xx_suspend,
++ .resume = smsc75xx_resume,
++ .reset_resume = smsc75xx_resume,
++ .disconnect = usbnet_disconnect,
++ .disable_hub_initiated_lpm = 1,
++ .supports_autosuspend = 1,
++};
++
++module_usb_driver(smsc75xx_driver);
++
++MODULE_AUTHOR("Nancy Lin");
++MODULE_AUTHOR("Steve Glendinning <steve.glendinning@shawell.net>");
++MODULE_DESCRIPTION("SMSC75XX USB 2.0 Gigabit Ethernet Devices");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc75xx.h backports-3.18.1-1/drivers/net/usb/smsc75xx.h
+--- backports-3.18.1-1.org/drivers/net/usb/smsc75xx.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/smsc75xx.h 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,421 @@
++ /***************************************************************************
++ *
++ * Copyright (C) 2007-2010 SMSC
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ *
++ *****************************************************************************/
++
++#ifndef _SMSC75XX_H
++#define _SMSC75XX_H
++
++/* Tx command words */
++#define TX_CMD_A_LSO (0x08000000)
++#define TX_CMD_A_IPE (0x04000000)
++#define TX_CMD_A_TPE (0x02000000)
++#define TX_CMD_A_IVTG (0x01000000)
++#define TX_CMD_A_RVTG (0x00800000)
++#define TX_CMD_A_FCS (0x00400000)
++#define TX_CMD_A_LEN (0x000FFFFF)
++
++#define TX_CMD_B_MSS (0x3FFF0000)
++#define TX_CMD_B_MSS_SHIFT (16)
++#define TX_MSS_MIN ((u16)8)
++#define TX_CMD_B_VTAG (0x0000FFFF)
++
++/* Rx command words */
++#define RX_CMD_A_ICE (0x80000000)
++#define RX_CMD_A_TCE (0x40000000)
++#define RX_CMD_A_IPV (0x20000000)
++#define RX_CMD_A_PID (0x18000000)
++#define RX_CMD_A_PID_NIP (0x00000000)
++#define RX_CMD_A_PID_TCP (0x08000000)
++#define RX_CMD_A_PID_UDP (0x10000000)
++#define RX_CMD_A_PID_PP (0x18000000)
++#define RX_CMD_A_PFF (0x04000000)
++#define RX_CMD_A_BAM (0x02000000)
++#define RX_CMD_A_MAM (0x01000000)
++#define RX_CMD_A_FVTG (0x00800000)
++#define RX_CMD_A_RED (0x00400000)
++#define RX_CMD_A_RWT (0x00200000)
++#define RX_CMD_A_RUNT (0x00100000)
++#define RX_CMD_A_LONG (0x00080000)
++#define RX_CMD_A_RXE (0x00040000)
++#define RX_CMD_A_DRB (0x00020000)
++#define RX_CMD_A_FCS (0x00010000)
++#define RX_CMD_A_UAM (0x00008000)
++#define RX_CMD_A_LCSM (0x00004000)
++#define RX_CMD_A_LEN (0x00003FFF)
++
++#define RX_CMD_B_CSUM (0xFFFF0000)
++#define RX_CMD_B_CSUM_SHIFT (16)
++#define RX_CMD_B_VTAG (0x0000FFFF)
++
++/* SCSRs */
++#define ID_REV (0x0000)
++
++#define FPGA_REV (0x0004)
++
++#define BOND_CTL (0x0008)
++
++#define INT_STS (0x000C)
++#define INT_STS_RDFO_INT (0x00400000)
++#define INT_STS_TXE_INT (0x00200000)
++#define INT_STS_MACRTO_INT (0x00100000)
++#define INT_STS_TX_DIS_INT (0x00080000)
++#define INT_STS_RX_DIS_INT (0x00040000)
++#define INT_STS_PHY_INT_ (0x00020000)
++#define INT_STS_MAC_ERR_INT (0x00008000)
++#define INT_STS_TDFU (0x00004000)
++#define INT_STS_TDFO (0x00002000)
++#define INT_STS_GPIOS (0x00000FFF)
++#define INT_STS_CLEAR_ALL (0xFFFFFFFF)
++
++#define HW_CFG (0x0010)
++#define HW_CFG_SMDET_STS (0x00008000)
++#define HW_CFG_SMDET_EN (0x00004000)
++#define HW_CFG_EEM (0x00002000)
++#define HW_CFG_RST_PROTECT (0x00001000)
++#define HW_CFG_PORT_SWAP (0x00000800)
++#define HW_CFG_PHY_BOOST (0x00000600)
++#define HW_CFG_PHY_BOOST_NORMAL (0x00000000)
++#define HW_CFG_PHY_BOOST_4 (0x00002000)
++#define HW_CFG_PHY_BOOST_8 (0x00004000)
++#define HW_CFG_PHY_BOOST_12 (0x00006000)
++#define HW_CFG_LEDB (0x00000100)
++#define HW_CFG_BIR (0x00000080)
++#define HW_CFG_SBP (0x00000040)
++#define HW_CFG_IME (0x00000020)
++#define HW_CFG_MEF (0x00000010)
++#define HW_CFG_ETC (0x00000008)
++#define HW_CFG_BCE (0x00000004)
++#define HW_CFG_LRST (0x00000002)
++#define HW_CFG_SRST (0x00000001)
++
++#define PMT_CTL (0x0014)
++#define PMT_CTL_PHY_PWRUP (0x00000400)
++#define PMT_CTL_RES_CLR_WKP_EN (0x00000100)
++#define PMT_CTL_DEV_RDY (0x00000080)
++#define PMT_CTL_SUS_MODE (0x00000060)
++#define PMT_CTL_SUS_MODE_0 (0x00000000)
++#define PMT_CTL_SUS_MODE_1 (0x00000020)
++#define PMT_CTL_SUS_MODE_2 (0x00000040)
++#define PMT_CTL_SUS_MODE_3 (0x00000060)
++#define PMT_CTL_PHY_RST (0x00000010)
++#define PMT_CTL_WOL_EN (0x00000008)
++#define PMT_CTL_ED_EN (0x00000004)
++#define PMT_CTL_WUPS (0x00000003)
++#define PMT_CTL_WUPS_NO (0x00000000)
++#define PMT_CTL_WUPS_ED (0x00000001)
++#define PMT_CTL_WUPS_WOL (0x00000002)
++#define PMT_CTL_WUPS_MULTI (0x00000003)
++
++#define LED_GPIO_CFG (0x0018)
++#define LED_GPIO_CFG_LED2_FUN_SEL (0x80000000)
++#define LED_GPIO_CFG_LED10_FUN_SEL (0x40000000)
++#define LED_GPIO_CFG_LEDGPIO_EN (0x0000F000)
++#define LED_GPIO_CFG_LEDGPIO_EN_0 (0x00001000)
++#define LED_GPIO_CFG_LEDGPIO_EN_1 (0x00002000)
++#define LED_GPIO_CFG_LEDGPIO_EN_2 (0x00004000)
++#define LED_GPIO_CFG_LEDGPIO_EN_3 (0x00008000)
++#define LED_GPIO_CFG_GPBUF (0x00000F00)
++#define LED_GPIO_CFG_GPBUF_0 (0x00000100)
++#define LED_GPIO_CFG_GPBUF_1 (0x00000200)
++#define LED_GPIO_CFG_GPBUF_2 (0x00000400)
++#define LED_GPIO_CFG_GPBUF_3 (0x00000800)
++#define LED_GPIO_CFG_GPDIR (0x000000F0)
++#define LED_GPIO_CFG_GPDIR_0 (0x00000010)
++#define LED_GPIO_CFG_GPDIR_1 (0x00000020)
++#define LED_GPIO_CFG_GPDIR_2 (0x00000040)
++#define LED_GPIO_CFG_GPDIR_3 (0x00000080)
++#define LED_GPIO_CFG_GPDATA (0x0000000F)
++#define LED_GPIO_CFG_GPDATA_0 (0x00000001)
++#define LED_GPIO_CFG_GPDATA_1 (0x00000002)
++#define LED_GPIO_CFG_GPDATA_2 (0x00000004)
++#define LED_GPIO_CFG_GPDATA_3 (0x00000008)
++
++#define GPIO_CFG (0x001C)
++#define GPIO_CFG_SHIFT (24)
++#define GPIO_CFG_GPEN (0xFF000000)
++#define GPIO_CFG_GPBUF (0x00FF0000)
++#define GPIO_CFG_GPDIR (0x0000FF00)
++#define GPIO_CFG_GPDATA (0x000000FF)
++
++#define GPIO_WAKE (0x0020)
++#define GPIO_WAKE_PHY_LINKUP_EN (0x80000000)
++#define GPIO_WAKE_POL (0x0FFF0000)
++#define GPIO_WAKE_POL_SHIFT (16)
++#define GPIO_WAKE_WK (0x00000FFF)
++
++#define DP_SEL (0x0024)
++#define DP_SEL_DPRDY (0x80000000)
++#define DP_SEL_RSEL (0x0000000F)
++#define DP_SEL_URX (0x00000000)
++#define DP_SEL_VHF (0x00000001)
++#define DP_SEL_VHF_HASH_LEN (16)
++#define DP_SEL_VHF_VLAN_LEN (128)
++#define DP_SEL_LSO_HEAD (0x00000002)
++#define DP_SEL_FCT_RX (0x00000003)
++#define DP_SEL_FCT_TX (0x00000004)
++#define DP_SEL_DESCRIPTOR (0x00000005)
++#define DP_SEL_WOL (0x00000006)
++
++#define DP_CMD (0x0028)
++#define DP_CMD_WRITE (0x01)
++#define DP_CMD_READ (0x00)
++
++#define DP_ADDR (0x002C)
++
++#define DP_DATA (0x0030)
++
++#define BURST_CAP (0x0034)
++#define BURST_CAP_MASK (0x0000000F)
++
++#define INT_EP_CTL (0x0038)
++#define INT_EP_CTL_INTEP_ON (0x80000000)
++#define INT_EP_CTL_RDFO_EN (0x00400000)
++#define INT_EP_CTL_TXE_EN (0x00200000)
++#define INT_EP_CTL_MACROTO_EN (0x00100000)
++#define INT_EP_CTL_TX_DIS_EN (0x00080000)
++#define INT_EP_CTL_RX_DIS_EN (0x00040000)
++#define INT_EP_CTL_PHY_EN_ (0x00020000)
++#define INT_EP_CTL_MAC_ERR_EN (0x00008000)
++#define INT_EP_CTL_TDFU_EN (0x00004000)
++#define INT_EP_CTL_TDFO_EN (0x00002000)
++#define INT_EP_CTL_RX_FIFO_EN (0x00001000)
++#define INT_EP_CTL_GPIOX_EN (0x00000FFF)
++
++#define BULK_IN_DLY (0x003C)
++#define BULK_IN_DLY_MASK (0xFFFF)
++
++#define E2P_CMD (0x0040)
++#define E2P_CMD_BUSY (0x80000000)
++#define E2P_CMD_MASK (0x70000000)
++#define E2P_CMD_READ (0x00000000)
++#define E2P_CMD_EWDS (0x10000000)
++#define E2P_CMD_EWEN (0x20000000)
++#define E2P_CMD_WRITE (0x30000000)
++#define E2P_CMD_WRAL (0x40000000)
++#define E2P_CMD_ERASE (0x50000000)
++#define E2P_CMD_ERAL (0x60000000)
++#define E2P_CMD_RELOAD (0x70000000)
++#define E2P_CMD_TIMEOUT (0x00000400)
++#define E2P_CMD_LOADED (0x00000200)
++#define E2P_CMD_ADDR (0x000001FF)
++
++#define MAX_EEPROM_SIZE (512)
++
++#define E2P_DATA (0x0044)
++#define E2P_DATA_MASK_ (0x000000FF)
++
++#define RFE_CTL (0x0060)
++#define RFE_CTL_TCPUDP_CKM (0x00001000)
++#define RFE_CTL_IP_CKM (0x00000800)
++#define RFE_CTL_AB (0x00000400)
++#define RFE_CTL_AM (0x00000200)
++#define RFE_CTL_AU (0x00000100)
++#define RFE_CTL_VS (0x00000080)
++#define RFE_CTL_UF (0x00000040)
++#define RFE_CTL_VF (0x00000020)
++#define RFE_CTL_SPF (0x00000010)
++#define RFE_CTL_MHF (0x00000008)
++#define RFE_CTL_DHF (0x00000004)
++#define RFE_CTL_DPF (0x00000002)
++#define RFE_CTL_RST_RF (0x00000001)
++
++#define VLAN_TYPE (0x0064)
++#define VLAN_TYPE_MASK (0x0000FFFF)
++
++#define FCT_RX_CTL (0x0090)
++#define FCT_RX_CTL_EN (0x80000000)
++#define FCT_RX_CTL_RST (0x40000000)
++#define FCT_RX_CTL_SBF (0x02000000)
++#define FCT_RX_CTL_OVERFLOW (0x01000000)
++#define FCT_RX_CTL_FRM_DROP (0x00800000)
++#define FCT_RX_CTL_RX_NOT_EMPTY (0x00400000)
++#define FCT_RX_CTL_RX_EMPTY (0x00200000)
++#define FCT_RX_CTL_RX_DISABLED (0x00100000)
++#define FCT_RX_CTL_RXUSED (0x0000FFFF)
++
++#define FCT_TX_CTL (0x0094)
++#define FCT_TX_CTL_EN (0x80000000)
++#define FCT_TX_CTL_RST (0x40000000)
++#define FCT_TX_CTL_TX_NOT_EMPTY (0x00400000)
++#define FCT_TX_CTL_TX_EMPTY (0x00200000)
++#define FCT_TX_CTL_TX_DISABLED (0x00100000)
++#define FCT_TX_CTL_TXUSED (0x0000FFFF)
++
++#define FCT_RX_FIFO_END (0x0098)
++#define FCT_RX_FIFO_END_MASK (0x0000007F)
++
++#define FCT_TX_FIFO_END (0x009C)
++#define FCT_TX_FIFO_END_MASK (0x0000003F)
++
++#define FCT_FLOW (0x00A0)
++#define FCT_FLOW_THRESHOLD_OFF (0x00007F00)
++#define FCT_FLOW_THRESHOLD_OFF_SHIFT (8)
++#define FCT_FLOW_THRESHOLD_ON (0x0000007F)
++
++/* MAC CSRs */
++#define MAC_CR (0x100)
++#define MAC_CR_ADP (0x00002000)
++#define MAC_CR_ADD (0x00001000)
++#define MAC_CR_ASD (0x00000800)
++#define MAC_CR_INT_LOOP (0x00000400)
++#define MAC_CR_BOLMT (0x000000C0)
++#define MAC_CR_FDPX (0x00000008)
++#define MAC_CR_CFG (0x00000006)
++#define MAC_CR_CFG_10 (0x00000000)
++#define MAC_CR_CFG_100 (0x00000002)
++#define MAC_CR_CFG_1000 (0x00000004)
++#define MAC_CR_RST (0x00000001)
++
++#define MAC_RX (0x104)
++#define MAC_RX_MAX_SIZE (0x3FFF0000)
++#define MAC_RX_MAX_SIZE_SHIFT (16)
++#define MAC_RX_FCS_STRIP (0x00000010)
++#define MAC_RX_FSE (0x00000004)
++#define MAC_RX_RXD (0x00000002)
++#define MAC_RX_RXEN (0x00000001)
++
++#define MAC_TX (0x108)
++#define MAC_TX_BFCS (0x00000004)
++#define MAC_TX_TXD (0x00000002)
++#define MAC_TX_TXEN (0x00000001)
++
++#define FLOW (0x10C)
++#define FLOW_FORCE_FC (0x80000000)
++#define FLOW_TX_FCEN (0x40000000)
++#define FLOW_RX_FCEN (0x20000000)
++#define FLOW_FPF (0x10000000)
++#define FLOW_PAUSE_TIME (0x0000FFFF)
++
++#define RAND_SEED (0x110)
++#define RAND_SEED_MASK (0x0000FFFF)
++
++#define ERR_STS (0x114)
++#define ERR_STS_FCS_ERR (0x00000100)
++#define ERR_STS_LFRM_ERR (0x00000080)
++#define ERR_STS_RUNT_ERR (0x00000040)
++#define ERR_STS_COLLISION_ERR (0x00000010)
++#define ERR_STS_ALIGN_ERR (0x00000008)
++#define ERR_STS_URUN_ERR (0x00000004)
++
++#define RX_ADDRH (0x118)
++#define RX_ADDRH_MASK (0x0000FFFF)
++
++#define RX_ADDRL (0x11C)
++
++#define MII_ACCESS (0x120)
++#define MII_ACCESS_PHY_ADDR (0x0000F800)
++#define MII_ACCESS_PHY_ADDR_SHIFT (11)
++#define MII_ACCESS_REG_ADDR (0x000007C0)
++#define MII_ACCESS_REG_ADDR_SHIFT (6)
++#define MII_ACCESS_READ (0x00000000)
++#define MII_ACCESS_WRITE (0x00000002)
++#define MII_ACCESS_BUSY (0x00000001)
++
++#define MII_DATA (0x124)
++#define MII_DATA_MASK (0x0000FFFF)
++
++#define WUCSR (0x140)
++#define WUCSR_PFDA_FR (0x00000080)
++#define WUCSR_WUFR (0x00000040)
++#define WUCSR_MPR (0x00000020)
++#define WUCSR_BCAST_FR (0x00000010)
++#define WUCSR_PFDA_EN (0x00000008)
++#define WUCSR_WUEN (0x00000004)
++#define WUCSR_MPEN (0x00000002)
++#define WUCSR_BCST_EN (0x00000001)
++
++#define WUF_CFGX (0x144)
++#define WUF_CFGX_EN (0x80000000)
++#define WUF_CFGX_ATYPE (0x03000000)
++#define WUF_CFGX_ATYPE_UNICAST (0x00000000)
++#define WUF_CFGX_ATYPE_MULTICAST (0x02000000)
++#define WUF_CFGX_ATYPE_ALL (0x03000000)
++#define WUF_CFGX_PATTERN_OFFSET (0x007F0000)
++#define WUF_CFGX_PATTERN_OFFSET_SHIFT (16)
++#define WUF_CFGX_CRC16 (0x0000FFFF)
++#define WUF_NUM (8)
++
++#define WUF_MASKX (0x170)
++#define WUF_MASKX_AVALID (0x80000000)
++#define WUF_MASKX_ATYPE (0x40000000)
++
++#define ADDR_FILTX (0x300)
++#define ADDR_FILTX_FB_VALID (0x80000000)
++#define ADDR_FILTX_FB_TYPE (0x40000000)
++#define ADDR_FILTX_FB_ADDRHI (0x0000FFFF)
++#define ADDR_FILTX_SB_ADDRLO (0xFFFFFFFF)
++
++#define WUCSR2 (0x500)
++#define WUCSR2_NS_RCD (0x00000040)
++#define WUCSR2_ARP_RCD (0x00000020)
++#define WUCSR2_TCPSYN_RCD (0x00000010)
++#define WUCSR2_NS_OFFLOAD (0x00000004)
++#define WUCSR2_ARP_OFFLOAD (0x00000002)
++#define WUCSR2_TCPSYN_OFFLOAD (0x00000001)
++
++#define WOL_FIFO_STS (0x504)
++
++#define IPV6_ADDRX (0x510)
++
++#define IPV4_ADDRX (0x590)
++
++
++/* Vendor-specific PHY Definitions */
++
++/* Mode Control/Status Register */
++#define PHY_MODE_CTRL_STS (17)
++#define MODE_CTRL_STS_EDPWRDOWN ((u16)0x2000)
++#define MODE_CTRL_STS_ENERGYON ((u16)0x0002)
++
++#define PHY_INT_SRC (29)
++#define PHY_INT_SRC_ENERGY_ON ((u16)0x0080)
++#define PHY_INT_SRC_ANEG_COMP ((u16)0x0040)
++#define PHY_INT_SRC_REMOTE_FAULT ((u16)0x0020)
++#define PHY_INT_SRC_LINK_DOWN ((u16)0x0010)
++#define PHY_INT_SRC_CLEAR_ALL ((u16)0xffff)
++
++#define PHY_INT_MASK (30)
++#define PHY_INT_MASK_ENERGY_ON ((u16)0x0080)
++#define PHY_INT_MASK_ANEG_COMP ((u16)0x0040)
++#define PHY_INT_MASK_REMOTE_FAULT ((u16)0x0020)
++#define PHY_INT_MASK_LINK_DOWN ((u16)0x0010)
++#define PHY_INT_MASK_DEFAULT (PHY_INT_MASK_ANEG_COMP | \
++ PHY_INT_MASK_LINK_DOWN)
++
++#define PHY_SPECIAL (31)
++#define PHY_SPECIAL_SPD ((u16)0x001C)
++#define PHY_SPECIAL_SPD_10HALF ((u16)0x0004)
++#define PHY_SPECIAL_SPD_10FULL ((u16)0x0014)
++#define PHY_SPECIAL_SPD_100HALF ((u16)0x0008)
++#define PHY_SPECIAL_SPD_100FULL ((u16)0x0018)
++
++/* USB Vendor Requests */
++#define USB_VENDOR_REQUEST_WRITE_REGISTER 0xA0
++#define USB_VENDOR_REQUEST_READ_REGISTER 0xA1
++#define USB_VENDOR_REQUEST_GET_STATS 0xA2
++
++/* Interrupt Endpoint status word bitfields */
++#define INT_ENP_RDFO_INT ((u32)BIT(22))
++#define INT_ENP_TXE_INT ((u32)BIT(21))
++#define INT_ENP_TX_DIS_INT ((u32)BIT(19))
++#define INT_ENP_RX_DIS_INT ((u32)BIT(18))
++#define INT_ENP_PHY_INT ((u32)BIT(17))
++#define INT_ENP_MAC_ERR_INT ((u32)BIT(15))
++#define INT_ENP_RX_FIFO_DATA_INT ((u32)BIT(12))
++
++#endif /* _SMSC75XX_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc95xx.c backports-3.18.1-1/drivers/net/usb/smsc95xx.c
+--- backports-3.18.1-1.org/drivers/net/usb/smsc95xx.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/smsc95xx.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,2030 @@
++ /***************************************************************************
++ *
++ * Copyright (C) 2007-2008 SMSC
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ *
++ *****************************************************************************/
++
++#include <linux/module.h>
++#include <linux/kmod.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/bitrev.h>
++#include <linux/crc16.h>
++#include <linux/crc32.h>
++#include <linux/usb/usbnet.h>
++#include <linux/slab.h>
++#include "smsc95xx.h"
++
++#define SMSC_CHIPNAME "smsc95xx"
++#define SMSC_DRIVER_VERSION "1.0.4"
++#define HS_USB_PKT_SIZE (512)
++#define FS_USB_PKT_SIZE (64)
++#define DEFAULT_HS_BURST_CAP_SIZE (16 * 1024 + 5 * HS_USB_PKT_SIZE)
++#define DEFAULT_FS_BURST_CAP_SIZE (6 * 1024 + 33 * FS_USB_PKT_SIZE)
++#define DEFAULT_BULK_IN_DELAY (0x00002000)
++#define MAX_SINGLE_PACKET_SIZE (2048)
++#define LAN95XX_EEPROM_MAGIC (0x9500)
++#define EEPROM_MAC_OFFSET (0x01)
++#define DEFAULT_TX_CSUM_ENABLE (true)
++#define DEFAULT_RX_CSUM_ENABLE (true)
++#define SMSC95XX_INTERNAL_PHY_ID (1)
++#define SMSC95XX_TX_OVERHEAD (8)
++#define SMSC95XX_TX_OVERHEAD_CSUM (12)
++#define SUPPORTED_WAKE (WAKE_PHY | WAKE_UCAST | WAKE_BCAST | \
++ WAKE_MCAST | WAKE_ARP | WAKE_MAGIC)
++
++#define FEATURE_8_WAKEUP_FILTERS (0x01)
++#define FEATURE_PHY_NLP_CROSSOVER (0x02)
++#define FEATURE_REMOTE_WAKEUP (0x04)
++
++#define SUSPEND_SUSPEND0 (0x01)
++#define SUSPEND_SUSPEND1 (0x02)
++#define SUSPEND_SUSPEND2 (0x04)
++#define SUSPEND_SUSPEND3 (0x08)
++#define SUSPEND_ALLMODES (SUSPEND_SUSPEND0 | SUSPEND_SUSPEND1 | \
++ SUSPEND_SUSPEND2 | SUSPEND_SUSPEND3)
++
++struct smsc95xx_priv {
++ u32 mac_cr;
++ u32 hash_hi;
++ u32 hash_lo;
++ u32 wolopts;
++ spinlock_t mac_cr_lock;
++ u8 features;
++ u8 suspend_flags;
++};
++
++static bool turbo_mode = true;
++module_param(turbo_mode, bool, 0644);
++MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
++
++static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
++ u32 *data, int in_pm)
++{
++ u32 buf;
++ int ret;
++ int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
++
++ BUG_ON(!dev);
++
++ if (!in_pm)
++ fn = usbnet_read_cmd;
++ else
++ fn = usbnet_read_cmd_nopm;
++
++ ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
++ | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ 0, index, &buf, 4);
++ if (unlikely(ret < 0))
++ netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
++ index, ret);
++
++ le32_to_cpus(&buf);
++ *data = buf;
++
++ return ret;
++}
++
++static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index,
++ u32 data, int in_pm)
++{
++ u32 buf;
++ int ret;
++ int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
++
++ BUG_ON(!dev);
++
++ if (!in_pm)
++ fn = usbnet_write_cmd;
++ else
++ fn = usbnet_write_cmd_nopm;
++
++ buf = data;
++ cpu_to_le32s(&buf);
++
++ ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
++ | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
++ 0, index, &buf, 4);
++ if (unlikely(ret < 0))
++ netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",
++ index, ret);
++
++ return ret;
++}
++
++static int __must_check smsc95xx_read_reg_nopm(struct usbnet *dev, u32 index,
++ u32 *data)
++{
++ return __smsc95xx_read_reg(dev, index, data, 1);
++}
++
++static int __must_check smsc95xx_write_reg_nopm(struct usbnet *dev, u32 index,
++ u32 data)
++{
++ return __smsc95xx_write_reg(dev, index, data, 1);
++}
++
++static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index,
++ u32 *data)
++{
++ return __smsc95xx_read_reg(dev, index, data, 0);
++}
++
++static int __must_check smsc95xx_write_reg(struct usbnet *dev, u32 index,
++ u32 data)
++{
++ return __smsc95xx_write_reg(dev, index, data, 0);
++}
++
++/* Loop until the read is completed with timeout
++ * called with phy_mutex held */
++static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev,
++ int in_pm)
++{
++ unsigned long start_time = jiffies;
++ u32 val;
++ int ret;
++
++ do {
++ ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading MII_ACCESS\n");
++ return ret;
++ }
++
++ if (!(val & MII_BUSY_))
++ return 0;
++ } while (!time_after(jiffies, start_time + HZ));
++
++ return -EIO;
++}
++
++static int __smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx,
++ int in_pm)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u32 val, addr;
++ int ret;
++
++ mutex_lock(&dev->phy_mutex);
++
++ /* confirm MII not busy */
++ ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_read\n");
++ goto done;
++ }
++
++ /* set the address, index & direction (read from PHY) */
++ phy_id &= dev->mii.phy_id_mask;
++ idx &= dev->mii.reg_num_mask;
++ addr = (phy_id << 11) | (idx << 6) | MII_READ_ | MII_BUSY_;
++ ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing MII_ADDR\n");
++ goto done;
++ }
++
++ ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Timed out reading MII reg %02X\n", idx);
++ goto done;
++ }
++
++ ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading MII_DATA\n");
++ goto done;
++ }
++
++ ret = (u16)(val & 0xFFFF);
++
++done:
++ mutex_unlock(&dev->phy_mutex);
++ return ret;
++}
++
++static void __smsc95xx_mdio_write(struct net_device *netdev, int phy_id,
++ int idx, int regval, int in_pm)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u32 val, addr;
++ int ret;
++
++ mutex_lock(&dev->phy_mutex);
++
++ /* confirm MII not busy */
++ ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_write\n");
++ goto done;
++ }
++
++ val = regval;
++ ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing MII_DATA\n");
++ goto done;
++ }
++
++ /* set the address, index & direction (write to PHY) */
++ phy_id &= dev->mii.phy_id_mask;
++ idx &= dev->mii.reg_num_mask;
++ addr = (phy_id << 11) | (idx << 6) | MII_WRITE_ | MII_BUSY_;
++ ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing MII_ADDR\n");
++ goto done;
++ }
++
++ ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Timed out writing MII reg %02X\n", idx);
++ goto done;
++ }
++
++done:
++ mutex_unlock(&dev->phy_mutex);
++}
++
++static int smsc95xx_mdio_read_nopm(struct net_device *netdev, int phy_id,
++ int idx)
++{
++ return __smsc95xx_mdio_read(netdev, phy_id, idx, 1);
++}
++
++static void smsc95xx_mdio_write_nopm(struct net_device *netdev, int phy_id,
++ int idx, int regval)
++{
++ __smsc95xx_mdio_write(netdev, phy_id, idx, regval, 1);
++}
++
++static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
++{
++ return __smsc95xx_mdio_read(netdev, phy_id, idx, 0);
++}
++
++static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
++ int regval)
++{
++ __smsc95xx_mdio_write(netdev, phy_id, idx, regval, 0);
++}
++
++static int __must_check smsc95xx_wait_eeprom(struct usbnet *dev)
++{
++ unsigned long start_time = jiffies;
++ u32 val;
++ int ret;
++
++ do {
++ ret = smsc95xx_read_reg(dev, E2P_CMD, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading E2P_CMD\n");
++ return ret;
++ }
++
++ if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_))
++ break;
++ udelay(40);
++ } while (!time_after(jiffies, start_time + HZ));
++
++ if (val & (E2P_CMD_TIMEOUT_ | E2P_CMD_BUSY_)) {
++ netdev_warn(dev->net, "EEPROM read operation timeout\n");
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static int __must_check smsc95xx_eeprom_confirm_not_busy(struct usbnet *dev)
++{
++ unsigned long start_time = jiffies;
++ u32 val;
++ int ret;
++
++ do {
++ ret = smsc95xx_read_reg(dev, E2P_CMD, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading E2P_CMD\n");
++ return ret;
++ }
++
++ if (!(val & E2P_CMD_BUSY_))
++ return 0;
++
++ udelay(40);
++ } while (!time_after(jiffies, start_time + HZ));
++
++ netdev_warn(dev->net, "EEPROM is busy\n");
++ return -EIO;
++}
++
++static int smsc95xx_read_eeprom(struct usbnet *dev, u32 offset, u32 length,
++ u8 *data)
++{
++ u32 val;
++ int i, ret;
++
++ BUG_ON(!dev);
++ BUG_ON(!data);
++
++ ret = smsc95xx_eeprom_confirm_not_busy(dev);
++ if (ret)
++ return ret;
++
++ for (i = 0; i < length; i++) {
++ val = E2P_CMD_BUSY_ | E2P_CMD_READ_ | (offset & E2P_CMD_ADDR_);
++ ret = smsc95xx_write_reg(dev, E2P_CMD, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing E2P_CMD\n");
++ return ret;
++ }
++
++ ret = smsc95xx_wait_eeprom(dev);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_read_reg(dev, E2P_DATA, &val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error reading E2P_DATA\n");
++ return ret;
++ }
++
++ data[i] = val & 0xFF;
++ offset++;
++ }
++
++ return 0;
++}
++
++static int smsc95xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length,
++ u8 *data)
++{
++ u32 val;
++ int i, ret;
++
++ BUG_ON(!dev);
++ BUG_ON(!data);
++
++ ret = smsc95xx_eeprom_confirm_not_busy(dev);
++ if (ret)
++ return ret;
++
++ /* Issue write/erase enable command */
++ val = E2P_CMD_BUSY_ | E2P_CMD_EWEN_;
++ ret = smsc95xx_write_reg(dev, E2P_CMD, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing E2P_DATA\n");
++ return ret;
++ }
++
++ ret = smsc95xx_wait_eeprom(dev);
++ if (ret < 0)
++ return ret;
++
++ for (i = 0; i < length; i++) {
++
++ /* Fill data register */
++ val = data[i];
++ ret = smsc95xx_write_reg(dev, E2P_DATA, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing E2P_DATA\n");
++ return ret;
++ }
++
++ /* Send "write" command */
++ val = E2P_CMD_BUSY_ | E2P_CMD_WRITE_ | (offset & E2P_CMD_ADDR_);
++ ret = smsc95xx_write_reg(dev, E2P_CMD, val);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Error writing E2P_CMD\n");
++ return ret;
++ }
++
++ ret = smsc95xx_wait_eeprom(dev);
++ if (ret < 0)
++ return ret;
++
++ offset++;
++ }
++
++ return 0;
++}
++
++static int __must_check smsc95xx_write_reg_async(struct usbnet *dev, u16 index,
++ u32 data)
++{
++ const u16 size = 4;
++ u32 buf;
++ int ret;
++
++ buf = data;
++ cpu_to_le32s(&buf);
++
++ ret = usbnet_write_cmd_async(dev, USB_VENDOR_REQUEST_WRITE_REGISTER,
++ USB_DIR_OUT | USB_TYPE_VENDOR |
++ USB_RECIP_DEVICE,
++ 0, index, &buf, size);
++ if (ret < 0)
++ netdev_warn(dev->net, "Error write async cmd, sts=%d\n",
++ ret);
++ return ret;
++}
++
++/* returns hash bit number for given MAC address
++ * example:
++ * 01 00 5E 00 00 01 -> returns bit number 31 */
++static unsigned int smsc95xx_hash(char addr[ETH_ALEN])
++{
++ return (ether_crc(ETH_ALEN, addr) >> 26) & 0x3f;
++}
++
++static void smsc95xx_set_multicast(struct net_device *netdev)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ unsigned long flags;
++ int ret;
++
++ pdata->hash_hi = 0;
++ pdata->hash_lo = 0;
++
++ spin_lock_irqsave(&pdata->mac_cr_lock, flags);
++
++ if (dev->net->flags & IFF_PROMISC) {
++ netif_dbg(dev, drv, dev->net, "promiscuous mode enabled\n");
++ pdata->mac_cr |= MAC_CR_PRMS_;
++ pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_);
++ } else if (dev->net->flags & IFF_ALLMULTI) {
++ netif_dbg(dev, drv, dev->net, "receive all multicast enabled\n");
++ pdata->mac_cr |= MAC_CR_MCPAS_;
++ pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_);
++ } else if (!netdev_mc_empty(dev->net)) {
++ struct netdev_hw_addr *ha;
++
++ pdata->mac_cr |= MAC_CR_HPFILT_;
++ pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_);
++
++ netdev_for_each_mc_addr(ha, netdev) {
++ u32 bitnum = smsc95xx_hash(ha->addr);
++ u32 mask = 0x01 << (bitnum & 0x1F);
++ if (bitnum & 0x20)
++ pdata->hash_hi |= mask;
++ else
++ pdata->hash_lo |= mask;
++ }
++
++ netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n",
++ pdata->hash_hi, pdata->hash_lo);
++ } else {
++ netif_dbg(dev, drv, dev->net, "receive own packets only\n");
++ pdata->mac_cr &=
++ ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_);
++ }
++
++ spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);
++
++ /* Initiate async writes, as we can't wait for completion here */
++ ret = smsc95xx_write_reg_async(dev, HASHH, pdata->hash_hi);
++ if (ret < 0)
++ netdev_warn(dev->net, "failed to initiate async write to HASHH\n");
++
++ ret = smsc95xx_write_reg_async(dev, HASHL, pdata->hash_lo);
++ if (ret < 0)
++ netdev_warn(dev->net, "failed to initiate async write to HASHL\n");
++
++ ret = smsc95xx_write_reg_async(dev, MAC_CR, pdata->mac_cr);
++ if (ret < 0)
++ netdev_warn(dev->net, "failed to initiate async write to MAC_CR\n");
++}
++
++static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
++ u16 lcladv, u16 rmtadv)
++{
++ u32 flow, afc_cfg = 0;
++
++ int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg);
++ if (ret < 0)
++ return ret;
++
++ if (duplex == DUPLEX_FULL) {
++ u8 cap = mii_resolve_flowctrl_fdx(lcladv, rmtadv);
++
++ if (cap & FLOW_CTRL_RX)
++ flow = 0xFFFF0002;
++ else
++ flow = 0;
++
++ if (cap & FLOW_CTRL_TX)
++ afc_cfg |= 0xF;
++ else
++ afc_cfg &= ~0xF;
++
++ netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n",
++ cap & FLOW_CTRL_RX ? "enabled" : "disabled",
++ cap & FLOW_CTRL_TX ? "enabled" : "disabled");
++ } else {
++ netif_dbg(dev, link, dev->net, "half duplex\n");
++ flow = 0;
++ afc_cfg |= 0xF;
++ }
++
++ ret = smsc95xx_write_reg(dev, FLOW, flow);
++ if (ret < 0)
++ return ret;
++
++ return smsc95xx_write_reg(dev, AFC_CFG, afc_cfg);
++}
++
++static int smsc95xx_link_reset(struct usbnet *dev)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ struct mii_if_info *mii = &dev->mii;
++ struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
++ unsigned long flags;
++ u16 lcladv, rmtadv;
++ int ret;
++
++ /* clear interrupt status */
++ ret = smsc95xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_);
++ if (ret < 0)
++ return ret;
++
++ mii_check_media(mii, 1, 1);
++ mii_ethtool_gset(&dev->mii, &ecmd);
++ lcladv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE);
++ rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA);
++
++ netif_dbg(dev, link, dev->net,
++ "speed: %u duplex: %d lcladv: %04x rmtadv: %04x\n",
++ ethtool_cmd_speed(&ecmd), ecmd.duplex, lcladv, rmtadv);
++
++ spin_lock_irqsave(&pdata->mac_cr_lock, flags);
++ if (ecmd.duplex != DUPLEX_FULL) {
++ pdata->mac_cr &= ~MAC_CR_FDPX_;
++ pdata->mac_cr |= MAC_CR_RCVOWN_;
++ } else {
++ pdata->mac_cr &= ~MAC_CR_RCVOWN_;
++ pdata->mac_cr |= MAC_CR_FDPX_;
++ }
++ spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);
++
++ ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_phy_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv);
++ if (ret < 0)
++ netdev_warn(dev->net, "Error updating PHY flow control\n");
++
++ return ret;
++}
++
++static void smsc95xx_status(struct usbnet *dev, struct urb *urb)
++{
++ u32 intdata;
++
++ if (urb->actual_length != 4) {
++ netdev_warn(dev->net, "unexpected urb length %d\n",
++ urb->actual_length);
++ return;
++ }
++
++ memcpy(&intdata, urb->transfer_buffer, 4);
++ le32_to_cpus(&intdata);
++
++ netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata);
++
++ if (intdata & INT_ENP_PHY_INT_)
++ usbnet_defer_kevent(dev, EVENT_LINK_RESET);
++ else
++ netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n",
++ intdata);
++}
++
++/* Enable or disable Tx & Rx checksum offload engines */
++static int smsc95xx_set_features(struct net_device *netdev,
++ netdev_features_t features)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u32 read_buf;
++ int ret;
++
++ ret = smsc95xx_read_reg(dev, COE_CR, &read_buf);
++ if (ret < 0)
++ return ret;
++
++ if (features & NETIF_F_HW_CSUM)
++ read_buf |= Tx_COE_EN_;
++ else
++ read_buf &= ~Tx_COE_EN_;
++
++ if (features & NETIF_F_RXCSUM)
++ read_buf |= Rx_COE_EN_;
++ else
++ read_buf &= ~Rx_COE_EN_;
++
++ ret = smsc95xx_write_reg(dev, COE_CR, read_buf);
++ if (ret < 0)
++ return ret;
++
++ netif_dbg(dev, hw, dev->net, "COE_CR = 0x%08x\n", read_buf);
++ return 0;
++}
++
++static int smsc95xx_ethtool_get_eeprom_len(struct net_device *net)
++{
++ return MAX_EEPROM_SIZE;
++}
++
++static int smsc95xx_ethtool_get_eeprom(struct net_device *netdev,
++ struct ethtool_eeprom *ee, u8 *data)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++
++ ee->magic = LAN95XX_EEPROM_MAGIC;
++
++ return smsc95xx_read_eeprom(dev, ee->offset, ee->len, data);
++}
++
++static int smsc95xx_ethtool_set_eeprom(struct net_device *netdev,
++ struct ethtool_eeprom *ee, u8 *data)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++
++ if (ee->magic != LAN95XX_EEPROM_MAGIC) {
++ netdev_warn(dev->net, "EEPROM: magic value mismatch, magic = 0x%x\n",
++ ee->magic);
++ return -EINVAL;
++ }
++
++ return smsc95xx_write_eeprom(dev, ee->offset, ee->len, data);
++}
++
++static int smsc95xx_ethtool_getregslen(struct net_device *netdev)
++{
++ /* all smsc95xx registers */
++ return COE_CR - ID_REV + sizeof(u32);
++}
++
++static void
++smsc95xx_ethtool_getregs(struct net_device *netdev, struct ethtool_regs *regs,
++ void *buf)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ unsigned int i, j;
++ int retval;
++ u32 *data = buf;
++
++ retval = smsc95xx_read_reg(dev, ID_REV, ®s->version);
++ if (retval < 0) {
++ netdev_warn(netdev, "REGS: cannot read ID_REV\n");
++ return;
++ }
++
++ for (i = ID_REV, j = 0; i <= COE_CR; i += (sizeof(u32)), j++) {
++ retval = smsc95xx_read_reg(dev, i, &data[j]);
++ if (retval < 0) {
++ netdev_warn(netdev, "REGS: cannot read reg[%x]\n", i);
++ return;
++ }
++ }
++}
++
++static void smsc95xx_ethtool_get_wol(struct net_device *net,
++ struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++
++ wolinfo->supported = SUPPORTED_WAKE;
++ wolinfo->wolopts = pdata->wolopts;
++}
++
++static int smsc95xx_ethtool_set_wol(struct net_device *net,
++ struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ int ret;
++
++ pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE;
++
++ ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts);
++ if (ret < 0)
++ netdev_warn(dev->net, "device_set_wakeup_enable error %d\n", ret);
++
++ return ret;
++}
++
++static const struct ethtool_ops smsc95xx_ethtool_ops = {
++ .get_link = usbnet_get_link,
++ .nway_reset = usbnet_nway_reset,
++ .get_drvinfo = usbnet_get_drvinfo,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .get_eeprom_len = smsc95xx_ethtool_get_eeprom_len,
++ .get_eeprom = smsc95xx_ethtool_get_eeprom,
++ .set_eeprom = smsc95xx_ethtool_set_eeprom,
++ .get_regs_len = smsc95xx_ethtool_getregslen,
++ .get_regs = smsc95xx_ethtool_getregs,
++ .get_wol = smsc95xx_ethtool_get_wol,
++ .set_wol = smsc95xx_ethtool_set_wol,
++};
++
++static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++
++ if (!netif_running(netdev))
++ return -EINVAL;
++
++ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
++}
++
++static void smsc95xx_init_mac_address(struct usbnet *dev)
++{
++ /* try reading mac address from EEPROM */
++ if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
++ dev->net->dev_addr) == 0) {
++ if (is_valid_ether_addr(dev->net->dev_addr)) {
++ /* eeprom values are valid so use them */
++ netif_dbg(dev, ifup, dev->net, "MAC address read from EEPROM\n");
++ return;
++ }
++ }
++
++ /* no eeprom, or eeprom values are invalid. generate random MAC */
++ eth_hw_addr_random(dev->net);
++ netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");
++}
++
++static int smsc95xx_set_mac_address(struct usbnet *dev)
++{
++ u32 addr_lo = dev->net->dev_addr[0] | dev->net->dev_addr[1] << 8 |
++ dev->net->dev_addr[2] << 16 | dev->net->dev_addr[3] << 24;
++ u32 addr_hi = dev->net->dev_addr[4] | dev->net->dev_addr[5] << 8;
++ int ret;
++
++ ret = smsc95xx_write_reg(dev, ADDRL, addr_lo);
++ if (ret < 0)
++ return ret;
++
++ return smsc95xx_write_reg(dev, ADDRH, addr_hi);
++}
++
++/* starts the TX path */
++static int smsc95xx_start_tx_path(struct usbnet *dev)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ unsigned long flags;
++ int ret;
++
++ /* Enable Tx at MAC */
++ spin_lock_irqsave(&pdata->mac_cr_lock, flags);
++ pdata->mac_cr |= MAC_CR_TXEN_;
++ spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);
++
++ ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr);
++ if (ret < 0)
++ return ret;
++
++ /* Enable Tx at SCSRs */
++ return smsc95xx_write_reg(dev, TX_CFG, TX_CFG_ON_);
++}
++
++/* Starts the Receive path */
++static int smsc95xx_start_rx_path(struct usbnet *dev, int in_pm)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ unsigned long flags;
++
++ spin_lock_irqsave(&pdata->mac_cr_lock, flags);
++ pdata->mac_cr |= MAC_CR_RXEN_;
++ spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);
++
++ return __smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr, in_pm);
++}
++
++static int smsc95xx_phy_initialize(struct usbnet *dev)
++{
++ int bmcr, ret, timeout = 0;
++
++ /* Initialize MII structure */
++ dev->mii.dev = dev->net;
++ dev->mii.mdio_read = smsc95xx_mdio_read;
++ dev->mii.mdio_write = smsc95xx_mdio_write;
++ dev->mii.phy_id_mask = 0x1f;
++ dev->mii.reg_num_mask = 0x1f;
++ dev->mii.phy_id = SMSC95XX_INTERNAL_PHY_ID;
++
++ /* reset phy and wait for reset to complete */
++ smsc95xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
++
++ do {
++ msleep(10);
++ bmcr = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
++ timeout++;
++ } while ((bmcr & BMCR_RESET) && (timeout < 100));
++
++ if (timeout >= 100) {
++ netdev_warn(dev->net, "timeout on PHY Reset");
++ return -EIO;
++ }
++
++ smsc95xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
++ ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
++ ADVERTISE_PAUSE_ASYM);
++
++ /* read to clear */
++ ret = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to read PHY_INT_SRC during init\n");
++ return ret;
++ }
++
++ smsc95xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
++ PHY_INT_MASK_DEFAULT_);
++ mii_nway_restart(&dev->mii);
++
++ netif_dbg(dev, ifup, dev->net, "phy initialised successfully\n");
++ return 0;
++}
++
++static int smsc95xx_reset(struct usbnet *dev)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ u32 read_buf, write_buf, burst_cap;
++ int ret = 0, timeout;
++
++ netif_dbg(dev, ifup, dev->net, "entering smsc95xx_reset\n");
++
++ ret = smsc95xx_write_reg(dev, HW_CFG, HW_CFG_LRST_);
++ if (ret < 0)
++ return ret;
++
++ timeout = 0;
++ do {
++ msleep(10);
++ ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
++ if (ret < 0)
++ return ret;
++ timeout++;
++ } while ((read_buf & HW_CFG_LRST_) && (timeout < 100));
++
++ if (timeout >= 100) {
++ netdev_warn(dev->net, "timeout waiting for completion of Lite Reset\n");
++ return ret;
++ }
++
++ ret = smsc95xx_write_reg(dev, PM_CTRL, PM_CTL_PHY_RST_);
++ if (ret < 0)
++ return ret;
++
++ timeout = 0;
++ do {
++ msleep(10);
++ ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf);
++ if (ret < 0)
++ return ret;
++ timeout++;
++ } while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100));
++
++ if (timeout >= 100) {
++ netdev_warn(dev->net, "timeout waiting for PHY Reset\n");
++ return ret;
++ }
++
++ ret = smsc95xx_set_mac_address(dev);
++ if (ret < 0)
++ return ret;
++
++ netif_dbg(dev, ifup, dev->net, "MAC Address: %pM\n",
++ dev->net->dev_addr);
++
++ ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
++ if (ret < 0)
++ return ret;
++
++ netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG : 0x%08x\n",
++ read_buf);
++
++ read_buf |= HW_CFG_BIR_;
++
++ ret = smsc95xx_write_reg(dev, HW_CFG, read_buf);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
++ if (ret < 0)
++ return ret;
++
++ netif_dbg(dev, ifup, dev->net,
++ "Read Value from HW_CFG after writing HW_CFG_BIR_: 0x%08x\n",
++ read_buf);
++
++ if (!turbo_mode) {
++ burst_cap = 0;
++ dev->rx_urb_size = MAX_SINGLE_PACKET_SIZE;
++ } else if (dev->udev->speed == USB_SPEED_HIGH) {
++ burst_cap = DEFAULT_HS_BURST_CAP_SIZE / HS_USB_PKT_SIZE;
++ dev->rx_urb_size = DEFAULT_HS_BURST_CAP_SIZE;
++ } else {
++ burst_cap = DEFAULT_FS_BURST_CAP_SIZE / FS_USB_PKT_SIZE;
++ dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n",
++ (ulong)dev->rx_urb_size);
++
++ ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_read_reg(dev, BURST_CAP, &read_buf);
++ if (ret < 0)
++ return ret;
++
++ netif_dbg(dev, ifup, dev->net,
++ "Read Value from BURST_CAP after writing: 0x%08x\n",
++ read_buf);
++
++ ret = smsc95xx_write_reg(dev, BULK_IN_DLY, DEFAULT_BULK_IN_DELAY);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_read_reg(dev, BULK_IN_DLY, &read_buf);
++ if (ret < 0)
++ return ret;
++
++ netif_dbg(dev, ifup, dev->net,
++ "Read Value from BULK_IN_DLY after writing: 0x%08x\n",
++ read_buf);
++
++ ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
++ if (ret < 0)
++ return ret;
++
++ netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG: 0x%08x\n",
++ read_buf);
++
++ if (turbo_mode)
++ read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_);
++
++ read_buf &= ~HW_CFG_RXDOFF_;
++
++ /* set Rx data offset=2, Make IP header aligns on word boundary. */
++ read_buf |= NET_IP_ALIGN << 9;
++
++ ret = smsc95xx_write_reg(dev, HW_CFG, read_buf);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
++ if (ret < 0)
++ return ret;
++
++ netif_dbg(dev, ifup, dev->net,
++ "Read Value from HW_CFG after writing: 0x%08x\n", read_buf);
++
++ ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_read_reg(dev, ID_REV, &read_buf);
++ if (ret < 0)
++ return ret;
++ netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", read_buf);
++
++ /* Configure GPIO pins as LED outputs */
++ write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
++ LED_GPIO_CFG_FDX_LED;
++ ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf);
++ if (ret < 0)
++ return ret;
++
++ /* Init Tx */
++ ret = smsc95xx_write_reg(dev, FLOW, 0);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_write_reg(dev, AFC_CFG, AFC_CFG_DEFAULT);
++ if (ret < 0)
++ return ret;
++
++ /* Don't need mac_cr_lock during initialisation */
++ ret = smsc95xx_read_reg(dev, MAC_CR, &pdata->mac_cr);
++ if (ret < 0)
++ return ret;
++
++ /* Init Rx */
++ /* Set Vlan */
++ ret = smsc95xx_write_reg(dev, VLAN1, (u32)ETH_P_8021Q);
++ if (ret < 0)
++ return ret;
++
++ /* Enable or disable checksum offload engines */
++ ret = smsc95xx_set_features(dev->net, dev->net->features);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to set checksum offload features\n");
++ return ret;
++ }
++
++ smsc95xx_set_multicast(dev->net);
++
++ ret = smsc95xx_phy_initialize(dev);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to init PHY\n");
++ return ret;
++ }
++
++ ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf);
++ if (ret < 0)
++ return ret;
++
++ /* enable PHY interrupts */
++ read_buf |= INT_EP_CTL_PHY_INT_;
++
++ ret = smsc95xx_write_reg(dev, INT_EP_CTL, read_buf);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_start_tx_path(dev);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to start TX path\n");
++ return ret;
++ }
++
++ ret = smsc95xx_start_rx_path(dev, 0);
++ if (ret < 0) {
++ netdev_warn(dev->net, "Failed to start RX path\n");
++ return ret;
++ }
++
++ netif_dbg(dev, ifup, dev->net, "smsc95xx_reset, return 0\n");
++ return 0;
++}
++
++static const struct net_device_ops smsc95xx_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_set_mac_address = eth_mac_addr,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = smsc95xx_ioctl,
++ .ndo_set_rx_mode = smsc95xx_set_multicast,
++ .ndo_set_features = smsc95xx_set_features,
++};
++
++static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ struct smsc95xx_priv *pdata = NULL;
++ u32 val;
++ int ret;
++
++ printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n");
++
++ ret = usbnet_get_endpoints(dev, intf);
++ if (ret < 0) {
++ netdev_warn(dev->net, "usbnet_get_endpoints failed: %d\n", ret);
++ return ret;
++ }
++
++ dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc95xx_priv),
++ GFP_KERNEL);
++
++ pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ if (!pdata)
++ return -ENOMEM;
++
++ spin_lock_init(&pdata->mac_cr_lock);
++
++ if (DEFAULT_TX_CSUM_ENABLE)
++ dev->net->features |= NETIF_F_HW_CSUM;
++ if (DEFAULT_RX_CSUM_ENABLE)
++ dev->net->features |= NETIF_F_RXCSUM;
++
++ dev->net->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
++
++ smsc95xx_init_mac_address(dev);
++
++ /* Init all registers */
++ ret = smsc95xx_reset(dev);
++
++ /* detect device revision as different features may be available */
++ ret = smsc95xx_read_reg(dev, ID_REV, &val);
++ if (ret < 0)
++ return ret;
++ val >>= 16;
++
++ if ((val == ID_REV_CHIP_ID_9500A_) || (val == ID_REV_CHIP_ID_9530_) ||
++ (val == ID_REV_CHIP_ID_89530_) || (val == ID_REV_CHIP_ID_9730_))
++ pdata->features = (FEATURE_8_WAKEUP_FILTERS |
++ FEATURE_PHY_NLP_CROSSOVER |
++ FEATURE_REMOTE_WAKEUP);
++ else if (val == ID_REV_CHIP_ID_9512_)
++ pdata->features = FEATURE_8_WAKEUP_FILTERS;
++
++ dev->net->netdev_ops = &smsc95xx_netdev_ops;
++ dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
++ dev->net->flags |= IFF_MULTICAST;
++ dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
++ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
++ return 0;
++}
++
++static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ if (pdata) {
++ netif_dbg(dev, ifdown, dev->net, "free pdata\n");
++ kfree(pdata);
++ pdata = NULL;
++ dev->data[0] = 0;
++ }
++}
++
++static u32 smsc_crc(const u8 *buffer, size_t len, int filter)
++{
++ u32 crc = bitrev16(crc16(0xFFFF, buffer, len));
++ return crc << ((filter % 2) * 16);
++}
++
++static int smsc95xx_enable_phy_wakeup_interrupts(struct usbnet *dev, u16 mask)
++{
++ struct mii_if_info *mii = &dev->mii;
++ int ret;
++
++ netdev_dbg(dev->net, "enabling PHY wakeup interrupts\n");
++
++ /* read to clear */
++ ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_SRC);
++ if (ret < 0)
++ return ret;
++
++ /* enable interrupt source */
++ ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_MASK);
++ if (ret < 0)
++ return ret;
++
++ ret |= mask;
++
++ smsc95xx_mdio_write_nopm(dev->net, mii->phy_id, PHY_INT_MASK, ret);
++
++ return 0;
++}
++
++static int smsc95xx_link_ok_nopm(struct usbnet *dev)
++{
++ struct mii_if_info *mii = &dev->mii;
++ int ret;
++
++ /* first, a dummy read, needed to latch some MII phys */
++ ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR);
++ if (ret < 0)
++ return ret;
++
++ ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR);
++ if (ret < 0)
++ return ret;
++
++ return !!(ret & BMSR_LSTATUS);
++}
++
++static int smsc95xx_enter_suspend0(struct usbnet *dev)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ u32 val;
++ int ret;
++
++ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
++ if (ret < 0)
++ return ret;
++
++ val &= (~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_));
++ val |= PM_CTL_SUS_MODE_0;
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ return ret;
++
++ /* clear wol status */
++ val &= ~PM_CTL_WUPS_;
++ val |= PM_CTL_WUPS_WOL_;
++
++ /* enable energy detection */
++ if (pdata->wolopts & WAKE_PHY)
++ val |= PM_CTL_WUPS_ED_;
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ return ret;
++
++ /* read back PM_CTRL */
++ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
++ if (ret < 0)
++ return ret;
++
++ pdata->suspend_flags |= SUSPEND_SUSPEND0;
++
++ return 0;
++}
++
++static int smsc95xx_enter_suspend1(struct usbnet *dev)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ struct mii_if_info *mii = &dev->mii;
++ u32 val;
++ int ret;
++
++ /* reconfigure link pulse detection timing for
++ * compatibility with non-standard link partners
++ */
++ if (pdata->features & FEATURE_PHY_NLP_CROSSOVER)
++ smsc95xx_mdio_write_nopm(dev->net, mii->phy_id, PHY_EDPD_CONFIG,
++ PHY_EDPD_CONFIG_DEFAULT);
++
++ /* enable energy detect power-down mode */
++ ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_MODE_CTRL_STS);
++ if (ret < 0)
++ return ret;
++
++ ret |= MODE_CTRL_STS_EDPWRDOWN_;
++
++ smsc95xx_mdio_write_nopm(dev->net, mii->phy_id, PHY_MODE_CTRL_STS, ret);
++
++ /* enter SUSPEND1 mode */
++ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
++ if (ret < 0)
++ return ret;
++
++ val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_);
++ val |= PM_CTL_SUS_MODE_1;
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ return ret;
++
++ /* clear wol status, enable energy detection */
++ val &= ~PM_CTL_WUPS_;
++ val |= (PM_CTL_WUPS_ED_ | PM_CTL_ED_EN_);
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ return ret;
++
++ pdata->suspend_flags |= SUSPEND_SUSPEND1;
++
++ return 0;
++}
++
++static int smsc95xx_enter_suspend2(struct usbnet *dev)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ u32 val;
++ int ret;
++
++ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
++ if (ret < 0)
++ return ret;
++
++ val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_);
++ val |= PM_CTL_SUS_MODE_2;
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ return ret;
++
++ pdata->suspend_flags |= SUSPEND_SUSPEND2;
++
++ return 0;
++}
++
++static int smsc95xx_enter_suspend3(struct usbnet *dev)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ u32 val;
++ int ret;
++
++ ret = smsc95xx_read_reg_nopm(dev, RX_FIFO_INF, &val);
++ if (ret < 0)
++ return ret;
++
++ if (val & 0xFFFF) {
++ netdev_info(dev->net, "rx fifo not empty in autosuspend\n");
++ return -EBUSY;
++ }
++
++ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
++ if (ret < 0)
++ return ret;
++
++ val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_);
++ val |= PM_CTL_SUS_MODE_3 | PM_CTL_RES_CLR_WKP_STS;
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ return ret;
++
++ /* clear wol status */
++ val &= ~PM_CTL_WUPS_;
++ val |= PM_CTL_WUPS_WOL_;
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ return ret;
++
++ pdata->suspend_flags |= SUSPEND_SUSPEND3;
++
++ return 0;
++}
++
++static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ int ret;
++
++ if (!netif_running(dev->net)) {
++ /* interface is ifconfig down so fully power down hw */
++ netdev_dbg(dev->net, "autosuspend entering SUSPEND2\n");
++ return smsc95xx_enter_suspend2(dev);
++ }
++
++ if (!link_up) {
++ /* link is down so enter EDPD mode, but only if device can
++ * reliably resume from it. This check should be redundant
++ * as current FEATURE_REMOTE_WAKEUP parts also support
++ * FEATURE_PHY_NLP_CROSSOVER but it's included for clarity */
++ if (!(pdata->features & FEATURE_PHY_NLP_CROSSOVER)) {
++ netdev_warn(dev->net, "EDPD not supported\n");
++ return -EBUSY;
++ }
++
++ netdev_dbg(dev->net, "autosuspend entering SUSPEND1\n");
++
++ /* enable PHY wakeup events for if cable is attached */
++ ret = smsc95xx_enable_phy_wakeup_interrupts(dev,
++ PHY_INT_MASK_ANEG_COMP_);
++ if (ret < 0) {
++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n");
++ return ret;
++ }
++
++ netdev_info(dev->net, "entering SUSPEND1 mode\n");
++ return smsc95xx_enter_suspend1(dev);
++ }
++
++ /* enable PHY wakeup events so we remote wakeup if cable is pulled */
++ ret = smsc95xx_enable_phy_wakeup_interrupts(dev,
++ PHY_INT_MASK_LINK_DOWN_);
++ if (ret < 0) {
++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n");
++ return ret;
++ }
++
++ netdev_dbg(dev->net, "autosuspend entering SUSPEND3\n");
++ return smsc95xx_enter_suspend3(dev);
++}
++
++static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
++{
++ struct usbnet *dev = usb_get_intfdata(intf);
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ u32 val, link_up;
++ int ret;
++
++ ret = usbnet_suspend(intf, message);
++ if (ret < 0) {
++ netdev_warn(dev->net, "usbnet_suspend error\n");
++ return ret;
++ }
++
++ if (pdata->suspend_flags) {
++ netdev_warn(dev->net, "error during last resume\n");
++ pdata->suspend_flags = 0;
++ }
++
++ /* determine if link is up using only _nopm functions */
++ link_up = smsc95xx_link_ok_nopm(dev);
++
++ if (message.event == PM_EVENT_AUTO_SUSPEND &&
++ (pdata->features & FEATURE_REMOTE_WAKEUP)) {
++ ret = smsc95xx_autosuspend(dev, link_up);
++ goto done;
++ }
++
++ /* if we get this far we're not autosuspending */
++ /* if no wol options set, or if link is down and we're not waking on
++ * PHY activity, enter lowest power SUSPEND2 mode
++ */
++ if (!(pdata->wolopts & SUPPORTED_WAKE) ||
++ !(link_up || (pdata->wolopts & WAKE_PHY))) {
++ netdev_info(dev->net, "entering SUSPEND2 mode\n");
++
++ /* disable energy detect (link up) & wake up events */
++ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0)
++ goto done;
++
++ val &= ~(WUCSR_MPEN_ | WUCSR_WAKE_EN_);
++
++ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0)
++ goto done;
++
++ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
++ if (ret < 0)
++ goto done;
++
++ val &= ~(PM_CTL_ED_EN_ | PM_CTL_WOL_EN_);
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ goto done;
++
++ ret = smsc95xx_enter_suspend2(dev);
++ goto done;
++ }
++
++ if (pdata->wolopts & WAKE_PHY) {
++ ret = smsc95xx_enable_phy_wakeup_interrupts(dev,
++ (PHY_INT_MASK_ANEG_COMP_ | PHY_INT_MASK_LINK_DOWN_));
++ if (ret < 0) {
++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n");
++ goto done;
++ }
++
++ /* if link is down then configure EDPD and enter SUSPEND1,
++ * otherwise enter SUSPEND0 below
++ */
++ if (!link_up) {
++ netdev_info(dev->net, "entering SUSPEND1 mode\n");
++ ret = smsc95xx_enter_suspend1(dev);
++ goto done;
++ }
++ }
++
++ if (pdata->wolopts & (WAKE_BCAST | WAKE_MCAST | WAKE_ARP | WAKE_UCAST)) {
++ u32 *filter_mask = kzalloc(sizeof(u32) * 32, GFP_KERNEL);
++ u32 command[2];
++ u32 offset[2];
++ u32 crc[4];
++ int wuff_filter_count =
++ (pdata->features & FEATURE_8_WAKEUP_FILTERS) ?
++ LAN9500A_WUFF_NUM : LAN9500_WUFF_NUM;
++ int i, filter = 0;
++
++ if (!filter_mask) {
++ netdev_warn(dev->net, "Unable to allocate filter_mask\n");
++ ret = -ENOMEM;
++ goto done;
++ }
++
++ memset(command, 0, sizeof(command));
++ memset(offset, 0, sizeof(offset));
++ memset(crc, 0, sizeof(crc));
++
++ if (pdata->wolopts & WAKE_BCAST) {
++ const u8 bcast[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
++ netdev_info(dev->net, "enabling broadcast detection\n");
++ filter_mask[filter * 4] = 0x003F;
++ filter_mask[filter * 4 + 1] = 0x00;
++ filter_mask[filter * 4 + 2] = 0x00;
++ filter_mask[filter * 4 + 3] = 0x00;
++ command[filter/4] |= 0x05UL << ((filter % 4) * 8);
++ offset[filter/4] |= 0x00 << ((filter % 4) * 8);
++ crc[filter/2] |= smsc_crc(bcast, 6, filter);
++ filter++;
++ }
++
++ if (pdata->wolopts & WAKE_MCAST) {
++ const u8 mcast[] = {0x01, 0x00, 0x5E};
++ netdev_info(dev->net, "enabling multicast detection\n");
++ filter_mask[filter * 4] = 0x0007;
++ filter_mask[filter * 4 + 1] = 0x00;
++ filter_mask[filter * 4 + 2] = 0x00;
++ filter_mask[filter * 4 + 3] = 0x00;
++ command[filter/4] |= 0x09UL << ((filter % 4) * 8);
++ offset[filter/4] |= 0x00 << ((filter % 4) * 8);
++ crc[filter/2] |= smsc_crc(mcast, 3, filter);
++ filter++;
++ }
++
++ if (pdata->wolopts & WAKE_ARP) {
++ const u8 arp[] = {0x08, 0x06};
++ netdev_info(dev->net, "enabling ARP detection\n");
++ filter_mask[filter * 4] = 0x0003;
++ filter_mask[filter * 4 + 1] = 0x00;
++ filter_mask[filter * 4 + 2] = 0x00;
++ filter_mask[filter * 4 + 3] = 0x00;
++ command[filter/4] |= 0x05UL << ((filter % 4) * 8);
++ offset[filter/4] |= 0x0C << ((filter % 4) * 8);
++ crc[filter/2] |= smsc_crc(arp, 2, filter);
++ filter++;
++ }
++
++ if (pdata->wolopts & WAKE_UCAST) {
++ netdev_info(dev->net, "enabling unicast detection\n");
++ filter_mask[filter * 4] = 0x003F;
++ filter_mask[filter * 4 + 1] = 0x00;
++ filter_mask[filter * 4 + 2] = 0x00;
++ filter_mask[filter * 4 + 3] = 0x00;
++ command[filter/4] |= 0x01UL << ((filter % 4) * 8);
++ offset[filter/4] |= 0x00 << ((filter % 4) * 8);
++ crc[filter/2] |= smsc_crc(dev->net->dev_addr, ETH_ALEN, filter);
++ filter++;
++ }
++
++ for (i = 0; i < (wuff_filter_count * 4); i++) {
++ ret = smsc95xx_write_reg_nopm(dev, WUFF, filter_mask[i]);
++ if (ret < 0) {
++ kfree(filter_mask);
++ goto done;
++ }
++ }
++ kfree(filter_mask);
++
++ for (i = 0; i < (wuff_filter_count / 4); i++) {
++ ret = smsc95xx_write_reg_nopm(dev, WUFF, command[i]);
++ if (ret < 0)
++ goto done;
++ }
++
++ for (i = 0; i < (wuff_filter_count / 4); i++) {
++ ret = smsc95xx_write_reg_nopm(dev, WUFF, offset[i]);
++ if (ret < 0)
++ goto done;
++ }
++
++ for (i = 0; i < (wuff_filter_count / 2); i++) {
++ ret = smsc95xx_write_reg_nopm(dev, WUFF, crc[i]);
++ if (ret < 0)
++ goto done;
++ }
++
++ /* clear any pending pattern match packet status */
++ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0)
++ goto done;
++
++ val |= WUCSR_WUFR_;
++
++ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0)
++ goto done;
++ }
++
++ if (pdata->wolopts & WAKE_MAGIC) {
++ /* clear any pending magic packet status */
++ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0)
++ goto done;
++
++ val |= WUCSR_MPR_;
++
++ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0)
++ goto done;
++ }
++
++ /* enable/disable wakeup sources */
++ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0)
++ goto done;
++
++ if (pdata->wolopts & (WAKE_BCAST | WAKE_MCAST | WAKE_ARP | WAKE_UCAST)) {
++ netdev_info(dev->net, "enabling pattern match wakeup\n");
++ val |= WUCSR_WAKE_EN_;
++ } else {
++ netdev_info(dev->net, "disabling pattern match wakeup\n");
++ val &= ~WUCSR_WAKE_EN_;
++ }
++
++ if (pdata->wolopts & WAKE_MAGIC) {
++ netdev_info(dev->net, "enabling magic packet wakeup\n");
++ val |= WUCSR_MPEN_;
++ } else {
++ netdev_info(dev->net, "disabling magic packet wakeup\n");
++ val &= ~WUCSR_MPEN_;
++ }
++
++ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0)
++ goto done;
++
++ /* enable wol wakeup source */
++ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
++ if (ret < 0)
++ goto done;
++
++ val |= PM_CTL_WOL_EN_;
++
++ /* phy energy detect wakeup source */
++ if (pdata->wolopts & WAKE_PHY)
++ val |= PM_CTL_ED_EN_;
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ goto done;
++
++ /* enable receiver to enable frame reception */
++ smsc95xx_start_rx_path(dev, 1);
++
++ /* some wol options are enabled, so enter SUSPEND0 */
++ netdev_info(dev->net, "entering SUSPEND0 mode\n");
++ ret = smsc95xx_enter_suspend0(dev);
++
++done:
++ /*
++ * TODO: resume() might need to handle the suspend failure
++ * in system sleep
++ */
++ if (ret && PMSG_IS_AUTO(message))
++ usbnet_resume(intf);
++ return ret;
++}
++
++static int smsc95xx_resume(struct usb_interface *intf)
++{
++ struct usbnet *dev = usb_get_intfdata(intf);
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++ u8 suspend_flags = pdata->suspend_flags;
++ int ret;
++ u32 val;
++
++ BUG_ON(!dev);
++
++ netdev_dbg(dev->net, "resume suspend_flags=0x%02x\n", suspend_flags);
++
++ /* do this first to ensure it's cleared even in error case */
++ pdata->suspend_flags = 0;
++
++ if (suspend_flags & SUSPEND_ALLMODES) {
++ /* clear wake-up sources */
++ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
++ if (ret < 0)
++ return ret;
++
++ val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_);
++
++ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
++ if (ret < 0)
++ return ret;
++
++ /* clear wake-up status */
++ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
++ if (ret < 0)
++ return ret;
++
++ val &= ~PM_CTL_WOL_EN_;
++ val |= PM_CTL_WUPS_;
++
++ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
++ if (ret < 0)
++ return ret;
++ }
++
++ ret = usbnet_resume(intf);
++ if (ret < 0)
++ netdev_warn(dev->net, "usbnet_resume error\n");
++
++ return ret;
++}
++
++static int smsc95xx_reset_resume(struct usb_interface *intf)
++{
++ struct usbnet *dev = usb_get_intfdata(intf);
++ int ret;
++
++ ret = smsc95xx_reset(dev);
++ if (ret < 0)
++ return ret;
++
++ return smsc95xx_resume(intf);
++}
++
++static void smsc95xx_rx_csum_offload(struct sk_buff *skb)
++{
++ skb->csum = *(u16 *)(skb_tail_pointer(skb) - 2);
++ skb->ip_summed = CHECKSUM_COMPLETE;
++ skb_trim(skb, skb->len - 2);
++}
++
++static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ /* This check is no longer done by usbnet */
++ if (skb->len < dev->net->hard_header_len)
++ return 0;
++
++ while (skb->len > 0) {
++ u32 header, align_count;
++ struct sk_buff *ax_skb;
++ unsigned char *packet;
++ u16 size;
++
++ memcpy(&header, skb->data, sizeof(header));
++ le32_to_cpus(&header);
++ skb_pull(skb, 4 + NET_IP_ALIGN);
++ packet = skb->data;
++
++ /* get the packet length */
++ size = (u16)((header & RX_STS_FL_) >> 16);
++ align_count = (4 - ((size + NET_IP_ALIGN) % 4)) % 4;
++
++ if (unlikely(header & RX_STS_ES_)) {
++ netif_dbg(dev, rx_err, dev->net,
++ "Error header=0x%08x\n", header);
++ dev->net->stats.rx_errors++;
++ dev->net->stats.rx_dropped++;
++
++ if (header & RX_STS_CRC_) {
++ dev->net->stats.rx_crc_errors++;
++ } else {
++ if (header & (RX_STS_TL_ | RX_STS_RF_))
++ dev->net->stats.rx_frame_errors++;
++
++ if ((header & RX_STS_LE_) &&
++ (!(header & RX_STS_FT_)))
++ dev->net->stats.rx_length_errors++;
++ }
++ } else {
++ /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */
++ if (unlikely(size > (ETH_FRAME_LEN + 12))) {
++ netif_dbg(dev, rx_err, dev->net,
++ "size err header=0x%08x\n", header);
++ return 0;
++ }
++
++ /* last frame in this batch */
++ if (skb->len == size) {
++ if (dev->net->features & NETIF_F_RXCSUM)
++ smsc95xx_rx_csum_offload(skb);
++ skb_trim(skb, skb->len - 4); /* remove fcs */
++ skb->truesize = size + sizeof(struct sk_buff);
++
++ return 1;
++ }
++
++ ax_skb = skb_clone(skb, GFP_ATOMIC);
++ if (unlikely(!ax_skb)) {
++ netdev_warn(dev->net, "Error allocating skb\n");
++ return 0;
++ }
++
++ ax_skb->len = size;
++ ax_skb->data = packet;
++ skb_set_tail_pointer(ax_skb, size);
++
++ if (dev->net->features & NETIF_F_RXCSUM)
++ smsc95xx_rx_csum_offload(ax_skb);
++ skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
++ ax_skb->truesize = size + sizeof(struct sk_buff);
++
++ usbnet_skb_return(dev, ax_skb);
++ }
++
++ skb_pull(skb, size);
++
++ /* padding bytes before the next frame starts */
++ if (skb->len)
++ skb_pull(skb, align_count);
++ }
++
++ if (unlikely(skb->len < 0)) {
++ netdev_warn(dev->net, "invalid rx length<0 %d\n", skb->len);
++ return 0;
++ }
++
++ return 1;
++}
++
++static u32 smsc95xx_calc_csum_preamble(struct sk_buff *skb)
++{
++ u16 low_16 = (u16)skb_checksum_start_offset(skb);
++ u16 high_16 = low_16 + skb->csum_offset;
++ return (high_16 << 16) | low_16;
++}
++
++static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev,
++ struct sk_buff *skb, gfp_t flags)
++{
++ bool csum = skb->ip_summed == CHECKSUM_PARTIAL;
++ int overhead = csum ? SMSC95XX_TX_OVERHEAD_CSUM : SMSC95XX_TX_OVERHEAD;
++ u32 tx_cmd_a, tx_cmd_b;
++
++ /* We do not advertise SG, so skbs should be already linearized */
++ BUG_ON(skb_shinfo(skb)->nr_frags);
++
++ if (skb_headroom(skb) < overhead) {
++ struct sk_buff *skb2 = skb_copy_expand(skb,
++ overhead, 0, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (!skb)
++ return NULL;
++ }
++
++ if (csum) {
++ if (skb->len <= 45) {
++ /* workaround - hardware tx checksum does not work
++ * properly with extremely small packets */
++ long csstart = skb_checksum_start_offset(skb);
++ __wsum calc = csum_partial(skb->data + csstart,
++ skb->len - csstart, 0);
++ *((__sum16 *)(skb->data + csstart
++ + skb->csum_offset)) = csum_fold(calc);
++
++ csum = false;
++ } else {
++ u32 csum_preamble = smsc95xx_calc_csum_preamble(skb);
++ skb_push(skb, 4);
++ cpu_to_le32s(&csum_preamble);
++ memcpy(skb->data, &csum_preamble, 4);
++ }
++ }
++
++ skb_push(skb, 4);
++ tx_cmd_b = (u32)(skb->len - 4);
++ if (csum)
++ tx_cmd_b |= TX_CMD_B_CSUM_ENABLE;
++ cpu_to_le32s(&tx_cmd_b);
++ memcpy(skb->data, &tx_cmd_b, 4);
++
++ skb_push(skb, 4);
++ tx_cmd_a = (u32)(skb->len - 8) | TX_CMD_A_FIRST_SEG_ |
++ TX_CMD_A_LAST_SEG_;
++ cpu_to_le32s(&tx_cmd_a);
++ memcpy(skb->data, &tx_cmd_a, 4);
++
++ return skb;
++}
++
++static int smsc95xx_manage_power(struct usbnet *dev, int on)
++{
++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
++
++ dev->intf->needs_remote_wakeup = on;
++
++ if (pdata->features & FEATURE_REMOTE_WAKEUP)
++ return 0;
++
++ /* this chip revision isn't capable of remote wakeup */
++ netdev_info(dev->net, "hardware isn't capable of remote wakeup\n");
++
++ if (on)
++ usb_autopm_get_interface_no_resume(dev->intf);
++ else
++ usb_autopm_put_interface(dev->intf);
++
++ return 0;
++}
++
++static const struct driver_info smsc95xx_info = {
++ .description = "smsc95xx USB 2.0 Ethernet",
++ .bind = smsc95xx_bind,
++ .unbind = smsc95xx_unbind,
++ .link_reset = smsc95xx_link_reset,
++ .reset = smsc95xx_reset,
++ .rx_fixup = smsc95xx_rx_fixup,
++ .tx_fixup = smsc95xx_tx_fixup,
++ .status = smsc95xx_status,
++ .manage_power = smsc95xx_manage_power,
++ .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ /* SMSC9500 USB Ethernet Device */
++ USB_DEVICE(0x0424, 0x9500),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9505 USB Ethernet Device */
++ USB_DEVICE(0x0424, 0x9505),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9500A USB Ethernet Device */
++ USB_DEVICE(0x0424, 0x9E00),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9505A USB Ethernet Device */
++ USB_DEVICE(0x0424, 0x9E01),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9512/9514 USB Hub & Ethernet Device */
++ USB_DEVICE(0x0424, 0xec00),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9500 USB Ethernet Device (SAL10) */
++ USB_DEVICE(0x0424, 0x9900),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9505 USB Ethernet Device (SAL10) */
++ USB_DEVICE(0x0424, 0x9901),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9500A USB Ethernet Device (SAL10) */
++ USB_DEVICE(0x0424, 0x9902),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9505A USB Ethernet Device (SAL10) */
++ USB_DEVICE(0x0424, 0x9903),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9512/9514 USB Hub & Ethernet Device (SAL10) */
++ USB_DEVICE(0x0424, 0x9904),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9500A USB Ethernet Device (HAL) */
++ USB_DEVICE(0x0424, 0x9905),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9505A USB Ethernet Device (HAL) */
++ USB_DEVICE(0x0424, 0x9906),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9500 USB Ethernet Device (Alternate ID) */
++ USB_DEVICE(0x0424, 0x9907),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9500A USB Ethernet Device (Alternate ID) */
++ USB_DEVICE(0x0424, 0x9908),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC9512/9514 USB Hub & Ethernet Device (Alternate ID) */
++ USB_DEVICE(0x0424, 0x9909),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC LAN9530 USB Ethernet Device */
++ USB_DEVICE(0x0424, 0x9530),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC LAN9730 USB Ethernet Device */
++ USB_DEVICE(0x0424, 0x9730),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ {
++ /* SMSC LAN89530 USB Ethernet Device */
++ USB_DEVICE(0x0424, 0x9E08),
++ .driver_info = (unsigned long) &smsc95xx_info,
++ },
++ { }, /* END */
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver smsc95xx_driver = {
++ .name = "smsc95xx",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .suspend = smsc95xx_suspend,
++ .resume = smsc95xx_resume,
++ .reset_resume = smsc95xx_reset_resume,
++ .disconnect = usbnet_disconnect,
++ .disable_hub_initiated_lpm = 1,
++ .supports_autosuspend = 1,
++};
++
++module_usb_driver(smsc95xx_driver);
++
++MODULE_AUTHOR("Nancy Lin");
++MODULE_AUTHOR("Steve Glendinning <steve.glendinning@shawell.net>");
++MODULE_DESCRIPTION("SMSC95XX USB 2.0 Ethernet Devices");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc95xx.h backports-3.18.1-1/drivers/net/usb/smsc95xx.h
+--- backports-3.18.1-1.org/drivers/net/usb/smsc95xx.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/smsc95xx.h 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,290 @@
++ /***************************************************************************
++ *
++ * Copyright (C) 2007-2008 SMSC
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ *
++ *****************************************************************************/
++
++#ifndef _SMSC95XX_H
++#define _SMSC95XX_H
++
++/* Tx command words */
++#define TX_CMD_A_DATA_OFFSET_ (0x001F0000)
++#define TX_CMD_A_FIRST_SEG_ (0x00002000)
++#define TX_CMD_A_LAST_SEG_ (0x00001000)
++#define TX_CMD_A_BUF_SIZE_ (0x000007FF)
++
++#define TX_CMD_B_CSUM_ENABLE (0x00004000)
++#define TX_CMD_B_ADD_CRC_DISABLE_ (0x00002000)
++#define TX_CMD_B_DISABLE_PADDING_ (0x00001000)
++#define TX_CMD_B_PKT_BYTE_LENGTH_ (0x000007FF)
++
++/* Rx status word */
++#define RX_STS_FF_ (0x40000000) /* Filter Fail */
++#define RX_STS_FL_ (0x3FFF0000) /* Frame Length */
++#define RX_STS_ES_ (0x00008000) /* Error Summary */
++#define RX_STS_BF_ (0x00002000) /* Broadcast Frame */
++#define RX_STS_LE_ (0x00001000) /* Length Error */
++#define RX_STS_RF_ (0x00000800) /* Runt Frame */
++#define RX_STS_MF_ (0x00000400) /* Multicast Frame */
++#define RX_STS_TL_ (0x00000080) /* Frame too long */
++#define RX_STS_CS_ (0x00000040) /* Collision Seen */
++#define RX_STS_FT_ (0x00000020) /* Frame Type */
++#define RX_STS_RW_ (0x00000010) /* Receive Watchdog */
++#define RX_STS_ME_ (0x00000008) /* Mii Error */
++#define RX_STS_DB_ (0x00000004) /* Dribbling */
++#define RX_STS_CRC_ (0x00000002) /* CRC Error */
++
++/* SCSRs */
++#define ID_REV (0x00)
++#define ID_REV_CHIP_ID_MASK_ (0xFFFF0000)
++#define ID_REV_CHIP_REV_MASK_ (0x0000FFFF)
++#define ID_REV_CHIP_ID_9500_ (0x9500)
++#define ID_REV_CHIP_ID_9500A_ (0x9E00)
++#define ID_REV_CHIP_ID_9512_ (0xEC00)
++#define ID_REV_CHIP_ID_9530_ (0x9530)
++#define ID_REV_CHIP_ID_89530_ (0x9E08)
++#define ID_REV_CHIP_ID_9730_ (0x9730)
++
++#define INT_STS (0x08)
++#define INT_STS_TX_STOP_ (0x00020000)
++#define INT_STS_RX_STOP_ (0x00010000)
++#define INT_STS_PHY_INT_ (0x00008000)
++#define INT_STS_TXE_ (0x00004000)
++#define INT_STS_TDFU_ (0x00002000)
++#define INT_STS_TDFO_ (0x00001000)
++#define INT_STS_RXDF_ (0x00000800)
++#define INT_STS_GPIOS_ (0x000007FF)
++#define INT_STS_CLEAR_ALL_ (0xFFFFFFFF)
++
++#define RX_CFG (0x0C)
++#define RX_FIFO_FLUSH_ (0x00000001)
++
++#define TX_CFG (0x10)
++#define TX_CFG_ON_ (0x00000004)
++#define TX_CFG_STOP_ (0x00000002)
++#define TX_CFG_FIFO_FLUSH_ (0x00000001)
++
++#define HW_CFG (0x14)
++#define HW_CFG_BIR_ (0x00001000)
++#define HW_CFG_LEDB_ (0x00000800)
++#define HW_CFG_RXDOFF_ (0x00000600)
++#define HW_CFG_DRP_ (0x00000040)
++#define HW_CFG_MEF_ (0x00000020)
++#define HW_CFG_LRST_ (0x00000008)
++#define HW_CFG_PSEL_ (0x00000004)
++#define HW_CFG_BCE_ (0x00000002)
++#define HW_CFG_SRST_ (0x00000001)
++
++#define RX_FIFO_INF (0x18)
++
++#define PM_CTRL (0x20)
++#define PM_CTL_RES_CLR_WKP_STS (0x00000200)
++#define PM_CTL_DEV_RDY_ (0x00000080)
++#define PM_CTL_SUS_MODE_ (0x00000060)
++#define PM_CTL_SUS_MODE_0 (0x00000000)
++#define PM_CTL_SUS_MODE_1 (0x00000020)
++#define PM_CTL_SUS_MODE_2 (0x00000040)
++#define PM_CTL_SUS_MODE_3 (0x00000060)
++#define PM_CTL_PHY_RST_ (0x00000010)
++#define PM_CTL_WOL_EN_ (0x00000008)
++#define PM_CTL_ED_EN_ (0x00000004)
++#define PM_CTL_WUPS_ (0x00000003)
++#define PM_CTL_WUPS_NO_ (0x00000000)
++#define PM_CTL_WUPS_ED_ (0x00000001)
++#define PM_CTL_WUPS_WOL_ (0x00000002)
++#define PM_CTL_WUPS_MULTI_ (0x00000003)
++
++#define LED_GPIO_CFG (0x24)
++#define LED_GPIO_CFG_SPD_LED (0x01000000)
++#define LED_GPIO_CFG_LNK_LED (0x00100000)
++#define LED_GPIO_CFG_FDX_LED (0x00010000)
++
++#define GPIO_CFG (0x28)
++
++#define AFC_CFG (0x2C)
++
++/* Hi watermark = 15.5Kb (~10 mtu pkts) */
++/* low watermark = 3k (~2 mtu pkts) */
++/* backpressure duration = ~ 350us */
++/* Apply FC on any frame. */
++#define AFC_CFG_DEFAULT (0x00F830A1)
++
++#define E2P_CMD (0x30)
++#define E2P_CMD_BUSY_ (0x80000000)
++#define E2P_CMD_MASK_ (0x70000000)
++#define E2P_CMD_READ_ (0x00000000)
++#define E2P_CMD_EWDS_ (0x10000000)
++#define E2P_CMD_EWEN_ (0x20000000)
++#define E2P_CMD_WRITE_ (0x30000000)
++#define E2P_CMD_WRAL_ (0x40000000)
++#define E2P_CMD_ERASE_ (0x50000000)
++#define E2P_CMD_ERAL_ (0x60000000)
++#define E2P_CMD_RELOAD_ (0x70000000)
++#define E2P_CMD_TIMEOUT_ (0x00000400)
++#define E2P_CMD_LOADED_ (0x00000200)
++#define E2P_CMD_ADDR_ (0x000001FF)
++
++#define MAX_EEPROM_SIZE (512)
++
++#define E2P_DATA (0x34)
++#define E2P_DATA_MASK_ (0x000000FF)
++
++#define BURST_CAP (0x38)
++
++#define GPIO_WAKE (0x64)
++
++#define INT_EP_CTL (0x68)
++#define INT_EP_CTL_INTEP_ (0x80000000)
++#define INT_EP_CTL_MACRTO_ (0x00080000)
++#define INT_EP_CTL_TX_STOP_ (0x00020000)
++#define INT_EP_CTL_RX_STOP_ (0x00010000)
++#define INT_EP_CTL_PHY_INT_ (0x00008000)
++#define INT_EP_CTL_TXE_ (0x00004000)
++#define INT_EP_CTL_TDFU_ (0x00002000)
++#define INT_EP_CTL_TDFO_ (0x00001000)
++#define INT_EP_CTL_RXDF_ (0x00000800)
++#define INT_EP_CTL_GPIOS_ (0x000007FF)
++
++#define BULK_IN_DLY (0x6C)
++
++/* MAC CSRs */
++#define MAC_CR (0x100)
++#define MAC_CR_RXALL_ (0x80000000)
++#define MAC_CR_RCVOWN_ (0x00800000)
++#define MAC_CR_LOOPBK_ (0x00200000)
++#define MAC_CR_FDPX_ (0x00100000)
++#define MAC_CR_MCPAS_ (0x00080000)
++#define MAC_CR_PRMS_ (0x00040000)
++#define MAC_CR_INVFILT_ (0x00020000)
++#define MAC_CR_PASSBAD_ (0x00010000)
++#define MAC_CR_HFILT_ (0x00008000)
++#define MAC_CR_HPFILT_ (0x00002000)
++#define MAC_CR_LCOLL_ (0x00001000)
++#define MAC_CR_BCAST_ (0x00000800)
++#define MAC_CR_DISRTY_ (0x00000400)
++#define MAC_CR_PADSTR_ (0x00000100)
++#define MAC_CR_BOLMT_MASK (0x000000C0)
++#define MAC_CR_DFCHK_ (0x00000020)
++#define MAC_CR_TXEN_ (0x00000008)
++#define MAC_CR_RXEN_ (0x00000004)
++
++#define ADDRH (0x104)
++
++#define ADDRL (0x108)
++
++#define HASHH (0x10C)
++
++#define HASHL (0x110)
++
++#define MII_ADDR (0x114)
++#define MII_WRITE_ (0x02)
++#define MII_BUSY_ (0x01)
++#define MII_READ_ (0x00) /* ~of MII Write bit */
++
++#define MII_DATA (0x118)
++
++#define FLOW (0x11C)
++#define FLOW_FCPT_ (0xFFFF0000)
++#define FLOW_FCPASS_ (0x00000004)
++#define FLOW_FCEN_ (0x00000002)
++#define FLOW_FCBSY_ (0x00000001)
++
++#define VLAN1 (0x120)
++
++#define VLAN2 (0x124)
++
++#define WUFF (0x128)
++#define LAN9500_WUFF_NUM (4)
++#define LAN9500A_WUFF_NUM (8)
++
++#define WUCSR (0x12C)
++#define WUCSR_WFF_PTR_RST_ (0x80000000)
++#define WUCSR_GUE_ (0x00000200)
++#define WUCSR_WUFR_ (0x00000040)
++#define WUCSR_MPR_ (0x00000020)
++#define WUCSR_WAKE_EN_ (0x00000004)
++#define WUCSR_MPEN_ (0x00000002)
++
++#define COE_CR (0x130)
++#define Tx_COE_EN_ (0x00010000)
++#define Rx_COE_MODE_ (0x00000002)
++#define Rx_COE_EN_ (0x00000001)
++
++/* Vendor-specific PHY Definitions */
++
++/* EDPD NLP / crossover time configuration (LAN9500A only) */
++#define PHY_EDPD_CONFIG (16)
++#define PHY_EDPD_CONFIG_TX_NLP_EN_ ((u16)0x8000)
++#define PHY_EDPD_CONFIG_TX_NLP_1000_ ((u16)0x0000)
++#define PHY_EDPD_CONFIG_TX_NLP_768_ ((u16)0x2000)
++#define PHY_EDPD_CONFIG_TX_NLP_512_ ((u16)0x4000)
++#define PHY_EDPD_CONFIG_TX_NLP_256_ ((u16)0x6000)
++#define PHY_EDPD_CONFIG_RX_1_NLP_ ((u16)0x1000)
++#define PHY_EDPD_CONFIG_RX_NLP_64_ ((u16)0x0000)
++#define PHY_EDPD_CONFIG_RX_NLP_256_ ((u16)0x0400)
++#define PHY_EDPD_CONFIG_RX_NLP_512_ ((u16)0x0800)
++#define PHY_EDPD_CONFIG_RX_NLP_1000_ ((u16)0x0C00)
++#define PHY_EDPD_CONFIG_EXT_CROSSOVER_ ((u16)0x0001)
++#define PHY_EDPD_CONFIG_DEFAULT (PHY_EDPD_CONFIG_TX_NLP_EN_ | \
++ PHY_EDPD_CONFIG_TX_NLP_768_ | \
++ PHY_EDPD_CONFIG_RX_1_NLP_)
++
++/* Mode Control/Status Register */
++#define PHY_MODE_CTRL_STS (17)
++#define MODE_CTRL_STS_EDPWRDOWN_ ((u16)0x2000)
++#define MODE_CTRL_STS_ENERGYON_ ((u16)0x0002)
++
++#define SPECIAL_CTRL_STS (27)
++#define SPECIAL_CTRL_STS_OVRRD_AMDIX_ ((u16)0x8000)
++#define SPECIAL_CTRL_STS_AMDIX_ENABLE_ ((u16)0x4000)
++#define SPECIAL_CTRL_STS_AMDIX_STATE_ ((u16)0x2000)
++
++#define PHY_INT_SRC (29)
++#define PHY_INT_SRC_ENERGY_ON_ ((u16)0x0080)
++#define PHY_INT_SRC_ANEG_COMP_ ((u16)0x0040)
++#define PHY_INT_SRC_REMOTE_FAULT_ ((u16)0x0020)
++#define PHY_INT_SRC_LINK_DOWN_ ((u16)0x0010)
++
++#define PHY_INT_MASK (30)
++#define PHY_INT_MASK_ENERGY_ON_ ((u16)0x0080)
++#define PHY_INT_MASK_ANEG_COMP_ ((u16)0x0040)
++#define PHY_INT_MASK_REMOTE_FAULT_ ((u16)0x0020)
++#define PHY_INT_MASK_LINK_DOWN_ ((u16)0x0010)
++#define PHY_INT_MASK_DEFAULT_ (PHY_INT_MASK_ANEG_COMP_ | \
++ PHY_INT_MASK_LINK_DOWN_)
++
++#define PHY_SPECIAL (31)
++#define PHY_SPECIAL_SPD_ ((u16)0x001C)
++#define PHY_SPECIAL_SPD_10HALF_ ((u16)0x0004)
++#define PHY_SPECIAL_SPD_10FULL_ ((u16)0x0014)
++#define PHY_SPECIAL_SPD_100HALF_ ((u16)0x0008)
++#define PHY_SPECIAL_SPD_100FULL_ ((u16)0x0018)
++
++/* USB Vendor Requests */
++#define USB_VENDOR_REQUEST_WRITE_REGISTER 0xA0
++#define USB_VENDOR_REQUEST_READ_REGISTER 0xA1
++#define USB_VENDOR_REQUEST_GET_STATS 0xA2
++
++/* Interrupt Endpoint status word bitfields */
++#define INT_ENP_TX_STOP_ ((u32)BIT(17))
++#define INT_ENP_RX_STOP_ ((u32)BIT(16))
++#define INT_ENP_PHY_INT_ ((u32)BIT(15))
++#define INT_ENP_TXE_ ((u32)BIT(14))
++#define INT_ENP_TDFU_ ((u32)BIT(13))
++#define INT_ENP_TDFO_ ((u32)BIT(12))
++#define INT_ENP_RXDF_ ((u32)BIT(11))
++
++#endif /* _SMSC95XX_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/drivers/net/usb/sr9700.c
+--- backports-3.18.1-1.org/drivers/net/usb/sr9700.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/sr9700.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,559 @@
++/*
++ * CoreChip-sz SR9700 one chip USB 1.1 Ethernet Devices
++ *
++ * Author : Liu Junliang <liujunliang_ljl@163.com>
++ *
++ * Based on dm9601.c
++ *
++ * This file is licensed under the terms of the GNU General Public License
++ * version 2. This program is licensed "as is" without any warranty of any
++ * kind, whether express or implied.
++ */
++
++#include <linux/module.h>
++#include <linux/sched.h>
++#include <linux/stddef.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/crc32.h>
++#include <linux/usb/usbnet.h>
++
++#include "sr9700.h"
++
++static int sr_read(struct usbnet *dev, u8 reg, u16 length, void *data)
++{
++ int err;
++
++ err = usbnet_read_cmd(dev, SR_RD_REGS, SR_REQ_RD_REG, 0, reg, data,
++ length);
++ if ((err != length) && (err >= 0))
++ err = -EINVAL;
++ return err;
++}
++
++static int sr_write(struct usbnet *dev, u8 reg, u16 length, void *data)
++{
++ int err;
++
++ err = usbnet_write_cmd(dev, SR_WR_REGS, SR_REQ_WR_REG, 0, reg, data,
++ length);
++ if ((err >= 0) && (err < length))
++ err = -EINVAL;
++ return err;
++}
++
++static int sr_read_reg(struct usbnet *dev, u8 reg, u8 *value)
++{
++ return sr_read(dev, reg, 1, value);
++}
++
++static int sr_write_reg(struct usbnet *dev, u8 reg, u8 value)
++{
++ return usbnet_write_cmd(dev, SR_WR_REGS, SR_REQ_WR_REG,
++ value, reg, NULL, 0);
++}
++
++static void sr_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
++{
++ usbnet_write_cmd_async(dev, SR_WR_REGS, SR_REQ_WR_REG,
++ 0, reg, data, length);
++}
++
++static void sr_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
++{
++ usbnet_write_cmd_async(dev, SR_WR_REGS, SR_REQ_WR_REG,
++ value, reg, NULL, 0);
++}
++
++static int wait_phy_eeprom_ready(struct usbnet *dev, int phy)
++{
++ int i;
++
++ for (i = 0; i < SR_SHARE_TIMEOUT; i++) {
++ u8 tmp = 0;
++ int ret;
++
++ udelay(1);
++ ret = sr_read_reg(dev, EPCR, &tmp);
++ if (ret < 0)
++ return ret;
++
++ /* ready */
++ if (!(tmp & EPCR_ERRE))
++ return 0;
++ }
++
++ netdev_err(dev->net, "%s write timed out!\n", phy ? "phy" : "eeprom");
++
++ return -EIO;
++}
++
++static int sr_share_read_word(struct usbnet *dev, int phy, u8 reg,
++ __le16 *value)
++{
++ int ret;
++
++ mutex_lock(&dev->phy_mutex);
++
++ sr_write_reg(dev, EPAR, phy ? (reg | EPAR_PHY_ADR) : reg);
++ sr_write_reg(dev, EPCR, phy ? (EPCR_EPOS | EPCR_ERPRR) : EPCR_ERPRR);
++
++ ret = wait_phy_eeprom_ready(dev, phy);
++ if (ret < 0)
++ goto out_unlock;
++
++ sr_write_reg(dev, EPCR, 0x0);
++ ret = sr_read(dev, EPDR, 2, value);
++
++ netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n",
++ phy, reg, *value, ret);
++
++out_unlock:
++ mutex_unlock(&dev->phy_mutex);
++ return ret;
++}
++
++static int sr_share_write_word(struct usbnet *dev, int phy, u8 reg,
++ __le16 value)
++{
++ int ret;
++
++ mutex_lock(&dev->phy_mutex);
++
++ ret = sr_write(dev, EPDR, 2, &value);
++ if (ret < 0)
++ goto out_unlock;
++
++ sr_write_reg(dev, EPAR, phy ? (reg | EPAR_PHY_ADR) : reg);
++ sr_write_reg(dev, EPCR, phy ? (EPCR_WEP | EPCR_EPOS | EPCR_ERPRW) :
++ (EPCR_WEP | EPCR_ERPRW));
++
++ ret = wait_phy_eeprom_ready(dev, phy);
++ if (ret < 0)
++ goto out_unlock;
++
++ sr_write_reg(dev, EPCR, 0x0);
++
++out_unlock:
++ mutex_unlock(&dev->phy_mutex);
++ return ret;
++}
++
++static int sr_read_eeprom_word(struct usbnet *dev, u8 offset, void *value)
++{
++ return sr_share_read_word(dev, 0, offset, value);
++}
++
++static int sr9700_get_eeprom_len(struct net_device *netdev)
++{
++ return SR_EEPROM_LEN;
++}
++
++static int sr9700_get_eeprom(struct net_device *netdev,
++ struct ethtool_eeprom *eeprom, u8 *data)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ __le16 *buf = (__le16 *)data;
++ int ret = 0;
++ int i;
++
++ /* access is 16bit */
++ if ((eeprom->offset & 0x01) || (eeprom->len & 0x01))
++ return -EINVAL;
++
++ for (i = 0; i < eeprom->len / 2; i++) {
++ ret = sr_read_eeprom_word(dev, eeprom->offset / 2 + i, buf + i);
++ if (ret < 0)
++ break;
++ }
++
++ return ret;
++}
++
++static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ __le16 res;
++ int rc = 0;
++
++ if (phy_id) {
++ netdev_dbg(netdev, "Only internal phy supported\n");
++ return 0;
++ }
++
++ /* Access NSR_LINKST bit for link status instead of MII_BMSR */
++ if (loc == MII_BMSR) {
++ u8 value;
++
++ sr_read_reg(dev, NSR, &value);
++ if (value & NSR_LINKST)
++ rc = 1;
++ }
++ sr_share_read_word(dev, 1, loc, &res);
++ if (rc == 1)
++ res = le16_to_cpu(res) | BMSR_LSTATUS;
++ else
++ res = le16_to_cpu(res) & ~BMSR_LSTATUS;
++
++ netdev_dbg(netdev, "sr_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",
++ phy_id, loc, res);
++
++ return res;
++}
++
++static void sr_mdio_write(struct net_device *netdev, int phy_id, int loc,
++ int val)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ __le16 res = cpu_to_le16(val);
++
++ if (phy_id) {
++ netdev_dbg(netdev, "Only internal phy supported\n");
++ return;
++ }
++
++ netdev_dbg(netdev, "sr_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n",
++ phy_id, loc, val);
++
++ sr_share_write_word(dev, 1, loc, res);
++}
++
++static u32 sr9700_get_link(struct net_device *netdev)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ u8 value = 0;
++ int rc = 0;
++
++ /* Get the Link Status directly */
++ sr_read_reg(dev, NSR, &value);
++ if (value & NSR_LINKST)
++ rc = 1;
++
++ return rc;
++}
++
++static int sr9700_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++
++ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
++}
++
++static const struct ethtool_ops sr9700_ethtool_ops = {
++ .get_drvinfo = usbnet_get_drvinfo,
++ .get_link = sr9700_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_eeprom_len = sr9700_get_eeprom_len,
++ .get_eeprom = sr9700_get_eeprom,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .nway_reset = usbnet_nway_reset,
++};
++
++static void sr9700_set_multicast(struct net_device *netdev)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ /* We use the 20 byte dev->data for our 8 byte filter buffer
++ * to avoid allocating memory that is tricky to free later
++ */
++ u8 *hashes = (u8 *)&dev->data;
++ /* rx_ctl setting : enable, disable_long, disable_crc */
++ u8 rx_ctl = RCR_RXEN | RCR_DIS_CRC | RCR_DIS_LONG;
++
++ memset(hashes, 0x00, SR_MCAST_SIZE);
++ /* broadcast address */
++ hashes[SR_MCAST_SIZE - 1] |= SR_MCAST_ADDR_FLAG;
++ if (netdev->flags & IFF_PROMISC) {
++ rx_ctl |= RCR_PRMSC;
++ } else if (netdev->flags & IFF_ALLMULTI ||
++ netdev_mc_count(netdev) > SR_MCAST_MAX) {
++ rx_ctl |= RCR_RUNT;
++ } else if (!netdev_mc_empty(netdev)) {
++ struct netdev_hw_addr *ha;
++
++ netdev_for_each_mc_addr(ha, netdev) {
++ u32 crc = ether_crc(ETH_ALEN, ha->addr) >> 26;
++ hashes[crc >> 3] |= 1 << (crc & 0x7);
++ }
++ }
++
++ sr_write_async(dev, MAR, SR_MCAST_SIZE, hashes);
++ sr_write_reg_async(dev, RCR, rx_ctl);
++}
++
++static int sr9700_set_mac_address(struct net_device *netdev, void *p)
++{
++ struct usbnet *dev = netdev_priv(netdev);
++ struct sockaddr *addr = p;
++
++ if (!is_valid_ether_addr(addr->sa_data)) {
++ netdev_err(netdev, "not setting invalid mac address %pM\n",
++ addr->sa_data);
++ return -EINVAL;
++ }
++
++ memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
++ sr_write_async(dev, PAR, 6, netdev->dev_addr);
++
++ return 0;
++}
++
++static const struct net_device_ops sr9700_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = sr9700_ioctl,
++ .ndo_set_rx_mode = sr9700_set_multicast,
++ .ndo_set_mac_address = sr9700_set_mac_address,
++};
++
++static int sr9700_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ struct net_device *netdev;
++ struct mii_if_info *mii;
++ int ret;
++
++ ret = usbnet_get_endpoints(dev, intf);
++ if (ret)
++ goto out;
++
++ netdev = dev->net;
++
++ netdev->netdev_ops = &sr9700_netdev_ops;
++ netdev->ethtool_ops = &sr9700_ethtool_ops;
++ netdev->hard_header_len += SR_TX_OVERHEAD;
++ dev->hard_mtu = netdev->mtu + netdev->hard_header_len;
++ /* bulkin buffer is preferably not less than 3K */
++ dev->rx_urb_size = 3072;
++
++ mii = &dev->mii;
++ mii->dev = netdev;
++ mii->mdio_read = sr_mdio_read;
++ mii->mdio_write = sr_mdio_write;
++ mii->phy_id_mask = 0x1f;
++ mii->reg_num_mask = 0x1f;
++
++ sr_write_reg(dev, NCR, NCR_RST);
++ udelay(20);
++
++ /* read MAC
++ * After Chip Power on, the Chip will reload the MAC from
++ * EEPROM automatically to PAR. In case there is no EEPROM externally,
++ * a default MAC address is stored in PAR for making chip work properly.
++ */
++ if (sr_read(dev, PAR, ETH_ALEN, netdev->dev_addr) < 0) {
++ netdev_err(netdev, "Error reading MAC address\n");
++ ret = -ENODEV;
++ goto out;
++ }
++
++ /* power up and reset phy */
++ sr_write_reg(dev, PRR, PRR_PHY_RST);
++ /* at least 10ms, here 20ms for safe */
++ mdelay(20);
++ sr_write_reg(dev, PRR, 0);
++ /* at least 1ms, here 2ms for reading right register */
++ udelay(2 * 1000);
++
++ /* receive broadcast packets */
++ sr9700_set_multicast(netdev);
++
++ sr_mdio_write(netdev, mii->phy_id, MII_BMCR, BMCR_RESET);
++ sr_mdio_write(netdev, mii->phy_id, MII_ADVERTISE, ADVERTISE_ALL |
++ ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
++ mii_nway_restart(mii);
++
++out:
++ return ret;
++}
++
++static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ struct sk_buff *sr_skb;
++ int len;
++
++ /* skb content (packets) format :
++ * p0 p1 p2 ...... pm
++ * / \
++ * / \
++ * / \
++ * / \
++ * p0b0 p0b1 p0b2 p0b3 ...... p0b(n-4) p0b(n-3)...p0bn
++ *
++ * p0 : packet 0
++ * p0b0 : packet 0 byte 0
++ *
++ * b0: rx status
++ * b1: packet length (incl crc) low
++ * b2: packet length (incl crc) high
++ * b3..n-4: packet data
++ * bn-3..bn: ethernet packet crc
++ */
++ if (unlikely(skb->len < SR_RX_OVERHEAD)) {
++ netdev_err(dev->net, "unexpected tiny rx frame\n");
++ return 0;
++ }
++
++ /* one skb may contains multiple packets */
++ while (skb->len > SR_RX_OVERHEAD) {
++ if (skb->data[0] != 0x40)
++ return 0;
++
++ /* ignore the CRC length */
++ len = (skb->data[1] | (skb->data[2] << 8)) - 4;
++
++ if (len > ETH_FRAME_LEN)
++ return 0;
++
++ /* the last packet of current skb */
++ if (skb->len == (len + SR_RX_OVERHEAD)) {
++ skb_pull(skb, 3);
++ skb->len = len;
++ skb_set_tail_pointer(skb, len);
++ skb->truesize = len + sizeof(struct sk_buff);
++ return 2;
++ }
++
++ /* skb_clone is used for address align */
++ sr_skb = skb_clone(skb, GFP_ATOMIC);
++ if (!sr_skb)
++ return 0;
++
++ sr_skb->len = len;
++ sr_skb->data = skb->data + 3;
++ skb_set_tail_pointer(sr_skb, len);
++ sr_skb->truesize = len + sizeof(struct sk_buff);
++ usbnet_skb_return(dev, sr_skb);
++
++ skb_pull(skb, len + SR_RX_OVERHEAD);
++ };
++
++ return 0;
++}
++
++static struct sk_buff *sr9700_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
++ gfp_t flags)
++{
++ int len;
++
++ /* SR9700 can only send out one ethernet packet at once.
++ *
++ * b0 b1 b2 b3 ...... b(n-4) b(n-3)...bn
++ *
++ * b0: rx status
++ * b1: packet length (incl crc) low
++ * b2: packet length (incl crc) high
++ * b3..n-4: packet data
++ * bn-3..bn: ethernet packet crc
++ */
++
++ len = skb->len;
++
++ if (skb_headroom(skb) < SR_TX_OVERHEAD) {
++ struct sk_buff *skb2;
++
++ skb2 = skb_copy_expand(skb, SR_TX_OVERHEAD, 0, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (!skb)
++ return NULL;
++ }
++
++ __skb_push(skb, SR_TX_OVERHEAD);
++
++ /* usbnet adds padding if length is a multiple of packet size
++ * if so, adjust length value in header
++ */
++ if ((skb->len % dev->maxpacket) == 0)
++ len++;
++
++ skb->data[0] = len;
++ skb->data[1] = len >> 8;
++
++ return skb;
++}
++
++static void sr9700_status(struct usbnet *dev, struct urb *urb)
++{
++ int link;
++ u8 *buf;
++
++ /* format:
++ b0: net status
++ b1: tx status 1
++ b2: tx status 2
++ b3: rx status
++ b4: rx overflow
++ b5: rx count
++ b6: tx count
++ b7: gpr
++ */
++
++ if (urb->actual_length < 8)
++ return;
++
++ buf = urb->transfer_buffer;
++
++ link = !!(buf[0] & 0x40);
++ if (netif_carrier_ok(dev->net) != link) {
++ usbnet_link_change(dev, link, 1);
++ netdev_dbg(dev->net, "Link Status is: %d\n", link);
++ }
++}
++
++static int sr9700_link_reset(struct usbnet *dev)
++{
++ struct ethtool_cmd ecmd;
++
++ mii_check_media(&dev->mii, 1, 1);
++ mii_ethtool_gset(&dev->mii, &ecmd);
++
++ netdev_dbg(dev->net, "link_reset() speed: %d duplex: %d\n",
++ ecmd.speed, ecmd.duplex);
++
++ return 0;
++}
++
++static const struct driver_info sr9700_driver_info = {
++ .description = "CoreChip SR9700 USB Ethernet",
++ .flags = FLAG_ETHER,
++ .bind = sr9700_bind,
++ .rx_fixup = sr9700_rx_fixup,
++ .tx_fixup = sr9700_tx_fixup,
++ .status = sr9700_status,
++ .link_reset = sr9700_link_reset,
++ .reset = sr9700_link_reset,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ USB_DEVICE(0x0fe6, 0x9700), /* SR9700 device */
++ .driver_info = (unsigned long)&sr9700_driver_info,
++ },
++ {}, /* END */
++};
++
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver sr9700_usb_driver = {
++ .name = "sr9700",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(sr9700_usb_driver);
++
++MODULE_AUTHOR("liujl <liujunliang_ljl@163.com>");
++MODULE_DESCRIPTION("SR9700 one chip USB 1.1 USB to Ethernet device from http://www.corechip-sz.com/");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/drivers/net/usb/sr9700.h
+--- backports-3.18.1-1.org/drivers/net/usb/sr9700.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/sr9700.h 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,173 @@
++/*
++ * CoreChip-sz SR9700 one chip USB 1.1 Ethernet Devices
++ *
++ * Author : Liu Junliang <liujunliang_ljl@163.com>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * version 2 as published by the Free Software Foundation.
++ */
++
++#ifndef _SR9700_H
++#define _SR9700_H
++
++/* sr9700 spec. register table on Linux platform */
++
++/* Network Control Reg */
++#define NCR 0x00
++#define NCR_RST (1 << 0)
++#define NCR_LBK (3 << 1)
++#define NCR_FDX (1 << 3)
++#define NCR_WAKEEN (1 << 6)
++/* Network Status Reg */
++#define NSR 0x01
++#define NSR_RXRDY (1 << 0)
++#define NSR_RXOV (1 << 1)
++#define NSR_TX1END (1 << 2)
++#define NSR_TX2END (1 << 3)
++#define NSR_TXFULL (1 << 4)
++#define NSR_WAKEST (1 << 5)
++#define NSR_LINKST (1 << 6)
++#define NSR_SPEED (1 << 7)
++/* Tx Control Reg */
++#define TCR 0x02
++#define TCR_CRC_DIS (1 << 1)
++#define TCR_PAD_DIS (1 << 2)
++#define TCR_LC_CARE (1 << 3)
++#define TCR_CRS_CARE (1 << 4)
++#define TCR_EXCECM (1 << 5)
++#define TCR_LF_EN (1 << 6)
++/* Tx Status Reg for Packet Index 1 */
++#define TSR1 0x03
++#define TSR1_EC (1 << 2)
++#define TSR1_COL (1 << 3)
++#define TSR1_LC (1 << 4)
++#define TSR1_NC (1 << 5)
++#define TSR1_LOC (1 << 6)
++#define TSR1_TLF (1 << 7)
++/* Tx Status Reg for Packet Index 2 */
++#define TSR2 0x04
++#define TSR2_EC (1 << 2)
++#define TSR2_COL (1 << 3)
++#define TSR2_LC (1 << 4)
++#define TSR2_NC (1 << 5)
++#define TSR2_LOC (1 << 6)
++#define TSR2_TLF (1 << 7)
++/* Rx Control Reg*/
++#define RCR 0x05
++#define RCR_RXEN (1 << 0)
++#define RCR_PRMSC (1 << 1)
++#define RCR_RUNT (1 << 2)
++#define RCR_ALL (1 << 3)
++#define RCR_DIS_CRC (1 << 4)
++#define RCR_DIS_LONG (1 << 5)
++/* Rx Status Reg */
++#define RSR 0x06
++#define RSR_AE (1 << 2)
++#define RSR_MF (1 << 6)
++#define RSR_RF (1 << 7)
++/* Rx Overflow Counter Reg */
++#define ROCR 0x07
++#define ROCR_ROC (0x7F << 0)
++#define ROCR_RXFU (1 << 7)
++/* Back Pressure Threshold Reg */
++#define BPTR 0x08
++#define BPTR_JPT (0x0F << 0)
++#define BPTR_BPHW (0x0F << 4)
++/* Flow Control Threshold Reg */
++#define FCTR 0x09
++#define FCTR_LWOT (0x0F << 0)
++#define FCTR_HWOT (0x0F << 4)
++/* rx/tx Flow Control Reg */
++#define FCR 0x0A
++#define FCR_FLCE (1 << 0)
++#define FCR_BKPA (1 << 4)
++#define FCR_TXPEN (1 << 5)
++#define FCR_TXPF (1 << 6)
++#define FCR_TXP0 (1 << 7)
++/* Eeprom & Phy Control Reg */
++#define EPCR 0x0B
++#define EPCR_ERRE (1 << 0)
++#define EPCR_ERPRW (1 << 1)
++#define EPCR_ERPRR (1 << 2)
++#define EPCR_EPOS (1 << 3)
++#define EPCR_WEP (1 << 4)
++/* Eeprom & Phy Address Reg */
++#define EPAR 0x0C
++#define EPAR_EROA (0x3F << 0)
++#define EPAR_PHY_ADR_MASK (0x03 << 6)
++#define EPAR_PHY_ADR (0x01 << 6)
++/* Eeprom & Phy Data Reg */
++#define EPDR 0x0D /* 0x0D ~ 0x0E for Data Reg Low & High */
++/* Wakeup Control Reg */
++#define WCR 0x0F
++#define WCR_MAGICST (1 << 0)
++#define WCR_LINKST (1 << 2)
++#define WCR_MAGICEN (1 << 3)
++#define WCR_LINKEN (1 << 5)
++/* Physical Address Reg */
++#define PAR 0x10 /* 0x10 ~ 0x15 6 bytes for PAR */
++/* Multicast Address Reg */
++#define MAR 0x16 /* 0x16 ~ 0x1D 8 bytes for MAR */
++/* 0x1e unused */
++/* Phy Reset Reg */
++#define PRR 0x1F
++#define PRR_PHY_RST (1 << 0)
++/* Tx sdram Write Pointer Address Low */
++#define TWPAL 0x20
++/* Tx sdram Write Pointer Address High */
++#define TWPAH 0x21
++/* Tx sdram Read Pointer Address Low */
++#define TRPAL 0x22
++/* Tx sdram Read Pointer Address High */
++#define TRPAH 0x23
++/* Rx sdram Write Pointer Address Low */
++#define RWPAL 0x24
++/* Rx sdram Write Pointer Address High */
++#define RWPAH 0x25
++/* Rx sdram Read Pointer Address Low */
++#define RRPAL 0x26
++/* Rx sdram Read Pointer Address High */
++#define RRPAH 0x27
++/* Vendor ID register */
++#define VID 0x28 /* 0x28 ~ 0x29 2 bytes for VID */
++/* Product ID register */
++#define PID 0x2A /* 0x2A ~ 0x2B 2 bytes for PID */
++/* CHIP Revision register */
++#define CHIPR 0x2C
++/* 0x2D --> 0xEF unused */
++/* USB Device Address */
++#define USBDA 0xF0
++#define USBDA_USBFA (0x7F << 0)
++/* RX packet Counter Reg */
++#define RXC 0xF1
++/* Tx packet Counter & USB Status Reg */
++#define TXC_USBS 0xF2
++#define TXC_USBS_TXC0 (1 << 0)
++#define TXC_USBS_TXC1 (1 << 1)
++#define TXC_USBS_TXC2 (1 << 2)
++#define TXC_USBS_EP1RDY (1 << 5)
++#define TXC_USBS_SUSFLAG (1 << 6)
++#define TXC_USBS_RXFAULT (1 << 7)
++/* USB Control register */
++#define USBC 0xF4
++#define USBC_EP3NAK (1 << 4)
++#define USBC_EP3ACK (1 << 5)
++
++/* Register access commands and flags */
++#define SR_RD_REGS 0x00
++#define SR_WR_REGS 0x01
++#define SR_WR_REG 0x03
++#define SR_REQ_RD_REG (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE)
++#define SR_REQ_WR_REG (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE)
++
++/* parameters */
++#define SR_SHARE_TIMEOUT 1000
++#define SR_EEPROM_LEN 256
++#define SR_MCAST_SIZE 8
++#define SR_MCAST_ADDR_FLAG 0x80
++#define SR_MCAST_MAX 64
++#define SR_TX_OVERHEAD 2 /* 2bytes header */
++#define SR_RX_OVERHEAD 7 /* 3bytes header + 4crc tail */
++
++#endif /* _SR9700_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9800.c backports-3.18.1-1/drivers/net/usb/sr9800.c
+--- backports-3.18.1-1.org/drivers/net/usb/sr9800.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/sr9800.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,874 @@
++/* CoreChip-sz SR9800 one chip USB 2.0 Ethernet Devices
++ *
++ * Author : Liu Junliang <liujunliang_ljl@163.com>
++ *
++ * Based on asix_common.c, asix_devices.c
++ *
++ * This file is licensed under the terms of the GNU General Public License
++ * version 2. This program is licensed "as is" without any warranty of any
++ * kind, whether express or implied.*
++ */
++
++#include <linux/module.h>
++#include <linux/kmod.h>
++#include <linux/init.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/usb.h>
++#include <linux/crc32.h>
++#include <linux/usb/usbnet.h>
++#include <linux/slab.h>
++#include <linux/if_vlan.h>
++
++#include "sr9800.h"
++
++static int sr_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data)
++{
++ int err;
++
++ err = usbnet_read_cmd(dev, cmd, SR_REQ_RD_REG, value, index,
++ data, size);
++ if ((err != size) && (err >= 0))
++ err = -EINVAL;
++
++ return err;
++}
++
++static int sr_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data)
++{
++ int err;
++
++ err = usbnet_write_cmd(dev, cmd, SR_REQ_WR_REG, value, index,
++ data, size);
++ if ((err != size) && (err >= 0))
++ err = -EINVAL;
++
++ return err;
++}
++
++static void
++sr_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
++ u16 size, void *data)
++{
++ usbnet_write_cmd_async(dev, cmd, SR_REQ_WR_REG, value, index, data,
++ size);
++}
++
++static int sr_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++{
++ int offset = 0;
++
++ /* This check is no longer done by usbnet */
++ if (skb->len < dev->net->hard_header_len)
++ return 0;
++
++ while (offset + sizeof(u32) < skb->len) {
++ struct sk_buff *sr_skb;
++ u16 size;
++ u32 header = get_unaligned_le32(skb->data + offset);
++
++ offset += sizeof(u32);
++ /* get the packet length */
++ size = (u16) (header & 0x7ff);
++ if (size != ((~header >> 16) & 0x07ff)) {
++ netdev_err(dev->net, "%s : Bad Header Length\n",
++ __func__);
++ return 0;
++ }
++
++ if ((size > dev->net->mtu + ETH_HLEN + VLAN_HLEN) ||
++ (size + offset > skb->len)) {
++ netdev_err(dev->net, "%s : Bad RX Length %d\n",
++ __func__, size);
++ return 0;
++ }
++ sr_skb = netdev_alloc_skb_ip_align(dev->net, size);
++ if (!sr_skb)
++ return 0;
++
++ skb_put(sr_skb, size);
++ memcpy(sr_skb->data, skb->data + offset, size);
++ usbnet_skb_return(dev, sr_skb);
++
++ offset += (size + 1) & 0xfffe;
++ }
++
++ if (skb->len != offset) {
++ netdev_err(dev->net, "%s : Bad SKB Length %d\n", __func__,
++ skb->len);
++ return 0;
++ }
++
++ return 1;
++}
++
++static struct sk_buff *sr_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
++ gfp_t flags)
++{
++ int headroom = skb_headroom(skb);
++ int tailroom = skb_tailroom(skb);
++ u32 padbytes = 0xffff0000;
++ u32 packet_len;
++ int padlen;
++
++ padlen = ((skb->len + 4) % (dev->maxpacket - 1)) ? 0 : 4;
++
++ if ((!skb_cloned(skb)) && ((headroom + tailroom) >= (4 + padlen))) {
++ if ((headroom < 4) || (tailroom < padlen)) {
++ skb->data = memmove(skb->head + 4, skb->data,
++ skb->len);
++ skb_set_tail_pointer(skb, skb->len);
++ }
++ } else {
++ struct sk_buff *skb2;
++ skb2 = skb_copy_expand(skb, 4, padlen, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (!skb)
++ return NULL;
++ }
++
++ skb_push(skb, 4);
++ packet_len = (((skb->len - 4) ^ 0x0000ffff) << 16) + (skb->len - 4);
++ cpu_to_le32s(&packet_len);
++ skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len));
++
++ if (padlen) {
++ cpu_to_le32s(&padbytes);
++ memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
++ skb_put(skb, sizeof(padbytes));
++ }
++
++ return skb;
++}
++
++static void sr_status(struct usbnet *dev, struct urb *urb)
++{
++ struct sr9800_int_data *event;
++ int link;
++
++ if (urb->actual_length < 8)
++ return;
++
++ event = urb->transfer_buffer;
++ link = event->link & 0x01;
++ if (netif_carrier_ok(dev->net) != link) {
++ usbnet_link_change(dev, link, 1);
++ netdev_dbg(dev->net, "Link Status is: %d\n", link);
++ }
++
++ return;
++}
++
++static inline int sr_set_sw_mii(struct usbnet *dev)
++{
++ int ret;
++
++ ret = sr_write_cmd(dev, SR_CMD_SET_SW_MII, 0x0000, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to enable software MII access\n");
++ return ret;
++}
++
++static inline int sr_set_hw_mii(struct usbnet *dev)
++{
++ int ret;
++
++ ret = sr_write_cmd(dev, SR_CMD_SET_HW_MII, 0x0000, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to enable hardware MII access\n");
++ return ret;
++}
++
++static inline int sr_get_phy_addr(struct usbnet *dev)
++{
++ u8 buf[2];
++ int ret;
++
++ ret = sr_read_cmd(dev, SR_CMD_READ_PHY_ID, 0, 0, 2, buf);
++ if (ret < 0) {
++ netdev_err(dev->net, "%s : Error reading PHYID register:%02x\n",
++ __func__, ret);
++ goto out;
++ }
++ netdev_dbg(dev->net, "%s : returning 0x%04x\n", __func__,
++ *((__le16 *)buf));
++
++ ret = buf[1];
++
++out:
++ return ret;
++}
++
++static int sr_sw_reset(struct usbnet *dev, u8 flags)
++{
++ int ret;
++
++ ret = sr_write_cmd(dev, SR_CMD_SW_RESET, flags, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to send software reset:%02x\n",
++ ret);
++
++ return ret;
++}
++
++static u16 sr_read_rx_ctl(struct usbnet *dev)
++{
++ __le16 v;
++ int ret;
++
++ ret = sr_read_cmd(dev, SR_CMD_READ_RX_CTL, 0, 0, 2, &v);
++ if (ret < 0) {
++ netdev_err(dev->net, "Error reading RX_CTL register:%02x\n",
++ ret);
++ goto out;
++ }
++
++ ret = le16_to_cpu(v);
++out:
++ return ret;
++}
++
++static int sr_write_rx_ctl(struct usbnet *dev, u16 mode)
++{
++ int ret;
++
++ netdev_dbg(dev->net, "%s : mode = 0x%04x\n", __func__, mode);
++ ret = sr_write_cmd(dev, SR_CMD_WRITE_RX_CTL, mode, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net,
++ "Failed to write RX_CTL mode to 0x%04x:%02x\n",
++ mode, ret);
++
++ return ret;
++}
++
++static u16 sr_read_medium_status(struct usbnet *dev)
++{
++ __le16 v;
++ int ret;
++
++ ret = sr_read_cmd(dev, SR_CMD_READ_MEDIUM_STATUS, 0, 0, 2, &v);
++ if (ret < 0) {
++ netdev_err(dev->net,
++ "Error reading Medium Status register:%02x\n", ret);
++ return ret; /* TODO: callers not checking for error ret */
++ }
++
++ return le16_to_cpu(v);
++}
++
++static int sr_write_medium_mode(struct usbnet *dev, u16 mode)
++{
++ int ret;
++
++ netdev_dbg(dev->net, "%s : mode = 0x%04x\n", __func__, mode);
++ ret = sr_write_cmd(dev, SR_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net,
++ "Failed to write Medium Mode mode to 0x%04x:%02x\n",
++ mode, ret);
++ return ret;
++}
++
++static int sr_write_gpio(struct usbnet *dev, u16 value, int sleep)
++{
++ int ret;
++
++ netdev_dbg(dev->net, "%s : value = 0x%04x\n", __func__, value);
++ ret = sr_write_cmd(dev, SR_CMD_WRITE_GPIOS, value, 0, 0, NULL);
++ if (ret < 0)
++ netdev_err(dev->net, "Failed to write GPIO value 0x%04x:%02x\n",
++ value, ret);
++ if (sleep)
++ msleep(sleep);
++
++ return ret;
++}
++
++/* SR9800 have a 16-bit RX_CTL value */
++static void sr_set_multicast(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct sr_data *data = (struct sr_data *)&dev->data;
++ u16 rx_ctl = SR_DEFAULT_RX_CTL;
++
++ if (net->flags & IFF_PROMISC) {
++ rx_ctl |= SR_RX_CTL_PRO;
++ } else if (net->flags & IFF_ALLMULTI ||
++ netdev_mc_count(net) > SR_MAX_MCAST) {
++ rx_ctl |= SR_RX_CTL_AMALL;
++ } else if (netdev_mc_empty(net)) {
++ /* just broadcast and directed */
++ } else {
++ /* We use the 20 byte dev->data
++ * for our 8 byte filter buffer
++ * to avoid allocating memory that
++ * is tricky to free later
++ */
++ struct netdev_hw_addr *ha;
++ u32 crc_bits;
++
++ memset(data->multi_filter, 0, SR_MCAST_FILTER_SIZE);
++
++ /* Build the multicast hash filter. */
++ netdev_for_each_mc_addr(ha, net) {
++ crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
++ data->multi_filter[crc_bits >> 3] |=
++ 1 << (crc_bits & 7);
++ }
++
++ sr_write_cmd_async(dev, SR_CMD_WRITE_MULTI_FILTER, 0, 0,
++ SR_MCAST_FILTER_SIZE, data->multi_filter);
++
++ rx_ctl |= SR_RX_CTL_AM;
++ }
++
++ sr_write_cmd_async(dev, SR_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL);
++}
++
++static int sr_mdio_read(struct net_device *net, int phy_id, int loc)
++{
++ struct usbnet *dev = netdev_priv(net);
++ __le16 res;
++
++ mutex_lock(&dev->phy_mutex);
++ sr_set_sw_mii(dev);
++ sr_read_cmd(dev, SR_CMD_READ_MII_REG, phy_id, (__u16)loc, 2, &res);
++ sr_set_hw_mii(dev);
++ mutex_unlock(&dev->phy_mutex);
++
++ netdev_dbg(dev->net,
++ "%s : phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n", __func__,
++ phy_id, loc, le16_to_cpu(res));
++
++ return le16_to_cpu(res);
++}
++
++static void
++sr_mdio_write(struct net_device *net, int phy_id, int loc, int val)
++{
++ struct usbnet *dev = netdev_priv(net);
++ __le16 res = cpu_to_le16(val);
++
++ netdev_dbg(dev->net,
++ "%s : phy_id=0x%02x, loc=0x%02x, val=0x%04x\n", __func__,
++ phy_id, loc, val);
++ mutex_lock(&dev->phy_mutex);
++ sr_set_sw_mii(dev);
++ sr_write_cmd(dev, SR_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, &res);
++ sr_set_hw_mii(dev);
++ mutex_unlock(&dev->phy_mutex);
++}
++
++/* Get the PHY Identifier from the PHYSID1 & PHYSID2 MII registers */
++static u32 sr_get_phyid(struct usbnet *dev)
++{
++ int phy_reg;
++ u32 phy_id;
++ int i;
++
++ /* Poll for the rare case the FW or phy isn't ready yet. */
++ for (i = 0; i < 100; i++) {
++ phy_reg = sr_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID1);
++ if (phy_reg != 0 && phy_reg != 0xFFFF)
++ break;
++ mdelay(1);
++ }
++
++ if (phy_reg <= 0 || phy_reg == 0xFFFF)
++ return 0;
++
++ phy_id = (phy_reg & 0xffff) << 16;
++
++ phy_reg = sr_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID2);
++ if (phy_reg < 0)
++ return 0;
++
++ phy_id |= (phy_reg & 0xffff);
++
++ return phy_id;
++}
++
++static void
++sr_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u8 opt;
++
++ if (sr_read_cmd(dev, SR_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) {
++ wolinfo->supported = 0;
++ wolinfo->wolopts = 0;
++ return;
++ }
++ wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
++ wolinfo->wolopts = 0;
++ if (opt & SR_MONITOR_LINK)
++ wolinfo->wolopts |= WAKE_PHY;
++ if (opt & SR_MONITOR_MAGIC)
++ wolinfo->wolopts |= WAKE_MAGIC;
++}
++
++static int
++sr_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
++{
++ struct usbnet *dev = netdev_priv(net);
++ u8 opt = 0;
++
++ if (wolinfo->wolopts & WAKE_PHY)
++ opt |= SR_MONITOR_LINK;
++ if (wolinfo->wolopts & WAKE_MAGIC)
++ opt |= SR_MONITOR_MAGIC;
++
++ if (sr_write_cmd(dev, SR_CMD_WRITE_MONITOR_MODE,
++ opt, 0, 0, NULL) < 0)
++ return -EINVAL;
++
++ return 0;
++}
++
++static int sr_get_eeprom_len(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct sr_data *data = (struct sr_data *)&dev->data;
++
++ return data->eeprom_len;
++}
++
++static int sr_get_eeprom(struct net_device *net,
++ struct ethtool_eeprom *eeprom, u8 *data)
++{
++ struct usbnet *dev = netdev_priv(net);
++ __le16 *ebuf = (__le16 *)data;
++ int ret;
++ int i;
++
++ /* Crude hack to ensure that we don't overwrite memory
++ * if an odd length is supplied
++ */
++ if (eeprom->len % 2)
++ return -EINVAL;
++
++ eeprom->magic = SR_EEPROM_MAGIC;
++
++ /* sr9800 returns 2 bytes from eeprom on read */
++ for (i = 0; i < eeprom->len / 2; i++) {
++ ret = sr_read_cmd(dev, SR_CMD_READ_EEPROM, eeprom->offset + i,
++ 0, 2, &ebuf[i]);
++ if (ret < 0)
++ return -EINVAL;
++ }
++ return 0;
++}
++
++static void sr_get_drvinfo(struct net_device *net,
++ struct ethtool_drvinfo *info)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct sr_data *data = (struct sr_data *)&dev->data;
++
++ /* Inherit standard device info */
++ usbnet_get_drvinfo(net, info);
++ strncpy(info->driver, DRIVER_NAME, sizeof(info->driver));
++ strncpy(info->version, DRIVER_VERSION, sizeof(info->version));
++ info->eedump_len = data->eeprom_len;
++}
++
++static u32 sr_get_link(struct net_device *net)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ return mii_link_ok(&dev->mii);
++}
++
++static int sr_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
++{
++ struct usbnet *dev = netdev_priv(net);
++
++ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
++}
++
++static int sr_set_mac_address(struct net_device *net, void *p)
++{
++ struct usbnet *dev = netdev_priv(net);
++ struct sr_data *data = (struct sr_data *)&dev->data;
++ struct sockaddr *addr = p;
++
++ if (netif_running(net))
++ return -EBUSY;
++ if (!is_valid_ether_addr(addr->sa_data))
++ return -EADDRNOTAVAIL;
++
++ memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
++
++ /* We use the 20 byte dev->data
++ * for our 6 byte mac buffer
++ * to avoid allocating memory that
++ * is tricky to free later
++ */
++ memcpy(data->mac_addr, addr->sa_data, ETH_ALEN);
++ sr_write_cmd_async(dev, SR_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
++ data->mac_addr);
++
++ return 0;
++}
++
++static const struct ethtool_ops sr9800_ethtool_ops = {
++ .get_drvinfo = sr_get_drvinfo,
++ .get_link = sr_get_link,
++ .get_msglevel = usbnet_get_msglevel,
++ .set_msglevel = usbnet_set_msglevel,
++ .get_wol = sr_get_wol,
++ .set_wol = sr_set_wol,
++ .get_eeprom_len = sr_get_eeprom_len,
++ .get_eeprom = sr_get_eeprom,
++ .get_settings = usbnet_get_settings,
++ .set_settings = usbnet_set_settings,
++ .nway_reset = usbnet_nway_reset,
++};
++
++static int sr9800_link_reset(struct usbnet *dev)
++{
++ struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
++ u16 mode;
++
++ mii_check_media(&dev->mii, 1, 1);
++ mii_ethtool_gset(&dev->mii, &ecmd);
++ mode = SR9800_MEDIUM_DEFAULT;
++
++ if (ethtool_cmd_speed(&ecmd) != SPEED_100)
++ mode &= ~SR_MEDIUM_PS;
++
++ if (ecmd.duplex != DUPLEX_FULL)
++ mode &= ~SR_MEDIUM_FD;
++
++ netdev_dbg(dev->net, "%s : speed: %u duplex: %d mode: 0x%04x\n",
++ __func__, ethtool_cmd_speed(&ecmd), ecmd.duplex, mode);
++
++ sr_write_medium_mode(dev, mode);
++
++ return 0;
++}
++
++
++static int sr9800_set_default_mode(struct usbnet *dev)
++{
++ u16 rx_ctl;
++ int ret;
++
++ sr_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
++ sr_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
++ ADVERTISE_ALL | ADVERTISE_CSMA);
++ mii_nway_restart(&dev->mii);
++
++ ret = sr_write_medium_mode(dev, SR9800_MEDIUM_DEFAULT);
++ if (ret < 0)
++ goto out;
++
++ ret = sr_write_cmd(dev, SR_CMD_WRITE_IPG012,
++ SR9800_IPG0_DEFAULT | SR9800_IPG1_DEFAULT,
++ SR9800_IPG2_DEFAULT, 0, NULL);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Write IPG,IPG1,IPG2 failed: %d\n", ret);
++ goto out;
++ }
++
++ /* Set RX_CTL to default values with 2k buffer, and enable cactus */
++ ret = sr_write_rx_ctl(dev, SR_DEFAULT_RX_CTL);
++ if (ret < 0)
++ goto out;
++
++ rx_ctl = sr_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x after all initializations\n",
++ rx_ctl);
++
++ rx_ctl = sr_read_medium_status(dev);
++ netdev_dbg(dev->net, "Medium Status:0x%04x after all initializations\n",
++ rx_ctl);
++
++ return 0;
++out:
++ return ret;
++}
++
++static int sr9800_reset(struct usbnet *dev)
++{
++ struct sr_data *data = (struct sr_data *)&dev->data;
++ int ret, embd_phy;
++ u16 rx_ctl;
++
++ ret = sr_write_gpio(dev,
++ SR_GPIO_RSE | SR_GPIO_GPO_2 | SR_GPIO_GPO2EN, 5);
++ if (ret < 0)
++ goto out;
++
++ embd_phy = ((sr_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0);
++
++ ret = sr_write_cmd(dev, SR_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Select PHY #1 failed: %d\n", ret);
++ goto out;
++ }
++
++ ret = sr_sw_reset(dev, SR_SWRESET_IPPD | SR_SWRESET_PRL);
++ if (ret < 0)
++ goto out;
++
++ msleep(150);
++
++ ret = sr_sw_reset(dev, SR_SWRESET_CLEAR);
++ if (ret < 0)
++ goto out;
++
++ msleep(150);
++
++ if (embd_phy) {
++ ret = sr_sw_reset(dev, SR_SWRESET_IPRL);
++ if (ret < 0)
++ goto out;
++ } else {
++ ret = sr_sw_reset(dev, SR_SWRESET_PRTE);
++ if (ret < 0)
++ goto out;
++ }
++
++ msleep(150);
++ rx_ctl = sr_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x after software reset\n", rx_ctl);
++ ret = sr_write_rx_ctl(dev, 0x0000);
++ if (ret < 0)
++ goto out;
++
++ rx_ctl = sr_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x setting to 0x0000\n", rx_ctl);
++
++ ret = sr_sw_reset(dev, SR_SWRESET_PRL);
++ if (ret < 0)
++ goto out;
++
++ msleep(150);
++
++ ret = sr_sw_reset(dev, SR_SWRESET_IPRL | SR_SWRESET_PRL);
++ if (ret < 0)
++ goto out;
++
++ msleep(150);
++
++ ret = sr9800_set_default_mode(dev);
++ if (ret < 0)
++ goto out;
++
++ /* Rewrite MAC address */
++ memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
++ ret = sr_write_cmd(dev, SR_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
++ data->mac_addr);
++ if (ret < 0)
++ goto out;
++
++ return 0;
++
++out:
++ return ret;
++}
++
++static const struct net_device_ops sr9800_netdev_ops = {
++ .ndo_open = usbnet_open,
++ .ndo_stop = usbnet_stop,
++ .ndo_start_xmit = usbnet_start_xmit,
++ .ndo_tx_timeout = usbnet_tx_timeout,
++ .ndo_change_mtu = usbnet_change_mtu,
++ .ndo_set_mac_address = sr_set_mac_address,
++ .ndo_validate_addr = eth_validate_addr,
++ .ndo_do_ioctl = sr_ioctl,
++ .ndo_set_rx_mode = sr_set_multicast,
++};
++
++static int sr9800_phy_powerup(struct usbnet *dev)
++{
++ int ret;
++
++ /* set the embedded Ethernet PHY in power-down state */
++ ret = sr_sw_reset(dev, SR_SWRESET_IPPD | SR_SWRESET_IPRL);
++ if (ret < 0) {
++ netdev_err(dev->net, "Failed to power down PHY : %d\n", ret);
++ return ret;
++ }
++ msleep(20);
++
++ /* set the embedded Ethernet PHY in power-up state */
++ ret = sr_sw_reset(dev, SR_SWRESET_IPRL);
++ if (ret < 0) {
++ netdev_err(dev->net, "Failed to reset PHY: %d\n", ret);
++ return ret;
++ }
++ msleep(600);
++
++ /* set the embedded Ethernet PHY in reset state */
++ ret = sr_sw_reset(dev, SR_SWRESET_CLEAR);
++ if (ret < 0) {
++ netdev_err(dev->net, "Failed to power up PHY: %d\n", ret);
++ return ret;
++ }
++ msleep(20);
++
++ /* set the embedded Ethernet PHY in power-up state */
++ ret = sr_sw_reset(dev, SR_SWRESET_IPRL);
++ if (ret < 0) {
++ netdev_err(dev->net, "Failed to reset PHY: %d\n", ret);
++ return ret;
++ }
++
++ return 0;
++}
++
++static int sr9800_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ struct sr_data *data = (struct sr_data *)&dev->data;
++ u16 led01_mux, led23_mux;
++ int ret, embd_phy;
++ u32 phyid;
++ u16 rx_ctl;
++
++ data->eeprom_len = SR9800_EEPROM_LEN;
++
++ usbnet_get_endpoints(dev, intf);
++
++ /* LED Setting Rule :
++ * AABB:CCDD
++ * AA : MFA0(LED0)
++ * BB : MFA1(LED1)
++ * CC : MFA2(LED2), Reserved for SR9800
++ * DD : MFA3(LED3), Reserved for SR9800
++ */
++ led01_mux = (SR_LED_MUX_LINK_ACTIVE << 8) | SR_LED_MUX_LINK;
++ led23_mux = (SR_LED_MUX_LINK_ACTIVE << 8) | SR_LED_MUX_TX_ACTIVE;
++ ret = sr_write_cmd(dev, SR_CMD_LED_MUX, led01_mux, led23_mux, 0, NULL);
++ if (ret < 0) {
++ netdev_err(dev->net, "set LINK LED failed : %d\n", ret);
++ goto out;
++ }
++
++ /* Get the MAC address */
++ ret = sr_read_cmd(dev, SR_CMD_READ_NODE_ID, 0, 0, ETH_ALEN,
++ dev->net->dev_addr);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Failed to read MAC address: %d\n", ret);
++ return ret;
++ }
++ netdev_dbg(dev->net, "mac addr : %pM\n", dev->net->dev_addr);
++
++ /* Initialize MII structure */
++ dev->mii.dev = dev->net;
++ dev->mii.mdio_read = sr_mdio_read;
++ dev->mii.mdio_write = sr_mdio_write;
++ dev->mii.phy_id_mask = 0x1f;
++ dev->mii.reg_num_mask = 0x1f;
++ dev->mii.phy_id = sr_get_phy_addr(dev);
++
++ dev->net->netdev_ops = &sr9800_netdev_ops;
++ dev->net->ethtool_ops = &sr9800_ethtool_ops;
++
++ embd_phy = ((dev->mii.phy_id & 0x1f) == 0x10 ? 1 : 0);
++ /* Reset the PHY to normal operation mode */
++ ret = sr_write_cmd(dev, SR_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
++ if (ret < 0) {
++ netdev_dbg(dev->net, "Select PHY #1 failed: %d\n", ret);
++ return ret;
++ }
++
++ /* Init PHY routine */
++ ret = sr9800_phy_powerup(dev);
++ if (ret < 0)
++ goto out;
++
++ rx_ctl = sr_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x after software reset\n", rx_ctl);
++ ret = sr_write_rx_ctl(dev, 0x0000);
++ if (ret < 0)
++ goto out;
++
++ rx_ctl = sr_read_rx_ctl(dev);
++ netdev_dbg(dev->net, "RX_CTL is 0x%04x setting to 0x0000\n", rx_ctl);
++
++ /* Read PHYID register *AFTER* the PHY was reset properly */
++ phyid = sr_get_phyid(dev);
++ netdev_dbg(dev->net, "PHYID=0x%08x\n", phyid);
++
++ /* medium mode setting */
++ ret = sr9800_set_default_mode(dev);
++ if (ret < 0)
++ goto out;
++
++ if (dev->udev->speed == USB_SPEED_HIGH) {
++ ret = sr_write_cmd(dev, SR_CMD_BULKIN_SIZE,
++ SR9800_BULKIN_SIZE[SR9800_MAX_BULKIN_4K].byte_cnt,
++ SR9800_BULKIN_SIZE[SR9800_MAX_BULKIN_4K].threshold,
++ 0, NULL);
++ if (ret < 0) {
++ netdev_err(dev->net, "Reset RX_CTL failed: %d\n", ret);
++ goto out;
++ }
++ dev->rx_urb_size =
++ SR9800_BULKIN_SIZE[SR9800_MAX_BULKIN_4K].size;
++ } else {
++ ret = sr_write_cmd(dev, SR_CMD_BULKIN_SIZE,
++ SR9800_BULKIN_SIZE[SR9800_MAX_BULKIN_2K].byte_cnt,
++ SR9800_BULKIN_SIZE[SR9800_MAX_BULKIN_2K].threshold,
++ 0, NULL);
++ if (ret < 0) {
++ netdev_err(dev->net, "Reset RX_CTL failed: %d\n", ret);
++ goto out;
++ }
++ dev->rx_urb_size =
++ SR9800_BULKIN_SIZE[SR9800_MAX_BULKIN_2K].size;
++ }
++ netdev_dbg(dev->net, "%s : setting rx_urb_size with : %zu\n", __func__,
++ dev->rx_urb_size);
++ return 0;
++
++out:
++ return ret;
++}
++
++static const struct driver_info sr9800_driver_info = {
++ .description = "CoreChip SR9800 USB 2.0 Ethernet",
++ .bind = sr9800_bind,
++ .status = sr_status,
++ .link_reset = sr9800_link_reset,
++ .reset = sr9800_reset,
++ .flags = DRIVER_FLAG,
++ .rx_fixup = sr_rx_fixup,
++ .tx_fixup = sr_tx_fixup,
++};
++
++static const struct usb_device_id products[] = {
++ {
++ USB_DEVICE(0x0fe6, 0x9800), /* SR9800 Device */
++ .driver_info = (unsigned long) &sr9800_driver_info,
++ },
++ {}, /* END */
++};
++
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver sr_driver = {
++ .name = DRIVER_NAME,
++ .id_table = products,
++ .probe = usbnet_probe,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disconnect = usbnet_disconnect,
++ .supports_autosuspend = 1,
++};
++
++module_usb_driver(sr_driver);
++
++MODULE_AUTHOR("Liu Junliang <liujunliang_ljl@163.com");
++MODULE_VERSION(DRIVER_VERSION);
++MODULE_DESCRIPTION("SR9800 USB 2.0 USB2NET Dev : http://www.corechip-sz.com");
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9800.h backports-3.18.1-1/drivers/net/usb/sr9800.h
+--- backports-3.18.1-1.org/drivers/net/usb/sr9800.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/sr9800.h 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,202 @@
++/* CoreChip-sz SR9800 one chip USB 2.0 Ethernet Devices
++ *
++ * Author : Liu Junliang <liujunliang_ljl@163.com>
++ *
++ * This file is licensed under the terms of the GNU General Public License
++ * version 2. This program is licensed "as is" without any warranty of any
++ * kind, whether express or implied.
++ */
++
++#ifndef _SR9800_H
++#define _SR9800_H
++
++/* SR9800 spec. command table on Linux Platform */
++
++/* command : Software Station Management Control Reg */
++#define SR_CMD_SET_SW_MII 0x06
++/* command : PHY Read Reg */
++#define SR_CMD_READ_MII_REG 0x07
++/* command : PHY Write Reg */
++#define SR_CMD_WRITE_MII_REG 0x08
++/* command : Hardware Station Management Control Reg */
++#define SR_CMD_SET_HW_MII 0x0a
++/* command : SROM Read Reg */
++#define SR_CMD_READ_EEPROM 0x0b
++/* command : SROM Write Reg */
++#define SR_CMD_WRITE_EEPROM 0x0c
++/* command : SROM Write Enable Reg */
++#define SR_CMD_WRITE_ENABLE 0x0d
++/* command : SROM Write Disable Reg */
++#define SR_CMD_WRITE_DISABLE 0x0e
++/* command : RX Control Read Reg */
++#define SR_CMD_READ_RX_CTL 0x0f
++#define SR_RX_CTL_PRO (1 << 0)
++#define SR_RX_CTL_AMALL (1 << 1)
++#define SR_RX_CTL_SEP (1 << 2)
++#define SR_RX_CTL_AB (1 << 3)
++#define SR_RX_CTL_AM (1 << 4)
++#define SR_RX_CTL_AP (1 << 5)
++#define SR_RX_CTL_ARP (1 << 6)
++#define SR_RX_CTL_SO (1 << 7)
++#define SR_RX_CTL_RH1M (1 << 8)
++#define SR_RX_CTL_RH2M (1 << 9)
++#define SR_RX_CTL_RH3M (1 << 10)
++/* command : RX Control Write Reg */
++#define SR_CMD_WRITE_RX_CTL 0x10
++/* command : IPG0/IPG1/IPG2 Control Read Reg */
++#define SR_CMD_READ_IPG012 0x11
++/* command : IPG0/IPG1/IPG2 Control Write Reg */
++#define SR_CMD_WRITE_IPG012 0x12
++/* command : Node ID Read Reg */
++#define SR_CMD_READ_NODE_ID 0x13
++/* command : Node ID Write Reg */
++#define SR_CMD_WRITE_NODE_ID 0x14
++/* command : Multicast Filter Array Read Reg */
++#define SR_CMD_READ_MULTI_FILTER 0x15
++/* command : Multicast Filter Array Write Reg */
++#define SR_CMD_WRITE_MULTI_FILTER 0x16
++/* command : Eth/HomePNA PHY Address Reg */
++#define SR_CMD_READ_PHY_ID 0x19
++/* command : Medium Status Read Reg */
++#define SR_CMD_READ_MEDIUM_STATUS 0x1a
++#define SR_MONITOR_LINK (1 << 1)
++#define SR_MONITOR_MAGIC (1 << 2)
++#define SR_MONITOR_HSFS (1 << 4)
++/* command : Medium Status Write Reg */
++#define SR_CMD_WRITE_MEDIUM_MODE 0x1b
++#define SR_MEDIUM_GM (1 << 0)
++#define SR_MEDIUM_FD (1 << 1)
++#define SR_MEDIUM_AC (1 << 2)
++#define SR_MEDIUM_ENCK (1 << 3)
++#define SR_MEDIUM_RFC (1 << 4)
++#define SR_MEDIUM_TFC (1 << 5)
++#define SR_MEDIUM_JFE (1 << 6)
++#define SR_MEDIUM_PF (1 << 7)
++#define SR_MEDIUM_RE (1 << 8)
++#define SR_MEDIUM_PS (1 << 9)
++#define SR_MEDIUM_RSV (1 << 10)
++#define SR_MEDIUM_SBP (1 << 11)
++#define SR_MEDIUM_SM (1 << 12)
++/* command : Monitor Mode Status Read Reg */
++#define SR_CMD_READ_MONITOR_MODE 0x1c
++/* command : Monitor Mode Status Write Reg */
++#define SR_CMD_WRITE_MONITOR_MODE 0x1d
++/* command : GPIO Status Read Reg */
++#define SR_CMD_READ_GPIOS 0x1e
++#define SR_GPIO_GPO0EN (1 << 0) /* GPIO0 Output enable */
++#define SR_GPIO_GPO_0 (1 << 1) /* GPIO0 Output value */
++#define SR_GPIO_GPO1EN (1 << 2) /* GPIO1 Output enable */
++#define SR_GPIO_GPO_1 (1 << 3) /* GPIO1 Output value */
++#define SR_GPIO_GPO2EN (1 << 4) /* GPIO2 Output enable */
++#define SR_GPIO_GPO_2 (1 << 5) /* GPIO2 Output value */
++#define SR_GPIO_RESERVED (1 << 6) /* Reserved */
++#define SR_GPIO_RSE (1 << 7) /* Reload serial EEPROM */
++/* command : GPIO Status Write Reg */
++#define SR_CMD_WRITE_GPIOS 0x1f
++/* command : Eth PHY Power and Reset Control Reg */
++#define SR_CMD_SW_RESET 0x20
++#define SR_SWRESET_CLEAR 0x00
++#define SR_SWRESET_RR (1 << 0)
++#define SR_SWRESET_RT (1 << 1)
++#define SR_SWRESET_PRTE (1 << 2)
++#define SR_SWRESET_PRL (1 << 3)
++#define SR_SWRESET_BZ (1 << 4)
++#define SR_SWRESET_IPRL (1 << 5)
++#define SR_SWRESET_IPPD (1 << 6)
++/* command : Software Interface Selection Status Read Reg */
++#define SR_CMD_SW_PHY_STATUS 0x21
++/* command : Software Interface Selection Status Write Reg */
++#define SR_CMD_SW_PHY_SELECT 0x22
++/* command : BULK in Buffer Size Reg */
++#define SR_CMD_BULKIN_SIZE 0x2A
++/* command : LED_MUX Control Reg */
++#define SR_CMD_LED_MUX 0x70
++#define SR_LED_MUX_TX_ACTIVE (1 << 0)
++#define SR_LED_MUX_RX_ACTIVE (1 << 1)
++#define SR_LED_MUX_COLLISION (1 << 2)
++#define SR_LED_MUX_DUP_COL (1 << 3)
++#define SR_LED_MUX_DUP (1 << 4)
++#define SR_LED_MUX_SPEED (1 << 5)
++#define SR_LED_MUX_LINK_ACTIVE (1 << 6)
++#define SR_LED_MUX_LINK (1 << 7)
++
++/* Register Access Flags */
++#define SR_REQ_RD_REG (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE)
++#define SR_REQ_WR_REG (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE)
++
++/* Multicast Filter Array size & Max Number */
++#define SR_MCAST_FILTER_SIZE 8
++#define SR_MAX_MCAST 64
++
++/* IPG0/1/2 Default Value */
++#define SR9800_IPG0_DEFAULT 0x15
++#define SR9800_IPG1_DEFAULT 0x0c
++#define SR9800_IPG2_DEFAULT 0x12
++
++/* Medium Status Default Mode */
++#define SR9800_MEDIUM_DEFAULT \
++ (SR_MEDIUM_FD | SR_MEDIUM_RFC | \
++ SR_MEDIUM_TFC | SR_MEDIUM_PS | \
++ SR_MEDIUM_AC | SR_MEDIUM_RE)
++
++/* RX Control Default Setting */
++#define SR_DEFAULT_RX_CTL \
++ (SR_RX_CTL_SO | SR_RX_CTL_AB | SR_RX_CTL_RH1M)
++
++/* EEPROM Magic Number & EEPROM Size */
++#define SR_EEPROM_MAGIC 0xdeadbeef
++#define SR9800_EEPROM_LEN 0xff
++
++/* SR9800 Driver Version and Driver Name */
++#define DRIVER_VERSION "11-Nov-2013"
++#define DRIVER_NAME "CoreChips"
++#define DRIVER_FLAG \
++ (FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | FLAG_MULTI_PACKET)
++
++/* SR9800 BULKIN Buffer Size */
++#define SR9800_MAX_BULKIN_2K 0
++#define SR9800_MAX_BULKIN_4K 1
++#define SR9800_MAX_BULKIN_6K 2
++#define SR9800_MAX_BULKIN_8K 3
++#define SR9800_MAX_BULKIN_16K 4
++#define SR9800_MAX_BULKIN_20K 5
++#define SR9800_MAX_BULKIN_24K 6
++#define SR9800_MAX_BULKIN_32K 7
++
++struct {unsigned short size, byte_cnt, threshold; } SR9800_BULKIN_SIZE[] = {
++ /* 2k */
++ {2048, 0x8000, 0x8001},
++ /* 4k */
++ {4096, 0x8100, 0x8147},
++ /* 6k */
++ {6144, 0x8200, 0x81EB},
++ /* 8k */
++ {8192, 0x8300, 0x83D7},
++ /* 16 */
++ {16384, 0x8400, 0x851E},
++ /* 20k */
++ {20480, 0x8500, 0x8666},
++ /* 24k */
++ {24576, 0x8600, 0x87AE},
++ /* 32k */
++ {32768, 0x8700, 0x8A3D},
++};
++
++/* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
++struct sr_data {
++ u8 multi_filter[SR_MCAST_FILTER_SIZE];
++ u8 mac_addr[ETH_ALEN];
++ u8 phymode;
++ u8 ledmode;
++ u8 eeprom_len;
++};
++
++struct sr9800_int_data {
++ __le16 res1;
++ u8 link;
++ __le16 res2;
++ u8 status;
++ __le16 res3;
++} __packed;
++
++#endif /* _SR9800_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/zaurus.c backports-3.18.1-1/drivers/net/usb/zaurus.c
+--- backports-3.18.1-1.org/drivers/net/usb/zaurus.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/zaurus.c 2014-12-16 18:39:45.000000000 +0100
+@@ -0,0 +1,385 @@
++/*
++ * Copyright (C) 2002 Pavel Machek <pavel@ucw.cz>
++ * Copyright (C) 2002-2005 by David Brownell
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++// #define DEBUG // error path messages, extra info
++// #define VERBOSE // more; success messages
++
++#include <linux/module.h>
++#include <linux/netdevice.h>
++#include <linux/ethtool.h>
++#include <linux/workqueue.h>
++#include <linux/mii.h>
++#include <linux/crc32.h>
++#include <linux/usb.h>
++#include <linux/usb/cdc.h>
++#include <linux/usb/usbnet.h>
++
++
++/*
++ * All known Zaurii lie about their standards conformance. At least
++ * the earliest SA-1100 models lie by saying they support CDC Ethernet.
++ * Some later models (especially PXA-25x and PXA-27x based ones) lie
++ * and say they support CDC MDLM (for access to cell phone modems).
++ *
++ * There are non-Zaurus products that use these same protocols too.
++ *
++ * The annoying thing is that at the same time Sharp was developing
++ * that annoying standards-breaking software, the Linux community had
++ * a simple "CDC Subset" working reliably on the same SA-1100 hardware.
++ * That is, the same functionality but not violating standards.
++ *
++ * The CDC Ethernet nonconformance points are troublesome to hosts
++ * with a true CDC Ethernet implementation:
++ * - Framing appends a CRC, which the spec says drivers "must not" do;
++ * - Transfers data in altsetting zero, instead of altsetting 1;
++ * - All these peripherals use the same ethernet address.
++ *
++ * The CDC MDLM nonconformance is less immediately troublesome, since all
++ * MDLM implementations are quasi-proprietary anyway.
++ */
++
++static struct sk_buff *
++zaurus_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
++{
++ int padlen;
++ struct sk_buff *skb2;
++
++ padlen = 2;
++ if (!skb_cloned(skb)) {
++ int tailroom = skb_tailroom(skb);
++ if ((padlen + 4) <= tailroom)
++ goto done;
++ }
++ skb2 = skb_copy_expand(skb, 0, 4 + padlen, flags);
++ dev_kfree_skb_any(skb);
++ skb = skb2;
++ if (skb) {
++ u32 fcs;
++done:
++ fcs = crc32_le(~0, skb->data, skb->len);
++ fcs = ~fcs;
++
++ *skb_put (skb, 1) = fcs & 0xff;
++ *skb_put (skb, 1) = (fcs>> 8) & 0xff;
++ *skb_put (skb, 1) = (fcs>>16) & 0xff;
++ *skb_put (skb, 1) = (fcs>>24) & 0xff;
++ }
++ return skb;
++}
++
++static int zaurus_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ /* Belcarra's funky framing has other options; mostly
++ * TRAILERS (!) with 4 bytes CRC, and maybe 2 pad bytes.
++ */
++ dev->net->hard_header_len += 6;
++ dev->rx_urb_size = dev->net->hard_header_len + dev->net->mtu;
++ return usbnet_generic_cdc_bind(dev, intf);
++}
++
++/* PDA style devices are always connected if present */
++static int always_connected (struct usbnet *dev)
++{
++ return 0;
++}
++
++static const struct driver_info zaurus_sl5x00_info = {
++ .description = "Sharp Zaurus SL-5x00",
++ .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_Z,
++ .check_connect = always_connected,
++ .bind = zaurus_bind,
++ .unbind = usbnet_cdc_unbind,
++ .tx_fixup = zaurus_tx_fixup,
++};
++#define ZAURUS_STRONGARM_INFO ((unsigned long)&zaurus_sl5x00_info)
++
++static const struct driver_info zaurus_pxa_info = {
++ .description = "Sharp Zaurus, PXA-2xx based",
++ .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_Z,
++ .check_connect = always_connected,
++ .bind = zaurus_bind,
++ .unbind = usbnet_cdc_unbind,
++ .tx_fixup = zaurus_tx_fixup,
++};
++#define ZAURUS_PXA_INFO ((unsigned long)&zaurus_pxa_info)
++
++static const struct driver_info olympus_mxl_info = {
++ .description = "Olympus R1000",
++ .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_Z,
++ .check_connect = always_connected,
++ .bind = zaurus_bind,
++ .unbind = usbnet_cdc_unbind,
++ .tx_fixup = zaurus_tx_fixup,
++};
++#define OLYMPUS_MXL_INFO ((unsigned long)&olympus_mxl_info)
++
++
++/* Some more recent products using Lineo/Belcarra code will wrongly claim
++ * CDC MDLM conformance. They aren't conformant: data endpoints live
++ * in the control interface, there's no data interface, and it's not used
++ * to talk to a cell phone radio. But at least we can detect these two
++ * pseudo-classes, rather than growing this product list with entries for
++ * each new nonconformant product (sigh).
++ */
++static const u8 safe_guid[16] = {
++ 0x5d, 0x34, 0xcf, 0x66, 0x11, 0x18, 0x11, 0xd6,
++ 0xa2, 0x1a, 0x00, 0x01, 0x02, 0xca, 0x9a, 0x7f,
++};
++static const u8 blan_guid[16] = {
++ 0x74, 0xf0, 0x3d, 0xbd, 0x1e, 0xc1, 0x44, 0x70,
++ 0xa3, 0x67, 0x71, 0x34, 0xc9, 0xf5, 0x54, 0x37,
++};
++
++static int blan_mdlm_bind(struct usbnet *dev, struct usb_interface *intf)
++{
++ u8 *buf = intf->cur_altsetting->extra;
++ int len = intf->cur_altsetting->extralen;
++ struct usb_cdc_mdlm_desc *desc = NULL;
++ struct usb_cdc_mdlm_detail_desc *detail = NULL;
++
++ while (len > 3) {
++ if (buf [1] != USB_DT_CS_INTERFACE)
++ goto next_desc;
++
++ /* use bDescriptorSubType, and just verify that we get a
++ * "BLAN" (or "SAFE") descriptor.
++ */
++ switch (buf [2]) {
++ case USB_CDC_MDLM_TYPE:
++ if (desc) {
++ dev_dbg(&intf->dev, "extra MDLM\n");
++ goto bad_desc;
++ }
++ desc = (void *) buf;
++ if (desc->bLength != sizeof *desc) {
++ dev_dbg(&intf->dev, "MDLM len %u\n",
++ desc->bLength);
++ goto bad_desc;
++ }
++ /* expect bcdVersion 1.0, ignore */
++ if (memcmp(&desc->bGUID, blan_guid, 16) &&
++ memcmp(&desc->bGUID, safe_guid, 16)) {
++ /* hey, this one might _really_ be MDLM! */
++ dev_dbg(&intf->dev, "MDLM guid\n");
++ goto bad_desc;
++ }
++ break;
++ case USB_CDC_MDLM_DETAIL_TYPE:
++ if (detail) {
++ dev_dbg(&intf->dev, "extra MDLM detail\n");
++ goto bad_desc;
++ }
++ detail = (void *) buf;
++ switch (detail->bGuidDescriptorType) {
++ case 0: /* "SAFE" */
++ if (detail->bLength != (sizeof *detail + 2))
++ goto bad_detail;
++ break;
++ case 1: /* "BLAN" */
++ if (detail->bLength != (sizeof *detail + 3))
++ goto bad_detail;
++ break;
++ default:
++ goto bad_detail;
++ }
++
++ /* assuming we either noticed BLAN already, or will
++ * find it soon, there are some data bytes here:
++ * - bmNetworkCapabilities (unused)
++ * - bmDataCapabilities (bits, see below)
++ * - bPad (ignored, for PADAFTER -- BLAN-only)
++ * bits are:
++ * - 0x01 -- Zaurus framing (add CRC)
++ * - 0x02 -- PADBEFORE (CRC includes some padding)
++ * - 0x04 -- PADAFTER (some padding after CRC)
++ * - 0x08 -- "fermat" packet mangling (for hw bugs)
++ * the PADBEFORE appears not to matter; we interop
++ * with devices that use it and those that don't.
++ */
++ if ((detail->bDetailData[1] & ~0x02) != 0x01) {
++ /* bmDataCapabilities == 0 would be fine too,
++ * but framing is minidriver-coupled for now.
++ */
++bad_detail:
++ dev_dbg(&intf->dev,
++ "bad MDLM detail, %d %d %d\n",
++ detail->bLength,
++ detail->bDetailData[0],
++ detail->bDetailData[2]);
++ goto bad_desc;
++ }
++
++ /* same extra framing as for non-BLAN mode */
++ dev->net->hard_header_len += 6;
++ dev->rx_urb_size = dev->net->hard_header_len
++ + dev->net->mtu;
++ break;
++ }
++next_desc:
++ len -= buf [0]; /* bLength */
++ buf += buf [0];
++ }
++
++ if (!desc || !detail) {
++ dev_dbg(&intf->dev, "missing cdc mdlm %s%sdescriptor\n",
++ desc ? "" : "func ",
++ detail ? "" : "detail ");
++ goto bad_desc;
++ }
++
++ /* There's probably a CDC Ethernet descriptor there, but we can't
++ * rely on the Ethernet address it provides since not all vendors
++ * bother to make it unique. Likewise there's no point in tracking
++ * of the CDC event notifications.
++ */
++ return usbnet_get_endpoints(dev, intf);
++
++bad_desc:
++ dev_info(&dev->udev->dev, "unsupported MDLM descriptors\n");
++ return -ENODEV;
++}
++
++static const struct driver_info bogus_mdlm_info = {
++ .description = "pseudo-MDLM (BLAN) device",
++ .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_Z,
++ .check_connect = always_connected,
++ .tx_fixup = zaurus_tx_fixup,
++ .bind = blan_mdlm_bind,
++};
++
++static const struct usb_device_id products [] = {
++#define ZAURUS_MASTER_INTERFACE \
++ .bInterfaceClass = USB_CLASS_COMM, \
++ .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
++ .bInterfaceProtocol = USB_CDC_PROTO_NONE
++
++/* SA-1100 based Sharp Zaurus ("collie"), or compatible. */
++{
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
++ | USB_DEVICE_ID_MATCH_DEVICE,
++ .idVendor = 0x04DD,
++ .idProduct = 0x8004,
++ ZAURUS_MASTER_INTERFACE,
++ .driver_info = ZAURUS_STRONGARM_INFO,
++},
++
++/* PXA-2xx based models are also lying-about-cdc. If you add any
++ * more devices that claim to be CDC Ethernet, make sure they get
++ * added to the blacklist in cdc_ether too.
++ *
++ * NOTE: OpenZaurus versions with 2.6 kernels won't use these entries,
++ * unlike the older ones with 2.4 "embedix" kernels.
++ */
++{
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
++ | USB_DEVICE_ID_MATCH_DEVICE,
++ .idVendor = 0x04DD,
++ .idProduct = 0x8005, /* A-300 */
++ ZAURUS_MASTER_INTERFACE,
++ .driver_info = ZAURUS_PXA_INFO,
++}, {
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
++ | USB_DEVICE_ID_MATCH_DEVICE,
++ .idVendor = 0x04DD,
++ .idProduct = 0x8006, /* B-500/SL-5600 */
++ ZAURUS_MASTER_INTERFACE,
++ .driver_info = ZAURUS_PXA_INFO,
++}, {
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
++ | USB_DEVICE_ID_MATCH_DEVICE,
++ .idVendor = 0x04DD,
++ .idProduct = 0x8007, /* C-700 */
++ ZAURUS_MASTER_INTERFACE,
++ .driver_info = ZAURUS_PXA_INFO,
++}, {
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
++ | USB_DEVICE_ID_MATCH_DEVICE,
++ .idVendor = 0x04DD,
++ .idProduct = 0x9031, /* C-750 C-760 */
++ ZAURUS_MASTER_INTERFACE,
++ .driver_info = ZAURUS_PXA_INFO,
++}, {
++ /* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */
++ USB_DEVICE_AND_INTERFACE_INFO(0x04DD, 0x9031, USB_CLASS_COMM,
++ USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
++ .driver_info = (unsigned long) &bogus_mdlm_info,
++}, {
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
++ | USB_DEVICE_ID_MATCH_DEVICE,
++ .idVendor = 0x04DD,
++ .idProduct = 0x9032, /* SL-6000 */
++ ZAURUS_MASTER_INTERFACE,
++ .driver_info = ZAURUS_PXA_INFO,
++}, {
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
++ | USB_DEVICE_ID_MATCH_DEVICE,
++ .idVendor = 0x04DD,
++ /* reported with some C860 units */
++ .idProduct = 0x9050, /* C-860 */
++ ZAURUS_MASTER_INTERFACE,
++ .driver_info = ZAURUS_PXA_INFO,
++},
++{
++ /* Motorola Rokr E6 */
++ USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6027, USB_CLASS_COMM,
++ USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
++ .driver_info = (unsigned long) &bogus_mdlm_info,
++}, {
++ /* Motorola MOTOMAGX phones */
++ USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM,
++ USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
++ .driver_info = (unsigned long) &bogus_mdlm_info,
++},
++
++/* Olympus has some models with a Zaurus-compatible option.
++ * R-1000 uses a FreeScale i.MXL cpu (ARMv4T)
++ */
++{
++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
++ | USB_DEVICE_ID_MATCH_DEVICE,
++ .idVendor = 0x07B4,
++ .idProduct = 0x0F02, /* R-1000 */
++ ZAURUS_MASTER_INTERFACE,
++ .driver_info = OLYMPUS_MXL_INFO,
++},
++
++/* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
++{
++ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
++ USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
++ .driver_info = (unsigned long) &bogus_mdlm_info,
++},
++ { }, // END
++};
++MODULE_DEVICE_TABLE(usb, products);
++
++static struct usb_driver zaurus_driver = {
++ .name = "zaurus",
++ .id_table = products,
++ .probe = usbnet_probe,
++ .disconnect = usbnet_disconnect,
++ .suspend = usbnet_suspend,
++ .resume = usbnet_resume,
++ .disable_hub_initiated_lpm = 1,
++};
++
++module_usb_driver(zaurus_driver);
++
++MODULE_AUTHOR("Pavel Machek, David Brownell");
++MODULE_DESCRIPTION("Sharp Zaurus PDA, and compatible products");
++MODULE_LICENSE("GPL");
--- /dev/null
+diff -Naur backports-3.18.1-1.org/drivers/bluetooth/btwilink.c backports-3.18.1-1/drivers/bluetooth/btwilink.c
+--- backports-3.18.1-1.org/drivers/bluetooth/btwilink.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/drivers/bluetooth/btwilink.c 2014-12-28 14:10:09.480888533 +0100
+@@ -288,7 +288,7 @@
+
+ static int bt_ti_probe(struct platform_device *pdev)
+ {
+- static struct ti_st *hst;
++ struct ti_st *hst;
+ struct hci_dev *hdev;
+ int err;
+
+diff -Naur backports-3.18.1-1.org/drivers/media/dvb-core/dvbdev.c backports-3.18.1-1/drivers/media/dvb-core/dvbdev.c
+--- backports-3.18.1-1.org/drivers/media/dvb-core/dvbdev.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/dvb-core/dvbdev.c 2014-12-28 14:10:09.528888772 +0100
+@@ -185,7 +185,7 @@
+ const struct dvb_device *template, void *priv, int type)
+ {
+ struct dvb_device *dvbdev;
+- struct file_operations *dvbdevfops;
++ file_operations_no_const *dvbdevfops;
+ struct device *clsdev;
+ int minor;
+ int id;
+diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/af9033.h backports-3.18.1-1/drivers/media/dvb-frontends/af9033.h
+--- backports-3.18.1-1.org/drivers/media/dvb-frontends/af9033.h 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/dvb-frontends/af9033.h 2014-12-28 14:10:09.528888772 +0100
+@@ -96,6 +96,6 @@
+ int (*pid_filter_ctrl)(struct dvb_frontend *fe, int onoff);
+ int (*pid_filter)(struct dvb_frontend *fe, int index, u16 pid,
+ int onoff);
+-};
++} __no_const;
+
+ #endif /* AF9033_H */
+diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib3000.h backports-3.18.1-1/drivers/media/dvb-frontends/dib3000.h
+--- backports-3.18.1-1.org/drivers/media/dvb-frontends/dib3000.h 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/dvb-frontends/dib3000.h 2014-12-28 14:10:09.528888772 +0100
+@@ -39,7 +39,7 @@
+ int (*fifo_ctrl)(struct dvb_frontend *fe, int onoff);
+ int (*pid_ctrl)(struct dvb_frontend *fe, int index, int pid, int onoff);
+ int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl);
+-};
++} __no_const;
+
+ #if IS_ENABLED(CPTCFG_DVB_DIB3000MB)
+ extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
+diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib7000p.h backports-3.18.1-1/drivers/media/dvb-frontends/dib7000p.h
+--- backports-3.18.1-1.org/drivers/media/dvb-frontends/dib7000p.h 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/dvb-frontends/dib7000p.h 2014-12-28 14:10:09.528888772 +0100
+@@ -64,7 +64,7 @@
+ int (*get_adc_power)(struct dvb_frontend *fe);
+ int (*slave_reset)(struct dvb_frontend *fe);
+ struct dvb_frontend *(*init)(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib7000p_config *cfg);
+-};
++} __no_const;
+
+ #if IS_ENABLED(CPTCFG_DVB_DIB7000P)
+ void *dib7000p_attach(struct dib7000p_ops *ops);
+diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib8000.h backports-3.18.1-1/drivers/media/dvb-frontends/dib8000.h
+--- backports-3.18.1-1.org/drivers/media/dvb-frontends/dib8000.h 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/dvb-frontends/dib8000.h 2014-12-28 14:10:09.528888772 +0100
+@@ -61,7 +61,7 @@
+ int (*pid_filter_ctrl)(struct dvb_frontend *fe, u8 onoff);
+ int (*pid_filter)(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff);
+ struct dvb_frontend *(*init)(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib8000_config *cfg);
+-};
++} __no_const;
+
+ #if IS_ENABLED(CPTCFG_DVB_DIB8000)
+ void *dib8000_attach(struct dib8000_ops *ops);
+diff -Naur backports-3.18.1-1.org/drivers/media/pci/cx88/cx88-video.c backports-3.18.1-1/drivers/media/pci/cx88/cx88-video.c
+--- backports-3.18.1-1.org/drivers/media/pci/cx88/cx88-video.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/pci/cx88/cx88-video.c 2014-12-28 14:10:09.528888772 +0100
+@@ -50,9 +50,9 @@
+
+ /* ------------------------------------------------------------------ */
+
+-static unsigned int video_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
+-static unsigned int vbi_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
+-static unsigned int radio_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
++static int video_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
++static int vbi_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
++static int radio_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
+
+ module_param_array(video_nr, int, NULL, 0444);
+ module_param_array(vbi_nr, int, NULL, 0444);
+diff -Naur backports-3.18.1-1.org/drivers/media/pci/ivtv/ivtv-driver.c backports-3.18.1-1/drivers/media/pci/ivtv/ivtv-driver.c
+--- backports-3.18.1-1.org/drivers/media/pci/ivtv/ivtv-driver.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/pci/ivtv/ivtv-driver.c 2014-12-28 14:10:09.528888772 +0100
+@@ -83,7 +83,7 @@
+ MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
+
+ /* ivtv instance counter */
+-static atomic_t ivtv_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t ivtv_instance = ATOMIC_INIT(0);
+
+ /* Parameter declarations */
+ static int cardtype[IVTV_MAX_CARDS];
+diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-core.c backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-core.c
+--- backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-core.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-core.c 2014-12-28 14:10:09.528888772 +0100
+@@ -424,7 +424,7 @@
+
+ static int solo_sysfs_init(struct solo_dev *solo_dev)
+ {
+- struct bin_attribute *sdram_attr = &solo_dev->sdram_attr;
++ bin_attribute_no_const *sdram_attr = &solo_dev->sdram_attr;
+ struct device *dev = &solo_dev->dev;
+ const char *driver;
+ int i;
+diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-g723.c backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-g723.c
+--- backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-g723.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-g723.c 2014-12-28 14:10:09.528888772 +0100
+@@ -351,7 +351,7 @@
+
+ int solo_g723_init(struct solo_dev *solo_dev)
+ {
+- static struct snd_device_ops ops = { NULL };
++ static struct snd_device_ops ops = { };
+ struct snd_card *card;
+ struct snd_kcontrol_new kctl;
+ char name[32];
+diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10.h backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10.h
+--- backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10.h 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10.h 2014-12-28 14:10:09.532888798 +0100
+@@ -219,7 +219,7 @@
+
+ /* P2M DMA Engine */
+ struct solo_p2m_dev p2m_dev[SOLO_NR_P2M];
+- atomic_t p2m_count;
++ atomic_unchecked_t p2m_count;
+ int p2m_jiffies;
+ unsigned int p2m_timeouts;
+
+diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-p2m.c backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-p2m.c
+--- backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-p2m.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-p2m.c 2014-12-28 14:10:09.532888798 +0100
+@@ -73,7 +73,7 @@
+
+ /* Get next ID. According to Softlogic, 6110 has problems on !=0 P2M */
+ if (solo_dev->type != SOLO_DEV_6110 && multi_p2m) {
+- p2m_id = atomic_inc_return(&solo_dev->p2m_count) % SOLO_NR_P2M;
++ p2m_id = atomic_inc_return_unchecked(&solo_dev->p2m_count) % SOLO_NR_P2M;
+ if (p2m_id < 0)
+ p2m_id = -p2m_id;
+ }
+diff -Naur backports-3.18.1-1.org/drivers/media/platform/omap/omap_vout.c backports-3.18.1-1/drivers/media/platform/omap/omap_vout.c
+--- backports-3.18.1-1.org/drivers/media/platform/omap/omap_vout.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/platform/omap/omap_vout.c 2014-12-28 14:10:09.532888798 +0100
+@@ -63,7 +63,6 @@
+ OMAP_VIDEO2,
+ };
+
+-static struct videobuf_queue_ops video_vbq_ops;
+ /* Variables configurable through module params*/
+ static u32 video1_numbuffers = 3;
+ static u32 video2_numbuffers = 3;
+@@ -1012,6 +1011,12 @@
+ {
+ struct videobuf_queue *q;
+ struct omap_vout_device *vout = NULL;
++ static struct videobuf_queue_ops video_vbq_ops = {
++ .buf_setup = omap_vout_buffer_setup,
++ .buf_prepare = omap_vout_buffer_prepare,
++ .buf_release = omap_vout_buffer_release,
++ .buf_queue = omap_vout_buffer_queue,
++ };
+
+ vout = video_drvdata(file);
+ v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Entering %s\n", __func__);
+@@ -1029,10 +1034,6 @@
+ vout->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+
+ q = &vout->vbq;
+- video_vbq_ops.buf_setup = omap_vout_buffer_setup;
+- video_vbq_ops.buf_prepare = omap_vout_buffer_prepare;
+- video_vbq_ops.buf_release = omap_vout_buffer_release;
+- video_vbq_ops.buf_queue = omap_vout_buffer_queue;
+ spin_lock_init(&vout->vbq_lock);
+
+ videobuf_queue_dma_contig_init(q, &video_vbq_ops, q->dev,
+diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_grp_layer.c backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_grp_layer.c
+--- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_grp_layer.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_grp_layer.c 2014-12-28 14:10:09.532888798 +0100
+@@ -235,7 +235,7 @@
+ {
+ struct mxr_layer *layer;
+ int ret;
+- struct mxr_layer_ops ops = {
++ static struct mxr_layer_ops ops = {
+ .release = mxr_graph_layer_release,
+ .buffer_set = mxr_graph_buffer_set,
+ .stream_set = mxr_graph_stream_set,
+diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer.h backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer.h
+--- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer.h 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer.h 2014-12-28 14:10:09.532888798 +0100
+@@ -156,7 +156,7 @@
+ /** layer index (unique identifier) */
+ int idx;
+ /** callbacks for layer methods */
+- struct mxr_layer_ops ops;
++ struct mxr_layer_ops *ops;
+ /** format array */
+ const struct mxr_format **fmt_array;
+ /** size of format array */
+diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_reg.c backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_reg.c
+--- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_reg.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_reg.c 2014-12-28 14:10:09.532888798 +0100
+@@ -276,7 +276,7 @@
+ layer->update_buf = next;
+ }
+
+- layer->ops.buffer_set(layer, layer->update_buf);
++ layer->ops->buffer_set(layer, layer->update_buf);
+
+ if (done && done != layer->shadow_buf)
+ vb2_buffer_done(&done->vb, VB2_BUF_STATE_DONE);
+diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_video.c
+--- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_video.c 2014-12-28 14:10:09.532888798 +0100
+@@ -210,7 +210,7 @@
+ layer->geo.src.height = layer->geo.src.full_height;
+
+ mxr_geometry_dump(mdev, &layer->geo);
+- layer->ops.fix_geometry(layer, MXR_GEOMETRY_SINK, 0);
++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_SINK, 0);
+ mxr_geometry_dump(mdev, &layer->geo);
+ }
+
+@@ -228,7 +228,7 @@
+ layer->geo.dst.full_width = mbus_fmt.width;
+ layer->geo.dst.full_height = mbus_fmt.height;
+ layer->geo.dst.field = mbus_fmt.field;
+- layer->ops.fix_geometry(layer, MXR_GEOMETRY_SINK, 0);
++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_SINK, 0);
+
+ mxr_geometry_dump(mdev, &layer->geo);
+ }
+@@ -334,7 +334,7 @@
+ /* set source size to highest accepted value */
+ geo->src.full_width = max(geo->dst.full_width, pix->width);
+ geo->src.full_height = max(geo->dst.full_height, pix->height);
+- layer->ops.fix_geometry(layer, MXR_GEOMETRY_SOURCE, 0);
++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_SOURCE, 0);
+ mxr_geometry_dump(mdev, &layer->geo);
+ /* set cropping to total visible screen */
+ geo->src.width = pix->width;
+@@ -342,12 +342,12 @@
+ geo->src.x_offset = 0;
+ geo->src.y_offset = 0;
+ /* assure consistency of geometry */
+- layer->ops.fix_geometry(layer, MXR_GEOMETRY_CROP, MXR_NO_OFFSET);
++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_CROP, MXR_NO_OFFSET);
+ mxr_geometry_dump(mdev, &layer->geo);
+ /* set full size to lowest possible value */
+ geo->src.full_width = 0;
+ geo->src.full_height = 0;
+- layer->ops.fix_geometry(layer, MXR_GEOMETRY_SOURCE, 0);
++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_SOURCE, 0);
+ mxr_geometry_dump(mdev, &layer->geo);
+
+ /* returning results */
+@@ -474,7 +474,7 @@
+ target->width = s->r.width;
+ target->height = s->r.height;
+
+- layer->ops.fix_geometry(layer, stage, s->flags);
++ layer->ops->fix_geometry(layer, stage, s->flags);
+
+ /* retrieve update selection rectangle */
+ res.left = target->x_offset;
+@@ -954,13 +954,13 @@
+ mxr_output_get(mdev);
+
+ mxr_layer_update_output(layer);
+- layer->ops.format_set(layer);
++ layer->ops->format_set(layer);
+ /* enabling layer in hardware */
+ spin_lock_irqsave(&layer->enq_slock, flags);
+ layer->state = MXR_LAYER_STREAMING;
+ spin_unlock_irqrestore(&layer->enq_slock, flags);
+
+- layer->ops.stream_set(layer, MXR_ENABLE);
++ layer->ops->stream_set(layer, MXR_ENABLE);
+ mxr_streamer_get(mdev);
+
+ return 0;
+@@ -1030,7 +1030,7 @@
+ spin_unlock_irqrestore(&layer->enq_slock, flags);
+
+ /* disabling layer in hardware */
+- layer->ops.stream_set(layer, MXR_DISABLE);
++ layer->ops->stream_set(layer, MXR_DISABLE);
+ /* remove one streamer */
+ mxr_streamer_put(mdev);
+ /* allow changes in output configuration */
+@@ -1068,8 +1068,8 @@
+
+ void mxr_layer_release(struct mxr_layer *layer)
+ {
+- if (layer->ops.release)
+- layer->ops.release(layer);
++ if (layer->ops->release)
++ layer->ops->release(layer);
+ }
+
+ void mxr_base_layer_release(struct mxr_layer *layer)
+@@ -1095,7 +1095,7 @@
+
+ layer->mdev = mdev;
+ layer->idx = idx;
+- layer->ops = *ops;
++ layer->ops = ops;
+
+ spin_lock_init(&layer->enq_slock);
+ INIT_LIST_HEAD(&layer->enq_list);
+diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_vp_layer.c backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_vp_layer.c
+--- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_vp_layer.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_vp_layer.c 2014-12-28 14:10:09.532888798 +0100
+@@ -206,7 +206,7 @@
+ {
+ struct mxr_layer *layer;
+ int ret;
+- struct mxr_layer_ops ops = {
++ static struct mxr_layer_ops ops = {
+ .release = mxr_vp_layer_release,
+ .buffer_set = mxr_vp_buffer_set,
+ .stream_set = mxr_vp_stream_set,
+diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-cadet.c backports-3.18.1-1/drivers/media/radio/radio-cadet.c
+--- backports-3.18.1-1.org/drivers/media/radio/radio-cadet.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/radio/radio-cadet.c 2014-12-28 14:10:09.532888798 +0100
+@@ -333,6 +333,8 @@
+ unsigned char readbuf[RDS_BUFFER];
+ int i = 0;
+
++ if (count > RDS_BUFFER)
++ return -EFAULT;
+ mutex_lock(&dev->lock);
+ if (dev->rdsstat == 0)
+ cadet_start_rds(dev);
+@@ -349,8 +351,9 @@
+ readbuf[i++] = dev->rdsbuf[dev->rdsout++];
+ mutex_unlock(&dev->lock);
+
+- if (i && copy_to_user(data, readbuf, i))
+- return -EFAULT;
++ if (i > sizeof(readbuf) || (i && copy_to_user(data, readbuf, i)))
++ i = -EFAULT;
++
+ return i;
+ }
+
+diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-maxiradio.c backports-3.18.1-1/drivers/media/radio/radio-maxiradio.c
+--- backports-3.18.1-1.org/drivers/media/radio/radio-maxiradio.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/radio/radio-maxiradio.c 2014-12-28 14:10:09.532888798 +0100
+@@ -61,7 +61,7 @@
+ /* TEA5757 pin mappings */
+ static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16;
+
+-static atomic_t maxiradio_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t maxiradio_instance = ATOMIC_INIT(0);
+
+ #define PCI_VENDOR_ID_GUILLEMOT 0x5046
+ #define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001
+diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-shark2.c backports-3.18.1-1/drivers/media/radio/radio-shark2.c
+--- backports-3.18.1-1.org/drivers/media/radio/radio-shark2.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/radio/radio-shark2.c 2014-12-28 14:10:09.532888798 +0100
+@@ -74,7 +74,7 @@
+ u8 *transfer_buffer;
+ };
+
+-static atomic_t shark_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t shark_instance = ATOMIC_INIT(0);
+
+ static int shark_write_reg(struct radio_tea5777 *tea, u64 reg)
+ {
+diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-shark.c backports-3.18.1-1/drivers/media/radio/radio-shark.c
+--- backports-3.18.1-1.org/drivers/media/radio/radio-shark.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/radio/radio-shark.c 2014-12-28 14:10:09.532888798 +0100
+@@ -79,7 +79,7 @@
+ u32 last_val;
+ };
+
+-static atomic_t shark_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t shark_instance = ATOMIC_INIT(0);
+
+ static void shark_write_val(struct snd_tea575x *tea, u32 val)
+ {
+diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-si476x.c backports-3.18.1-1/drivers/media/radio/radio-si476x.c
+--- backports-3.18.1-1.org/drivers/media/radio/radio-si476x.c 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/drivers/media/radio/radio-si476x.c 2014-12-28 14:10:09.532888798 +0100
+@@ -1445,7 +1445,7 @@
+ struct si476x_radio *radio;
+ struct v4l2_ctrl *ctrl;
+
+- static atomic_t instance = ATOMIC_INIT(0);
++ static atomic_unchecked_t instance = ATOMIC_INIT(0);
+
+ radio = devm_kzalloc(&pdev->dev, sizeof(*radio), GFP_KERNEL);
+ if (!radio)
+diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-core.c backports-3.18.1-1/drivers/media/usb/dvb-usb/cinergyT2-core.c
+--- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-core.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/usb/dvb-usb/cinergyT2-core.c 2014-12-28 14:10:09.532888798 +0100
+@@ -50,29 +50,73 @@
+
+ static int cinergyt2_streaming_ctrl(struct dvb_usb_adapter *adap, int enable)
+ {
+- char buf[] = { CINERGYT2_EP1_CONTROL_STREAM_TRANSFER, enable ? 1 : 0 };
+- char result[64];
+- return dvb_usb_generic_rw(adap->dev, buf, sizeof(buf), result,
+- sizeof(result), 0);
++ char *buf;
++ char *result;
++ int retval;
++
++ buf = kmalloc(2, GFP_KERNEL);
++ if (buf == NULL)
++ return -ENOMEM;
++ result = kmalloc(64, GFP_KERNEL);
++ if (result == NULL) {
++ kfree(buf);
++ return -ENOMEM;
++ }
++
++ buf[0] = CINERGYT2_EP1_CONTROL_STREAM_TRANSFER;
++ buf[1] = enable ? 1 : 0;
++
++ retval = dvb_usb_generic_rw(adap->dev, buf, 2, result, 64, 0);
++
++ kfree(buf);
++ kfree(result);
++ return retval;
+ }
+
+ static int cinergyt2_power_ctrl(struct dvb_usb_device *d, int enable)
+ {
+- char buf[] = { CINERGYT2_EP1_SLEEP_MODE, enable ? 0 : 1 };
+- char state[3];
+- return dvb_usb_generic_rw(d, buf, sizeof(buf), state, sizeof(state), 0);
++ char *buf;
++ char *state;
++ int retval;
++
++ buf = kmalloc(2, GFP_KERNEL);
++ if (buf == NULL)
++ return -ENOMEM;
++ state = kmalloc(3, GFP_KERNEL);
++ if (state == NULL) {
++ kfree(buf);
++ return -ENOMEM;
++ }
++
++ buf[0] = CINERGYT2_EP1_SLEEP_MODE;
++ buf[1] = enable ? 1 : 0;
++
++ retval = dvb_usb_generic_rw(d, buf, 2, state, 3, 0);
++
++ kfree(buf);
++ kfree(state);
++ return retval;
+ }
+
+ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap)
+ {
+- char query[] = { CINERGYT2_EP1_GET_FIRMWARE_VERSION };
+- char state[3];
++ char *query;
++ char *state;
+ int ret;
++ query = kmalloc(1, GFP_KERNEL);
++ if (query == NULL)
++ return -ENOMEM;
++ state = kmalloc(3, GFP_KERNEL);
++ if (state == NULL) {
++ kfree(query);
++ return -ENOMEM;
++ }
++
++ query[0] = CINERGYT2_EP1_GET_FIRMWARE_VERSION;
+
+ adap->fe_adap[0].fe = cinergyt2_fe_attach(adap->dev);
+
+- ret = dvb_usb_generic_rw(adap->dev, query, sizeof(query), state,
+- sizeof(state), 0);
++ ret = dvb_usb_generic_rw(adap->dev, query, 1, state, 3, 0);
+ if (ret < 0) {
+ deb_rc("cinergyt2_power_ctrl() Failed to retrieve sleep "
+ "state info\n");
+@@ -80,7 +124,8 @@
+
+ /* Copy this pointer as we are gonna need it in the release phase */
+ cinergyt2_usb_device = adap->dev;
+-
++ kfree(query);
++ kfree(state);
+ return 0;
+ }
+
+@@ -141,12 +186,23 @@
+ static int cinergyt2_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
+ {
+ struct cinergyt2_state *st = d->priv;
+- u8 key[5] = {0, 0, 0, 0, 0}, cmd = CINERGYT2_EP1_GET_RC_EVENTS;
++ u8 *key, *cmd;
+ int i;
+
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -EINVAL;
++ key = kzalloc(5, GFP_KERNEL);
++ if (key == NULL) {
++ kfree(cmd);
++ return -EINVAL;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_RC_EVENTS;
++
+ *state = REMOTE_NO_KEY_PRESSED;
+
+- dvb_usb_generic_rw(d, &cmd, 1, key, sizeof(key), 0);
++ dvb_usb_generic_rw(d, cmd, 1, key, 5, 0);
+ if (key[4] == 0xff) {
+ /* key repeat */
+ st->rc_counter++;
+@@ -157,12 +213,12 @@
+ *event = d->last_event;
+ deb_rc("repeat key, event %x\n",
+ *event);
+- return 0;
++ goto out;
+ }
+ }
+ deb_rc("repeated key (non repeatable)\n");
+ }
+- return 0;
++ goto out;
+ }
+
+ /* hack to pass checksum on the custom field */
+@@ -174,6 +230,9 @@
+
+ deb_rc("key: %*ph\n", 5, key);
+ }
++out:
++ kfree(cmd);
++ kfree(key);
+ return 0;
+ }
+
+diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-fe.c backports-3.18.1-1/drivers/media/usb/dvb-usb/cinergyT2-fe.c
+--- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-fe.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/usb/dvb-usb/cinergyT2-fe.c 2014-12-28 14:10:09.532888798 +0100
+@@ -145,103 +145,176 @@
+ fe_status_t *status)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg result;
+- u8 cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *result;
++ u8 *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (u8 *)&result,
+- sizeof(result), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ result = kmalloc(sizeof(*result), GFP_KERNEL);
++ if (result == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (u8 *)result,
++ sizeof(*result), 0);
+ if (ret < 0)
+- return ret;
++ goto out;
+
+ *status = 0;
+
+- if (0xffff - le16_to_cpu(result.gain) > 30)
++ if (0xffff - le16_to_cpu(result->gain) > 30)
+ *status |= FE_HAS_SIGNAL;
+- if (result.lock_bits & (1 << 6))
++ if (result->lock_bits & (1 << 6))
+ *status |= FE_HAS_LOCK;
+- if (result.lock_bits & (1 << 5))
++ if (result->lock_bits & (1 << 5))
+ *status |= FE_HAS_SYNC;
+- if (result.lock_bits & (1 << 4))
++ if (result->lock_bits & (1 << 4))
+ *status |= FE_HAS_CARRIER;
+- if (result.lock_bits & (1 << 1))
++ if (result->lock_bits & (1 << 1))
+ *status |= FE_HAS_VITERBI;
+
+ if ((*status & (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC)) !=
+ (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC))
+ *status &= ~FE_HAS_LOCK;
+
+- return 0;
++out:
++ kfree(cmd);
++ kfree(result);
++ return ret;
+ }
+
+ static int cinergyt2_fe_read_ber(struct dvb_frontend *fe, u32 *ber)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg status;
+- char cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *status;
++ char *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (char *)&status,
+- sizeof(status), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ status = kmalloc(sizeof(*status), GFP_KERNEL);
++ if (status == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (char *)status,
++ sizeof(*status), 0);
+ if (ret < 0)
+- return ret;
++ goto out;
+
+- *ber = le32_to_cpu(status.viterbi_error_rate);
++ *ber = le32_to_cpu(status->viterbi_error_rate);
++out:
++ kfree(cmd);
++ kfree(status);
+ return 0;
+ }
+
+ static int cinergyt2_fe_read_unc_blocks(struct dvb_frontend *fe, u32 *unc)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg status;
+- u8 cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *status;
++ u8 *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (u8 *)&status,
+- sizeof(status), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ status = kmalloc(sizeof(*status), GFP_KERNEL);
++ if (status == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (u8 *)status,
++ sizeof(*status), 0);
+ if (ret < 0) {
+ err("cinergyt2_fe_read_unc_blocks() Failed! (Error=%d)\n",
+ ret);
+- return ret;
++ goto out;
+ }
+- *unc = le32_to_cpu(status.uncorrected_block_count);
+- return 0;
++ *unc = le32_to_cpu(status->uncorrected_block_count);
++
++out:
++ kfree(cmd);
++ kfree(status);
++ return ret;
+ }
+
+ static int cinergyt2_fe_read_signal_strength(struct dvb_frontend *fe,
+ u16 *strength)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg status;
+- char cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *status;
++ char *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (char *)&status,
+- sizeof(status), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ status = kmalloc(sizeof(*status), GFP_KERNEL);
++ if (status == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (char *)status,
++ sizeof(*status), 0);
+ if (ret < 0) {
+ err("cinergyt2_fe_read_signal_strength() Failed!"
+ " (Error=%d)\n", ret);
+- return ret;
++ goto out;
+ }
+- *strength = (0xffff - le16_to_cpu(status.gain));
++ *strength = (0xffff - le16_to_cpu(status->gain));
++
++out:
++ kfree(cmd);
++ kfree(status);
+ return 0;
+ }
+
+ static int cinergyt2_fe_read_snr(struct dvb_frontend *fe, u16 *snr)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg status;
+- char cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *status;
++ char *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (char *)&status,
+- sizeof(status), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ status = kmalloc(sizeof(*status), GFP_KERNEL);
++ if (status == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (char *)status,
++ sizeof(*status), 0);
+ if (ret < 0) {
+ err("cinergyt2_fe_read_snr() Failed! (Error=%d)\n", ret);
+- return ret;
++ goto out;
+ }
+- *snr = (status.snr << 8) | status.snr;
+- return 0;
++ *snr = (status->snr << 8) | status->snr;
++
++out:
++ kfree(cmd);
++ kfree(status);
++ return ret;
+ }
+
+ static int cinergyt2_fe_init(struct dvb_frontend *fe)
+@@ -266,35 +339,46 @@
+ {
+ struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_set_parameters_msg param;
+- char result[2];
++ struct dvbt_set_parameters_msg *param;
++ char *result;
+ int err;
+
+- param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
+- param.tps = cpu_to_le16(compute_tps(fep));
+- param.freq = cpu_to_le32(fep->frequency / 1000);
+- param.flags = 0;
++ result = kmalloc(2, GFP_KERNEL);
++ if (result == NULL)
++ return -ENOMEM;
++ param = kmalloc(sizeof(*param), GFP_KERNEL);
++ if (param == NULL) {
++ kfree(result);
++ return -ENOMEM;
++ }
++
++ param->cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
++ param->tps = cpu_to_le16(compute_tps(fep));
++ param->freq = cpu_to_le32(fep->frequency / 1000);
++ param->flags = 0;
+
+ switch (fep->bandwidth_hz) {
+ default:
+ case 8000000:
+- param.bandwidth = 8;
++ param->bandwidth = 8;
+ break;
+ case 7000000:
+- param.bandwidth = 7;
++ param->bandwidth = 7;
+ break;
+ case 6000000:
+- param.bandwidth = 6;
++ param->bandwidth = 6;
+ break;
+ }
+
+ err = dvb_usb_generic_rw(state->d,
+- (char *)¶m, sizeof(param),
+- result, sizeof(result), 0);
++ (char *)param, sizeof(*param),
++ result, 2, 0);
+ if (err < 0)
+ err("cinergyt2_fe_set_frontend() Failed! err=%d\n", err);
+
+- return (err < 0) ? err : 0;
++ kfree(result);
++ kfree(param);
++ return err;
+ }
+
+ static void cinergyt2_fe_release(struct dvb_frontend *fe)
+diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dvb-usb-firmware.c backports-3.18.1-1/drivers/media/usb/dvb-usb/dvb-usb-firmware.c
+--- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dvb-usb-firmware.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/usb/dvb-usb/dvb-usb-firmware.c 2014-12-28 14:10:09.532888798 +0100
+@@ -35,42 +35,57 @@
+
+ int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type)
+ {
+- struct hexline hx;
+- u8 reset;
++ struct hexline *hx;
++ u8 *reset;
+ int ret,pos=0;
+
++ reset = kmalloc(1, GFP_KERNEL);
++ if (reset == NULL)
++ return -ENOMEM;
++
++ hx = kmalloc(sizeof(struct hexline), GFP_KERNEL);
++ if (hx == NULL) {
++ kfree(reset);
++ return -ENOMEM;
++ }
++
+ /* stop the CPU */
+- reset = 1;
+- if ((ret = usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&reset,1)) != 1)
++ reset[0] = 1;
++ if ((ret = usb_cypress_writemem(udev,cypress[type].cpu_cs_register,reset,1)) != 1)
+ err("could not stop the USB controller CPU.");
+
+- while ((ret = dvb_usb_get_hexline(fw,&hx,&pos)) > 0) {
+- deb_fw("writing to address 0x%04x (buffer: 0x%02x %02x)\n",hx.addr,hx.len,hx.chk);
+- ret = usb_cypress_writemem(udev,hx.addr,hx.data,hx.len);
++ while ((ret = dvb_usb_get_hexline(fw,hx,&pos)) > 0) {
++ deb_fw("writing to address 0x%04x (buffer: 0x%02x %02x)\n",hx->addr,hx->len,hx->chk);
++ ret = usb_cypress_writemem(udev,hx->addr,hx->data,hx->len);
+
+- if (ret != hx.len) {
++ if (ret != hx->len) {
+ err("error while transferring firmware "
+ "(transferred size: %d, block size: %d)",
+- ret,hx.len);
++ ret,hx->len);
+ ret = -EINVAL;
+ break;
+ }
+ }
+ if (ret < 0) {
+ err("firmware download failed at %d with %d",pos,ret);
++ kfree(reset);
++ kfree(hx);
+ return ret;
+ }
+
+ if (ret == 0) {
+ /* restart the CPU */
+- reset = 0;
+- if (ret || usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&reset,1) != 1) {
++ reset[0] = 0;
++ if (ret || usb_cypress_writemem(udev,cypress[type].cpu_cs_register,reset,1) != 1) {
+ err("could not restart the USB controller CPU.");
+ ret = -EINVAL;
+ }
+ } else
+ ret = -EIO;
+
++ kfree(reset);
++ kfree(hx);
++
+ return ret;
+ }
+ EXPORT_SYMBOL(usb_cypress_load_firmware);
+diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dw2102.c backports-3.18.1-1/drivers/media/usb/dvb-usb/dw2102.c
+--- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dw2102.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/usb/dvb-usb/dw2102.c 2014-12-28 14:10:09.536888811 +0100
+@@ -118,7 +118,7 @@
+
+ struct s6x0_state {
+ int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v);
+-};
++} __no_const;
+
+ /* debug */
+ static int dvb_usb_dw2102_debug;
+diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c backports-3.18.1-1/drivers/media/usb/dvb-usb/technisat-usb2.c
+--- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/usb/dvb-usb/technisat-usb2.c 2014-12-28 14:10:09.536888811 +0100
+@@ -87,8 +87,11 @@
+ static int technisat_usb2_i2c_access(struct usb_device *udev,
+ u8 device_addr, u8 *tx, u8 txlen, u8 *rx, u8 rxlen)
+ {
+- u8 b[64];
+- int ret, actual_length;
++ u8 *b = kmalloc(64, GFP_KERNEL);
++ int ret, actual_length, error = 0;
++
++ if (b == NULL)
++ return -ENOMEM;
+
+ deb_i2c("i2c-access: %02x, tx: ", device_addr);
+ debug_dump(tx, txlen, deb_i2c);
+@@ -121,7 +124,8 @@
+
+ if (ret < 0) {
+ err("i2c-error: out failed %02x = %d", device_addr, ret);
+- return -ENODEV;
++ error = -ENODEV;
++ goto out;
+ }
+
+ ret = usb_bulk_msg(udev,
+@@ -129,7 +133,8 @@
+ b, 64, &actual_length, 1000);
+ if (ret < 0) {
+ err("i2c-error: in failed %02x = %d", device_addr, ret);
+- return -ENODEV;
++ error = -ENODEV;
++ goto out;
+ }
+
+ if (b[0] != I2C_STATUS_OK) {
+@@ -137,8 +142,10 @@
+ /* handle tuner-i2c-nak */
+ if (!(b[0] == I2C_STATUS_NAK &&
+ device_addr == 0x60
+- /* && device_is_technisat_usb2 */))
+- return -ENODEV;
++ /* && device_is_technisat_usb2 */)) {
++ error = -ENODEV;
++ goto out;
++ }
+ }
+
+ deb_i2c("status: %d, ", b[0]);
+@@ -152,7 +159,9 @@
+
+ deb_i2c("\n");
+
+- return 0;
++out:
++ kfree(b);
++ return error;
+ }
+
+ static int technisat_usb2_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,
+@@ -224,14 +233,16 @@
+ {
+ int ret;
+
+- u8 led[8] = {
+- red ? SET_RED_LED_VENDOR_REQUEST : SET_GREEN_LED_VENDOR_REQUEST,
+- 0
+- };
++ u8 *led = kzalloc(8, GFP_KERNEL);
++
++ if (led == NULL)
++ return -ENOMEM;
+
+ if (disable_led_control && state != TECH_LED_OFF)
+ return 0;
+
++ led[0] = red ? SET_RED_LED_VENDOR_REQUEST : SET_GREEN_LED_VENDOR_REQUEST;
++
+ switch (state) {
+ case TECH_LED_ON:
+ led[1] = 0x82;
+@@ -263,16 +274,22 @@
+ red ? SET_RED_LED_VENDOR_REQUEST : SET_GREEN_LED_VENDOR_REQUEST,
+ USB_TYPE_VENDOR | USB_DIR_OUT,
+ 0, 0,
+- led, sizeof(led), 500);
++ led, 8, 500);
+
+ mutex_unlock(&d->i2c_mutex);
++
++ kfree(led);
++
+ return ret;
+ }
+
+ static int technisat_usb2_set_led_timer(struct dvb_usb_device *d, u8 red, u8 green)
+ {
+ int ret;
+- u8 b = 0;
++ u8 *b = kzalloc(1, GFP_KERNEL);
++
++ if (b == NULL)
++ return -ENOMEM;
+
+ if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+ return -EAGAIN;
+@@ -281,10 +298,12 @@
+ SET_LED_TIMER_DIVIDER_VENDOR_REQUEST,
+ USB_TYPE_VENDOR | USB_DIR_OUT,
+ (red << 8) | green, 0,
+- &b, 1, 500);
++ b, 1, 500);
+
+ mutex_unlock(&d->i2c_mutex);
+
++ kfree(b);
++
+ return ret;
+ }
+
+@@ -328,7 +347,7 @@
+ struct dvb_usb_device_description **desc, int *cold)
+ {
+ int ret;
+- u8 version[3];
++ u8 *version = kmalloc(3, GFP_KERNEL);
+
+ /* first select the interface */
+ if (usb_set_interface(udev, 0, 1) != 0)
+@@ -338,11 +357,14 @@
+
+ *cold = 0; /* by default do not download a firmware - just in case something is wrong */
+
++ if (version == NULL)
++ return 0;
++
+ ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+ GET_VERSION_INFO_VENDOR_REQUEST,
+ USB_TYPE_VENDOR | USB_DIR_IN,
+ 0, 0,
+- version, sizeof(version), 500);
++ version, 3, 500);
+
+ if (ret < 0)
+ *cold = 1;
+@@ -351,6 +373,8 @@
+ *cold = 0;
+ }
+
++ kfree(version);
++
+ return 0;
+ }
+
+@@ -591,10 +615,15 @@
+
+ static int technisat_usb2_get_ir(struct dvb_usb_device *d)
+ {
+- u8 buf[62], *b;
++ u8 *buf, *b;
+ int ret;
+ struct ir_raw_event ev;
+
++ buf = kmalloc(62, GFP_KERNEL);
++
++ if (buf == NULL)
++ return -ENOMEM;
++
+ buf[0] = GET_IR_DATA_VENDOR_REQUEST;
+ buf[1] = 0x08;
+ buf[2] = 0x8f;
+@@ -617,16 +646,20 @@
+ GET_IR_DATA_VENDOR_REQUEST,
+ USB_TYPE_VENDOR | USB_DIR_IN,
+ 0x8080, 0,
+- buf, sizeof(buf), 500);
++ buf, 62, 500);
+
+ unlock:
+ mutex_unlock(&d->i2c_mutex);
+
+- if (ret < 0)
++ if (ret < 0) {
++ kfree(buf);
+ return ret;
++ }
+
+- if (ret == 1)
++ if (ret == 1) {
++ kfree(buf);
+ return 0; /* no key pressed */
++ }
+
+ /* decoding */
+ b = buf+1;
+@@ -653,6 +686,8 @@
+
+ ir_raw_event_handle(d->rc_dev);
+
++ kfree(buf);
++
+ return 1;
+ }
+
+diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-device.c backports-3.18.1-1/drivers/media/v4l2-core/v4l2-device.c
+--- backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-device.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/v4l2-core/v4l2-device.c 2014-12-28 14:10:09.536888811 +0100
+@@ -75,9 +75,9 @@
+ EXPORT_SYMBOL_GPL(v4l2_device_put);
+
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+- atomic_t *instance)
++ atomic_unchecked_t *instance)
+ {
+- int num = atomic_inc_return(instance) - 1;
++ int num = atomic_inc_return_unchecked(instance) - 1;
+ int len = strlen(basename);
+
+ if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
+diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports-3.18.1-1/drivers/media/v4l2-core/v4l2-ioctl.c
+--- backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/media/v4l2-core/v4l2-ioctl.c 2014-12-28 14:10:09.536888811 +0100
+@@ -2142,7 +2142,8 @@
+ struct file *file, void *fh, void *p);
+ } u;
+ void (*debug)(const void *arg, bool write_only);
+-};
++} __do_const;
++typedef struct v4l2_ioctl_info __no_const v4l2_ioctl_info_no_const;
+
+ /* This control needs a priority check */
+ #define INFO_FL_PRIO (1 << 0)
+@@ -2326,7 +2327,7 @@
+ struct video_device *vfd = video_devdata(file);
+ const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
+ bool write_only = false;
+- struct v4l2_ioctl_info default_info;
++ v4l2_ioctl_info_no_const default_info;
+ const struct v4l2_ioctl_info *info;
+ void *fh = file->private_data;
+ struct v4l2_fh *vfh = NULL;
+@@ -2413,7 +2414,7 @@
+ ret = -EINVAL;
+ break;
+ }
+- *user_ptr = (void __user *)buf->m.planes;
++ *user_ptr = (void __force_user *)buf->m.planes;
+ *kernel_ptr = (void **)&buf->m.planes;
+ *array_size = sizeof(struct v4l2_plane) * buf->length;
+ ret = 1;
+@@ -2430,7 +2431,7 @@
+ ret = -EINVAL;
+ break;
+ }
+- *user_ptr = (void __user *)edid->edid;
++ *user_ptr = (void __force_user *)edid->edid;
+ *kernel_ptr = (void **)&edid->edid;
+ *array_size = edid->blocks * 128;
+ ret = 1;
+@@ -2448,7 +2449,7 @@
+ ret = -EINVAL;
+ break;
+ }
+- *user_ptr = (void __user *)ctrls->controls;
++ *user_ptr = (void __force_user *)ctrls->controls;
+ *kernel_ptr = (void **)&ctrls->controls;
+ *array_size = sizeof(struct v4l2_ext_control)
+ * ctrls->count;
+@@ -2549,7 +2550,7 @@
+ }
+
+ if (has_array_args) {
+- *kernel_ptr = (void __force *)user_ptr;
++ *kernel_ptr = (void __force_kernel *)user_ptr;
+ if (copy_to_user(user_ptr, mbuf, array_size))
+ err = -EFAULT;
+ goto out_array_args;
+diff -Naur backports-3.18.1-1.org/drivers/net/ieee802154/fakehard.c backports-3.18.1-1/drivers/net/ieee802154/fakehard.c
+--- backports-3.18.1-1.org/drivers/net/ieee802154/fakehard.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/ieee802154/fakehard.c 2014-12-28 14:10:09.556888909 +0100
+@@ -365,7 +365,7 @@
+ phy->transmit_power = 0xbf;
+
+ dev->netdev_ops = &fake_ops;
+- dev->ml_priv = &fake_mlme;
++ dev->ml_priv = (void *)&fake_mlme;
+
+ priv = netdev_priv(dev);
+ priv->phy = phy;
+diff -Naur backports-3.18.1-1.org/drivers/net/usb/sierra_net.c backports-3.18.1-1/drivers/net/usb/sierra_net.c
+--- backports-3.18.1-1.org/drivers/net/usb/sierra_net.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/usb/sierra_net.c 2014-12-28 14:10:09.560888936 +0100
+@@ -51,7 +51,7 @@
+ /* atomic counter partially included in MAC address to make sure 2 devices
+ * do not end up with the same MAC - concept breaks in case of > 255 ifaces
+ */
+-static atomic_t iface_counter = ATOMIC_INIT(0);
++static atomic_unchecked_t iface_counter = ATOMIC_INIT(0);
+
+ /*
+ * SYNC Timer Delay definition used to set the expiry time
+@@ -697,7 +697,7 @@
+ dev->net->netdev_ops = &sierra_net_device_ops;
+
+ /* change MAC addr to include, ifacenum, and to be unique */
+- dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
++ dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return_unchecked(&iface_counter);
+ dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
+
+ /* we will have to manufacture ethernet headers, prepare template */
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/at76c50x-usb.c backports-3.18.1-1/drivers/net/wireless/at76c50x-usb.c
+--- backports-3.18.1-1.org/drivers/net/wireless/at76c50x-usb.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/at76c50x-usb.c 2014-12-28 14:10:09.560888936 +0100
+@@ -353,7 +353,7 @@
+ }
+
+ /* Convert timeout from the DFU status to jiffies */
+-static inline unsigned long at76_get_timeout(struct dfu_status *s)
++static inline unsigned long __intentional_overflow(-1) at76_get_timeout(struct dfu_status *s)
+ {
+ return msecs_to_jiffies((s->poll_timeout[2] << 16)
+ | (s->poll_timeout[1] << 8)
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.c backports-3.18.1-1/drivers/net/wireless/ath/ath10k/htc.c
+--- backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ath/ath10k/htc.c 2014-12-28 14:10:09.560888936 +0100
+@@ -848,7 +848,10 @@
+ /* registered target arrival callback from the HIF layer */
+ int ath10k_htc_init(struct ath10k *ar)
+ {
+- struct ath10k_hif_cb htc_callbacks;
++ static struct ath10k_hif_cb htc_callbacks = {
++ .rx_completion = ath10k_htc_rx_completion_handler,
++ .tx_completion = ath10k_htc_tx_completion_handler,
++ };
+ struct ath10k_htc_ep *ep = NULL;
+ struct ath10k_htc *htc = &ar->htc;
+
+@@ -857,8 +860,6 @@
+ ath10k_htc_reset_endpoint_states(htc);
+
+ /* setup HIF layer callbacks */
+- htc_callbacks.rx_completion = ath10k_htc_rx_completion_handler;
+- htc_callbacks.tx_completion = ath10k_htc_tx_completion_handler;
+ htc->ar = ar;
+
+ /* Get HIF default pipe for HTC message exchange */
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.h backports-3.18.1-1/drivers/net/wireless/ath/ath10k/htc.h
+--- backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.h 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ath/ath10k/htc.h 2014-12-28 14:10:09.560888936 +0100
+@@ -270,13 +270,13 @@
+
+ struct ath10k_htc_ops {
+ void (*target_send_suspend_complete)(struct ath10k *ar);
+-};
++} __no_const;
+
+ struct ath10k_htc_ep_ops {
+ void (*ep_tx_complete)(struct ath10k *, struct sk_buff *);
+ void (*ep_rx_complete)(struct ath10k *, struct sk_buff *);
+ void (*ep_tx_credits)(struct ath10k *);
+-};
++} __no_const;
+
+ /* service connection information */
+ struct ath10k_htc_svc_conn_req {
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9002_mac.c backports-3.18.1-1/drivers/net/wireless/ath/ath9k/ar9002_mac.c
+--- backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9002_mac.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ath/ath9k/ar9002_mac.c 2014-12-28 14:10:09.560888936 +0100
+@@ -220,8 +220,8 @@
+ ads->ds_txstatus6 = ads->ds_txstatus7 = 0;
+ ads->ds_txstatus8 = ads->ds_txstatus9 = 0;
+
+- ACCESS_ONCE(ads->ds_link) = i->link;
+- ACCESS_ONCE(ads->ds_data) = i->buf_addr[0];
++ ACCESS_ONCE_RW(ads->ds_link) = i->link;
++ ACCESS_ONCE_RW(ads->ds_data) = i->buf_addr[0];
+
+ ctl1 = i->buf_len[0] | (i->is_last ? 0 : AR_TxMore);
+ ctl6 = SM(i->keytype, AR_EncrType);
+@@ -235,26 +235,26 @@
+
+ if ((i->is_first || i->is_last) &&
+ i->aggr != AGGR_BUF_MIDDLE && i->aggr != AGGR_BUF_LAST) {
+- ACCESS_ONCE(ads->ds_ctl2) = set11nTries(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ds_ctl2) = set11nTries(i->rates, 0)
+ | set11nTries(i->rates, 1)
+ | set11nTries(i->rates, 2)
+ | set11nTries(i->rates, 3)
+ | (i->dur_update ? AR_DurUpdateEna : 0)
+ | SM(0, AR_BurstDur);
+
+- ACCESS_ONCE(ads->ds_ctl3) = set11nRate(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ds_ctl3) = set11nRate(i->rates, 0)
+ | set11nRate(i->rates, 1)
+ | set11nRate(i->rates, 2)
+ | set11nRate(i->rates, 3);
+ } else {
+- ACCESS_ONCE(ads->ds_ctl2) = 0;
+- ACCESS_ONCE(ads->ds_ctl3) = 0;
++ ACCESS_ONCE_RW(ads->ds_ctl2) = 0;
++ ACCESS_ONCE_RW(ads->ds_ctl3) = 0;
+ }
+
+ if (!i->is_first) {
+- ACCESS_ONCE(ads->ds_ctl0) = 0;
+- ACCESS_ONCE(ads->ds_ctl1) = ctl1;
+- ACCESS_ONCE(ads->ds_ctl6) = ctl6;
++ ACCESS_ONCE_RW(ads->ds_ctl0) = 0;
++ ACCESS_ONCE_RW(ads->ds_ctl1) = ctl1;
++ ACCESS_ONCE_RW(ads->ds_ctl6) = ctl6;
+ return;
+ }
+
+@@ -279,7 +279,7 @@
+ break;
+ }
+
+- ACCESS_ONCE(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
++ ACCESS_ONCE_RW(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
+ | (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
+ | SM(i->txpower, AR_XmitPower0)
+ | (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
+@@ -289,27 +289,27 @@
+ | (i->flags & ATH9K_TXDESC_RTSENA ? AR_RTSEnable :
+ (i->flags & ATH9K_TXDESC_CTSENA ? AR_CTSEnable : 0));
+
+- ACCESS_ONCE(ads->ds_ctl1) = ctl1;
+- ACCESS_ONCE(ads->ds_ctl6) = ctl6;
++ ACCESS_ONCE_RW(ads->ds_ctl1) = ctl1;
++ ACCESS_ONCE_RW(ads->ds_ctl6) = ctl6;
+
+ if (i->aggr == AGGR_BUF_MIDDLE || i->aggr == AGGR_BUF_LAST)
+ return;
+
+- ACCESS_ONCE(ads->ds_ctl4) = set11nPktDurRTSCTS(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ds_ctl4) = set11nPktDurRTSCTS(i->rates, 0)
+ | set11nPktDurRTSCTS(i->rates, 1);
+
+- ACCESS_ONCE(ads->ds_ctl5) = set11nPktDurRTSCTS(i->rates, 2)
++ ACCESS_ONCE_RW(ads->ds_ctl5) = set11nPktDurRTSCTS(i->rates, 2)
+ | set11nPktDurRTSCTS(i->rates, 3);
+
+- ACCESS_ONCE(ads->ds_ctl7) = set11nRateFlags(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ds_ctl7) = set11nRateFlags(i->rates, 0)
+ | set11nRateFlags(i->rates, 1)
+ | set11nRateFlags(i->rates, 2)
+ | set11nRateFlags(i->rates, 3)
+ | SM(i->rtscts_rate, AR_RTSCTSRate);
+
+- ACCESS_ONCE(ads->ds_ctl9) = SM(i->txpower, AR_XmitPower1);
+- ACCESS_ONCE(ads->ds_ctl10) = SM(i->txpower, AR_XmitPower2);
+- ACCESS_ONCE(ads->ds_ctl11) = SM(i->txpower, AR_XmitPower3);
++ ACCESS_ONCE_RW(ads->ds_ctl9) = SM(i->txpower, AR_XmitPower1);
++ ACCESS_ONCE_RW(ads->ds_ctl10) = SM(i->txpower, AR_XmitPower2);
++ ACCESS_ONCE_RW(ads->ds_ctl11) = SM(i->txpower, AR_XmitPower3);
+ }
+
+ static int ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds,
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9003_mac.c backports-3.18.1-1/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+--- backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9003_mac.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ath/ath9k/ar9003_mac.c 2014-12-28 14:10:09.560888936 +0100
+@@ -39,47 +39,47 @@
+ (i->qcu << AR_TxQcuNum_S) | desc_len;
+
+ checksum += val;
+- ACCESS_ONCE(ads->info) = val;
++ ACCESS_ONCE_RW(ads->info) = val;
+
+ checksum += i->link;
+- ACCESS_ONCE(ads->link) = i->link;
++ ACCESS_ONCE_RW(ads->link) = i->link;
+
+ checksum += i->buf_addr[0];
+- ACCESS_ONCE(ads->data0) = i->buf_addr[0];
++ ACCESS_ONCE_RW(ads->data0) = i->buf_addr[0];
+ checksum += i->buf_addr[1];
+- ACCESS_ONCE(ads->data1) = i->buf_addr[1];
++ ACCESS_ONCE_RW(ads->data1) = i->buf_addr[1];
+ checksum += i->buf_addr[2];
+- ACCESS_ONCE(ads->data2) = i->buf_addr[2];
++ ACCESS_ONCE_RW(ads->data2) = i->buf_addr[2];
+ checksum += i->buf_addr[3];
+- ACCESS_ONCE(ads->data3) = i->buf_addr[3];
++ ACCESS_ONCE_RW(ads->data3) = i->buf_addr[3];
+
+ checksum += (val = (i->buf_len[0] << AR_BufLen_S) & AR_BufLen);
+- ACCESS_ONCE(ads->ctl3) = val;
++ ACCESS_ONCE_RW(ads->ctl3) = val;
+ checksum += (val = (i->buf_len[1] << AR_BufLen_S) & AR_BufLen);
+- ACCESS_ONCE(ads->ctl5) = val;
++ ACCESS_ONCE_RW(ads->ctl5) = val;
+ checksum += (val = (i->buf_len[2] << AR_BufLen_S) & AR_BufLen);
+- ACCESS_ONCE(ads->ctl7) = val;
++ ACCESS_ONCE_RW(ads->ctl7) = val;
+ checksum += (val = (i->buf_len[3] << AR_BufLen_S) & AR_BufLen);
+- ACCESS_ONCE(ads->ctl9) = val;
++ ACCESS_ONCE_RW(ads->ctl9) = val;
+
+ checksum = (u16) (((checksum & 0xffff) + (checksum >> 16)) & 0xffff);
+- ACCESS_ONCE(ads->ctl10) = checksum;
++ ACCESS_ONCE_RW(ads->ctl10) = checksum;
+
+ if (i->is_first || i->is_last) {
+- ACCESS_ONCE(ads->ctl13) = set11nTries(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ctl13) = set11nTries(i->rates, 0)
+ | set11nTries(i->rates, 1)
+ | set11nTries(i->rates, 2)
+ | set11nTries(i->rates, 3)
+ | (i->dur_update ? AR_DurUpdateEna : 0)
+ | SM(0, AR_BurstDur);
+
+- ACCESS_ONCE(ads->ctl14) = set11nRate(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ctl14) = set11nRate(i->rates, 0)
+ | set11nRate(i->rates, 1)
+ | set11nRate(i->rates, 2)
+ | set11nRate(i->rates, 3);
+ } else {
+- ACCESS_ONCE(ads->ctl13) = 0;
+- ACCESS_ONCE(ads->ctl14) = 0;
++ ACCESS_ONCE_RW(ads->ctl13) = 0;
++ ACCESS_ONCE_RW(ads->ctl14) = 0;
+ }
+
+ ads->ctl20 = 0;
+@@ -89,17 +89,17 @@
+
+ ctl17 = SM(i->keytype, AR_EncrType);
+ if (!i->is_first) {
+- ACCESS_ONCE(ads->ctl11) = 0;
+- ACCESS_ONCE(ads->ctl12) = i->is_last ? 0 : AR_TxMore;
+- ACCESS_ONCE(ads->ctl15) = 0;
+- ACCESS_ONCE(ads->ctl16) = 0;
+- ACCESS_ONCE(ads->ctl17) = ctl17;
+- ACCESS_ONCE(ads->ctl18) = 0;
+- ACCESS_ONCE(ads->ctl19) = 0;
++ ACCESS_ONCE_RW(ads->ctl11) = 0;
++ ACCESS_ONCE_RW(ads->ctl12) = i->is_last ? 0 : AR_TxMore;
++ ACCESS_ONCE_RW(ads->ctl15) = 0;
++ ACCESS_ONCE_RW(ads->ctl16) = 0;
++ ACCESS_ONCE_RW(ads->ctl17) = ctl17;
++ ACCESS_ONCE_RW(ads->ctl18) = 0;
++ ACCESS_ONCE_RW(ads->ctl19) = 0;
+ return;
+ }
+
+- ACCESS_ONCE(ads->ctl11) = (i->pkt_len & AR_FrameLen)
++ ACCESS_ONCE_RW(ads->ctl11) = (i->pkt_len & AR_FrameLen)
+ | (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
+ | SM(i->txpower, AR_XmitPower0)
+ | (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
+@@ -135,26 +135,26 @@
+ val = (i->flags & ATH9K_TXDESC_PAPRD) >> ATH9K_TXDESC_PAPRD_S;
+ ctl12 |= SM(val, AR_PAPRDChainMask);
+
+- ACCESS_ONCE(ads->ctl12) = ctl12;
+- ACCESS_ONCE(ads->ctl17) = ctl17;
++ ACCESS_ONCE_RW(ads->ctl12) = ctl12;
++ ACCESS_ONCE_RW(ads->ctl17) = ctl17;
+
+- ACCESS_ONCE(ads->ctl15) = set11nPktDurRTSCTS(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ctl15) = set11nPktDurRTSCTS(i->rates, 0)
+ | set11nPktDurRTSCTS(i->rates, 1);
+
+- ACCESS_ONCE(ads->ctl16) = set11nPktDurRTSCTS(i->rates, 2)
++ ACCESS_ONCE_RW(ads->ctl16) = set11nPktDurRTSCTS(i->rates, 2)
+ | set11nPktDurRTSCTS(i->rates, 3);
+
+- ACCESS_ONCE(ads->ctl18) = set11nRateFlags(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ctl18) = set11nRateFlags(i->rates, 0)
+ | set11nRateFlags(i->rates, 1)
+ | set11nRateFlags(i->rates, 2)
+ | set11nRateFlags(i->rates, 3)
+ | SM(i->rtscts_rate, AR_RTSCTSRate);
+
+- ACCESS_ONCE(ads->ctl19) = AR_Not_Sounding;
++ ACCESS_ONCE_RW(ads->ctl19) = AR_Not_Sounding;
+
+- ACCESS_ONCE(ads->ctl20) = SM(i->txpower, AR_XmitPower1);
+- ACCESS_ONCE(ads->ctl21) = SM(i->txpower, AR_XmitPower2);
+- ACCESS_ONCE(ads->ctl22) = SM(i->txpower, AR_XmitPower3);
++ ACCESS_ONCE_RW(ads->ctl20) = SM(i->txpower, AR_XmitPower1);
++ ACCESS_ONCE_RW(ads->ctl21) = SM(i->txpower, AR_XmitPower2);
++ ACCESS_ONCE_RW(ads->ctl22) = SM(i->txpower, AR_XmitPower3);
+ }
+
+ static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads)
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/hw.h backports-3.18.1-1/drivers/net/wireless/ath/ath9k/hw.h
+--- backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/hw.h 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ath/ath9k/hw.h 2014-12-28 14:10:09.564888946 +0100
+@@ -630,7 +630,7 @@
+
+ /* ANI */
+ void (*ani_cache_ini_regs)(struct ath_hw *ah);
+-};
++} __no_const;
+
+ /**
+ * struct ath_spec_scan - parameters for Atheros spectral scan
+@@ -708,7 +708,7 @@
+ #ifdef CPTCFG_ATH9K_BTCOEX_SUPPORT
+ void (*set_bt_ant_diversity)(struct ath_hw *hw, bool enable);
+ #endif
+-};
++} __no_const;
+
+ struct ath_nf_limits {
+ s16 max;
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/main.c backports-3.18.1-1/drivers/net/wireless/ath/ath9k/main.c
+--- backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/main.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ath/ath9k/main.c 2014-12-28 14:24:49.169250593 +0100
+@@ -2454,16 +2454,18 @@
+ if (!ath9k_is_chanctx_enabled())
+ return;
+
+- ath9k_ops.hw_scan = ath9k_hw_scan;
+- ath9k_ops.cancel_hw_scan = ath9k_cancel_hw_scan;
+- ath9k_ops.remain_on_channel = ath9k_remain_on_channel;
+- ath9k_ops.cancel_remain_on_channel = ath9k_cancel_remain_on_channel;
+- ath9k_ops.add_chanctx = ath9k_add_chanctx;
+- ath9k_ops.remove_chanctx = ath9k_remove_chanctx;
+- ath9k_ops.change_chanctx = ath9k_change_chanctx;
+- ath9k_ops.assign_vif_chanctx = ath9k_assign_vif_chanctx;
+- ath9k_ops.unassign_vif_chanctx = ath9k_unassign_vif_chanctx;
+- ath9k_ops.mgd_prepare_tx = ath9k_mgd_prepare_tx;
++ pax_open_kernel();
++ *(void **)&ath9k_ops.hw_scan = ath9k_hw_scan;
++ *(void **)&ath9k_ops.cancel_hw_scan = ath9k_cancel_hw_scan;
++ *(void **)&ath9k_ops.remain_on_channel = ath9k_remain_on_channel;
++ *(void **)&ath9k_ops.cancel_remain_on_channel = ath9k_cancel_remain_on_channel;
++ *(void **)&ath9k_ops.add_chanctx = ath9k_add_chanctx;
++ *(void **)&ath9k_ops.remove_chanctx = ath9k_remove_chanctx;
++ *(void **)&ath9k_ops.change_chanctx = ath9k_change_chanctx;
++ *(void **)&ath9k_ops.assign_vif_chanctx = ath9k_assign_vif_chanctx;
++ *(void **)&ath9k_ops.unassign_vif_chanctx = ath9k_unassign_vif_chanctx;
++ *(void **)&ath9k_ops.mgd_prepare_tx = ath9k_mgd_prepare_tx;
++ pax_close_kernel();
+ }
+
+ #endif
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/b43/phy_lp.c backports-3.18.1-1/drivers/net/wireless/b43/phy_lp.c
+--- backports-3.18.1-1.org/drivers/net/wireless/b43/phy_lp.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/b43/phy_lp.c 2014-12-28 14:10:09.564888946 +0100
+@@ -2502,7 +2502,7 @@
+ {
+ struct ssb_bus *bus = dev->dev->sdev->bus;
+
+- static const struct b206x_channel *chandata = NULL;
++ const struct b206x_channel *chandata = NULL;
+ u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
+ u32 freqref, vco_freq, val1, val2, val3, timeout, timeoutref, count;
+ u16 old_comm15, scale;
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlegacy/3945-mac.c backports-3.18.1-1/drivers/net/wireless/iwlegacy/3945-mac.c
+--- backports-3.18.1-1.org/drivers/net/wireless/iwlegacy/3945-mac.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/iwlegacy/3945-mac.c 2014-12-28 14:10:09.564888946 +0100
+@@ -3633,7 +3633,9 @@
+ */
+ if (il3945_mod_params.disable_hw_scan) {
+ D_INFO("Disabling hw_scan\n");
+- il3945_mac_ops.hw_scan = NULL;
++ pax_open_kernel();
++ *(void **)&il3945_mac_ops.hw_scan = NULL;
++ pax_close_kernel();
+ }
+
+ D_INFO("*** LOAD DRIVER ***\n");
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/dvm/debugfs.c backports-3.18.1-1/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+--- backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/dvm/debugfs.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/iwlwifi/dvm/debugfs.c 2014-12-28 14:10:09.564888946 +0100
+@@ -188,7 +188,7 @@
+ {
+ struct iwl_priv *priv = file->private_data;
+ char buf[64];
+- int buf_size;
++ size_t buf_size;
+ u32 offset, len;
+
+ memset(buf, 0, sizeof(buf));
+@@ -458,7 +458,7 @@
+ struct iwl_priv *priv = file->private_data;
+
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ u32 reset_flag;
+
+ memset(buf, 0, sizeof(buf));
+@@ -539,7 +539,7 @@
+ {
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int ht40;
+
+ memset(buf, 0, sizeof(buf));
+@@ -591,7 +591,7 @@
+ {
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int value;
+
+ memset(buf, 0, sizeof(buf));
+@@ -683,10 +683,10 @@
+ DEBUGFS_READ_WRITE_FILE_OPS(sleep_level_override);
+ DEBUGFS_READ_FILE_OPS(current_sleep_command);
+
+-static const char *fmt_value = " %-30s %10u\n";
+-static const char *fmt_hex = " %-30s 0x%02X\n";
+-static const char *fmt_table = " %-30s %10u %10u %10u %10u\n";
+-static const char *fmt_header =
++static const char fmt_value[] = " %-30s %10u\n";
++static const char fmt_hex[] = " %-30s 0x%02X\n";
++static const char fmt_table[] = " %-30s %10u %10u %10u %10u\n";
++static const char fmt_header[] =
+ "%-32s current cumulative delta max\n";
+
+ static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz)
+@@ -1856,7 +1856,7 @@
+ {
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int clear;
+
+ memset(buf, 0, sizeof(buf));
+@@ -1901,7 +1901,7 @@
+ {
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int trace;
+
+ memset(buf, 0, sizeof(buf));
+@@ -1972,7 +1972,7 @@
+ {
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int missed;
+
+ memset(buf, 0, sizeof(buf));
+@@ -2013,7 +2013,7 @@
+
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int plcp;
+
+ memset(buf, 0, sizeof(buf));
+@@ -2073,7 +2073,7 @@
+
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int flush;
+
+ memset(buf, 0, sizeof(buf));
+@@ -2163,7 +2163,7 @@
+
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int rts;
+
+ if (!priv->cfg->ht_params)
+@@ -2204,7 +2204,7 @@
+ {
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+
+ memset(buf, 0, sizeof(buf));
+ buf_size = min(count, sizeof(buf) - 1);
+@@ -2238,7 +2238,7 @@
+ struct iwl_priv *priv = file->private_data;
+ u32 event_log_flag;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+
+ /* check that the interface is up */
+ if (!iwl_is_ready(priv))
+@@ -2292,7 +2292,7 @@
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+ u32 calib_disabled;
+- int buf_size;
++ size_t buf_size;
+
+ memset(buf, 0, sizeof(buf));
+ buf_size = min(count, sizeof(buf) - 1);
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/pcie/trans.c backports-3.18.1-1/drivers/net/wireless/iwlwifi/pcie/trans.c
+--- backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/pcie/trans.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/iwlwifi/pcie/trans.c 2014-12-28 14:10:09.564888946 +0100
+@@ -1689,7 +1689,7 @@
+ struct isr_statistics *isr_stats = &trans_pcie->isr_stats;
+
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ u32 reset_flag;
+
+ memset(buf, 0, sizeof(buf));
+@@ -1710,7 +1710,7 @@
+ {
+ struct iwl_trans *trans = file->private_data;
+ char buf[8];
+- int buf_size;
++ size_t buf_size;
+ int csr;
+
+ memset(buf, 0, sizeof(buf));
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/mac80211_hwsim.c backports-3.18.1-1/drivers/net/wireless/mac80211_hwsim.c
+--- backports-3.18.1-1.org/drivers/net/wireless/mac80211_hwsim.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/mac80211_hwsim.c 2014-12-28 14:10:09.568888967 +0100
+@@ -2578,20 +2578,20 @@
+ if (channels < 1)
+ return -EINVAL;
+
+- mac80211_hwsim_mchan_ops = mac80211_hwsim_ops;
+- mac80211_hwsim_mchan_ops.hw_scan = mac80211_hwsim_hw_scan;
+- mac80211_hwsim_mchan_ops.cancel_hw_scan = mac80211_hwsim_cancel_hw_scan;
+- mac80211_hwsim_mchan_ops.sw_scan_start = NULL;
+- mac80211_hwsim_mchan_ops.sw_scan_complete = NULL;
+- mac80211_hwsim_mchan_ops.remain_on_channel = mac80211_hwsim_roc;
+- mac80211_hwsim_mchan_ops.cancel_remain_on_channel = mac80211_hwsim_croc;
+- mac80211_hwsim_mchan_ops.add_chanctx = mac80211_hwsim_add_chanctx;
+- mac80211_hwsim_mchan_ops.remove_chanctx = mac80211_hwsim_remove_chanctx;
+- mac80211_hwsim_mchan_ops.change_chanctx = mac80211_hwsim_change_chanctx;
+- mac80211_hwsim_mchan_ops.assign_vif_chanctx =
+- mac80211_hwsim_assign_vif_chanctx;
+- mac80211_hwsim_mchan_ops.unassign_vif_chanctx =
+- mac80211_hwsim_unassign_vif_chanctx;
++ pax_open_kernel();
++ memcpy((void *)&mac80211_hwsim_mchan_ops, &mac80211_hwsim_ops, sizeof mac80211_hwsim_mchan_ops);
++ *(void **)&mac80211_hwsim_mchan_ops.hw_scan = mac80211_hwsim_hw_scan;
++ *(void **)&mac80211_hwsim_mchan_ops.cancel_hw_scan = mac80211_hwsim_cancel_hw_scan;
++ *(void **)&mac80211_hwsim_mchan_ops.sw_scan_start = NULL;
++ *(void **)&mac80211_hwsim_mchan_ops.sw_scan_complete = NULL;
++ *(void **)&mac80211_hwsim_mchan_ops.remain_on_channel = mac80211_hwsim_roc;
++ *(void **)&mac80211_hwsim_mchan_ops.cancel_remain_on_channel = mac80211_hwsim_croc;
++ *(void **)&mac80211_hwsim_mchan_ops.add_chanctx = mac80211_hwsim_add_chanctx;
++ *(void **)&mac80211_hwsim_mchan_ops.remove_chanctx = mac80211_hwsim_remove_chanctx;
++ *(void **)&mac80211_hwsim_mchan_ops.change_chanctx = mac80211_hwsim_change_chanctx;
++ *(void **)&mac80211_hwsim_mchan_ops.assign_vif_chanctx = mac80211_hwsim_assign_vif_chanctx;
++ *(void **)&mac80211_hwsim_mchan_ops.unassign_vif_chanctx = mac80211_hwsim_unassign_vif_chanctx;
++ pax_close_kernel();
+
+ spin_lock_init(&hwsim_radio_lock);
+ INIT_LIST_HEAD(&hwsim_radios);
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rndis_wlan.c backports-3.18.1-1/drivers/net/wireless/rndis_wlan.c
+--- backports-3.18.1-1.org/drivers/net/wireless/rndis_wlan.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/rndis_wlan.c 2014-12-28 14:10:09.568888967 +0100
+@@ -1236,7 +1236,7 @@
+
+ netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold);
+
+- if (rts_threshold < 0 || rts_threshold > 2347)
++ if (rts_threshold > 2347)
+ rts_threshold = 2347;
+
+ tmp = cpu_to_le32(rts_threshold);
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00.h backports-3.18.1-1/drivers/net/wireless/rt2x00/rt2x00.h
+--- backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00.h 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/rt2x00/rt2x00.h 2014-12-28 14:10:09.568888967 +0100
+@@ -375,7 +375,7 @@
+ * for hardware which doesn't support hardware
+ * sequence counting.
+ */
+- atomic_t seqno;
++ atomic_unchecked_t seqno;
+ };
+
+ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00queue.c backports-3.18.1-1/drivers/net/wireless/rt2x00/rt2x00queue.c
+--- backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00queue.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/rt2x00/rt2x00queue.c 2014-12-28 14:10:09.568888967 +0100
+@@ -224,9 +224,9 @@
+ * sequence counter given by mac80211.
+ */
+ if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags))
+- seqno = atomic_add_return(0x10, &intf->seqno);
++ seqno = atomic_add_return_unchecked(0x10, &intf->seqno);
+ else
+- seqno = atomic_read(&intf->seqno);
++ seqno = atomic_read_unchecked(&intf->seqno);
+
+ hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
+ hdr->seq_ctrl |= cpu_to_le16(seqno);
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl1251/sdio.c backports-3.18.1-1/drivers/net/wireless/ti/wl1251/sdio.c
+--- backports-3.18.1-1.org/drivers/net/wireless/ti/wl1251/sdio.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ti/wl1251/sdio.c 2014-12-28 14:10:09.568888967 +0100
+@@ -282,13 +282,17 @@
+
+ irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
+
+- wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq;
+- wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq;
++ pax_open_kernel();
++ *(void **)&wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq;
++ *(void **)&wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq;
++ pax_close_kernel();
+
+ wl1251_info("using dedicated interrupt line");
+ } else {
+- wl1251_sdio_ops.enable_irq = wl1251_sdio_enable_irq;
+- wl1251_sdio_ops.disable_irq = wl1251_sdio_disable_irq;
++ pax_open_kernel();
++ *(void **)&wl1251_sdio_ops.enable_irq = wl1251_sdio_enable_irq;
++ *(void **)&wl1251_sdio_ops.disable_irq = wl1251_sdio_disable_irq;
++ pax_close_kernel();
+
+ wl1251_info("using SDIO interrupt");
+ }
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl12xx/main.c backports-3.18.1-1/drivers/net/wireless/ti/wl12xx/main.c
+--- backports-3.18.1-1.org/drivers/net/wireless/ti/wl12xx/main.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ti/wl12xx/main.c 2014-12-28 14:10:09.568888967 +0100
+@@ -656,7 +656,9 @@
+ sizeof(wl->conf.mem));
+
+ /* read data preparation is only needed by wl127x */
+- wl->ops->prepare_read = wl127x_prepare_read;
++ pax_open_kernel();
++ *(void **)&wl->ops->prepare_read = wl127x_prepare_read;
++ pax_close_kernel();
+
+ wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER,
+ WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER,
+@@ -681,7 +683,9 @@
+ sizeof(wl->conf.mem));
+
+ /* read data preparation is only needed by wl127x */
+- wl->ops->prepare_read = wl127x_prepare_read;
++ pax_open_kernel();
++ *(void **)&wl->ops->prepare_read = wl127x_prepare_read;
++ pax_close_kernel();
+
+ wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER,
+ WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER,
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl18xx/main.c backports-3.18.1-1/drivers/net/wireless/ti/wl18xx/main.c
+--- backports-3.18.1-1.org/drivers/net/wireless/ti/wl18xx/main.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/ti/wl18xx/main.c 2014-12-28 14:10:09.568888967 +0100
+@@ -1916,8 +1916,10 @@
+ }
+
+ if (!checksum_param) {
+- wl18xx_ops.set_rx_csum = NULL;
+- wl18xx_ops.init_vif = NULL;
++ pax_open_kernel();
++ *(void **)&wl18xx_ops.set_rx_csum = NULL;
++ *(void **)&wl18xx_ops.init_vif = NULL;
++ pax_close_kernel();
+ }
+
+ /* Enable 11a Band only if we have 5G antennas */
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/zd1211rw/zd_usb.c backports-3.18.1-1/drivers/net/wireless/zd1211rw/zd_usb.c
+--- backports-3.18.1-1.org/drivers/net/wireless/zd1211rw/zd_usb.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/zd1211rw/zd_usb.c 2014-12-28 14:10:09.568888967 +0100
+@@ -385,7 +385,7 @@
+ {
+ struct zd_usb *usb = urb->context;
+ struct zd_usb_interrupt *intr = &usb->intr;
+- int len;
++ unsigned int len;
+ u16 int_num;
+
+ ZD_ASSERT(in_interrupt());
+diff -Naur backports-3.18.1-1.org/drivers/nfc/nfcwilink.c backports-3.18.1-1/drivers/nfc/nfcwilink.c
+--- backports-3.18.1-1.org/drivers/nfc/nfcwilink.c 2014-12-21 22:37:14.000000000 +0100
++++ backports-3.18.1-1/drivers/nfc/nfcwilink.c 2014-12-28 14:10:09.568888967 +0100
+@@ -497,7 +497,7 @@
+
+ static int nfcwilink_probe(struct platform_device *pdev)
+ {
+- static struct nfcwilink *drv;
++ struct nfcwilink *drv;
+ int rc;
+ __u32 protocols;
+
+diff -Naur backports-3.18.1-1.org/include/linux/gracl_compat.h backports-3.18.1-1/include/linux/gracl_compat.h
+--- backports-3.18.1-1.org/include/linux/gracl_compat.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/linux/gracl_compat.h 2014-12-28 14:10:09.684889542 +0100
+@@ -0,0 +1,156 @@
++#ifndef GR_ACL_COMPAT_H
++#define GR_ACL_COMPAT_H
++
++#include <linux/resource.h>
++#include <asm/resource.h>
++
++struct sprole_pw_compat {
++ compat_uptr_t rolename;
++ unsigned char salt[GR_SALT_LEN];
++ unsigned char sum[GR_SHA_LEN];
++};
++
++struct gr_hash_struct_compat {
++ compat_uptr_t table;
++ compat_uptr_t nametable;
++ compat_uptr_t first;
++ __u32 table_size;
++ __u32 used_size;
++ int type;
++};
++
++struct acl_subject_label_compat {
++ compat_uptr_t filename;
++ compat_ino_t inode;
++ __u32 device;
++ __u32 mode;
++ kernel_cap_t cap_mask;
++ kernel_cap_t cap_lower;
++ kernel_cap_t cap_invert_audit;
++
++ struct compat_rlimit res[GR_NLIMITS];
++ __u32 resmask;
++
++ __u8 user_trans_type;
++ __u8 group_trans_type;
++ compat_uptr_t user_transitions;
++ compat_uptr_t group_transitions;
++ __u16 user_trans_num;
++ __u16 group_trans_num;
++
++ __u32 sock_families[2];
++ __u32 ip_proto[8];
++ __u32 ip_type;
++ compat_uptr_t ips;
++ __u32 ip_num;
++ __u32 inaddr_any_override;
++
++ __u32 crashes;
++ compat_ulong_t expires;
++
++ compat_uptr_t parent_subject;
++ compat_uptr_t hash;
++ compat_uptr_t prev;
++ compat_uptr_t next;
++
++ compat_uptr_t obj_hash;
++ __u32 obj_hash_size;
++ __u16 pax_flags;
++};
++
++struct role_allowed_ip_compat {
++ __u32 addr;
++ __u32 netmask;
++
++ compat_uptr_t prev;
++ compat_uptr_t next;
++};
++
++struct role_transition_compat {
++ compat_uptr_t rolename;
++
++ compat_uptr_t prev;
++ compat_uptr_t next;
++};
++
++struct acl_role_label_compat {
++ compat_uptr_t rolename;
++ uid_t uidgid;
++ __u16 roletype;
++
++ __u16 auth_attempts;
++ compat_ulong_t expires;
++
++ compat_uptr_t root_label;
++ compat_uptr_t hash;
++
++ compat_uptr_t prev;
++ compat_uptr_t next;
++
++ compat_uptr_t transitions;
++ compat_uptr_t allowed_ips;
++ compat_uptr_t domain_children;
++ __u16 domain_child_num;
++
++ umode_t umask;
++
++ compat_uptr_t subj_hash;
++ __u32 subj_hash_size;
++};
++
++struct user_acl_role_db_compat {
++ compat_uptr_t r_table;
++ __u32 num_pointers;
++ __u32 num_roles;
++ __u32 num_domain_children;
++ __u32 num_subjects;
++ __u32 num_objects;
++};
++
++struct acl_object_label_compat {
++ compat_uptr_t filename;
++ compat_ino_t inode;
++ __u32 device;
++ __u32 mode;
++
++ compat_uptr_t nested;
++ compat_uptr_t globbed;
++
++ compat_uptr_t prev;
++ compat_uptr_t next;
++};
++
++struct acl_ip_label_compat {
++ compat_uptr_t iface;
++ __u32 addr;
++ __u32 netmask;
++ __u16 low, high;
++ __u8 mode;
++ __u32 type;
++ __u32 proto[8];
++
++ compat_uptr_t prev;
++ compat_uptr_t next;
++};
++
++struct gr_arg_compat {
++ struct user_acl_role_db_compat role_db;
++ unsigned char pw[GR_PW_LEN];
++ unsigned char salt[GR_SALT_LEN];
++ unsigned char sum[GR_SHA_LEN];
++ unsigned char sp_role[GR_SPROLE_LEN];
++ compat_uptr_t sprole_pws;
++ __u32 segv_device;
++ compat_ino_t segv_inode;
++ uid_t segv_uid;
++ __u16 num_sprole_pws;
++ __u16 mode;
++};
++
++struct gr_arg_wrapper_compat {
++ compat_uptr_t arg;
++ __u32 version;
++ __u32 size;
++};
++
++#endif
+diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/include/linux/gracl.h
+--- backports-3.18.1-1.org/include/linux/gracl.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/linux/gracl.h 2014-12-28 14:10:09.684889542 +0100
+@@ -0,0 +1,340 @@
++#ifndef GR_ACL_H
++#define GR_ACL_H
++
++#include <linux/grdefs.h>
++#include <linux/resource.h>
++#include <linux/capability.h>
++#include <linux/dcache.h>
++#include <asm/resource.h>
++
++/* Major status information */
++
++#define GR_VERSION "grsecurity 3.0"
++#define GRSECURITY_VERSION 0x3000
++
++enum {
++ GR_SHUTDOWN = 0,
++ GR_ENABLE = 1,
++ GR_SPROLE = 2,
++ GR_OLDRELOAD = 3,
++ GR_SEGVMOD = 4,
++ GR_STATUS = 5,
++ GR_UNSPROLE = 6,
++ GR_PASSSET = 7,
++ GR_SPROLEPAM = 8,
++ GR_RELOAD = 9,
++};
++
++/* Password setup definitions
++ * kernel/grhash.c */
++enum {
++ GR_PW_LEN = 128,
++ GR_SALT_LEN = 16,
++ GR_SHA_LEN = 32,
++};
++
++enum {
++ GR_SPROLE_LEN = 64,
++};
++
++enum {
++ GR_NO_GLOB = 0,
++ GR_REG_GLOB,
++ GR_CREATE_GLOB
++};
++
++#define GR_NLIMITS 32
++
++/* Begin Data Structures */
++
++struct sprole_pw {
++ unsigned char *rolename;
++ unsigned char salt[GR_SALT_LEN];
++ unsigned char sum[GR_SHA_LEN]; /* 256-bit SHA hash of the password */
++};
++
++struct name_entry {
++ __u32 key;
++ ino_t inode;
++ dev_t device;
++ char *name;
++ __u16 len;
++ __u8 deleted;
++ struct name_entry *prev;
++ struct name_entry *next;
++};
++
++struct inodev_entry {
++ struct name_entry *nentry;
++ struct inodev_entry *prev;
++ struct inodev_entry *next;
++};
++
++struct acl_role_db {
++ struct acl_role_label **r_hash;
++ __u32 r_size;
++};
++
++struct inodev_db {
++ struct inodev_entry **i_hash;
++ __u32 i_size;
++};
++
++struct name_db {
++ struct name_entry **n_hash;
++ __u32 n_size;
++};
++
++struct crash_uid {
++ uid_t uid;
++ unsigned long expires;
++};
++
++struct gr_hash_struct {
++ void **table;
++ void **nametable;
++ void *first;
++ __u32 table_size;
++ __u32 used_size;
++ int type;
++};
++
++/* Userspace Grsecurity ACL data structures */
++
++struct acl_subject_label {
++ char *filename;
++ ino_t inode;
++ dev_t device;
++ __u32 mode;
++ kernel_cap_t cap_mask;
++ kernel_cap_t cap_lower;
++ kernel_cap_t cap_invert_audit;
++
++ struct rlimit res[GR_NLIMITS];
++ __u32 resmask;
++
++ __u8 user_trans_type;
++ __u8 group_trans_type;
++ uid_t *user_transitions;
++ gid_t *group_transitions;
++ __u16 user_trans_num;
++ __u16 group_trans_num;
++
++ __u32 sock_families[2];
++ __u32 ip_proto[8];
++ __u32 ip_type;
++ struct acl_ip_label **ips;
++ __u32 ip_num;
++ __u32 inaddr_any_override;
++
++ __u32 crashes;
++ unsigned long expires;
++
++ struct acl_subject_label *parent_subject;
++ struct gr_hash_struct *hash;
++ struct acl_subject_label *prev;
++ struct acl_subject_label *next;
++
++ struct acl_object_label **obj_hash;
++ __u32 obj_hash_size;
++ __u16 pax_flags;
++};
++
++struct role_allowed_ip {
++ __u32 addr;
++ __u32 netmask;
++
++ struct role_allowed_ip *prev;
++ struct role_allowed_ip *next;
++};
++
++struct role_transition {
++ char *rolename;
++
++ struct role_transition *prev;
++ struct role_transition *next;
++};
++
++struct acl_role_label {
++ char *rolename;
++ uid_t uidgid;
++ __u16 roletype;
++
++ __u16 auth_attempts;
++ unsigned long expires;
++
++ struct acl_subject_label *root_label;
++ struct gr_hash_struct *hash;
++
++ struct acl_role_label *prev;
++ struct acl_role_label *next;
++
++ struct role_transition *transitions;
++ struct role_allowed_ip *allowed_ips;
++ uid_t *domain_children;
++ __u16 domain_child_num;
++
++ umode_t umask;
++
++ struct acl_subject_label **subj_hash;
++ __u32 subj_hash_size;
++};
++
++struct user_acl_role_db {
++ struct acl_role_label **r_table;
++ __u32 num_pointers; /* Number of allocations to track */
++ __u32 num_roles; /* Number of roles */
++ __u32 num_domain_children; /* Number of domain children */
++ __u32 num_subjects; /* Number of subjects */
++ __u32 num_objects; /* Number of objects */
++};
++
++struct acl_object_label {
++ char *filename;
++ ino_t inode;
++ dev_t device;
++ __u32 mode;
++
++ struct acl_subject_label *nested;
++ struct acl_object_label *globbed;
++
++ /* next two structures not used */
++
++ struct acl_object_label *prev;
++ struct acl_object_label *next;
++};
++
++struct acl_ip_label {
++ char *iface;
++ __u32 addr;
++ __u32 netmask;
++ __u16 low, high;
++ __u8 mode;
++ __u32 type;
++ __u32 proto[8];
++
++ /* next two structures not used */
++
++ struct acl_ip_label *prev;
++ struct acl_ip_label *next;
++};
++
++struct gr_arg {
++ struct user_acl_role_db role_db;
++ unsigned char pw[GR_PW_LEN];
++ unsigned char salt[GR_SALT_LEN];
++ unsigned char sum[GR_SHA_LEN];
++ unsigned char sp_role[GR_SPROLE_LEN];
++ struct sprole_pw *sprole_pws;
++ dev_t segv_device;
++ ino_t segv_inode;
++ uid_t segv_uid;
++ __u16 num_sprole_pws;
++ __u16 mode;
++};
++
++struct gr_arg_wrapper {
++ struct gr_arg *arg;
++ __u32 version;
++ __u32 size;
++};
++
++struct subject_map {
++ struct acl_subject_label *user;
++ struct acl_subject_label *kernel;
++ struct subject_map *prev;
++ struct subject_map *next;
++};
++
++struct acl_subj_map_db {
++ struct subject_map **s_hash;
++ __u32 s_size;
++};
++
++struct gr_policy_state {
++ struct sprole_pw **acl_special_roles;
++ __u16 num_sprole_pws;
++ struct acl_role_label *kernel_role;
++ struct acl_role_label *role_list;
++ struct acl_role_label *default_role;
++ struct acl_role_db acl_role_set;
++ struct acl_subj_map_db subj_map_set;
++ struct name_db name_set;
++ struct inodev_db inodev_set;
++};
++
++struct gr_alloc_state {
++ unsigned long alloc_stack_next;
++ unsigned long alloc_stack_size;
++ void **alloc_stack;
++};
++
++struct gr_reload_state {
++ struct gr_policy_state oldpolicy;
++ struct gr_alloc_state oldalloc;
++ struct gr_policy_state newpolicy;
++ struct gr_alloc_state newalloc;
++ struct gr_policy_state *oldpolicy_ptr;
++ struct gr_alloc_state *oldalloc_ptr;
++ unsigned char oldmode;
++};
++
++/* End Data Structures Section */
++
++/* Hash functions generated by empirical testing by Brad Spengler
++ Makes good use of the low bits of the inode. Generally 0-1 times
++ in loop for successful match. 0-3 for unsuccessful match.
++ Shift/add algorithm with modulus of table size and an XOR*/
++
++static __inline__ unsigned int
++gr_rhash(const uid_t uid, const __u16 type, const unsigned int sz)
++{
++ return ((((uid + type) << (16 + type)) ^ uid) % sz);
++}
++
++ static __inline__ unsigned int
++gr_shash(const struct acl_subject_label *userp, const unsigned int sz)
++{
++ return ((const unsigned long)userp % sz);
++}
++
++static __inline__ unsigned int
++gr_fhash(const ino_t ino, const dev_t dev, const unsigned int sz)
++{
++ return (((ino + dev) ^ ((ino << 13) + (ino << 23) + (dev << 9))) % sz);
++}
++
++static __inline__ unsigned int
++gr_nhash(const char *name, const __u16 len, const unsigned int sz)
++{
++ return full_name_hash((const unsigned char *)name, len) % sz;
++}
++
++#define FOR_EACH_SUBJECT_START(role,subj,iter) \
++ subj = NULL; \
++ iter = 0; \
++ while (iter < role->subj_hash_size) { \
++ if (subj == NULL) \
++ subj = role->subj_hash[iter]; \
++ if (subj == NULL) { \
++ iter++; \
++ continue; \
++ }
++
++#define FOR_EACH_SUBJECT_END(subj,iter) \
++ subj = subj->next; \
++ if (subj == NULL) \
++ iter++; \
++ }
++
++
++#define FOR_EACH_NESTED_SUBJECT_START(role,subj) \
++ subj = role->hash->first; \
++ while (subj != NULL) {
++
++#define FOR_EACH_NESTED_SUBJECT_END(subj) \
++ subj = subj->next; \
++ }
++
++#endif
++
+diff -Naur backports-3.18.1-1.org/include/linux/gralloc.h backports-3.18.1-1/include/linux/gralloc.h
+--- backports-3.18.1-1.org/include/linux/gralloc.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/linux/gralloc.h 2014-12-28 14:10:09.684889542 +0100
+@@ -0,0 +1,9 @@
++#ifndef __GRALLOC_H
++#define __GRALLOC_H
++
++void acl_free_all(void);
++int acl_alloc_stack_init(unsigned long size);
++void *acl_alloc(unsigned long len);
++void *acl_alloc_num(unsigned long num, unsigned long len);
++
++#endif
+diff -Naur backports-3.18.1-1.org/include/linux/grdefs.h backports-3.18.1-1/include/linux/grdefs.h
+--- backports-3.18.1-1.org/include/linux/grdefs.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/linux/grdefs.h 2014-12-28 14:10:09.688889562 +0100
+@@ -0,0 +1,140 @@
++#ifndef GRDEFS_H
++#define GRDEFS_H
++
++/* Begin grsecurity status declarations */
++
++enum {
++ GR_READY = 0x01,
++ GR_STATUS_INIT = 0x00 // disabled state
++};
++
++/* Begin ACL declarations */
++
++/* Role flags */
++
++enum {
++ GR_ROLE_USER = 0x0001,
++ GR_ROLE_GROUP = 0x0002,
++ GR_ROLE_DEFAULT = 0x0004,
++ GR_ROLE_SPECIAL = 0x0008,
++ GR_ROLE_AUTH = 0x0010,
++ GR_ROLE_NOPW = 0x0020,
++ GR_ROLE_GOD = 0x0040,
++ GR_ROLE_LEARN = 0x0080,
++ GR_ROLE_TPE = 0x0100,
++ GR_ROLE_DOMAIN = 0x0200,
++ GR_ROLE_PAM = 0x0400,
++ GR_ROLE_PERSIST = 0x0800
++};
++
++/* ACL Subject and Object mode flags */
++enum {
++ GR_DELETED = 0x80000000
++};
++
++/* ACL Object-only mode flags */
++enum {
++ GR_READ = 0x00000001,
++ GR_APPEND = 0x00000002,
++ GR_WRITE = 0x00000004,
++ GR_EXEC = 0x00000008,
++ GR_FIND = 0x00000010,
++ GR_INHERIT = 0x00000020,
++ GR_SETID = 0x00000040,
++ GR_CREATE = 0x00000080,
++ GR_DELETE = 0x00000100,
++ GR_LINK = 0x00000200,
++ GR_AUDIT_READ = 0x00000400,
++ GR_AUDIT_APPEND = 0x00000800,
++ GR_AUDIT_WRITE = 0x00001000,
++ GR_AUDIT_EXEC = 0x00002000,
++ GR_AUDIT_FIND = 0x00004000,
++ GR_AUDIT_INHERIT= 0x00008000,
++ GR_AUDIT_SETID = 0x00010000,
++ GR_AUDIT_CREATE = 0x00020000,
++ GR_AUDIT_DELETE = 0x00040000,
++ GR_AUDIT_LINK = 0x00080000,
++ GR_PTRACERD = 0x00100000,
++ GR_NOPTRACE = 0x00200000,
++ GR_SUPPRESS = 0x00400000,
++ GR_NOLEARN = 0x00800000,
++ GR_INIT_TRANSFER= 0x01000000
++};
++
++#define GR_AUDITS (GR_AUDIT_READ | GR_AUDIT_WRITE | GR_AUDIT_APPEND | GR_AUDIT_EXEC | \
++ GR_AUDIT_FIND | GR_AUDIT_INHERIT | GR_AUDIT_SETID | \
++ GR_AUDIT_CREATE | GR_AUDIT_DELETE | GR_AUDIT_LINK)
++
++/* ACL subject-only mode flags */
++enum {
++ GR_KILL = 0x00000001,
++ GR_VIEW = 0x00000002,
++ GR_PROTECTED = 0x00000004,
++ GR_LEARN = 0x00000008,
++ GR_OVERRIDE = 0x00000010,
++ /* just a placeholder, this mode is only used in userspace */
++ GR_DUMMY = 0x00000020,
++ GR_PROTSHM = 0x00000040,
++ GR_KILLPROC = 0x00000080,
++ GR_KILLIPPROC = 0x00000100,
++ /* just a placeholder, this mode is only used in userspace */
++ GR_NOTROJAN = 0x00000200,
++ GR_PROTPROCFD = 0x00000400,
++ GR_PROCACCT = 0x00000800,
++ GR_RELAXPTRACE = 0x00001000,
++ //GR_NESTED = 0x00002000,
++ GR_INHERITLEARN = 0x00004000,
++ GR_PROCFIND = 0x00008000,
++ GR_POVERRIDE = 0x00010000,
++ GR_KERNELAUTH = 0x00020000,
++ GR_ATSECURE = 0x00040000,
++ GR_SHMEXEC = 0x00080000
++};
++
++enum {
++ GR_PAX_ENABLE_SEGMEXEC = 0x0001,
++ GR_PAX_ENABLE_PAGEEXEC = 0x0002,
++ GR_PAX_ENABLE_MPROTECT = 0x0004,
++ GR_PAX_ENABLE_RANDMMAP = 0x0008,
++ GR_PAX_ENABLE_EMUTRAMP = 0x0010,
++ GR_PAX_DISABLE_SEGMEXEC = 0x0100,
++ GR_PAX_DISABLE_PAGEEXEC = 0x0200,
++ GR_PAX_DISABLE_MPROTECT = 0x0400,
++ GR_PAX_DISABLE_RANDMMAP = 0x0800,
++ GR_PAX_DISABLE_EMUTRAMP = 0x1000,
++};
++
++enum {
++ GR_ID_USER = 0x01,
++ GR_ID_GROUP = 0x02,
++};
++
++enum {
++ GR_ID_ALLOW = 0x01,
++ GR_ID_DENY = 0x02,
++};
++
++#define GR_CRASH_RES 31
++#define GR_UIDTABLE_MAX 500
++
++/* begin resource learning section */
++enum {
++ GR_RLIM_CPU_BUMP = 60,
++ GR_RLIM_FSIZE_BUMP = 50000,
++ GR_RLIM_DATA_BUMP = 10000,
++ GR_RLIM_STACK_BUMP = 1000,
++ GR_RLIM_CORE_BUMP = 10000,
++ GR_RLIM_RSS_BUMP = 500000,
++ GR_RLIM_NPROC_BUMP = 1,
++ GR_RLIM_NOFILE_BUMP = 5,
++ GR_RLIM_MEMLOCK_BUMP = 50000,
++ GR_RLIM_AS_BUMP = 500000,
++ GR_RLIM_LOCKS_BUMP = 2,
++ GR_RLIM_SIGPENDING_BUMP = 5,
++ GR_RLIM_MSGQUEUE_BUMP = 10000,
++ GR_RLIM_NICE_BUMP = 1,
++ GR_RLIM_RTPRIO_BUMP = 1,
++ GR_RLIM_RTTIME_BUMP = 1000000
++};
++
++#endif
+diff -Naur backports-3.18.1-1.org/include/linux/grinternal.h backports-3.18.1-1/include/linux/grinternal.h
+--- backports-3.18.1-1.org/include/linux/grinternal.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/linux/grinternal.h 2014-12-28 14:10:09.688889562 +0100
+@@ -0,0 +1,229 @@
++#ifndef __GRINTERNAL_H
++#define __GRINTERNAL_H
++
++#ifdef CONFIG_GRKERNSEC
++
++#include <linux/fs.h>
++#include <linux/mnt_namespace.h>
++#include <linux/nsproxy.h>
++#include <linux/gracl.h>
++#include <linux/grdefs.h>
++#include <linux/grmsg.h>
++
++void gr_add_learn_entry(const char *fmt, ...)
++ __attribute__ ((format (printf, 1, 2)));
++__u32 gr_search_file(const struct dentry *dentry, const __u32 mode,
++ const struct vfsmount *mnt);
++__u32 gr_check_create(const struct dentry *new_dentry,
++ const struct dentry *parent,
++ const struct vfsmount *mnt, const __u32 mode);
++int gr_check_protected_task(const struct task_struct *task);
++__u32 to_gr_audit(const __u32 reqmode);
++int gr_set_acls(const int type);
++int gr_acl_is_enabled(void);
++char gr_roletype_to_char(void);
++
++void gr_handle_alertkill(struct task_struct *task);
++char *gr_to_filename(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++char *gr_to_filename1(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++char *gr_to_filename2(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++char *gr_to_filename3(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++
++extern int grsec_enable_ptrace_readexec;
++extern int grsec_enable_harden_ptrace;
++extern int grsec_enable_link;
++extern int grsec_enable_fifo;
++extern int grsec_enable_execve;
++extern int grsec_enable_shm;
++extern int grsec_enable_execlog;
++extern int grsec_enable_signal;
++extern int grsec_enable_audit_ptrace;
++extern int grsec_enable_forkfail;
++extern int grsec_enable_time;
++extern int grsec_enable_rofs;
++extern int grsec_deny_new_usb;
++extern int grsec_enable_chroot_shmat;
++extern int grsec_enable_chroot_mount;
++extern int grsec_enable_chroot_double;
++extern int grsec_enable_chroot_pivot;
++extern int grsec_enable_chroot_chdir;
++extern int grsec_enable_chroot_chmod;
++extern int grsec_enable_chroot_mknod;
++extern int grsec_enable_chroot_fchdir;
++extern int grsec_enable_chroot_nice;
++extern int grsec_enable_chroot_execlog;
++extern int grsec_enable_chroot_caps;
++extern int grsec_enable_chroot_sysctl;
++extern int grsec_enable_chroot_unix;
++extern int grsec_enable_symlinkown;
++extern kgid_t grsec_symlinkown_gid;
++extern int grsec_enable_tpe;
++extern kgid_t grsec_tpe_gid;
++extern int grsec_enable_tpe_all;
++extern int grsec_enable_tpe_invert;
++extern int grsec_enable_socket_all;
++extern kgid_t grsec_socket_all_gid;
++extern int grsec_enable_socket_client;
++extern kgid_t grsec_socket_client_gid;
++extern int grsec_enable_socket_server;
++extern kgid_t grsec_socket_server_gid;
++extern kgid_t grsec_audit_gid;
++extern int grsec_enable_group;
++extern int grsec_enable_log_rwxmaps;
++extern int grsec_enable_mount;
++extern int grsec_enable_chdir;
++extern int grsec_resource_logging;
++extern int grsec_enable_blackhole;
++extern int grsec_lastack_retries;
++extern int grsec_enable_brute;
++extern int grsec_enable_harden_ipc;
++extern int grsec_lock;
++
++extern spinlock_t grsec_alert_lock;
++extern unsigned long grsec_alert_wtime;
++extern unsigned long grsec_alert_fyet;
++
++extern spinlock_t grsec_audit_lock;
++
++extern rwlock_t grsec_exec_file_lock;
++
++#define gr_task_fullpath(tsk) ((tsk)->exec_file ? \
++ gr_to_filename2((tsk)->exec_file->f_path.dentry, \
++ (tsk)->exec_file->f_path.mnt) : "/")
++
++#define gr_parent_task_fullpath(tsk) ((tsk)->real_parent->exec_file ? \
++ gr_to_filename3((tsk)->real_parent->exec_file->f_path.dentry, \
++ (tsk)->real_parent->exec_file->f_path.mnt) : "/")
++
++#define gr_task_fullpath0(tsk) ((tsk)->exec_file ? \
++ gr_to_filename((tsk)->exec_file->f_path.dentry, \
++ (tsk)->exec_file->f_path.mnt) : "/")
++
++#define gr_parent_task_fullpath0(tsk) ((tsk)->real_parent->exec_file ? \
++ gr_to_filename1((tsk)->real_parent->exec_file->f_path.dentry, \
++ (tsk)->real_parent->exec_file->f_path.mnt) : "/")
++
++#define proc_is_chrooted(tsk_a) ((tsk_a)->gr_is_chrooted)
++
++#define have_same_root(tsk_a,tsk_b) ((tsk_a)->gr_chroot_dentry == (tsk_b)->gr_chroot_dentry)
++
++static inline bool gr_is_same_file(const struct file *file1, const struct file *file2)
++{
++ if (file1 && file2) {
++ const struct inode *inode1 = file1->f_path.dentry->d_inode;
++ const struct inode *inode2 = file2->f_path.dentry->d_inode;
++ if (inode1->i_ino == inode2->i_ino && inode1->i_sb->s_dev == inode2->i_sb->s_dev)
++ return true;
++ }
++
++ return false;
++}
++
++#define GR_CHROOT_CAPS {{ \
++ CAP_TO_MASK(CAP_LINUX_IMMUTABLE) | CAP_TO_MASK(CAP_NET_ADMIN) | \
++ CAP_TO_MASK(CAP_SYS_MODULE) | CAP_TO_MASK(CAP_SYS_RAWIO) | \
++ CAP_TO_MASK(CAP_SYS_PACCT) | CAP_TO_MASK(CAP_SYS_ADMIN) | \
++ CAP_TO_MASK(CAP_SYS_BOOT) | CAP_TO_MASK(CAP_SYS_TIME) | \
++ CAP_TO_MASK(CAP_NET_RAW) | CAP_TO_MASK(CAP_SYS_TTY_CONFIG) | \
++ CAP_TO_MASK(CAP_IPC_OWNER) | CAP_TO_MASK(CAP_SETFCAP), \
++ CAP_TO_MASK(CAP_SYSLOG) | CAP_TO_MASK(CAP_MAC_ADMIN) }}
++
++#define security_learn(normal_msg,args...) \
++({ \
++ read_lock(&grsec_exec_file_lock); \
++ gr_add_learn_entry(normal_msg "\n", ## args); \
++ read_unlock(&grsec_exec_file_lock); \
++})
++
++enum {
++ GR_DO_AUDIT,
++ GR_DONT_AUDIT,
++ /* used for non-audit messages that we shouldn't kill the task on */
++ GR_DONT_AUDIT_GOOD
++};
++
++enum {
++ GR_TTYSNIFF,
++ GR_RBAC,
++ GR_RBAC_STR,
++ GR_STR_RBAC,
++ GR_RBAC_MODE2,
++ GR_RBAC_MODE3,
++ GR_FILENAME,
++ GR_SYSCTL_HIDDEN,
++ GR_NOARGS,
++ GR_ONE_INT,
++ GR_ONE_INT_TWO_STR,
++ GR_ONE_STR,
++ GR_STR_INT,
++ GR_TWO_STR_INT,
++ GR_TWO_INT,
++ GR_TWO_U64,
++ GR_THREE_INT,
++ GR_FIVE_INT_TWO_STR,
++ GR_TWO_STR,
++ GR_THREE_STR,
++ GR_FOUR_STR,
++ GR_STR_FILENAME,
++ GR_FILENAME_STR,
++ GR_FILENAME_TWO_INT,
++ GR_FILENAME_TWO_INT_STR,
++ GR_TEXTREL,
++ GR_PTRACE,
++ GR_RESOURCE,
++ GR_CAP,
++ GR_SIG,
++ GR_SIG2,
++ GR_CRASH1,
++ GR_CRASH2,
++ GR_PSACCT,
++ GR_RWXMAP,
++ GR_RWXMAPVMA
++};
++
++#define gr_log_hidden_sysctl(audit, msg, str) gr_log_varargs(audit, msg, GR_SYSCTL_HIDDEN, str)
++#define gr_log_ttysniff(audit, msg, task) gr_log_varargs(audit, msg, GR_TTYSNIFF, task)
++#define gr_log_fs_rbac_generic(audit, msg, dentry, mnt) gr_log_varargs(audit, msg, GR_RBAC, dentry, mnt)
++#define gr_log_fs_rbac_str(audit, msg, dentry, mnt, str) gr_log_varargs(audit, msg, GR_RBAC_STR, dentry, mnt, str)
++#define gr_log_fs_str_rbac(audit, msg, str, dentry, mnt) gr_log_varargs(audit, msg, GR_STR_RBAC, str, dentry, mnt)
++#define gr_log_fs_rbac_mode2(audit, msg, dentry, mnt, str1, str2) gr_log_varargs(audit, msg, GR_RBAC_MODE2, dentry, mnt, str1, str2)
++#define gr_log_fs_rbac_mode3(audit, msg, dentry, mnt, str1, str2, str3) gr_log_varargs(audit, msg, GR_RBAC_MODE3, dentry, mnt, str1, str2, str3)
++#define gr_log_fs_generic(audit, msg, dentry, mnt) gr_log_varargs(audit, msg, GR_FILENAME, dentry, mnt)
++#define gr_log_noargs(audit, msg) gr_log_varargs(audit, msg, GR_NOARGS)
++#define gr_log_int(audit, msg, num) gr_log_varargs(audit, msg, GR_ONE_INT, num)
++#define gr_log_int_str2(audit, msg, num, str1, str2) gr_log_varargs(audit, msg, GR_ONE_INT_TWO_STR, num, str1, str2)
++#define gr_log_str(audit, msg, str) gr_log_varargs(audit, msg, GR_ONE_STR, str)
++#define gr_log_str_int(audit, msg, str, num) gr_log_varargs(audit, msg, GR_STR_INT, str, num)
++#define gr_log_int_int(audit, msg, num1, num2) gr_log_varargs(audit, msg, GR_TWO_INT, num1, num2)
++#define gr_log_two_u64(audit, msg, num1, num2) gr_log_varargs(audit, msg, GR_TWO_U64, num1, num2)
++#define gr_log_int3(audit, msg, num1, num2, num3) gr_log_varargs(audit, msg, GR_THREE_INT, num1, num2, num3)
++#define gr_log_int5_str2(audit, msg, num1, num2, str1, str2) gr_log_varargs(audit, msg, GR_FIVE_INT_TWO_STR, num1, num2, str1, str2)
++#define gr_log_str_str(audit, msg, str1, str2) gr_log_varargs(audit, msg, GR_TWO_STR, str1, str2)
++#define gr_log_str2_int(audit, msg, str1, str2, num) gr_log_varargs(audit, msg, GR_TWO_STR_INT, str1, str2, num)
++#define gr_log_str3(audit, msg, str1, str2, str3) gr_log_varargs(audit, msg, GR_THREE_STR, str1, str2, str3)
++#define gr_log_str4(audit, msg, str1, str2, str3, str4) gr_log_varargs(audit, msg, GR_FOUR_STR, str1, str2, str3, str4)
++#define gr_log_str_fs(audit, msg, str, dentry, mnt) gr_log_varargs(audit, msg, GR_STR_FILENAME, str, dentry, mnt)
++#define gr_log_fs_str(audit, msg, dentry, mnt, str) gr_log_varargs(audit, msg, GR_FILENAME_STR, dentry, mnt, str)
++#define gr_log_fs_int2(audit, msg, dentry, mnt, num1, num2) gr_log_varargs(audit, msg, GR_FILENAME_TWO_INT, dentry, mnt, num1, num2)
++#define gr_log_fs_int2_str(audit, msg, dentry, mnt, num1, num2, str) gr_log_varargs(audit, msg, GR_FILENAME_TWO_INT_STR, dentry, mnt, num1, num2, str)
++#define gr_log_textrel_ulong_ulong(audit, msg, file, ulong1, ulong2) gr_log_varargs(audit, msg, GR_TEXTREL, file, ulong1, ulong2)
++#define gr_log_ptrace(audit, msg, task) gr_log_varargs(audit, msg, GR_PTRACE, task)
++#define gr_log_res_ulong2_str(audit, msg, task, ulong1, str, ulong2) gr_log_varargs(audit, msg, GR_RESOURCE, task, ulong1, str, ulong2)
++#define gr_log_cap(audit, msg, task, str) gr_log_varargs(audit, msg, GR_CAP, task, str)
++#define gr_log_sig_addr(audit, msg, str, addr) gr_log_varargs(audit, msg, GR_SIG, str, addr)
++#define gr_log_sig_task(audit, msg, task, num) gr_log_varargs(audit, msg, GR_SIG2, task, num)
++#define gr_log_crash1(audit, msg, task, ulong) gr_log_varargs(audit, msg, GR_CRASH1, task, ulong)
++#define gr_log_crash2(audit, msg, task, ulong1) gr_log_varargs(audit, msg, GR_CRASH2, task, ulong1)
++#define gr_log_procacct(audit, msg, task, num1, num2, num3, num4, num5, num6, num7, num8, num9) gr_log_varargs(audit, msg, GR_PSACCT, task, num1, num2, num3, num4, num5, num6, num7, num8, num9)
++#define gr_log_rwxmap(audit, msg, str) gr_log_varargs(audit, msg, GR_RWXMAP, str)
++#define gr_log_rwxmap_vma(audit, msg, str) gr_log_varargs(audit, msg, GR_RWXMAPVMA, str)
++
++void gr_log_varargs(int audit, const char *msg, int argtypes, ...);
++
++#endif
++
++#endif
+diff -Naur backports-3.18.1-1.org/include/linux/grmsg.h backports-3.18.1-1/include/linux/grmsg.h
+--- backports-3.18.1-1.org/include/linux/grmsg.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/linux/grmsg.h 2014-12-28 14:10:09.688889562 +0100
+@@ -0,0 +1,117 @@
++#define DEFAULTSECMSG "%.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u, parent %.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u"
++#define GR_ACL_PROCACCT_MSG "%.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u run time:[%ud %uh %um %us] cpu time:[%ud %uh %um %us] %s with exit code %ld, parent %.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u"
++#define GR_PTRACE_ACL_MSG "denied ptrace of %.950s(%.16s:%d) by "
++#define GR_STOPMOD_MSG "denied modification of module state by "
++#define GR_ROFS_BLOCKWRITE_MSG "denied write to block device %.950s by "
++#define GR_ROFS_MOUNT_MSG "denied writable mount of %.950s by "
++#define GR_IOPERM_MSG "denied use of ioperm() by "
++#define GR_IOPL_MSG "denied use of iopl() by "
++#define GR_SHMAT_ACL_MSG "denied attach of shared memory of UID %u, PID %d, ID %u by "
++#define GR_UNIX_CHROOT_MSG "denied connect() to abstract AF_UNIX socket outside of chroot by "
++#define GR_SHMAT_CHROOT_MSG "denied attach of shared memory outside of chroot by "
++#define GR_MEM_READWRITE_MSG "denied access of range %Lx -> %Lx in /dev/mem by "
++#define GR_SYMLINK_MSG "not following symlink %.950s owned by %d.%d by "
++#define GR_LEARN_AUDIT_MSG "%s\t%u\t%u\t%u\t%.4095s\t%.4095s\t%lu\t%lu\t%.4095s\t%lu\t%pI4"
++#define GR_ID_LEARN_MSG "%s\t%u\t%u\t%u\t%.4095s\t%.4095s\t%c\t%d\t%d\t%d\t%pI4"
++#define GR_HIDDEN_ACL_MSG "%s access to hidden file %.950s by "
++#define GR_OPEN_ACL_MSG "%s open of %.950s for%s%s by "
++#define GR_CREATE_ACL_MSG "%s create of %.950s for%s%s by "
++#define GR_FIFO_MSG "denied writing FIFO %.950s of %d.%d by "
++#define GR_MKNOD_CHROOT_MSG "denied mknod of %.950s from chroot by "
++#define GR_MKNOD_ACL_MSG "%s mknod of %.950s by "
++#define GR_UNIXCONNECT_ACL_MSG "%s connect() to the unix domain socket %.950s by "
++#define GR_TTYSNIFF_ACL_MSG "terminal being sniffed by IP:%pI4 %.480s[%.16s:%d], parent %.480s[%.16s:%d] against "
++#define GR_MKDIR_ACL_MSG "%s mkdir of %.950s by "
++#define GR_RMDIR_ACL_MSG "%s rmdir of %.950s by "
++#define GR_UNLINK_ACL_MSG "%s unlink of %.950s by "
++#define GR_SYMLINK_ACL_MSG "%s symlink from %.480s to %.480s by "
++#define GR_HARDLINK_MSG "denied hardlink of %.930s (owned by %d.%d) to %.30s for "
++#define GR_LINK_ACL_MSG "%s link of %.480s to %.480s by "
++#define GR_INHERIT_ACL_MSG "successful inherit of %.480s's ACL for %.480s by "
++#define GR_RENAME_ACL_MSG "%s rename of %.480s to %.480s by "
++#define GR_UNSAFESHARE_EXEC_ACL_MSG "denied exec with cloned fs of %.950s by "
++#define GR_PTRACE_EXEC_ACL_MSG "denied ptrace of %.950s by "
++#define GR_EXEC_ACL_MSG "%s execution of %.950s by "
++#define GR_EXEC_TPE_MSG "denied untrusted exec (due to %.70s) of %.950s by "
++#define GR_SEGVSTART_ACL_MSG "possible exploit bruteforcing on " DEFAULTSECMSG " banning uid %u from login for %lu seconds"
++#define GR_SEGVNOSUID_ACL_MSG "possible exploit bruteforcing on " DEFAULTSECMSG " banning execution for %lu seconds"
++#define GR_MOUNT_CHROOT_MSG "denied mount of %.256s as %.930s from chroot by "
++#define GR_PIVOT_CHROOT_MSG "denied pivot_root from chroot by "
++#define GR_TRUNCATE_ACL_MSG "%s truncate of %.950s by "
++#define GR_ATIME_ACL_MSG "%s access time change of %.950s by "
++#define GR_ACCESS_ACL_MSG "%s access of %.950s for%s%s%s by "
++#define GR_CHROOT_CHROOT_MSG "denied double chroot to %.950s by "
++#define GR_CHMOD_CHROOT_MSG "denied chmod +s of %.950s by "
++#define GR_CHMOD_ACL_MSG "%s chmod of %.950s by "
++#define GR_CHROOT_FCHDIR_MSG "denied fchdir outside of chroot to %.950s by "
++#define GR_CHROOT_FHANDLE_MSG "denied use of file handles inside chroot by "
++#define GR_CHOWN_ACL_MSG "%s chown of %.950s by "
++#define GR_SETXATTR_ACL_MSG "%s setting extended attribute of %.950s by "
++#define GR_REMOVEXATTR_ACL_MSG "%s removing extended attribute of %.950s by "
++#define GR_WRITLIB_ACL_MSG "denied load of writable library %.950s by "
++#define GR_INITF_ACL_MSG "init_variables() failed %s by "
++#define GR_DISABLED_ACL_MSG "Error loading %s, trying to run kernel with acls disabled. To disable acls at startup use <kernel image name> gracl=off from your boot loader"
++#define GR_DEV_ACL_MSG "/dev/grsec: %d bytes sent %d required, being fed garbage by "
++#define GR_SHUTS_ACL_MSG "shutdown auth success for "
++#define GR_SHUTF_ACL_MSG "shutdown auth failure for "
++#define GR_SHUTI_ACL_MSG "ignoring shutdown for disabled RBAC system for "
++#define GR_SEGVMODS_ACL_MSG "segvmod auth success for "
++#define GR_SEGVMODF_ACL_MSG "segvmod auth failure for "
++#define GR_SEGVMODI_ACL_MSG "ignoring segvmod for disabled RBAC system for "
++#define GR_ENABLE_ACL_MSG "%s RBAC system loaded by "
++#define GR_ENABLEF_ACL_MSG "unable to load %s for "
++#define GR_RELOADI_ACL_MSG "ignoring reload request for disabled RBAC system"
++#define GR_RELOAD_ACL_MSG "%s RBAC system reloaded by "
++#define GR_RELOADF_ACL_MSG "failed reload of %s for "
++#define GR_SPROLEI_ACL_MSG "ignoring change to special role for disabled RBAC system for "
++#define GR_SPROLES_ACL_MSG "successful change to special role %s (id %d) by "
++#define GR_SPROLEL_ACL_MSG "special role %s (id %d) exited by "
++#define GR_SPROLEF_ACL_MSG "special role %s failure for "
++#define GR_UNSPROLEI_ACL_MSG "ignoring unauth of special role for disabled RBAC system for "
++#define GR_UNSPROLES_ACL_MSG "successful unauth of special role %s (id %d) by "
++#define GR_INVMODE_ACL_MSG "invalid mode %d by "
++#define GR_PRIORITY_CHROOT_MSG "denied priority change of process (%.16s:%d) by "
++#define GR_FAILFORK_MSG "failed fork with errno %s by "
++#define GR_NICE_CHROOT_MSG "denied priority change by "
++#define GR_UNISIGLOG_MSG "%.32s occurred at %p in "
++#define GR_DUALSIGLOG_MSG "signal %d sent to " DEFAULTSECMSG " by "
++#define GR_SIG_ACL_MSG "denied send of signal %d to protected task " DEFAULTSECMSG " by "
++#define GR_SYSCTL_MSG "denied modification of grsecurity sysctl value : %.32s by "
++#define GR_SYSCTL_ACL_MSG "%s sysctl of %.950s for%s%s by "
++#define GR_TIME_MSG "time set by "
++#define GR_DEFACL_MSG "fatal: unable to find subject for (%.16s:%d), loaded by "
++#define GR_MMAP_ACL_MSG "%s executable mmap of %.950s by "
++#define GR_MPROTECT_ACL_MSG "%s executable mprotect of %.950s by "
++#define GR_SOCK_MSG "denied socket(%.16s,%.16s,%.16s) by "
++#define GR_SOCK_NOINET_MSG "denied socket(%.16s,%.16s,%d) by "
++#define GR_BIND_MSG "denied bind() by "
++#define GR_CONNECT_MSG "denied connect() by "
++#define GR_BIND_ACL_MSG "denied bind() to %pI4 port %u sock type %.16s protocol %.16s by "
++#define GR_CONNECT_ACL_MSG "denied connect() to %pI4 port %u sock type %.16s protocol %.16s by "
++#define GR_IP_LEARN_MSG "%s\t%u\t%u\t%u\t%.4095s\t%.4095s\t%pI4\t%u\t%u\t%u\t%u\t%pI4"
++#define GR_EXEC_CHROOT_MSG "exec of %.980s within chroot by process "
++#define GR_CAP_ACL_MSG "use of %s denied for "
++#define GR_CAP_CHROOT_MSG "use of %s in chroot denied for "
++#define GR_CAP_ACL_MSG2 "use of %s permitted for "
++#define GR_USRCHANGE_ACL_MSG "change to uid %u denied for "
++#define GR_GRPCHANGE_ACL_MSG "change to gid %u denied for "
++#define GR_REMOUNT_AUDIT_MSG "remount of %.256s by "
++#define GR_UNMOUNT_AUDIT_MSG "unmount of %.256s by "
++#define GR_MOUNT_AUDIT_MSG "mount of %.256s to %.256s by "
++#define GR_CHDIR_AUDIT_MSG "chdir to %.980s by "
++#define GR_EXEC_AUDIT_MSG "exec of %.930s (%.128s) by "
++#define GR_RESOURCE_MSG "denied resource overstep by requesting %lu for %.16s against limit %lu for "
++#define GR_RWXMMAP_MSG "denied RWX mmap of %.950s by "
++#define GR_RWXMPROTECT_MSG "denied RWX mprotect of %.950s by "
++#define GR_TEXTREL_AUDIT_MSG "denied text relocation in %.950s, VMA:0x%08lx 0x%08lx by "
++#define GR_PTGNUSTACK_MSG "denied marking stack executable as requested by PT_GNU_STACK marking in %.950s by "
++#define GR_VM86_MSG "denied use of vm86 by "
++#define GR_PTRACE_AUDIT_MSG "process %.950s(%.16s:%d) attached to via ptrace by "
++#define GR_PTRACE_READEXEC_MSG "denied ptrace of unreadable binary %.950s by "
++#define GR_INIT_TRANSFER_MSG "persistent special role transferred privilege to init by "
++#define GR_BADPROCPID_MSG "denied read of sensitive /proc/pid/%s entry via fd passed across exec by "
++#define GR_SYMLINKOWNER_MSG "denied following symlink %.950s since symlink owner %u does not match target owner %u, by "
++#define GR_BRUTE_DAEMON_MSG "bruteforce prevention initiated for the next 30 minutes or until service restarted, stalling each fork 30 seconds. Please investigate the crash report for "
++#define GR_BRUTE_SUID_MSG "bruteforce prevention initiated due to crash of %.950s against uid %u, banning suid/sgid execs for %u minutes. Please investigate the crash report for "
++#define GR_IPC_DENIED_MSG "denied %s of overly-permissive IPC object with creator uid %u by "
++#define GR_MSRWRITE_MSG "denied write to CPU MSR by "
+diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/include/linux/grsecurity.h
+--- backports-3.18.1-1.org/include/linux/grsecurity.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/linux/grsecurity.h 2014-12-28 14:10:09.688889562 +0100
+@@ -0,0 +1,254 @@
++#ifndef GR_SECURITY_H
++#define GR_SECURITY_H
++#include <linux/fs.h>
++#include <linux/fs_struct.h>
++#include <linux/binfmts.h>
++#include <linux/gracl.h>
++
++/* notify of brain-dead configs */
++#if defined(CONFIG_GRKERNSEC_PROC_USER) && defined(CONFIG_GRKERNSEC_PROC_USERGROUP)
++#error "CONFIG_GRKERNSEC_PROC_USER and CONFIG_GRKERNSEC_PROC_USERGROUP cannot both be enabled."
++#endif
++#if defined(CONFIG_GRKERNSEC_PROC) && !defined(CONFIG_GRKERNSEC_PROC_USER) && !defined(CONFIG_GRKERNSEC_PROC_USERGROUP)
++#error "CONFIG_GRKERNSEC_PROC enabled, but neither CONFIG_GRKERNSEC_PROC_USER nor CONFIG_GRKERNSEC_PROC_USERGROUP enabled"
++#endif
++#if defined(CONFIG_PAX_NOEXEC) && !defined(CONFIG_PAX_PAGEEXEC) && !defined(CONFIG_PAX_SEGMEXEC) && !defined(CONFIG_PAX_KERNEXEC)
++#error "CONFIG_PAX_NOEXEC enabled, but PAGEEXEC, SEGMEXEC, and KERNEXEC are disabled."
++#endif
++#if defined(CONFIG_PAX_ASLR) && !defined(CONFIG_PAX_RANDKSTACK) && !defined(CONFIG_PAX_RANDUSTACK) && !defined(CONFIG_PAX_RANDMMAP)
++#error "CONFIG_PAX_ASLR enabled, but RANDKSTACK, RANDUSTACK, and RANDMMAP are disabled."
++#endif
++#if defined(CONFIG_PAX) && !defined(CONFIG_PAX_NOEXEC) && !defined(CONFIG_PAX_ASLR)
++#error "CONFIG_PAX enabled, but no PaX options are enabled."
++#endif
++
++int gr_handle_new_usb(void);
++
++void gr_handle_brute_attach(int dumpable);
++void gr_handle_brute_check(void);
++void gr_handle_kernel_exploit(void);
++
++char gr_roletype_to_char(void);
++
++int gr_proc_is_restricted(void);
++
++int gr_acl_enable_at_secure(void);
++
++int gr_check_user_change(kuid_t real, kuid_t effective, kuid_t fs);
++int gr_check_group_change(kgid_t real, kgid_t effective, kgid_t fs);
++
++int gr_learn_cap(const struct task_struct *task, const struct cred *cred, const int cap);
++
++void gr_del_task_from_ip_table(struct task_struct *p);
++
++int gr_pid_is_chrooted(struct task_struct *p);
++int gr_handle_chroot_fowner(struct pid *pid, enum pid_type type);
++int gr_handle_chroot_nice(void);
++int gr_handle_chroot_sysctl(const int op);
++int gr_handle_chroot_setpriority(struct task_struct *p,
++ const int niceval);
++int gr_chroot_fchdir(struct dentry *u_dentry, struct vfsmount *u_mnt);
++int gr_chroot_fhandle(void);
++int gr_handle_chroot_chroot(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++void gr_handle_chroot_chdir(const struct path *path);
++int gr_handle_chroot_chmod(const struct dentry *dentry,
++ const struct vfsmount *mnt, const int mode);
++int gr_handle_chroot_mknod(const struct dentry *dentry,
++ const struct vfsmount *mnt, const int mode);
++int gr_handle_chroot_mount(const struct dentry *dentry,
++ const struct vfsmount *mnt,
++ const char *dev_name);
++int gr_handle_chroot_pivot(void);
++int gr_handle_chroot_unix(const pid_t pid);
++
++int gr_handle_rawio(const struct inode *inode);
++
++void gr_handle_ioperm(void);
++void gr_handle_iopl(void);
++void gr_handle_msr_write(void);
++
++umode_t gr_acl_umask(void);
++
++int gr_tpe_allow(const struct file *file);
++
++void gr_set_chroot_entries(struct task_struct *task, const struct path *path);
++void gr_clear_chroot_entries(struct task_struct *task);
++
++void gr_log_forkfail(const int retval);
++void gr_log_timechange(void);
++void gr_log_signal(const int sig, const void *addr, const struct task_struct *t);
++void gr_log_chdir(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++void gr_log_chroot_exec(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++void gr_log_remount(const char *devname, const int retval);
++void gr_log_unmount(const char *devname, const int retval);
++void gr_log_mount(const char *from, const char *to, const int retval);
++void gr_log_textrel(struct vm_area_struct *vma);
++void gr_log_ptgnustack(struct file *file);
++void gr_log_rwxmmap(struct file *file);
++void gr_log_rwxmprotect(struct vm_area_struct *vma);
++
++int gr_handle_follow_link(const struct inode *parent,
++ const struct inode *inode,
++ const struct dentry *dentry,
++ const struct vfsmount *mnt);
++int gr_handle_fifo(const struct dentry *dentry,
++ const struct vfsmount *mnt,
++ const struct dentry *dir, const int flag,
++ const int acc_mode);
++int gr_handle_hardlink(const struct dentry *dentry,
++ const struct vfsmount *mnt,
++ struct inode *inode,
++ const int mode, const struct filename *to);
++
++int gr_is_capable(const int cap);
++int gr_is_capable_nolog(const int cap);
++int gr_task_is_capable(const struct task_struct *task, const struct cred *cred, const int cap);
++int gr_task_is_capable_nolog(const struct task_struct *task, const int cap);
++
++void gr_copy_label(struct task_struct *tsk);
++void gr_handle_crash(struct task_struct *task, const int sig);
++int gr_handle_signal(const struct task_struct *p, const int sig);
++int gr_check_crash_uid(const kuid_t uid);
++int gr_check_protected_task(const struct task_struct *task);
++int gr_check_protected_task_fowner(struct pid *pid, enum pid_type type);
++int gr_acl_handle_mmap(const struct file *file,
++ const unsigned long prot);
++int gr_acl_handle_mprotect(const struct file *file,
++ const unsigned long prot);
++int gr_check_hidden_task(const struct task_struct *tsk);
++__u32 gr_acl_handle_truncate(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++__u32 gr_acl_handle_utime(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++__u32 gr_acl_handle_access(const struct dentry *dentry,
++ const struct vfsmount *mnt, const int fmode);
++__u32 gr_acl_handle_chmod(const struct dentry *dentry,
++ const struct vfsmount *mnt, umode_t *mode);
++__u32 gr_acl_handle_chown(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++__u32 gr_acl_handle_setxattr(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++__u32 gr_acl_handle_removexattr(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++int gr_handle_ptrace(struct task_struct *task, const long request);
++int gr_handle_proc_ptrace(struct task_struct *task);
++__u32 gr_acl_handle_execve(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++int gr_check_crash_exec(const struct file *filp);
++int gr_acl_is_enabled(void);
++void gr_set_role_label(struct task_struct *task, const kuid_t uid,
++ const kgid_t gid);
++int gr_set_proc_label(const struct dentry *dentry,
++ const struct vfsmount *mnt,
++ const int unsafe_flags);
++__u32 gr_acl_handle_hidden_file(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++__u32 gr_acl_handle_open(const struct dentry *dentry,
++ const struct vfsmount *mnt, int acc_mode);
++__u32 gr_acl_handle_creat(const struct dentry *dentry,
++ const struct dentry *p_dentry,
++ const struct vfsmount *p_mnt,
++ int open_flags, int acc_mode, const int imode);
++void gr_handle_create(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++void gr_handle_proc_create(const struct dentry *dentry,
++ const struct inode *inode);
++__u32 gr_acl_handle_mknod(const struct dentry *new_dentry,
++ const struct dentry *parent_dentry,
++ const struct vfsmount *parent_mnt,
++ const int mode);
++__u32 gr_acl_handle_mkdir(const struct dentry *new_dentry,
++ const struct dentry *parent_dentry,
++ const struct vfsmount *parent_mnt);
++__u32 gr_acl_handle_rmdir(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++void gr_handle_delete(const ino_t ino, const dev_t dev);
++__u32 gr_acl_handle_unlink(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++__u32 gr_acl_handle_symlink(const struct dentry *new_dentry,
++ const struct dentry *parent_dentry,
++ const struct vfsmount *parent_mnt,
++ const struct filename *from);
++__u32 gr_acl_handle_link(const struct dentry *new_dentry,
++ const struct dentry *parent_dentry,
++ const struct vfsmount *parent_mnt,
++ const struct dentry *old_dentry,
++ const struct vfsmount *old_mnt, const struct filename *to);
++int gr_handle_symlink_owner(const struct path *link, const struct inode *target);
++int gr_acl_handle_rename(struct dentry *new_dentry,
++ struct dentry *parent_dentry,
++ const struct vfsmount *parent_mnt,
++ struct dentry *old_dentry,
++ struct inode *old_parent_inode,
++ struct vfsmount *old_mnt, const struct filename *newname, unsigned int flags);
++void gr_handle_rename(struct inode *old_dir, struct inode *new_dir,
++ struct dentry *old_dentry,
++ struct dentry *new_dentry,
++ struct vfsmount *mnt, const __u8 replace, unsigned int flags);
++__u32 gr_check_link(const struct dentry *new_dentry,
++ const struct dentry *parent_dentry,
++ const struct vfsmount *parent_mnt,
++ const struct dentry *old_dentry,
++ const struct vfsmount *old_mnt);
++int gr_acl_handle_filldir(const struct file *file, const char *name,
++ const unsigned int namelen, const ino_t ino);
++
++__u32 gr_acl_handle_unix(const struct dentry *dentry,
++ const struct vfsmount *mnt);
++void gr_acl_handle_exit(void);
++void gr_acl_handle_psacct(struct task_struct *task, const long code);
++int gr_acl_handle_procpidmem(const struct task_struct *task);
++int gr_handle_rofs_mount(struct dentry *dentry, struct vfsmount *mnt, int mnt_flags);
++int gr_handle_rofs_blockwrite(struct dentry *dentry, struct vfsmount *mnt, int acc_mode);
++void gr_audit_ptrace(struct task_struct *task);
++dev_t gr_get_dev_from_dentry(struct dentry *dentry);
++void gr_put_exec_file(struct task_struct *task);
++
++int gr_ptrace_readexec(struct file *file, int unsafe_flags);
++
++#if defined(CONFIG_GRKERNSEC) && (defined(CONFIG_GRKERNSEC_RESLOG) || !defined(CONFIG_GRKERNSEC_NO_RBAC))
++extern void gr_learn_resource(const struct task_struct *task, const int res,
++ const unsigned long wanted, const int gt);
++#else
++static inline void gr_learn_resource(const struct task_struct *task, const int res,
++ const unsigned long wanted, const int gt)
++{
++}
++#endif
++
++#ifdef CONFIG_GRKERNSEC_RESLOG
++extern void gr_log_resource(const struct task_struct *task, const int res,
++ const unsigned long wanted, const int gt);
++#else
++static inline void gr_log_resource(const struct task_struct *task, const int res,
++ const unsigned long wanted, const int gt)
++{
++}
++#endif
++
++#ifdef CONFIG_GRKERNSEC
++void task_grsec_rbac(struct seq_file *m, struct task_struct *p);
++void gr_handle_vm86(void);
++void gr_handle_mem_readwrite(u64 from, u64 to);
++
++void gr_log_badprocpid(const char *entry);
++
++extern int grsec_enable_dmesg;
++extern int grsec_disable_privio;
++
++#ifdef CONFIG_GRKERNSEC_PROC_USERGROUP
++extern kgid_t grsec_proc_gid;
++#endif
++
++#ifdef CONFIG_GRKERNSEC_CHROOT_FINDTASK
++extern int grsec_enable_chroot_findtask;
++#endif
++#ifdef CONFIG_GRKERNSEC_SETXID
++extern int grsec_enable_setxid;
++#endif
++#endif
++
++#endif
+diff -Naur backports-3.18.1-1.org/include/linux/grsock.h backports-3.18.1-1/include/linux/grsock.h
+--- backports-3.18.1-1.org/include/linux/grsock.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/linux/grsock.h 2014-12-28 14:10:09.688889562 +0100
+@@ -0,0 +1,19 @@
++#ifndef __GRSOCK_H
++#define __GRSOCK_H
++
++extern void gr_attach_curr_ip(const struct sock *sk);
++extern int gr_handle_sock_all(const int family, const int type,
++ const int protocol);
++extern int gr_handle_sock_server(const struct sockaddr *sck);
++extern int gr_handle_sock_server_other(const struct sock *sck);
++extern int gr_handle_sock_client(const struct sockaddr *sck);
++extern int gr_search_connect(struct socket * sock,
++ struct sockaddr_in * addr);
++extern int gr_search_bind(struct socket * sock,
++ struct sockaddr_in * addr);
++extern int gr_search_listen(struct socket * sock);
++extern int gr_search_accept(struct socket * sock);
++extern int gr_search_socket(const int domain, const int type,
++ const int protocol);
++
++#endif
+diff -Naur backports-3.18.1-1.org/include/linux/unaligned/access_ok.h backports-3.18.1-1/include/linux/unaligned/access_ok.h
+--- backports-3.18.1-1.org/include/linux/unaligned/access_ok.h 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/include/linux/unaligned/access_ok.h 2014-12-28 14:10:09.712889681 +0100
+@@ -4,34 +4,34 @@
+ #include <linux/kernel.h>
+ #include <asm/byteorder.h>
+
+-static inline u16 get_unaligned_le16(const void *p)
++static inline u16 __intentional_overflow(-1) get_unaligned_le16(const void *p)
+ {
+- return le16_to_cpup((__le16 *)p);
++ return le16_to_cpup((const __le16 *)p);
+ }
+
+-static inline u32 get_unaligned_le32(const void *p)
++static inline u32 __intentional_overflow(-1) get_unaligned_le32(const void *p)
+ {
+- return le32_to_cpup((__le32 *)p);
++ return le32_to_cpup((const __le32 *)p);
+ }
+
+-static inline u64 get_unaligned_le64(const void *p)
++static inline u64 __intentional_overflow(-1) get_unaligned_le64(const void *p)
+ {
+- return le64_to_cpup((__le64 *)p);
++ return le64_to_cpup((const __le64 *)p);
+ }
+
+-static inline u16 get_unaligned_be16(const void *p)
++static inline u16 __intentional_overflow(-1) get_unaligned_be16(const void *p)
+ {
+- return be16_to_cpup((__be16 *)p);
++ return be16_to_cpup((const __be16 *)p);
+ }
+
+-static inline u32 get_unaligned_be32(const void *p)
++static inline u32 __intentional_overflow(-1) get_unaligned_be32(const void *p)
+ {
+- return be32_to_cpup((__be32 *)p);
++ return be32_to_cpup((const __be32 *)p);
+ }
+
+-static inline u64 get_unaligned_be64(const void *p)
++static inline u64 __intentional_overflow(-1) get_unaligned_be64(const void *p)
+ {
+- return be64_to_cpup((__be64 *)p);
++ return be64_to_cpup((const __be64 *)p);
+ }
+
+ static inline void put_unaligned_le16(u16 val, void *p)
+diff -Naur backports-3.18.1-1.org/include/media/v4l2-dev.h backports-3.18.1-1/include/media/v4l2-dev.h
+--- backports-3.18.1-1.org/include/media/v4l2-dev.h 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/include/media/v4l2-dev.h 2014-12-28 14:10:09.716889709 +0100
+@@ -75,7 +75,7 @@
+ int (*mmap) (struct file *, struct vm_area_struct *);
+ int (*open) (struct file *);
+ int (*release) (struct file *);
+-};
++} __do_const;
+
+ /*
+ * Newer version of video_device, handled by videodev2.c
+diff -Naur backports-3.18.1-1.org/include/media/v4l2-device.h backports-3.18.1-1/include/media/v4l2-device.h
+--- backports-3.18.1-1.org/include/media/v4l2-device.h 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/include/media/v4l2-device.h 2014-12-28 14:10:09.716889709 +0100
+@@ -95,7 +95,7 @@
+ this function returns 0. If the name ends with a digit (e.g. cx18),
+ then the name will be set to cx18-0 since cx180 looks really odd. */
+ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+- atomic_t *instance);
++ atomic_unchecked_t *instance);
+
+ /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
+ Since the parent disappears this ensures that v4l2_dev doesn't have an
+diff -Naur backports-3.18.1-1.org/include/net/bluetooth/l2cap.h backports-3.18.1-1/include/net/bluetooth/l2cap.h
+--- backports-3.18.1-1.org/include/net/bluetooth/l2cap.h 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/include/net/bluetooth/l2cap.h 2014-12-28 14:10:09.716889709 +0100
+@@ -608,7 +608,7 @@
+ unsigned char *kdata,
+ struct iovec *iov,
+ int len);
+-};
++} __do_const;
+
+ struct l2cap_conn {
+ struct hci_conn *hcon;
+diff -Naur backports-3.18.1-1.org/include/net/mac80211.h backports-3.18.1-1/include/net/mac80211.h
+--- backports-3.18.1-1.org/include/net/mac80211.h 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/include/net/mac80211.h 2014-12-28 14:10:09.724889743 +0100
+@@ -4648,7 +4648,7 @@
+ void (*remove_sta_debugfs)(void *priv, void *priv_sta);
+
+ u32 (*get_expected_throughput)(void *priv_sta);
+-};
++} __do_const;
+
+ static inline int rate_supported(struct ieee80211_sta *sta,
+ enum ieee80211_band band,
+diff -Naur backports-3.18.1-1.org/include/trace/events/fs.h backports-3.18.1-1/include/trace/events/fs.h
+--- backports-3.18.1-1.org/include/trace/events/fs.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/include/trace/events/fs.h 2014-12-28 14:10:09.728889769 +0100
+@@ -0,0 +1,53 @@
++#undef TRACE_SYSTEM
++#define TRACE_SYSTEM fs
++
++#if !defined(_TRACE_FS_H) || defined(TRACE_HEADER_MULTI_READ)
++#define _TRACE_FS_H
++
++#include <linux/fs.h>
++#include <linux/tracepoint.h>
++
++TRACE_EVENT(do_sys_open,
++
++ TP_PROTO(const char *filename, int flags, int mode),
++
++ TP_ARGS(filename, flags, mode),
++
++ TP_STRUCT__entry(
++ __string( filename, filename )
++ __field( int, flags )
++ __field( int, mode )
++ ),
++
++ TP_fast_assign(
++ __assign_str(filename, filename);
++ __entry->flags = flags;
++ __entry->mode = mode;
++ ),
++
++ TP_printk("\"%s\" %x %o",
++ __get_str(filename), __entry->flags, __entry->mode)
++);
++
++TRACE_EVENT(open_exec,
++
++ TP_PROTO(const char *filename),
++
++ TP_ARGS(filename),
++
++ TP_STRUCT__entry(
++ __string( filename, filename )
++ ),
++
++ TP_fast_assign(
++ __assign_str(filename, filename);
++ ),
++
++ TP_printk("\"%s\"",
++ __get_str(filename))
++);
++
++#endif /* _TRACE_FS_H */
++
++/* This part must be outside protection */
++#include <trace/define_trace.h>
+diff -Naur backports-3.18.1-1.org/net/bluetooth/6lowpan.c backports-3.18.1-1/net/bluetooth/6lowpan.c
+--- backports-3.18.1-1.org/net/bluetooth/6lowpan.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/6lowpan.c 2014-12-28 14:10:09.784890034 +0100
+@@ -367,7 +367,6 @@
+
+ drop:
+ dev->stats.rx_dropped++;
+- kfree_skb(skb);
+ return NET_RX_DROP;
+ }
+
+diff -Naur backports-3.18.1-1.org/net/bluetooth/bnep/core.c backports-3.18.1-1/net/bluetooth/bnep/core.c
+--- backports-3.18.1-1.org/net/bluetooth/bnep/core.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/bnep/core.c 2014-12-28 14:10:09.784890034 +0100
+@@ -533,6 +533,9 @@
+
+ BT_DBG("");
+
++ if (!l2cap_is_socket(sock))
++ return -EBADFD;
++
+ baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
+ baswap((void *) src, &l2cap_pi(sock->sk)->chan->src);
+
+diff -Naur backports-3.18.1-1.org/net/bluetooth/cmtp/core.c backports-3.18.1-1/net/bluetooth/cmtp/core.c
+--- backports-3.18.1-1.org/net/bluetooth/cmtp/core.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/cmtp/core.c 2014-12-28 14:10:09.784890034 +0100
+@@ -334,6 +334,9 @@
+
+ BT_DBG("");
+
++ if (!l2cap_is_socket(sock))
++ return -EBADFD;
++
+ session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL);
+ if (!session)
+ return -ENOMEM;
+diff -Naur backports-3.18.1-1.org/net/bluetooth/hci_sock.c backports-3.18.1-1/net/bluetooth/hci_sock.c
+--- backports-3.18.1-1.org/net/bluetooth/hci_sock.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/hci_sock.c 2014-12-28 14:10:09.784890034 +0100
+@@ -1067,7 +1067,7 @@
+ uf.event_mask[1] = *((u32 *) f->event_mask + 1);
+ }
+
+- len = min_t(unsigned int, len, sizeof(uf));
++ len = min((size_t)len, sizeof(uf));
+ if (copy_from_user(&uf, optval, len)) {
+ err = -EFAULT;
+ break;
+diff -Naur backports-3.18.1-1.org/net/bluetooth/hidp/core.c backports-3.18.1-1/net/bluetooth/hidp/core.c
+--- backports-3.18.1-1.org/net/bluetooth/hidp/core.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/hidp/core.c 2014-12-28 14:10:09.784890034 +0100
+@@ -1322,13 +1322,14 @@
+ {
+ struct hidp_session *session;
+ struct l2cap_conn *conn;
+- struct l2cap_chan *chan = l2cap_pi(ctrl_sock->sk)->chan;
++ struct l2cap_chan *chan;
+ int ret;
+
+ ret = hidp_verify_sockets(ctrl_sock, intr_sock);
+ if (ret)
+ return ret;
+
++ chan = l2cap_pi(ctrl_sock->sk)->chan;
+ conn = NULL;
+ l2cap_chan_lock(chan);
+ if (chan->conn)
+diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_core.c backports-3.18.1-1/net/bluetooth/l2cap_core.c
+--- backports-3.18.1-1.org/net/bluetooth/l2cap_core.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/l2cap_core.c 2014-12-28 14:10:09.784890034 +0100
+@@ -3512,8 +3512,10 @@
+ break;
+
+ case L2CAP_CONF_RFC:
+- if (olen == sizeof(rfc))
+- memcpy(&rfc, (void *)val, olen);
++ if (olen != sizeof(rfc))
++ break;
++
++ memcpy(&rfc, (void *)val, olen);
+
+ if (test_bit(CONF_STATE2_DEVICE, &chan->conf_state) &&
+ rfc.mode != chan->mode)
+diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c backports-3.18.1-1/net/bluetooth/l2cap_sock.c
+--- backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/l2cap_sock.c 2014-12-28 14:10:09.788890064 +0100
+@@ -628,7 +628,8 @@
+ struct sock *sk = sock->sk;
+ struct l2cap_chan *chan = l2cap_pi(sk)->chan;
+ struct l2cap_options opts;
+- int len, err = 0;
++ int err = 0;
++ size_t len = optlen;
+ u32 opt;
+
+ BT_DBG("sk %p", sk);
+@@ -655,7 +656,7 @@
+ opts.max_tx = chan->max_tx;
+ opts.txwin_size = chan->tx_win;
+
+- len = min_t(unsigned int, sizeof(opts), optlen);
++ len = min(sizeof(opts), len);
+ if (copy_from_user((char *) &opts, optval, len)) {
+ err = -EFAULT;
+ break;
+@@ -742,7 +743,8 @@
+ struct bt_security sec;
+ struct bt_power pwr;
+ struct l2cap_conn *conn;
+- int len, err = 0;
++ int err = 0;
++ size_t len = optlen;
+ u32 opt;
+
+ BT_DBG("sk %p", sk);
+@@ -766,7 +768,7 @@
+
+ sec.level = BT_SECURITY_LOW;
+
+- len = min_t(unsigned int, sizeof(sec), optlen);
++ len = min(sizeof(sec), len);
+ if (copy_from_user((char *) &sec, optval, len)) {
+ err = -EFAULT;
+ break;
+@@ -862,7 +864,7 @@
+
+ pwr.force_active = BT_POWER_FORCE_ACTIVE_ON;
+
+- len = min_t(unsigned int, sizeof(pwr), optlen);
++ len = min(sizeof(pwr), len);
+ if (copy_from_user((char *) &pwr, optval, len)) {
+ err = -EFAULT;
+ break;
+diff -Naur backports-3.18.1-1.org/net/bluetooth/rfcomm/sock.c backports-3.18.1-1/net/bluetooth/rfcomm/sock.c
+--- backports-3.18.1-1.org/net/bluetooth/rfcomm/sock.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/rfcomm/sock.c 2014-12-28 14:10:09.788890064 +0100
+@@ -695,7 +695,7 @@
+ struct sock *sk = sock->sk;
+ struct bt_security sec;
+ int err = 0;
+- size_t len;
++ size_t len = optlen;
+ u32 opt;
+
+ BT_DBG("sk %p", sk);
+@@ -717,7 +717,7 @@
+
+ sec.level = BT_SECURITY_LOW;
+
+- len = min_t(unsigned int, sizeof(sec), optlen);
++ len = min(sizeof(sec), len);
+ if (copy_from_user((char *) &sec, optval, len)) {
+ err = -EFAULT;
+ break;
+diff -Naur backports-3.18.1-1.org/net/bluetooth/rfcomm/tty.c backports-3.18.1-1/net/bluetooth/rfcomm/tty.c
+--- backports-3.18.1-1.org/net/bluetooth/rfcomm/tty.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/bluetooth/rfcomm/tty.c 2014-12-28 14:10:09.788890064 +0100
+@@ -752,7 +752,7 @@
+ BT_DBG("tty %p id %d", tty, tty->index);
+
+ BT_DBG("dev %p dst %pMR channel %d opened %d", dev, &dev->dst,
+- dev->channel, dev->port.count);
++ dev->channel, atomic_read(&dev->port.count));
+
+ err = tty_port_open(&dev->port, tty, filp);
+ if (err)
+@@ -775,7 +775,7 @@
+ struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
+
+ BT_DBG("tty %p dev %p dlc %p opened %d", tty, dev, dev->dlc,
+- dev->port.count);
++ atomic_read(&dev->port.count));
+
+ tty_port_close(&dev->port, tty, filp);
+ }
+diff -Naur backports-3.18.1-1.org/net/ieee802154/6lowpan_rtnl.c backports-3.18.1-1/net/ieee802154/6lowpan_rtnl.c
+--- backports-3.18.1-1.org/net/ieee802154/6lowpan_rtnl.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/ieee802154/6lowpan_rtnl.c 2014-12-28 14:10:09.796890100 +0100
+@@ -639,7 +639,7 @@
+ dev_put(real_dev);
+ }
+
+-static struct rtnl_link_ops lowpan_link_ops __read_mostly = {
++static struct rtnl_link_ops lowpan_link_ops = {
+ .kind = "lowpan",
+ .priv_size = sizeof(struct lowpan_dev_info),
+ .setup = lowpan_setup,
+diff -Naur backports-3.18.1-1.org/net/ieee802154/reassembly.c backports-3.18.1-1/net/ieee802154/reassembly.c
+--- backports-3.18.1-1.org/net/ieee802154/reassembly.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/ieee802154/reassembly.c 2014-12-28 14:10:09.796890100 +0100
+@@ -460,14 +460,13 @@
+
+ static int __net_init lowpan_frags_ns_sysctl_register(struct net *net)
+ {
+- struct ctl_table *table;
++ ctl_table_no_const *table = NULL;
+ struct ctl_table_header *hdr;
+ struct netns_ieee802154_lowpan *ieee802154_lowpan =
+ net_ieee802154_lowpan(net);
+
+- table = lowpan_frags_ns_ctl_table;
+ if (!net_eq(net, &init_net)) {
+- table = kmemdup(table, sizeof(lowpan_frags_ns_ctl_table),
++ table = kmemdup(lowpan_frags_ns_ctl_table, sizeof(lowpan_frags_ns_ctl_table),
+ GFP_KERNEL);
+ if (table == NULL)
+ goto err_alloc;
+@@ -494,8 +493,7 @@
+ return 0;
+
+ err_reg:
+- if (!net_eq(net, &init_net))
+- kfree(table);
++ kfree(table);
+ err_alloc:
+ return -ENOMEM;
+ }
+diff -Naur backports-3.18.1-1.org/net/mac80211/cfg.c backports-3.18.1-1/net/mac80211/cfg.c
+--- backports-3.18.1-1.org/net/mac80211/cfg.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/mac80211/cfg.c 2014-12-28 14:10:09.812890175 +0100
+@@ -541,7 +541,7 @@
+ ret = ieee80211_vif_use_channel(sdata, chandef,
+ IEEE80211_CHANCTX_EXCLUSIVE);
+ }
+- } else if (local->open_count == local->monitors) {
++ } else if (local_read(&local->open_count) == local->monitors) {
+ local->_oper_chandef = *chandef;
+ ieee80211_hw_config(local, 0);
+ }
+@@ -3326,7 +3326,7 @@
+ else
+ local->probe_req_reg--;
+
+- if (!local->open_count)
++ if (!local_read(&local->open_count))
+ break;
+
+ ieee80211_queue_work(&local->hw, &local->reconfig_filter);
+@@ -3460,8 +3460,8 @@
+ if (chanctx_conf) {
+ *chandef = sdata->vif.bss_conf.chandef;
+ ret = 0;
+- } else if (local->open_count > 0 &&
+- local->open_count == local->monitors &&
++ } else if (local_read(&local->open_count) > 0 &&
++ local_read(&local->open_count) == local->monitors &&
+ sdata->vif.type == NL80211_IFTYPE_MONITOR) {
+ if (local->use_chanctx)
+ *chandef = local->monitor_chandef;
+diff -Naur backports-3.18.1-1.org/net/mac80211/ieee80211_i.h backports-3.18.1-1/net/mac80211/ieee80211_i.h
+--- backports-3.18.1-1.org/net/mac80211/ieee80211_i.h 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/mac80211/ieee80211_i.h 2014-12-28 14:10:09.812890175 +0100
+@@ -29,6 +29,7 @@
+ #include <net/ieee80211_radiotap.h>
+ #include <net/cfg80211.h>
+ #include <net/mac80211.h>
++#include <asm/local.h>
+ #include "key.h"
+ #include "sta_info.h"
+ #include "debug.h"
+@@ -1057,7 +1058,7 @@
+ /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
+ spinlock_t queue_stop_reason_lock;
+
+- int open_count;
++ local_t open_count;
+ int monitors, cooked_mntrs;
+ /* number of interfaces with corresponding FIF_ flags */
+ int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
+diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/mac80211/iface.c
+--- backports-3.18.1-1.org/net/mac80211/iface.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/mac80211/iface.c 2014-12-28 14:10:09.812890175 +0100
+@@ -532,7 +532,7 @@
+ break;
+ }
+
+- if (local->open_count == 0) {
++ if (local_read(&local->open_count) == 0) {
+ res = drv_start(local);
+ if (res)
+ goto err_del_bss;
+@@ -579,7 +579,7 @@
+ res = drv_add_interface(local, sdata);
+ if (res)
+ goto err_stop;
+- } else if (local->monitors == 0 && local->open_count == 0) {
++ } else if (local->monitors == 0 && local_read(&local->open_count) == 0) {
+ res = ieee80211_add_virtual_monitor(local);
+ if (res)
+ goto err_stop;
+@@ -688,7 +688,7 @@
+ atomic_inc(&local->iff_promiscs);
+
+ if (coming_up)
+- local->open_count++;
++ local_inc(&local->open_count);
+
+ if (hw_reconf_flags)
+ ieee80211_hw_config(local, hw_reconf_flags);
+@@ -726,7 +726,7 @@
+ err_del_interface:
+ drv_remove_interface(local, sdata);
+ err_stop:
+- if (!local->open_count)
++ if (!local_read(&local->open_count))
+ drv_stop(local);
+ err_del_bss:
+ sdata->bss = NULL;
+@@ -892,7 +892,7 @@
+ }
+
+ if (going_down)
+- local->open_count--;
++ local_dec(&local->open_count);
+
+ switch (sdata->vif.type) {
+ case NL80211_IFTYPE_AP_VLAN:
+@@ -954,7 +954,7 @@
+ }
+ spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
+
+- if (local->open_count == 0)
++ if (local_read(&local->open_count) == 0)
+ ieee80211_clear_tx_pending(local);
+
+ /*
+@@ -997,7 +997,7 @@
+ if (cancel_scan)
+ flush_delayed_work(&local->scan_work);
+
+- if (local->open_count == 0) {
++ if (local_read(&local->open_count) == 0) {
+ ieee80211_stop_device(local);
+
+ /* no reconfiguring after stop! */
+@@ -1008,7 +1008,7 @@
+ ieee80211_configure_filter(local);
+ ieee80211_hw_config(local, hw_reconf_flags);
+
+- if (local->monitors == local->open_count)
++ if (local->monitors == local_read(&local->open_count))
+ ieee80211_add_virtual_monitor(local);
+ }
+
+diff -Naur backports-3.18.1-1.org/net/mac80211/main.c backports-3.18.1-1/net/mac80211/main.c
+--- backports-3.18.1-1.org/net/mac80211/main.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/mac80211/main.c 2014-12-28 14:10:09.812890175 +0100
+@@ -175,7 +175,7 @@
+ changed &= ~(IEEE80211_CONF_CHANGE_CHANNEL |
+ IEEE80211_CONF_CHANGE_POWER);
+
+- if (changed && local->open_count) {
++ if (changed && local_read(&local->open_count)) {
+ ret = drv_config(local, changed);
+ /*
+ * Goal:
+diff -Naur backports-3.18.1-1.org/net/mac80211/pm.c backports-3.18.1-1/net/mac80211/pm.c
+--- backports-3.18.1-1.org/net/mac80211/pm.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/mac80211/pm.c 2014-12-28 14:10:09.812890175 +0100
+@@ -12,7 +12,7 @@
+ struct ieee80211_sub_if_data *sdata;
+ struct sta_info *sta;
+
+- if (!local->open_count)
++ if (!local_read(&local->open_count))
+ goto suspend;
+
+ ieee80211_scan_cancel(local);
+@@ -59,7 +59,7 @@
+ cancel_work_sync(&local->dynamic_ps_enable_work);
+ del_timer_sync(&local->dynamic_ps_timer);
+
+- local->wowlan = wowlan && local->open_count;
++ local->wowlan = wowlan && local_read(&local->open_count);
+ if (local->wowlan) {
+ int err = drv_suspend(local, wowlan);
+ if (err < 0) {
+@@ -125,7 +125,7 @@
+ WARN_ON(!list_empty(&local->chanctx_list));
+
+ /* stop hardware - this must stop RX */
+- if (local->open_count)
++ if (local_read(&local->open_count))
+ ieee80211_stop_device(local);
+
+ suspend:
+diff -Naur backports-3.18.1-1.org/net/mac80211/rate.c backports-3.18.1-1/net/mac80211/rate.c
+--- backports-3.18.1-1.org/net/mac80211/rate.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/mac80211/rate.c 2014-12-28 14:10:09.812890175 +0100
+@@ -720,7 +720,7 @@
+
+ ASSERT_RTNL();
+
+- if (local->open_count)
++ if (local_read(&local->open_count))
+ return -EBUSY;
+
+ if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
+diff -Naur backports-3.18.1-1.org/net/mac80211/util.c backports-3.18.1-1/net/mac80211/util.c
+--- backports-3.18.1-1.org/net/mac80211/util.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/mac80211/util.c 2014-12-28 14:10:09.816890209 +0100
+@@ -1669,7 +1669,7 @@
+ }
+ #endif
+ /* everything else happens only if HW was up & running */
+- if (!local->open_count)
++ if (!local_read(&local->open_count))
+ goto wake_up;
+
+ /*
+@@ -1895,7 +1895,7 @@
+ local->in_reconfig = false;
+ barrier();
+
+- if (local->monitors == local->open_count && local->monitors > 0)
++ if (local->monitors == local_read(&local->open_count) && local->monitors > 0)
+ ieee80211_add_virtual_monitor(local);
+
+ /*
+diff -Naur backports-3.18.1-1.org/net/wireless/wext-core.c backports-3.18.1-1/net/wireless/wext-core.c
+--- backports-3.18.1-1.org/net/wireless/wext-core.c 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/net/wireless/wext-core.c 2014-12-28 14:10:09.832890290 +0100
+@@ -748,8 +748,7 @@
+ */
+
+ /* Support for very large requests */
+- if ((descr->flags & IW_DESCR_FLAG_NOMAX) &&
+- (user_length > descr->max_tokens)) {
++ if (user_length > descr->max_tokens) {
+ /* Allow userspace to GET more than max so
+ * we can support any size GET requests.
+ * There is still a limit : -ENOMEM.
+@@ -788,22 +787,6 @@
+ }
+ }
+
+- if (IW_IS_GET(cmd) && !(descr->flags & IW_DESCR_FLAG_NOMAX)) {
+- /*
+- * If this is a GET, but not NOMAX, it means that the extra
+- * data is not bounded by userspace, but by max_tokens. Thus
+- * set the length to max_tokens. This matches the extra data
+- * allocation.
+- * The driver should fill it with the number of tokens it
+- * provided, and it may check iwp->length rather than having
+- * knowledge of max_tokens. If the driver doesn't change the
+- * iwp->length, this ioctl just copies back max_token tokens
+- * filled with zeroes. Hopefully the driver isn't claiming
+- * them to be valid data.
+- */
+- iwp->length = descr->max_tokens;
+- }
+-
+ err = handler(dev, info, (union iwreq_data *) iwp, extra);
+
+ iwp->length += essid_compat;
--- /dev/null
+diff -Naur backports-3.18.1-1.org/Makefile backports-3.18.1-1/Makefile
+--- backports-3.18.1-1.org/Makefile 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/Makefile 2014-12-29 15:51:19.358111370 +0100
+@@ -8,9 +8,9 @@
+ SHELL := /bin/bash
+ BACKPORT_PWD := $(shell pwd)
+
+-KMODDIR ?= updates
++KMODDIR ?= kernel
+ ifneq ($(origin KLIB), undefined)
+-KMODPATH_ARG := "INSTALL_MOD_PATH=$(KLIB)"
++KMODPATH_ARG :=
+ else
+ KLIB := /lib/modules/$(shell uname -r)/
+ KMODPATH_ARG :=
+diff -Naur backports-3.18.1-1.org/Makefile.real backports-3.18.1-1/Makefile.real
+--- backports-3.18.1-1.org/Makefile.real 2014-12-21 22:37:13.000000000 +0100
++++ backports-3.18.1-1/Makefile.real 2014-12-29 15:51:40.934780933 +0100
+@@ -92,11 +92,11 @@
+ @$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_PWD) \
+ INSTALL_MOD_DIR=$(KMODDIR) $(KMODPATH_ARG) \
+ modules_install
+- @./scripts/blacklist.sh $(KLIB)/ $(KLIB)/$(KMODDIR)
++# @./scripts/blacklist.sh $(KLIB)/ $(KLIB)/$(KMODDIR)
+ @./scripts/compress_modules.sh $(KLIB)/$(KMODDIR)
+- @./scripts/check_depmod.sh
+- @/sbin/depmod -a
+- @./scripts/update-initramfs.sh $(KLIB)
++# @./scripts/check_depmod.sh
++# @/sbin/depmod -a
++# @./scripts/update-initramfs.sh $(KLIB)
+ @echo
+ @echo Your backported driver modules should be installed now.
+ @echo Reboot.
--- /dev/null
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/Kconfig backports-3.18.1-1/drivers/net/wireless/Kconfig
+--- backports-3.18.1-1.org/drivers/net/wireless/Kconfig 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/Kconfig 2014-12-29 20:37:43.945764119 +0100
+@@ -55,6 +55,14 @@
+ ---help---
+ A driver for Marvell Libertas 8388 USB devices using thinfirm.
+
++config LIBERTAS_UAP
++ tristate "Marvell 8xxx Libertas UAP"
++ depends on MAC80211
++ depends on MMC
++ select FW_LOADER
++ ---help---
++ Driver for Marvell Libertas 8xxx micro AP.
++
+ config AIRO
+ depends on n
+ tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards"
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/Makefile backports-3.18.1-1/drivers/net/wireless/libertas_uap/Makefile
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/Makefile 2014-12-29 20:41:50.975778546 +0100
+@@ -0,0 +1,6 @@
++obj-$(CPTCFG_LIBERTAS_UAP) += uap8xxx.o
++
++uap8xxx-y += uap_main.o uap_sdio_mmc.o
++uap8xxx-$(CPTCFG_PROC_FS) += uap_proc.o uap_debug.o
++
++EXTRA_CFLAGS += -DFPNUM='"52"' -DPXA3XX_DMA_ALIGN -DDEBUG_LEVEL1
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_debug.c backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_debug.c
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_debug.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_debug.c 2014-12-29 20:37:43.949097590 +0100
+@@ -0,0 +1,260 @@
++/** @file uap_debug.c
++ * @brief This file contains functions for debug proc file.
++ *
++ * Copyright (C) 2008-2009, Marvell International Ltd.
++ *
++ * This software file (the "File") is distributed by Marvell International
++ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
++ * (the "License"). You may use, redistribute and/or modify this File in
++ * accordance with the terms and conditions of the License, a copy of which
++ * is available along with the File in the gpl.txt file or by writing to
++ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
++ *
++ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
++ * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
++ * this warranty disclaimer.
++ *
++ */
++#ifdef CONFIG_PROC_FS
++#include "uap_headers.h"
++
++/********************************************************
++ Local Variables
++********************************************************/
++
++#define item_size(n) (sizeof ((uap_adapter *)0)->n)
++#define item_addr(n) ((u32) &((uap_adapter *)0)->n)
++
++#define item_dbg_size(n) (sizeof (((uap_adapter *)0)->dbg.n))
++#define item_dbg_addr(n) ((u32) &(((uap_adapter *)0)->dbg.n))
++
++#define item_dev_size(n) (sizeof ((uap_dev_t *)0)->n)
++#define item_dev_addr(n) ((u32) &((uap_dev_t *)0)->n)
++
++/** MicroAp device offset */
++#define OFFSET_UAP_DEV 0x01
++/** Bluetooth adapter offset */
++#define OFFSET_UAP_ADAPTER 0x02
++
++struct debug_data
++{
++ /** Name */
++ char name[32];
++ /** Size */
++ u32 size;
++ /** Address */
++ u32 addr;
++ /** Offset */
++ u32 offset;
++ /** Flag */
++ u32 flag;
++};
++
++/* To debug any member of uap_adapter, simply add one line here.
++ */
++static struct debug_data items[] = {
++ {"cmd_sent", item_dev_size(cmd_sent), 0, item_dev_addr(cmd_sent),
++ OFFSET_UAP_DEV},
++ {"data_sent", item_dev_size(data_sent), 0, item_dev_addr(data_sent),
++ OFFSET_UAP_DEV},
++ {"IntCounter", item_size(IntCounter), 0, item_addr(IntCounter),
++ OFFSET_UAP_ADAPTER},
++ {"cmd_pending", item_size(cmd_pending), 0, item_addr(cmd_pending),
++ OFFSET_UAP_ADAPTER},
++ {"num_cmd_h2c_fail", item_dbg_size(num_cmd_host_to_card_failure), 0,
++ item_dbg_addr(num_cmd_host_to_card_failure), OFFSET_UAP_ADAPTER},
++ {"num_tx_h2c_fail", item_dbg_size(num_tx_host_to_card_failure), 0,
++ item_dbg_addr(num_tx_host_to_card_failure), OFFSET_UAP_ADAPTER},
++ {"psmode", item_size(psmode), 0, item_addr(psmode), OFFSET_UAP_ADAPTER},
++ {"ps_state", item_size(ps_state), 0, item_addr(ps_state),
++ OFFSET_UAP_ADAPTER},
++#ifdef DEBUG_LEVEL1
++ {"drvdbg", sizeof(drvdbg), (u32) & drvdbg, 0, 0}
++#endif
++};
++
++static int num_of_items = sizeof(items) / sizeof(items[0]);
++
++/********************************************************
++ Global Variables
++********************************************************/
++
++/********************************************************
++ Local Functions
++********************************************************/
++/**
++ * @brief proc read function
++ *
++ * @param page pointer to buffer
++ * @param s read data starting position
++ * @param off offset
++ * @param cnt counter
++ * @param eof end of file flag
++ * @param data data to output
++ * @return number of output data
++ */
++static int uap_debug_proc_show(struct seq_file *s, void *data) {
++ int val = 0;
++ int i;
++
++ struct debug_data *d = (struct debug_data *)s->private;
++
++ if (MODULE_GET == 0)
++ return UAP_STATUS_FAILURE;
++
++ for (i = 0; i < num_of_items; i++) {
++ if (d[i].size == 1)
++ val = *((u8 *) d[i].addr);
++ else if (d[i].size == 2)
++ val = *((u16 *) d[i].addr);
++ else if (d[i].size == 4)
++ val = *((u32 *) d[i].addr);
++
++ seq_printf(s, "%s=%d\n", d[i].name, val);
++ }
++ MODULE_PUT;
++ return 0;
++}
++
++static int uap_debug_proc_open(struct inode* inode, struct file* file) {
++ return single_open(file, uap_debug_proc_show, PDE_DATA(inode));
++}
++
++/**
++ * @brief proc write function
++ *
++ * @param f file pointer
++ * @param buf pointer to data buffer
++ * @param cnt data number to write
++ * @param data data to write
++ * @return number of data
++ */
++static ssize_t uap_debug_proc_write(struct file *f, const char __user *buf, size_t cnt, loff_t *data) {
++ int r, i;
++ char *pdata;
++ char *p;
++ char *p0;
++ char *p1;
++ char *p2;
++ struct debug_data *d = (struct debug_data *)PDE_DATA(file_inode(f));
++
++ if (MODULE_GET == 0)
++ return UAP_STATUS_FAILURE;
++
++ pdata = (char *) kmalloc(cnt, GFP_KERNEL);
++ if (pdata == NULL) {
++ MODULE_PUT;
++ return 0;
++ }
++
++ if (copy_from_user(pdata, buf, cnt)) {
++ PRINTM(INFO, "Copy from user failed\n");
++ kfree(pdata);
++ MODULE_PUT;
++ return 0;
++ }
++
++ p0 = pdata;
++ for (i = 0; i < num_of_items; i++) {
++ do {
++ p = strstr(p0, d[i].name);
++ if (p == NULL)
++ break;
++ p1 = strchr(p, '\n');
++ if (p1 == NULL)
++ break;
++ p0 = p1++;
++ p2 = strchr(p, '=');
++ if (!p2)
++ break;
++ p2++;
++ r = string_to_number(p2);
++ if (d[i].size == 1)
++ *((u8 *) d[i].addr) = (u8) r;
++ else if (d[i].size == 2)
++ *((u16 *) d[i].addr) = (u16) r;
++ else if (d[i].size == 4)
++ *((u32 *) d[i].addr) = (u32) r;
++ break;
++ } while (TRUE);
++ }
++ kfree(pdata);
++#ifdef DEBUG_LEVEL1
++ printk(KERN_ALERT "drvdbg = 0x%x\n", drvdbg);
++ printk(KERN_ALERT "INFO (%08lx) %s\n", DBG_INFO,
++ (drvdbg & DBG_INFO) ? "X" : "");
++ printk(KERN_ALERT "WARN (%08lx) %s\n", DBG_WARN,
++ (drvdbg & DBG_WARN) ? "X" : "");
++ printk(KERN_ALERT "ENTRY (%08lx) %s\n", DBG_ENTRY,
++ (drvdbg & DBG_ENTRY) ? "X" : "");
++ printk(KERN_ALERT "CMD_D (%08lx) %s\n", DBG_CMD_D,
++ (drvdbg & DBG_CMD_D) ? "X" : "");
++ printk(KERN_ALERT "DAT_D (%08lx) %s\n", DBG_DAT_D,
++ (drvdbg & DBG_DAT_D) ? "X" : "");
++ printk(KERN_ALERT "CMND (%08lx) %s\n", DBG_CMND,
++ (drvdbg & DBG_CMND) ? "X" : "");
++ printk(KERN_ALERT "DATA (%08lx) %s\n", DBG_DATA,
++ (drvdbg & DBG_DATA) ? "X" : "");
++ printk(KERN_ALERT "ERROR (%08lx) %s\n", DBG_ERROR,
++ (drvdbg & DBG_ERROR) ? "X" : "");
++ printk(KERN_ALERT "FATAL (%08lx) %s\n", DBG_FATAL,
++ (drvdbg & DBG_FATAL) ? "X" : "");
++ printk(KERN_ALERT "MSG (%08lx) %s\n", DBG_MSG,
++ (drvdbg & DBG_MSG) ? "X" : "");
++#endif
++ MODULE_PUT;
++ return cnt;
++}
++
++static const struct file_operations uap_debug_proc_fops = {
++ .owner = THIS_MODULE,
++ .open = uap_debug_proc_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
++ .write = uap_debug_proc_write,
++};
++
++/********************************************************
++ Global Functions
++********************************************************/
++/**
++ * @brief create debug proc file
++ *
++ * @param priv pointer uap_private
++ * @param dev pointer net_device
++ * @return N/A
++ */
++void
++uap_debug_entry(uap_private * priv, struct net_device *dev)
++{
++ int i;
++
++ if (priv->proc_entry == NULL)
++ return;
++
++ for (i = 0; i < num_of_items; i++) {
++ if (items[i].flag & OFFSET_UAP_ADAPTER)
++ items[i].addr = items[i].offset + (u32) priv->adapter;
++ if (items[i].flag & OFFSET_UAP_DEV)
++ items[i].addr = items[i].offset + (u32) & priv->uap_dev;
++ }
++ proc_create_data("debug", 0644, priv->proc_entry, &uap_debug_proc_fops,
++ &items[0]);
++}
++
++/**
++ * @brief remove proc file
++ *
++ * @param priv pointer uap_private
++ * @return N/A
++ */
++void
++uap_debug_remove(uap_private * priv)
++{
++ remove_proc_entry("debug", priv->proc_entry);
++}
++
++#endif
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_drv.h backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_drv.h
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_drv.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_drv.h 2014-12-29 20:37:43.949097590 +0100
+@@ -0,0 +1,667 @@
++/** @file uap_drv.h
++ * @brief This file contains Linux OS related definitions and
++ * declarations, uAP driver
++ *
++ * Copyright (C) 2008-2009, Marvell International Ltd.
++ *
++ * This software file (the "File") is distributed by Marvell International
++ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
++ * (the "License"). You may use, redistribute and/or modify this File in
++ * accordance with the terms and conditions of the License, a copy of which
++ * is available along with the File in the gpl.txt file or by writing to
++ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
++ *
++ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
++ * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
++ * this warranty disclaimer.
++ *
++ */
++
++#ifndef _UAP_DRV_H
++#define _UAP_DRV_H
++
++/** Driver release version */
++#define DRIVER_VERSION "26146"
++
++/** True */
++#ifndef TRUE
++#define TRUE 1
++#endif
++/** False */
++#ifndef FALSE
++#define FALSE 0
++#endif
++
++/** Bit definitions */
++#ifndef BIT
++#define BIT(x) (1UL << (x))
++#endif
++
++/** Dma addresses are 32-bits wide. */
++#ifndef __ATTRIB_ALIGN__
++#define __ATTRIB_ALIGN__ __attribute__((aligned(4)))
++#endif
++
++/** attribute pack */
++#ifndef __ATTRIB_PACK__
++#define __ATTRIB_PACK__ __attribute__ ((packed))
++#endif
++
++/** Debug Macro definition*/
++#ifdef DEBUG_LEVEL1
++
++extern u32 drvdbg;
++
++/** Debug message control bit definition for drvdbg */
++/** Debug message */
++#define DBG_MSG BIT(0)
++/** Debug fatal message */
++#define DBG_FATAL BIT(1)
++/** Debug error message */
++#define DBG_ERROR BIT(2)
++/** Debug data message */
++#define DBG_DATA BIT(3)
++/** Debug command message */
++#define DBG_CMND BIT(4)
++
++/** Debug data */
++#define DBG_DAT_D BIT(16)
++/** Debug command */
++#define DBG_CMD_D BIT(17)
++
++/** Debug entry */
++#define DBG_ENTRY BIT(28)
++/** Debug warning */
++#define DBG_WARN BIT(29)
++/** Debug info */
++#define DBG_INFO BIT(30)
++
++/** Print info */
++#define PRINTM_INFO(msg...) {if (drvdbg & DBG_INFO) printk(KERN_DEBUG msg);}
++/** Print warn message */
++#define PRINTM_WARN(msg...) {if (drvdbg & DBG_WARN) printk(KERN_DEBUG msg);}
++/** Print entry */
++#define PRINTM_ENTRY(msg...) {if (drvdbg & DBG_ENTRY) printk(KERN_DEBUG msg);}
++/** Print cmd_d */
++#define PRINTM_CMD_D(msg...) {if (drvdbg & DBG_CMD_D) printk(KERN_DEBUG msg);}
++/** Print data_d */
++#define PRINTM_DAT_D(msg...) {if (drvdbg & DBG_DAT_D) printk(KERN_DEBUG msg);}
++/** Print command */
++#define PRINTM_CMND(msg...) {if (drvdbg & DBG_CMND) printk(KERN_DEBUG msg);}
++/** Print data */
++#define PRINTM_DATA(msg...) {if (drvdbg & DBG_DATA) printk(KERN_DEBUG msg);}
++/** Print error message */
++#define PRINTM_ERROR(msg...) {if (drvdbg & DBG_ERROR) printk(KERN_DEBUG msg);}
++/** Print fatal message */
++#define PRINTM_FATAL(msg...) {if (drvdbg & DBG_FATAL) printk(KERN_DEBUG msg);}
++/** Print message */
++#define PRINTM_MSG(msg...) {if (drvdbg & DBG_MSG) printk(KERN_ALERT msg);}
++/** Print level */
++#define PRINTM(level,msg...) PRINTM_##level(msg)
++
++#else
++
++#define PRINTM(level,msg...) do {} while (0)
++
++#endif /* DEBUG_LEVEL1 */
++
++/** Wait until a condition becomes true */
++#define ASSERT(cond) \
++do { \
++ if (!(cond)) \
++ PRINTM(INFO, "ASSERT: %s, %s:%i\n", \
++ __FUNCTION__, __FILE__, __LINE__); \
++} while(0)
++
++/** Log enrty point for debugging */
++#define ENTER() PRINTM(ENTRY, "Enter: %s, %s:%i\n", __FUNCTION__, \
++ __FILE__, __LINE__)
++/** Log exit point for debugging */
++#define LEAVE() PRINTM(ENTRY, "Leave: %s, %s:%i\n", __FUNCTION__, \
++ __FILE__, __LINE__)
++
++#ifdef DEBUG_LEVEL1
++/** Dump buffer length */
++#define DBG_DUMP_BUF_LEN 64
++/** Maximum dump per line */
++#define MAX_DUMP_PER_LINE 16
++/** Data dump length */
++#define DATA_DUMP_LEN 32
++
++static inline void
++hexdump(char *prompt, u8 * buf, int len)
++{
++ int i;
++ char dbgdumpbuf[DBG_DUMP_BUF_LEN];
++ char *ptr = dbgdumpbuf;
++
++ printk(KERN_DEBUG "%s:\n", prompt);
++ for (i = 1; i <= len; i++) {
++ ptr += sprintf(ptr, "%02x ", *buf);
++ buf++;
++ if (i % MAX_DUMP_PER_LINE == 0) {
++ *ptr = 0;
++ printk(KERN_DEBUG "%s\n", dbgdumpbuf);
++ ptr = dbgdumpbuf;
++ }
++ }
++ if (len % MAX_DUMP_PER_LINE) {
++ *ptr = 0;
++ printk(KERN_DEBUG "%s\n", dbgdumpbuf);
++ }
++}
++
++/** Debug command */
++#define DBG_HEXDUMP_CMD_D(x,y,z) {if (drvdbg & DBG_CMD_D) hexdump(x,y,z);}
++/** Debug data */
++#define DBG_HEXDUMP_DAT_D(x,y,z) {if (drvdbg & DBG_DAT_D) hexdump(x,y,z);}
++/** Debug hexdump */
++#define DBG_HEXDUMP(level,x,y,z) DBG_HEXDUMP_##level(x,y,z)
++/** hexdump */
++#define HEXDUMP(x,y,z) {if (drvdbg & DBG_INFO) hexdump(x,y,z);}
++#else
++/** Do nothing since debugging is not turned on */
++#define DBG_HEXDUMP(level,x,y,z) do {} while (0)
++/** Do nothing since debugging is not turned on */
++#define HEXDUMP(x,y,z) do {} while (0)
++#endif
++
++/**
++ * Typedefs
++ */
++/** Unsigned char */
++typedef u8 BOOLEAN;
++
++/*
++ * OS macro definitions
++ */
++/** OS macro to get time */
++#define os_time_get() jiffies
++
++/** OS macro to update transfer start time */
++#define UpdateTransStart(dev) { \
++ dev->trans_start = jiffies; \
++}
++
++/** Try to get a reference to the module */
++#define MODULE_GET try_module_get(THIS_MODULE)
++/** Decrease module reference count */
++#define MODULE_PUT module_put(THIS_MODULE)
++
++/** OS macro to initialize semaphore */
++#define OS_INIT_SEMAPHORE(x) sema_init(x,1)
++/** OS macro to acquire blocking semaphore */
++#define OS_ACQ_SEMAPHORE_BLOCK(x) down_interruptible(x)
++/** OS macro to acquire non-blocking semaphore */
++#define OS_ACQ_SEMAPHORE_NOBLOCK(x) down_trylock(x)
++/** OS macro to release semaphore */
++#define OS_REL_SEMAPHORE(x) up(x)
++
++static inline void
++os_sched_timeout(u32 millisec)
++{
++ set_current_state(TASK_INTERRUPTIBLE);
++ schedule_timeout((millisec * HZ) / 1000);
++}
++
++/** Maximum size of ethernet packet */
++#define MRVDRV_MAXIMUM_ETH_PACKET_SIZE 1514
++
++/** Maximum size of multicast list */
++#define MRVDRV_MAX_MULTICAST_LIST_SIZE 32
++
++/** Find minimum */
++#ifndef MIN
++#define MIN(a,b) ((a) < (b) ? (a) : (b))
++#endif
++
++/** Find maximum */
++#ifndef MAX
++#define MAX(a,b) ((a) > (b) ? (a) : (b))
++#endif
++
++/** Find number of elements */
++#ifndef NELEMENTS
++#define NELEMENTS(x) (sizeof(x)/sizeof(x[0]))
++#endif
++
++/** Buffer Constants */
++
++/** Size of command buffer */
++#define MRVDRV_SIZE_OF_CMD_BUFFER (2 * 1024)
++
++/** Length of device length */
++#define DEV_NAME_LEN 32
++
++/** Length of ethernet address */
++#ifndef ETH_ALEN
++#define ETH_ALEN 6
++#endif
++
++/** Default watchdog timeout */
++#define MRVDRV_DEFAULT_WATCHDOG_TIMEOUT (2 * HZ)
++
++/** Success */
++#define UAP_STATUS_SUCCESS (0)
++/** Failure */
++#define UAP_STATUS_FAILURE (-1)
++/** Not accepted */
++#define UAP_STATUS_NOT_ACCEPTED (-2)
++
++/** Max loop count (* 100ms) for waiting device ready at init time */
++#define MAX_WAIT_DEVICE_READY_COUNT 50
++
++/** Tx high watermark. Stop Tx queue after this is crossed */
++#define TX_HIGH_WATERMARK 4
++/** Tx low watermark. Restart Tx queue after this is crossed */
++#define TX_LOW_WATERMARK 2
++
++/** Netlink protocol number */
++#define NETLINK_MARVELL (MAX_LINKS - 1)
++/** Netlink maximum payload size */
++#define NL_MAX_PAYLOAD 1024
++/** Netlink multicast group number */
++#define NL_MULTICAST_GROUP 1
++
++/** 20 seconds */
++#define MRVDRV_TIMER_20S 20000
++
++/** Host Command option for wait till Send */
++#define HostCmd_OPTION_WAITFORSEND 0x0001
++/** Host Command option for wait for RSP */
++#define HostCmd_OPTION_WAITFORRSP 0x0002
++/** Host Command option for wait for RSP or Timeout */
++#define HostCmd_OPTION_WAITFORRSP_TIMEOUT 0x0003
++/** Host Command option for wait for RSP of sleep confirm */
++#define HostCmd_OPTION_WAITFORRSP_SLEEPCONFIRM 0x0004
++
++/** Sleep until a condition gets true or a timeout elapses */
++#define os_wait_interruptible_timeout(waitq, cond, timeout) \
++ wait_event_interruptible_timeout(waitq, cond, ((timeout) * HZ / 1000))
++
++/** Private command ID to Host command */
++#define UAPHOSTCMD (SIOCDEVPRIVATE + 1)
++
++/** Private command ID to Power Mode */
++#define UAP_POWER_MODE (SIOCDEVPRIVATE + 3)
++/** sleep_param */
++typedef struct _ps_sleep_param
++{
++ /** control bitmap */
++ u32 ctrl_bitmap;
++ /** minimum sleep period (micro second) */
++ u32 min_sleep;
++ /** maximum sleep period (micro second) */
++ u32 max_sleep;
++} ps_sleep_param;
++
++/** inactivity sleep_param */
++typedef struct _inact_sleep_param
++{
++ /** inactivity timeout (micro second) */
++ u32 inactivity_to;
++ /** miniumu awake period (micro second) */
++ u32 min_awake;
++ /** maximum awake period (micro second) */
++ u32 max_awake;
++} inact_sleep_param;
++
++/** flag for ps mode */
++#define PS_FLAG_PS_MODE 1
++/** flag for sleep param */
++#define PS_FLAG_SLEEP_PARAM 2
++/** flag for inactivity sleep param */
++#define PS_FLAG_INACT_SLEEP_PARAM 4
++
++/** Disable power mode */
++#define PS_MODE_DISABLE 0
++/** Enable periodic dtim ps */
++#define PS_MODE_PERIODIC_DTIM 1
++/** Enable inactivity ps */
++#define PS_MODE_INACTIVITY 2
++
++/** sleep parameter */
++#define SLEEP_PARAMETER 1
++/** inactivity sleep parameter */
++#define INACTIVITY_SLEEP_PARAMETER 2
++/** ps_mgmt */
++typedef struct _ps_mgmt
++{
++ /** flags for valid field */
++ u16 flags;
++ /** power mode */
++ u16 ps_mode;
++ /** sleep param */
++ ps_sleep_param sleep_param;
++ /** inactivity sleep param */
++ inact_sleep_param inact_param;
++} ps_mgmt;
++
++/** Semaphore structure */
++typedef struct semaphore SEMAPHORE;
++
++/** Global Varibale Declaration */
++/** Private data structure of the device */
++typedef struct _uap_private uap_private;
++/** Adapter data structure of the device */
++typedef struct _uap_adapter uap_adapter;
++/** private structure */
++extern uap_private *uappriv;
++
++/** ENUM definition*/
++
++/** Hardware status codes */
++typedef enum _HARDWARE_STATUS
++{
++ HWReady,
++ HWInitializing,
++ HWReset,
++ HWClosing,
++ HWNotReady
++} HARDWARE_STATUS;
++
++/** info for debug purpose */
++typedef struct _uap_dbg
++{
++ /** Number of host to card command failures */
++ u32 num_cmd_host_to_card_failure;
++ /** Number of host to card Tx failures */
++ u32 num_tx_host_to_card_failure;
++} uap_dbg;
++
++/** Set thread state */
++#define OS_SET_THREAD_STATE(x) set_current_state(x)
++
++typedef struct
++{
++ /** Task */
++ struct task_struct *task;
++ /** Queue */
++ wait_queue_head_t waitQ;
++ /** PID */
++ pid_t pid;
++ /** Private structure */
++ void *priv;
++} uap_thread;
++
++static inline void
++uap_activate_thread(uap_thread * thr)
++{
++ /** Record the thread pid */
++ thr->pid = current->pid;
++
++ /** Initialize the wait queue */
++ init_waitqueue_head(&thr->waitQ);
++}
++
++static inline void
++uap_deactivate_thread(uap_thread * thr)
++{
++ thr->pid = 0;
++ return;
++}
++
++static inline void
++uap_create_thread(int (*uapfunc) (void *), uap_thread * thr, char *name)
++{
++ thr->task = kthread_run(uapfunc, thr, "%s", name);
++}
++
++static inline int
++uap_terminate_thread(uap_thread * thr)
++{
++ /* Check if the thread is active or not */
++ if (!thr->pid)
++ return -1;
++ kthread_stop(thr->task);
++ return 0;
++}
++
++/** Data structure for the Marvell uAP device */
++typedef struct _uap_dev
++{
++ /** device name */
++ char name[DEV_NAME_LEN];
++ /** card pointer */
++ void *card;
++ /** IO port */
++ u32 ioport;
++ /** Rx unit */
++ u8 rx_unit;
++ /** Data sent:
++ TRUE - Data is sent to fw, no Tx Done received
++ FALSE - Tx done received for previous Tx */
++ BOOLEAN data_sent;
++ /** CMD sent:
++ TRUE - CMD is sent to fw, no CMD Done received
++ FALSE - CMD done received for previous CMD */
++ BOOLEAN cmd_sent;
++ /** netdev pointer */
++ struct net_device *netdev;
++} uap_dev_t, *puap_dev_t;
++
++/** Private structure for the MV device */
++struct _uap_private
++{
++ /** Device open */
++ int open;
++
++ /** Device adapter structure */
++ uap_adapter *adapter;
++ /** Device structure */
++ uap_dev_t uap_dev;
++
++ /** Net device statistics structure */
++ struct net_device_stats stats;
++
++ /** Number of Tx timeouts */
++ u32 num_tx_timeout;
++
++ /** Media connection status */
++ BOOLEAN MediaConnected;
++
++#ifdef CONFIG_PROC_FS
++ struct proc_dir_entry *proc_uap;
++ struct proc_dir_entry *proc_entry;
++#endif /* CONFIG_PROC_FS */
++
++ /** Firmware helper */
++ const struct firmware *fw_helper;
++ /** Firmware */
++ const struct firmware *firmware;
++ /** Hotplug device */
++ struct device *hotplug_device;
++ /** thread to service interrupts */
++ uap_thread MainThread;
++ /** Driver lock */
++ spinlock_t driver_lock;
++ /** Driver lock flags */
++ ulong driver_flags;
++
++};
++
++/** PS_CMD_ConfirmSleep */
++typedef struct _PS_CMD_ConfirmSleep
++{
++ /** SDIO Length */
++ u16 SDLen;
++ /** SDIO Type */
++ u16 SDType;
++ /** Command */
++ u16 Command;
++ /** Size */
++ u16 Size;
++ /** Sequence number */
++ u16 SeqNum;
++ /** Result */
++ u16 Result;
++} __ATTRIB_PACK__ PS_CMD_ConfirmSleep, *PPS_CMD_ConfirmSleep;
++
++/** Wlan Adapter data structure*/
++struct _uap_adapter
++{
++ /** Power save confirm sleep command */
++ PS_CMD_ConfirmSleep PSConfirmSleep;
++ /** Device status */
++ HARDWARE_STATUS HardwareStatus;
++ /** Interrupt counter */
++ u32 IntCounter;
++ /** Tx packet queue */
++ struct sk_buff_head tx_queue;
++ /** Cmd packet queue */
++ struct sk_buff_head cmd_queue;
++ /** Command sequence number */
++ u16 SeqNum;
++ /** Command buffer */
++ u8 *CmdBuf;
++ /** cmd pending flag */
++ u8 cmd_pending;
++ /** cmd wait option */
++ u8 cmd_wait_option;
++ /** Command buffer length */
++ u32 CmdSize;
++ /** Command wait queue */
++ wait_queue_head_t cmdwait_q __ATTRIB_ALIGN__;
++ /** Command wait queue state flag */
++ u8 CmdWaitQWoken;
++ /** PnP support */
++ BOOLEAN SurpriseRemoved;
++ /** Debug */
++ uap_dbg dbg;
++ /** Netlink kernel socket */
++ struct sock *nl_sk;
++ /** Semaphore for CMD */
++ SEMAPHORE CmdSem;
++ /** Power Save mode */
++ u8 psmode;
++ /** Power Save state */
++ u8 ps_state;
++ /** Number of wakeup tries */
++ u32 WakeupTries;
++};
++
++static inline int
++os_upload_rx_packet(uap_private * priv, struct sk_buff *skb)
++{
++ skb->dev = priv->uap_dev.netdev;
++ skb->protocol = eth_type_trans(skb, priv->uap_dev.netdev);
++ skb->ip_summed = CHECKSUM_UNNECESSARY;
++ if (in_interrupt())
++ netif_rx(skb);
++ else
++ netif_rx_ni(skb);
++ return 0;
++}
++
++/*
++ * netif carrier_on/off and start(wake)/stop_queue handling
++ */
++static inline void
++os_carrier_on(uap_private * priv)
++{
++ if (!netif_carrier_ok(priv->uap_dev.netdev) &&
++ (priv->MediaConnected == TRUE)) {
++ netif_carrier_on(priv->uap_dev.netdev);
++ }
++}
++
++static inline void
++os_carrier_off(uap_private * priv)
++{
++ if (netif_carrier_ok(priv->uap_dev.netdev)) {
++ netif_carrier_off(priv->uap_dev.netdev);
++ }
++}
++
++static inline void
++os_start_queue(uap_private * priv)
++{
++ if (netif_queue_stopped(priv->uap_dev.netdev) &&
++ (priv->MediaConnected == TRUE)) {
++ netif_wake_queue(priv->uap_dev.netdev);
++ }
++}
++
++static inline void
++os_stop_queue(uap_private * priv)
++{
++ if (!netif_queue_stopped(priv->uap_dev.netdev)) {
++ netif_stop_queue(priv->uap_dev.netdev);
++ }
++}
++
++/** Interface specific header */
++#define INTF_HEADER_LEN 4
++
++/** headroom alignment for tx packet */
++#define HEADER_ALIGNMENT 8
++
++/** The number of times to try when polling for status bits */
++#define MAX_POLL_TRIES 100
++
++/** Length of SNAP header */
++#define MRVDRV_SNAP_HEADER_LEN 8
++
++/** Extra length of Tx packet buffer */
++#define EXTRA_LEN 36
++
++/** Buffer size for ethernet Tx packets */
++#define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE \
++ (ETH_FRAME_LEN + sizeof(TxPD) + EXTRA_LEN)
++
++/** Buffer size for ethernet Rx packets */
++#define MRVDRV_ETH_RX_PACKET_BUFFER_SIZE \
++ (ETH_FRAME_LEN + sizeof(RxPD) \
++ + MRVDRV_SNAP_HEADER_LEN + EXTRA_LEN)
++
++/** Packet type: data, command & event */
++typedef enum _mv_type
++{
++ MV_TYPE_DAT = 0,
++ MV_TYPE_CMD = 1,
++ MV_TYPE_EVENT = 3
++} mv_type;
++
++/** Disable interrupt */
++#define OS_INT_DISABLE spin_lock_irqsave(&priv->driver_lock, priv->driver_flags)
++/** Enable interrupt */
++#define OS_INT_RESTORE spin_unlock_irqrestore(&priv->driver_lock, priv->driver_flags)
++
++int uap_process_rx_packet(uap_private * priv, struct sk_buff *skb);
++void uap_interrupt(uap_private * priv);
++uap_private *uap_add_card(void *card);
++int uap_remove_card(void *card);
++int uap_process_event(uap_private * priv, u8 * payload, uint len);
++int uap_soft_reset(uap_private * priv);
++int uap_process_sleep_confirm_resp(uap_private * priv, u8 * resp, int resp_len);
++
++#ifdef CONFIG_PROC_FS
++/** The proc fs interface */
++void uap_proc_entry(uap_private * priv, struct net_device *dev);
++void uap_proc_remove(uap_private * priv);
++int string_to_number(char *s);
++void uap_debug_entry(uap_private * priv, struct net_device *dev);
++void uap_debug_remove(uap_private * priv);
++#endif /* CONFIG_PROC_FS */
++
++int sbi_register(void);
++
++void sbi_unregister(void);
++int sbi_register_dev(uap_private * priv);
++int sbi_unregister_dev(uap_private * priv);
++int sbi_prog_fw_w_helper(uap_private *);
++
++int sbi_host_to_card(uap_private * priv, u8 * payload, u16 nb);
++int sbi_enable_host_int(uap_private * priv);
++int sbi_disable_host_int(uap_private * priv);
++
++int sbi_get_int_status(uap_private * priv, u8 * ireg);
++/** Check firmware status */
++int sbi_check_fw_status(uap_private *, int);
++int sbi_prog_helper(uap_private *);
++
++int sbi_wakeup_firmware(uap_private * priv);
++
++#endif /* _UAP_DRV_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_fw.h backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_fw.h
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_fw.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_fw.h 2014-12-29 20:37:43.949097590 +0100
+@@ -0,0 +1,359 @@
++/** @file uap_fw.h
++ *
++ * @brief This file contains firmware specific defines.
++ *
++ * Copyright (C) 2008-2009, Marvell International Ltd.
++ *
++ * This software file (the "File") is distributed by Marvell International
++ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
++ * (the "License"). You may use, redistribute and/or modify this File in
++ * accordance with the terms and conditions of the License, a copy of which
++ * is available along with the File in the gpl.txt file or by writing to
++ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
++ *
++ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
++ * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
++ * this warranty disclaimer.
++ *
++ */
++/********************************************************
++Change log:
++ 02/26/08: Initial creation
++********************************************************/
++
++#ifndef _UAP_FW_H
++#define _UAP_FW_H
++
++/** uap upload size */
++#define UAP_UPLD_SIZE 2312
++/** Packet type Micro AP */
++#define PKT_TYPE_MICROAP 1
++/** Packet type client */
++#define PKT_TYPE_CLIENT 0
++
++/** TxPD descriptor */
++typedef struct _TxPD
++{
++ /** Bss Type */
++ u8 BssType;
++ /** Bss num */
++ u8 BssNum;
++ /** Tx packet length */
++ u16 TxPktLength;
++ /** Tx packet offset */
++ u16 TxPktOffset;
++ /** Tx packet type */
++ u16 TxPktType;
++ /** Tx Control */
++ u32 TxControl;
++ /** reserved */
++ u32 reserved[2];
++} __ATTRIB_PACK__ TxPD, *PTxPD;
++
++/** RxPD Descriptor */
++typedef struct _RxPD
++{
++ /** Bss Type */
++ u8 BssType;
++ /** Bss Num */
++ u8 BssNum;
++ /** Tx packet length */
++ u16 RxPktLength;
++ /** Tx packet offset */
++ u16 RxPktOffset;
++} __ATTRIB_PACK__ RxPD, *PRxPD;
++
++#ifdef BIG_ENDIAN
++/** Convert from 16 bit little endian format to CPU format */
++#define uap_le16_to_cpu(x) le16_to_cpu(x)
++/** Convert from 32 bit little endian format to CPU format */
++#define uap_le32_to_cpu(x) le32_to_cpu(x)
++/** Convert from 64 bit little endian format to CPU format */
++#define uap_le64_to_cpu(x) le64_to_cpu(x)
++/** Convert to 16 bit little endian format from CPU format */
++#define uap_cpu_to_le16(x) cpu_to_le16(x)
++/** Convert to 32 bit little endian format from CPU format */
++#define uap_cpu_to_le32(x) cpu_to_le32(x)
++/** Convert to 64 bit little endian format from CPU format */
++#define uap_cpu_to_le64(x) cpu_to_le64(x)
++
++/** Convert TxPD to little endian format from CPU format */
++#define endian_convert_TxPD(x); \
++ { \
++ (x)->TxPktLength = uap_cpu_to_le16((x)->TxPktLength); \
++ (x)->TxPktOffset = uap_cpu_to_le32((x)->TxPktOffset); \
++ (x)->TxControl = uap_cpu_to_le32((x)->TxControl); \
++ (x)->TxPktType = uap_cpu_to_le32((x)->TxPktType); \
++ }
++
++/** Convert RxPD from little endian format to CPU format */
++#define endian_convert_RxPD(x); \
++ { \
++ (x)->RxPktLength = uap_le16_to_cpu((x)->RxPktLength); \
++ (x)->RxPktOffset = uap_le32_to_cpu((x)->RxPktOffset); \
++ }
++#else /* BIG_ENDIAN */
++/** Do nothing */
++#define uap_le16_to_cpu(x) x
++/** Do nothing */
++#define uap_le32_to_cpu(x) x
++/** Do nothing */
++#define uap_le64_to_cpu(x) x
++/** Do nothing */
++#define uap_cpu_to_le16(x) x
++/** Do nothing */
++#define uap_cpu_to_le32(x) x
++/** Do nothing */
++#define uap_cpu_to_le64(x) x
++
++/** Do nothing */
++#define endian_convert_TxPD(x)
++/** Do nothing */
++#define endian_convert_RxPD(x)
++#endif /* BIG_ENDIAN */
++
++/** Host Command ID : Function initialization */
++#define HostCmd_CMD_FUNC_INIT 0x00a9
++/** Host Command ID : Function shutdown */
++#define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
++
++/** Host Command id: SYS_INFO */
++#define HOST_CMD_APCMD_SYS_INFO 0x00ae
++/** Host Command id: SYS_RESET */
++#define HOST_CMD_APCMD_SYS_RESET 0x00af
++/** Host Command id: SYS_CONFIGURE */
++#define HOST_CMD_APCMD_SYS_CONFIGURE 0x00b0
++/** Host Command id: BSS_START */
++#define HOST_CMD_APCMD_BSS_START 0x00b1
++/** Host Command id: SYS_STOP */
++#define HOST_CMD_APCMD_BSS_STOP 0x00b2
++/** Host Command id: STA_LIST */
++#define HOST_CMD_APCMD_STA_LIST 0x00b3
++/** Host Command id: STA_FILTER_TABLE */
++#define HOST_CMD_APCMD_STA_FILTER_TABLE 0x00b4
++/** Host Command id: STA_DEAUTH */
++#define HOST_CMD_APCMD_STA_DEAUTH 0x00b5
++/** Host Command id: SOFT_RESET */
++#define HOST_CMD_APCMD_SOFT_RESET 0x00d5
++/** Host Command id: POWER_MGMT_EXT */
++#define HOST_CMD_POWER_MGMT_EXT 0x00ef
++/** Host Command id: SLEEP_CONFIRM*/
++#define HOST_CMD_SLEEP_CONFIRM 0x00d8
++
++/** TLV type : SSID */
++#define TLV_TYPE_SSID 0x0000
++/** TLV type : Rates */
++#define TLV_TYPE_RATES 0x0001
++/** TLV type : PHY DS */
++#define TLV_TYPE_PHY_DS 0x0003
++
++/** TLV Id : Base id */
++#define PROPRIETARY_TLV_BASE_ID 0x0100
++/** TLV Id : AP_MAC_ADDRESS */
++#define MRVL_AP_MAC_ADDRESS_TLV_ID (PROPRIETARY_TLV_BASE_ID + 43)
++/** TLV Id : Beacon period */
++#define MRVL_BEACON_PERIOD_TLV_ID (PROPRIETARY_TLV_BASE_ID + 44)
++/** TLV Id : Dtim period */
++#define MRVL_DTIM_PERIOD_TLV_ID (PROPRIETARY_TLV_BASE_ID + 45)
++/** TLV Id : Basic rates */
++#define MRVL_BASIC_RATES_TLV_ID (PROPRIETARY_TLV_BASE_ID + 46)
++/** TLV Id : Tx Power */
++#define MRVL_TX_POWER_TLV_ID (PROPRIETARY_TLV_BASE_ID + 47)
++/** TLV Id : Broadcast SSID control */
++#define MRVL_BCAST_SSID_CTL_TLV_ID (PROPRIETARY_TLV_BASE_ID + 48)
++/** TLV Id : Preamble control */
++#define MRVL_PREAMBLE_CTL_TLV_ID (PROPRIETARY_TLV_BASE_ID + 49)
++/** TLV Id : Antenna control */
++#define MRVL_ANTENNA_CTL_TLV_ID (PROPRIETARY_TLV_BASE_ID + 50)
++/** TLV Id : RTS threshold */
++#define MRVL_RTS_THRESHOLD_TLV_ID (PROPRIETARY_TLV_BASE_ID + 51)
++/** TLV Id : Radio control */
++#define MRVL_RADIO_CTL_TLV_ID (PROPRIETARY_TLV_BASE_ID + 52)
++/** TLV Id : TX data rate */
++#define MRVL_TX_DATA_RATE_TLV_ID (PROPRIETARY_TLV_BASE_ID + 53)
++/** TLV Id : Packet forward control */
++#define MRVL_PKT_FWD_CTL_TLV_ID (PROPRIETARY_TLV_BASE_ID + 54)
++/** TLV Id : STA info */
++#define MRVL_STA_INFO_TLV_ID (PROPRIETARY_TLV_BASE_ID + 55)
++/** TLV Id : STA MAC address filter */
++#define MRVL_STA_MAC_ADDR_FILTER_TLV_ID (PROPRIETARY_TLV_BASE_ID + 56)
++/** TLV Id : STA ageout timer */
++#define MRVL_STA_AGEOUT_TIMER_TLV_ID (PROPRIETARY_TLV_BASE_ID + 57)
++/** TLV Id : Security config */
++#define MRVL_SECURITY_CFG_TLV_ID (PROPRIETARY_TLV_BASE_ID + 58)
++/** TLV Id : WEP KEY */
++#define MRVL_WEP_KEY_TLV_ID (PROPRIETARY_TLV_BASE_ID + 59)
++/** TLV Id : WPA Passphrase */
++#define MRVL_WPA_PASSPHRASE_TLV_ID (PROPRIETARY_TLV_BASE_ID + 60)
++
++/** Action get */
++#define ACTION_GET 0
++/** Action set */
++#define ACTION_SET 1
++/** Length of ethernet address */
++#ifndef ETH_ALEN
++#define ETH_ALEN 6
++#endif
++
++/** HostCmd_DS_GEN */
++typedef struct
++{
++ /** Command */
++ u16 Command;
++ /** Size */
++ u16 Size;
++ /** Sequence number */
++ u16 SeqNum;
++ /** Result */
++ u16 Result;
++} __ATTRIB_PACK__ HostCmd_DS_GEN;
++
++/** Size of HostCmd_DS_GEN */
++#define S_DS_GEN sizeof(HostCmd_DS_GEN)
++
++/** _HostCmd_HEADER*/
++typedef struct
++{
++ /** Command Header : Command */
++ u16 Command;
++ /** Command Header : Size */
++ u16 Size;
++} __ATTRIB_PACK__ HostCmd_HEADER;
++
++/** HostCmd_SYS_CONFIG */
++typedef struct _HostCmd_SYS_CONFIG
++{
++ /** CMD Action GET/SET*/
++ u16 Action;
++ /** Tlv buffer */
++ u8 TlvBuffer[0];
++} __ATTRIB_PACK__ HostCmd_SYS_CONFIG;
++
++/** HostCmd_DS_POWER_MGMT_EXT */
++typedef struct _HostCmd_DS_POWER_MGMT_EXT
++{
++ /** CMD Action Get/Set*/
++ u16 action;
++ /** power mode */
++ u16 power_mode;
++} __ATTRIB_PACK__ HostCmd_DS_POWER_MGMT_EXT;
++
++/** _HostCmd_DS_COMMAND*/
++typedef struct _HostCmd_DS_COMMAND
++{
++
++ /** Command Header : Command */
++ u16 Command;
++ /** Command Header : Size */
++ u16 Size;
++ /** Command Header : Sequence number */
++ u16 SeqNum;
++ /** Command Header : Result */
++ u16 Result;
++ /** Command Body */
++ union
++ {
++ HostCmd_SYS_CONFIG sys_config;
++ HostCmd_DS_POWER_MGMT_EXT pm_cfg;
++
++ } params;
++} __ATTRIB_PACK__ HostCmd_DS_COMMAND;
++
++/** MrvlIEtypesHeader_*/
++typedef struct _MrvlIEtypesHeader
++{
++ /** Header type */
++ u16 Type;
++ /** Header length */
++ u16 Len;
++} __ATTRIB_PACK__ MrvlIEtypesHeader_t;
++
++/** MrvlIEtypes_Data_t */
++typedef struct _MrvlIEtypes_Data_t
++{
++ /** Header */
++ MrvlIEtypesHeader_t Header;
++ /** Data */
++ u8 Data[1];
++} __ATTRIB_PACK__ MrvlIEtypes_Data_t;
++
++/** MrvlIEtypes_ChanListParamSet_t */
++typedef struct _MrvlIEtypes_MacAddr_t
++{
++ /** Header */
++ MrvlIEtypesHeader_t Header;
++ /** AP MAC address */
++ u8 ApMacAddr[ETH_ALEN];
++} __ATTRIB_PACK__ MrvlIEtypes_MacAddr_t;
++
++/** Event ID: BSS started */
++#define MICRO_AP_EV_ID_BSS_START 46
++
++/** Event ID: BSS idle event */
++#define MICRO_AP_EV_BSS_IDLE 67
++
++/** Event ID: BSS active event */
++#define MICRO_AP_EV_BSS_ACTIVE 68
++
++/** Event ID: PS_AWAKE */
++#define EVENT_PS_AWAKE 0x0a
++
++/** Event ID: PS_SLEEP */
++#define EVENT_PS_SLEEP 0x0b
++
++/** PS_STATE */
++typedef enum _PS_STATE
++{
++ PS_STATE_AWAKE,
++ PS_STATE_PRE_SLEEP,
++ PS_STATE_SLEEP
++} PS_STATE;
++
++/** TLV type: AP Sleep param */
++#define TLV_TYPE_AP_SLEEP_PARAM (PROPRIETARY_TLV_BASE_ID + 106)
++/** TLV type: AP Inactivity Sleep param */
++#define TLV_TYPE_AP_INACT_SLEEP_PARAM (PROPRIETARY_TLV_BASE_ID + 107)
++
++/** MrvlIEtypes_sleep_param_t */
++typedef struct _MrvlIEtypes_sleep_param_t
++{
++ /** Header */
++ MrvlIEtypesHeader_t header;
++ /** control bitmap */
++ u32 ctrl_bitmap;
++ /** min_sleep */
++ u32 min_sleep;
++ /** max_sleep */
++ u32 max_sleep;
++} __ATTRIB_PACK__ MrvlIEtypes_sleep_param_t;
++
++/** MrvlIEtypes_inact_sleep_param_t */
++typedef struct _MrvlIEtypes_inact_sleep_param_t
++{
++ /** Header */
++ MrvlIEtypesHeader_t header;
++ /** inactivity timeout */
++ u32 inactivity_to;
++ /** min_awake */
++ u32 min_awake;
++ /** max_awake */
++ u32 max_awake;
++} __ATTRIB_PACK__ MrvlIEtypes_inact_sleep_param_t;
++
++/** AP_Event */
++typedef struct _AP_Event
++{
++ /** Event ID */
++ u32 EventId;
++ /*
++ * Reserved for STA_ASSOCIATED event and contains
++ * status information for the MIC_COUNTERMEASURES event.
++ */
++ /** Reserved/status */
++ u16 status;
++ /** AP MAC address */
++ u8 MacAddr[ETH_ALEN];
++} __ATTRIB_PACK__ AP_Event;
++#endif /* _UAP_FW_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_headers.h backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_headers.h
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_headers.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_headers.h 2014-12-29 20:37:43.949097590 +0100
+@@ -0,0 +1,64 @@
++/** @file uap_headers.h
++ *
++ * @brief This file contains all the necessary include file.
++ *
++ * Copyright (C) 2008-2009, Marvell International Ltd.
++ *
++ * This software file (the "File") is distributed by Marvell International
++ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
++ * (the "License"). You may use, redistribute and/or modify this File in
++ * accordance with the terms and conditions of the License, a copy of which
++ * is available along with the File in the gpl.txt file or by writing to
++ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
++ *
++ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
++ * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
++ * this warranty disclaimer.
++ *
++ */
++#ifndef _UAP_HEADERS_H
++#define _UAP_HEADERS_H
++
++/* Linux header files */
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/version.h>
++#include <linux/param.h>
++#include <linux/types.h>
++#include <linux/interrupt.h>
++#include <linux/proc_fs.h>
++#include <linux/kthread.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++#include <linux/semaphore.h>
++#else
++#include <asm/semaphore.h>
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
++#include <linux/config.h>
++#endif
++
++/* Net header files */
++#include <linux/netdevice.h>
++#include <linux/net.h>
++#include <linux/skbuff.h>
++#include <linux/if_ether.h>
++#include <linux/etherdevice.h>
++#include <net/sock.h>
++#include <linux/netlink.h>
++#include <linux/firmware.h>
++#include <linux/delay.h>
++
++#include "uap_drv.h"
++#include "uap_fw.h"
++
++#include <linux/mmc/sdio.h>
++#include <linux/mmc/sdio_ids.h>
++#include <linux/mmc/sdio_func.h>
++#include <linux/mmc/card.h>
++#include "uap_sdio_mmc.h"
++
++#endif /* _UAP_HEADERS_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_main.c backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_main.c
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_main.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_main.c 2014-12-29 20:37:43.952431125 +0100
+@@ -0,0 +1,1817 @@
++/** @file uap_main.c
++ * @brief This file contains the major functions in uAP
++ * driver. It includes init, exit etc..
++ * This file also contains the initialization for SW,
++ * FW and HW
++ *
++ * Copyright (C) 2008-2009, Marvell International Ltd.
++ *
++ * This software file (the "File") is distributed by Marvell International
++ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
++ * (the "License"). You may use, redistribute and/or modify this File in
++ * accordance with the terms and conditions of the License, a copy of which
++ * is available along with the File in the gpl.txt file or by writing to
++ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
++ *
++ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
++ * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
++ * this warranty disclaimer.
++ *
++ */
++/**
++ * @mainpage uAP Linux Driver
++ *
++ * @section overview_sec Overview
++ *
++ * This is Linux reference driver for Marvell uAP.
++ *
++ * @section copyright_sec Copyright
++ *
++ * Copyright (C) 2008, Marvell International Ltd.
++ *
++ */
++
++#include "uap_headers.h"
++
++/**
++ * the global variable of a pointer to uap_private
++ * structure variable
++ */
++uap_private *uappriv = NULL;
++#ifdef DEBUG_LEVEL1
++#define DEFAULT_DEBUG_MASK (DBG_MSG | DBG_FATAL | DBG_ERROR)
++u32 drvdbg = DEFAULT_DEBUG_MASK;
++#endif
++/** Helper name */
++char *helper_name = NULL;
++/** Firmware name */
++char *fw_name = NULL;
++
++/** Semaphore for add/remove card */
++SEMAPHORE AddRemoveCardSem;
++
++/********************************************************
++ Local Functions
++********************************************************/
++/**
++ * @brief This function send sleep confirm command to firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS for success otherwise UAP_STATUS_FAILURE
++ */
++static int
++uap_dnld_sleep_confirm_cmd(uap_private * priv)
++{
++ uap_adapter *Adapter = priv->adapter;
++ int ret = UAP_STATUS_SUCCESS;
++ ENTER();
++ PRINTM(CMND, "Sleep confirm\n");
++ Adapter->cmd_pending = TRUE;
++ Adapter->cmd_wait_option = HostCmd_OPTION_WAITFORRSP_SLEEPCONFIRM;
++ ret =
++ sbi_host_to_card(priv, (u8 *) & Adapter->PSConfirmSleep,
++ sizeof(PS_CMD_ConfirmSleep));
++ if (ret != UAP_STATUS_SUCCESS) {
++ Adapter->ps_state = PS_STATE_AWAKE;
++ Adapter->cmd_pending = FALSE;
++ Adapter->cmd_wait_option = FALSE;
++ }
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function process sleep confirm resp from firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @param resp A pointer to resp buf
++ * @param resp_len resp buf len
++ * @return UAP_STATUS_SUCCESS for success otherwise UAP_STATUS_FAILURE
++ */
++int
++uap_process_sleep_confirm_resp(uap_private * priv, u8 * resp, int resp_len)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ HostCmd_DS_COMMAND *cmd;
++ uap_adapter *Adapter = priv->adapter;
++ ENTER();
++ PRINTM(CMND, "Sleep confirm resp\n");
++ if (!resp_len) {
++ PRINTM(ERROR, "Cmd Size is 0\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ cmd = (HostCmd_DS_COMMAND *) resp;
++ cmd->Result = uap_le16_to_cpu(cmd->Result);
++ if (cmd->Result != UAP_STATUS_SUCCESS) {
++ PRINTM(ERROR, "HOST_CMD_APCMD_PS_SLEEP_CONFIRM fail=%x\n", cmd->Result);
++ ret = -EFAULT;
++ }
++ done:
++ if (ret == UAP_STATUS_SUCCESS)
++ Adapter->ps_state = PS_STATE_SLEEP;
++ else
++ Adapter->ps_state = PS_STATE_AWAKE;
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function checks condition and prepares to
++ * send sleep confirm command to firmware if OK.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return n/a
++ */
++static void
++uap_ps_cond_check(uap_private * priv)
++{
++ uap_adapter *Adapter = priv->adapter;
++
++ ENTER();
++ if (!priv->uap_dev.cmd_sent &&
++ !Adapter->cmd_pending && !Adapter->IntCounter) {
++ uap_dnld_sleep_confirm_cmd(priv);
++ } else {
++ PRINTM(INFO, "Delay Sleep Confirm (%s%s%s)\n",
++ (priv->uap_dev.cmd_sent) ? "D" : "",
++ (Adapter->cmd_pending) ? "C" : "",
++ (Adapter->IntCounter) ? "I" : "");
++ }
++ LEAVE();
++}
++
++/**
++ * @brief This function add cmd to cmdQ and waiting for response
++ *
++ * @param priv A pointer to uap_private structure
++ * @param skb A pointer to the skb for process
++ * @param wait_option Wait option
++ * @return UAP_STATUS_SUCCESS for success otherwise UAP_STATUS_FAILURE
++ */
++static int
++uap_process_cmd(uap_private * priv, struct sk_buff *skb, u8 wait_option)
++{
++ uap_adapter *Adapter = priv->adapter;
++ int ret = UAP_STATUS_SUCCESS;
++ HostCmd_DS_COMMAND *cmd;
++ u8 *headptr;
++ ENTER();
++ if (Adapter->HardwareStatus != HWReady) {
++ PRINTM(ERROR, "Hw not ready, uap_process_cmd\n");
++ kfree(skb);
++ LEAVE();
++ return -EFAULT;
++ }
++ skb->cb[0] = wait_option;
++ headptr = skb->data;
++ *(u16 *) & headptr[0] = uap_cpu_to_le16(skb->len);
++ *(u16 *) & headptr[2] = uap_cpu_to_le16(MV_TYPE_CMD);
++ cmd = (HostCmd_DS_COMMAND *) (skb->data + INTF_HEADER_LEN);
++ Adapter->SeqNum++;
++ cmd->SeqNum = uap_cpu_to_le16(Adapter->SeqNum);
++ PRINTM(CMND, "process_cmd: %x\n", cmd->Command);
++ DBG_HEXDUMP(CMD_D, "process_cmd", (u8 *) cmd, cmd->Size);
++ if (!wait_option) {
++ skb_queue_tail(&priv->adapter->cmd_queue, skb);
++ wake_up_interruptible(&priv->MainThread.waitQ);
++ LEAVE();
++ return ret;
++ }
++ if (OS_ACQ_SEMAPHORE_BLOCK(&Adapter->CmdSem)) {
++ PRINTM(ERROR, "Acquire semaphore error, uap_prepare_cmd\n");
++ kfree(skb);
++ LEAVE();
++ return -EBUSY;
++ }
++ skb_queue_tail(&priv->adapter->cmd_queue, skb);
++ Adapter->CmdWaitQWoken = FALSE;
++ wake_up_interruptible(&priv->MainThread.waitQ);
++ /* Sleep until response is generated by FW */
++ if (wait_option == HostCmd_OPTION_WAITFORRSP_TIMEOUT) {
++ if (!os_wait_interruptible_timeout
++ (Adapter->cmdwait_q, Adapter->CmdWaitQWoken, MRVDRV_TIMER_20S)) {
++ PRINTM(ERROR, "Cmd timeout\n");
++ Adapter->cmd_pending = FALSE;
++ ret = -EFAULT;
++ }
++ } else
++ wait_event_interruptible(Adapter->cmdwait_q, Adapter->CmdWaitQWoken);
++ OS_REL_SEMAPHORE(&Adapter->CmdSem);
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief Inspect the response buffer for pointers to expected TLVs
++ *
++ *
++ * @param pTlv Pointer to the start of the TLV buffer to parse
++ * @param tlvBufSize Size of the TLV buffer
++ * @param reqTlvType request tlv's tlvtype
++ * @param ppTlv Output parameter: Pointer to the request TLV if found
++ *
++ * @return void
++ */
++static void
++uap_get_tlv_ptrs(MrvlIEtypes_Data_t * pTlv, int tlvBufSize,
++ u16 reqTlvType, MrvlIEtypes_Data_t ** ppTlv)
++{
++ MrvlIEtypes_Data_t *pCurrentTlv;
++ int tlvBufLeft;
++ u16 tlvType;
++ u16 tlvLen;
++
++ ENTER();
++ pCurrentTlv = pTlv;
++ tlvBufLeft = tlvBufSize;
++ *ppTlv = NULL;
++ PRINTM(INFO, "uap_get_tlv: tlvBufSize = %d, reqTlvType=%x\n", tlvBufSize,
++ reqTlvType);
++ while (tlvBufLeft >= sizeof(MrvlIEtypesHeader_t)) {
++ tlvType = uap_le16_to_cpu(pCurrentTlv->Header.Type);
++ tlvLen = uap_le16_to_cpu(pCurrentTlv->Header.Len);
++ if (reqTlvType == tlvType)
++ *ppTlv = (MrvlIEtypes_Data_t *) pCurrentTlv;
++ if (*ppTlv) {
++ HEXDUMP("TLV Buf", (u8 *) * ppTlv, tlvLen);
++ break;
++ }
++ tlvBufLeft -= (sizeof(pTlv->Header) + tlvLen);
++ pCurrentTlv = (MrvlIEtypes_Data_t *) (pCurrentTlv->Data + tlvLen);
++ } /* while */
++ LEAVE();
++}
++
++/**
++ * @brief This function get mac
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS on success, otherwise failure code
++ */
++static int
++uap_get_mac_address(uap_private * priv)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u32 CmdSize;
++ HostCmd_DS_COMMAND *cmd;
++ uap_adapter *Adapter = priv->adapter;
++ struct sk_buff *skb;
++ MrvlIEtypes_MacAddr_t *pMacAddrTlv;
++ MrvlIEtypes_Data_t *pTlv;
++ u16 tlvBufSize;
++ ENTER();
++ skb = dev_alloc_skb(MRVDRV_SIZE_OF_CMD_BUFFER);
++ if (!skb) {
++ PRINTM(ERROR, "No free skb\n");
++ ret = -ENOMEM;
++ goto done;
++ }
++ CmdSize =
++ S_DS_GEN + sizeof(HostCmd_SYS_CONFIG) + sizeof(MrvlIEtypes_MacAddr_t);
++ cmd = (HostCmd_DS_COMMAND *) (skb->data + INTF_HEADER_LEN);
++ cmd->Command = uap_cpu_to_le16(HOST_CMD_APCMD_SYS_CONFIGURE);
++ cmd->Size = uap_cpu_to_le16(CmdSize);
++ cmd->params.sys_config.Action = uap_cpu_to_le16(ACTION_GET);
++ pMacAddrTlv =
++ (MrvlIEtypes_MacAddr_t *) (skb->data + INTF_HEADER_LEN + S_DS_GEN +
++ sizeof(HostCmd_SYS_CONFIG));
++ pMacAddrTlv->Header.Type = uap_cpu_to_le16(MRVL_AP_MAC_ADDRESS_TLV_ID);
++ pMacAddrTlv->Header.Len = uap_cpu_to_le16(ETH_ALEN);
++ skb_put(skb, CmdSize + INTF_HEADER_LEN);
++ if (UAP_STATUS_SUCCESS !=
++ uap_process_cmd(priv, skb, HostCmd_OPTION_WAITFORRSP_TIMEOUT)) {
++ PRINTM(ERROR, "Fail to process cmd SYS_CONFIGURE Query\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ if (!Adapter->CmdSize) {
++ PRINTM(ERROR, "Cmd Size is 0\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ cmd = (HostCmd_DS_COMMAND *) Adapter->CmdBuf;
++ cmd->Result = uap_le16_to_cpu(cmd->Result);
++ if (cmd->Result != UAP_STATUS_SUCCESS) {
++ PRINTM(ERROR, "uap_get_mac_address fail=%x\n", cmd->Result);
++ ret = -EFAULT;
++ goto done;
++ }
++ pTlv =
++ (MrvlIEtypes_Data_t *) (Adapter->CmdBuf + S_DS_GEN +
++ sizeof(HostCmd_SYS_CONFIG));
++ tlvBufSize = Adapter->CmdSize - S_DS_GEN - sizeof(HostCmd_SYS_CONFIG);
++ uap_get_tlv_ptrs(pTlv, tlvBufSize, MRVL_AP_MAC_ADDRESS_TLV_ID,
++ (MrvlIEtypes_Data_t **) & pMacAddrTlv);
++ if (pMacAddrTlv) {
++ memcpy(priv->uap_dev.netdev->dev_addr, pMacAddrTlv->ApMacAddr,
++ ETH_ALEN);
++ HEXDUMP("Original MAC addr", priv->uap_dev.netdev->dev_addr, ETH_ALEN);
++ }
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function checks the conditions and sends packet to device
++ *
++ * @param priv A pointer to uap_private structure
++ * @param skb A pointer to the skb for process
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++uap_process_tx(uap_private * priv, struct sk_buff *skb)
++{
++ uap_adapter *Adapter = priv->adapter;
++ int ret = UAP_STATUS_SUCCESS;
++ TxPD *pLocalTxPD;
++ u8 *headptr;
++ struct sk_buff *newskb;
++ int newheadlen;
++ ENTER();
++ ASSERT(skb);
++ if (!skb) {
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++ if (skb_headroom(skb) < (sizeof(TxPD) + INTF_HEADER_LEN + HEADER_ALIGNMENT)) {
++ newheadlen = sizeof(TxPD) + INTF_HEADER_LEN + HEADER_ALIGNMENT;
++ PRINTM(WARN, "Tx: Insufficient skb headroom %d\n", skb_headroom(skb));
++ /* Insufficient skb headroom - allocate a new skb */
++ newskb = skb_realloc_headroom(skb, newheadlen);
++ if (unlikely(newskb == NULL)) {
++ PRINTM(ERROR, "Tx: Cannot allocate skb\n");
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ kfree_skb(skb);
++ skb = newskb;
++ PRINTM(INFO, "new skb headroom %d\n", skb_headroom(skb));
++ }
++ /* headptr should be aligned */
++ headptr = skb->data - sizeof(TxPD) - INTF_HEADER_LEN;
++ headptr = (u8 *) ((u32) headptr & ~((u32) (HEADER_ALIGNMENT - 1)));
++
++ pLocalTxPD = (TxPD *) (headptr + INTF_HEADER_LEN);
++ memset(pLocalTxPD, 0, sizeof(TxPD));
++ pLocalTxPD->BssType = PKT_TYPE_MICROAP;
++ pLocalTxPD->TxPktLength = skb->len;
++ /* offset of actual data */
++ pLocalTxPD->TxPktOffset = (long) skb->data - (long) pLocalTxPD;
++ endian_convert_TxPD(pLocalTxPD);
++ *(u16 *) & headptr[0] =
++ uap_cpu_to_le16(skb->len + ((long) skb->data - (long) headptr));
++ *(u16 *) & headptr[2] = uap_cpu_to_le16(MV_TYPE_DAT);
++ ret =
++ sbi_host_to_card(priv, headptr,
++ skb->len + ((long) skb->data - (long) headptr));
++ if (ret) {
++ PRINTM(ERROR, "uap_process_tx Error: sbi_host_to_card failed: 0x%X\n",
++ ret);
++ Adapter->dbg.num_tx_host_to_card_failure++;
++ goto done;
++ }
++ PRINTM(DATA, "Data => FW\n");
++ DBG_HEXDUMP(DAT_D, "Tx", headptr,
++ MIN(skb->len + sizeof(TxPD), DATA_DUMP_LEN));
++ done:
++ /* Freed skb */
++ kfree_skb(skb);
++ LEAVE();
++ return ret;
++}
++
++static struct netlink_kernel_cfg cfg = {
++ .groups = NL_MULTICAST_GROUP,
++};
++
++/**
++ * @brief This function initializes the adapter structure
++ * and set default value to the member of adapter.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++uap_init_sw(uap_private * priv)
++{
++ uap_adapter *Adapter = priv->adapter;
++
++ ENTER();
++
++ if (!(Adapter->CmdBuf = kmalloc(MRVDRV_SIZE_OF_CMD_BUFFER, GFP_KERNEL))) {
++ PRINTM(INFO, "Failed to allocate command buffer!\n");
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++
++ Adapter->cmd_pending = FALSE;
++ Adapter->CmdWaitQWoken = FALSE;
++ Adapter->ps_state = PS_STATE_AWAKE;
++ Adapter->WakeupTries = 0;
++
++ memset(&Adapter->PSConfirmSleep, 0, sizeof(PS_CMD_ConfirmSleep));
++ /** SDIO header */
++ Adapter->PSConfirmSleep.SDLen =
++ uap_cpu_to_le16(sizeof(PS_CMD_ConfirmSleep));
++ Adapter->PSConfirmSleep.SDType = uap_cpu_to_le16(MV_TYPE_CMD);
++ Adapter->PSConfirmSleep.SeqNum = 0;
++ Adapter->PSConfirmSleep.Command = uap_cpu_to_le16(HOST_CMD_SLEEP_CONFIRM);
++ Adapter->PSConfirmSleep.Size = uap_cpu_to_le16(sizeof(HostCmd_DS_GEN));
++ Adapter->PSConfirmSleep.Result = 0;
++
++ init_waitqueue_head(&Adapter->cmdwait_q);
++ OS_INIT_SEMAPHORE(&Adapter->CmdSem);
++
++ skb_queue_head_init(&Adapter->tx_queue);
++ skb_queue_head_init(&Adapter->cmd_queue);
++
++ /* Status variable */
++ Adapter->HardwareStatus = HWInitializing;
++
++ /* PnP support */
++ Adapter->SurpriseRemoved = FALSE;
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
++ Adapter->nl_sk = netlink_kernel_create(NETLINK_MARVELL,
++ NL_MULTICAST_GROUP, NULL,
++ THIS_MODULE);
++#else
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
++ Adapter->nl_sk = netlink_kernel_create(NETLINK_MARVELL,
++ NL_MULTICAST_GROUP, NULL, NULL,
++ THIS_MODULE);
++#else
++ Adapter->nl_sk = netlink_kernel_create(&init_net, NETLINK_MARVELL, &cfg);
++#endif
++#endif
++ if (!Adapter->nl_sk) {
++ PRINTM(ERROR,
++ "Could not initialize netlink event passing mechanism!\n");
++ }
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++
++/**
++ * @brief This function sends FUNC_INIT command to firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS on success, otherwise failure code
++ */
++static int
++uap_func_init(uap_private * priv)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u32 CmdSize;
++ HostCmd_DS_GEN *cmd;
++ uap_adapter *Adapter = priv->adapter;
++ struct sk_buff *skb;
++ ENTER();
++ if (Adapter->HardwareStatus != HWReady) {
++ PRINTM(ERROR, "uap_func_init:Hardware is not ready!\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ skb = dev_alloc_skb(MRVDRV_SIZE_OF_CMD_BUFFER);
++ if (!skb) {
++ PRINTM(ERROR, "No free skb\n");
++ ret = -ENOMEM;
++ goto done;
++ }
++ CmdSize = sizeof(HostCmd_DS_GEN);
++ cmd = (HostCmd_DS_GEN *) (skb->data + INTF_HEADER_LEN);
++ cmd->Command = uap_cpu_to_le16(HostCmd_CMD_FUNC_INIT);
++ cmd->Size = uap_cpu_to_le16(CmdSize);
++ skb_put(skb, CmdSize + INTF_HEADER_LEN);
++ PRINTM(CMND, "HostCmd_CMD_FUNC_INIT\n");
++ if (UAP_STATUS_SUCCESS !=
++ uap_process_cmd(priv, skb, HostCmd_OPTION_WAITFORRSP_TIMEOUT)) {
++ PRINTM(ERROR, "Fail to process cmd HostCmd_CMD_FUNC_INIT\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function sends FUNC_SHUTDOWN command to firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS on success, otherwise failure code
++ */
++static int __exit
++uap_func_shutdown(uap_private * priv)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u32 CmdSize;
++ HostCmd_DS_GEN *cmd;
++ uap_adapter *Adapter = priv->adapter;
++ struct sk_buff *skb;
++ ENTER();
++ if (Adapter->HardwareStatus != HWReady) {
++ PRINTM(ERROR, "uap_func_shutdown:Hardware is not ready!\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ skb = dev_alloc_skb(MRVDRV_SIZE_OF_CMD_BUFFER);
++ if (!skb) {
++ PRINTM(ERROR, "No free skb\n");
++ ret = -ENOMEM;
++ goto done;
++ }
++ CmdSize = sizeof(HostCmd_DS_GEN);
++ cmd = (HostCmd_DS_GEN *) (skb->data + INTF_HEADER_LEN);
++ cmd->Command = uap_cpu_to_le16(HostCmd_CMD_FUNC_SHUTDOWN);
++ cmd->Size = uap_cpu_to_le16(CmdSize);
++ skb_put(skb, CmdSize + INTF_HEADER_LEN);
++ PRINTM(CMND, "HostCmd_CMD_FUNC_SHUTDOWN\n");
++ if (UAP_STATUS_SUCCESS !=
++ uap_process_cmd(priv, skb, HostCmd_OPTION_WAITFORRSP_TIMEOUT)) {
++ PRINTM(ERROR, "Fail to process cmd HostCmd_CMD_FUNC_SHUTDOWN\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function initializes firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++uap_init_fw(uap_private * priv)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ ENTER();
++ sbi_disable_host_int(priv);
++ /* Check if firmware is already running */
++ if (sbi_check_fw_status(priv, 1) == UAP_STATUS_SUCCESS) {
++ PRINTM(MSG, "UAP FW already running! Skip FW download\n");
++ } else {
++ if ((ret = request_firmware(&priv->fw_helper, helper_name,
++ priv->hotplug_device)) < 0) {
++ PRINTM(FATAL,
++ "request_firmware() failed (helper), error code = %#x\n",
++ ret);
++ goto done;
++ }
++
++ /* Download the helper */
++ ret = sbi_prog_helper(priv);
++
++ if (ret) {
++ PRINTM(FATAL,
++ "Bootloader in invalid state! Helper download failed!\n");
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ if ((ret = request_firmware(&priv->firmware, fw_name,
++ priv->hotplug_device)) < 0) {
++ PRINTM(FATAL, "request_firmware() failed, error code = %#x\n", ret);
++ goto done;
++ }
++
++ /* Download the main firmware via the helper firmware */
++ if (sbi_prog_fw_w_helper(priv)) {
++ PRINTM(FATAL, "UAP FW download failed!\n");
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ /* Check if the firmware is downloaded successfully or not */
++ if (sbi_check_fw_status(priv, MAX_FIRMWARE_POLL_TRIES) ==
++ UAP_STATUS_FAILURE) {
++ PRINTM(FATAL, "FW failed to be active in time!\n");
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ PRINTM(MSG, "UAP FW is active\n");
++ }
++ sbi_enable_host_int(priv);
++ priv->adapter->HardwareStatus = HWReady;
++ if (uap_func_init(priv) != UAP_STATUS_SUCCESS) {
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ done:
++ if (priv->fw_helper)
++ release_firmware(priv->fw_helper);
++ if (priv->firmware)
++ release_firmware(priv->firmware);
++ LEAVE();
++ return ret;
++
++}
++
++/**
++ * @brief This function frees the structure of adapter
++ *
++ * @param priv A pointer to uap_private structure
++ * @return n/a
++ */
++static void
++uap_free_adapter(uap_private * priv)
++{
++ uap_adapter *Adapter = priv->adapter;
++
++ ENTER();
++
++ if (Adapter) {
++ if ((Adapter->nl_sk) && ((Adapter->nl_sk)->sk_socket)) {
++ sock_release((Adapter->nl_sk)->sk_socket);
++ Adapter->nl_sk = NULL;
++ }
++ if (Adapter->CmdBuf)
++ kfree(Adapter->CmdBuf);
++ skb_queue_purge(&priv->adapter->tx_queue);
++ skb_queue_purge(&priv->adapter->cmd_queue);
++ /* Free the adapter object itself */
++ kfree(Adapter);
++ priv->adapter = NULL;
++ }
++
++ LEAVE();
++}
++
++/**
++ * @brief This function handles the major job in uap driver.
++ * it handles the event generated by firmware, rx data received
++ * from firmware and tx data sent from kernel.
++ *
++ * @param data A pointer to uap_thread structure
++ * @return BT_STATUS_SUCCESS
++ */
++static int
++uap_service_main_thread(void *data)
++{
++ uap_thread *thread = data;
++ uap_private *priv = thread->priv;
++ uap_adapter *Adapter = priv->adapter;
++ wait_queue_t wait;
++ u8 ireg = 0;
++ struct sk_buff *skb;
++ ENTER();
++ uap_activate_thread(thread);
++ init_waitqueue_entry(&wait, current);
++ current->flags |= PF_NOFREEZE;
++
++ for (;;) {
++ add_wait_queue(&thread->waitQ, &wait);
++ OS_SET_THREAD_STATE(TASK_INTERRUPTIBLE);
++ if ((Adapter->WakeupTries) ||
++ (!Adapter->IntCounter && Adapter->ps_state == PS_STATE_PRE_SLEEP) ||
++ (!priv->adapter->IntCounter
++ && (priv->uap_dev.data_sent ||
++ skb_queue_empty(&priv->adapter->tx_queue))
++ && (priv->uap_dev.cmd_sent || Adapter->cmd_pending ||
++ skb_queue_empty(&priv->adapter->cmd_queue))
++ )) {
++ PRINTM(INFO, "Main: Thread sleeping...\n");
++ schedule();
++ }
++ OS_SET_THREAD_STATE(TASK_RUNNING);
++ remove_wait_queue(&thread->waitQ, &wait);
++ if (kthread_should_stop() || Adapter->SurpriseRemoved) {
++ PRINTM(INFO, "main-thread: break from main thread: "
++ "SurpriseRemoved=0x%x\n", Adapter->SurpriseRemoved);
++ /* Cancel pending command */
++ if (Adapter->cmd_pending == TRUE) {
++ /* Wake up cmd Q */
++ Adapter->CmdWaitQWoken = TRUE;
++ wake_up_interruptible(&Adapter->cmdwait_q);
++ }
++ break;
++ }
++
++ PRINTM(INFO, "Main: Thread waking up...\n");
++ if (priv->adapter->IntCounter) {
++ OS_INT_DISABLE;
++ Adapter->IntCounter = 0;
++ OS_INT_RESTORE;
++ sbi_get_int_status(priv, &ireg);
++ } else if ((priv->adapter->ps_state == PS_STATE_SLEEP) &&
++ (!skb_queue_empty(&priv->adapter->cmd_queue) ||
++ !skb_queue_empty(&priv->adapter->tx_queue))) {
++ priv->adapter->WakeupTries++;
++ PRINTM(CMND, "%lu : Wakeup device...\n", os_time_get());
++ sbi_wakeup_firmware(priv);
++ continue;
++ }
++ if (Adapter->ps_state == PS_STATE_PRE_SLEEP)
++ uap_ps_cond_check(priv);
++
++ /* The PS state is changed during processing of Sleep Request event
++ above */
++ if ((Adapter->ps_state == PS_STATE_SLEEP) ||
++ (Adapter->ps_state == PS_STATE_PRE_SLEEP))
++ continue;
++ /* Execute the next command */
++ if (!priv->uap_dev.cmd_sent && !Adapter->cmd_pending &&
++ (Adapter->HardwareStatus == HWReady)) {
++ if (!skb_queue_empty(&priv->adapter->cmd_queue)) {
++ skb = skb_dequeue(&priv->adapter->cmd_queue);
++ if (skb) {
++ Adapter->CmdSize = 0;
++ Adapter->cmd_pending = TRUE;
++ Adapter->cmd_wait_option = skb->cb[0];
++ if (sbi_host_to_card(priv, skb->data, skb->len)) {
++ PRINTM(ERROR, "Cmd:sbi_host_to_card failed!\n");
++ Adapter->cmd_pending = FALSE;
++ Adapter->dbg.num_cmd_host_to_card_failure++;
++ /* Wake up cmd Q */
++ Adapter->CmdWaitQWoken = TRUE;
++ wake_up_interruptible(&Adapter->cmdwait_q);
++ } else {
++ if (Adapter->cmd_wait_option ==
++ HostCmd_OPTION_WAITFORSEND) {
++ /* Wake up cmd Q */
++ Adapter->CmdWaitQWoken = TRUE;
++ wake_up_interruptible(&Adapter->cmdwait_q);
++ Adapter->cmd_wait_option = FALSE;
++ }
++ }
++ kfree_skb(skb);
++ }
++ }
++ }
++ if (!priv->uap_dev.data_sent && (Adapter->HardwareStatus == HWReady)) {
++ if (!skb_queue_empty(&priv->adapter->tx_queue)) {
++ skb = skb_dequeue(&priv->adapter->tx_queue);
++ if (skb) {
++ if (uap_process_tx(priv, skb)) {
++ priv->stats.tx_dropped++;
++ priv->stats.tx_errors++;
++ os_start_queue(priv);
++ } else {
++ priv->stats.tx_packets++;
++ priv->stats.tx_bytes += skb->len;
++ }
++
++ }
++ }
++ }
++ }
++ uap_deactivate_thread(thread);
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++
++/**
++ * @brief uap hostcmd ioctl handler
++ *
++ * @param dev A pointer to net_device structure
++ * @param req A pointer to ifreq structure
++ * @return UAP_STATUS_SUCCESS --success, otherwise fail
++ */
++/********* format of ifr_data *************/
++/* buf_len + Hostcmd_body */
++/* buf_len: 4 bytes */
++/* the length of the buf which */
++/* can be used to return data */
++/* to application */
++/* Hostcmd_body */
++/*******************************************/
++static int
++uap_hostcmd_ioctl(struct net_device *dev, struct ifreq *req)
++{
++ u32 buf_len;
++ HostCmd_HEADER head;
++ uap_private *priv = (uap_private *) netdev_priv(dev);
++ uap_adapter *Adapter = priv->adapter;
++ int ret = UAP_STATUS_SUCCESS;
++ struct sk_buff *skb;
++
++ ENTER();
++
++ /* Sanity check */
++ if (req->ifr_data == NULL) {
++ PRINTM(ERROR, "uap_hostcmd_ioctl() corrupt data\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ if (copy_from_user(&buf_len, req->ifr_data, sizeof(buf_len))) {
++ PRINTM(ERROR, "Copy from user failed\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ memset(&head, 0, sizeof(HostCmd_HEADER));
++ /* Get the command size from user space */
++ if (copy_from_user
++ (&head, req->ifr_data + sizeof(buf_len), sizeof(HostCmd_HEADER))) {
++ PRINTM(ERROR, "Copy from user failed\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ head.Size = uap_le16_to_cpu(head.Size);
++ if (head.Size > MRVDRV_SIZE_OF_CMD_BUFFER) {
++ PRINTM(ERROR, "CmdSize too big=%d\n", head.Size);
++ LEAVE();
++ return -EFAULT;
++ }
++ PRINTM(CMND, "ioctl: hostcmd=%x, size=%d,buf_len=%d\n", head.Command,
++ head.Size, buf_len);
++ skb = dev_alloc_skb(head.Size + INTF_HEADER_LEN);
++ if (!skb) {
++ PRINTM(ERROR, "No free skb\n");
++ LEAVE();
++ return -ENOMEM;
++ }
++
++ /* Get the command from user space */
++ if (copy_from_user
++ (skb->data + INTF_HEADER_LEN, req->ifr_data + sizeof(buf_len),
++ head.Size)) {
++ PRINTM(ERROR, "Copy from user failed\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ skb_put(skb, head.Size + INTF_HEADER_LEN);
++ if (UAP_STATUS_SUCCESS !=
++ uap_process_cmd(priv, skb, HostCmd_OPTION_WAITFORRSP)) {
++ PRINTM(ERROR, "Fail to process cmd\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ if (!Adapter->CmdSize) {
++ PRINTM(ERROR, "Cmd Size is 0\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ if (Adapter->CmdSize > buf_len) {
++ PRINTM(ERROR, "buf_len is too small\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ /* Copy to user */
++ if (copy_to_user
++ (req->ifr_data + sizeof(buf_len), Adapter->CmdBuf, Adapter->CmdSize)) {
++ PRINTM(ERROR, "Copy to user failed!\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief uap power mode ioctl handler
++ *
++ * @param dev A pointer to net_device structure
++ * @param req A pointer to ifreq structure
++ * @return UAP_STATUS_SUCCESS --success, otherwise fail
++ */
++static int
++uap_power_mode_ioctl(struct net_device *dev, struct ifreq *req)
++{
++ ps_mgmt pm_cfg;
++ int ret = UAP_STATUS_SUCCESS;
++ uap_private *priv = (uap_private *) netdev_priv(dev);
++ uap_adapter *Adapter = priv->adapter;
++ struct sk_buff *skb = NULL;
++ HostCmd_DS_COMMAND *cmd;
++ u32 CmdSize;
++ u8 *tlv = NULL;
++ MrvlIEtypes_sleep_param_t *sleep_tlv = NULL;
++ MrvlIEtypes_inact_sleep_param_t *inact_tlv = NULL;
++ u16 tlv_buf_left = 0;
++ MrvlIEtypesHeader_t *tlvbuf = NULL;
++ u16 tlv_type = 0;
++ u16 tlv_len = 0;
++
++ ENTER();
++
++ /* Sanity check */
++ if (req->ifr_data == NULL) {
++ PRINTM(ERROR, "uap_power_mode_ioctl() corrupt data\n");
++ LEAVE();
++ return -EFAULT;
++ }
++
++ memset(&pm_cfg, 0, sizeof(ps_mgmt));
++ if (copy_from_user(&pm_cfg, req->ifr_data, sizeof(ps_mgmt))) {
++ PRINTM(ERROR, "Copy from user failed\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ PRINTM(CMND,
++ "ioctl power: flag=0x%x ps_mode=%d ctrl_bitmap=%d min_sleep=%d max_sleep=%d "
++ "inact_to=%d min_awake=%d max_awake=%d\n", pm_cfg.flags,
++ (int) pm_cfg.ps_mode, (int) pm_cfg.sleep_param.ctrl_bitmap,
++ (int) pm_cfg.sleep_param.min_sleep,
++ (int) pm_cfg.sleep_param.max_sleep,
++ (int) pm_cfg.inact_param.inactivity_to,
++ (int) pm_cfg.inact_param.min_awake,
++ (int) pm_cfg.inact_param.max_awake);
++
++ if (pm_cfg.
++ flags & ~(PS_FLAG_PS_MODE | PS_FLAG_SLEEP_PARAM |
++ PS_FLAG_INACT_SLEEP_PARAM)) {
++ PRINTM(ERROR, "Invalid parameter: flags = 0x%x\n", pm_cfg.flags);
++ ret = -EINVAL;
++ goto done;
++ }
++ if (pm_cfg.ps_mode > PS_MODE_INACTIVITY) {
++ PRINTM(ERROR, "Invalid parameter: ps_mode = %d\n", (int) pm_cfg.flags);
++ ret = -EINVAL;
++ goto done;
++ }
++
++ skb = dev_alloc_skb(MRVDRV_SIZE_OF_CMD_BUFFER);
++ if (!skb) {
++ PRINTM(INFO, "No free skb\n");
++ ret = -ENOMEM;
++ goto done;
++ }
++
++ CmdSize = S_DS_GEN + sizeof(HostCmd_DS_POWER_MGMT_EXT);
++
++ cmd = (HostCmd_DS_COMMAND *) (skb->data + INTF_HEADER_LEN);
++ cmd->Command = uap_cpu_to_le16(HOST_CMD_POWER_MGMT_EXT);
++ if (!pm_cfg.flags) {
++ cmd->params.pm_cfg.action = uap_cpu_to_le16(ACTION_GET);
++ } else {
++ cmd->params.pm_cfg.action = uap_cpu_to_le16(ACTION_SET);
++ cmd->params.pm_cfg.power_mode = uap_cpu_to_le16(pm_cfg.ps_mode);
++ tlv = (u8 *) & cmd->params.pm_cfg + sizeof(HostCmd_DS_POWER_MGMT_EXT);
++
++ if ((pm_cfg.ps_mode) && (pm_cfg.flags & PS_FLAG_SLEEP_PARAM)) {
++ sleep_tlv = (MrvlIEtypes_sleep_param_t *) tlv;
++ sleep_tlv->header.Type = uap_cpu_to_le16(TLV_TYPE_AP_SLEEP_PARAM);
++ sleep_tlv->header.Len =
++ uap_cpu_to_le16(sizeof(MrvlIEtypes_sleep_param_t) -
++ sizeof(MrvlIEtypesHeader_t));
++ sleep_tlv->ctrl_bitmap =
++ uap_cpu_to_le32(pm_cfg.sleep_param.ctrl_bitmap);
++ sleep_tlv->min_sleep =
++ uap_cpu_to_le32(pm_cfg.sleep_param.min_sleep);
++ sleep_tlv->max_sleep =
++ uap_cpu_to_le32(pm_cfg.sleep_param.max_sleep);
++ CmdSize += sizeof(MrvlIEtypes_sleep_param_t);
++ tlv += sizeof(MrvlIEtypes_sleep_param_t);
++ }
++ if ((pm_cfg.ps_mode == PS_MODE_INACTIVITY) &&
++ (pm_cfg.flags & PS_FLAG_INACT_SLEEP_PARAM)) {
++ inact_tlv = (MrvlIEtypes_inact_sleep_param_t *) tlv;
++ inact_tlv->header.Type =
++ uap_cpu_to_le16(TLV_TYPE_AP_INACT_SLEEP_PARAM);
++ inact_tlv->header.Len =
++ uap_cpu_to_le16(sizeof(MrvlIEtypes_inact_sleep_param_t) -
++ sizeof(MrvlIEtypesHeader_t));
++ inact_tlv->inactivity_to =
++ uap_cpu_to_le32(pm_cfg.inact_param.inactivity_to);
++ inact_tlv->min_awake =
++ uap_cpu_to_le32(pm_cfg.inact_param.min_awake);
++ inact_tlv->max_awake =
++ uap_cpu_to_le32(pm_cfg.inact_param.max_awake);
++ CmdSize += sizeof(MrvlIEtypes_inact_sleep_param_t);
++ tlv += sizeof(MrvlIEtypes_inact_sleep_param_t);
++ }
++ }
++ cmd->Size = uap_cpu_to_le16(CmdSize);
++ skb_put(skb, CmdSize + INTF_HEADER_LEN);
++ if (UAP_STATUS_SUCCESS !=
++ uap_process_cmd(priv, skb, HostCmd_OPTION_WAITFORRSP)) {
++ PRINTM(ERROR, "Fail to process cmd POWER_MODE\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ if (!Adapter->CmdSize) {
++ PRINTM(ERROR, "Cmd Size is 0\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ cmd = (HostCmd_DS_COMMAND *) Adapter->CmdBuf;
++ cmd->Result = uap_le16_to_cpu(cmd->Result);
++ if (cmd->Result != UAP_STATUS_SUCCESS) {
++ PRINTM(ERROR, "HOST_CMD_APCMD_POWER_MODE fail=%x\n", cmd->Result);
++ ret = -EFAULT;
++ goto done;
++ }
++ if (pm_cfg.flags) {
++ Adapter->psmode = uap_le16_to_cpu(cmd->params.pm_cfg.power_mode);
++ } else {
++ pm_cfg.flags = PS_FLAG_PS_MODE;
++ pm_cfg.ps_mode = uap_le16_to_cpu(cmd->params.pm_cfg.power_mode);
++ tlv_buf_left =
++ cmd->Size - (sizeof(HostCmd_DS_POWER_MGMT_EXT) + S_DS_GEN);
++ tlvbuf =
++ (MrvlIEtypesHeader_t *) ((u8 *) & cmd->params.pm_cfg +
++ sizeof(HostCmd_DS_POWER_MGMT_EXT));
++ while (tlv_buf_left >= sizeof(MrvlIEtypesHeader_t)) {
++ tlv_type = uap_le16_to_cpu(tlvbuf->Type);
++ tlv_len = uap_le16_to_cpu(tlvbuf->Len);
++ switch (tlv_type) {
++ case TLV_TYPE_AP_SLEEP_PARAM:
++ sleep_tlv = (MrvlIEtypes_sleep_param_t *) tlvbuf;
++ pm_cfg.flags |= PS_FLAG_SLEEP_PARAM;
++ pm_cfg.sleep_param.ctrl_bitmap =
++ uap_le32_to_cpu(sleep_tlv->ctrl_bitmap);
++ pm_cfg.sleep_param.min_sleep =
++ uap_le32_to_cpu(sleep_tlv->min_sleep);
++ pm_cfg.sleep_param.max_sleep =
++ uap_le32_to_cpu(sleep_tlv->max_sleep);
++ break;
++ case TLV_TYPE_AP_INACT_SLEEP_PARAM:
++ inact_tlv = (MrvlIEtypes_inact_sleep_param_t *) tlvbuf;
++ pm_cfg.flags |= PS_FLAG_INACT_SLEEP_PARAM;
++ pm_cfg.inact_param.inactivity_to =
++ uap_le32_to_cpu(inact_tlv->inactivity_to);
++ pm_cfg.inact_param.min_awake =
++ uap_le32_to_cpu(inact_tlv->min_awake);
++ pm_cfg.inact_param.max_awake =
++ uap_le32_to_cpu(inact_tlv->max_awake);
++ break;
++ }
++ tlv_buf_left -= tlv_len + sizeof(MrvlIEtypesHeader_t);
++ tlvbuf =
++ (MrvlIEtypesHeader_t *) ((u8 *) tlvbuf + tlv_len +
++ sizeof(MrvlIEtypesHeader_t));
++ }
++ /* Copy to user */
++ if (copy_to_user(req->ifr_data, &pm_cfg, sizeof(ps_mgmt))) {
++ PRINTM(ERROR, "Copy to user failed!\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ }
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function send bss_stop command to firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS on success, otherwise failure code
++ */
++static int
++uap_bss_stop(uap_private * priv)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u32 CmdSize;
++ HostCmd_DS_GEN *cmd;
++ uap_adapter *Adapter = priv->adapter;
++ struct sk_buff *skb;
++ ENTER();
++ if (Adapter->HardwareStatus != HWReady) {
++ PRINTM(ERROR, "uap_bss_stop:Hardware is not ready!\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ skb = dev_alloc_skb(MRVDRV_SIZE_OF_CMD_BUFFER);
++ if (!skb) {
++ PRINTM(ERROR, "No free skb\n");
++ ret = -ENOMEM;
++ goto done;
++ }
++ CmdSize = sizeof(HostCmd_DS_GEN);
++ cmd = (HostCmd_DS_GEN *) (skb->data + INTF_HEADER_LEN);
++ cmd->Command = uap_cpu_to_le16(HOST_CMD_APCMD_BSS_STOP);
++ cmd->Size = uap_cpu_to_le16(CmdSize);
++ skb_put(skb, CmdSize + INTF_HEADER_LEN);
++ PRINTM(CMND, "APCMD_BSS_STOP\n");
++ if (UAP_STATUS_SUCCESS !=
++ uap_process_cmd(priv, skb, HostCmd_OPTION_WAITFORRSP_TIMEOUT)) {
++ PRINTM(ERROR, "Fail to process cmd BSS_STOP\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ done:
++ LEAVE();
++ return ret;
++}
++
++/********************************************************
++ Global Functions
++********************************************************/
++/**
++ * @brief This function send soft_reset command to firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS on success, otherwise failure code
++ */
++int
++uap_soft_reset(uap_private * priv)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u32 CmdSize;
++ HostCmd_DS_GEN *cmd;
++ uap_adapter *Adapter = priv->adapter;
++ struct sk_buff *skb;
++ ENTER();
++ ret = uap_bss_stop(priv);
++ if (ret != UAP_STATUS_SUCCESS)
++ goto done;
++ skb = dev_alloc_skb(MRVDRV_SIZE_OF_CMD_BUFFER);
++ if (!skb) {
++ PRINTM(ERROR, "No free skb\n");
++ ret = -ENOMEM;
++ goto done;
++ }
++ CmdSize = sizeof(HostCmd_DS_GEN);
++ cmd = (HostCmd_DS_GEN *) (skb->data + INTF_HEADER_LEN);
++ cmd->Command = uap_cpu_to_le16(HOST_CMD_APCMD_SOFT_RESET);
++ cmd->Size = uap_cpu_to_le16(CmdSize);
++ skb_put(skb, CmdSize + INTF_HEADER_LEN);
++ PRINTM(CMND, "APCMD_SOFT_RESET\n");
++ if (UAP_STATUS_SUCCESS !=
++ uap_process_cmd(priv, skb, HostCmd_OPTION_WAITFORSEND)) {
++ PRINTM(ERROR, "Fail to process cmd SOFT_RESET\n");
++ ret = -EFAULT;
++ goto done;
++ }
++ Adapter->SurpriseRemoved = TRUE;
++ /* delay to allow hardware complete reset */
++ os_sched_timeout(5);
++ if (priv->MediaConnected == TRUE) {
++ os_stop_queue(priv);
++ os_carrier_off(priv);
++ priv->MediaConnected = FALSE;
++ }
++ Adapter->CmdSize = 0;
++ Adapter->CmdWaitQWoken = TRUE;
++ wake_up_interruptible(&Adapter->cmdwait_q);
++ skb_queue_purge(&priv->adapter->tx_queue);
++ skb_queue_purge(&priv->adapter->cmd_queue);
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function processes received packet and forwards it
++ * to kernel/upper layer
++ *
++ * @param priv A pointer to uap_private
++ * @param skb A pointer to skb which includes the received packet
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++uap_process_rx_packet(uap_private * priv, struct sk_buff *skb)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ RxPD *pRxPD;
++ ENTER();
++ priv->adapter->ps_state = PS_STATE_AWAKE;
++ pRxPD = (RxPD *) skb->data;
++ endian_convert_RxPD(pRxPD);
++ DBG_HEXDUMP(DAT_D, "Rx", skb->data, MIN(skb->len, DATA_DUMP_LEN));
++ skb_pull(skb, pRxPD->RxPktOffset);
++ priv->stats.rx_packets++;
++ priv->stats.rx_bytes += skb->len;
++ os_upload_rx_packet(priv, skb);
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function opens the network device
++ *
++ * @param dev A pointer to net_device structure
++ * @return UAP_STATUS_SUCCESS
++ */
++static int
++uap_open(struct net_device *dev)
++{
++ uap_private *priv = (uap_private *) (uap_private *) netdev_priv(dev);
++ uap_adapter *Adapter = priv->adapter;
++ int i = 0;
++
++ ENTER();
++
++ /* On some systems the device open handler will be called before HW ready. */
++ /* Use the following flag check and wait function to work around the issue. */
++ while ((Adapter->HardwareStatus != HWReady) &&
++ (i < MAX_WAIT_DEVICE_READY_COUNT)) {
++ i++;
++ os_sched_timeout(100);
++ }
++ if (i >= MAX_WAIT_DEVICE_READY_COUNT) {
++ PRINTM(FATAL, "HW not ready, uap_open() return failure\n");
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++
++ if (MODULE_GET == 0)
++ return UAP_STATUS_FAILURE;
++
++ priv->open = TRUE;
++ if (priv->MediaConnected == TRUE) {
++ os_carrier_on(priv);
++ os_start_queue(priv);
++ } else {
++ os_stop_queue(priv);
++ os_carrier_off(priv);
++ }
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++
++/**
++ * @brief This function closes the network device
++ *
++ * @param dev A pointer to net_device structure
++ * @return UAP_STATUS_SUCCESS
++ */
++static int
++uap_close(struct net_device *dev)
++{
++ uap_private *priv = (uap_private *) netdev_priv(dev);
++
++ ENTER();
++ skb_queue_purge(&priv->adapter->tx_queue);
++ os_stop_queue(priv);
++ os_carrier_off(priv);
++
++ MODULE_PUT;
++ priv->open = FALSE;
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++
++/**
++ * @brief This function returns the network statistics
++ *
++ * @param dev A pointer to uap_private structure
++ * @return A pointer to net_device_stats structure
++ */
++static struct net_device_stats *
++uap_get_stats(struct net_device *dev)
++{
++ uap_private *priv = (uap_private *) netdev_priv(dev);
++
++ return &priv->stats;
++}
++
++/**
++ * @brief This function sets the MAC address to firmware.
++ *
++ * @param dev A pointer to uap_private structure
++ * @param addr MAC address to set
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++uap_set_mac_address(struct net_device *dev, void *addr)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ uap_private *priv = (uap_private *) netdev_priv(dev);
++ struct sockaddr *pHwAddr = (struct sockaddr *) addr;
++ u32 CmdSize;
++ HostCmd_DS_COMMAND *cmd;
++ MrvlIEtypes_MacAddr_t *pMacAddrTlv;
++ uap_adapter *Adapter = priv->adapter;
++ struct sk_buff *skb;
++
++ ENTER();
++
++ /* Dump MAC address */
++ DBG_HEXDUMP(CMD_D, "Original MAC addr", dev->dev_addr, ETH_ALEN);
++ DBG_HEXDUMP(CMD_D, "New MAC addr", pHwAddr->sa_data, ETH_ALEN);
++ if (priv->open && (priv->MediaConnected == TRUE)) {
++ os_carrier_on(priv);
++ os_start_queue(priv);
++ }
++ skb = dev_alloc_skb(MRVDRV_SIZE_OF_CMD_BUFFER);
++ if (!skb) {
++ PRINTM(ERROR, "No free skb\n");
++ LEAVE();
++ return -ENOMEM;
++ }
++ CmdSize =
++ S_DS_GEN + sizeof(HostCmd_SYS_CONFIG) + sizeof(MrvlIEtypes_MacAddr_t);
++ cmd = (HostCmd_DS_COMMAND *) (skb->data + INTF_HEADER_LEN);
++ cmd->Command = uap_cpu_to_le16(HOST_CMD_APCMD_SYS_CONFIGURE);
++ cmd->Size = uap_cpu_to_le16(CmdSize);
++ cmd->params.sys_config.Action = uap_cpu_to_le16(ACTION_SET);
++ pMacAddrTlv =
++ (MrvlIEtypes_MacAddr_t *) ((u8 *) cmd + S_DS_GEN +
++ sizeof(HostCmd_SYS_CONFIG));
++ pMacAddrTlv->Header.Type = uap_cpu_to_le16(MRVL_AP_MAC_ADDRESS_TLV_ID);
++ pMacAddrTlv->Header.Len = uap_cpu_to_le16(ETH_ALEN);
++ memcpy(pMacAddrTlv->ApMacAddr, pHwAddr->sa_data, ETH_ALEN);
++ skb_put(skb, CmdSize + INTF_HEADER_LEN);
++ PRINTM(CMND, "set_mac_address\n");
++ if (UAP_STATUS_SUCCESS !=
++ uap_process_cmd(priv, skb, HostCmd_OPTION_WAITFORRSP_TIMEOUT)) {
++ PRINTM(ERROR, "Fail to set mac address\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ if (!Adapter->CmdSize) {
++ PRINTM(ERROR, "Cmd Size is 0\n");
++ LEAVE();
++ return -EFAULT;
++ }
++ cmd = (HostCmd_DS_COMMAND *) Adapter->CmdBuf;
++ cmd->Result = uap_cpu_to_le16(cmd->Result);
++ if (cmd->Result != UAP_STATUS_SUCCESS) {
++ PRINTM(ERROR, "set mac addrress fail,cmd result=%x\n", cmd->Result);
++ ret = -EFAULT;
++ } else
++ memcpy(dev->dev_addr, pHwAddr->sa_data, ETH_ALEN);
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function handles the timeout of packet
++ * transmission
++ *
++ * @param dev A pointer to net_device structure
++ * @return n/a
++ */
++static void
++uap_tx_timeout(struct net_device *dev)
++{
++ uap_private *priv = (uap_private *) netdev_priv(dev);
++
++ ENTER();
++
++ PRINTM(DATA, "Tx timeout\n");
++ UpdateTransStart(dev);
++ priv->num_tx_timeout++;
++ priv->adapter->IntCounter++;
++ wake_up_interruptible(&priv->MainThread.waitQ);
++
++ LEAVE();
++}
++
++/**
++ * @brief This function handles packet transmission
++ *
++ * @param skb A pointer to sk_buff structure
++ * @param dev A pointer to net_device structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++uap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
++{
++ uap_private *priv = (uap_private *) netdev_priv(dev);
++ int ret = UAP_STATUS_SUCCESS;
++
++ ENTER();
++ PRINTM(DATA, "Data <= kernel\n");
++ DBG_HEXDUMP(DAT_D, "Tx", skb->data, MIN(skb->len, DATA_DUMP_LEN));
++ /* skb sanity check */
++ if (!skb->len || (skb->len > MRVDRV_MAXIMUM_ETH_PACKET_SIZE)) {
++ PRINTM(ERROR, "Tx Error: Bad skb length %d : %d\n", skb->len,
++ MRVDRV_MAXIMUM_ETH_PACKET_SIZE);
++ priv->stats.tx_dropped++;
++ kfree(skb);
++ goto done;
++ }
++ skb_queue_tail(&priv->adapter->tx_queue, skb);
++ wake_up_interruptible(&priv->MainThread.waitQ);
++ if (skb_queue_len(&priv->adapter->tx_queue) > TX_HIGH_WATERMARK) {
++ UpdateTransStart(dev);
++ os_stop_queue(priv);
++ }
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief ioctl function - entry point
++ *
++ * @param dev A pointer to net_device structure
++ * @param req A pointer to ifreq structure
++ * @param cmd command
++ * @return UAP_STATUS_SUCCESS--success, otherwise fail
++ */
++static int
++uap_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
++{
++ int ret = UAP_STATUS_SUCCESS;
++
++ ENTER();
++
++ PRINTM(CMND, "uap_do_ioctl: ioctl cmd = 0x%x\n", cmd);
++
++ switch (cmd) {
++ case UAPHOSTCMD:
++ ret = uap_hostcmd_ioctl(dev, req);
++ break;
++ case UAP_POWER_MODE:
++ ret = uap_power_mode_ioctl(dev, req);
++ break;
++ default:
++ ret = -EINVAL;
++ break;
++ }
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function handles events generated by firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @param payload A pointer to payload buffer
++ * @param len Length of the payload
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++uap_process_event(uap_private * priv, u8 * payload, uint len)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ uap_adapter *Adapter = priv->adapter;
++ struct sk_buff *skb = NULL;
++ struct nlmsghdr *nlh = NULL;
++ struct sock *sk = Adapter->nl_sk;
++ AP_Event *pEvent;
++
++ ENTER();
++ Adapter->ps_state = PS_STATE_AWAKE;
++ if (len > NL_MAX_PAYLOAD) {
++ PRINTM(ERROR, "event size is too big!!! len=%d\n", len);
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ pEvent = (AP_Event *) payload;
++ PRINTM(CMND, "Event: %d\n", pEvent->EventId);
++ switch (pEvent->EventId) {
++ case MICRO_AP_EV_ID_BSS_START:
++ memcpy(priv->uap_dev.netdev->dev_addr, pEvent->MacAddr, ETH_ALEN);
++ DBG_HEXDUMP(CMD_D, "BSS MAC addr", priv->uap_dev.netdev->dev_addr,
++ ETH_ALEN);
++ break;
++ case MICRO_AP_EV_BSS_ACTIVE:
++ // carrier on
++ priv->MediaConnected = TRUE;
++ os_carrier_on(priv);
++ os_start_queue(priv);
++ break;
++ case MICRO_AP_EV_BSS_IDLE:
++ os_stop_queue(priv);
++ os_carrier_off(priv);
++ priv->MediaConnected = FALSE;
++ break;
++ case EVENT_PS_AWAKE:
++ PRINTM(CMND, "UAP: PS_AWAKE\n");
++ Adapter->ps_state = PS_STATE_AWAKE;
++ Adapter->WakeupTries = 0;
++ break;
++ case EVENT_PS_SLEEP:
++ PRINTM(CMND, "UAP: PS_SLEEP\n");
++ Adapter->ps_state = PS_STATE_PRE_SLEEP;
++ break;
++ default:
++ break;
++ }
++ if ((pEvent->EventId == EVENT_PS_AWAKE) ||
++ (pEvent->EventId == EVENT_PS_SLEEP))
++ goto done;
++ if (sk) {
++ /* Allocate skb */
++ if (!(skb = alloc_skb(NLMSG_SPACE(NL_MAX_PAYLOAD), GFP_ATOMIC))) {
++ PRINTM(ERROR, "Could not allocate skb for netlink.\n");
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ nlh = (struct nlmsghdr *) skb->data;
++ nlh->nlmsg_len = NLMSG_SPACE(len);
++
++ /* From kernel */
++ nlh->nlmsg_pid = 0;
++ nlh->nlmsg_flags = 0;
++
++ /* Data */
++ skb_put(skb, nlh->nlmsg_len);
++ memcpy(NLMSG_DATA(nlh), payload, len);
++
++ /* From Kernel */
++ NETLINK_CB(skb).portid = 0;
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
++ /* Multicast message */
++ NETLINK_CB(skb).dst_pid = 0;
++#endif
++
++ /* Multicast group number */
++ NETLINK_CB(skb).dst_group = NL_MULTICAST_GROUP;
++
++ /* Send message */
++ netlink_broadcast(sk, skb, 0, NL_MULTICAST_GROUP, GFP_KERNEL);
++
++ ret = UAP_STATUS_SUCCESS;
++ } else {
++ PRINTM(ERROR, "Could not send event through NETLINK. Link down.\n");
++ ret = UAP_STATUS_FAILURE;
++ }
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function handles the interrupt. it will change PS
++ * state if applicable. it will wake up main_thread to handle
++ * the interrupt event as well.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return n/a
++ */
++void
++uap_interrupt(uap_private * priv)
++{
++ ENTER();
++ priv->adapter->IntCounter++;
++ priv->adapter->WakeupTries = 0;
++ PRINTM(INFO, "*\n");
++ wake_up_interruptible(&priv->MainThread.waitQ);
++
++ LEAVE();
++
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
++/** Network device handlers */
++static const struct net_device_ops uap_netdev_ops = {
++ .ndo_open = uap_open,
++ .ndo_start_xmit = uap_hard_start_xmit,
++ .ndo_stop = uap_close,
++ .ndo_do_ioctl = uap_do_ioctl,
++ .ndo_set_mac_address = uap_set_mac_address,
++ .ndo_tx_timeout = uap_tx_timeout,
++ .ndo_get_stats = uap_get_stats,
++};
++#endif
++
++/**
++ * @brief This function adds the card. it will probe the
++ * card, allocate the uap_priv and initialize the device.
++ *
++ * @param card A pointer to card
++ * @return A pointer to uap_private structure
++ */
++uap_private *
++uap_add_card(void *card)
++{
++ struct net_device *dev = NULL;
++ uap_private *priv = NULL;
++
++ ENTER();
++
++ if (OS_ACQ_SEMAPHORE_BLOCK(&AddRemoveCardSem))
++ goto exit_sem_err;
++
++ /* Allocate an Ethernet device */
++ if (!(dev = alloc_etherdev(sizeof(uap_private)))) {
++ PRINTM(FATAL, "Init ethernet device failed!\n");
++ goto error;
++ }
++ priv = (uap_private *) netdev_priv(dev);
++
++ /* Allocate name */
++ if (dev_alloc_name(dev, "uap%d") < 0) {
++ PRINTM(ERROR, "Could not allocate device name!\n");
++ goto error;
++ }
++
++ /* Allocate buffer for uap_adapter */
++ if (!(priv->adapter = kmalloc(sizeof(uap_adapter), GFP_KERNEL))) {
++ PRINTM(FATAL, "Allocate buffer for uap_adapter failed!\n");
++ goto error;
++ }
++ memset(priv->adapter, 0, sizeof(uap_adapter));
++
++ priv->uap_dev.netdev = dev;
++ priv->uap_dev.card = card;
++ priv->MediaConnected = FALSE;
++ uappriv = priv;
++ ((struct sdio_mmc_card *) card)->priv = priv;
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
++ SET_MODULE_OWNER(dev);
++#endif
++
++ /* Setup the OS Interface to our functions */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
++ dev->open = uap_open;
++ dev->stop = uap_close;
++ dev->hard_start_xmit = uap_hard_start_xmit;
++ dev->tx_timeout = uap_tx_timeout;
++ dev->get_stats = uap_get_stats;
++ dev->do_ioctl = uap_do_ioctl;
++ dev->set_mac_address = uap_set_mac_address;
++ dev->set_multicast_list = uap_set_multicast_list;
++#else
++ dev->netdev_ops = &uap_netdev_ops;
++#endif
++ dev->watchdog_timeo = MRVDRV_DEFAULT_WATCHDOG_TIMEOUT;
++ dev->hard_header_len += sizeof(TxPD) + INTF_HEADER_LEN;
++ dev->hard_header_len += HEADER_ALIGNMENT;
++#define NETIF_F_DYNALLOC 16
++ dev->features |= NETIF_F_DYNALLOC;
++ dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
++
++ /* Init SW */
++ if (uap_init_sw(priv)) {
++ PRINTM(FATAL, "Software Init Failed\n");
++ goto error;
++ }
++
++ PRINTM(INFO, "Starting kthread...\n");
++ priv->MainThread.priv = priv;
++ spin_lock_init(&priv->driver_lock);
++ uap_create_thread(uap_service_main_thread, &priv->MainThread,
++ "uap_main_service");
++ while (priv->MainThread.pid == 0) {
++ os_sched_timeout(2);
++ }
++
++ /* Register the device */
++ if (sbi_register_dev(priv) < 0) {
++ PRINTM(FATAL, "Failed to register uap device!\n");
++ goto err_registerdev;
++ }
++#ifdef FW_DNLD_NEEDED
++ SET_NETDEV_DEV(dev, priv->hotplug_device);
++#endif
++
++ /* Init FW and HW */
++ if (uap_init_fw(priv)) {
++ PRINTM(FATAL, "Firmware Init Failed\n");
++ goto err_init_fw;
++ }
++
++ priv->uap_dev.cmd_sent = FALSE;
++ priv->uap_dev.data_sent = FALSE;
++
++ /* Get mac address from firmware */
++ if (uap_get_mac_address(priv)) {
++ PRINTM(FATAL, "Fail to get mac address\n");
++ goto err_init_fw;
++ }
++ /* Register network device */
++ if (register_netdev(dev)) {
++ printk(KERN_ERR "Cannot register network device!\n");
++ goto err_init_fw;
++ }
++#ifdef CONFIG_PROC_FS
++ uap_proc_entry(priv, dev);
++ uap_debug_entry(priv, dev);
++#endif /* CPNFIG_PROC_FS */
++ OS_REL_SEMAPHORE(&AddRemoveCardSem);
++
++ LEAVE();
++ return priv;
++ err_init_fw:
++ sbi_unregister_dev(priv);
++ err_registerdev:
++ ((struct sdio_mmc_card *) card)->priv = NULL;
++ /* Stop the thread servicing the interrupts */
++ priv->adapter->SurpriseRemoved = TRUE;
++ wake_up_interruptible(&priv->MainThread.waitQ);
++ while (priv->MainThread.pid) {
++ os_sched_timeout(1);
++ }
++ error:
++ if (dev) {
++ if (dev->reg_state == NETREG_REGISTERED)
++ unregister_netdev(dev);
++ if (priv->adapter)
++ uap_free_adapter(priv);
++ free_netdev(dev);
++ uappriv = NULL;
++ }
++ OS_REL_SEMAPHORE(&AddRemoveCardSem);
++ exit_sem_err:
++ LEAVE();
++ return NULL;
++}
++
++/**
++ * @brief This function removes the card.
++ *
++ * @param card A pointer to card
++ * @return UAP_STATUS_SUCCESS
++ */
++int
++uap_remove_card(void *card)
++{
++ uap_private *priv = uappriv;
++ uap_adapter *Adapter;
++ struct net_device *dev;
++
++ ENTER();
++
++ if (OS_ACQ_SEMAPHORE_BLOCK(&AddRemoveCardSem))
++ goto exit_sem_err;
++
++ if (!priv || !(Adapter = priv->adapter)) {
++ goto exit_remove;
++ }
++ Adapter->SurpriseRemoved = TRUE;
++ if (Adapter->cmd_pending == TRUE) {
++ /* Wake up cmd Q */
++ Adapter->CmdWaitQWoken = TRUE;
++ wake_up_interruptible(&Adapter->cmdwait_q);
++ }
++ dev = priv->uap_dev.netdev;
++ if (priv->MediaConnected == TRUE) {
++ os_stop_queue(priv);
++ os_carrier_off(priv);
++ priv->MediaConnected = FALSE;
++ }
++ Adapter->CmdSize = 0;
++ Adapter->CmdWaitQWoken = TRUE;
++ wake_up_interruptible(&Adapter->cmdwait_q);
++ skb_queue_purge(&priv->adapter->tx_queue);
++ skb_queue_purge(&priv->adapter->cmd_queue);
++
++ /* Disable interrupts on the card */
++ sbi_disable_host_int(priv);
++ PRINTM(INFO, "netdev_finish_unregister: %s%s.\n", dev->name,
++ (dev->features & NETIF_F_DYNALLOC) ? "" : ", old style");
++ unregister_netdev(dev);
++ PRINTM(INFO, "Unregister finish\n");
++ wake_up_interruptible(&priv->MainThread.waitQ);
++ while (priv->MainThread.pid) {
++ os_sched_timeout(1);
++ }
++
++ if ((Adapter->nl_sk) && ((Adapter->nl_sk)->sk_socket)) {
++ sock_release((Adapter->nl_sk)->sk_socket);
++ Adapter->nl_sk = NULL;
++ }
++#ifdef CONFIG_PROC_FS
++ uap_debug_remove(priv);
++ uap_proc_remove(priv);
++#endif
++ sbi_unregister_dev(priv);
++ PRINTM(INFO, "Free Adapter\n");
++ uap_free_adapter(priv);
++ priv->uap_dev.netdev = NULL;
++ free_netdev(dev);
++ uappriv = NULL;
++
++ exit_remove:
++ OS_REL_SEMAPHORE(&AddRemoveCardSem);
++ exit_sem_err:
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++
++/**
++ * @brief This function initializes module.
++ *
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int __init
++uap_init_module(void)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ ENTER();
++
++ OS_INIT_SEMAPHORE(&AddRemoveCardSem);
++ ret = sbi_register();
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function cleans module
++ *
++ * @return n/a
++ */
++static void __exit
++uap_cleanup_module(void)
++{
++ ENTER();
++
++ if (OS_ACQ_SEMAPHORE_BLOCK(&AddRemoveCardSem))
++ goto exit_sem_err;
++
++ if ((uappriv) && (uappriv->adapter)) {
++ uap_func_shutdown(uappriv);
++ }
++ OS_REL_SEMAPHORE(&AddRemoveCardSem);
++ exit_sem_err:
++ sbi_unregister();
++ LEAVE();
++}
++
++module_init(uap_init_module);
++module_exit(uap_cleanup_module);
++module_param(helper_name, charp, 0);
++MODULE_PARM_DESC(helper_name, "Helper name");
++module_param(fw_name, charp, 0);
++MODULE_PARM_DESC(fw_name, "Firmware name");
++
++MODULE_DESCRIPTION("M-UAP Driver");
++MODULE_AUTHOR("Marvell International Ltd.");
++MODULE_VERSION(DRIVER_VERSION);
++MODULE_LICENSE("GPL");
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_proc.c backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_proc.c
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_proc.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_proc.c 2014-12-29 20:37:43.952431125 +0100
+@@ -0,0 +1,258 @@
++/** @file uap_proc.c
++ * @brief This file contains functions for proc file.
++ *
++ * Copyright (C) 2008-2009, Marvell International Ltd.
++ *
++ * This software file (the "File") is distributed by Marvell International
++ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
++ * (the "License"). You may use, redistribute and/or modify this File in
++ * accordance with the terms and conditions of the License, a copy of which
++ * is available along with the File in the gpl.txt file or by writing to
++ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
++ *
++ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
++ * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
++ * this warranty disclaimer.
++ *
++ */
++#ifdef CONFIG_PROC_FS
++#include <linux/proc_fs.h>
++#include <linux/seq_file.h>
++#include "uap_headers.h"
++
++/** /proc directory root */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#define PROC_DIR NULL
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
++#define PROC_DIR &proc_root
++#else
++#define PROC_DIR proc_net
++#endif
++
++/********************************************************
++ Local Variables
++********************************************************/
++
++/********************************************************
++ Global Variables
++********************************************************/
++
++/********************************************************
++ Local Functions
++********************************************************/
++
++static int uap_info_proc_show(struct seq_file *s, void *data) {
++ int i;
++ struct net_device *netdev = (struct net_device*)s->private;
++ struct netdev_hw_addr *ha;
++ uap_private *priv = (uap_private *) netdev_priv(netdev);
++
++ seq_printf(s, "driver_name = " "\"uap\"\n");
++ seq_printf(s, "driver_version = %s-(FP%s)", DRIVER_VERSION, FPNUM);
++ seq_printf(s, "\nInterfaceName=\"%s\"\n", netdev->name);
++
++ seq_printf(s, "State=\"%s\"\n",
++ ((priv->MediaConnected ==
++ FALSE) ? "Disconnected" : "Connected"));
++ seq_printf(s, "MACAddress=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
++ netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
++ netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
++ i = 0;
++ netdev_for_each_mc_addr(ha, netdev) {
++ ++i;
++ }
++ seq_printf(s, "MCCount=\"%d\"\n", i);
++
++ /*
++ * Put out the multicast list
++ */
++ i = 0;
++ netdev_for_each_mc_addr(ha, netdev) {
++ seq_printf(s,
++ "MCAddr[%d]=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
++ i++,
++ ha->addr[0], ha->addr[1],
++ ha->addr[2], ha->addr[3],
++ ha->addr[4], ha->addr[5]);
++ }
++
++ seq_printf(s, "num_tx_bytes = %lu\n", priv->stats.tx_bytes);
++ seq_printf(s, "num_rx_bytes = %lu\n", priv->stats.rx_bytes);
++ seq_printf(s, "num_tx_pkts = %lu\n", priv->stats.tx_packets);
++ seq_printf(s, "num_rx_pkts = %lu\n", priv->stats.rx_packets);
++ seq_printf(s, "num_tx_pkts_dropped = %lu\n", priv->stats.tx_dropped);
++ seq_printf(s, "num_rx_pkts_dropped = %lu\n", priv->stats.rx_dropped);
++ seq_printf(s, "num_tx_pkts_err = %lu\n", priv->stats.tx_errors);
++ seq_printf(s, "num_rx_pkts_err = %lu\n", priv->stats.rx_errors);
++ seq_printf(s, "num_tx_timeout = %u\n", priv->num_tx_timeout);
++ seq_printf(s, "carrier %s\n",
++ ((netif_carrier_ok(priv->uap_dev.netdev)) ? "on" : "off"));
++ seq_printf(s, "tx queue %s\n",
++ ((netif_queue_stopped(priv->uap_dev.netdev)) ? "stopped" :
++ "started"));
++
++ return 0;
++}
++
++static int uap_info_proc_open(struct inode *inode, struct file *file) {
++ return single_open(file, uap_info_proc_show, PDE_DATA(inode));
++}
++
++static int uap_hwstatus_proc_show(struct seq_file *s, void *data) {
++ struct net_device *netdev = (struct net_device*)s->private;
++ uap_private *priv = (uap_private *) netdev_priv(netdev);
++
++ MODULE_GET;
++ seq_printf(s, "%d\n", priv->adapter->HardwareStatus);
++ MODULE_PUT;
++
++ return 0;
++}
++
++static int uap_hwstatus_proc_open(struct inode *inode, struct file *file) {
++ return single_open(file, uap_hwstatus_proc_show, PDE_DATA(inode));
++}
++
++static ssize_t uap_hwstatus_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *data) {
++ struct net_device *netdev = (struct net_device *)PDE_DATA(file_inode(file));
++ uap_private *priv = (uap_private *) netdev_priv(netdev);
++
++ int hwstatus;
++ char value[10];
++
++ if (count > sizeof(value))
++ return count;
++
++ if (copy_from_user(&value, buffer, count))
++ return -EFAULT;
++
++ hwstatus = string_to_number(value);
++ switch (hwstatus) {
++ case HWReset:
++ PRINTM(MSG, "reset hw\n");
++ uap_soft_reset(priv);
++ priv->adapter->HardwareStatus = HWReset;
++ break;
++ default:
++ break;
++ }
++
++ MODULE_PUT;
++ return count;
++}
++
++static const struct file_operations uap_info_proc_fops = {
++ .owner = THIS_MODULE,
++ .open = uap_info_proc_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
++};
++
++static const struct file_operations uap_hwstatus_proc_fops = {
++ .owner = THIS_MODULE,
++ .open = uap_hwstatus_proc_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
++ .write = uap_hwstatus_proc_write,
++};
++
++/********************************************************
++ Global Functions
++********************************************************/
++/**
++ * @brief create uap proc file
++ *
++ * @param priv pointer uap_private
++ * @param dev pointer net_device
++ * @return N/A
++ */
++void
++uap_proc_entry(uap_private * priv, struct net_device *dev)
++{
++ PRINTM(INFO, "Creating Proc Interface\n");
++ /* Check if uap directory already exists */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
++ struct proc_dir_entry *r = PROC_DIR;
++
++ for (r = r->subdir; r; r = r->next) {
++ if (r->namelen && !strcmp("uap", r->name)) {
++ /* Directory exists */
++ PRINTM(WARN, "proc directory already exists!\n");
++ priv->proc_uap = r;
++ break;
++ }
++ }
++#endif
++ if (!priv->proc_uap) {
++ priv->proc_uap = proc_mkdir("uap", PROC_DIR);
++ if (!priv->proc_uap)
++ return;
++ }
++ priv->proc_entry = proc_mkdir(dev->name, priv->proc_uap);
++
++ if (priv->proc_entry) {
++ proc_create_data("info", 0644, priv->proc_entry, &uap_info_proc_fops, dev);
++ proc_create_data("hwinfo", 0644, priv->proc_entry, &uap_hwstatus_proc_fops, dev);
++ }
++}
++
++/**
++ * @brief remove proc file
++ *
++ * @param priv pointer uap_private
++ * @return N/A
++ */
++void
++uap_proc_remove(uap_private * priv)
++{
++ if (priv->proc_uap) {
++ if (priv->proc_entry) {
++ remove_proc_entry("info", priv->proc_entry);
++ remove_proc_entry("hwstatus", priv->proc_entry);
++ }
++ remove_proc_entry(priv->uap_dev.netdev->name, priv->proc_uap);
++ }
++}
++
++/**
++ * @brief convert string to number
++ *
++ * @param s pointer to numbered string
++ * @return converted number from string s
++ */
++int
++string_to_number(char *s)
++{
++ int r = 0;
++ int base = 0;
++ int pn = 1;
++
++ if (strncmp(s, "-", 1) == 0) {
++ pn = -1;
++ s++;
++ }
++ if ((strncmp(s, "0x", 2) == 0) || (strncmp(s, "0X", 2) == 0)) {
++ base = 16;
++ s += 2;
++ } else
++ base = 10;
++
++ for (s = s; *s != 0; s++) {
++ if ((*s >= '0') && (*s <= '9'))
++ r = (r * base) + (*s - '0');
++ else if ((*s >= 'A') && (*s <= 'F'))
++ r = (r * base) + (*s - 'A' + 10);
++ else if ((*s >= 'a') && (*s <= 'f'))
++ r = (r * base) + (*s - 'a' + 10);
++ else
++ break;
++ }
++
++ return (r * pn);
++}
++
++#endif
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_sdio_mmc.c backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_sdio_mmc.c
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_sdio_mmc.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_sdio_mmc.c 2014-12-29 20:37:43.955764567 +0100
+@@ -0,0 +1,1428 @@
++/** @file uap_sdio_mmc.c
++ * @brief This file contains SDIO IF (interface) module
++ * related functions.
++ *
++ * Copyright (C) 2007-2009, Marvell International Ltd.
++ *
++ * This software file (the "File") is distributed by Marvell International
++ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
++ * (the "License"). You may use, redistribute and/or modify this File in
++ * accordance with the terms and conditions of the License, a copy of which
++ * is available along with the File in the gpl.txt file or by writing to
++ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
++ *
++ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
++ * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
++ * this warranty disclaimer.
++ *
++ */
++/****************************************************
++Change log:
++****************************************************/
++
++#include "uap_sdio_mmc.h"
++
++#include <linux/firmware.h>
++
++/** define SDIO block size */
++/* We support up to 480-byte block size due to FW buffer limitation. */
++#define SD_BLOCK_SIZE 256
++
++/** define allocated buffer size */
++#define ALLOC_BUF_SIZE (((MAX(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, \
++ MRVDRV_SIZE_OF_CMD_BUFFER) + INTF_HEADER_LEN \
++ + SD_BLOCK_SIZE - 1) / SD_BLOCK_SIZE) * SD_BLOCK_SIZE)
++
++/** Max retry number of CMD53 write */
++#define MAX_WRITE_IOMEM_RETRY 2
++
++/********************************************************
++ Local Variables
++********************************************************/
++
++/** SDIO Rx unit */
++static u8 sdio_rx_unit = 0;
++
++/**Interrupt status */
++static u8 sd_ireg = 0;
++/********************************************************
++ Global Variables
++********************************************************/
++extern u8 *helper_name;
++extern u8 *fw_name;
++/** Default helper name */
++#define DEFAULT_HELPER_NAME "mrvl/helper_sd.bin"
++/** Default firmware name */
++#define DEFAULT_FW_NAME "mrvl/sd8688_ap.bin"
++
++/********************************************************
++ Local Functions
++********************************************************/
++/**
++ * @brief This function reads the IO register.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param reg register to be read
++ * @param dat A pointer to variable that keeps returned value
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++sbi_read_ioreg(uap_private * priv, u32 reg, u8 * dat)
++{
++ struct sdio_mmc_card *card;
++ int ret = UAP_STATUS_FAILURE;
++
++ ENTER();
++
++ card = priv->uap_dev.card;
++ if (!card || !card->func) {
++ PRINTM(ERROR, "sbi_read_ioreg(): card or function is NULL!\n");
++ goto done;
++ }
++
++ *dat = sdio_readb(card->func, reg, &ret);
++ if (ret) {
++ PRINTM(ERROR, "sbi_read_ioreg(): sdio_readb failed! ret=%d\n", ret);
++ goto done;
++ }
++
++ PRINTM(INFO, "sbi_read_ioreg() priv=%p func=%d reg=%#x dat=%#x\n", priv,
++ card->func->num, reg, *dat);
++
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function writes the IO register.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param reg register to be written
++ * @param dat the value to be written
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++sbi_write_ioreg(uap_private * priv, u32 reg, u8 dat)
++{
++ struct sdio_mmc_card *card;
++ int ret = UAP_STATUS_FAILURE;
++
++ ENTER();
++
++ card = priv->uap_dev.card;
++ if (!card || !card->func) {
++ PRINTM(ERROR, "sbi_write_ioreg(): card or function is NULL!\n");
++ goto done;
++ }
++
++ PRINTM(INFO, "sbi_write_ioreg() priv=%p func=%d reg=%#x dat=%#x\n", priv,
++ card->func->num, reg, dat);
++
++ sdio_writeb(card->func, dat, reg, &ret);
++ if (ret) {
++ PRINTM(ERROR, "sbi_write_ioreg(): sdio_readb failed! ret=%d\n", ret);
++ goto done;
++ }
++
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function get rx_unit value
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++sd_get_rx_unit(uap_private * priv)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u8 reg;
++
++ ENTER();
++
++ ret = sbi_read_ioreg(priv, CARD_RX_UNIT_REG, ®);
++ if (ret == UAP_STATUS_SUCCESS)
++ sdio_rx_unit = reg;
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function reads rx length
++ *
++ * @param priv A pointer to uap_private structure
++ * @param dat A pointer to keep returned data
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++sd_read_rx_len(uap_private * priv, u16 * dat)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u8 reg;
++
++ ENTER();
++
++ ret = sbi_read_ioreg(priv, CARD_RX_LEN_REG, ®);
++ if (ret == UAP_STATUS_SUCCESS)
++ *dat = (u16) reg << sdio_rx_unit;
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function reads fw status registers
++ *
++ * @param priv A pointer to uap_private structure
++ * @param dat A pointer to keep returned data
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++sd_read_firmware_status(uap_private * priv, u16 * dat)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u8 fws0;
++ u8 fws1;
++
++ ENTER();
++
++ ret = sbi_read_ioreg(priv, CARD_FW_STATUS0_REG, &fws0);
++ if (ret < 0) {
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++
++ ret = sbi_read_ioreg(priv, CARD_FW_STATUS1_REG, &fws1);
++ if (ret < 0) {
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++
++ *dat = (((u16) fws1) << 8) | fws0;
++
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++
++/**
++ * @brief This function polls the card status register.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param bits the bit mask
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++mv_sdio_poll_card_status(uap_private * priv, u8 bits)
++{
++ int tries;
++ u8 cs;
++
++ ENTER();
++
++ for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
++ if (sbi_read_ioreg(priv, CARD_STATUS_REG, &cs) < 0)
++ break;
++ else if ((cs & bits) == bits) {
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++ }
++ udelay(10);
++ }
++
++ PRINTM(WARN, "mv_sdio_poll_card_status failed, tries = %d\n", tries);
++
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++}
++
++/**
++ * @brief This function set the sdio bus width.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param mode 1--1 bit mode, 4--4 bit mode
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++#if 0
++static int
++sdio_set_bus_width(uap_private * priv, u8 mode)
++{
++ ENTER();
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++#endif
++
++/**
++ * @brief This function reads data from the card.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++sd_card_to_host(uap_private * priv)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u16 buf_len = 0;
++ int buf_block_len;
++ int blksz;
++ struct sk_buff *skb = NULL;
++ u16 type;
++ u8 *payload = NULL;
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++
++ ENTER();
++
++ if (!card || !card->func) {
++ PRINTM(ERROR, "card or function is NULL!\n");
++ ret = UAP_STATUS_FAILURE;
++ goto exit;
++ }
++
++ /* Read the length of data to be transferred */
++ ret = sd_read_rx_len(priv, &buf_len);
++ if (ret < 0) {
++ PRINTM(ERROR, "card_to_host, read scratch reg failed\n");
++ ret = UAP_STATUS_FAILURE;
++ goto exit;
++ }
++
++ /* Allocate buffer */
++ blksz = SD_BLOCK_SIZE;
++ buf_block_len = (buf_len + blksz - 1) / blksz;
++ if (buf_len <= INTF_HEADER_LEN || (buf_block_len * blksz) > ALLOC_BUF_SIZE) {
++ PRINTM(ERROR, "card_to_host, invalid packet length: %d\n", buf_len);
++ ret = UAP_STATUS_FAILURE;
++ goto exit;
++ }
++#ifdef PXA3XX_DMA_ALIGN
++ skb = dev_alloc_skb(buf_block_len * blksz + PXA3XX_DMA_ALIGNMENT);
++#else
++ skb = dev_alloc_skb(buf_block_len * blksz);
++#endif
++ if (skb == NULL) {
++ PRINTM(WARN, "No free skb\n");
++ goto exit;
++ }
++#ifdef PXA3XX_DMA_ALIGN
++ if ((u32) skb->data & (PXA3XX_DMA_ALIGNMENT - 1)) {
++ skb_put(skb, (u32) skb->data & (PXA3XX_DMA_ALIGNMENT - 1));
++ skb_pull(skb, (u32) skb->data & (PXA3XX_DMA_ALIGNMENT - 1));
++ }
++#endif /* PXA3XX_DMA_ALIGN */
++
++ payload = skb->tail;
++ ret = sdio_readsb(card->func, payload, priv->uap_dev.ioport,
++ buf_block_len * blksz);
++ if (ret < 0) {
++ PRINTM(ERROR, "card_to_host, read iomem failed: %d\n", ret);
++ ret = UAP_STATUS_FAILURE;
++ goto exit;
++ }
++ HEXDUMP("SDIO Blk Rd", payload, blksz * buf_block_len);
++ /*
++ * This is SDIO specific header
++ * u16 length,
++ * u16 type (MV_TYPE_DAT = 0, MV_TYPE_CMD = 1, MV_TYPE_EVENT = 3)
++ */
++ buf_len = uap_le16_to_cpu(*(u16 *) & payload[0]);
++ type = uap_le16_to_cpu(*(u16 *) & payload[2]);
++ switch (type) {
++ case MV_TYPE_EVENT:
++ skb_put(skb, buf_len);
++ skb_pull(skb, INTF_HEADER_LEN);
++ uap_process_event(priv, skb->data, skb->len);
++ kfree_skb(skb);
++ skb = NULL;
++ break;
++ case MV_TYPE_CMD:
++ skb_put(skb, buf_len);
++ skb_pull(skb, INTF_HEADER_LEN);
++ priv->adapter->cmd_pending = FALSE;
++ if (priv->adapter->cmd_wait_option ==
++ HostCmd_OPTION_WAITFORRSP_SLEEPCONFIRM) {
++ priv->adapter->cmd_wait_option = FALSE;
++ uap_process_sleep_confirm_resp(priv, skb->data, skb->len);
++ } else if (priv->adapter->cmd_wait_option) {
++ memcpy(priv->adapter->CmdBuf, skb->data, skb->len);
++ priv->adapter->CmdSize = skb->len;
++ priv->adapter->cmd_wait_option = FALSE;
++ priv->adapter->CmdWaitQWoken = TRUE;
++ wake_up_interruptible(&priv->adapter->cmdwait_q);
++ }
++ kfree_skb(skb);
++ skb = NULL;
++ break;
++ case MV_TYPE_DAT:
++ skb_put(skb, buf_len);
++ skb_pull(skb, INTF_HEADER_LEN);
++ uap_process_rx_packet(priv, skb);
++ break;
++ default:
++ priv->stats.rx_errors++;
++ priv->stats.rx_dropped++;
++ /* Driver specified event and command resp should be handle here */
++ PRINTM(INFO, "Unknown PKT type:%d\n", type);
++ kfree_skb(skb);
++ skb = NULL;
++ break;
++ }
++ exit:
++ if (ret) {
++ if (skb)
++ kfree_skb(skb);
++ }
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function enables the host interrupts mask
++ *
++ * @param priv A pointer to uap_private structure
++ * @param mask the interrupt mask
++ * @return UAP_STATUS_SUCCESS
++ */
++static int
++enable_host_int_mask(uap_private * priv, u8 mask)
++{
++ int ret = UAP_STATUS_SUCCESS;
++
++ ENTER();
++
++ /* Simply write the mask to the register */
++ ret = sbi_write_ioreg(priv, HOST_INT_MASK_REG, mask);
++
++ if (ret) {
++ PRINTM(WARN, "Unable to enable the host interrupt!\n");
++ ret = UAP_STATUS_FAILURE;
++ }
++
++ LEAVE();
++ return ret;
++}
++
++/** @brief This function disables the host interrupts mask.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param mask the interrupt mask
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++disable_host_int_mask(uap_private * priv, u8 mask)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u8 host_int_mask;
++
++ ENTER();
++
++ /* Read back the host_int_mask register */
++ ret = sbi_read_ioreg(priv, HOST_INT_MASK_REG, &host_int_mask);
++ if (ret) {
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++
++ /* Update with the mask and write back to the register */
++ host_int_mask &= ~mask;
++ ret = sbi_write_ioreg(priv, HOST_INT_MASK_REG, host_int_mask);
++ if (ret < 0) {
++ PRINTM(WARN, "Unable to diable the host interrupt!\n");
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++
++ done:
++ LEAVE();
++ return ret;
++}
++
++/********************************************************
++ Global Functions
++********************************************************/
++
++/**
++ * @brief This function handles the interrupt.
++ *
++ * @param func A pointer to sdio_func structure.
++ * @return n/a
++ */
++static void
++sbi_interrupt(struct sdio_func *func)
++{
++ struct sdio_mmc_card *card;
++ uap_private *priv;
++ u8 ireg = 0;
++ int ret = UAP_STATUS_SUCCESS;
++
++ ENTER();
++
++ card = sdio_get_drvdata(func);
++ if (!card || !card->priv) {
++ PRINTM(MSG, "%s: sbi_interrupt(%p) card or priv is NULL, card=%p\n",
++ __FUNCTION__, func, card);
++ LEAVE();
++ return;
++ }
++ priv = card->priv;
++#ifdef FW_WAKEUP_TIME
++ if ((priv->adapter->wt_pwrup_sending != 0L) &&
++ (priv->adapter->wt_int == 0L))
++ priv->adapter->wt_int = get_utimeofday();
++#endif
++
++ ireg = sdio_readb(card->func, HOST_INTSTATUS_REG, &ret);
++ if (ret) {
++ PRINTM(WARN, "sdio_read_ioreg: read int status register failed\n");
++ goto done;
++ }
++ if (ireg != 0) {
++ /*
++ * DN_LD_HOST_INT_STATUS and/or UP_LD_HOST_INT_STATUS
++ * Clear the interrupt status register and re-enable the interrupt
++ */
++ PRINTM(INFO, "sdio_ireg = 0x%x\n", ireg);
++ sdio_writeb(card->func,
++ ~(ireg) & (DN_LD_HOST_INT_STATUS | UP_LD_HOST_INT_STATUS),
++ HOST_INTSTATUS_REG, &ret);
++ if (ret) {
++ PRINTM(WARN,
++ "sdio_write_ioreg: clear int status register failed\n");
++ goto done;
++ }
++ }
++ OS_INT_DISABLE;
++ sd_ireg |= ireg;
++ OS_INT_RESTORE;
++
++ uap_interrupt(priv);
++ done:
++ LEAVE();
++}
++
++/**
++ * @brief This function probe the card
++ *
++ * @param func A pointer to sdio_func structure
++ * @param id A pointer to structure sd_device_id
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++static int
++uap_probe(struct sdio_func *func, const struct sdio_device_id *id)
++{
++ int ret = UAP_STATUS_FAILURE;
++ struct sdio_mmc_card *card = NULL;
++
++ ENTER();
++
++ PRINTM(MSG, "%s: vendor=0x%4.04X device=0x%4.04X class=%d function=%d\n",
++ __FUNCTION__, func->vendor, func->device, func->class, func->num);
++
++ card = kzalloc(sizeof(struct sdio_mmc_card), GFP_KERNEL);
++ if (!card) {
++ ret = -ENOMEM;
++ goto done;
++ }
++
++ card->func = func;
++
++ if (!uap_add_card(card)) {
++ PRINTM(ERROR, "%s: uap_add_callback failed\n", __FUNCTION__);
++ kfree(card);
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++
++ ret = UAP_STATUS_SUCCESS;
++
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function removes the card
++ *
++ * @param func A pointer to sdio_func structure
++ * @return N/A
++ */
++static void
++uap_remove(struct sdio_func *func)
++{
++ struct sdio_mmc_card *card;
++
++ ENTER();
++
++ if (func) {
++ card = sdio_get_drvdata(func);
++ if (card) {
++ uap_remove_card(card);
++ kfree(card);
++ }
++ }
++
++ LEAVE();
++}
++
++#ifdef CONFIG_PM
++/**
++ * @brief This function handles client driver suspend
++ *
++ * @param func A pointer to sdio_func structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++uap_suspend(struct sdio_func *func)
++{
++ ENTER();
++ LEAVE();
++ return 0;
++}
++
++/**
++ * @brief This function handles client driver resume
++ *
++ * @param func A pointer to sdio_func structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++uap_resume(struct sdio_func *func)
++{
++ ENTER();
++ LEAVE();
++ return 0;
++}
++#endif
++
++/** Device ID for SD8688 */
++#define SD_DEVICE_ID_8688_UAP 0x9104
++/** UAP IDs */
++static const struct sdio_device_id uap_ids[] = {
++ {SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SD_DEVICE_ID_8688_UAP)},
++ {},
++};
++
++MODULE_DEVICE_TABLE(sdio, uap_ids);
++
++static struct sdio_driver uap_sdio = {
++ .name = "uap_sdio",
++ .id_table = uap_ids,
++ .probe = uap_probe,
++ .remove = uap_remove,
++#ifdef CONFIG_PM
++/* .suspend = uap_suspend, */
++/* .resume = uap_resume, */
++#endif
++
++};
++
++/**
++ * @brief This function registers the IF module in bus driver.
++ *
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int __init
++sbi_register()
++{
++ int ret = UAP_STATUS_SUCCESS;
++
++ ENTER();
++
++ /* SDIO Driver Registration */
++ if (sdio_register_driver(&uap_sdio) != 0) {
++ PRINTM(FATAL, "SDIO Driver Registration Failed \n");
++ ret = UAP_STATUS_FAILURE;
++ }
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function de-registers the IF module in bus driver.
++ *
++ * @return n/a
++ */
++void __exit
++sbi_unregister(void)
++{
++ ENTER();
++
++ /* SDIO Driver Unregistration */
++ sdio_unregister_driver(&uap_sdio);
++
++ LEAVE();
++}
++
++/**
++ * @brief This function checks the interrupt status and handle it accordingly.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param ireg A pointer to variable that keeps returned value
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++sbi_get_int_status(uap_private * priv, u8 * ireg)
++{
++ int ret = UAP_STATUS_SUCCESS;
++ u8 sdio_ireg = 0;
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++
++ ENTER();
++
++ *ireg = 0;
++ OS_INT_DISABLE;
++ sdio_ireg = sd_ireg;
++ sd_ireg = 0;
++ OS_INT_RESTORE;
++
++ sdio_claim_host(card->func);
++
++ if (sdio_ireg & DN_LD_HOST_INT_STATUS) { /* tx_done INT */
++ if (!priv->uap_dev.cmd_sent) { /* tx_done already received */
++ PRINTM(INFO,
++ "warning: tx_done already received: tx_dnld_rdy=0x%x int status=0x%x\n",
++ priv->uap_dev.cmd_sent, sdio_ireg);
++ } else {
++ priv->uap_dev.cmd_sent = FALSE;
++ priv->uap_dev.data_sent = FALSE;
++ if ( (priv->uap_dev.netdev->reg_state == NETREG_REGISTERED) && (skb_queue_len(&priv->adapter->tx_queue) < TX_LOW_WATERMARK)) {
++ os_start_queue(priv);
++ }
++ }
++ }
++ if (sdio_ireg & UP_LD_HOST_INT_STATUS) {
++ sd_card_to_host(priv);
++ }
++
++ *ireg = sdio_ireg;
++ ret = UAP_STATUS_SUCCESS;
++ sdio_release_host(card->func);
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function disables the host interrupts.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++sbi_disable_host_int(uap_private * priv)
++{
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ int ret;
++
++ ENTER();
++
++ sdio_claim_host(card->func);
++ ret = disable_host_int_mask(priv, HIM_DISABLE);
++ sdio_release_host(card->func);
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function enables the host interrupts.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS
++ */
++int
++sbi_enable_host_int(uap_private * priv)
++{
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ int ret;
++
++ ENTER();
++
++ sdio_claim_host(card->func);
++ ret = enable_host_int_mask(priv, HIM_ENABLE);
++ sdio_release_host(card->func);
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function de-registers the device.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS
++ */
++int
++sbi_unregister_dev(uap_private * priv)
++{
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++
++ ENTER();
++
++ if (!card || !card->func) {
++ PRINTM(ERROR, "Error: card or function is NULL!\n");
++ goto done;
++ }
++
++ sdio_claim_host(card->func);
++ sdio_release_irq(card->func);
++ sdio_disable_func(card->func);
++ sdio_release_host(card->func);
++
++ sdio_set_drvdata(card->func, NULL);
++
++ done:
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++
++/**
++ * @brief This function registers the device.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++sbi_register_dev(uap_private * priv)
++{
++ int ret = UAP_STATUS_FAILURE;
++ u8 reg;
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ struct sdio_func *func;
++
++ ENTER();
++
++ if (!card || !card->func) {
++ PRINTM(ERROR, "Error: card or function is NULL!\n");
++ goto done;
++ }
++
++ func = card->func;
++
++ /* Initialize the private structure */
++ priv->uap_dev.ioport = 0;
++
++ sdio_claim_host(func);
++
++ ret = sdio_enable_func(func);
++ if (ret) {
++ PRINTM(FATAL, "sdio_enable_func() failed: ret=%d\n", ret);
++ goto release_host;
++ }
++
++ ret = sdio_claim_irq(func, sbi_interrupt);
++ if (ret) {
++ PRINTM(FATAL, "sdio_claim_irq failed: ret=%d\n", ret);
++ goto disable_func;
++ }
++
++ /* Read the IO port */
++ ret = sbi_read_ioreg(priv, IO_PORT_0_REG, ®);
++ if (ret)
++ goto release_irq;
++ else
++ priv->uap_dev.ioport |= reg;
++
++ ret = sbi_read_ioreg(priv, IO_PORT_1_REG, ®);
++ if (ret)
++ goto release_irq;
++ else
++ priv->uap_dev.ioport |= (reg << 8);
++
++ ret = sbi_read_ioreg(priv, IO_PORT_2_REG, ®);
++ if (ret)
++ goto release_irq;
++ else
++ priv->uap_dev.ioport |= (reg << 16);
++
++ PRINTM(INFO, "SDIO FUNC #%d IO port: 0x%x\n", func->num,
++ priv->uap_dev.ioport);
++
++ ret = sdio_set_block_size(card->func, SD_BLOCK_SIZE);
++ if (ret) {
++ PRINTM(ERROR, "%s: cannot set SDIO block size\n", __FUNCTION__);
++ ret = UAP_STATUS_FAILURE;
++ goto release_irq;
++ }
++ priv->hotplug_device = &func->dev;
++
++ if (helper_name == NULL) {
++ helper_name = DEFAULT_HELPER_NAME;
++ }
++ if (fw_name == NULL) {
++ fw_name = DEFAULT_FW_NAME;
++ }
++ sdio_release_host(func);
++
++ sdio_set_drvdata(func, card);
++
++ ret = UAP_STATUS_SUCCESS;
++ goto done;
++
++ release_irq:
++ sdio_release_irq(func);
++ disable_func:
++ sdio_disable_func(func);
++ release_host:
++ sdio_release_host(func);
++
++ done:
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function sends data to the card.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param payload A pointer to the data/cmd buffer
++ * @param nb the length of data/cmd
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++sbi_host_to_card(uap_private * priv, u8 * payload, u16 nb)
++{
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ int ret = UAP_STATUS_SUCCESS;
++ int buf_block_len;
++ int blksz;
++ int i = 0;
++ u8 *buf = NULL;
++#ifdef PXA3XX_DMA_ALIGN
++ void *tmpbuf = NULL;
++ int tmpbufsz;
++#endif
++
++ ENTER();
++
++ if (!card || !card->func) {
++ PRINTM(ERROR, "card or function is NULL!\n");
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++ buf = payload;
++#ifdef PXA3XX_DMA_ALIGN
++ if ((u32) payload & (PXA3XX_DMA_ALIGNMENT - 1)) {
++ tmpbufsz = ALIGN_SZ(nb, PXA3XX_DMA_ALIGNMENT);
++ tmpbuf = kmalloc(tmpbufsz, GFP_KERNEL);
++ memset(tmpbuf, 0, tmpbufsz);
++ /* Ensure 8-byte aligned CMD buffer */
++ buf = (u8 *) ALIGN_ADDR(tmpbuf, PXA3XX_DMA_ALIGNMENT);
++ memcpy(buf, payload, nb);
++ }
++#endif
++ /* Allocate buffer and copy payload */
++ blksz = SD_BLOCK_SIZE;
++ buf_block_len = (nb + blksz - 1) / blksz;
++ sdio_claim_host(card->func);
++#define MAX_WRITE_IOMEM_RETRY 2
++ priv->uap_dev.cmd_sent = TRUE;
++ priv->uap_dev.data_sent = TRUE;
++ do {
++ /* Transfer data to card */
++ ret = sdio_writesb(card->func, priv->uap_dev.ioport, buf,
++ buf_block_len * blksz);
++ if (ret < 0) {
++ i++;
++ PRINTM(ERROR, "host_to_card, write iomem (%d) failed: %d\n", i,
++ ret);
++ ret = UAP_STATUS_FAILURE;
++ if (i > MAX_WRITE_IOMEM_RETRY)
++ goto exit;
++ } else {
++ HEXDUMP("SDIO Blk Wr", payload, nb);
++ }
++ } while (ret == UAP_STATUS_FAILURE);
++ exit:
++ sdio_release_host(card->func);
++#ifdef PXA3XX_DMA_ALIGN
++ if (tmpbuf)
++ kfree(tmpbuf);
++#endif
++ if (ret == UAP_STATUS_FAILURE) {
++ priv->uap_dev.cmd_sent = FALSE;
++ priv->uap_dev.data_sent = FALSE;
++ }
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function reads CIS information.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param cisinfo A pointer to CIS information output buffer
++ * @param cislen A pointer to length of CIS info output buffer
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++#if 0
++static int
++sbi_get_cis_info(uap_private * priv, void *cisinfo, int *cislen)
++{
++#define CIS_PTR (0x8000)
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ unsigned int i, cis_ptr = CIS_PTR;
++ int ret = UAP_STATUS_FAILURE;
++
++ ENTER();
++
++ if (!card || !card->func) {
++ PRINTM(ERROR, "sbi_get_cis_info(): card or function is NULL!\n");
++ goto exit;
++ }
++#define MAX_SDIO_CIS_INFO_LEN (256)
++ if (!cisinfo || (*cislen < MAX_SDIO_CIS_INFO_LEN)) {
++ PRINTM(WARN, "ERROR! get_cis_info: insufficient buffer passed\n");
++ goto exit;
++ }
++
++ *cislen = MAX_SDIO_CIS_INFO_LEN;
++
++ sdio_claim_host(card->func);
++
++ PRINTM(INFO, "cis_ptr=%#x\n", cis_ptr);
++
++ /* Read the Tuple Data */
++ for (i = 0; i < *cislen; i++) {
++ ((unsigned char *) cisinfo)[i] =
++ sdio_readb(card->func, cis_ptr + i, &ret);
++ if (ret) {
++ PRINTM(WARN, "get_cis_info error: ret=%d\n", ret);
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ PRINTM(INFO, "cisinfo[%d]=%#x\n", i, ((unsigned char *) cisinfo)[i]);
++ }
++
++ done:
++ sdio_release_host(card->func);
++ exit:
++ LEAVE();
++ return ret;
++}
++#endif
++/**
++ * @brief This function downloads helper image to the card.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++sbi_prog_helper(uap_private * priv)
++{
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ u8 *helper = NULL;
++ int helperlen;
++ int ret = UAP_STATUS_SUCCESS;
++ void *tmphlprbuf = NULL;
++ int tmphlprbufsz;
++ u8 *hlprbuf;
++ int hlprblknow;
++ u32 tx_len;
++#ifdef FW_DOWNLOAD_SPEED
++ u32 tv1, tv2;
++#endif
++
++ ENTER();
++
++ if (!card || !card->func) {
++ PRINTM(ERROR, "sbi_prog_helper(): card or function is NULL!\n");
++ goto done;
++ }
++
++ if (priv->fw_helper) {
++ helper = (u8 *) priv->fw_helper->data;
++ helperlen = priv->fw_helper->size;
++ } else {
++ PRINTM(MSG, "No helper image found! Terminating download.\n");
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++
++ PRINTM(INFO, "Downloading helper image (%d bytes), block size %d bytes\n",
++ helperlen, SD_BLOCK_SIZE);
++
++#ifdef FW_DOWNLOAD_SPEED
++ tv1 = get_utimeofday();
++#endif
++
++#ifdef PXA3XX_DMA_ALIGN
++ tmphlprbufsz = ALIGN_SZ(UAP_UPLD_SIZE, PXA3XX_DMA_ALIGNMENT);
++#else /* !PXA3XX_DMA_ALIGN */
++ tmphlprbufsz = UAP_UPLD_SIZE;
++#endif /* !PXA3XX_DMA_ALIGN */
++ tmphlprbuf = kmalloc(tmphlprbufsz, GFP_KERNEL);
++ if (!tmphlprbuf) {
++ PRINTM(ERROR,
++ "Unable to allocate buffer for helper. Terminating download\n");
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ memset(tmphlprbuf, 0, tmphlprbufsz);
++#ifdef PXA3XX_DMA_ALIGN
++ hlprbuf = (u8 *) ALIGN_ADDR(tmphlprbuf, PXA3XX_DMA_ALIGNMENT);
++#else /* !PXA3XX_DMA_ALIGN */
++ hlprbuf = (u8 *) tmphlprbuf;
++#endif /* !PXA3XX_DMA_ALIGN */
++
++ sdio_claim_host(card->func);
++
++ /* Perform helper data transfer */
++ tx_len = (FIRMWARE_TRANSFER_NBLOCK * SD_BLOCK_SIZE) - INTF_HEADER_LEN;
++ hlprblknow = 0;
++ do {
++ /* The host polls for the DN_LD_CARD_RDY and CARD_IO_READY bits */
++ ret = mv_sdio_poll_card_status(priv, CARD_IO_READY | DN_LD_CARD_RDY);
++ if (ret < 0) {
++ PRINTM(FATAL, "Helper download poll status timeout @ %d\n",
++ hlprblknow);
++ goto done;
++ }
++
++ /* More data? */
++ if (hlprblknow >= helperlen)
++ break;
++
++ /* Set blocksize to transfer - checking for last block */
++ if (helperlen - hlprblknow < tx_len)
++ tx_len = helperlen - hlprblknow;
++
++ /* Set length to the 4-byte header */
++ *(u32 *) hlprbuf = uap_cpu_to_le32(tx_len);
++
++ /* Copy payload to buffer */
++ memcpy(&hlprbuf[INTF_HEADER_LEN], &helper[hlprblknow], tx_len);
++
++ PRINTM(INFO, ".");
++
++ /* Send data */
++ ret = sdio_writesb(card->func, priv->uap_dev.ioport,
++ hlprbuf, FIRMWARE_TRANSFER_NBLOCK * SD_BLOCK_SIZE);
++
++ if (ret < 0) {
++ PRINTM(FATAL, "IO error during helper download @ %d\n", hlprblknow);
++ goto done;
++ }
++
++ hlprblknow += tx_len;
++ } while (TRUE);
++
++#ifdef FW_DOWNLOAD_SPEED
++ tv2 = get_utimeofday();
++ PRINTM(INFO, "helper: %ld.%03ld.%03ld ", tv1 / 1000000,
++ (tv1 % 1000000) / 1000, tv1 % 1000);
++ PRINTM(INFO, " -> %ld.%03ld.%03ld ", tv2 / 1000000, (tv2 % 1000000) / 1000,
++ tv2 % 1000);
++ tv2 -= tv1;
++ PRINTM(INFO, " == %ld.%03ld.%03ld\n", tv2 / 1000000, (tv2 % 1000000) / 1000,
++ tv2 % 1000);
++#endif
++
++ /* Write last EOF data */
++ PRINTM(INFO, "\nTransferring helper image EOF block\n");
++ memset(hlprbuf, 0x0, SD_BLOCK_SIZE);
++ ret = sdio_writesb(card->func, priv->uap_dev.ioport,
++ hlprbuf, SD_BLOCK_SIZE);
++
++ if (ret < 0) {
++ PRINTM(FATAL, "IO error in writing helper image EOF block\n");
++ goto done;
++ }
++
++ ret = UAP_STATUS_SUCCESS;
++
++ done:
++ sdio_release_host(card->func);
++ if (tmphlprbuf)
++ kfree(tmphlprbuf);
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function downloads firmware image to the card.
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++sbi_prog_fw_w_helper(uap_private * priv)
++{
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ u8 *firmware = NULL;
++ int firmwarelen;
++ u8 base0;
++ u8 base1;
++ int ret = UAP_STATUS_SUCCESS;
++ int offset;
++ void *tmpfwbuf = NULL;
++ int tmpfwbufsz;
++ u8 *fwbuf;
++ u16 len;
++ int txlen = 0;
++ int tx_blocks = 0;
++ int i = 0;
++ int tries = 0;
++#ifdef FW_DOWNLOAD_SPEED
++ u32 tv1, tv2;
++#endif
++
++ ENTER();
++
++ if (!card || !card->func) {
++ PRINTM(ERROR, "sbi_prog_fw_w_helper(): card or function is NULL!\n");
++ goto done;
++ }
++
++ if (priv->firmware) {
++ firmware = (u8 *) priv->firmware->data;
++ firmwarelen = priv->firmware->size;
++ } else {
++ PRINTM(MSG, "No firmware image found! Terminating download.\n");
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++
++ PRINTM(INFO, "Downloading FW image (%d bytes)\n", firmwarelen);
++
++#ifdef FW_DOWNLOAD_SPEED
++ tv1 = get_utimeofday();
++#endif
++
++#ifdef PXA3XX_DMA_ALIGN
++ tmpfwbufsz = ALIGN_SZ(UAP_UPLD_SIZE, PXA3XX_DMA_ALIGNMENT);
++#else /* PXA3XX_DMA_ALIGN */
++ tmpfwbufsz = UAP_UPLD_SIZE;
++#endif /* PXA3XX_DMA_ALIGN */
++ tmpfwbuf = kmalloc(tmpfwbufsz, GFP_KERNEL);
++ if (!tmpfwbuf) {
++ PRINTM(ERROR,
++ "Unable to allocate buffer for firmware. Terminating download.\n");
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ memset(tmpfwbuf, 0, tmpfwbufsz);
++#ifdef PXA3XX_DMA_ALIGN
++ /* Ensure 8-byte aligned firmware buffer */
++ fwbuf = (u8 *) ALIGN_ADDR(tmpfwbuf, PXA3XX_DMA_ALIGNMENT);
++#else /* PXA3XX_DMA_ALIGN */
++ fwbuf = (u8 *) tmpfwbuf;
++#endif /* PXA3XX_DMA_ALIGN */
++
++ sdio_claim_host(card->func);
++
++ /* Perform firmware data transfer */
++ offset = 0;
++ do {
++ /* The host polls for the DN_LD_CARD_RDY and CARD_IO_READY bits */
++ ret = mv_sdio_poll_card_status(priv, CARD_IO_READY | DN_LD_CARD_RDY);
++ if (ret < 0) {
++ PRINTM(FATAL, "FW download with helper poll status timeout @ %d\n",
++ offset);
++ goto done;
++ }
++
++ /* More data? */
++ if (offset >= firmwarelen)
++ break;
++
++ for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
++ if ((ret = sbi_read_ioreg(priv, HOST_F1_RD_BASE_0, &base0)) < 0) {
++ PRINTM(WARN, "Dev BASE0 register read failed:"
++ " base0=0x%04X(%d). Terminating download.\n", base0,
++ base0);
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ if ((ret = sbi_read_ioreg(priv, HOST_F1_RD_BASE_1, &base1)) < 0) {
++ PRINTM(WARN, "Dev BASE1 register read failed:"
++ " base1=0x%04X(%d). Terminating download.\n", base1,
++ base1);
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ len = (((u16) base1) << 8) | base0;
++
++ /* For SD8688 wait until the length is not 0, 1 or 2 before
++ downloading the first FW block, since BOOT code writes the
++ register to indicate the helper/FW download winner, the value
++ could be 1 or 2 (Func1 or Func2). */
++ if ((len && offset) || (len > 2))
++ break;
++ udelay(10);
++ }
++
++ if (len == 0)
++ break;
++ else if (len > UAP_UPLD_SIZE) {
++ PRINTM(FATAL, "FW download failure @ %d, invalid length %d\n",
++ offset, len);
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++
++ txlen = len;
++
++ if (len & BIT(0)) {
++ i++;
++ if (i > MAX_WRITE_IOMEM_RETRY) {
++ PRINTM(FATAL,
++ "FW download failure @ %d, over max retry count\n",
++ offset);
++ ret = UAP_STATUS_FAILURE;
++ goto done;
++ }
++ PRINTM(ERROR, "FW CRC error indicated by the helper:"
++ " len = 0x%04X, txlen = %d\n", len, txlen);
++ len &= ~BIT(0);
++ /* Setting this to 0 to resend from same offset */
++ txlen = 0;
++ } else {
++ i = 0;
++
++ /* Set blocksize to transfer - checking for last block */
++ if (firmwarelen - offset < txlen) {
++ txlen = firmwarelen - offset;
++ }
++ PRINTM(INFO, ".");
++
++ tx_blocks = (txlen + SD_BLOCK_SIZE - 1) / SD_BLOCK_SIZE;
++
++ /* Copy payload to buffer */
++ memcpy(fwbuf, &firmware[offset], txlen);
++ }
++
++ /* Send data */
++ ret = sdio_writesb(card->func, priv->uap_dev.ioport,
++ fwbuf, tx_blocks * SD_BLOCK_SIZE);
++
++ if (ret < 0) {
++ PRINTM(ERROR, "FW download, write iomem (%d) failed @ %d\n", i,
++ offset);
++ if (sbi_write_ioreg(priv, CONFIGURATION_REG, 0x04) < 0) {
++ PRINTM(ERROR, "write ioreg failed (CFG)\n");
++ }
++ }
++
++ offset += txlen;
++ } while (TRUE);
++
++ PRINTM(INFO, "\nFW download over, size %d bytes\n", offset);
++
++ ret = UAP_STATUS_SUCCESS;
++ done:
++#ifdef FW_DOWNLOAD_SPEED
++ tv2 = get_utimeofday();
++ PRINTM(INFO, "FW: %ld.%03ld.%03ld ", tv1 / 1000000,
++ (tv1 % 1000000) / 1000, tv1 % 1000);
++ PRINTM(INFO, " -> %ld.%03ld.%03ld ", tv2 / 1000000,
++ (tv2 % 1000000) / 1000, tv2 % 1000);
++ tv2 -= tv1;
++ PRINTM(INFO, " == %ld.%03ld.%03ld\n", tv2 / 1000000,
++ (tv2 % 1000000) / 1000, tv2 % 1000);
++#endif
++ sdio_release_host(card->func);
++ if (tmpfwbuf)
++ kfree(tmpfwbuf);
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function checks if the firmware is ready to accept
++ * command or not.
++ *
++ * @param priv A pointer to uap_private structure
++ * @param pollnum Poll number
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++sbi_check_fw_status(uap_private * priv, int pollnum)
++{
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ int ret = UAP_STATUS_SUCCESS;
++ u16 firmwarestat;
++ int tries;
++
++ ENTER();
++
++ sdio_claim_host(card->func);
++
++ /* Wait for firmware initialization event */
++ for (tries = 0; tries < pollnum; tries++) {
++ if ((ret = sd_read_firmware_status(priv, &firmwarestat)) < 0)
++ continue;
++ if (firmwarestat == FIRMWARE_READY) {
++ ret = UAP_STATUS_SUCCESS;
++ break;
++ } else {
++ mdelay(10);
++ ret = UAP_STATUS_FAILURE;
++ }
++ }
++
++ if (ret < 0)
++ goto done;
++
++ ret = UAP_STATUS_SUCCESS;
++ sd_get_rx_unit(priv);
++
++ done:
++ sdio_release_host(card->func);
++
++ LEAVE();
++ return ret;
++}
++
++/**
++ * @brief This function set bus clock on/off
++ *
++ * @param priv A pointer to uap_private structure
++ * @param option TRUE--on , FALSE--off
++ * @return UAP_STATUS_SUCCESS
++ */
++#if 0
++static int
++sbi_set_bus_clock(uap_private * priv, u8 option)
++{
++ ENTER();
++ LEAVE();
++ return UAP_STATUS_SUCCESS;
++}
++#endif
++
++/**
++ * @brief This function wakeup firmware
++ *
++ * @param priv A pointer to uap_private structure
++ * @return UAP_STATUS_SUCCESS or UAP_STATUS_FAILURE
++ */
++int
++sbi_wakeup_firmware(uap_private * priv)
++{
++ struct sdio_mmc_card *card = priv->uap_dev.card;
++ int ret = UAP_STATUS_SUCCESS;
++
++ ENTER();
++
++ if (!card || !card->func) {
++ PRINTM(ERROR, "card or function is NULL!\n");
++ LEAVE();
++ return UAP_STATUS_FAILURE;
++ }
++ sdio_claim_host(card->func);
++ sdio_writeb(card->func, HOST_POWER_UP, CONFIGURATION_REG, &ret);
++ sdio_release_host(card->func);
++ LEAVE();
++ return ret;
++}
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_sdio_mmc.h backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_sdio_mmc.h
+--- backports-3.18.1-1.org/drivers/net/wireless/libertas_uap/uap_sdio_mmc.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/libertas_uap/uap_sdio_mmc.h 2014-12-29 20:37:43.955764567 +0100
+@@ -0,0 +1,136 @@
++/** @file uap_sdio_mmc.h
++ * @brief This file contains SDIO IF (interface) module
++ * related macros, enum, and structure.
++ *
++ * Copyright (C) 2007-2009, Marvell International Ltd.
++ *
++ * This software file (the "File") is distributed by Marvell International
++ * Ltd. under the terms of the GNU General Public License Version 2, June 1991
++ * (the "License"). You may use, redistribute and/or modify this File in
++ * accordance with the terms and conditions of the License, a copy of which
++ * is available along with the File in the gpl.txt file or by writing to
++ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
++ *
++ * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
++ * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
++ * this warranty disclaimer.
++ *
++ */
++/****************************************************
++Change log:
++ 10/10/07: initial version
++****************************************************/
++
++#ifndef _UAP_SDIO_MMC_H
++#define _UAP_SDIO_MMC_H
++
++#include <linux/mmc/sdio.h>
++#include <linux/mmc/sdio_ids.h>
++#include <linux/mmc/sdio_func.h>
++#include <linux/mmc/card.h>
++
++#include "uap_headers.h"
++
++/** The number of times to try when waiting for downloaded firmware to
++ become active. (polling the scratch register). */
++#define MAX_FIRMWARE_POLL_TRIES 100
++
++/** Firmware ready */
++#define FIRMWARE_READY 0xfedc
++
++/** Number of firmware blocks to transfer */
++#define FIRMWARE_TRANSFER_NBLOCK 2
++
++/* Host Control Registers */
++/** Host Control Registers : I/O port 0 */
++#define IO_PORT_0_REG 0x00
++/** Host Control Registers : I/O port 1 */
++#define IO_PORT_1_REG 0x01
++/** Host Control Registers : I/O port 2 */
++#define IO_PORT_2_REG 0x02
++
++/** Host Control Registers : Configuration */
++#define CONFIGURATION_REG 0x03
++/** Host Control Registers : Host without Command 53 finish host */
++#define HOST_WO_CMD53_FINISH_HOST (0x1U << 2)
++/** Host Control Registers : Host power up */
++#define HOST_POWER_UP (0x1U << 1)
++/** Host Control Registers : Host power down */
++#define HOST_POWER_DOWN (0x1U << 0)
++
++/** Host Control Registers : Host interrupt mask */
++#define HOST_INT_MASK_REG 0x04
++/** Host Control Registers : Upload host interrupt mask */
++#define UP_LD_HOST_INT_MASK (0x1U)
++/** Host Control Registers : Download host interrupt mask */
++#define DN_LD_HOST_INT_MASK (0x2U)
++/** Enable Host interrupt mask */
++#define HIM_ENABLE (UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK)
++/** Disable Host interrupt mask */
++#define HIM_DISABLE 0xff
++
++/** Host Control Registers : Host interrupt status */
++#define HOST_INTSTATUS_REG 0x05
++/** Host Control Registers : Upload host interrupt status */
++#define UP_LD_HOST_INT_STATUS (0x1U)
++/** Host Control Registers : Download host interrupt status */
++#define DN_LD_HOST_INT_STATUS (0x2U)
++
++/** Host F1 read base 0 */
++#define HOST_F1_RD_BASE_0 0x10
++/** Host F1 read base 1 */
++#define HOST_F1_RD_BASE_1 0x11
++
++/** Card Control Registers : Card status register */
++#define CARD_STATUS_REG 0x20
++/** Card Control Registers : Card I/O ready */
++#define CARD_IO_READY (0x1U << 3)
++/** Card Control Registers : CIS card ready */
++#define CIS_CARD_RDY (0x1U << 2)
++/** Card Control Registers : Upload card ready */
++#define UP_LD_CARD_RDY (0x1U << 1)
++/** Card Control Registers : Download card ready */
++#define DN_LD_CARD_RDY (0x1U << 0)
++
++/** Card Control Registers : Card OCR 0 register */
++#define CARD_OCR_0_REG 0x34
++/** Card Control Registers : Card OCR 1 register */
++#define CARD_OCR_1_REG 0x35
++
++/** Firmware status 0 register */
++#define CARD_FW_STATUS0_REG 0x40
++/** Firmware status 1 register */
++#define CARD_FW_STATUS1_REG 0x41
++/** Rx length register */
++#define CARD_RX_LEN_REG 0x42
++/** Rx unit register */
++#define CARD_RX_UNIT_REG 0x43
++
++/** Chip Id Register 0 */
++#define CARD_CHIP_ID_0_REG 0x801c
++/** Chip Id Register 1 */
++#define CARD_CHIP_ID_1_REG 0x801d
++
++#ifdef PXA3XX_DMA_ALIGN
++/** DMA alignment value for PXA3XX platforms */
++#define PXA3XX_DMA_ALIGNMENT 8
++/** Macros for Data Alignment : size */
++#define ALIGN_SZ(p, a) \
++ (((p) + ((a) - 1)) & ~((a) - 1))
++
++/** Macros for Data Alignment : address */
++#define ALIGN_ADDR(p, a) \
++ ((((u32)(p)) + (((u32)(a)) - 1)) & ~(((u32)(a)) - 1))
++#endif /* PXA3XX_DMA_ALIGN */
++
++struct sdio_mmc_card
++{
++ /** sdio_func structure pointer */
++ struct sdio_func *func;
++ /** uap_private structure pointer */
++ uap_private *priv;
++};
++
++#endif /* _UAP_SDIO_MMC_H */
+diff -Naur backports-3.18.1-1.org/drivers/net/wireless/Makefile backports-3.18.1-1/drivers/net/wireless/Makefile
+--- backports-3.18.1-1.org/drivers/net/wireless/Makefile 2014-12-21 22:37:15.000000000 +0100
++++ backports-3.18.1-1/drivers/net/wireless/Makefile 2014-12-29 20:40:33.632440784 +0100
+@@ -60,3 +60,5 @@
+
+ obj-$(CPTCFG_CW1200) += cw1200/
+ obj-$(CPTCFG_RSI_91X) += rsi/
++
++obj-$(CPTCFG_LIBERTAS_UAP) += libertas_uap/
--- /dev/null
+Index: clamav-0.97.3/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
+===================================================================
+--- clamav-0.97.3.orig/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
++++ clamav-0.97.3/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp
+@@ -52,6 +52,7 @@ static void runAtExitHandlers() {
+ #include <sys/stat.h>
+ #endif
+ #include <fcntl.h>
++#include <unistd.h>
+ /* stat functions are redirecting to __xstat with a version number. On x86-64
+ * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'
+ * available as an exported symbol, so we have to add it explicitly.
--- /dev/null
+From 4bbfb2b9f391f273744163cfda7bec96671e9d9c Mon Sep 17 00:00:00 2001
+From: Florian Forster <octo@collectd.org>
+Date: Thu, 18 Apr 2013 06:25:58 +0200
+Subject: [PATCH 01/22] src/utils_mount.h: Add <stdio.h>.
+
+This is required on Solaris 10. Thanks to dannypoo@ for reporting this
+problem.
+
+Github: #306
+---
+ src/utils_mount.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/utils_mount.h b/src/utils_mount.h
+index 1f2403c..83f789b 100644
+--- a/src/utils_mount.h
++++ b/src/utils_mount.h
+@@ -26,6 +26,7 @@
+ #ifndef COLLECTD_UTILS_MOUNT_H
+ #define COLLECTD_UTILS_MOUNT_H 1
+
++#include <stdio.h>
+ #if HAVE_FS_INFO_H
+ # include <fs_info.h>
+ #endif
+--
+1.9.3
+
--- /dev/null
+From f2391b9da6127e4acd5b54b7ae6c2d585df0e2a0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Joaqu=C3=ADn=20Cuenca=20Abela?= <e98cuenc@gmail.com>
+Date: Wed, 29 May 2013 16:22:09 +0200
+Subject: [PATCH 02/22] Don't notify continuously when MySQL slave SQL thread
+ is running
+
+Signed-off-by: Florian Forster <octo@collectd.org>
+---
+ src/mysql.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mysql.c b/src/mysql.c
+index 8b3cd21..f93a442 100644
+--- a/src/mysql.c
++++ b/src/mysql.c
+@@ -689,7 +689,7 @@ static int mysql_read_slave_stats (mysql_database_t *db, MYSQL *con)
+ ssnprintf (n.message, sizeof (n.message),
+ "slave SQL thread started");
+ plugin_dispatch_notification (&n);
+- db->slave_sql_running = 0;
++ db->slave_sql_running = 1;
+ }
+ }
+
+--
+1.9.3
+
--- /dev/null
+From bbbf37d55a3959951604c4be482e9a705a0f86d9 Mon Sep 17 00:00:00 2001
+From: Marc Fournier <marc.fournier@camptocamp.com>
+Date: Tue, 7 Jan 2014 11:30:59 +0100
+Subject: [PATCH 03/22] curl_xml.c: avoid using uninitalized variable in error
+ message
+
+Thanks to @trtrmitya for reporting this. Fixes GH#507
+---
+ src/curl_xml.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/curl_xml.c b/src/curl_xml.c
+index 75f5cc3..77aee60 100644
+--- a/src/curl_xml.c
++++ b/src/curl_xml.c
+@@ -551,12 +551,12 @@ static int cx_curl_perform (cx_t *db, CURL *curl) /* {{{ */
+ char *ptr;
+ char *url;
+
+- db->buffer_fill = 0;
++ db->buffer_fill = 0;
+ status = curl_easy_perform (curl);
+ if (status != CURLE_OK)
+ {
+- ERROR ("curl_xml plugin: curl_easy_perform failed with status %i: %s (%s)",
+- status, db->curl_errbuf, url);
++ ERROR ("curl_xml plugin: curl_easy_perform failed with status %i: %s",
++ status, db->curl_errbuf);
+ return (-1);
+ }
+
+--
+1.9.3
+
--- /dev/null
+From 645dadb3fcc466e8880fda4eb23b21ad433631fc Mon Sep 17 00:00:00 2001
+From: Marc Fournier <marc.fournier@camptocamp.com>
+Date: Tue, 7 Jan 2014 16:06:10 +0100
+Subject: [PATCH 04/22] interface.c: FreeBSD-10 support
+
+Quoting @trtrmitya in github issue #506 : "[...] it is broken on
+FreeBSD-10, in which getifaddrs() returns not only link level stats for
+a particular interface, but also entries for each IP configured on that
+interface. As a result if_submit() is called several times for each
+interface, which results in incorrect data being logged.
+
+I am attaching a patch which fixes a problem on FreeBSD (9/10), but it
+should work for every *BSD because [...] the getifaddrs implementation
+first appeared in BSDi BSD/OS."
+
+Many thanks to @trtrmitya for providing the patch !
+---
+ src/interface.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/src/interface.c b/src/interface.c
+index db998a3..9b566ea 100644
+--- a/src/interface.c
++++ b/src/interface.c
+@@ -213,18 +213,19 @@ static int interface_read (void)
+
+ for (if_ptr = if_list; if_ptr != NULL; if_ptr = if_ptr->ifa_next)
+ {
+- if ((if_data = (struct IFA_DATA *) if_ptr->ifa_data) == NULL)
+- continue;
++ if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) {
++ if_data = (struct IFA_DATA *) if_ptr->ifa_data;
+
+- if_submit (if_ptr->ifa_name, "if_octets",
++ if_submit (if_ptr->ifa_name, "if_octets",
+ if_data->IFA_RX_BYTES,
+ if_data->IFA_TX_BYTES);
+- if_submit (if_ptr->ifa_name, "if_packets",
++ if_submit (if_ptr->ifa_name, "if_packets",
+ if_data->IFA_RX_PACKT,
+ if_data->IFA_TX_PACKT);
+- if_submit (if_ptr->ifa_name, "if_errors",
++ if_submit (if_ptr->ifa_name, "if_errors",
+ if_data->IFA_RX_ERROR,
+ if_data->IFA_TX_ERROR);
++ }
+ }
+
+ freeifaddrs (if_list);
+--
+1.9.3
+
--- /dev/null
+From cde09b547abbeb7595d91259fcc628504d0f55a9 Mon Sep 17 00:00:00 2001
+From: Marc Fournier <marc.fournier@camptocamp.com>
+Date: Wed, 8 Jan 2014 18:05:40 +0100
+Subject: [PATCH 05/22] Revert "curl_xml.c: avoid using uninitalized variable
+ in error message"
+
+This reverts commit bbbf37d55a3959951604c4be482e9a705a0f86d9.
+
+A different fix for this problem was commited to the collectd-5.4 branch
+(8327ee64) and conflicts with this patch. Also, initializing url the
+same way as 8327ee64 does it, to avoid a merge conflict.
+---
+ src/curl_xml.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/curl_xml.c b/src/curl_xml.c
+index 77aee60..b941f02 100644
+--- a/src/curl_xml.c
++++ b/src/curl_xml.c
+@@ -550,13 +550,14 @@ static int cx_curl_perform (cx_t *db, CURL *curl) /* {{{ */
+ long rc;
+ char *ptr;
+ char *url;
++ url = db->url;
+
+- db->buffer_fill = 0;
++ db->buffer_fill = 0;
+ status = curl_easy_perform (curl);
+ if (status != CURLE_OK)
+ {
+- ERROR ("curl_xml plugin: curl_easy_perform failed with status %i: %s",
+- status, db->curl_errbuf);
++ ERROR ("curl_xml plugin: curl_easy_perform failed with status %i: %s (%s)",
++ status, db->curl_errbuf, url);
+ return (-1);
+ }
+
+--
+1.9.3
+
--- /dev/null
+From ddffda7a150cd3abdb6ec392b514a250e91e0c19 Mon Sep 17 00:00:00 2001
+From: Chris Lundquist <chris.lundquist@github.com>
+Date: Tue, 14 Jan 2014 18:33:13 -0800
+Subject: [PATCH 06/22] [network] set_thread_cbs so we initialize the right
+ threading mode in gcry_check_version
+
+Signed-off-by: Florian Forster <octo@collectd.org>
+---
+ src/network.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/network.c b/src/network.c
+index d0ff6bc..be82c6f 100644
+--- a/src/network.c
++++ b/src/network.c
+@@ -500,8 +500,8 @@ static void network_init_gcrypt (void) /* {{{ */
+ if (gcry_control (GCRYCTL_ANY_INITIALIZATION_P))
+ return;
+
+- gcry_check_version (NULL); /* before calling any other functions */
+ gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
++ gcry_check_version (NULL); /* before calling *almost* any other functions */
+ gcry_control (GCRYCTL_INIT_SECMEM, 32768);
+ gcry_control (GCRYCTL_INITIALIZATION_FINISHED);
+ } /* }}} void network_init_gcrypt */
+--
+1.9.3
+
--- /dev/null
+From 5f2f969335757f31f42cd8bb7e38eb8c5fe5e56e Mon Sep 17 00:00:00 2001
+From: Florian Forster <octo@collectd.org>
+Date: Wed, 15 Jan 2014 23:47:33 +0100
+Subject: [PATCH 07/22] apache plugin: Call curl_global_init() from the init
+ function.
+
+This is a shot in the dark in trying to address #513. By calling this
+from an init() callback, I hope to be initializing the curl and gcrypt
+libraries before collectd becomes multi-threaded, avoiding the problems
+described in the issue.
+---
+ src/apache.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/apache.c b/src/apache.c
+index 899c21e..23bba3e 100644
+--- a/src/apache.c
++++ b/src/apache.c
+@@ -702,9 +702,18 @@ static int apache_read_host (user_data_t *user_data) /* {{{ */
+ return (0);
+ } /* }}} int apache_read_host */
+
++static int apache_init (void) /* {{{ */
++{
++ /* Call this while collectd is still single-threaded to avoid
++ * initialization issues in libgcrypt. */
++ curl_global_init (CURL_GLOBAL_SSL);
++ return (0);
++} /* }}} int apache_init */
++
+ void module_register (void)
+ {
+ plugin_register_complex_config ("apache", config);
++ plugin_register_init ("apache", apache_init);
+ } /* void module_register */
+
+ /* vim: set sw=8 noet fdm=marker : */
+--
+1.9.3
+
--- /dev/null
+From 793c2046de1ac04689d541a5e83513fe8e62578c Mon Sep 17 00:00:00 2001
+From: Marc Fournier <marc.fournier@camptocamp.com>
+Date: Thu, 16 Jan 2014 00:30:42 +0100
+Subject: [PATCH 08/22] network: comment libgcrypt initalization process
+
+---
+ src/network.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/network.c b/src/network.c
+index be82c6f..f379a5c 100644
+--- a/src/network.c
++++ b/src/network.c
+@@ -500,8 +500,15 @@ static void network_init_gcrypt (void) /* {{{ */
+ if (gcry_control (GCRYCTL_ANY_INITIALIZATION_P))
+ return;
+
++ /* http://www.gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html
++ * To ensure thread-safety, it's important to set GCRYCTL_SET_THREAD_CBS
++ * *before* initalizing Libgcrypt with gcry_check_version(), which itself must
++ * be called before any other gcry_* function. GCRYCTL_ANY_INITIALIZATION_P
++ * above doesn't count, as it doesn't implicitly initalize Libgcrypt.
++ *
++ * tl;dr: keep all these gry_* statements in this exact order please. */
+ gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+- gcry_check_version (NULL); /* before calling *almost* any other functions */
++ gcry_check_version (NULL);
+ gcry_control (GCRYCTL_INIT_SECMEM, 32768);
+ gcry_control (GCRYCTL_INITIALIZATION_FINISHED);
+ } /* }}} void network_init_gcrypt */
+--
+1.9.3
+
--- /dev/null
+From 66b400ab01b8133e450bb002e175117a1ab6f9ae Mon Sep 17 00:00:00 2001
+From: Jeremy Katz <jeremy@katzbox.net>
+Date: Sun, 26 Jan 2014 20:43:19 -0500
+Subject: [PATCH 09/22] Call curl_global_init() in _init of plugins using curl
+
+Need to call curl_global_init() or curl_easy_init() during init
+for plugins when we're still running single threaded. This
+updates the remaining ones
+---
+ src/curl.c | 1 +
+ src/curl_json.c | 9 +++++++++
+ src/curl_xml.c | 9 +++++++++
+ src/write_http.c | 9 +++++++++
+ 4 files changed, 28 insertions(+)
+
+diff --git a/src/curl.c b/src/curl.c
+index 3899aaa..8d2893f 100644
+--- a/src/curl.c
++++ b/src/curl.c
+@@ -566,6 +566,7 @@ static int cc_init (void) /* {{{ */
+ INFO ("curl plugin: No pages have been defined.");
+ return (-1);
+ }
++ curl_global_init (CURL_GLOBAL_SSL);
+ return (0);
+ } /* }}} int cc_init */
+
+diff --git a/src/curl_json.c b/src/curl_json.c
+index 24e1df1..0948962 100644
+--- a/src/curl_json.c
++++ b/src/curl_json.c
+@@ -882,9 +882,18 @@ static int cj_read (user_data_t *ud) /* {{{ */
+ return cj_curl_perform (db, db->curl);
+ } /* }}} int cj_read */
+
++static int cj_init (void) /* {{{ */
++{
++ /* Call this while collectd is still single-threaded to avoid
++ * initialization issues in libgcrypt. */
++ curl_global_init (CURL_GLOBAL_SSL);
++ return (0);
++} /* }}} int cj_init */
++
+ void module_register (void)
+ {
+ plugin_register_complex_config ("curl_json", cj_config);
++ plugin_register_init ("curl_json", cj_init);
+ } /* void module_register */
+
+ /* vim: set sw=2 sts=2 et fdm=marker : */
+diff --git a/src/curl_xml.c b/src/curl_xml.c
+index b941f02..e31e73d 100644
+--- a/src/curl_xml.c
++++ b/src/curl_xml.c
+@@ -926,9 +926,18 @@ static int cx_config (oconfig_item_t *ci) /* {{{ */
+ return (0);
+ } /* }}} int cx_config */
+
++static int cx_init (void) /* {{{ */
++{
++ /* Call this while collectd is still single-threaded to avoid
++ * initialization issues in libgcrypt. */
++ curl_global_init (CURL_GLOBAL_SSL);
++ return (0);
++} /* }}} int cx_init */
++
+ void module_register (void)
+ {
+ plugin_register_complex_config ("curl_xml", cx_config);
++ plugin_register_init ("curl_xml", cx_init);
+ } /* void module_register */
+
+ /* vim: set sw=2 sts=2 et fdm=marker : */
+diff --git a/src/write_http.c b/src/write_http.c
+index 62c73b0..04c637b 100644
+--- a/src/write_http.c
++++ b/src/write_http.c
+@@ -656,9 +656,18 @@ static int wh_config (oconfig_item_t *ci) /* {{{ */
+ return (0);
+ } /* }}} int wh_config */
+
++static int wh_init (void) /* {{{ */
++{
++ /* Call this while collectd is still single-threaded to avoid
++ * initialization issues in libgcrypt. */
++ curl_global_init (CURL_GLOBAL_SSL);
++ return (0);
++} /* }}} int wh_init */
++
+ void module_register (void) /* {{{ */
+ {
+ plugin_register_complex_config ("write_http", wh_config);
++ plugin_register_init ("write_http", wh_init);
+ } /* }}} void module_register */
+
+ /* vim: set fdm=marker sw=8 ts=8 tw=78 et : */
+--
+1.9.3
+
--- /dev/null
+From 6bd48f2346c5072dc22da58c7b7cd8e8ceb83fc5 Mon Sep 17 00:00:00 2001
+From: Marc Fournier <marc.fournier@camptocamp.com>
+Date: Sat, 29 Mar 2014 13:37:36 +0100
+Subject: [PATCH 10/22] indent wh_init() to be consistent with the rest of the
+ file
+
+---
+ src/write_http.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/write_http.c b/src/write_http.c
+index 04c637b..0a13444 100644
+--- a/src/write_http.c
++++ b/src/write_http.c
+@@ -658,10 +658,10 @@ static int wh_config (oconfig_item_t *ci) /* {{{ */
+
+ static int wh_init (void) /* {{{ */
+ {
+- /* Call this while collectd is still single-threaded to avoid
+- * initialization issues in libgcrypt. */
+- curl_global_init (CURL_GLOBAL_SSL);
+- return (0);
++ /* Call this while collectd is still single-threaded to avoid
++ * initialization issues in libgcrypt. */
++ curl_global_init (CURL_GLOBAL_SSL);
++ return (0);
+ } /* }}} int wh_init */
+
+ void module_register (void) /* {{{ */
+--
+1.9.3
+
--- /dev/null
+From 6207fce91a0933e852ec76fc31ca81ec00ffa04b Mon Sep 17 00:00:00 2001
+From: Wilfried Goesgens <dothebart@citadel.org>
+Date: Thu, 5 Jun 2014 20:04:13 +0200
+Subject: [PATCH 11/22] Configparser: when we alocate an empty list, we also
+ need to reset the counter; else we will trip over this later. This fixes
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750440
+
+---
+ src/configfile.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/configfile.c b/src/configfile.c
+index 0b7786f..983d995 100644
+--- a/src/configfile.c
++++ b/src/configfile.c
+@@ -414,6 +414,12 @@ static int cf_ci_replace_child (oconfig_item_t *dst, oconfig_item_t *src,
+
+ /* Resize the memory containing the children to be big enough to hold
+ * all children. */
++ if (dst->children_num + src->children_num - 1 == 0)
++ {
++ dst->children_num = 0;
++ return (0);
++ }
++
+ temp = (oconfig_item_t *) realloc (dst->children,
+ sizeof (oconfig_item_t)
+ * (dst->children_num + src->children_num - 1));
+@@ -514,7 +520,8 @@ static int cf_include_all (oconfig_item_t *root, int depth)
+ continue;
+
+ /* Now replace the i'th child in `root' with `new'. */
+- cf_ci_replace_child (root, new, i);
++ if (cf_ci_replace_child (root, new, i) < 0)
++ return (-1);
+
+ /* ... and go back to the new i'th child. */
+ --i;
+--
+1.9.3
+
--- /dev/null
+From c2ca2a46e617878dcff69de0b8940ea91d3401cc Mon Sep 17 00:00:00 2001
+From: Lauri Tirkkonen <lotheac@iki.fi>
+Date: Thu, 22 May 2014 14:05:40 +0300
+Subject: [PATCH 12/22] don't assume pkg-config is in PATH
+
+---
+ configure.in | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 0b12630..7086800 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1136,8 +1136,8 @@ AC_CHECK_LIB(hal,libhal_device_property_exists,
+ [with_libhal="no"])
+ if test "x$with_libhal" = "xyes"; then
+ if test "x$PKG_CONFIG" != "x"; then
+- BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
+- BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
++ BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`"
++ BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`"
+ AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
+ fi
+@@ -3434,8 +3434,8 @@ then
+ if $PKG_CONFIG --exists tokyotyrant
+ then
+ with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
+- with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
+- with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
++ with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
++ with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
+ fi
+ fi
+
+@@ -3743,7 +3743,7 @@ with_libvirt_cflags=""
+ with_libvirt_ldflags=""
+ if test "x$PKG_CONFIG" != "x"
+ then
+- pkg-config --exists 'libxml-2.0' 2>/dev/null
++ $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
+ if test "$?" = "0"
+ then
+ with_libxml2="yes"
+@@ -3751,7 +3751,7 @@ then
+ with_libxml2="no (pkg-config doesn't know library)"
+ fi
+
+- pkg-config --exists libvirt 2>/dev/null
++ $PKG_CONFIG --exists libvirt 2>/dev/null
+ if test "$?" = "0"
+ then
+ with_libvirt="yes"
+@@ -3761,12 +3761,12 @@ then
+ fi
+ if test "x$with_libxml2" = "xyes"
+ then
+- with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
++ with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
+ if test $? -ne 0
+ then
+ with_libxml2="no"
+ fi
+- with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
++ with_libxml2_ldflags="$PKG_CONFIG --libs libxml-2.0`"
+ if test $? -ne 0
+ then
+ with_libxml2="no"
+@@ -3806,12 +3806,12 @@ if test "x$with_libxml2" = "xyes"; then
+ fi
+ if test "x$with_libvirt" = "xyes"
+ then
+- with_libvirt_cflags="`pkg-config --cflags libvirt`"
++ with_libvirt_cflags="$PKG_CONFIG --cflags libvirt`"
+ if test $? -ne 0
+ then
+ with_libvirt="no"
+ fi
+- with_libvirt_ldflags="`pkg-config --libs libvirt`"
++ with_libvirt_ldflags="$PKG_CONFIG --libs libvirt`"
+ if test $? -ne 0
+ then
+ with_libvirt="no"
+--
+1.9.3
+
--- /dev/null
+From 497f5785e8b385f03b5fb5b15bdff8ba39e4699e Mon Sep 17 00:00:00 2001
+From: Marc Fournier <marc.fournier@camptocamp.com>
+Date: Mon, 23 Jun 2014 18:00:01 +0200
+Subject: [PATCH 13/22] add missing backticks which broke the build
+
+---
+ configure.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 7086800..5dac543 100644
+--- a/configure.in
++++ b/configure.in
+@@ -3766,7 +3766,7 @@ then
+ then
+ with_libxml2="no"
+ fi
+- with_libxml2_ldflags="$PKG_CONFIG --libs libxml-2.0`"
++ with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
+ if test $? -ne 0
+ then
+ with_libxml2="no"
+@@ -3806,12 +3806,12 @@ if test "x$with_libxml2" = "xyes"; then
+ fi
+ if test "x$with_libvirt" = "xyes"
+ then
+- with_libvirt_cflags="$PKG_CONFIG --cflags libvirt`"
++ with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
+ if test $? -ne 0
+ then
+ with_libvirt="no"
+ fi
+- with_libvirt_ldflags="$PKG_CONFIG --libs libvirt`"
++ with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
+ if test $? -ne 0
+ then
+ with_libvirt="no"
+--
+1.9.3
+
--- /dev/null
+From 0da910fb1bf2bd4982ca6541458c795ec296f398 Mon Sep 17 00:00:00 2001
+From: Marc Fournier <marc.fournier@camptocamp.com>
+Date: Fri, 8 Aug 2014 15:55:10 +0200
+Subject: [PATCH 14/22] snmp: free snmp_pdu struct allocated by
+ snmp_pdu_create()
+
+This should fix the leak reported in issue #610.
+---
+ src/snmp.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/snmp.c b/src/snmp.c
+index d440f7f..dacdede 100644
+--- a/src/snmp.c
++++ b/src/snmp.c
+@@ -1503,6 +1503,10 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
+ snmp_free_pdu (res);
+ res = NULL;
+
++ if (req != NULL)
++ snmp_free_pdu (req);
++ req = NULL;
++
+ if (status == 0)
+ csnmp_dispatch_table (host, data, instance_list_head, value_list_head);
+
+--
+1.9.3
+
--- /dev/null
+From 0afea60611f115a28b8ec331aba610e3038c1ef2 Mon Sep 17 00:00:00 2001
+From: Arthur Marble <arthur@info9.net>
+Date: Sun, 17 Aug 2014 17:34:04 -0500
+Subject: [PATCH 15/22] curl_xml plugin: Fixed tautological pointer comparison
+ error.
+
+Fixes: http://bugs.debian.org/758481
+Signed-off-by: Florian Forster <octo@collectd.org>
+---
+ src/curl_xml.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/curl_xml.c b/src/curl_xml.c
+index e31e73d..28b2ded 100644
+--- a/src/curl_xml.c
++++ b/src/curl_xml.c
+@@ -344,7 +344,7 @@ static int cx_handle_instance_xpath (xmlXPathContextPtr xpath_ctx, /* {{{ */
+ /* If the base xpath returns more than one block, the result is assumed to be
+ * a table. The `Instnce' option is not optional in this case. Check for the
+ * condition and inform the user. */
+- if (is_table && (vl->type_instance == NULL))
++ if (is_table)
+ {
+ WARNING ("curl_xml plugin: "
+ "Base-XPath %s is a table (more than one result was returned), "
+--
+1.9.3
+
--- /dev/null
+From 9d065b401c2c393bef5a6e58b5deeda7d59d4f39 Mon Sep 17 00:00:00 2001
+From: Ed Okerson <ed@okerson.com>
+Date: Mon, 11 Feb 2013 15:46:10 -0600
+Subject: [PATCH 16/22] Add support for OpenVPN 2.3.0 status files.
+
+Fix a bug that breaks this module if a server is running multiple instances of OpenVPN and one instance does not have any clients connected.
+---
+ src/openvpn.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 84 insertions(+), 6 deletions(-)
+
+diff --git a/src/openvpn.c b/src/openvpn.c
+index 2aca414..d2b6f17 100644
+--- a/src/openvpn.c
++++ b/src/openvpn.c
+@@ -32,6 +32,7 @@
+ #define V1STRING "Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since\n"
+ #define V2STRING "HEADER,CLIENT_LIST,Common Name,Real Address,Virtual Address,Bytes Received,Bytes Sent,Connected Since,Connected Since (time_t)\n"
+ #define V3STRING "HEADER CLIENT_LIST Common Name Real Address Virtual Address Bytes Received Bytes Sent Connected Since Connected Since (time_t)\n"
++#define V4STRING "HEADER,CLIENT_LIST,Common Name,Real Address,Virtual Address,Bytes Received,Bytes Sent,Connected Since,Connected Since (time_t),Username\n"
+ #define VSSTRING "OpenVPN STATISTICS\n"
+
+
+@@ -43,6 +44,7 @@ struct vpn_status_s
+ MULTI1 = 1, /* status-version 1 */
+ MULTI2, /* status-version 2 */
+ MULTI3, /* status-version 3 */
++ MULTI4, /* status-version 4 */
+ SINGLE = 10 /* currently no versions for single mode, maybe in the future */
+ } version;
+ char *name;
+@@ -452,13 +454,77 @@ static int multi3_read (char *name, FILE *fh)
+ return (read);
+ } /* int multi3_read */
+
++/* for reading status version 4 */
++static int multi4_read (char *name, FILE *fh)
++{
++ char buffer[1024];
++ char *fields[11];
++ const int max_fields = STATIC_ARRAY_SIZE (fields);
++ int fields_num, read = 0;
++ long long sum_users = 0;
++
++ while (fgets (buffer, sizeof (buffer), fh) != NULL)
++ {
++ fields_num = openvpn_strsplit (buffer, fields, max_fields);
++
++ /* status file is generated by openvpn/multi.c:multi_print_status()
++ * http://svn.openvpn.net/projects/openvpn/trunk/openvpn/multi.c
++ *
++ * The line we're expecting has 9 fields. We ignore all lines
++ * with more or less fields.
++ */
++ if (fields_num != 9)
++ continue;
++
++
++ if (strcmp (fields[0], "CLIENT_LIST") != 0)
++ continue;
++
++
++ if (collect_user_count)
++ /* If so, sum all users, ignore the individuals*/
++ {
++ sum_users += 1;
++ }
++ if (collect_individual_users)
++ {
++ if (new_naming_schema)
++ {
++ /* plugin inst = file name, type inst = fields[1] */
++ iostats_submit (name, /* vpn instance */
++ fields[1], /* "Common Name" */
++ atoll (fields[4]), /* "Bytes Received" */
++ atoll (fields[5])); /* "Bytes Sent" */
++ }
++ else
++ {
++ /* plugin inst = fields[1], type inst = "" */
++ iostats_submit (fields[1], /* "Common Name" */
++ NULL, /* unused when in multimode */
++ atoll (fields[4]), /* "Bytes Received" */
++ atoll (fields[5])); /* "Bytes Sent" */
++ }
++ }
++
++ read = 1;
++ }
++
++ if (collect_user_count)
++ {
++ numusers_submit(name, name, sum_users);
++ read = 1;
++ }
++
++ return (read);
++} /* int multi4_read */
++
+ /* read callback */
+ static int openvpn_read (void)
+ {
+ FILE *fh;
+- int i, read;
++ int i, vpn_read, read;
+
+- read = 0;
++ vpn_read = read = 0;
+
+ /* call the right read function for every status entry in the list */
+ for (i = 0; i < vpn_num; i++)
+@@ -476,23 +542,28 @@ static int openvpn_read (void)
+ switch (vpn_list[i]->version)
+ {
+ case SINGLE:
+- read = single_read(vpn_list[i]->name, fh);
++ vpn_read = single_read(vpn_list[i]->name, fh);
+ break;
+
+ case MULTI1:
+- read = multi1_read(vpn_list[i]->name, fh);
++ vpn_read = multi1_read(vpn_list[i]->name, fh);
+ break;
+
+ case MULTI2:
+- read = multi2_read(vpn_list[i]->name, fh);
++ vpn_read = multi2_read(vpn_list[i]->name, fh);
+ break;
+
+ case MULTI3:
+- read = multi3_read(vpn_list[i]->name, fh);
++ vpn_read = multi3_read(vpn_list[i]->name, fh);
++ break;
++
++ case MULTI4:
++ vpn_read = multi4_read(vpn_list[i]->name, fh);
+ break;
+ }
+
+ fclose (fh);
++ read += vpn_read;
+ }
+
+ return (read ? 0 : -1);
+@@ -549,6 +620,13 @@ static int version_detect (const char *filename)
+ version = MULTI3;
+ break;
+ }
++ /* searching for multi version 4 */
++ else if (strcmp (buffer, V4STRING) == 0)
++ {
++ DEBUG ("openvpn plugin: found status file version MULTI4");
++ version = MULTI4;
++ break;
++ }
+ }
+
+ if (version == 0)
+--
+1.9.3
+
--- /dev/null
+From 8516f9abb625fa7b9321e62307305aa6499be4e8 Mon Sep 17 00:00:00 2001
+From: Florian Forster <octo@collectd.org>
+Date: Sun, 14 Sep 2014 19:28:05 +0200
+Subject: [PATCH 17/22] openvpn plugin: Don't signal an error when no clients
+ are connected.
+
+In the multi1_read() function, an error (zero) was returned when no
+clients were currently connected to the OpenVPN server, because the
+"read" variable was initialized to zero and the while loop exited before
+it was set to one. This is not the intended behavior.
+
+Thanks to @srix for reporting this issue!
+
+Fixes: #731
+---
+ src/openvpn.c | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/src/openvpn.c b/src/openvpn.c
+index d2b6f17..7d4e4a0 100644
+--- a/src/openvpn.c
++++ b/src/openvpn.c
+@@ -267,7 +267,7 @@ static int multi1_read (char *name, FILE *fh)
+ {
+ char buffer[1024];
+ char *fields[10];
+- int fields_num, read = 0, found_header = 0;
++ int fields_num, found_header = 0;
+ long long sum_users = 0;
+
+ /* read the file until the "ROUTING TABLE" line is found (no more info after) */
+@@ -314,17 +314,15 @@ static int multi1_read (char *name, FILE *fh)
+ atoll (fields[3])); /* "Bytes Sent" */
+ }
+ }
+-
+- read = 1;
+ }
+
++ if (ferror (fh))
++ return (0);
++
+ if (collect_user_count)
+- {
+ numusers_submit(name, name, sum_users);
+- read = 1;
+- }
+
+- return (read);
++ return (1);
+ } /* int multi1_read */
+
+ /* for reading status version 2 */
+--
+1.9.3
+
--- /dev/null
+From 5dbc1cfb4baff831f950b3c9de8c332bc9aa2b6e Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Wed, 17 Sep 2014 11:25:17 +0200
+Subject: [PATCH 18/22] openvpn: Remove boguous file handler check
+
+---
+ src/openvpn.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/openvpn.c b/src/openvpn.c
+index 7d4e4a0..9598abc 100644
+--- a/src/openvpn.c
++++ b/src/openvpn.c
+@@ -316,9 +316,6 @@ static int multi1_read (char *name, FILE *fh)
+ }
+ }
+
+- if (ferror (fh))
+- return (0);
+-
+ if (collect_user_count)
+ numusers_submit(name, name, sum_users);
+
+--
+1.9.3
+
--- /dev/null
+From a45710a5a887d25ab0e04ce1553bb268013ef780 Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Tue, 16 Sep 2014 14:44:42 +0200
+Subject: [PATCH 19/22] openvpn: Ignore not fully established connections
+
+---
+ src/openvpn.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/src/openvpn.c b/src/openvpn.c
+index 9598abc..6a0ffbd 100644
+--- a/src/openvpn.c
++++ b/src/openvpn.c
+@@ -292,6 +292,10 @@ static int multi1_read (char *name, FILE *fh)
+ if (fields_num < 4)
+ continue;
+
++ // Ignore not yet fully established connections
++ if (strcmp(fields[1], "UNDEF") == 0)
++ continue;
++
+ if (collect_user_count)
+ /* If so, sum all users, ignore the individuals*/
+ {
+@@ -347,6 +351,10 @@ static int multi2_read (char *name, FILE *fh)
+ if (strcmp (fields[0], "CLIENT_LIST") != 0)
+ continue;
+
++ // Ignore not yet fully established connections
++ if (strcmp(fields[0], "UNDEF") == 0)
++ continue;
++
+ if (collect_user_count)
+ /* If so, sum all users, ignore the individuals*/
+ {
+@@ -412,6 +420,10 @@ static int multi3_read (char *name, FILE *fh)
+ if (strcmp (fields[0], "CLIENT_LIST") != 0)
+ continue;
+
++ // Ignore not yet fully established connections
++ if (strcmp(fields[0], "UNDEF") == 0)
++ continue;
++
+ if (collect_user_count)
+ /* If so, sum all users, ignore the individuals*/
+ {
+@@ -475,6 +487,9 @@ static int multi4_read (char *name, FILE *fh)
+ if (strcmp (fields[0], "CLIENT_LIST") != 0)
+ continue;
+
++ // Ignore not yet fully established connections
++ if (strcmp(fields[0], "UNDEF") == 0)
++ continue;
+
+ if (collect_user_count)
+ /* If so, sum all users, ignore the individuals*/
+--
+1.9.3
+
--- /dev/null
+From 46e716ee8d4208924d10f57f9ed97c99674a6ef4 Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Wed, 17 Sep 2014 11:31:13 +0200
+Subject: [PATCH 20/22] openvpn: Make read functions robust like in
+ 8516f9abb625fa7b9321e62307305aa6499be4e8
+
+---
+ src/openvpn.c | 21 ++++++---------------
+ 1 file changed, 6 insertions(+), 15 deletions(-)
+
+diff --git a/src/openvpn.c b/src/openvpn.c
+index 6a0ffbd..f686721 100644
+--- a/src/openvpn.c
++++ b/src/openvpn.c
+@@ -332,7 +332,7 @@ static int multi2_read (char *name, FILE *fh)
+ char buffer[1024];
+ char *fields[10];
+ const int max_fields = STATIC_ARRAY_SIZE (fields);
+- int fields_num, read = 0;
++ int fields_num;
+ long long sum_users = 0;
+
+ while (fgets (buffer, sizeof (buffer), fh) != NULL)
+@@ -379,17 +379,14 @@ static int multi2_read (char *name, FILE *fh)
+ atoll (fields[5])); /* "Bytes Sent" */
+ }
+ }
+-
+- read = 1;
+ }
+
+ if (collect_user_count)
+ {
+ numusers_submit(name, name, sum_users);
+- read = 1;
+ }
+
+- return (read);
++ return (1);
+ } /* int multi2_read */
+
+ /* for reading status version 3 */
+@@ -398,7 +395,7 @@ static int multi3_read (char *name, FILE *fh)
+ char buffer[1024];
+ char *fields[15];
+ const int max_fields = STATIC_ARRAY_SIZE (fields);
+- int fields_num, read = 0;
++ int fields_num;
+ long long sum_users = 0;
+
+ while (fgets (buffer, sizeof (buffer), fh) != NULL)
+@@ -447,18 +444,15 @@ static int multi3_read (char *name, FILE *fh)
+ atoll (fields[5])); /* "Bytes Sent" */
+ }
+ }
+-
+- read = 1;
+ }
+ }
+
+ if (collect_user_count)
+ {
+ numusers_submit(name, name, sum_users);
+- read = 1;
+ }
+
+- return (read);
++ return (1);
+ } /* int multi3_read */
+
+ /* for reading status version 4 */
+@@ -467,7 +461,7 @@ static int multi4_read (char *name, FILE *fh)
+ char buffer[1024];
+ char *fields[11];
+ const int max_fields = STATIC_ARRAY_SIZE (fields);
+- int fields_num, read = 0;
++ int fields_num;
+ long long sum_users = 0;
+
+ while (fgets (buffer, sizeof (buffer), fh) != NULL)
+@@ -515,17 +509,14 @@ static int multi4_read (char *name, FILE *fh)
+ atoll (fields[5])); /* "Bytes Sent" */
+ }
+ }
+-
+- read = 1;
+ }
+
+ if (collect_user_count)
+ {
+ numusers_submit(name, name, sum_users);
+- read = 1;
+ }
+
+- return (read);
++ return (1);
+ } /* int multi4_read */
+
+ /* read callback */
+--
+1.9.3
+
--- /dev/null
+From 41253b68808deade2a1866f0c24f4bbc029a92c2 Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Wed, 24 Sep 2014 14:38:04 +0200
+Subject: [PATCH 21/22] openvpn: Fix copy-and-paste error
+
+---
+ src/openvpn.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/openvpn.c b/src/openvpn.c
+index f686721..2db3677 100644
+--- a/src/openvpn.c
++++ b/src/openvpn.c
+@@ -293,7 +293,7 @@ static int multi1_read (char *name, FILE *fh)
+ continue;
+
+ // Ignore not yet fully established connections
+- if (strcmp(fields[1], "UNDEF") == 0)
++ if (strcmp(fields[0], "UNDEF") == 0)
+ continue;
+
+ if (collect_user_count)
+--
+1.9.3
+
--- /dev/null
+From 3458d610e8b99eb88c2f06ad576b4f46e0169877 Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Fri, 26 Sep 2014 12:02:27 +0200
+Subject: [PATCH 22/22] openvpn: Change data type from COUNTER to DERIVE
+
+COUNTER is not what we want here, so we will use DERIVE.
+---
+ src/openvpn.c | 26 +++++++++++++-------------
+ src/types.db | 2 ++
+ 2 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/openvpn.c b/src/openvpn.c
+index 2db3677..d446e99 100644
+--- a/src/openvpn.c
++++ b/src/openvpn.c
+@@ -116,13 +116,13 @@ static void numusers_submit (char *pinst, char *tinst, gauge_t value)
+ } /* void numusers_submit */
+
+ /* dispatches stats about traffic (TCP or UDP) generated by the tunnel per single endpoint */
+-static void iostats_submit (char *pinst, char *tinst, counter_t rx, counter_t tx)
++static void iostats_submit (char *pinst, char *tinst, derive_t rx, derive_t tx)
+ {
+ value_t values[2];
+ value_list_t vl = VALUE_LIST_INIT;
+
+- values[0].counter = rx;
+- values[1].counter = tx;
++ values[0].derive = rx;
++ values[1].derive = tx;
+
+ /* NOTE ON THE NEW NAMING SCHEMA:
+ * using plugin_instance to identify each vpn config (and
+@@ -137,7 +137,7 @@ static void iostats_submit (char *pinst, char *tinst, counter_t rx, counter_t tx
+ if (pinst != NULL)
+ sstrncpy (vl.plugin_instance, pinst,
+ sizeof (vl.plugin_instance));
+- sstrncpy (vl.type, "if_octets", sizeof (vl.type));
++ sstrncpy (vl.type, "if_octets_derive", sizeof (vl.type));
+ if (tinst != NULL)
+ sstrncpy (vl.type_instance, tinst, sizeof (vl.type_instance));
+
+@@ -146,13 +146,13 @@ static void iostats_submit (char *pinst, char *tinst, counter_t rx, counter_t tx
+
+ /* dispatches stats about data compression shown when in single mode */
+ static void compression_submit (char *pinst, char *tinst,
+- counter_t uncompressed, counter_t compressed)
++ derive_t uncompressed, derive_t compressed)
+ {
+ value_t values[2];
+ value_list_t vl = VALUE_LIST_INIT;
+
+- values[0].counter = uncompressed;
+- values[1].counter = compressed;
++ values[0].derive = uncompressed;
++ values[1].derive = compressed;
+
+ vl.values = values;
+ vl.values_len = STATIC_ARRAY_SIZE (values);
+@@ -161,7 +161,7 @@ static void compression_submit (char *pinst, char *tinst,
+ if (pinst != NULL)
+ sstrncpy (vl.plugin_instance, pinst,
+ sizeof (vl.plugin_instance));
+- sstrncpy (vl.type, "compression", sizeof (vl.type));
++ sstrncpy (vl.type, "compression_dervice", sizeof (vl.type));
+ if (tinst != NULL)
+ sstrncpy (vl.type_instance, tinst, sizeof (vl.type_instance));
+
+@@ -175,11 +175,11 @@ static int single_read (char *name, FILE *fh)
+ const int max_fields = STATIC_ARRAY_SIZE (fields);
+ int fields_num, read = 0;
+
+- counter_t link_rx, link_tx;
+- counter_t tun_rx, tun_tx;
+- counter_t pre_compress, post_compress;
+- counter_t pre_decompress, post_decompress;
+- counter_t overhead_rx, overhead_tx;
++ derive_t link_rx, link_tx;
++ derive_t tun_rx, tun_tx;
++ derive_t pre_compress, post_compress;
++ derive_t pre_decompress, post_decompress;
++ derive_t overhead_rx, overhead_tx;
+
+ link_rx = 0;
+ link_tx = 0;
+diff --git a/src/types.db b/src/types.db
+index ad54240..03ec75b 100644
+--- a/src/types.db
++++ b/src/types.db
+@@ -18,6 +18,7 @@ cache_result value:COUNTER:0:4294967295
+ cache_size value:GAUGE:0:4294967295
+ charge value:GAUGE:0:U
+ compression uncompressed:COUNTER:0:U, compressed:COUNTER:0:U
++compression_derive uncompressed:DERIVE:0:U, compressed:DERIVE:0:U
+ compression_ratio value:GAUGE:0:2
+ connections value:COUNTER:0:U
+ conntrack entropy:GAUGE:0:4294967295
+@@ -74,6 +75,7 @@ if_dropped rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295
+ if_errors rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295
+ if_multicast value:COUNTER:0:4294967295
+ if_octets rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295
++if_octets_derive rx:DERIVE:0:U, tx:DERIVE:0:U
+ if_packets rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295
+ if_rx_errors value:COUNTER:0:4294967295
+ if_tx_errors value:COUNTER:0:4294967295
+--
+1.9.3
+
--- /dev/null
+Submitted By: hauke from OpenWRT
+Date: 2009-04-17
+Initial Package Version: 1.0.2
+Origin: https://dev.openwrt.org/changeset/15405/trunk/package/crda/patches/101-make_crypto_use_optional.patch
+Description: The patch was modified for version crda-3.13 by Erik Kapfer <erik.kapfer@ipfire.org>..
+This patch provides the following improvements:
+ * Crypto usage is optional.
+
+diff -Nur crda-3.13.orig/Makefile crda-3.13/Makefile
+--- crda-3.13.orig/Makefile 2015-01-12 07:55:08.791183765 +0100
++++ crda-3.13/Makefile 2015-01-12 07:56:35.437381029 +0100
+@@ -43,7 +43,9 @@
+
+ $(LIBREG): keys-ssl.c
+
+-else
++endif
++
++ifeq ($(USE_GCRYPT),1)
+ CFLAGS += -DUSE_GCRYPT
+ LDLIBS += -lgcrypt
+
diff --git a/Makefile b/Makefile
-index 58a7975..616c6b7 100644
+index 2910320b6452..0a76ce3c5154 100644
--- a/Makefile
+++ b/Makefile
-@@ -69,7 +69,7 @@ objs = cache.o rfc1035.o util.o option.o forward.o network.o \
+@@ -73,7 +73,7 @@ objs = cache.o rfc1035.o util.o option.o forward.o network.o \
dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
-- domain.o dnssec.o blockdata.o tables.o loop.o
-+ domain.o dnssec.o blockdata.o tables.o loop.o isc.o
+- domain.o dnssec.o blockdata.o tables.o loop.o inotify.o
++ domain.o dnssec.o blockdata.o tables.o loop.o inotify.o isc.o
hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
dns-protocol.h radv-protocol.h ip6addr.h
diff --git a/src/cache.c b/src/cache.c
-index 2c3a498..77a7046 100644
+index 117ae279fd4e..6ee7ee362e6c 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -17,7 +17,7 @@
#ifdef HAVE_DNSSEC
cache_blockdata_free(crecp);
#endif
-@@ -1110,7 +1113,7 @@ void cache_reload(void)
- total_size = read_hostsfile(ah->fname, ah->index, total_size, (struct crec **)daemon->packet, revhashsz);
+@@ -1151,7 +1154,7 @@ void cache_reload(void)
+
}
-#ifdef HAVE_DHCP
struct in_addr a_record_from_hosts(char *name, time_t now)
{
struct crec *crecp = NULL;
-@@ -1188,7 +1191,7 @@ void cache_add_dhcp_entry(char *host_name, int prot,
+@@ -1229,7 +1232,7 @@ void cache_add_dhcp_entry(char *host_name, int prot,
addrlen = sizeof(struct in6_addr);
}
#endif
inet_ntop(prot, host_address, daemon->addrbuff, ADDRSTRLEN);
while ((crec = cache_find_by_name(crec, host_name, 0, flags | F_CNAME)))
-@@ -1253,7 +1256,11 @@ void cache_add_dhcp_entry(char *host_name, int prot,
+@@ -1294,7 +1297,11 @@ void cache_add_dhcp_entry(char *host_name, int prot,
else
crec->ttd = ttd;
crec->addr.addr = *host_address;
cache_hash(crec);
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
-index f4a89fc..a448ec4 100644
+index e903a24c8105..eefc7f939933 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
-@@ -940,6 +940,11 @@ int main (int argc, char **argv)
+@@ -970,6 +970,11 @@ int main (int argc, char **argv)
poll_resolv(0, daemon->last_resolv != 0, now);
daemon->last_resolv = now;
+ load_dhcp(now);
+#endif
}
-
- if (FD_ISSET(piperead, &rset))
+ #endif
+
diff --git a/src/dnsmasq.h b/src/dnsmasq.h
-index e74b15a..4a35168 100644
+index 89e758b56a0a..c5edd6fdf7f5 100644
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
-@@ -1463,9 +1463,13 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *leases);
- void slaac_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface, struct dhcp_lease *leases);
+@@ -1502,3 +1502,8 @@ void inotify_dnsmasq_init();
+ int inotify_check(time_t now);
+ void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revhashsz);
#endif
-
++
+/* isc.c */
+#ifdef HAVE_ISC_READER
+void load_dhcp(time_t now);
+#endif
-+
- /* loop.c */
- #ifdef HAVE_LOOP
- void loop_send_probes();
- int detect_loop(char *query, int type);
- #endif
--
diff --git a/src/isc.c b/src/isc.c
new file mode 100644
-index 0000000..5106442
+index 000000000000..51064426f17f
--- /dev/null
+++ b/src/isc.c
@@ -0,0 +1,251 @@
+
+#endif
diff --git a/src/option.c b/src/option.c
-index 45d8875..29c9ee5 100644
+index cb4e76ba0aa2..f6420fcbb7ab 100644
--- a/src/option.c
+++ b/src/option.c
-@@ -1669,7 +1669,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+@@ -1693,7 +1693,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
ret_err(_("bad MX target"));
break;
--- /dev/null
+From f2658275b25ebfe691cdcb9fede85a3088cca168 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Thu, 25 Sep 2014 21:51:25 +0100
+Subject: [PATCH 01/55] Add newline at the end of example config file.
+
+---
+ dnsmasq.conf.example | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dnsmasq.conf.example b/dnsmasq.conf.example
+index 83924fc4a9b4..6b00bd34fbb5 100644
+--- a/dnsmasq.conf.example
++++ b/dnsmasq.conf.example
+@@ -645,4 +645,4 @@
+ #conf-dir=/etc/dnsmasq.d,.bak
+
+ # Include all files in a directory which end in .conf
+-#conf-dir=/etc/dnsmasq.d/*.conf
+\ No newline at end of file
++#conf-dir=/etc/dnsmasq.d/*.conf
+--
+2.1.0
+
--- /dev/null
+From 00cd9d551998307225312fd21f761cfa8868bd2c Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Thu, 2 Oct 2014 21:44:21 +0100
+Subject: [PATCH 02/55] crash at startup when an empty suffix is supplied to
+ --conf-dir
+
+---
+ CHANGELOG | 6 ++++++
+ src/option.c | 38 +++++++++++++++++++++++---------------
+ 2 files changed, 29 insertions(+), 15 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 768e2aaca42a..13ab41c05fc3 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -1,3 +1,9 @@
++version 2.73
++ Fix crash at startup when an empty suffix is supplied to
++ --conf-dir, also trivial memory leak. Thanks to
++ Tomas Hozza for spotting this.
++
++
+ version 2.72
+ Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
+
+diff --git a/src/option.c b/src/option.c
+index 45d8875fb7f9..b08e98e16f84 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -1474,22 +1474,25 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ for (arg = comma; arg; arg = comma)
+ {
+ comma = split(arg);
+- li = opt_malloc(sizeof(struct list));
+- if (*arg == '*')
++ if (strlen(arg) != 0)
+ {
+- li->next = match_suffix;
+- match_suffix = li;
+- /* Have to copy: buffer is overwritten */
+- li->suffix = opt_string_alloc(arg+1);
+- }
+- else
+- {
+- li->next = ignore_suffix;
+- ignore_suffix = li;
+- /* Have to copy: buffer is overwritten */
+- li->suffix = opt_string_alloc(arg);
++ li = opt_malloc(sizeof(struct list));
++ if (*arg == '*')
++ {
++ li->next = match_suffix;
++ match_suffix = li;
++ /* Have to copy: buffer is overwritten */
++ li->suffix = opt_string_alloc(arg+1);
++ }
++ else
++ {
++ li->next = ignore_suffix;
++ ignore_suffix = li;
++ /* Have to copy: buffer is overwritten */
++ li->suffix = opt_string_alloc(arg);
++ }
+ }
+- };
++ }
+
+ if (!(dir_stream = opendir(directory)))
+ die(_("cannot access directory %s: %s"), directory, EC_FILE);
+@@ -1555,7 +1558,12 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ free(ignore_suffix->suffix);
+ free(ignore_suffix);
+ }
+-
++ for(; match_suffix; match_suffix = li)
++ {
++ li = match_suffix->next;
++ free(match_suffix->suffix);
++ free(match_suffix);
++ }
+ break;
+ }
+
+--
+2.1.0
+
--- /dev/null
+From 6ac3bc0452a74e16e3d620a0757b0f8caab182ec Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Fri, 3 Oct 2014 08:48:11 +0100
+Subject: [PATCH 03/55] Debian build fixes for kFreeBSD
+
+---
+ src/tables.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/tables.c b/src/tables.c
+index 834f11944cd0..dcdef794c4d2 100644
+--- a/src/tables.c
++++ b/src/tables.c
+@@ -20,6 +20,10 @@
+
+ #if defined(HAVE_IPSET) && defined(HAVE_BSD_NETWORK)
+
++#ifndef __FreeBSD__
++#include <bsd/string.h>
++#endif
++
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+
+@@ -136,7 +140,7 @@ int add_to_ipset(const char *setname, const struct all_addr *ipaddr,
+ return -1;
+ }
+
+- if (rc = pfr_add_tables(&table, 1, &n, 0))
++ if ((rc = pfr_add_tables(&table, 1, &n, 0)))
+ {
+ my_syslog(LOG_WARNING, _("warning: pfr_add_tables: %s(%d)"),
+ pfr_strerror(errno),rc);
+--
+2.1.0
+
--- /dev/null
+From e9828b6f66b22ce8873f8d30a773137d1aef1b92 Mon Sep 17 00:00:00 2001
+From: Karl Vogel <karl.vogel@gmail.com>
+Date: Fri, 3 Oct 2014 21:45:15 +0100
+Subject: [PATCH 04/55] Set conntrack mark before connect() call.
+
+SO_MARK has to be done before issuing the connect() call on the
+TCP socket.
+---
+ src/forward.c | 36 ++++++++++++++++++------------------
+ 1 file changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/src/forward.c b/src/forward.c
+index 4895efeba89a..2cf29eba6e26 100644
+--- a/src/forward.c
++++ b/src/forward.c
+@@ -1796,6 +1796,24 @@ unsigned char *tcp_request(int confd, time_t now,
+ if ((last_server->tcpfd = socket(last_server->addr.sa.sa_family, SOCK_STREAM, 0)) == -1)
+ continue;
+
++#ifdef HAVE_CONNTRACK
++ /* Copy connection mark of incoming query to outgoing connection. */
++ if (option_bool(OPT_CONNTRACK))
++ {
++ unsigned int mark;
++ struct all_addr local;
++#ifdef HAVE_IPV6
++ if (local_addr->sa.sa_family == AF_INET6)
++ local.addr.addr6 = local_addr->in6.sin6_addr;
++ else
++#endif
++ local.addr.addr4 = local_addr->in.sin_addr;
++
++ if (get_incoming_mark(&peer_addr, &local, 1, &mark))
++ setsockopt(last_server->tcpfd, SOL_SOCKET, SO_MARK, &mark, sizeof(unsigned int));
++ }
++#endif
++
+ if ((!local_bind(last_server->tcpfd, &last_server->source_addr, last_server->interface, 1) ||
+ connect(last_server->tcpfd, &last_server->addr.sa, sa_len(&last_server->addr)) == -1))
+ {
+@@ -1820,24 +1838,6 @@ unsigned char *tcp_request(int confd, time_t now,
+ size = new_size;
+ }
+ #endif
+-
+-#ifdef HAVE_CONNTRACK
+- /* Copy connection mark of incoming query to outgoing connection. */
+- if (option_bool(OPT_CONNTRACK))
+- {
+- unsigned int mark;
+- struct all_addr local;
+-#ifdef HAVE_IPV6
+- if (local_addr->sa.sa_family == AF_INET6)
+- local.addr.addr6 = local_addr->in6.sin6_addr;
+- else
+-#endif
+- local.addr.addr4 = local_addr->in.sin_addr;
+-
+- if (get_incoming_mark(&peer_addr, &local, 1, &mark))
+- setsockopt(last_server->tcpfd, SOL_SOCKET, SO_MARK, &mark, sizeof(unsigned int));
+- }
+-#endif
+ }
+
+ *length = htons(size);
+--
+2.1.0
+
--- /dev/null
+From 17b475912f6a4e72797a543dad59d4d5dde6bb1b Mon Sep 17 00:00:00 2001
+From: Daniel Collins <daniel.collins@smoothwall.net>
+Date: Fri, 3 Oct 2014 21:58:43 +0100
+Subject: [PATCH 05/55] Fix typo in new Dbus code.
+
+Simon's fault.
+---
+ src/dbus.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/dbus.c b/src/dbus.c
+index 15fed906bd90..a2a94dc85dac 100644
+--- a/src/dbus.c
++++ b/src/dbus.c
+@@ -426,7 +426,7 @@ static DBusMessage *dbus_set_bool(DBusMessage *message, int flag, char *name)
+ }
+ else
+ {
+- my_syslog(LOG_INFO, "Disabling --$s option from D-Bus", name);
++ my_syslog(LOG_INFO, "Disabling --%s option from D-Bus", name);
+ reset_option_bool(flag);
+ }
+
+--
+2.1.0
+
--- /dev/null
+From 3d9d2dd0018603a2ae4b9cd65ac6ff959f4fd8c7 Mon Sep 17 00:00:00 2001
+From: Tomas Hozza <thozza@redhat.com>
+Date: Mon, 6 Oct 2014 10:46:48 +0100
+Subject: [PATCH 06/55] Fit example conf file typo.
+
+---
+ dnsmasq.conf.example | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dnsmasq.conf.example b/dnsmasq.conf.example
+index 6b00bd34fbb5..1bd305dbdbad 100644
+--- a/dnsmasq.conf.example
++++ b/dnsmasq.conf.example
+@@ -645,4 +645,4 @@
+ #conf-dir=/etc/dnsmasq.d,.bak
+
+ # Include all files in a directory which end in .conf
+-#conf-dir=/etc/dnsmasq.d/*.conf
++#conf-dir=/etc/dnsmasq.d/,*.conf
+--
+2.1.0
+
--- /dev/null
+From b9ff5c8f435173cfa616e3c398bdc089ef690a07 Mon Sep 17 00:00:00 2001
+From: Vladislav Grishenko <themiron@mail.ru>
+Date: Mon, 6 Oct 2014 14:34:24 +0100
+Subject: [PATCH 07/55] Improve RFC-compliance when unable to supply addresses
+ in DHCPv6
+
+While testing https://github.com/sbyx/odhcp6c client I have noticed it
+permanently crashes after startup.
+
+The reason was it (odhcp6c) doesn't expect empty IA options in ADVERTISE
+message without any suboptions.
+
+Despite this validation bug of odhcp6c, dnsmasq should not generate
+ADVERTISE messages with IA if there's nothing to advert per RFC 3315
+17.2.2:
+
+ If the server will not assign any addresses to any IAs in a
+
+ subsequent Request from the client, the server MUST send an Advertise
+
+ message to the client that includes only a Status Code option with
+
+ code NoAddrsAvail and a status message for the user, a Server
+
+ Identifier option with the server's DUID, and a Client Identifier
+
+ option with the client's DUID.
+
+Meanwhile it's need to add status code for every IA in REPLY message per
+RFC3315 18.2.1:
+
+ If the server cannot assign any addresses to an IA in the message
+ from the client, the server MUST include the IA in the Reply message
+ with no addresses in the IA and a Status Code option in the IA
+ containing status code NoAddrsAvail.
+
+So, I've changed the logic to skip IA completely from ADVERTISE messages and
+to add NoAddrsAvail subcode into IA of REPLY messages.
+
+As for overhead, yes, I believe it's ok to return NoAddrsAvail twice in IA
+and in global section for compatibility with all old and new clients.
+---
+ src/rfc3315.c | 27 +++++++++++++++++++++++++--
+ 1 file changed, 25 insertions(+), 2 deletions(-)
+
+diff --git a/src/rfc3315.c b/src/rfc3315.c
+index 5ebf09d50ac1..ddb390bf1136 100644
+--- a/src/rfc3315.c
++++ b/src/rfc3315.c
+@@ -691,6 +691,8 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
+ #endif
+
+ o = build_ia(state, &t1cntr);
++ if (address_assigned)
++ address_assigned = 2;
+
+ for (ia_counter = 0; ia_option; ia_counter++, ia_option = opt6_find(opt6_next(ia_option, ia_end), ia_end, OPTION6_IAADDR, 24))
+ {
+@@ -781,6 +783,27 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
+ address_assigned = 1;
+ }
+
++ if (address_assigned != 1)
++ {
++ /* If the server will not assign any addresses to any IAs in a
++ subsequent Request from the client, the server MUST send an Advertise
++ message to the client that doesn't include any IA options. */
++ if (!state->lease_allocate)
++ {
++ save_counter(o);
++ continue;
++ }
++
++ /* If the server cannot assign any addresses to an IA in the message
++ from the client, the server MUST include the IA in the Reply message
++ with no addresses in the IA and a Status Code option in the IA
++ containing status code NoAddrsAvail. */
++ o1 = new_opt6(OPTION6_STATUS_CODE);
++ put_opt6_short(DHCP6NOADDRS);
++ put_opt6_string(_("address unavailable"));
++ end_opt6(o1);
++ }
++
+ end_ia(t1cntr, min_time, 0);
+ end_opt6(o);
+ }
+@@ -806,7 +829,7 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
+ put_opt6_short(DHCP6NOADDRS);
+ put_opt6_string(_("no addresses available"));
+ end_opt6(o1);
+- log6_packet(state, "DHCPADVERTISE", NULL, _("no addresses available"));
++ log6_packet(state, state->lease_allocate ? "DHCPREPLY" : "DHCPADVERTISE", NULL, _("no addresses available"));
+ }
+
+ break;
+@@ -862,7 +885,7 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
+ {
+ /* Static range, not configured. */
+ o1 = new_opt6(OPTION6_STATUS_CODE);
+- put_opt6_short(DHCP6UNSPEC);
++ put_opt6_short(DHCP6NOADDRS);
+ put_opt6_string(_("address unavailable"));
+ end_opt6(o1);
+ }
+--
+2.1.0
+
--- /dev/null
+From 98906275a02ae260fe3f82133bd79054f8315f06 Mon Sep 17 00:00:00 2001
+From: Hans Dedecker <dedeckeh@gmail.com>
+Date: Tue, 9 Dec 2014 22:22:53 +0000
+Subject: [PATCH 08/55] Fix conntrack with --bind-interfaces
+
+Make sure dst_addr is assigned the correct address in receive_query when OPTNOWILD is
+enabled so the assigned mark can be correctly retrieved and set in forward_query when
+conntrack is enabled.
+
+Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
+---
+ src/forward.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/forward.c b/src/forward.c
+index 2cf29eba6e26..408a179a20f4 100644
+--- a/src/forward.c
++++ b/src/forward.c
+@@ -1048,7 +1048,7 @@ void receive_query(struct listener *listen, time_t now)
+ /* packet buffer overwritten */
+ daemon->srv_save = NULL;
+
+- dst_addr_4.s_addr = 0;
++ dst_addr_4.s_addr = dst_addr.addr.addr4.s_addr = 0;
+ netmask.s_addr = 0;
+
+ if (option_bool(OPT_NOWILD) && listen->iface)
+@@ -1057,7 +1057,7 @@ void receive_query(struct listener *listen, time_t now)
+
+ if (listen->family == AF_INET)
+ {
+- dst_addr_4 = listen->iface->addr.in.sin_addr;
++ dst_addr_4 = dst_addr.addr.addr4 = listen->iface->addr.in.sin_addr;
+ netmask = listen->iface->netmask;
+ }
+ }
+--
+2.1.0
+
--- /dev/null
+From 193de4abf59e49c6b70d54cfe9720fcb95ca2f71 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Wed, 10 Dec 2014 17:32:16 +0000
+Subject: [PATCH 09/55] Use inotify instead of polling on Linux.
+
+This should solve problems people are seeing when a file changes
+twice within a second and thus is missed for polling.
+---
+ Makefile | 2 +-
+ bld/Android.mk | 2 +-
+ src/dnsmasq.c | 25 ++++++++++++--
+ src/dnsmasq.h | 11 ++++++-
+ src/inotify.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 137 insertions(+), 5 deletions(-)
+ create mode 100644 src/inotify.c
+
+diff --git a/Makefile b/Makefile
+index 58a7975f60b5..c340f1c7b59a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -69,7 +69,7 @@ objs = cache.o rfc1035.o util.o option.o forward.o network.o \
+ dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
+ helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
+ dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
+- domain.o dnssec.o blockdata.o tables.o loop.o
++ domain.o dnssec.o blockdata.o tables.o loop.o inotify.o
+
+ hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
+ dns-protocol.h radv-protocol.h ip6addr.h
+diff --git a/bld/Android.mk b/bld/Android.mk
+index d855094eb264..d627796e8edc 100644
+--- a/bld/Android.mk
++++ b/bld/Android.mk
+@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := bpf.c cache.c dbus.c dhcp.c dnsmasq.c \
+ dhcp6.c rfc3315.c dhcp-common.c outpacket.c \
+ radv.c slaac.c auth.c ipset.c domain.c \
+ dnssec.c dnssec-openssl.c blockdata.c tables.c \
+- loop.c
++ loop.c inotify.c
+
+ LOCAL_MODULE := dnsmasq
+
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index f4a89fc38183..bf2e25a55780 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -315,9 +315,15 @@ int main (int argc, char **argv)
+ if (daemon->port != 0)
+ {
+ cache_init();
++
+ #ifdef HAVE_DNSSEC
+ blockdata_init();
+ #endif
++
++#ifdef HAVE_LINUX_NETWORK
++ if (!option_bool(OPT_NO_POLL))
++ inotify_dnsmasq_init();
++#endif
+ }
+
+ if (option_bool(OPT_DBUS))
+@@ -793,6 +799,11 @@ int main (int argc, char **argv)
+
+ pid = getpid();
+
++#ifdef HAVE_LINUX_NETWORK
++ /* Using inotify, have to select a resolv file at startup */
++ poll_resolv(1, 0, now);
++#endif
++
+ while (1)
+ {
+ int maxfd = -1;
+@@ -862,11 +873,16 @@ int main (int argc, char **argv)
+ #if defined(HAVE_LINUX_NETWORK)
+ FD_SET(daemon->netlinkfd, &rset);
+ bump_maxfd(daemon->netlinkfd, &maxfd);
++ if (daemon->port != 0 && !option_bool(OPT_NO_POLL))
++ {
++ FD_SET(daemon->inotifyfd, &rset);
++ bump_maxfd(daemon->inotifyfd, &maxfd);
++ }
+ #elif defined(HAVE_BSD_NETWORK)
+ FD_SET(daemon->routefd, &rset);
+ bump_maxfd(daemon->routefd, &maxfd);
+ #endif
+-
++
+ FD_SET(piperead, &rset);
+ bump_maxfd(piperead, &maxfd);
+
+@@ -929,6 +945,10 @@ int main (int argc, char **argv)
+ route_sock();
+ #endif
+
++#ifdef HAVE_LINUX_NETWORK
++ if (daemon->port != 0 && !option_bool(OPT_NO_POLL) && FD_ISSET(daemon->inotifyfd, &rset) && inotify_check())
++ poll_resolv(1, 1, now);
++#else
+ /* Check for changes to resolv files once per second max. */
+ /* Don't go silent for long periods if the clock goes backwards. */
+ if (daemon->last_resolv == 0 ||
+@@ -941,7 +961,8 @@ int main (int argc, char **argv)
+ poll_resolv(0, daemon->last_resolv != 0, now);
+ daemon->last_resolv = now;
+ }
+-
++#endif
++
+ if (FD_ISSET(piperead, &rset))
+ async_event(piperead, now);
+
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index e74b15a5459a..ebb6b957812f 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -541,6 +541,10 @@ struct resolvc {
+ int is_default, logged;
+ time_t mtime;
+ char *name;
++#ifdef HAVE_LINUX_NETWORK
++ int wd; /* inotify watch descriptor */
++ char *file; /* pointer to file part if path */
++#endif
+ };
+
+ /* adn-hosts parms from command-line (also dhcp-hostsfile and dhcp-optsfile */
+@@ -998,7 +1002,7 @@ extern struct daemon {
+ /* DHCP state */
+ int dhcpfd, helperfd, pxefd;
+ #if defined(HAVE_LINUX_NETWORK)
+- int netlinkfd;
++ int netlinkfd, inotifyfd;
+ #elif defined(HAVE_BSD_NETWORK)
+ int dhcp_raw_fd, dhcp_icmp_fd, routefd;
+ #endif
+@@ -1469,3 +1473,8 @@ void loop_send_probes();
+ int detect_loop(char *query, int type);
+ #endif
+
++/* inotify.c */
++#ifdef HAVE_LINUX_NETWORK
++void inotify_dnsmasq_init();
++int inotify_check(void);
++#endif
+diff --git a/src/inotify.c b/src/inotify.c
+new file mode 100644
+index 000000000000..a0223443d6b6
+--- /dev/null
++++ b/src/inotify.c
+@@ -0,0 +1,102 @@
++/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; version 2 dated June, 1991, or
++ (at your option) version 3 dated 29 June, 2007.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>.
++*/
++
++#include "dnsmasq.h"
++#include <sys/inotify.h>
++
++#ifdef HAVE_LINUX_NETWORK
++
++/* the strategy is to set a inotify on the directories containing
++ resolv files, for any files in the directory which are close-write
++ or moved into the directory.
++
++ When either of those happen, we look to see if the file involved
++ is actually a resolv-file, and if so, call poll-resolv with
++ the "force" argument, to ensure it's read.
++
++ This adds one new error condition: the directories containing
++ all specified resolv-files must exist at start-up, even if the actual
++ files don't.
++*/
++
++static char *inotify_buffer;
++#define INOTIFY_SZ (sizeof(struct inotify_event) + NAME_MAX + 1)
++
++void inotify_dnsmasq_init()
++{
++ struct resolvc *res;
++
++ inotify_buffer = safe_malloc(INOTIFY_SZ);
++
++ daemon->inotifyfd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
++
++ if (daemon->inotifyfd == -1)
++ die(_("failed to create inotify: %s"), NULL, EC_MISC);
++
++ for (res = daemon->resolv_files; res; res = res->next)
++ {
++ char *d = strrchr(res->name, '/');
++
++ if (!d)
++ die(_("resolv-file %s not an absolute path"), res->name, EC_MISC);
++
++ *d = 0; /* make ->name just directory */
++ res->wd = inotify_add_watch(daemon->inotifyfd, res->name, IN_CLOSE_WRITE | IN_MOVED_TO);
++ res->file = d+1; /* pointer to filename */
++
++ if (res->wd == -1 && errno == ENOENT)
++ die(_("directory %s for resolv-file is missing, cannot poll"), res->name, EC_MISC);
++
++ *d = '/'; /* restore name */
++
++ if (res->wd == -1)
++ die(_("failed to create inotify for %s: %s"), res->name, EC_MISC);
++ }
++}
++
++int inotify_check(void)
++{
++ int hit = 0;
++
++ while (1)
++ {
++ int rc;
++ char *p;
++ struct resolvc *res;
++ struct inotify_event *in;
++
++ while ((rc = read(daemon->inotifyfd, inotify_buffer, INOTIFY_SZ)) == -1 && errno == EINTR);
++
++ if (rc <= 0)
++ break;
++
++ for (p = inotify_buffer; rc - (p - inotify_buffer) >= (int)sizeof(struct inotify_event); p += sizeof(struct inotify_event) + in->len)
++ {
++ in = (struct inotify_event*)p;
++
++ for (res = daemon->resolv_files; res; res = res->next)
++ if (res->wd == in->wd && in->len != 0 && strcmp(res->file, in->name) == 0)
++ hit = 1;
++ }
++ }
++
++ return hit;
++}
++
++#endif
++
++
++
+--
+2.1.0
+
--- /dev/null
+From 857973e6f7e0a3d03535a9df7f9373fd7a0b65cc Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 15 Dec 2014 15:58:13 +0000
+Subject: [PATCH 10/55] Teach the new inotify code about symlinks.
+
+---
+ src/inotify.c | 43 +++++++++++++++++++++++++++----------------
+ 1 file changed, 27 insertions(+), 16 deletions(-)
+
+diff --git a/src/inotify.c b/src/inotify.c
+index a0223443d6b6..960bf5efb41f 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -41,29 +41,40 @@ void inotify_dnsmasq_init()
+
+ inotify_buffer = safe_malloc(INOTIFY_SZ);
+
+- daemon->inotifyfd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
+
++ daemon->inotifyfd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
++
+ if (daemon->inotifyfd == -1)
+ die(_("failed to create inotify: %s"), NULL, EC_MISC);
+-
++
+ for (res = daemon->resolv_files; res; res = res->next)
+ {
+- char *d = strrchr(res->name, '/');
+-
+- if (!d)
+- die(_("resolv-file %s not an absolute path"), res->name, EC_MISC);
+-
+- *d = 0; /* make ->name just directory */
+- res->wd = inotify_add_watch(daemon->inotifyfd, res->name, IN_CLOSE_WRITE | IN_MOVED_TO);
+- res->file = d+1; /* pointer to filename */
+-
+- if (res->wd == -1 && errno == ENOENT)
+- die(_("directory %s for resolv-file is missing, cannot poll"), res->name, EC_MISC);
++ char *d = NULL, *path;
+
+- *d = '/'; /* restore name */
++ if (!(path = realpath(res->name, NULL)))
++ {
++ /* realpath will fail if the file doesn't exist, but
++ dnsmasq copes with missing files, so fall back
++ and assume that symlinks are not in use in that case. */
++ if (errno == ENOENT)
++ path = res->name;
++ else
++ die(_("cannot cannonicalise resolv-file %s: %s"), res->name, EC_MISC);
++ }
+
+- if (res->wd == -1)
+- die(_("failed to create inotify for %s: %s"), res->name, EC_MISC);
++ if ((d = strrchr(path, '/')))
++ {
++ *d = 0; /* make path just directory */
++ res->wd = inotify_add_watch(daemon->inotifyfd, path, IN_CLOSE_WRITE | IN_MOVED_TO);
++ res->file = d+1; /* pointer to filename */
++ *d = '/';
++
++ if (res->wd == -1 && errno == ENOENT)
++ die(_("directory %s for resolv-file is missing, cannot poll"), res->name, EC_MISC);
++
++ if (res->wd == -1)
++ die(_("failed to create inotify for %s: %s"), res->name, EC_MISC);
++ }
+ }
+ }
+
+--
+2.1.0
+
--- /dev/null
+From 800c5cc1e7438818fd80f08c2d472df249a6942d Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 15 Dec 2014 17:50:15 +0000
+Subject: [PATCH 11/55] Remove floor on EDNS0 packet size with DNSSEC.
+
+---
+ CHANGELOG | 6 +++++-
+ src/dnsmasq.c | 5 -----
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 13ab41c05fc3..68252924e743 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -2,7 +2,11 @@ version 2.73
+ Fix crash at startup when an empty suffix is supplied to
+ --conf-dir, also trivial memory leak. Thanks to
+ Tomas Hozza for spotting this.
+-
++
++ Remove floor of 4096 on advertised EDNS0 packet size when
++ DNSSEC in use, the original rationale for this has long gone.
++ Thanks to Anders Kaseorg for spotting this.
++
+
+ version 2.72
+ Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index bf2e25a55780..5c7750d365fa 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -87,11 +87,6 @@ int main (int argc, char **argv)
+
+ if (daemon->edns_pktsz < PACKETSZ)
+ daemon->edns_pktsz = PACKETSZ;
+-#ifdef HAVE_DNSSEC
+- /* Enforce min packet big enough for DNSSEC */
+- if (option_bool(OPT_DNSSEC_VALID) && daemon->edns_pktsz < EDNS_PKTSZ)
+- daemon->edns_pktsz = EDNS_PKTSZ;
+-#endif
+
+ daemon->packet_buff_sz = daemon->edns_pktsz > DNSMASQ_PACKETSZ ?
+ daemon->edns_pktsz : DNSMASQ_PACKETSZ;
+--
+2.1.0
+
--- /dev/null
+From ad946d555dce44eb690c7699933b6ff40ab85bb6 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 15 Dec 2014 17:52:22 +0000
+Subject: [PATCH 12/55] CHANGELOG re. inotify.
+
+---
+ CHANGELOG | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 68252924e743..9174b0bd75dc 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -7,6 +7,10 @@ version 2.73
+ DNSSEC in use, the original rationale for this has long gone.
+ Thanks to Anders Kaseorg for spotting this.
+
++ Use inotify for checking on updates to /etc/resolv.conf and
++ friends under Linux. This fixes race conditions when the files are
++ updated rapidly and saves CPU by noy polling.
++
+
+ version 2.72
+ Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
+--
+2.1.0
+
--- /dev/null
+From 3ad3f3bbd4ee716a7d2fb1e115cf89bd1b1a5de9 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Tue, 16 Dec 2014 18:25:17 +0000
+Subject: [PATCH 13/55] Fix breakage of --domain=<domain>,<subnet>,local
+
+---
+ CHANGELOG | 4 ++++
+ src/option.c | 18 ++++++++++++++++--
+ 2 files changed, 20 insertions(+), 2 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 9174b0bd75dc..9e6c7aa4fd68 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -10,6 +10,10 @@ version 2.73
+ Use inotify for checking on updates to /etc/resolv.conf and
+ friends under Linux. This fixes race conditions when the files are
+ updated rapidly and saves CPU by noy polling.
++
++ Fix breakage of --domain=<domain>,<subnet>,local - only reverse
++ queries were intercepted. THis appears to have been broken
++ since 2.69. Thanks to Josh Stone for finding the bug.
+
+
+ version 2.72
+diff --git a/src/option.c b/src/option.c
+index b08e98e16f84..209fa6976609 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -1941,10 +1941,17 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ else
+ {
+ /* generate the equivalent of
+- local=/<domain>/
+ local=/xxx.yyy.zzz.in-addr.arpa/ */
+ struct server *serv = add_rev4(new->start, msize);
+ serv->flags |= SERV_NO_ADDR;
++
++ /* local=/<domain>/ */
++ serv = opt_malloc(sizeof(struct server));
++ memset(serv, 0, sizeof(struct server));
++ serv->domain = d;
++ serv->flags = SERV_HAS_DOMAIN | SERV_NO_ADDR;
++ serv->next = daemon->servers;
++ daemon->servers = serv;
+ }
+ }
+ }
+@@ -1978,10 +1985,17 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ else
+ {
+ /* generate the equivalent of
+- local=/<domain>/
+ local=/xxx.yyy.zzz.ip6.arpa/ */
+ struct server *serv = add_rev6(&new->start6, msize);
+ serv->flags |= SERV_NO_ADDR;
++
++ /* local=/<domain>/ */
++ serv = opt_malloc(sizeof(struct server));
++ memset(serv, 0, sizeof(struct server));
++ serv->domain = d;
++ serv->flags = SERV_HAS_DOMAIN | SERV_NO_ADDR;
++ serv->next = daemon->servers;
++ daemon->servers = serv;
+ }
+ }
+ }
+--
+2.1.0
+
--- /dev/null
+From bd9520b7ade7098ee423acc38965376aa57feb07 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Tue, 16 Dec 2014 20:41:29 +0000
+Subject: [PATCH 14/55] Remove redundant IN6_IS_ADDR_ULA(a) macro defn.
+
+---
+ src/network.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/network.c b/src/network.c
+index 5067007c5cbc..99419f57951e 100644
+--- a/src/network.c
++++ b/src/network.c
+@@ -16,10 +16,6 @@
+
+ #include "dnsmasq.h"
+
+-#ifndef IN6_IS_ADDR_ULA
+-#define IN6_IS_ADDR_ULA(a) ((((__const uint32_t *) (a))[0] & htonl (0xfe00000)) == htonl (0xfc000000))
+-#endif
+-
+ #ifdef HAVE_LINUX_NETWORK
+
+ int indextoname(int fd, int index, char *name)
+--
+2.1.0
+
--- /dev/null
+From 476693678e778886b64d0b56e27eb7695cbcca99 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Wed, 17 Dec 2014 12:41:56 +0000
+Subject: [PATCH 15/55] Eliminate IPv6 privacy addresses from --interface-name
+ answers.
+
+---
+ CHANGELOG | 5 +++++
+ src/auth.c | 4 ++++
+ src/dnsmasq.h | 1 +
+ src/network.c | 12 ++++++++----
+ src/rfc1035.c | 17 ++++++++++-------
+ 5 files changed, 28 insertions(+), 11 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 9e6c7aa4fd68..01f5208ec006 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -14,6 +14,11 @@ version 2.73
+ Fix breakage of --domain=<domain>,<subnet>,local - only reverse
+ queries were intercepted. THis appears to have been broken
+ since 2.69. Thanks to Josh Stone for finding the bug.
++
++ Eliminate IPv6 privacy addresses and deprecated addresses from
++ the answers given by --interface-name. Note that reverse queries
++ (ie looking for names, given addresses) are not affected.
++ Thanks to Michael Gorbach for the suggestion.
+
+
+ version 2.72
+diff --git a/src/auth.c b/src/auth.c
+index dd46566ec2cc..a327f16d8c0b 100644
+--- a/src/auth.c
++++ b/src/auth.c
+@@ -363,6 +363,10 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
+ if (((addrlist->flags & ADDRLIST_IPV6) ? T_AAAA : T_A) == qtype &&
+ (local_query || filter_zone(zone, flag, &addrlist->addr)))
+ {
++#ifdef HAVE_IPV6
++ if (addrlist->flags & ADDRLIST_REVONLY)
++ continue;
++#endif
+ found = 1;
+ log_query(F_FORWARD | F_CONFIG | flag, name, &addrlist->addr, NULL);
+ if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index ebb6b957812f..1dd61c5edba3 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -318,6 +318,7 @@ struct ds_config {
+
+ #define ADDRLIST_LITERAL 1
+ #define ADDRLIST_IPV6 2
++#define ADDRLIST_REVONLY 4
+
+ struct addrlist {
+ struct all_addr addr;
+diff --git a/src/network.c b/src/network.c
+index 99419f57951e..14d2af2ce313 100644
+--- a/src/network.c
++++ b/src/network.c
+@@ -236,7 +236,7 @@ struct iface_param {
+ };
+
+ static int iface_allowed(struct iface_param *param, int if_index, char *label,
+- union mysockaddr *addr, struct in_addr netmask, int prefixlen, int dad)
++ union mysockaddr *addr, struct in_addr netmask, int prefixlen, int iface_flags)
+ {
+ struct irec *iface;
+ int mtu = 0, loopback;
+@@ -388,6 +388,10 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
+ {
+ al->addr.addr.addr6 = addr->in6.sin6_addr;
+ al->flags = ADDRLIST_IPV6;
++ /* Privacy addresses and addresses still undergoing DAD and deprecated addresses
++ don't appear in forward queries, but will in reverse ones. */
++ if (!(iface_flags & IFACE_PERMANENT) || (iface_flags & (IFACE_DEPRECATED | IFACE_TENTATIVE)))
++ al->flags |= ADDRLIST_REVONLY;
+ }
+ #endif
+ }
+@@ -399,7 +403,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
+ for (iface = daemon->interfaces; iface; iface = iface->next)
+ if (sockaddr_isequal(&iface->addr, addr))
+ {
+- iface->dad = dad;
++ iface->dad = !!(iface_flags & IFACE_TENTATIVE);
+ iface->found = 1; /* for garbage collection */
+ return 1;
+ }
+@@ -474,7 +478,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
+ iface->dhcp_ok = dhcp_ok;
+ iface->dns_auth = auth_dns;
+ iface->mtu = mtu;
+- iface->dad = dad;
++ iface->dad = !!(iface_flags & IFACE_TENTATIVE);
+ iface->found = 1;
+ iface->done = iface->multicast_done = iface->warned = 0;
+ iface->index = if_index;
+@@ -519,7 +523,7 @@ static int iface_allowed_v6(struct in6_addr *local, int prefix,
+ else
+ addr.in6.sin6_scope_id = 0;
+
+- return iface_allowed((struct iface_param *)vparam, if_index, NULL, &addr, netmask, prefix, !!(flags & IFACE_TENTATIVE));
++ return iface_allowed((struct iface_param *)vparam, if_index, NULL, &addr, netmask, prefix, flags);
+ }
+ #endif
+
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index 8a7d2608dac5..bdeb3fb10e68 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1923,14 +1923,17 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
+ for (intr = daemon->int_names; intr; intr = intr->next)
+ if (hostname_isequal(name, intr->name))
+ {
+- ans = 1;
+- if (!dryrun)
+- {
+-
+- for (addrlist = intr->addr; addrlist; addrlist = addrlist->next)
++ for (addrlist = intr->addr; addrlist; addrlist = addrlist->next)
+ #ifdef HAVE_IPV6
+- if (((addrlist->flags & ADDRLIST_IPV6) ? T_AAAA : T_A) == type)
++ if (((addrlist->flags & ADDRLIST_IPV6) ? T_AAAA : T_A) == type)
+ #endif
++ {
++#ifdef HAVE_IPV6
++ if (addrlist->flags & ADDRLIST_REVONLY)
++ continue;
++#endif
++ ans = 1;
++ if (!dryrun)
+ {
+ gotit = 1;
+ log_query(F_FORWARD | F_CONFIG | flag, name, &addrlist->addr, NULL);
+@@ -1939,7 +1942,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
+ type == T_A ? "4" : "6", &addrlist->addr))
+ anscount++;
+ }
+- }
++ }
+ }
+
+ if (!dryrun && !gotit)
+--
+2.1.0
+
--- /dev/null
+From 3267804598047bd1781cab91508d1bc516e5ddbb Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Wed, 17 Dec 2014 20:38:20 +0000
+Subject: [PATCH 16/55] Tweak field width in cache dump to avoid truncating
+ IPv6 addresses.
+
+---
+ src/cache.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/cache.c b/src/cache.c
+index 2c3a49887053..f9e1d31e8c99 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -1411,7 +1411,7 @@ void dump_cache(time_t now)
+ *a = 0;
+ if (strlen(n) == 0 && !(cache->flags & F_REVERSE))
+ n = "<Root>";
+- p += sprintf(p, "%-40.40s ", n);
++ p += sprintf(p, "%-30.30s ", n);
+ if ((cache->flags & F_CNAME) && !is_outdated_cname_pointer(cache))
+ a = cache_get_cname_target(cache);
+ #ifdef HAVE_DNSSEC
+@@ -1454,7 +1454,7 @@ void dump_cache(time_t now)
+ else if (cache->flags & F_DNSKEY)
+ t = "K";
+ #endif
+- p += sprintf(p, "%-30.30s %s%s%s%s%s%s%s%s%s ", a, t,
++ p += sprintf(p, "%-40.40s %s%s%s%s%s%s%s%s%s ", a, t,
+ cache->flags & F_FORWARD ? "F" : " ",
+ cache->flags & F_REVERSE ? "R" : " ",
+ cache->flags & F_IMMORTAL ? "I" : " ",
+--
+2.1.0
+
From 094b5c3d904bae9aeb3206d9f3b8348926b84975 Mon Sep 17 00:00:00 2001
From: Simon Kelley <simon@thekelleys.org.uk>
Date: Sun, 21 Dec 2014 16:11:52 +0000
-Subject: [PATCH] Fix crash in DNSSEC code when attempting to verify large
- RRs.
+Subject: [PATCH 17/55] Fix crash in DNSSEC code when attempting to verify
+ large RRs.
---
- src/dnssec.c | 27 +++++++++++++++++++--------
- 1 files changed, 22 insertions(+), 8 deletions(-)
+ CHANGELOG | 3 +++
+ src/dnssec.c | 27 +++++++++++++++++++--------
+ 2 files changed, 22 insertions(+), 8 deletions(-)
+diff --git a/CHANGELOG b/CHANGELOG
+index 01f5208ec006..956b71a151db 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -19,6 +19,9 @@ version 2.73
+ the answers given by --interface-name. Note that reverse queries
+ (ie looking for names, given addresses) are not affected.
+ Thanks to Michael Gorbach for the suggestion.
++
++ Fix crash in DNSSEC code with long RRs. Thanks to Marco Davids
++ for the bug report.
+
+
+ version 2.72
diff --git a/src/dnssec.c b/src/dnssec.c
-index 69bfc29..3208ac7 100644
+index 69bfc29e355f..3208ac701149 100644
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -456,16 +456,27 @@ static u16 *get_desc(int type)
if (cp != end)
hash->update(ctx, end - cp, cp);
--
-1.7.10.4
+2.1.0
From cbc652423403e3cef00e00240f6beef713142246 Mon Sep 17 00:00:00 2001
From: Simon Kelley <simon@thekelleys.org.uk>
Date: Sun, 21 Dec 2014 21:21:53 +0000
-Subject: [PATCH] Make caching work for CNAMEs pointing to A/AAAA records
+Subject: [PATCH 18/55] Make caching work for CNAMEs pointing to A/AAAA records
shadowed in /etc/hosts
If the answer to an upstream query is a CNAME which points to an
now modified to allow caching when the upstream and local A/AAAA
records have the same value.
---
- src/cache.c | 34 +++++++++++++++++++++++++---------
+ src/cache.c | 34 +++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/src/cache.c b/src/cache.c
-index f9e1d31..ff1ca6f 100644
+index f9e1d31e8c99..ff1ca6f1c352 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -322,7 +322,7 @@ static int is_expired(time_t now, struct crec *crecp)
return NULL;
}
--
-1.7.10.4
+2.1.0
From fbc5205702c7f6f431d9f1043c553d7fb62ddfdb Mon Sep 17 00:00:00 2001
From: Simon Kelley <simon@thekelleys.org.uk>
Date: Tue, 23 Dec 2014 15:46:08 +0000
-Subject: [PATCH] Fix problems validating NSEC3 and wildcards.
+Subject: [PATCH 19/55] Fix problems validating NSEC3 and wildcards.
---
- src/dnssec.c | 253 +++++++++++++++++++++++++++++-----------------------------
+ src/dnssec.c | 253 ++++++++++++++++++++++++++++++-----------------------------
1 file changed, 128 insertions(+), 125 deletions(-)
diff --git a/src/dnssec.c b/src/dnssec.c
-index 3208ac7..9350d3e 100644
+index 3208ac701149..9350d3e8c963 100644
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -615,6 +615,7 @@ static void sort_rrset(struct dns_header *header, size_t plen, u16 *rr_desc, int
{
if (rc == STAT_NO_SIG)
--
-1.7.10.4
+2.1.0
From 83d2ed09fc0216b567d7fb2197e4ff3eae150b0d Mon Sep 17 00:00:00 2001
From: Simon Kelley <simon@thekelleys.org.uk>
Date: Tue, 23 Dec 2014 18:42:38 +0000
-Subject: [PATCH] Initialise return value.
+Subject: [PATCH 20/55] Initialise return value.
---
- src/dnssec.c | 7 +++++--
+ src/dnssec.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/dnssec.c b/src/dnssec.c
-index 9350d3e..ed8cf89 100644
+index 9350d3e8c963..ed8cf893bad2 100644
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -637,10 +637,13 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
/* look for RRSIGs for this RRset and get pointers to each RR in the set. */
--
-1.7.10.4
+2.1.0
--- /dev/null
+From 32fc6dbe03569d70dd394420ceb73532cf303c33 Mon Sep 17 00:00:00 2001
+From: Glen Huang <curvedmark@gmail.com>
+Date: Sat, 27 Dec 2014 15:28:12 +0000
+Subject: [PATCH 21/55] Add --ignore-address option.
+
+---
+ CHANGELOG | 8 ++++++++
+ man/dnsmasq.8 | 6 ++++++
+ src/dnsmasq.h | 3 ++-
+ src/forward.c | 4 ++++
+ src/option.c | 18 +++++++++++++++---
+ src/rfc1035.c | 37 +++++++++++++++++++++++++++++++++++++
+ 6 files changed, 72 insertions(+), 4 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 956b71a151db..2b6356bcfb02 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -22,6 +22,14 @@ version 2.73
+
+ Fix crash in DNSSEC code with long RRs. Thanks to Marco Davids
+ for the bug report.
++
++ Add --ignore-address option. Ignore replies to A-record
++ queries which include the specified address. No error is
++ generated, dnsmasq simply continues to listen for another
++ reply. This is useful to defeat blocking strategies which
++ rely on quickly supplying a forged answer to a DNS
++ request for certain domains, before the correct answer can
++ arrive. Thanks to Glen Huang for the patch.
+
+
+ version 2.72
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 0b8e04f0a897..4236ba307df3 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -293,6 +293,12 @@ an advertising web page in response to queries for unregistered names,
+ instead of the correct NXDOMAIN response. This option tells dnsmasq to
+ fake the correct response when it sees this behaviour. As at Sept 2003
+ the IP address being returned by Verisign is 64.94.110.11
++.TP
++.B \-B, --ignore-address=<ipaddr>
++Ignore replies to A-record queries which include the specified address.
++No error is generated, dnsmasq simply continues to listen for another reply.
++This is useful to defeat blocking strategies which rely on quickly supplying a
++forged answer to a DNS request for certain domain, before the correct answer can arrive.
+ .TP
+ .B \-f, --filterwin2k
+ Later versions of windows make periodic DNS requests which don't get sensible answers from
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 1dd61c5edba3..7bc982ddf73c 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -930,7 +930,7 @@ extern struct daemon {
+ char *runfile;
+ char *lease_change_command;
+ struct iname *if_names, *if_addrs, *if_except, *dhcp_except, *auth_peers, *tftp_interfaces;
+- struct bogus_addr *bogus_addr;
++ struct bogus_addr *bogus_addr, *ignore_addr;
+ struct server *servers;
+ struct ipsets *ipsets;
+ int log_fac; /* log facility */
+@@ -1093,6 +1093,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
+ time_t now, int *ad_reqd, int *do_bit);
+ int check_for_bogus_wildcard(struct dns_header *header, size_t qlen, char *name,
+ struct bogus_addr *addr, time_t now);
++int check_for_ignored_address(struct dns_header *header, size_t qlen, struct bogus_addr *baddr);
+ unsigned char *find_pseudoheader(struct dns_header *header, size_t plen,
+ size_t *len, unsigned char **p, int *is_sign);
+ int check_for_local_domain(char *name, time_t now);
+diff --git a/src/forward.c b/src/forward.c
+index 408a179a20f4..f28c7d51f708 100644
+--- a/src/forward.c
++++ b/src/forward.c
+@@ -724,6 +724,10 @@ void reply_query(int fd, int family, time_t now)
+ if (!(forward = lookup_frec(ntohs(header->id), hash)))
+ return;
+
++ if (daemon->ignore_addr && RCODE(header) == NOERROR &&
++ check_for_ignored_address(header, n, daemon->ignore_addr))
++ return;
++
+ if ((RCODE(header) == SERVFAIL || RCODE(header) == REFUSED) &&
+ !option_bool(OPT_ORDER) &&
+ forward->forwardall == 0)
+diff --git a/src/option.c b/src/option.c
+index 209fa6976609..907d0cf88de9 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -147,6 +147,7 @@ struct myoption {
+ #define LOPT_LOCAL_SERVICE 335
+ #define LOPT_DNSSEC_TIME 336
+ #define LOPT_LOOP_DETECT 337
++#define LOPT_IGNORE_ADDR 338
+
+ #ifdef HAVE_GETOPT_LONG
+ static const struct option opts[] =
+@@ -181,6 +182,7 @@ static const struct myoption opts[] =
+ { "local-service", 0, 0, LOPT_LOCAL_SERVICE },
+ { "bogus-priv", 0, 0, 'b' },
+ { "bogus-nxdomain", 1, 0, 'B' },
++ { "ignore-address", 1, 0, LOPT_IGNORE_ADDR },
+ { "selfmx", 0, 0, 'e' },
+ { "filterwin2k", 0, 0, 'f' },
+ { "pid-file", 2, 0, 'x' },
+@@ -457,6 +459,7 @@ static struct {
+ { LOPT_QUIET_RA, OPT_QUIET_RA, NULL, gettext_noop("Do not log RA."), NULL },
+ { LOPT_LOCAL_SERVICE, OPT_LOCAL_SERVICE, NULL, gettext_noop("Accept queries only from directly-connected networks"), NULL },
+ { LOPT_LOOP_DETECT, OPT_LOOP_DETECT, NULL, gettext_noop("Detect and remove DNS forwarding loops"), NULL },
++ { LOPT_IGNORE_ADDR, ARG_DUP, "<ipaddr>", gettext_noop("Ignore DNS responses containing ipaddr."), NULL },
+ { 0, 0, NULL, NULL, NULL }
+ };
+
+@@ -2119,14 +2122,23 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ break;
+
+ case 'B': /* --bogus-nxdomain */
+- {
++ case LOPT_IGNORE_ADDR: /* --ignore-address */
++ {
+ struct in_addr addr;
+ unhide_metas(arg);
+ if (arg && (inet_pton(AF_INET, arg, &addr) > 0))
+ {
+ struct bogus_addr *baddr = opt_malloc(sizeof(struct bogus_addr));
+- baddr->next = daemon->bogus_addr;
+- daemon->bogus_addr = baddr;
++ if (option == 'B')
++ {
++ baddr->next = daemon->bogus_addr;
++ daemon->bogus_addr = baddr;
++ }
++ else
++ {
++ baddr->next = daemon->ignore_addr;
++ daemon->ignore_addr = baddr;
++ }
+ baddr->addr = addr;
+ }
+ else
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index bdeb3fb10e68..75c4266b47dd 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1328,6 +1328,43 @@ int check_for_bogus_wildcard(struct dns_header *header, size_t qlen, char *name,
+ return 0;
+ }
+
++int check_for_ignored_address(struct dns_header *header, size_t qlen, struct bogus_addr *baddr)
++{
++ unsigned char *p;
++ int i, qtype, qclass, rdlen;
++ struct bogus_addr *baddrp;
++
++ /* skip over questions */
++ if (!(p = skip_questions(header, qlen)))
++ return 0; /* bad packet */
++
++ for (i = ntohs(header->ancount); i != 0; i--)
++ {
++ if (!(p = skip_name(p, header, qlen, 10)))
++ return 0; /* bad packet */
++
++ GETSHORT(qtype, p);
++ GETSHORT(qclass, p);
++ p += 4; /* TTL */
++ GETSHORT(rdlen, p);
++
++ if (qclass == C_IN && qtype == T_A)
++ {
++ if (!CHECK_LEN(header, p, qlen, INADDRSZ))
++ return 0;
++
++ for (baddrp = baddr; baddrp; baddrp = baddrp->next)
++ if (memcmp(&baddrp->addr, p, INADDRSZ) == 0)
++ return 1;
++ }
++
++ if (!ADD_RDLEN(header, p, qlen, rdlen))
++ return 0;
++ }
++
++ return 0;
++}
++
+ int add_resource_record(struct dns_header *header, char *limit, int *truncp, int nameoffset, unsigned char **pp,
+ unsigned long ttl, int *offset, unsigned short type, unsigned short class, char *format, ...)
+ {
+--
+2.1.0
+
From 0b1008d367d44e77352134a4c5178f896f0db3e7 Mon Sep 17 00:00:00 2001
From: Simon Kelley <simon@thekelleys.org.uk>
Date: Sat, 27 Dec 2014 15:33:32 +0000
-Subject: [PATCH] Bad packet protection.
+Subject: [PATCH 22/55] Bad packet protection.
---
- src/dnssec.c | 2 +-
+ src/dnssec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dnssec.c b/src/dnssec.c
-index ed8cf89..026794b 100644
+index ed8cf893bad2..026794b077e5 100644
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -805,7 +805,7 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
}
--
-1.7.10.4
+2.1.0
--- /dev/null
+From d310ab7ecbffce79d3d90debba621e0222f9bced Mon Sep 17 00:00:00 2001
+From: Matthias Andree <matthias.andree@gmx.de>
+Date: Sat, 27 Dec 2014 15:36:38 +0000
+Subject: [PATCH 23/55] Fix build failure in new inotify code on BSD.
+
+---
+ src/inotify.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/inotify.c b/src/inotify.c
+index 960bf5efb41f..83730008c11b 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -15,10 +15,10 @@
+ */
+
+ #include "dnsmasq.h"
+-#include <sys/inotify.h>
+-
+ #ifdef HAVE_LINUX_NETWORK
+
++#include <sys/inotify.h>
++
+ /* the strategy is to set a inotify on the directories containing
+ resolv files, for any files in the directory which are close-write
+ or moved into the directory.
+--
+2.1.0
+
--- /dev/null
+From 81c538efcebfce2ce4a1d3a420b6c885b8f08df9 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Sat, 3 Jan 2015 16:36:14 +0000
+Subject: [PATCH 24/55] Implement makefile dependencies on COPTS variable.
+
+---
+ .gitignore | 2 +-
+ Makefile | 10 ++++++----
+ 2 files changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/.gitignore b/.gitignore
+index fcdbcbd135ae..23f11488ab4c 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -3,7 +3,7 @@ src/*.mo
+ src/dnsmasq.pot
+ src/dnsmasq
+ src/dnsmasq_baseline
+-src/.configured
++src/.copts_*
+ contrib/wrt/dhcp_lease_time
+ contrib/wrt/dhcp_release
+ debian/base/
+diff --git a/Makefile b/Makefile
+index c340f1c7b59a..5675f60c2036 100644
+--- a/Makefile
++++ b/Makefile
+@@ -64,6 +64,8 @@ nettle_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG
+ gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP --copy -lgmp`
+ sunos_libs = `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket -lnsl -lposix4; fi`
+ version = -DVERSION='\"`$(top)/bld/get-version $(top)`\"'
++copts_conf = .copts_$(shell $(CC) -DDNSMASQ_COMPILE_OPTS $(COPTS) -E $(top)/$(SRC)/dnsmasq.h | \
++ ( md5sum 2>/dev/null || md5 ) | cut -f 1 -d ' ')
+
+ objs = cache.o rfc1035.o util.o option.o forward.o network.o \
+ dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
+@@ -83,7 +85,7 @@ all : $(BUILDDIR)
+
+ mostly_clean :
+ rm -f $(BUILDDIR)/*.mo $(BUILDDIR)/*.pot
+- rm -f $(BUILDDIR)/.configured $(BUILDDIR)/*.o $(BUILDDIR)/dnsmasq.a $(BUILDDIR)/dnsmasq
++ rm -f $(BUILDDIR)/.copts_* $(BUILDDIR)/*.o $(BUILDDIR)/dnsmasq.a $(BUILDDIR)/dnsmasq
+
+ clean : mostly_clean
+ rm -f $(BUILDDIR)/dnsmasq_baseline
+@@ -139,8 +141,8 @@ bloatcheck : $(BUILDDIR)/dnsmasq_baseline mostly_clean all
+
+ # rules below are targets in recusive makes with cwd=$(BUILDDIR)
+
+-.configured: $(hdrs)
+- @rm -f *.o
++$(copts_conf): $(hdrs)
++ @rm -f *.o .copts_*
+ @touch $@
+
+ $(objs:.o=.c) $(hdrs):
+@@ -149,7 +151,7 @@ $(objs:.o=.c) $(hdrs):
+ .c.o:
+ $(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $<
+
+-dnsmasq : .configured $(hdrs) $(objs)
++dnsmasq : $(copts_conf) $(hdrs) $(objs)
+ $(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS)
+
+ dnsmasq.pot : $(objs:.o=.c) $(hdrs)
+--
+2.1.0
+
--- /dev/null
+From d8dbd903d024f84a149dac2f8a674a68dfed47a3 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Mon, 5 Jan 2015 17:03:35 +0000
+Subject: [PATCH 25/55] Fix race condition issue in makefile.
+
+---
+ Makefile | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 5675f60c2036..bcbd5571671d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -148,10 +148,12 @@ $(copts_conf): $(hdrs)
+ $(objs:.o=.c) $(hdrs):
+ ln -s $(top)/$(SRC)/$@ .
+
++$(objs): $(copts_conf) $(hdrs)
++
+ .c.o:
+ $(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $<
+
+-dnsmasq : $(copts_conf) $(hdrs) $(objs)
++dnsmasq : $(objs)
+ $(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS)
+
+ dnsmasq.pot : $(objs:.o=.c) $(hdrs)
+--
+2.1.0
+
--- /dev/null
+From 97e618a0e3f29465acc689d87288596b006f197e Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Wed, 7 Jan 2015 21:55:43 +0000
+Subject: [PATCH 26/55] DNSSEC: do top-down search for limit of secure
+ delegation.
+
+---
+ CHANGELOG | 9 ++
+ src/dnsmasq.h | 11 +-
+ src/dnssec.c | 91 +++++++++-------
+ src/forward.c | 327 +++++++++++++++++++++++++++++++++-------------------------
+ 4 files changed, 260 insertions(+), 178 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 2b6356bcfb02..e8bf80f81baa 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -31,7 +31,16 @@ version 2.73
+ request for certain domains, before the correct answer can
+ arrive. Thanks to Glen Huang for the patch.
+
++ Revisit the part of DNSSEC validation which determines if an
++ unsigned answer is legit, or is in some part of the DNS
++ tree which should be signed. Dnsmasq now works from the
++ DNS root downward looking for the limit of signed
++ delegations, rather than working bottom up. This is
++ both more correct, and less likely to trip over broken
++ nameservers in the unsigned parts of the DNS tree
++ which don't respond well to DNSSEC queries.
+
++
+ version 2.72
+ Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
+
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 7bc982ddf73c..2f4597294a56 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -569,8 +569,9 @@ struct hostsfile {
+ #define STAT_SECURE_WILDCARD 7
+ #define STAT_NO_SIG 8
+ #define STAT_NO_DS 9
+-#define STAT_NEED_DS_NEG 10
+-#define STAT_CHASE_CNAME 11
++#define STAT_NO_NS 10
++#define STAT_NEED_DS_NEG 11
++#define STAT_CHASE_CNAME 12
+
+ #define FREC_NOREBIND 1
+ #define FREC_CHECKING_DISABLED 2
+@@ -604,7 +605,9 @@ struct frec {
+ #ifdef HAVE_DNSSEC
+ int class, work_counter;
+ struct blockdata *stash; /* Saved reply, whilst we validate */
+- size_t stash_len;
++ struct blockdata *orig_domain; /* domain of original query, whilst
++ we're seeing is if in unsigned domain */
++ size_t stash_len, name_start, name_len;
+ struct frec *dependent; /* Query awaiting internally-generated DNSKEY or DS query */
+ struct frec *blocking_query; /* Query which is blocking us. */
+ #endif
+@@ -1126,7 +1129,7 @@ int in_zone(struct auth_zone *zone, char *name, char **cut);
+ size_t dnssec_generate_query(struct dns_header *header, char *end, char *name, int class, int type, union mysockaddr *addr);
+ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t n, char *name, char *keyname, int class);
+ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class);
+-int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int *class, int *neganswer);
++int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int *class, int *neganswer, int *nons);
+ int dnssec_chase_cname(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname);
+ int dnskey_keytag(int alg, int flags, unsigned char *rdata, int rdlen);
+ size_t filter_rrsigs(struct dns_header *header, size_t plen);
+diff --git a/src/dnssec.c b/src/dnssec.c
+index 026794b077e5..8f27677628b2 100644
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -875,8 +875,7 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
+ /* The DNS packet is expected to contain the answer to a DNSKEY query.
+ Put all DNSKEYs in the answer which are valid into the cache.
+ return codes:
+- STAT_INSECURE No DNSKEYs in reply.
+- STAT_SECURE At least one valid DNSKEY found and in cache.
++ STAT_SECURE At least one valid DNSKEY found and in cache.
+ STAT_BOGUS No DNSKEYs found, which can be validated with DS,
+ or self-sign for DNSKEY RRset is not valid, bad packet.
+ STAT_NEED_DS DS records to validate a key not found, name in keyname
+@@ -896,11 +895,8 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
+ GETSHORT(qtype, p);
+ GETSHORT(qclass, p);
+
+- if (qtype != T_DNSKEY || qclass != class)
++ if (qtype != T_DNSKEY || qclass != class || ntohs(header->ancount) == 0)
+ return STAT_BOGUS;
+-
+- if (ntohs(header->ancount) == 0)
+- return STAT_INSECURE;
+
+ /* See if we have cached a DS record which validates this key */
+ if (!(crecp = cache_find_by_name(NULL, name, now, F_DS)))
+@@ -1103,17 +1099,17 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
+ /* The DNS packet is expected to contain the answer to a DS query
+ Put all DSs in the answer which are valid into the cache.
+ return codes:
+- STAT_INSECURE no DS in reply or not signed.
+ STAT_SECURE At least one valid DS found and in cache.
+ STAT_NO_DS It's proved there's no DS here.
+- STAT_BOGUS At least one DS found, which fails validation, bad packet.
++ STAT_NO_NS It's proved there's no DS _or_ NS here.
++ STAT_BOGUS no DS in reply or not signed, fails validation, bad packet.
+ STAT_NEED_DNSKEY DNSKEY records to validate a DS not found, name in keyname
+ */
+
+ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class)
+ {
+ unsigned char *p = (unsigned char *)(header+1);
+- int qtype, qclass, val, i, neganswer;
++ int qtype, qclass, val, i, neganswer, nons;
+
+ if (ntohs(header->qdcount) != 1 ||
+ !(p = skip_name(p, header, plen, 4)))
+@@ -1125,32 +1121,39 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
+ if (qtype != T_DS || qclass != class)
+ val = STAT_BOGUS;
+ else
+- val = dnssec_validate_reply(now, header, plen, name, keyname, NULL, &neganswer);
+-
+- if (val == STAT_NO_SIG)
+- val = STAT_INSECURE;
++ val = dnssec_validate_reply(now, header, plen, name, keyname, NULL, &neganswer, &nons);
++ /* Note dnssec_validate_reply() will have cached positive answers */
++
++ if (val == STAT_NO_SIG || val == STAT_INSECURE)
++ val = STAT_BOGUS;
+
+ p = (unsigned char *)(header+1);
+ extract_name(header, plen, &p, name, 1, 4);
+ p += 4; /* qtype, qclass */
+
+ if (!(p = skip_section(p, ntohs(header->ancount), header, plen)))
+- return STAT_BOGUS;
++ val = STAT_BOGUS;
+
+ if (val == STAT_BOGUS)
+- log_query(F_UPSTREAM, name, NULL, "BOGUS DS");
+-
+- if ((val == STAT_SECURE || val == STAT_INSECURE) && neganswer)
+ {
+- int rdlen, flags = F_FORWARD | F_DS | F_NEG;
++ log_query(F_UPSTREAM, name, NULL, "BOGUS DS");
++ return STAT_BOGUS;
++ }
++
++ /* By here, the answer is proved secure, and a positive answer has been cached. */
++ if (val == STAT_SECURE && neganswer)
++ {
++ int rdlen, flags = F_FORWARD | F_DS | F_NEG | F_DNSSECOK;
+ unsigned long ttl, minttl = ULONG_MAX;
+ struct all_addr a;
+
+ if (RCODE(header) == NXDOMAIN)
+ flags |= F_NXDOMAIN;
+
+- if (val == STAT_SECURE)
+- flags |= F_DNSSECOK;
++ /* We only cache validated DS records, DNSSECOK flag hijacked
++ to store presence/absence of NS. */
++ if (nons)
++ flags &= ~F_DNSSECOK;
+
+ for (i = ntohs(header->nscount); i != 0; i--)
+ {
+@@ -1196,10 +1199,12 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
+ a.addr.dnssec.class = class;
+ cache_insert(name, &a, now, ttl, flags);
+
+- cache_end_insert();
++ cache_end_insert();
++
++ log_query(F_UPSTREAM, name, NULL, nons ? "no delegation" : "no DS");
+ }
+
+- return (val == STAT_SECURE) ? STAT_NO_DS : STAT_INSECURE;
++ return nons ? STAT_NO_NS : STAT_NO_DS;
+ }
+
+ return val;
+@@ -1323,12 +1328,15 @@ static int find_nsec_records(struct dns_header *header, size_t plen, unsigned ch
+ }
+
+ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsigned char **nsecs, int nsec_count,
+- char *workspace1, char *workspace2, char *name, int type)
++ char *workspace1, char *workspace2, char *name, int type, int *nons)
+ {
+ int i, rc, rdlen;
+ unsigned char *p, *psave;
+ int offset = (type & 0xff) >> 3;
+ int mask = 0x80 >> (type & 0x07);
++
++ if (nons)
++ *nons = 0;
+
+ /* Find NSEC record that proves name doesn't exist */
+ for (i = 0; i < nsec_count; i++)
+@@ -1355,6 +1363,10 @@ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsi
+ rdlen -= p - psave;
+ /* rdlen is now length of type map, and p points to it */
+
++ /* If we can prove that there's no NS record, return that information. */
++ if (nons && rdlen >= 2 && p[0] == 0 && (p[2] & (0x80 >> T_NS)) == 0)
++ *nons = 1;
++
+ while (rdlen >= 2)
+ {
+ if (!CHECK_LEN(header, p, plen, rdlen))
+@@ -1456,7 +1468,7 @@ static int base32_decode(char *in, unsigned char *out)
+ }
+
+ static int check_nsec3_coverage(struct dns_header *header, size_t plen, int digest_len, unsigned char *digest, int type,
+- char *workspace1, char *workspace2, unsigned char **nsecs, int nsec_count)
++ char *workspace1, char *workspace2, unsigned char **nsecs, int nsec_count, int *nons)
+ {
+ int i, hash_len, salt_len, base32_len, rdlen;
+ unsigned char *p, *psave;
+@@ -1497,6 +1509,10 @@ static int check_nsec3_coverage(struct dns_header *header, size_t plen, int dige
+ if (!CHECK_LEN(header, p, plen, rdlen))
+ return 0;
+
++ /* If we can prove that there's no NS record, return that information. */
++ if (nons && rdlen >= 2 && p[0] == 0 && (p[2] & (0x80 >> T_NS)) == 0)
++ *nons = 1;
++
+ while (rdlen >= 2)
+ {
+ if (p[0] == type >> 8)
+@@ -1533,13 +1549,16 @@ static int check_nsec3_coverage(struct dns_header *header, size_t plen, int dige
+ }
+
+ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, unsigned char **nsecs, int nsec_count,
+- char *workspace1, char *workspace2, char *name, int type, char *wildname)
++ char *workspace1, char *workspace2, char *name, int type, char *wildname, int *nons)
+ {
+ unsigned char *salt, *p, *digest;
+ int digest_len, i, iterations, salt_len, base32_len, algo = 0;
+ struct nettle_hash const *hash;
+ char *closest_encloser, *next_closest, *wildcard;
+-
++
++ if (nons)
++ *nons = 0;
++
+ /* Look though the NSEC3 records to find the first one with
+ an algorithm we support (currently only algo == 1).
+
+@@ -1612,7 +1631,7 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
+ if ((digest_len = hash_name(name, &digest, hash, salt, salt_len, iterations)) == 0)
+ return STAT_BOGUS;
+
+- if (check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count))
++ if (check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count, nons))
+ return STAT_SECURE;
+
+ /* Can't find an NSEC3 which covers the name directly, we need the "closest encloser NSEC3"
+@@ -1657,7 +1676,7 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
+ if ((digest_len = hash_name(next_closest, &digest, hash, salt, salt_len, iterations)) == 0)
+ return STAT_BOGUS;
+
+- if (!check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count))
++ if (!check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count, NULL))
+ return STAT_BOGUS;
+
+ /* Finally, check that there's no seat of wildcard synthesis */
+@@ -1672,7 +1691,7 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
+ if ((digest_len = hash_name(wildcard, &digest, hash, salt, salt_len, iterations)) == 0)
+ return STAT_BOGUS;
+
+- if (!check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count))
++ if (!check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count, NULL))
+ return STAT_BOGUS;
+ }
+
+@@ -1681,7 +1700,8 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
+
+ /* Validate all the RRsets in the answer and authority sections of the reply (4035:3.2.3) */
+ /* Returns are the same as validate_rrset, plus the class if the missing key is in *class */
+-int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int *class, int *neganswer)
++int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname,
++ int *class, int *neganswer, int *nons)
+ {
+ unsigned char *ans_start, *qname, *p1, *p2, **nsecs;
+ int type1, class1, rdlen1, type2, class2, rdlen2, qclass, qtype;
+@@ -1811,10 +1831,11 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
+ return STAT_BOGUS; /* No NSECs or bad packet */
+
+ if (nsec_type == T_NSEC)
+- rc = prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, type1);
++ rc = prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, type1, NULL);
+ else
+- rc = prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, type1, wildname);
+-
++ rc = prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename,
++ keyname, name, type1, wildname, NULL);
++
+ if (rc != STAT_SECURE)
+ return rc;
+ }
+@@ -1937,9 +1958,9 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
+ return STAT_BOGUS;
+
+ if (nsec_type == T_NSEC)
+- return prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype);
++ return prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, nons);
+ else
+- return prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, NULL);
++ return prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, NULL, nons);
+ }
+
+ /* Chase the CNAME chain in the packet until the first record which _doesn't validate.
+diff --git a/src/forward.c b/src/forward.c
+index f28c7d51f708..ee8d7b52d5e5 100644
+--- a/src/forward.c
++++ b/src/forward.c
+@@ -26,8 +26,9 @@ static void free_frec(struct frec *f);
+ #ifdef HAVE_DNSSEC
+ static int tcp_key_recurse(time_t now, int status, struct dns_header *header, size_t n,
+ int class, char *name, char *keyname, struct server *server, int *keycount);
+-static int do_check_sign(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class);
+-static int send_check_sign(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname);
++static int do_check_sign(struct frec *forward, int status, time_t now, char *name, char *keyname);
++static int send_check_sign(struct frec *forward, time_t now, struct dns_header *header, size_t plen,
++ char *name, char *keyname);
+ #endif
+
+
+@@ -815,18 +816,22 @@ void reply_query(int fd, int family, time_t now)
+ else if (forward->flags & FREC_DS_QUERY)
+ {
+ status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
+- if (status == STAT_NO_DS)
+- status = STAT_INSECURE;
++ if (status == STAT_NO_DS || status == STAT_NO_NS)
++ status = STAT_BOGUS;
+ }
+ else if (forward->flags & FREC_CHECK_NOSIGN)
+- status = do_check_sign(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
++ {
++ status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
++ if (status != STAT_NEED_KEY)
++ status = do_check_sign(forward, status, now, daemon->namebuff, daemon->keyname);
++ }
+ else
+ {
+- status = dnssec_validate_reply(now, header, n, daemon->namebuff, daemon->keyname, &forward->class, NULL);
++ status = dnssec_validate_reply(now, header, n, daemon->namebuff, daemon->keyname, &forward->class, NULL, NULL);
+ if (status == STAT_NO_SIG)
+ {
+ if (option_bool(OPT_DNSSEC_NO_SIGN))
+- status = send_check_sign(now, header, n, daemon->namebuff, daemon->keyname);
++ status = send_check_sign(forward, now, header, n, daemon->namebuff, daemon->keyname);
+ else
+ status = STAT_INSECURE;
+ }
+@@ -861,6 +866,7 @@ void reply_query(int fd, int family, time_t now)
+ new->blocking_query = NULL;
+ new->sentto = server;
+ new->rfd4 = NULL;
++ new->orig_domain = NULL;
+ #ifdef HAVE_IPV6
+ new->rfd6 = NULL;
+ #endif
+@@ -889,7 +895,9 @@ void reply_query(int fd, int family, time_t now)
+ new->new_id = get_id();
+ header->id = htons(new->new_id);
+ /* Save query for retransmission */
+- new->stash = blockdata_alloc((char *)header, nn);
++ if (!(new->stash = blockdata_alloc((char *)header, nn)))
++ return;
++
+ new->stash_len = nn;
+
+ /* Don't resend this. */
+@@ -946,18 +954,22 @@ void reply_query(int fd, int family, time_t now)
+ else if (forward->flags & FREC_DS_QUERY)
+ {
+ status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
+- if (status == STAT_NO_DS)
+- status = STAT_INSECURE;
++ if (status == STAT_NO_DS || status == STAT_NO_NS)
++ status = STAT_BOGUS;
+ }
+ else if (forward->flags & FREC_CHECK_NOSIGN)
+- status = do_check_sign(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
++ {
++ status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
++ if (status != STAT_NEED_KEY)
++ status = do_check_sign(forward, status, now, daemon->namebuff, daemon->keyname);
++ }
+ else
+ {
+- status = dnssec_validate_reply(now, header, n, daemon->namebuff, daemon->keyname, &forward->class, NULL);
++ status = dnssec_validate_reply(now, header, n, daemon->namebuff, daemon->keyname, &forward->class, NULL, NULL);
+ if (status == STAT_NO_SIG)
+ {
+ if (option_bool(OPT_DNSSEC_NO_SIGN))
+- status = send_check_sign(now, header, n, daemon->namebuff, daemon->keyname);
++ status = send_check_sign(forward, now, header, n, daemon->namebuff, daemon->keyname);
+ else
+ status = STAT_INSECURE;
+ }
+@@ -1319,70 +1331,80 @@ void receive_query(struct listener *listen, time_t now)
+ /* UDP: we've got an unsigned answer, return STAT_INSECURE if we can prove there's no DS
+ and therefore the answer shouldn't be signed, or STAT_BOGUS if it should be, or
+ STAT_NEED_DS_NEG and keyname if we need to do the query. */
+-static int send_check_sign(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname)
++static int send_check_sign(struct frec *forward, time_t now, struct dns_header *header, size_t plen,
++ char *name, char *keyname)
+ {
+- struct crec *crecp;
+- char *name_start = name;
+ int status = dnssec_chase_cname(now, header, plen, name, keyname);
+
+ if (status != STAT_INSECURE)
+ return status;
+
++ /* Store the domain we're trying to check. */
++ forward->name_start = strlen(name);
++ forward->name_len = forward->name_start + 1;
++ if (!(forward->orig_domain = blockdata_alloc(name, forward->name_len)))
++ return STAT_BOGUS;
++
++ return do_check_sign(forward, 0, now, name, keyname);
++}
++
++/* We either have a a reply (header non-NULL, or we need to start by looking in the cache */
++static int do_check_sign(struct frec *forward, int status, time_t now, char *name, char *keyname)
++{
++ /* get domain we're checking back from blockdata store, it's stored on the original query. */
++ while (forward->dependent)
++ forward = forward->dependent;
++
++ blockdata_retrieve(forward->orig_domain, forward->name_len, name);
++
+ while (1)
+ {
+- crecp = cache_find_by_name(NULL, name_start, now, F_DS);
+-
+- if (crecp && (crecp->flags & F_DNSSECOK))
+- return (crecp->flags & F_NEG) ? STAT_INSECURE : STAT_BOGUS;
+-
+- if (crecp && (crecp->flags & F_NEG) && (name_start = strchr(name_start, '.')))
++ char *p;
++
++ if (status == 0)
+ {
+- name_start++; /* chop a label off and try again */
+- continue;
++ struct crec *crecp;
++
++ /* Haven't received answer, see if in cache */
++ if (!(crecp = cache_find_by_name(NULL, &name[forward->name_start], now, F_DS)))
++ {
++ /* put name of DS record we're missing into keyname */
++ strcpy(keyname, &name[forward->name_start]);
++ /* and wait for reply to arrive */
++ return STAT_NEED_DS_NEG;
++ }
++
++ /* F_DNSSECOK misused in DS cache records to non-existance of NS record */
++ if (!(crecp->flags & F_NEG))
++ status = STAT_SECURE;
++ else if (crecp->flags & F_DNSSECOK)
++ status = STAT_NO_DS;
++ else
++ status = STAT_NO_NS;
+ }
++
++ /* Have entered non-signed part of DNS tree. */
++ if (status == STAT_NO_DS)
++ return STAT_INSECURE;
+
+- /* Reached the root */
+- if (!name_start)
++ if (status == STAT_BOGUS)
+ return STAT_BOGUS;
+
+- strcpy(keyname, name_start);
+- return STAT_NEED_DS_NEG;
+- }
+-}
+-
+-/* Got answer to DS query from send_check_sign, check for proven non-existence, or make the next DS query to try. */
+-static int do_check_sign(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class)
+-
+-{
+- char *name_start;
+- unsigned char *p;
+- int status;
++ /* There's a proven DS record, or we're within a zone, where there doesn't need
++ to be a DS record. Add a name and try again.
++ If we've already tried the whole name, then fail */
+
+- /* In this case only, a SERVFAIL reply allows us to continue up the tree, looking for a
+- suitable NSEC reply to DS queries. */
+- if (RCODE(header) != SERVFAIL)
+- {
+- status = dnssec_validate_ds(now, header, plen, name, keyname, class);
++ if (forward->name_start == 0)
++ return STAT_BOGUS;
+
+- if (status != STAT_INSECURE)
+- {
+- if (status == STAT_NO_DS)
+- status = STAT_INSECURE;
+- return status;
+- }
+- }
+-
+- p = (unsigned char *)(header+1);
+-
+- if (extract_name(header, plen, &p, name, 1, 4) &&
+- (name_start = strchr(name, '.')))
+- {
+- name_start++; /* chop a label off and try again */
+- strcpy(keyname, name_start);
+- return STAT_NEED_DS_NEG;
++ for (p = &name[forward->name_start-2]; (*p != '.') && (p != name); p--);
++
++ if (p != name)
++ p++;
++
++ forward->name_start = p - name;
++ status = 0; /* force to cache when we iterate. */
+ }
+-
+- return STAT_BOGUS;
+ }
+
+ /* Move toward the root, until we find a signed non-existance of a DS, in which case
+@@ -1395,8 +1417,10 @@ static int tcp_check_for_unsigned_zone(time_t now, struct dns_header *header, s
+ unsigned char *packet, *payload;
+ u16 *length;
+ unsigned char *p = (unsigned char *)(header+1);
+- int status;
+- char *name_start = name;
++ int status, name_len;
++ struct blockdata *block;
++
++ char *name_start;
+
+ /* Get first insecure entry in CNAME chain */
+ status = tcp_key_recurse(now, STAT_CHASE_CNAME, header, plen, class, name, keyname, server, keycount);
+@@ -1409,95 +1433,113 @@ static int tcp_check_for_unsigned_zone(time_t now, struct dns_header *header, s
+ payload = &packet[2];
+ header = (struct dns_header *)payload;
+ length = (u16 *)packet;
++
++ /* Stash the name away, since the buffer will be trashed when we recurse */
++ name_len = strlen(name) + 1;
++ name_start = name + name_len - 1;
+
++ if (!(block = blockdata_alloc(name, name_len)))
++ {
++ free(packet);
++ return STAT_BOGUS;
++ }
++
+ while (1)
+ {
+- unsigned char *newhash, hash[HASH_SIZE];
+ unsigned char c1, c2;
+- struct crec *crecp = cache_find_by_name(NULL, name_start, now, F_DS);
+-
++ struct crec *crecp;
++
+ if (--(*keycount) == 0)
+ {
+ free(packet);
++ blockdata_free(block);
+ return STAT_BOGUS;
+ }
+-
+- if (crecp && (crecp->flags & F_DNSSECOK))
+- {
+- free(packet);
+- return (crecp->flags & F_NEG) ? STAT_INSECURE : STAT_BOGUS;
+- }
+
+- /* If we have cached insecurely that a DS doesn't exist,
+- ise that is a hit for where to start looking for the secure one */
+- if (crecp && (crecp->flags & F_NEG) && (name_start = strchr(name_start, '.')))
+- {
+- name_start++; /* chop a label off and try again */
+- continue;
+- }
+-
+- /* reached the root */
+- if (!name_start)
+- {
+- free(packet);
+- return STAT_BOGUS;
++ while (crecp = cache_find_by_name(NULL, name_start, now, F_DS))
++ {
++ if ((crecp->flags & F_NEG) && (crecp->flags & F_DNSSECOK))
++ {
++ /* Found a secure denial of DS - delegation is indeed insecure */
++ free(packet);
++ blockdata_free(block);
++ return STAT_INSECURE;
++ }
++
++ /* Here, either there's a secure DS, or no NS and no DS, and therefore no delegation.
++ Add another label and continue. */
++
++ if (name_start == name)
++ {
++ free(packet);
++ blockdata_free(block);
++ return STAT_BOGUS; /* run out of labels */
++ }
++
++ name_start -= 2;
++ while (*name_start != '.' && name_start != name)
++ name_start--;
++ if (name_start != name)
++ name_start++;
+ }
++
++ /* Can't find it in the cache, have to send a query */
+
+ m = dnssec_generate_query(header, ((char *) header) + 65536, name_start, class, T_DS, &server->addr);
+
+- /* We rely on the question section coming back unchanged, ensure it is with the hash. */
+- if ((newhash = hash_questions(header, (unsigned int)m, name)))
+- {
+- memcpy(hash, newhash, HASH_SIZE);
++ *length = htons(m);
+
+- *length = htons(m);
++ if (read_write(server->tcpfd, packet, m + sizeof(u16), 0) &&
++ read_write(server->tcpfd, &c1, 1, 1) &&
++ read_write(server->tcpfd, &c2, 1, 1) &&
++ read_write(server->tcpfd, payload, (c1 << 8) | c2, 1))
++ {
++ m = (c1 << 8) | c2;
++
++ /* Note this trashes all three name workspaces */
++ status = tcp_key_recurse(now, STAT_NEED_DS_NEG, header, m, class, name, keyname, server, keycount);
+
+- if (read_write(server->tcpfd, packet, m + sizeof(u16), 0) &&
+- read_write(server->tcpfd, &c1, 1, 1) &&
+- read_write(server->tcpfd, &c2, 1, 1) &&
+- read_write(server->tcpfd, payload, (c1 << 8) | c2, 1))
++ if (status == STAT_NO_DS)
+ {
+- m = (c1 << 8) | c2;
+-
+- newhash = hash_questions(header, (unsigned int)m, name);
+- if (newhash && memcmp(hash, newhash, HASH_SIZE) == 0)
+- {
+- /* In this case only, a SERVFAIL reply allows us to continue up the tree, looking for a
+- suitable NSEC reply to DS queries. */
+- if (RCODE(header) == SERVFAIL)
+- status = STAT_INSECURE;
+- else
+- /* Note this trashes all three name workspaces */
+- status = tcp_key_recurse(now, STAT_NEED_DS_NEG, header, m, class, name, keyname, server, keycount);
+-
+- /* We've found a DS which proves the bit of the DNS where the
+- original query is, is unsigned, so the answer is OK,
+- if unvalidated. */
+- if (status == STAT_NO_DS)
+- {
+- free(packet);
+- return STAT_INSECURE;
+- }
+-
+- /* No DS, not got to DNSSEC-land yet, go up. */
+- if (status == STAT_INSECURE)
+- {
+- p = (unsigned char *)(header+1);
+-
+- if (extract_name(header, plen, &p, name, 1, 4) &&
+- (name_start = strchr(name, '.')))
+- {
+- name_start++; /* chop a label off and try again */
+- continue;
+- }
+- }
+- }
++ /* Found a secure denial of DS - delegation is indeed insecure */
++ free(packet);
++ blockdata_free(block);
++ return STAT_INSECURE;
++ }
++
++ if (status == STAT_BOGUS)
++ {
++ free(packet);
++ blockdata_free(block);
++ return STAT_BOGUS;
++ }
++
++ /* Here, either there's a secure DS, or no NS and no DS, and therefore no delegation.
++ Add another label and continue. */
++
++ /* Get name we're checking back. */
++ blockdata_retrieve(block, name_len, name);
++
++ if (name_start == name)
++ {
++ free(packet);
++ blockdata_free(block);
++ return STAT_BOGUS; /* run out of labels */
+ }
++
++ name_start -= 2;
++ while (*name_start != '.' && name_start != name)
++ name_start--;
++ if (name_start != name)
++ name_start++;
++ }
++ else
++ {
++ /* IO failure */
++ free(packet);
++ blockdata_free(block);
++ return STAT_BOGUS; /* run out of labels */
+ }
+-
+- free(packet);
+-
+- return STAT_BOGUS;
+ }
+ }
+
+@@ -1516,14 +1558,14 @@ static int tcp_key_recurse(time_t now, int status, struct dns_header *header, si
+ else if (status == STAT_NEED_DS || status == STAT_NEED_DS_NEG)
+ {
+ new_status = dnssec_validate_ds(now, header, n, name, keyname, class);
+- if (status == STAT_NEED_DS && new_status == STAT_NO_DS)
+- new_status = STAT_INSECURE;
++ if (status == STAT_NEED_DS && (new_status == STAT_NO_DS || new_status == STAT_NO_NS))
++ new_status = STAT_BOGUS;
+ }
+ else if (status == STAT_CHASE_CNAME)
+ new_status = dnssec_chase_cname(now, header, n, name, keyname);
+ else
+ {
+- new_status = dnssec_validate_reply(now, header, n, name, keyname, &class, NULL);
++ new_status = dnssec_validate_reply(now, header, n, name, keyname, &class, NULL, NULL);
+
+ if (new_status == STAT_NO_SIG)
+ {
+@@ -1576,14 +1618,14 @@ static int tcp_key_recurse(time_t now, int status, struct dns_header *header, si
+ else if (status == STAT_NEED_DS || status == STAT_NEED_DS_NEG)
+ {
+ new_status = dnssec_validate_ds(now, header, n, name, keyname, class);
+- if (status == STAT_NEED_DS && new_status == STAT_NO_DS)
+- new_status = STAT_INSECURE; /* Validated no DS */
++ if (status == STAT_NEED_DS && (new_status == STAT_NO_DS || new_status == STAT_NO_NS))
++ new_status = STAT_BOGUS; /* Validated no DS */
+ }
+ else if (status == STAT_CHASE_CNAME)
+ new_status = dnssec_chase_cname(now, header, n, name, keyname);
+ else
+ {
+- new_status = dnssec_validate_reply(now, header, n, name, keyname, &class, NULL);
++ new_status = dnssec_validate_reply(now, header, n, name, keyname, &class, NULL, NULL);
+
+ if (new_status == STAT_NO_SIG)
+ {
+@@ -1961,6 +2003,7 @@ static struct frec *allocate_frec(time_t now)
+ f->dependent = NULL;
+ f->blocking_query = NULL;
+ f->stash = NULL;
++ f->orig_domain = NULL;
+ #endif
+ daemon->frec_list = f;
+ }
+@@ -2029,6 +2072,12 @@ static void free_frec(struct frec *f)
+ f->stash = NULL;
+ }
+
++ if (f->orig_domain)
++ {
++ blockdata_free(f->orig_domain);
++ f->orig_domain = NULL;
++ }
++
+ /* Anything we're waiting on is pointless now, too */
+ if (f->blocking_query)
+ free_frec(f->blocking_query);
+--
+2.1.0
+
--- /dev/null
+From 25cf5e373eb41c088d4ee5e625209c4cf6a5659e Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Fri, 9 Jan 2015 15:53:03 +0000
+Subject: [PATCH 27/55] Add --log-queries=extra option for more complete
+ logging.
+
+---
+ CHANGELOG | 3 +++
+ man/dnsmasq.8 | 5 ++++-
+ src/cache.c | 11 ++++++++++-
+ src/config.h | 1 +
+ src/dnsmasq.c | 5 +++++
+ src/dnsmasq.h | 9 +++++++--
+ src/dnssec.c | 14 +++++++-------
+ src/forward.c | 30 ++++++++++++++++++++++++++----
+ src/option.c | 11 +++++++++--
+ 9 files changed, 72 insertions(+), 17 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index e8bf80f81baa..0bbb7835df4f 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -40,6 +40,9 @@ version 2.73
+ nameservers in the unsigned parts of the DNS tree
+ which don't respond well to DNSSEC queries.
+
++ Add --log-queries=extra option, which makes logs easier
++ to search automatically.
++
+
+ version 2.72
+ Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 4236ba307df3..227d74bd80e7 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -98,7 +98,10 @@ only, to stop dnsmasq daemonising in production, use
+ .B -k.
+ .TP
+ .B \-q, --log-queries
+-Log the results of DNS queries handled by dnsmasq. Enable a full cache dump on receipt of SIGUSR1.
++Log the results of DNS queries handled by dnsmasq. Enable a full cache dump on receipt of SIGUSR1. If the argument "extra" is supplied, ie
++.B --log-queries=extra
++then the log has extra information at the start of each line.
++This consists of a serial number which ties together the log lines associated with an individual query, and the IP address of the requestor.
+ .TP
+ .B \-8, --log-facility=<facility>
+ Set the facility to which dnsmasq will send syslog entries, this
+diff --git a/src/cache.c b/src/cache.c
+index ff1ca6f1c352..960bb7938778 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -1638,7 +1638,16 @@ void log_query(unsigned int flags, char *name, struct all_addr *addr, char *arg)
+ if (strlen(name) == 0)
+ name = ".";
+
+- my_syslog(LOG_INFO, "%s %s %s %s", source, name, verb, dest);
++ if (option_bool(OPT_EXTRALOG))
++ {
++ prettyprint_addr(daemon->log_source_addr, daemon->addrbuff2);
++ if (flags & F_NOEXTRA)
++ my_syslog(LOG_INFO, "* %s %s %s %s %s", daemon->addrbuff2, source, name, verb, dest);
++ else
++ my_syslog(LOG_INFO, "%u %s %s %s %s %s", daemon->log_display_id, daemon->addrbuff2, source, name, verb, dest);
++ }
++ else
++ my_syslog(LOG_INFO, "%s %s %s %s", source, name, verb, dest);
+ }
+
+
+diff --git a/src/config.h b/src/config.h
+index 145820ad2510..3b88d8193dca 100644
+--- a/src/config.h
++++ b/src/config.h
+@@ -17,6 +17,7 @@
+ #define FTABSIZ 150 /* max number of outstanding requests (default) */
+ #define MAX_PROCS 20 /* max no children for TCP requests */
+ #define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */
++#define TCP_MAX_QUERIES 100 /* Maximum number of queries per incoming TCP connection */
+ #define EDNS_PKTSZ 4096 /* default max EDNS.0 UDP packet from RFC5625 */
+ #define KEYBLOCK_LEN 40 /* choose to mininise fragmentation when storing DNSSEC keys */
+ #define DNSSEC_WORK 50 /* Max number of queries to validate one question */
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index 5c7750d365fa..c0c0589d4ce1 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -93,6 +93,8 @@ int main (int argc, char **argv)
+ daemon->packet = safe_malloc(daemon->packet_buff_sz);
+
+ daemon->addrbuff = safe_malloc(ADDRSTRLEN);
++ if (option_bool(OPT_EXTRALOG))
++ daemon->addrbuff2 = safe_malloc(ADDRSTRLEN);
+
+ #ifdef HAVE_DNSSEC
+ if (option_bool(OPT_DNSSEC_VALID))
+@@ -1587,6 +1589,9 @@ static void check_dns_listeners(fd_set *set, time_t now)
+ }
+ }
+ close(confd);
++
++ /* The child can use up to TCP_MAX_QUERIES ids, so skip that many. */
++ daemon->log_id += TCP_MAX_QUERIES;
+ }
+ #endif
+ else
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 2f4597294a56..4e9aea401b75 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -238,7 +238,8 @@ struct event_desc {
+ #define OPT_DNSSEC_NO_SIGN 48
+ #define OPT_LOCAL_SERVICE 49
+ #define OPT_LOOP_DETECT 50
+-#define OPT_LAST 51
++#define OPT_EXTRALOG 51
++#define OPT_LAST 52
+
+ /* extra flags for my_syslog, we use a couple of facilities since they are known
+ not to occupy the same bits as priorities, no matter how syslog.h is set up. */
+@@ -442,6 +443,7 @@ struct crec {
+ #define F_NO_RR (1u<<25)
+ #define F_IPSET (1u<<26)
+ #define F_NSIGMATCH (1u<<27)
++#define F_NOEXTRA (1u<<28)
+
+ /* Values of uid in crecs with F_CONFIG bit set. */
+ #define SRC_INTERFACE 0
+@@ -599,7 +601,7 @@ struct frec {
+ #endif
+ unsigned int iface;
+ unsigned short orig_id, new_id;
+- int fd, forwardall, flags;
++ int log_id, fd, forwardall, flags;
+ time_t time;
+ unsigned char *hash[HASH_SIZE];
+ #ifdef HAVE_DNSSEC
+@@ -1002,6 +1004,8 @@ extern struct daemon {
+ struct randfd randomsocks[RANDOM_SOCKS];
+ int v6pktinfo;
+ struct addrlist *interface_addrs; /* list of all addresses/prefix lengths associated with all local interfaces */
++ int log_id, log_display_id; /* ids of transactions for logging */
++ union mysockaddr *log_source_addr;
+
+ /* DHCP state */
+ int dhcpfd, helperfd, pxefd;
+@@ -1033,6 +1037,7 @@ extern struct daemon {
+
+ /* utility string buffer, hold max sized IP address as string */
+ char *addrbuff;
++ char *addrbuff2; /* only allocated when OPT_EXTRALOG */
+
+ } *daemon;
+
+diff --git a/src/dnssec.c b/src/dnssec.c
+index 8f27677628b2..afb3dca38cb1 100644
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -1038,7 +1038,7 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
+ else
+ {
+ a.addr.keytag = keytag;
+- log_query(F_KEYTAG | F_UPSTREAM, name, &a, "DNSKEY keytag %u");
++ log_query(F_NOEXTRA | F_KEYTAG | F_UPSTREAM, name, &a, "DNSKEY keytag %u");
+
+ recp1->addr.key.keylen = rdlen - 4;
+ recp1->addr.key.keydata = key;
+@@ -1092,7 +1092,7 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
+ return STAT_SECURE;
+ }
+
+- log_query(F_UPSTREAM, name, NULL, "BOGUS DNSKEY");
++ log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, "BOGUS DNSKEY");
+ return STAT_BOGUS;
+ }
+
+@@ -1136,7 +1136,7 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
+
+ if (val == STAT_BOGUS)
+ {
+- log_query(F_UPSTREAM, name, NULL, "BOGUS DS");
++ log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, "BOGUS DS");
+ return STAT_BOGUS;
+ }
+
+@@ -1201,7 +1201,7 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
+
+ cache_end_insert();
+
+- log_query(F_UPSTREAM, name, NULL, nons ? "no delegation" : "no DS");
++ log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, nons ? "no delegation" : "no DS");
+ }
+
+ return nons ? STAT_NO_NS : STAT_NO_DS;
+@@ -1885,7 +1885,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
+ else
+ {
+ a.addr.keytag = keytag;
+- log_query(F_KEYTAG | F_UPSTREAM, name, &a, "DS keytag %u");
++ log_query(F_NOEXTRA | F_KEYTAG | F_UPSTREAM, name, &a, "DS keytag %u");
+ crecp->addr.ds.digest = digest;
+ crecp->addr.ds.keydata = key;
+ crecp->addr.ds.algo = algo;
+@@ -2058,10 +2058,10 @@ size_t dnssec_generate_query(struct dns_header *header, char *end, char *name, i
+ char *types = querystr("dnssec-query", type);
+
+ if (addr->sa.sa_family == AF_INET)
+- log_query(F_DNSSEC | F_IPV4, name, (struct all_addr *)&addr->in.sin_addr, types);
++ log_query(F_NOEXTRA | F_DNSSEC | F_IPV4, name, (struct all_addr *)&addr->in.sin_addr, types);
+ #ifdef HAVE_IPV6
+ else
+- log_query(F_DNSSEC | F_IPV6, name, (struct all_addr *)&addr->in6.sin6_addr, types);
++ log_query(F_NOEXTRA | F_DNSSEC | F_IPV6, name, (struct all_addr *)&addr->in6.sin6_addr, types);
+ #endif
+
+ header->qdcount = htons(1);
+diff --git a/src/forward.c b/src/forward.c
+index 55f583383bc6..713a64c0fa58 100644
+--- a/src/forward.c
++++ b/src/forward.c
+@@ -279,10 +279,10 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
+ plen = forward->stash_len;
+
+ if (forward->sentto->addr.sa.sa_family == AF_INET)
+- log_query(F_DNSSEC | F_IPV4, "retry", (struct all_addr *)&forward->sentto->addr.in.sin_addr, "dnssec");
++ log_query(F_NOEXTRA | F_DNSSEC | F_IPV4, "retry", (struct all_addr *)&forward->sentto->addr.in.sin_addr, "dnssec");
+ #ifdef HAVE_IPV6
+ else
+- log_query(F_DNSSEC | F_IPV6, "retry", (struct all_addr *)&forward->sentto->addr.in6.sin6_addr, "dnssec");
++ log_query(F_NOEXTRA | F_DNSSEC | F_IPV6, "retry", (struct all_addr *)&forward->sentto->addr.in6.sin6_addr, "dnssec");
+ #endif
+
+ if (forward->sentto->sfd)
+@@ -389,6 +389,9 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
+ struct server *firstsentto = start;
+ int forwarded = 0;
+
++ /* If a query is retried, use the log_id for the retry when logging the answer. */
++ forward->log_id = daemon->log_id;
++
+ if (option_bool(OPT_ADD_MAC))
+ plen = add_mac(header, plen, ((char *) header) + daemon->packet_buff_sz, &forward->source);
+
+@@ -725,6 +728,11 @@ void reply_query(int fd, int family, time_t now)
+ if (!(forward = lookup_frec(ntohs(header->id), hash)))
+ return;
+
++ /* log_query gets called indirectly all over the place, so
++ pass these in global variables - sorry. */
++ daemon->log_display_id = forward->log_id;
++ daemon->log_source_addr = &forward->source;
++
+ if (daemon->ignore_addr && RCODE(header) == NOERROR &&
+ check_for_ignored_address(header, n, daemon->ignore_addr))
+ return;
+@@ -1258,6 +1266,11 @@ void receive_query(struct listener *listen, time_t now)
+ dst_addr_4.s_addr = 0;
+ }
+ }
++
++ /* log_query gets called indirectly all over the place, so
++ pass these in global variables - sorry. */
++ daemon->log_display_id = ++daemon->log_id;
++ daemon->log_source_addr = &source_addr;
+
+ if (extract_request(header, (size_t)n, daemon->namebuff, &type))
+ {
+@@ -1675,7 +1688,8 @@ unsigned char *tcp_request(int confd, time_t now,
+ struct in_addr dst_addr_4;
+ union mysockaddr peer_addr;
+ socklen_t peer_len = sizeof(union mysockaddr);
+-
++ int query_count = 0;
++
+ if (getpeername(confd, (struct sockaddr *)&peer_addr, &peer_len) == -1)
+ return packet;
+
+@@ -1712,7 +1726,8 @@ unsigned char *tcp_request(int confd, time_t now,
+
+ while (1)
+ {
+- if (!packet ||
++ if (query_count == TCP_MAX_QUERIES ||
++ !packet ||
+ !read_write(confd, &c1, 1, 1) || !read_write(confd, &c2, 1, 1) ||
+ !(size = c1 << 8 | c2) ||
+ !read_write(confd, payload, size, 1))
+@@ -1721,6 +1736,13 @@ unsigned char *tcp_request(int confd, time_t now,
+ if (size < (int)sizeof(struct dns_header))
+ continue;
+
++ query_count++;
++
++ /* log_query gets called indirectly all over the place, so
++ pass these in global variables - sorry. */
++ daemon->log_display_id = ++daemon->log_id;
++ daemon->log_source_addr = &peer_addr;
++
+ check_subnet = 0;
+
+ /* save state of "cd" flag in query */
+diff --git a/src/option.c b/src/option.c
+index 907d0cf88de9..b7372be0a090 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -149,6 +149,7 @@ struct myoption {
+ #define LOPT_LOOP_DETECT 337
+ #define LOPT_IGNORE_ADDR 338
+
++
+ #ifdef HAVE_GETOPT_LONG
+ static const struct option opts[] =
+ #else
+@@ -160,7 +161,7 @@ static const struct myoption opts[] =
+ { "no-poll", 0, 0, 'n' },
+ { "help", 0, 0, 'w' },
+ { "no-daemon", 0, 0, 'd' },
+- { "log-queries", 0, 0, 'q' },
++ { "log-queries", 2, 0, 'q' },
+ { "user", 2, 0, 'u' },
+ { "group", 2, 0, 'g' },
+ { "resolv-file", 2, 0, 'r' },
+@@ -357,7 +358,7 @@ static struct {
+ { LOPT_FORCE, ARG_DUP, "<optspec>", gettext_noop("DHCP option sent even if the client does not request it."), NULL},
+ { 'p', ARG_ONE, "<integer>", gettext_noop("Specify port to listen for DNS requests on (defaults to 53)."), NULL },
+ { 'P', ARG_ONE, "<integer>", gettext_noop("Maximum supported UDP packet size for EDNS.0 (defaults to %s)."), "*" },
+- { 'q', OPT_LOG, NULL, gettext_noop("Log DNS queries."), NULL },
++ { 'q', ARG_DUP, NULL, gettext_noop("Log DNS queries."), NULL },
+ { 'Q', ARG_ONE, "<integer>", gettext_noop("Force the originating port for upstream DNS queries."), NULL },
+ { 'R', OPT_NO_RESOLV, NULL, gettext_noop("Do NOT read resolv.conf."), NULL },
+ { 'r', ARG_DUP, "<path>", gettext_noop("Specify path to resolv.conf (defaults to %s)."), RESOLVFILE },
+@@ -2421,6 +2422,12 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ ret_err(gen_err);
+ break;
+
++ case 'q': /* --log-queries */
++ set_option_bool(OPT_LOG);
++ if (arg && strcmp(arg, "extra") == 0)
++ set_option_bool(OPT_EXTRALOG);
++ break;
++
+ case LOPT_MAX_LOGS: /* --log-async */
+ daemon->max_logs = LOG_MAX; /* default */
+ if (arg && !atoi_check(arg, &daemon->max_logs))
+--
+2.1.0
+
--- /dev/null
+From 28de38768e2c7d763b9aa5b7a4d251d5e56bab0b Mon Sep 17 00:00:00 2001
+From: RinSatsuki <aa65535@live.com>
+Date: Sat, 10 Jan 2015 15:22:21 +0000
+Subject: [PATCH 28/55] Add --min-cache-ttl option.
+
+---
+ CHANGELOG | 7 +++++++
+ man/dnsmasq.8 | 6 ++++++
+ src/cache.c | 4 +++-
+ src/config.h | 1 +
+ src/dnsmasq.h | 2 +-
+ src/option.c | 11 +++++++++++
+ 6 files changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 0bbb7835df4f..23fc6d0530cf 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -43,6 +43,13 @@ version 2.73
+ Add --log-queries=extra option, which makes logs easier
+ to search automatically.
+
++ Add --min-cache-ttl option. I've resisted this for a long
++ time, on the grounds that disbelieving TTLs is never a
++ good idea, but I've been persuaded that there are
++ sometimes reasons to do it. (Step forward, GFW).
++ To avoid misuse, there's a hard limit on the TTL
++ floor of one hour. Thansk to RinSatsuki for the patch.
++
+
+ version 2.72
+ Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 227d74bd80e7..5cfa355dea4a 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -81,6 +81,12 @@ the upstream DNS servers.
+ .B --max-cache-ttl=<time>
+ Set a maximum TTL value for entries in the cache.
+ .TP
++.B --min-cache-ttl=<time>
++Extend short TTL values to the time given when caching them. Note that
++artificially extending TTL values is in general a bad idea, do not do it
++unless you have a good reason, and understand what you are doing.
++Dnsmasq limits the value of this option to one hour, unless recompiled.
++.TP
+ .B --auth-ttl=<time>
+ Set the TTL value returned in answers from the authoritative server.
+ .TP
+diff --git a/src/cache.c b/src/cache.c
+index 960bb7938778..945be071a0b6 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -461,9 +461,11 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
+ if (flags & (F_IPV4 | F_IPV6 | F_CNAME))
+ {
+ log_query(flags | F_UPSTREAM, name, addr, NULL);
+- /* Don;t mess with TTL for DNSSEC records. */
++ /* Don't mess with TTL for DNSSEC records. */
+ if (daemon->max_cache_ttl != 0 && daemon->max_cache_ttl < ttl)
+ ttl = daemon->max_cache_ttl;
++ if (daemon->min_cache_ttl != 0 && daemon->min_cache_ttl > ttl)
++ ttl = daemon->min_cache_ttl;
+ }
+
+ /* if previous insertion failed give up now. */
+diff --git a/src/config.h b/src/config.h
+index 3b88d8193dca..cdca231b4079 100644
+--- a/src/config.h
++++ b/src/config.h
+@@ -27,6 +27,7 @@
+ #define RANDOM_SOCKS 64 /* max simultaneous random ports */
+ #define LEASE_RETRY 60 /* on error, retry writing leasefile after LEASE_RETRY seconds */
+ #define CACHESIZ 150 /* default cache size */
++#define TTL_FLOOR_LIMIT 3600 /* don't allow --min-cache-ttl to raise TTL above this under any circumstances */
+ #define MAXLEASES 1000 /* maximum number of DHCP leases */
+ #define PING_WAIT 3 /* wait for ping address-in-use test */
+ #define PING_CACHE_TIME 30 /* Ping test assumed to be valid this long. */
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 4e9aea401b75..f8275e3ac479 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -943,7 +943,7 @@ extern struct daemon {
+ int max_logs; /* queue limit */
+ int cachesize, ftabsize;
+ int port, query_port, min_port;
+- unsigned long local_ttl, neg_ttl, max_ttl, max_cache_ttl, auth_ttl;
++ unsigned long local_ttl, neg_ttl, max_ttl, min_cache_ttl, max_cache_ttl, auth_ttl;
+ struct hostsfile *addn_hosts;
+ struct dhcp_context *dhcp, *dhcp6;
+ struct ra_interface *ra_interfaces;
+diff --git a/src/option.c b/src/option.c
+index b7372be0a090..8b994098cc9f 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -148,6 +148,7 @@ struct myoption {
+ #define LOPT_DNSSEC_TIME 336
+ #define LOPT_LOOP_DETECT 337
+ #define LOPT_IGNORE_ADDR 338
++#define LOPT_MINCTTL 339
+
+
+ #ifdef HAVE_GETOPT_LONG
+@@ -256,6 +257,7 @@ static const struct myoption opts[] =
+ { "dhcp-broadcast", 2, 0, LOPT_BROADCAST },
+ { "neg-ttl", 1, 0, LOPT_NEGTTL },
+ { "max-ttl", 1, 0, LOPT_MAXTTL },
++ { "min-cache-ttl", 1, 0, LOPT_MINCTTL },
+ { "max-cache-ttl", 1, 0, LOPT_MAXCTTL },
+ { "dhcp-alternate-port", 2, 0, LOPT_ALTPORT },
+ { "dhcp-scriptuser", 1, 0, LOPT_SCRIPTUSR },
+@@ -371,6 +373,8 @@ static struct {
+ { 'T', ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for replies from /etc/hosts."), NULL },
+ { LOPT_NEGTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for negative caching."), NULL },
+ { LOPT_MAXTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for maximum TTL to send to clients."), NULL },
++ { LOPT_MAXCTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live ceiling for cache."), NULL },
++ { LOPT_MINCTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live floor for cache."), NULL },
+ { 'u', ARG_ONE, "<username>", gettext_noop("Change to this user after startup. (defaults to %s)."), CHUSER },
+ { 'U', ARG_DUP, "set:<tag>,<class>", gettext_noop("Map DHCP vendor class to tag."), NULL },
+ { 'v', 0, NULL, gettext_noop("Display dnsmasq version and copyright information."), NULL },
+@@ -2457,6 +2461,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ case 'T': /* --local-ttl */
+ case LOPT_NEGTTL: /* --neg-ttl */
+ case LOPT_MAXTTL: /* --max-ttl */
++ case LOPT_MINCTTL: /* --min-cache-ttl */
+ case LOPT_MAXCTTL: /* --max-cache-ttl */
+ case LOPT_AUTHTTL: /* --auth-ttl */
+ {
+@@ -2467,6 +2472,12 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ daemon->neg_ttl = (unsigned long)ttl;
+ else if (option == LOPT_MAXTTL)
+ daemon->max_ttl = (unsigned long)ttl;
++ else if (option == LOPT_MINCTTL)
++ {
++ if (ttl > TTL_FLOOR_LIMIT)
++ ttl = TTL_FLOOR_LIMIT;
++ daemon->min_cache_ttl = (unsigned long)ttl;
++ }
+ else if (option == LOPT_MAXCTTL)
+ daemon->max_cache_ttl = (unsigned long)ttl;
+ else if (option == LOPT_AUTHTTL)
+--
+2.1.0
+
--- /dev/null
+From 9f79ee4ae34886c0319f06d8f162b81ef79d62fb Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 12 Jan 2015 20:18:18 +0000
+Subject: [PATCH 29/55] Log port of requestor when doing extra logging.
+
+---
+ src/cache.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/cache.c b/src/cache.c
+index 945be071a0b6..09b6dbf8087a 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -1642,11 +1642,11 @@ void log_query(unsigned int flags, char *name, struct all_addr *addr, char *arg)
+
+ if (option_bool(OPT_EXTRALOG))
+ {
+- prettyprint_addr(daemon->log_source_addr, daemon->addrbuff2);
++ int port = prettyprint_addr(daemon->log_source_addr, daemon->addrbuff2);
+ if (flags & F_NOEXTRA)
+- my_syslog(LOG_INFO, "* %s %s %s %s %s", daemon->addrbuff2, source, name, verb, dest);
++ my_syslog(LOG_INFO, "* %s/%u %s %s %s %s", daemon->addrbuff2, port, source, name, verb, dest);
+ else
+- my_syslog(LOG_INFO, "%u %s %s %s %s %s", daemon->log_display_id, daemon->addrbuff2, source, name, verb, dest);
++ my_syslog(LOG_INFO, "%u %s/%u %s %s %s %s", daemon->log_display_id, daemon->addrbuff2, port, source, name, verb, dest);
+ }
+ else
+ my_syslog(LOG_INFO, "%s %s %s %s", source, name, verb, dest);
+--
+2.1.0
+
--- /dev/null
+From 5e321739db381a1d7b5964d76e9c81471d2564c9 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 12 Jan 2015 23:16:56 +0000
+Subject: [PATCH 30/55] Don't answer from cache RRsets from wildcards, as we
+ don't have NSECs.
+
+---
+ src/dnssec.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/dnssec.c b/src/dnssec.c
+index afb3dca38cb1..d39ab85ed966 100644
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -1818,11 +1818,14 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
+ struct blockdata *key;
+ struct crec *crecp;
+ char *wildname;
++ int have_wildcard = 0;
+
+ rc = validate_rrset(now, header, plen, class1, type1, name, keyname, &wildname, NULL, 0, 0, 0);
+
+ if (rc == STAT_SECURE_WILDCARD)
+ {
++ have_wildcard = 1;
++
+ /* An attacker replay a wildcard answer with a different
+ answer and overlay a genuine RR. To prove this
+ hasn't happened, the answer must prove that
+@@ -1913,7 +1916,11 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
+ p2 += 13; /* labels, orig_ttl, expiration, inception */
+ GETSHORT(keytag, p2);
+
+- if ((key = blockdata_alloc((char*)psave, rdlen2)))
++ /* We don't cache sigs for wildcard answers, because to reproduce the
++ answer from the cache will require one or more NSEC/NSEC3 records
++ which we don't cache. The lack of the RRSIG ensures that a query for
++ this RRset asking for a secure answer will always be forwarded. */
++ if (!have_wildcard && (key = blockdata_alloc((char*)psave, rdlen2)))
+ {
+ if (!(crecp = cache_insert(name, &a, now, ttl, F_FORWARD | F_DNSKEY | F_DS)))
+ blockdata_free(key);
+--
+2.1.0
+
--- /dev/null
+From ae4624bf46b5e37ff1a9a2ba3c927e0dede95adb Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 12 Jan 2015 23:22:08 +0000
+Subject: [PATCH 31/55] Logs for DS records consistent.
+
+---
+ src/rfc1035.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index 75c4266b47dd..262274fc5b80 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1643,7 +1643,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
+ {
+ if (crecp->flags & F_NXDOMAIN)
+ nxdomain = 1;
+- log_query(F_UPSTREAM, name, NULL, "secure no DS");
++ log_query(F_UPSTREAM, name, NULL, "no DS");
+ }
+ else if ((keydata = blockdata_retrieve(crecp->addr.ds.keydata, crecp->addr.ds.keylen, NULL)))
+ {
+--
+2.1.0
+
--- /dev/null
+From 393415597c8b5b09558b789ab9ac238dbe3db65d Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sun, 18 Jan 2015 22:11:10 +0000
+Subject: [PATCH 32/55] Cope with multiple interfaces with the same LL address.
+
+---
+ CHANGELOG | 4 ++++
+ src/auth.c | 5 ++++-
+ src/util.c | 1 +
+ 3 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 23fc6d0530cf..bbd7e6619689 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -49,6 +49,10 @@ version 2.73
+ sometimes reasons to do it. (Step forward, GFW).
+ To avoid misuse, there's a hard limit on the TTL
+ floor of one hour. Thansk to RinSatsuki for the patch.
++
++ Cope with multiple interfaces with the same link-local
++ address. (IPv6 addresses are scoped, so this is allowed.)
++ Thanks to Cory Benfield for help with this.
+
+
+ version 2.72
+diff --git a/src/auth.c b/src/auth.c
+index a327f16d8c0b..59e05d3da38e 100644
+--- a/src/auth.c
++++ b/src/auth.c
+@@ -413,7 +413,10 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
+ peer_addr->in.sin_port = 0;
+ #ifdef HAVE_IPV6
+ else
+- peer_addr->in6.sin6_port = 0;
++ {
++ peer_addr->in6.sin6_port = 0;
++ peer_addr->in6.sin6_scope_id = 0;
++ }
+ #endif
+
+ for (peers = daemon->auth_peers; peers; peers = peers->next)
+diff --git a/src/util.c b/src/util.c
+index a729f339e219..d532444da207 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -274,6 +274,7 @@ int sockaddr_isequal(union mysockaddr *s1, union mysockaddr *s2)
+ #ifdef HAVE_IPV6
+ if (s1->sa.sa_family == AF_INET6 &&
+ s1->in6.sin6_port == s2->in6.sin6_port &&
++ s1->in6.sin6_scope_id == s2->in6.sin6_scope_id &&
+ IN6_ARE_ADDR_EQUAL(&s1->in6.sin6_addr, &s2->in6.sin6_addr))
+ return 1;
+ #endif
+--
+2.1.0
+
--- /dev/null
+From 2ae195f5a71f7c5a75717845de1bd72fc7dd67f3 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sun, 18 Jan 2015 22:20:48 +0000
+Subject: [PATCH 33/55] Don't treat SERVFAIL as a recoverable error.....
+
+---
+ src/forward.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/forward.c b/src/forward.c
+index 713a64c0fa58..b17bc34f865f 100644
+--- a/src/forward.c
++++ b/src/forward.c
+@@ -737,7 +737,7 @@ void reply_query(int fd, int family, time_t now)
+ check_for_ignored_address(header, n, daemon->ignore_addr))
+ return;
+
+- if ((RCODE(header) == SERVFAIL || RCODE(header) == REFUSED) &&
++ if (RCODE(header) == REFUSED &&
+ !option_bool(OPT_ORDER) &&
+ forward->forwardall == 0)
+ /* for broken servers, attempt to send to another one. */
+--
+2.1.0
+
--- /dev/null
+From 5f4dc5c6ca50655ab14f572c7e30815ed74cd51a Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Tue, 20 Jan 2015 20:51:02 +0000
+Subject: [PATCH 34/55] Add --dhcp-hostsdir config option.
+
+---
+ CHANGELOG | 5 +++
+ man/dnsmasq.8 | 9 +++++
+ src/dnsmasq.c | 28 ++++++++++----
+ src/dnsmasq.h | 15 ++++++--
+ src/inotify.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ src/option.c | 22 +++++++++--
+ 6 files changed, 177 insertions(+), 21 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index bbd7e6619689..0076b557e95e 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -53,6 +53,11 @@ version 2.73
+ Cope with multiple interfaces with the same link-local
+ address. (IPv6 addresses are scoped, so this is allowed.)
+ Thanks to Cory Benfield for help with this.
++
++ Add --dhcp-hostsdir. This allows addition of new host
++ configurations to a running dnsmasq instance much more
++ cheaply than having dnsmasq re-read all its existing
++ configuration each time.
+
+
+ version 2.72
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 5cfa355dea4a..005b5cca8d1f 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -977,6 +977,15 @@ is given, then read all the files contained in that directory. The advantage of
+ using this option is the same as for --dhcp-hostsfile: the
+ dhcp-optsfile will be re-read when dnsmasq receives SIGHUP. Note that
+ it is possible to encode the information in a
++.TP
++.B --dhcp-hostsdir=<path>
++This is exactly equivalent to dhcp-hostfile, except for the following. The path MUST be a
++directory, and not an individual file. Changed or new files within
++the directory are read automatically, without the need to send SIGHUP.
++If a file is deleted for changed after it has been read by dnsmasq, then the
++host record it contained will remain until dnsmasq recieves a SIGHUP, or
++is restarted; ie host records are only added dynamically.
++.TP
+ .B --dhcp-boot
+ flag as DHCP options, using the options names bootfile-name,
+ server-ip-address and tftp-server. This allows these to be included
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index c0c0589d4ce1..04cc98278f62 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -142,6 +142,9 @@ int main (int argc, char **argv)
+ set_option_bool(OPT_NOWILD);
+ reset_option_bool(OPT_CLEVERBIND);
+ }
++
++ if (daemon->inotify_hosts)
++ die(_("dhcp-hostsdir not supported on this platform"), NULL, EC_BADCONF);
+ #endif
+
+ if (option_bool(OPT_DNSSEC_VALID))
+@@ -316,13 +319,16 @@ int main (int argc, char **argv)
+ #ifdef HAVE_DNSSEC
+ blockdata_init();
+ #endif
++ }
+
+ #ifdef HAVE_LINUX_NETWORK
+- if (!option_bool(OPT_NO_POLL))
+- inotify_dnsmasq_init();
++ if ((!option_bool(OPT_NO_POLL) && daemon->port != 0) ||
++ daemon->dhcp || daemon->doing_dhcp6)
++ inotify_dnsmasq_init();
++ else
++ daemon->inotifyfd = -1;
+ #endif
+- }
+-
++
+ if (option_bool(OPT_DBUS))
+ #ifdef HAVE_DBUS
+ {
+@@ -745,7 +751,7 @@ int main (int argc, char **argv)
+ #endif
+
+ #ifdef HAVE_TFTP
+- if (option_bool(OPT_TFTP))
++ if (option_bool(OPT_TFTP))
+ {
+ #ifdef FD_SETSIZE
+ if (FD_SETSIZE < (unsigned)max_fd)
+@@ -870,7 +876,7 @@ int main (int argc, char **argv)
+ #if defined(HAVE_LINUX_NETWORK)
+ FD_SET(daemon->netlinkfd, &rset);
+ bump_maxfd(daemon->netlinkfd, &maxfd);
+- if (daemon->port != 0 && !option_bool(OPT_NO_POLL))
++ if (daemon->inotifyfd != -1)
+ {
+ FD_SET(daemon->inotifyfd, &rset);
+ bump_maxfd(daemon->inotifyfd, &maxfd);
+@@ -943,8 +949,11 @@ int main (int argc, char **argv)
+ #endif
+
+ #ifdef HAVE_LINUX_NETWORK
+- if (daemon->port != 0 && !option_bool(OPT_NO_POLL) && FD_ISSET(daemon->inotifyfd, &rset) && inotify_check())
+- poll_resolv(1, 1, now);
++ if (daemon->inotifyfd != -1 && FD_ISSET(daemon->inotifyfd, &rset) && inotify_check(now))
++ {
++ if (daemon->port != 0 && !option_bool(OPT_NO_POLL))
++ poll_resolv(1, 1, now);
++ }
+ #else
+ /* Check for changes to resolv files once per second max. */
+ /* Don't go silent for long periods if the clock goes backwards. */
+@@ -1385,6 +1394,9 @@ void clear_cache_and_reload(time_t now)
+ if (option_bool(OPT_ETHERS))
+ dhcp_read_ethers();
+ reread_dhcp();
++#ifdef HAVE_LINUX_NETWORK
++ set_dhcp_inotify();
++#endif
+ dhcp_update_configs(daemon->dhcp_conf);
+ lease_update_from_configs();
+ lease_update_file(now);
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index f8275e3ac479..d841fdc064ad 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -550,13 +550,17 @@ struct resolvc {
+ #endif
+ };
+
+-/* adn-hosts parms from command-line (also dhcp-hostsfile and dhcp-optsfile */
++/* adn-hosts parms from command-line (also dhcp-hostsfile and dhcp-optsfile and dhcp-hostsdir*/
+ #define AH_DIR 1
+ #define AH_INACTIVE 2
++#define AH_WD_DONE 4
+ struct hostsfile {
+ struct hostsfile *next;
+ int flags;
+ char *fname;
++#ifdef HAVE_LINUX_NETWORK
++ int wd; /* inotify watch descriptor */
++#endif
+ unsigned int index; /* matches to cache entries for logging */
+ };
+
+@@ -961,7 +965,7 @@ extern struct daemon {
+ int doing_ra, doing_dhcp6;
+ struct dhcp_netid_list *dhcp_ignore, *dhcp_ignore_names, *dhcp_gen_names;
+ struct dhcp_netid_list *force_broadcast, *bootp_dynamic;
+- struct hostsfile *dhcp_hosts_file, *dhcp_opts_file;
++ struct hostsfile *dhcp_hosts_file, *dhcp_opts_file, *inotify_hosts;
+ int dhcp_max, tftp_max;
+ int dhcp_server_port, dhcp_client_port;
+ int start_tftp_port, end_tftp_port;
+@@ -1197,7 +1201,7 @@ void reset_option_bool(unsigned int opt);
+ struct hostsfile *expand_filelist(struct hostsfile *list);
+ char *parse_server(char *arg, union mysockaddr *addr,
+ union mysockaddr *source_addr, char *interface, int *flags);
+-
++int option_read_hostsfile(char *file);
+ /* forward.c */
+ void reply_query(int fd, int family, time_t now);
+ void receive_query(struct listener *listen, time_t now);
+@@ -1486,5 +1490,8 @@ int detect_loop(char *query, int type);
+ /* inotify.c */
+ #ifdef HAVE_LINUX_NETWORK
+ void inotify_dnsmasq_init();
+-int inotify_check(void);
++int inotify_check(time_t now);
++# ifdef HAVE_DHCP
++void set_dhcp_inotify(void);
++# endif
+ #endif
+diff --git a/src/inotify.c b/src/inotify.c
+index 83730008c11b..52a30d7f44db 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -19,6 +19,11 @@
+
+ #include <sys/inotify.h>
+
++#ifdef HAVE_DHCP
++static void check_for_dhcp_inotify(struct inotify_event *in, time_t now);
++#endif
++
++
+ /* the strategy is to set a inotify on the directories containing
+ resolv files, for any files in the directory which are close-write
+ or moved into the directory.
+@@ -40,8 +45,6 @@ void inotify_dnsmasq_init()
+ struct resolvc *res;
+
+ inotify_buffer = safe_malloc(INOTIFY_SZ);
+-
+-
+ daemon->inotifyfd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
+
+ if (daemon->inotifyfd == -1)
+@@ -66,6 +69,7 @@ void inotify_dnsmasq_init()
+ {
+ *d = 0; /* make path just directory */
+ res->wd = inotify_add_watch(daemon->inotifyfd, path, IN_CLOSE_WRITE | IN_MOVED_TO);
++
+ res->file = d+1; /* pointer to filename */
+ *d = '/';
+
+@@ -78,7 +82,7 @@ void inotify_dnsmasq_init()
+ }
+ }
+
+-int inotify_check(void)
++int inotify_check(time_t now)
+ {
+ int hit = 0;
+
+@@ -101,13 +105,116 @@ int inotify_check(void)
+ for (res = daemon->resolv_files; res; res = res->next)
+ if (res->wd == in->wd && in->len != 0 && strcmp(res->file, in->name) == 0)
+ hit = 1;
++
++#ifdef HAVE_DHCP
++ if (daemon->dhcp || daemon->doing_dhcp6)
++ check_for_dhcp_inotify(in, now);
++#endif
+ }
+ }
+-
+ return hit;
+ }
+
+-#endif
++#ifdef HAVE_DHCP
++/* initialisation for dhcp-hostdir. Set inotify watch for each directory, and read pre-existing files */
++void set_dhcp_inotify(void)
++{
++ struct hostsfile *ah;
+
+-
++ for (ah = daemon->inotify_hosts; ah; ah = ah->next)
++ {
++ DIR *dir_stream = NULL;
++ struct dirent *ent;
++ struct stat buf;
++
++ if (stat(ah->fname, &buf) == -1 || !(S_ISDIR(buf.st_mode)))
++ {
++ my_syslog(LOG_ERR, _("bad directory in dhcp-hostsdir %s"), ah->fname);
++ continue;
++ }
++
++ if (!(ah->flags & AH_WD_DONE))
++ {
++ ah->wd = inotify_add_watch(daemon->inotifyfd, ah->fname, IN_CLOSE_WRITE | IN_MOVED_TO);
++ ah->flags |= AH_WD_DONE;
++ }
++ /* Read contents of dir _after_ calling add_watch, in the ho[e of avoiding
++ a race which misses files being added as we start */
++ if (ah->wd == -1 || !(dir_stream = opendir(ah->fname)))
++ {
++ my_syslog(LOG_ERR, _("failed to create inotify for %s"), ah->fname);
++ continue;
++ }
++
++ while ((ent = readdir(dir_stream)))
++ {
++ size_t lendir = strlen(ah->fname);
++ size_t lenfile = strlen(ent->d_name);
++ char *path;
++
++ /* ignore emacs backups and dotfiles */
++ if (lenfile == 0 ||
++ ent->d_name[lenfile - 1] == '~' ||
++ (ent->d_name[0] == '#' && ent->d_name[lenfile - 1] == '#') ||
++ ent->d_name[0] == '.')
++ continue;
++
++ if ((path = whine_malloc(lendir + lenfile + 2)))
++ {
++ strcpy(path, ah->fname);
++ strcat(path, "/");
++ strcat(path, ent->d_name);
++
++ /* ignore non-regular files */
++ if (stat(path, &buf) != -1 && S_ISREG(buf.st_mode))
++ option_read_hostsfile(path);
++
++ free(path);
++ }
++ }
++ }
++}
++
++static void check_for_dhcp_inotify(struct inotify_event *in, time_t now)
++{
++ struct hostsfile *ah;
++
++ /* ignore emacs backups and dotfiles */
++ if (in->len == 0 ||
++ in->name[in->len - 1] == '~' ||
++ (in->name[0] == '#' && in->name[in->len - 1] == '#') ||
++ in->name[0] == '.')
++ return;
++
++ for (ah = daemon->inotify_hosts; ah; ah = ah->next)
++ if (ah->wd == in->wd)
++ {
++ size_t lendir = strlen(ah->fname);
++ char *path;
++
++ if ((path = whine_malloc(lendir + in->len + 2)))
++ {
++ strcpy(path, ah->fname);
++ strcat(path, "/");
++ strcat(path, in->name);
++
++ if (option_read_hostsfile(path))
++ {
++ /* Propogate the consequences of loading a new dhcp-host */
++ dhcp_update_configs(daemon->dhcp_conf);
++ lease_update_from_configs();
++ lease_update_file(now);
++ lease_update_dns(1);
++ }
++
++ free(path);
++ }
++
++ return;
++ }
++}
++
++#endif /* DHCP */
++
++#endif /* LINUX_NETWORK */
+
+diff --git a/src/option.c b/src/option.c
+index 8b994098cc9f..22e11c37d374 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -149,7 +149,7 @@ struct myoption {
+ #define LOPT_LOOP_DETECT 337
+ #define LOPT_IGNORE_ADDR 338
+ #define LOPT_MINCTTL 339
+-
++#define LOPT_DHCP_INOTIFY 340
+
+ #ifdef HAVE_GETOPT_LONG
+ static const struct option opts[] =
+@@ -248,6 +248,7 @@ static const struct myoption opts[] =
+ { "interface-name", 1, 0, LOPT_INTNAME },
+ { "dhcp-hostsfile", 1, 0, LOPT_DHCP_HOST },
+ { "dhcp-optsfile", 1, 0, LOPT_DHCP_OPTS },
++ { "dhcp-hostsdir", 1, 0, LOPT_DHCP_INOTIFY },
+ { "dhcp-no-override", 0, 0, LOPT_OVERRIDE },
+ { "tftp-port-range", 1, 0, LOPT_TFTPPORTS },
+ { "stop-dns-rebind", 0, 0, LOPT_REBIND },
+@@ -336,6 +337,7 @@ static struct {
+ { 'G', ARG_DUP, "<hostspec>", gettext_noop("Set address or hostname for a specified machine."), NULL },
+ { LOPT_DHCP_HOST, ARG_DUP, "<path>", gettext_noop("Read DHCP host specs from file."), NULL },
+ { LOPT_DHCP_OPTS, ARG_DUP, "<path>", gettext_noop("Read DHCP option specs from file."), NULL },
++ { LOPT_DHCP_INOTIFY, ARG_DUP, "<path>", gettext_noop("Read DHCP host specs from a directory."), NULL },
+ { LOPT_TAG_IF, ARG_DUP, "tag-expression", gettext_noop("Evaluate conditional tag expression."), NULL },
+ { 'h', OPT_NO_HOSTS, NULL, gettext_noop("Do NOT load %s file."), HOSTSFILE },
+ { 'H', ARG_DUP, "<path>", gettext_noop("Specify a hosts file to be read in addition to %s."), HOSTSFILE },
+@@ -1710,8 +1712,9 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ break;
+ #endif /* HAVE_DHCP */
+
+- case LOPT_DHCP_HOST: /* --dhcp-hostfile */
++ case LOPT_DHCP_HOST: /* --dhcp-hostsfile */
+ case LOPT_DHCP_OPTS: /* --dhcp-optsfile */
++ case LOPT_DHCP_INOTIFY: /* dhcp-hostsdir */
+ case 'H': /* --addn-hosts */
+ {
+ struct hostsfile *new = opt_malloc(sizeof(struct hostsfile));
+@@ -1734,6 +1737,12 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ new->next = daemon->dhcp_opts_file;
+ daemon->dhcp_opts_file = new;
+ }
++ else if (option == LOPT_DHCP_INOTIFY)
++ {
++ new->next = daemon->inotify_hosts;
++ daemon->inotify_hosts = new;
++ }
++
+ break;
+ }
+
+@@ -4042,6 +4051,13 @@ static void read_file(char *file, FILE *f, int hard_opt)
+ fclose(f);
+ }
+
++#ifdef HAVE_DHCP
++int option_read_hostsfile(char *file)
++{
++ return one_file(file, LOPT_BANK);
++}
++#endif
++
+ static int one_file(char *file, int hard_opt)
+ {
+ FILE *f;
+@@ -4139,7 +4155,7 @@ struct hostsfile *expand_filelist(struct hostsfile *list)
+
+ /* don't read this as a file */
+ ah->flags |= AH_INACTIVE;
+-
++
+ if (!(dir_stream = opendir(ah->fname)))
+ my_syslog(LOG_ERR, _("cannot access directory %s: %s"),
+ ah->fname, strerror(errno));
+--
+2.1.0
+
--- /dev/null
+From fbf01f7046e75f9aa73fd4aab2a94e43386d9052 Mon Sep 17 00:00:00 2001
+From: Conrad Kostecki <ck@conrad-kostecki.de>
+Date: Tue, 20 Jan 2015 21:07:56 +0000
+Subject: [PATCH 35/55] Update German translation.
+
+---
+ po/de.po | 101 +++++++++++++++++++++++++++++----------------------------------
+ 1 file changed, 47 insertions(+), 54 deletions(-)
+
+diff --git a/po/de.po b/po/de.po
+index e2317376d8a9..4c93c5b28ef2 100644
+--- a/po/de.po
++++ b/po/de.po
+@@ -9,10 +9,10 @@
+ # Simon Kelley <simon@thekelleys.org.uk>, 2005.
+ msgid ""
+ msgstr ""
+-"Project-Id-Version: dnsmasq 2.70\n"
++"Project-Id-Version: dnsmasq 2.73\n"
+ "Report-Msgid-Bugs-To: \n"
+ "POT-Creation-Date: 2009-06-18 12:24+0100\n"
+-"PO-Revision-Date: 2014-05-01 22:51+0100\n"
++"PO-Revision-Date: 2015-01-19 15:43+0100\n"
+ "Last-Translator: Conrad Kostecki <ck@conrad-kostecki.de>\n"
+ "Language-Team: German <de@li.org>\n"
+ "Language: de\n"
+@@ -20,12 +20,12 @@ msgstr ""
+ "Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8bit\n"
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
+-"X-Generator: Poedit 1.6.5\n"
++"X-Generator: Poedit 1.7.3\n"
+ "X-Poedit-SourceCharset: UTF-8\n"
+
+ #: cache.c:505
+ msgid "Internal error in cache."
+-msgstr ""
++msgstr "Interner Fehler im Cache."
+
+ #: cache.c:908
+ #, c-format
+@@ -126,7 +126,7 @@ msgstr "Lokale abzuhörende Adresse(n) angeben."
+
+ #: option.c:319
+ msgid "Return ipaddr for all hosts in specified domains."
+-msgstr "IP-Adresse für alle Hosts in angebenen Domänen festlegen."
++msgstr "IP-Adresse für alle Hosts in angegebenen Domänen festlegen."
+
+ # FIXME: the English test is not to the point. Just use a shortened description
+ # from the manpage instead. -- MA
+@@ -310,18 +310,16 @@ msgid "Specify path to resolv.conf (defaults to %s)."
+ msgstr "Pfad zu resolv.conf festlegen (%s voreingestellt)."
+
+ #: option.c:362
+-#, fuzzy
+ msgid "Specify path to file with server= options"
+-msgstr "Dateipfad für Prozesskennung (PID) festlegen (Voreinstellung: %s)."
++msgstr " Dateipfad mit der Option server= angeben"
+
+ #: option.c:363
+ msgid "Specify address(es) of upstream servers with optional domains."
+ msgstr "Adresse(n) vorgelagerter Server festlegen, optional mit Domänen."
+
+ #: option.c:364
+-#, fuzzy
+ msgid "Specify address of upstream servers for reverse address queries"
+-msgstr "Adresse(n) vorgelagerter Server festlegen, optional mit Domänen."
++msgstr "Adresse(n) vorgelagerter Server festlegen, für reverse Adressanfragen"
+
+ #: option.c:365
+ msgid "Never forward queries to specified domains."
+@@ -657,23 +655,23 @@ msgstr "Spezifiziere eine Domain und Adressbereich für synthetisierte Namen"
+
+ #: option.c:446
+ msgid "Activate DNSSEC validation"
+-msgstr ""
++msgstr "Aktiviere DNSSEC-Validierung"
+
+ #: option.c:447
+ msgid "Specify trust anchor key digest."
+-msgstr ""
++msgstr "Spezifiziere Vertrauensursprung (Trust Anchor) der Schlüssel-Prüfdaten (Key Digest)."
+
+ #: option.c:448
+ msgid "Disable upstream checking for DNSSEC debugging."
+-msgstr ""
++msgstr "Deaktiviere die Überprüfung vorgelagerter Server für DNSSEC-Debugging"
+
+ #: option.c:449
+ msgid "Ensure answers without DNSSEC are in unsigned zones."
+-msgstr ""
++msgstr "Stellt sicher, dass Antworten ohne DNSSEC sich in einer unsignierten Zone befinden."
+
+ #: option.c:450
+ msgid "Don't check DNSSEC signature timestamps until first cache-reload"
+-msgstr ""
++msgstr "DNSSEC Signatur-Zeitstempel nicht prüfen, bis erstmalig der Cache neugeladen wird"
+
+ #: option.c:452
+ msgid "Specify DHCPv6 prefix class"
+@@ -697,11 +695,11 @@ msgstr "RA nicht protokollieren."
+
+ #: option.c:458
+ msgid "Accept queries only from directly-connected networks"
+-msgstr ""
++msgstr "Akzeptiere nur Anfragen von direkt verbundenen Netzwerken"
+
+ #: option.c:459
+ msgid "Detect and remove DNS forwarding loops"
+-msgstr ""
++msgstr "Erkennen und Entfernen von DNS-Weiterleitungsschleifen"
+
+ #: option.c:661
+ #, c-format
+@@ -958,18 +956,16 @@ msgid "Bad name in host-record"
+ msgstr "Unzulässiger Name in host-record"
+
+ #: option.c:3826
+-#, fuzzy
+ msgid "bad trust anchor"
+-msgstr "unzulässiger Portbereich"
++msgstr "unzulässiger Vertrauensursprung (Trust Anchor)"
+
+ #: option.c:3840
+ msgid "bad HEX in trust anchor"
+-msgstr ""
++msgstr "unzulässiger Hexwert in Vertrauensursprung (Trust Anchor)"
+
+ #: option.c:3850
+-#, fuzzy
+ msgid "unsupported option (check that dnsmasq was compiled with DHCP/TFTP/DNSSEC/DBus support)"
+-msgstr "unzulässige Option (prüfen Sie, ob dnsmasq mit DHCP/TFTP/DBus-Unterstützt übersetzt wurde)"
++msgstr "Nicht unterstützte Option (prüfen Sie, ob DNSMasq mit DHCP/TFTP/DNSSEC/DBus-Unterstützung übersetzt wurde)"
+
+ #: option.c:3909
+ msgid "missing \""
+@@ -988,7 +984,6 @@ msgid "missing parameter"
+ msgstr "fehler Parameter"
+
+ #: option.c:3972
+-#, fuzzy
+ msgid "illegal option"
+ msgstr "unzulässige Option"
+
+@@ -1110,7 +1105,7 @@ msgstr "möglichen DNS-Rebind-Angriff entdeckt: %s"
+
+ #: forward.c:1132 forward.c:1663
+ msgid "Ignoring query from non-local network"
+-msgstr ""
++msgstr "Ignoriere Anfragen vom nicht lokalen Netzwerk"
+
+ #: forward.c:2101
+ #, c-format
+@@ -1189,9 +1184,9 @@ msgid "using nameserver %s#%d for %s %s"
+ msgstr "Benutze Namensserver %s#%d für %s %s"
+
+ #: network.c:1483
+-#, fuzzy, c-format
++#, c-format
+ msgid "NOT using nameserver %s#%d - query loop detected"
+-msgstr "Benutze Namensserver %s#%d für %s %s"
++msgstr "Benutze Namensserver %s#%d NICHT - Anfragenschleife festgetellt"
+
+ #: network.c:1486
+ #, c-format
+@@ -1205,16 +1200,15 @@ msgstr "Benutze Namensserver %s#%d"
+
+ #: dnsmasq.c:154
+ msgid "No trust anchors provided for DNSSEC"
+-msgstr ""
++msgstr "Keine Vertrauensursprünge (Trust Anchor) für DNSSEC verfügbar"
+
+ #: dnsmasq.c:157
+ msgid "Cannot reduce cache size from default when DNSSEC enabled"
+-msgstr ""
++msgstr "Kann die Standard Cachegröße nicht verkleinern, wenn DNSSEC aktiviert ist"
+
+ #: dnsmasq.c:159
+-#, fuzzy
+ msgid "DNSSEC not available: set HAVE_DNSSEC in src/config.h"
+-msgstr "DBus nicht verfügbar: setzen Sie HAVE_DBUS in src/config.h"
++msgstr "DNSSEC nicht verfügbar: setzen Sie HAVE_DNSSEC in src/config.h"
+
+ #: dnsmasq.c:165
+ msgid "TFTP server not available: set HAVE_TFTP in src/config.h"
+@@ -1241,9 +1235,8 @@ msgid "authoritative DNS not available: set HAVE_AUTH in src/config.h"
+ msgstr "Authoritatives DNS nicht verfügbar: Es muss HAVE_AUTH in src/config.h gesetzt sein"
+
+ #: dnsmasq.c:193
+-#, fuzzy
+ msgid "Loop detection not available: set HAVE_LOOP in src/config.h"
+-msgstr "TFTP-Server nicht verfügbar, setzen Sie HAVE_TFTP in src/config.h"
++msgstr "Loop-Erkennung nicht verfügbar, setzen Sie HAVE_LOOP in src/config.h"
+
+ #: dnsmasq.c:201
+ msgid "zone serial must be configured in --auth-soa"
+@@ -1317,15 +1310,15 @@ msgstr "DBus-Unterstützung eingeschaltet: warte auf Systembus-Verbindung"
+
+ #: dnsmasq.c:672
+ msgid "DNS service limited to local subnets"
+-msgstr ""
++msgstr "DNS-Dienst auf lokale Subnetze eingeschränkt"
+
+ #: dnsmasq.c:677
+ msgid "DNSSEC validation enabled"
+-msgstr ""
++msgstr "DNSSEC-Validierung aktiviert"
+
+ #: dnsmasq.c:679
+ msgid "DNSSEC signature timestamps not checked until first cache reload"
+-msgstr ""
++msgstr "DNSSEC Signatur-Zeitstempel werden erst ab dem ersten Neuladen des Caches überprüft"
+
+ #: dnsmasq.c:684
+ #, c-format
+@@ -1366,7 +1359,7 @@ msgstr "DHCP, Sockets exklusiv an das Interface %s gebunden"
+ # FIXME: this and the next few must be full strings to be translatable - do not assemble in code"
+ #: dnsmasq.c:753
+ msgid "root is "
+-msgstr "Wurzel ist"
++msgstr "Wurzel ist "
+
+ #: dnsmasq.c:753
+ msgid "enabled"
+@@ -1432,7 +1425,7 @@ msgstr "Das TFTP-Verzeichnis %s ist nicht zugreifbar: %s"
+
+ #: dnsmasq.c:1151
+ msgid "now checking DNSSEC signature timestamps"
+-msgstr ""
++msgstr "Prüfe jetzt DNSSEC Signatur-Zeitstempel"
+
+ #: dnsmasq.c:1218
+ #, c-format
+@@ -1506,7 +1499,7 @@ msgstr "DHCP-Paket ohne Adresse an Schnittstelle %s empfangen"
+ #: dhcp.c:408
+ #, c-format
+ msgid "ARP-cache injection failed: %s"
+-msgstr ""
++msgstr "APR-Cache Injektion fehlgeschlagen: %s"
+
+ #: dhcp.c:506
+ #, c-format
+@@ -1763,13 +1756,13 @@ msgid "DHCP request for unsupported hardware type (%d) received on %s"
+ msgstr "DHCP-Anfrage für nicht unterstützen Hardwaretyp (%d) auf %s empfangen"
+
+ #: bpf.c:376
+-#, fuzzy, c-format
++#, c-format
+ msgid "cannot create PF_ROUTE socket: %s"
+-msgstr "kann DHCP-Socket nicht erzeugen: %s"
++msgstr "Kann PF_ROUTE socket nicht erzeugen: %s"
+
+ #: bpf.c:397
+ msgid "Unknown protocol version from route socket"
+-msgstr ""
++msgstr "Unbekannte Protokollversion vom Route Socket"
+
+ #: helper.c:153
+ msgid "lease() function missing in Lua script"
+@@ -2020,50 +2013,50 @@ msgstr "konnte IPset-Kontroll-Socket nicht erzeugen: %s"
+ #: blockdata.c:58
+ #, c-format
+ msgid "DNSSEC memory in use %u, max %u, allocated %u"
+-msgstr ""
++msgstr "DNSSEC Speicher in Benutzung %u, Max %u, zugewiesen %u"
+
+ #: tables.c:76
+ msgid "error: fill_addr missused"
+-msgstr ""
++msgstr "Fehler: fill_addr falsch verwendet"
+
+ #: tables.c:105
+-#, fuzzy, c-format
++#, c-format
+ msgid "failed to access pf devices: %s"
+-msgstr "konnte auf %s nicht zugreifen: %s"
++msgstr "konnte auf pf Geräte nicht zugreifen: %s"
+
+ #: tables.c:119
+-#, fuzzy, c-format
++#, c-format
+ msgid "warning: no opened pf devices %s"
+-msgstr "Warnung: Keine Adresse für die Schnittstelle %s gefunden"
++msgstr "Warnung: Keine geöffneten pf Geräte %s"
+
+ #: tables.c:127
+-#, fuzzy, c-format
++#, c-format
+ msgid "error: cannot use table name %s"
+-msgstr "kann Hostnamen nicht ermitteln: %s"
++msgstr "Fehler: Kann Tabellenname %s nicht benutzen"
+
+ #: tables.c:135
+ #, c-format
+ msgid "error: cannot strlcpy table name %s"
+-msgstr ""
++msgstr "Fehler: Kann den Tabellennamen %s nicht strlcpy"
+
+ #: tables.c:141
+ #, c-format
+ msgid "warning: pfr_add_tables: %s(%d)"
+-msgstr ""
++msgstr "Warnung: pfr_add_tables: %s(%d)"
+
+ #: tables.c:147
+ msgid "info: table created"
+-msgstr ""
++msgstr "Info: Tabelle erstellt"
+
+ #: tables.c:158
+ #, c-format
+ msgid "warning: DIOCR%sADDRS: %s"
+-msgstr ""
++msgstr "Warnung: DIOCR%sADDRS: %s"
+
+ #: tables.c:162
+-#, fuzzy, c-format
++#, c-format
+ msgid "%d addresses %s"
+-msgstr "Fehlerhafte Adresse"
++msgstr "%d Adressen %s"
+
+ #~ msgid "no interface with address %s"
+ #~ msgstr "keine Schnittstelle mit Adresse %s"
+--
+2.1.0
+
--- /dev/null
+From 61b838dd574c51d96fef100285a0d225824534f9 Mon Sep 17 00:00:00 2001
+From: Win King Wan <pinwing+dnsmasq@gmail.com>
+Date: Wed, 21 Jan 2015 20:41:48 +0000
+Subject: [PATCH 36/55] Don't reply to DHCPv6 SOLICIT messages when not
+ configured for statefull DHCPv6.
+
+---
+ CHANGELOG | 4 ++++
+ src/rfc3315.c | 13 +++++++++++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 0076b557e95e..a4cb901e83ae 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -59,6 +59,10 @@ version 2.73
+ cheaply than having dnsmasq re-read all its existing
+ configuration each time.
+
++ Don't reply to DHCPv6 SOLICIT messages if we're not
++ configured to do stateful DHCPv6. Thanks to Win King Wan
++ for the patch.
++
+
+ version 2.72
+ Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
+diff --git a/src/rfc3315.c b/src/rfc3315.c
+index ddb390bf1136..e593ec9c362c 100644
+--- a/src/rfc3315.c
++++ b/src/rfc3315.c
+@@ -824,6 +824,19 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
+ }
+ else
+ {
++ /* Windows 8 always requests an address even if the Managed bit
++ in RA is 0 and it keeps retrying if it receives a reply
++ stating that no addresses are available. We solve this
++ by not replying at all if we're not configured to give any
++ addresses by DHCPv6. RFC 3315 17.2.1. appears to allow this. */
++
++ for (c = state->context; c; c = c->current)
++ if (!(c->flags & CONTEXT_RA_STATELESS))
++ break;
++
++ if (!c)
++ return 0;
++
+ /* no address, return error */
+ o1 = new_opt6(OPTION6_STATUS_CODE);
+ put_opt6_short(DHCP6NOADDRS);
+--
+2.1.0
+
--- /dev/null
+From 0491805d2ff6e7727f0272c94fd97d9897d1e22c Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 26 Jan 2015 11:23:43 +0000
+Subject: [PATCH 37/55] Allow inotify to be disabled at compile time on Linux.
+
+---
+ CHANGELOG | 4 +++-
+ src/config.h | 13 ++++++++++++-
+ src/dnsmasq.c | 21 +++++++++++++--------
+ src/dnsmasq.h | 11 +++++++----
+ src/inotify.c | 4 ++--
+ 5 files changed, 37 insertions(+), 16 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index a4cb901e83ae..c05dec63c587 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -9,7 +9,9 @@ version 2.73
+
+ Use inotify for checking on updates to /etc/resolv.conf and
+ friends under Linux. This fixes race conditions when the files are
+- updated rapidly and saves CPU by noy polling.
++ updated rapidly and saves CPU by noy polling. To build
++ a binary that runs on old Linux kernels without inotify,
++ use make COPTS=-DNO_INOTIFY
+
+ Fix breakage of --domain=<domain>,<subnet>,local - only reverse
+ queries were intercepted. THis appears to have been broken
+diff --git a/src/config.h b/src/config.h
+index cdca231b4079..5e5009271eba 100644
+--- a/src/config.h
++++ b/src/config.h
+@@ -115,6 +115,8 @@ HAVE_DNSSEC
+ HAVE_LOOP
+ include functionality to probe for and remove DNS forwarding loops.
+
++HAVE_INOTIFY
++ use the Linux inotify facility to efficiently re-read configuration files.
+
+ NO_IPV6
+ NO_TFTP
+@@ -123,6 +125,7 @@ NO_DHCP6
+ NO_SCRIPT
+ NO_LARGEFILE
+ NO_AUTH
++NO_INOTIFY
+ these are avilable to explictly disable compile time options which would
+ otherwise be enabled automatically (HAVE_IPV6, >2Gb file sizes) or
+ which are enabled by default in the distributed source tree. Building dnsmasq
+@@ -355,6 +358,10 @@ HAVE_SOCKADDR_SA_LEN
+ #undef HAVE_LOOP
+ #endif
+
++#if defined (HAVE_LINUX_NETWORK) && !defined(NO_INOTIFY)
++#define HAVE_INOTIFY
++#endif
++
+ /* Define a string indicating which options are in use.
+ DNSMASQP_COMPILE_OPTS is only defined in dnsmasq.c */
+
+@@ -428,7 +435,11 @@ static char *compile_opts =
+ #ifndef HAVE_LOOP
+ "no-"
+ #endif
+-"loop-detect";
++"loop-detect "
++#ifndef HAVE_INOTIFY
++"no-"
++#endif
++"inotify";
+
+
+ #endif
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index 04cc98278f62..bc4f47170705 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -142,7 +142,9 @@ int main (int argc, char **argv)
+ set_option_bool(OPT_NOWILD);
+ reset_option_bool(OPT_CLEVERBIND);
+ }
++#endif
+
++#ifndef HAVE_INOTIFY
+ if (daemon->inotify_hosts)
+ die(_("dhcp-hostsdir not supported on this platform"), NULL, EC_BADCONF);
+ #endif
+@@ -321,7 +323,7 @@ int main (int argc, char **argv)
+ #endif
+ }
+
+-#ifdef HAVE_LINUX_NETWORK
++#ifdef HAVE_INOTIFY
+ if ((!option_bool(OPT_NO_POLL) && daemon->port != 0) ||
+ daemon->dhcp || daemon->doing_dhcp6)
+ inotify_dnsmasq_init();
+@@ -802,7 +804,7 @@ int main (int argc, char **argv)
+
+ pid = getpid();
+
+-#ifdef HAVE_LINUX_NETWORK
++#ifdef HAVE_INOTIFY
+ /* Using inotify, have to select a resolv file at startup */
+ poll_resolv(1, 0, now);
+ #endif
+@@ -872,15 +874,18 @@ int main (int argc, char **argv)
+ bump_maxfd(daemon->icmp6fd, &maxfd);
+ }
+ #endif
+-
+-#if defined(HAVE_LINUX_NETWORK)
+- FD_SET(daemon->netlinkfd, &rset);
+- bump_maxfd(daemon->netlinkfd, &maxfd);
++
++#ifdef HAVE_INOTIFY
+ if (daemon->inotifyfd != -1)
+ {
+ FD_SET(daemon->inotifyfd, &rset);
+ bump_maxfd(daemon->inotifyfd, &maxfd);
+ }
++#endif
++
++#if defined(HAVE_LINUX_NETWORK)
++ FD_SET(daemon->netlinkfd, &rset);
++ bump_maxfd(daemon->netlinkfd, &maxfd);
+ #elif defined(HAVE_BSD_NETWORK)
+ FD_SET(daemon->routefd, &rset);
+ bump_maxfd(daemon->routefd, &maxfd);
+@@ -948,7 +953,7 @@ int main (int argc, char **argv)
+ route_sock();
+ #endif
+
+-#ifdef HAVE_LINUX_NETWORK
++#ifdef HAVE_INOTIFY
+ if (daemon->inotifyfd != -1 && FD_ISSET(daemon->inotifyfd, &rset) && inotify_check(now))
+ {
+ if (daemon->port != 0 && !option_bool(OPT_NO_POLL))
+@@ -1394,7 +1399,7 @@ void clear_cache_and_reload(time_t now)
+ if (option_bool(OPT_ETHERS))
+ dhcp_read_ethers();
+ reread_dhcp();
+-#ifdef HAVE_LINUX_NETWORK
++#ifdef HAVE_INOTIFY
+ set_dhcp_inotify();
+ #endif
+ dhcp_update_configs(daemon->dhcp_conf);
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index d841fdc064ad..8091634f69db 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -544,7 +544,7 @@ struct resolvc {
+ int is_default, logged;
+ time_t mtime;
+ char *name;
+-#ifdef HAVE_LINUX_NETWORK
++#ifdef HAVE_INOTIFY
+ int wd; /* inotify watch descriptor */
+ char *file; /* pointer to file part if path */
+ #endif
+@@ -558,7 +558,7 @@ struct hostsfile {
+ struct hostsfile *next;
+ int flags;
+ char *fname;
+-#ifdef HAVE_LINUX_NETWORK
++#ifdef HAVE_INOTIFY
+ int wd; /* inotify watch descriptor */
+ #endif
+ unsigned int index; /* matches to cache entries for logging */
+@@ -1013,8 +1013,11 @@ extern struct daemon {
+
+ /* DHCP state */
+ int dhcpfd, helperfd, pxefd;
++#ifdef HAVE_INOTIFY
++ int inotifyfd;
++#endif
+ #if defined(HAVE_LINUX_NETWORK)
+- int netlinkfd, inotifyfd;
++ int netlinkfd;
+ #elif defined(HAVE_BSD_NETWORK)
+ int dhcp_raw_fd, dhcp_icmp_fd, routefd;
+ #endif
+@@ -1488,7 +1491,7 @@ int detect_loop(char *query, int type);
+ #endif
+
+ /* inotify.c */
+-#ifdef HAVE_LINUX_NETWORK
++#ifdef HAVE_INOTIFY
+ void inotify_dnsmasq_init();
+ int inotify_check(time_t now);
+ # ifdef HAVE_DHCP
+diff --git a/src/inotify.c b/src/inotify.c
+index 52a30d7f44db..818fe8eddda4 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -15,7 +15,7 @@
+ */
+
+ #include "dnsmasq.h"
+-#ifdef HAVE_LINUX_NETWORK
++#ifdef HAVE_INOTIFY
+
+ #include <sys/inotify.h>
+
+@@ -216,5 +216,5 @@ static void check_for_dhcp_inotify(struct inotify_event *in, time_t now)
+
+ #endif /* DHCP */
+
+-#endif /* LINUX_NETWORK */
++#endif /* INOTIFY */
+
+--
+2.1.0
+
--- /dev/null
+From 70d1873dd9e70041ed4bb88c69d5b886b7cc634c Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 31 Jan 2015 19:59:29 +0000
+Subject: [PATCH 38/55] Expand inotify code to dhcp-hostsdir, dhcp-optsdir and
+ hostsdir.
+
+---
+ src/cache.c | 81 +++++++++++++++++---------
+ src/dnsmasq.c | 9 ++-
+ src/dnsmasq.h | 14 +++--
+ src/inotify.c | 179 +++++++++++++++++++++++++++++-----------------------------
+ src/option.c | 37 +++++++++---
+ 5 files changed, 187 insertions(+), 133 deletions(-)
+
+diff --git a/src/cache.c b/src/cache.c
+index 09b6dbf8087a..abaf25ec0f18 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -835,27 +835,42 @@ static void add_hosts_entry(struct crec *cache, struct all_addr *addr, int addrl
+ Only insert each unique address once into this hashing structure.
+
+ This complexity avoids O(n^2) divergent CPU use whilst reading
+- large (10000 entry) hosts files. */
+-
+- /* hash address */
+- for (j = 0, i = 0; i < addrlen; i++)
+- j = (j*2 +((unsigned char *)addr)[i]) % hashsz;
+-
+- for (lookup = rhash[j]; lookup; lookup = lookup->next)
+- if ((lookup->flags & cache->flags & (F_IPV4 | F_IPV6)) &&
+- memcmp(&lookup->addr.addr, addr, addrlen) == 0)
+- {
+- cache->flags &= ~F_REVERSE;
+- break;
+- }
++ large (10000 entry) hosts files.
++
++ Note that we only do this process when bulk-reading hosts files,
++ for incremental reads, rhash is NULL, and we use cache lookups
++ instead.
++ */
+
+- /* maintain address hash chain, insert new unique address */
+- if (!lookup)
++ if (rhash)
+ {
+- cache->next = rhash[j];
+- rhash[j] = cache;
++ /* hash address */
++ for (j = 0, i = 0; i < addrlen; i++)
++ j = (j*2 +((unsigned char *)addr)[i]) % hashsz;
++
++ for (lookup = rhash[j]; lookup; lookup = lookup->next)
++ if ((lookup->flags & cache->flags & (F_IPV4 | F_IPV6)) &&
++ memcmp(&lookup->addr.addr, addr, addrlen) == 0)
++ {
++ cache->flags &= ~F_REVERSE;
++ break;
++ }
++
++ /* maintain address hash chain, insert new unique address */
++ if (!lookup)
++ {
++ cache->next = rhash[j];
++ rhash[j] = cache;
++ }
+ }
+-
++ else
++ {
++ /* incremental read, lookup in cache */
++ lookup = cache_find_by_addr(NULL, addr, 0, cache->flags & (F_IPV4 | F_IPV6));
++ if (lookup && lookup->flags & F_HOSTS)
++ cache->flags &= ~F_REVERSE;
++ }
++
+ cache->uid = index;
+ memcpy(&cache->addr.addr, addr, addrlen);
+ cache_hash(cache);
+@@ -912,7 +927,7 @@ static int gettok(FILE *f, char *token)
+ }
+ }
+
+-static int read_hostsfile(char *filename, unsigned int index, int cache_size, struct crec **rhash, int hashsz)
++int read_hostsfile(char *filename, unsigned int index, int cache_size, struct crec **rhash, int hashsz)
+ {
+ FILE *f = fopen(filename, "r");
+ char *token = daemon->namebuff, *domain_suffix = NULL;
+@@ -958,7 +973,7 @@ static int read_hostsfile(char *filename, unsigned int index, int cache_size, st
+ addr_count++;
+
+ /* rehash every 1000 names. */
+- if ((name_count - cache_size) > 1000)
++ if (rhash && ((name_count - cache_size) > 1000))
+ {
+ rehash(name_count);
+ cache_size = name_count;
+@@ -1005,10 +1020,13 @@ static int read_hostsfile(char *filename, unsigned int index, int cache_size, st
+ }
+
+ fclose(f);
+- rehash(name_count);
+-
+- my_syslog(LOG_INFO, _("read %s - %d addresses"), filename, addr_count);
+
++ if (rhash)
++ {
++ rehash(name_count);
++ my_syslog(LOG_INFO, _("read %s - %d addresses"), filename, addr_count);
++ }
++
+ return name_count;
+ }
+
+@@ -1118,14 +1136,19 @@ void cache_reload(void)
+ my_syslog(LOG_INFO, _("cleared cache"));
+ return;
+ }
+-
++
+ if (!option_bool(OPT_NO_HOSTS))
+ total_size = read_hostsfile(HOSTSFILE, SRC_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
+-
++
+ daemon->addn_hosts = expand_filelist(daemon->addn_hosts);
+ for (ah = daemon->addn_hosts; ah; ah = ah->next)
+ if (!(ah->flags & AH_INACTIVE))
+ total_size = read_hostsfile(ah->fname, ah->index, total_size, (struct crec **)daemon->packet, revhashsz);
++
++#ifdef HAVE_INOTIFY
++ set_dynamic_inotify(AH_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
++#endif
++
+ }
+
+ #ifdef HAVE_DHCP
+@@ -1505,7 +1528,13 @@ char *record_source(unsigned int index)
+ for (ah = daemon->addn_hosts; ah; ah = ah->next)
+ if (ah->index == index)
+ return ah->fname;
+-
++
++#ifdef HAVE_INOTIFY
++ for (ah = daemon->dynamic_dirs; ah; ah = ah->next)
++ if (ah->index == index)
++ return ah->fname;
++#endif
++
+ return "<unknown>";
+ }
+
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index bc4f47170705..2c629fe422aa 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -145,8 +145,8 @@ int main (int argc, char **argv)
+ #endif
+
+ #ifndef HAVE_INOTIFY
+- if (daemon->inotify_hosts)
+- die(_("dhcp-hostsdir not supported on this platform"), NULL, EC_BADCONF);
++ if (daemon->dynamic_dirs)
++ die(_("dhcp-hostsdir, dhcp-optsdir and hostsdir are not supported on this platform"), NULL, EC_BADCONF);
+ #endif
+
+ if (option_bool(OPT_DNSSEC_VALID))
+@@ -324,8 +324,7 @@ int main (int argc, char **argv)
+ }
+
+ #ifdef HAVE_INOTIFY
+- if ((!option_bool(OPT_NO_POLL) && daemon->port != 0) ||
+- daemon->dhcp || daemon->doing_dhcp6)
++ if (daemon->port != 0 || daemon->dhcp || daemon->doing_dhcp6)
+ inotify_dnsmasq_init();
+ else
+ daemon->inotifyfd = -1;
+@@ -1400,7 +1399,7 @@ void clear_cache_and_reload(time_t now)
+ dhcp_read_ethers();
+ reread_dhcp();
+ #ifdef HAVE_INOTIFY
+- set_dhcp_inotify();
++ set_dynamic_inotify(AH_DHCP_HST | AH_DHCP_OPT, 0, NULL, 0);
+ #endif
+ dhcp_update_configs(daemon->dhcp_conf);
+ lease_update_from_configs();
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 8091634f69db..0c322a93993e 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -554,6 +554,9 @@ struct resolvc {
+ #define AH_DIR 1
+ #define AH_INACTIVE 2
+ #define AH_WD_DONE 4
++#define AH_HOSTS 8
++#define AH_DHCP_HST 16
++#define AH_DHCP_OPT 32
+ struct hostsfile {
+ struct hostsfile *next;
+ int flags;
+@@ -965,7 +968,7 @@ extern struct daemon {
+ int doing_ra, doing_dhcp6;
+ struct dhcp_netid_list *dhcp_ignore, *dhcp_ignore_names, *dhcp_gen_names;
+ struct dhcp_netid_list *force_broadcast, *bootp_dynamic;
+- struct hostsfile *dhcp_hosts_file, *dhcp_opts_file, *inotify_hosts;
++ struct hostsfile *dhcp_hosts_file, *dhcp_opts_file, *dynamic_dirs;
+ int dhcp_max, tftp_max;
+ int dhcp_server_port, dhcp_client_port;
+ int start_tftp_port, end_tftp_port;
+@@ -1071,6 +1074,8 @@ int cache_make_stat(struct txt_record *t);
+ char *cache_get_name(struct crec *crecp);
+ char *cache_get_cname_target(struct crec *crecp);
+ struct crec *cache_enumerate(int init);
++int read_hostsfile(char *filename, unsigned int index, int cache_size,
++ struct crec **rhash, int hashsz);
+
+ /* blockdata.c */
+ #ifdef HAVE_DNSSEC
+@@ -1204,7 +1209,8 @@ void reset_option_bool(unsigned int opt);
+ struct hostsfile *expand_filelist(struct hostsfile *list);
+ char *parse_server(char *arg, union mysockaddr *addr,
+ union mysockaddr *source_addr, char *interface, int *flags);
+-int option_read_hostsfile(char *file);
++int option_read_dynfile(char *file, int flags);
++
+ /* forward.c */
+ void reply_query(int fd, int family, time_t now);
+ void receive_query(struct listener *listen, time_t now);
+@@ -1494,7 +1500,5 @@ int detect_loop(char *query, int type);
+ #ifdef HAVE_INOTIFY
+ void inotify_dnsmasq_init();
+ int inotify_check(time_t now);
+-# ifdef HAVE_DHCP
+-void set_dhcp_inotify(void);
+-# endif
++void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revhashsz);
+ #endif
+diff --git a/src/inotify.c b/src/inotify.c
+index 818fe8eddda4..c537f4c1562a 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -19,11 +19,6 @@
+
+ #include <sys/inotify.h>
+
+-#ifdef HAVE_DHCP
+-static void check_for_dhcp_inotify(struct inotify_event *in, time_t now);
+-#endif
+-
+-
+ /* the strategy is to set a inotify on the directories containing
+ resolv files, for any files in the directory which are close-write
+ or moved into the directory.
+@@ -82,57 +77,28 @@ void inotify_dnsmasq_init()
+ }
+ }
+
+-int inotify_check(time_t now)
++
++/* initialisation for dynamic-dir. Set inotify watch for each directory, and read pre-existing files */
++void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revhashsz)
+ {
+- int hit = 0;
++ struct hostsfile *ah;
+
+- while (1)
++ for (ah = daemon->dynamic_dirs; ah; ah = ah->next)
+ {
+- int rc;
+- char *p;
+- struct resolvc *res;
+- struct inotify_event *in;
+-
+- while ((rc = read(daemon->inotifyfd, inotify_buffer, INOTIFY_SZ)) == -1 && errno == EINTR);
+-
+- if (rc <= 0)
+- break;
+-
+- for (p = inotify_buffer; rc - (p - inotify_buffer) >= (int)sizeof(struct inotify_event); p += sizeof(struct inotify_event) + in->len)
++ DIR *dir_stream = NULL;
++ struct dirent *ent;
++ struct stat buf;
++
++ if (!(ah->flags & flag))
++ continue;
++
++ if (stat(ah->fname, &buf) == -1 || !(S_ISDIR(buf.st_mode)))
+ {
+- in = (struct inotify_event*)p;
+-
+- for (res = daemon->resolv_files; res; res = res->next)
+- if (res->wd == in->wd && in->len != 0 && strcmp(res->file, in->name) == 0)
+- hit = 1;
+-
+-#ifdef HAVE_DHCP
+- if (daemon->dhcp || daemon->doing_dhcp6)
+- check_for_dhcp_inotify(in, now);
+-#endif
++ my_syslog(LOG_ERR, _("bad dynamic directory %s: %s"),
++ ah->fname, strerror(errno));
++ continue;
+ }
+- }
+- return hit;
+-}
+-
+-#ifdef HAVE_DHCP
+-/* initialisation for dhcp-hostdir. Set inotify watch for each directory, and read pre-existing files */
+-void set_dhcp_inotify(void)
+-{
+- struct hostsfile *ah;
+-
+- for (ah = daemon->inotify_hosts; ah; ah = ah->next)
+- {
+- DIR *dir_stream = NULL;
+- struct dirent *ent;
+- struct stat buf;
+-
+- if (stat(ah->fname, &buf) == -1 || !(S_ISDIR(buf.st_mode)))
+- {
+- my_syslog(LOG_ERR, _("bad directory in dhcp-hostsdir %s"), ah->fname);
+- continue;
+- }
+-
++
+ if (!(ah->flags & AH_WD_DONE))
+ {
+ ah->wd = inotify_add_watch(daemon->inotifyfd, ah->fname, IN_CLOSE_WRITE | IN_MOVED_TO);
+@@ -142,7 +108,8 @@ void set_dhcp_inotify(void)
+ a race which misses files being added as we start */
+ if (ah->wd == -1 || !(dir_stream = opendir(ah->fname)))
+ {
+- my_syslog(LOG_ERR, _("failed to create inotify for %s"), ah->fname);
++ my_syslog(LOG_ERR, _("failed to create inotify for %s: %s"),
++ ah->fname, strerror(errno));
+ continue;
+ }
+
+@@ -167,54 +134,90 @@ void set_dhcp_inotify(void)
+
+ /* ignore non-regular files */
+ if (stat(path, &buf) != -1 && S_ISREG(buf.st_mode))
+- option_read_hostsfile(path);
+-
++ {
++ if (ah->flags & AH_HOSTS)
++ total_size = read_hostsfile(path, ah->index, total_size, rhash, revhashsz);
++#ifdef HAVE_DHCP
++ else if (ah->flags & (AH_DHCP_HST | AH_DHCP_OPT))
++ option_read_dynfile(path, ah->flags);
++#endif
++ }
++
+ free(path);
+ }
+ }
+ }
+ }
+
+-static void check_for_dhcp_inotify(struct inotify_event *in, time_t now)
++int inotify_check(time_t now)
+ {
++ int hit = 0;
+ struct hostsfile *ah;
+
+- /* ignore emacs backups and dotfiles */
+- if (in->len == 0 ||
+- in->name[in->len - 1] == '~' ||
+- (in->name[0] == '#' && in->name[in->len - 1] == '#') ||
+- in->name[0] == '.')
+- return;
+-
+- for (ah = daemon->inotify_hosts; ah; ah = ah->next)
+- if (ah->wd == in->wd)
+- {
+- size_t lendir = strlen(ah->fname);
+- char *path;
+-
+- if ((path = whine_malloc(lendir + in->len + 2)))
+- {
+- strcpy(path, ah->fname);
+- strcat(path, "/");
+- strcat(path, in->name);
+-
+- if (option_read_hostsfile(path))
++ while (1)
++ {
++ int rc;
++ char *p;
++ struct resolvc *res;
++ struct inotify_event *in;
++
++ while ((rc = read(daemon->inotifyfd, inotify_buffer, INOTIFY_SZ)) == -1 && errno == EINTR);
++
++ if (rc <= 0)
++ break;
++
++ for (p = inotify_buffer; rc - (p - inotify_buffer) >= (int)sizeof(struct inotify_event); p += sizeof(struct inotify_event) + in->len)
++ {
++ in = (struct inotify_event*)p;
++
++ for (res = daemon->resolv_files; res; res = res->next)
++ if (res->wd == in->wd && in->len != 0 && strcmp(res->file, in->name) == 0)
++ hit = 1;
++
++ /* ignore emacs backups and dotfiles */
++ if (in->len == 0 ||
++ in->name[in->len - 1] == '~' ||
++ (in->name[0] == '#' && in->name[in->len - 1] == '#') ||
++ in->name[0] == '.')
++ continue;
++
++ for (ah = daemon->dynamic_dirs; ah; ah = ah->next)
++ if (ah->wd == in->wd)
+ {
+- /* Propogate the consequences of loading a new dhcp-host */
+- dhcp_update_configs(daemon->dhcp_conf);
+- lease_update_from_configs();
+- lease_update_file(now);
+- lease_update_dns(1);
++ size_t lendir = strlen(ah->fname);
++ char *path;
++
++ if ((path = whine_malloc(lendir + in->len + 2)))
++ {
++ strcpy(path, ah->fname);
++ strcat(path, "/");
++ strcat(path, in->name);
++
++ if (ah->flags & AH_HOSTS)
++ read_hostsfile(path, ah->index, 0, NULL, 0);
++#ifdef HAVE_DHCP
++ else if (ah->flags & AH_DHCP_HST)
++ {
++ if (option_read_dynfile(path, AH_DHCP_HST))
++ {
++ /* Propogate the consequences of loading a new dhcp-host */
++ dhcp_update_configs(daemon->dhcp_conf);
++ lease_update_from_configs();
++ lease_update_file(now);
++ lease_update_dns(1);
++ }
++ }
++ else if (ah->flags & AH_DHCP_OPT)
++ option_read_dynfile(path, AH_DHCP_OPT);
++#endif
++
++ free(path);
++ }
+ }
+-
+- free(path);
+- }
+-
+- return;
+- }
++ }
++ }
++ return hit;
+ }
+
+-#endif /* DHCP */
+-
+ #endif /* INOTIFY */
+
+diff --git a/src/option.c b/src/option.c
+index 22e11c37d374..6ef80117cc8c 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -150,6 +150,8 @@ struct myoption {
+ #define LOPT_IGNORE_ADDR 338
+ #define LOPT_MINCTTL 339
+ #define LOPT_DHCP_INOTIFY 340
++#define LOPT_DHOPT_INOTIFY 341
++#define LOPT_HOST_INOTIFY 342
+
+ #ifdef HAVE_GETOPT_LONG
+ static const struct option opts[] =
+@@ -200,6 +202,7 @@ static const struct myoption opts[] =
+ { "local-ttl", 1, 0, 'T' },
+ { "no-negcache", 0, 0, 'N' },
+ { "addn-hosts", 1, 0, 'H' },
++ { "hostsdir", 1, 0, LOPT_HOST_INOTIFY },
+ { "query-port", 1, 0, 'Q' },
+ { "except-interface", 1, 0, 'I' },
+ { "no-dhcp-interface", 1, 0, '2' },
+@@ -249,6 +252,7 @@ static const struct myoption opts[] =
+ { "dhcp-hostsfile", 1, 0, LOPT_DHCP_HOST },
+ { "dhcp-optsfile", 1, 0, LOPT_DHCP_OPTS },
+ { "dhcp-hostsdir", 1, 0, LOPT_DHCP_INOTIFY },
++ { "dhcp-optsdir", 1, 0, LOPT_DHOPT_INOTIFY },
+ { "dhcp-no-override", 0, 0, LOPT_OVERRIDE },
+ { "tftp-port-range", 1, 0, LOPT_TFTPPORTS },
+ { "stop-dns-rebind", 0, 0, LOPT_REBIND },
+@@ -338,9 +342,11 @@ static struct {
+ { LOPT_DHCP_HOST, ARG_DUP, "<path>", gettext_noop("Read DHCP host specs from file."), NULL },
+ { LOPT_DHCP_OPTS, ARG_DUP, "<path>", gettext_noop("Read DHCP option specs from file."), NULL },
+ { LOPT_DHCP_INOTIFY, ARG_DUP, "<path>", gettext_noop("Read DHCP host specs from a directory."), NULL },
++ { LOPT_DHOPT_INOTIFY, ARG_DUP, "<path>", gettext_noop("Read DHCP options from a directory."), NULL },
+ { LOPT_TAG_IF, ARG_DUP, "tag-expression", gettext_noop("Evaluate conditional tag expression."), NULL },
+ { 'h', OPT_NO_HOSTS, NULL, gettext_noop("Do NOT load %s file."), HOSTSFILE },
+ { 'H', ARG_DUP, "<path>", gettext_noop("Specify a hosts file to be read in addition to %s."), HOSTSFILE },
++ { LOPT_HOST_INOTIFY, ARG_DUP, "<path>", gettext_noop("Read hosts files from a directory."), NULL },
+ { 'i', ARG_DUP, "<interface>", gettext_noop("Specify interface(s) to listen on."), NULL },
+ { 'I', ARG_DUP, "<interface>", gettext_noop("Specify interface(s) NOT to listen on.") , NULL },
+ { 'j', ARG_DUP, "set:<tag>,<class>", gettext_noop("Map DHCP user class to tag."), NULL },
+@@ -1712,10 +1718,12 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ break;
+ #endif /* HAVE_DHCP */
+
+- case LOPT_DHCP_HOST: /* --dhcp-hostsfile */
+- case LOPT_DHCP_OPTS: /* --dhcp-optsfile */
+- case LOPT_DHCP_INOTIFY: /* dhcp-hostsdir */
+- case 'H': /* --addn-hosts */
++ case LOPT_DHCP_HOST: /* --dhcp-hostsfile */
++ case LOPT_DHCP_OPTS: /* --dhcp-optsfile */
++ case LOPT_DHCP_INOTIFY: /* --dhcp-hostsdir */
++ case LOPT_DHOPT_INOTIFY: /* --dhcp-optsdir */
++ case LOPT_HOST_INOTIFY: /* --hostsdir */
++ case 'H': /* --addn-hosts */
+ {
+ struct hostsfile *new = opt_malloc(sizeof(struct hostsfile));
+ static unsigned int hosts_index = SRC_AH;
+@@ -1737,10 +1745,16 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ new->next = daemon->dhcp_opts_file;
+ daemon->dhcp_opts_file = new;
+ }
+- else if (option == LOPT_DHCP_INOTIFY)
++ else
+ {
+- new->next = daemon->inotify_hosts;
+- daemon->inotify_hosts = new;
++ new->next = daemon->dynamic_dirs;
++ daemon->dynamic_dirs = new;
++ if (option == LOPT_DHCP_INOTIFY)
++ new->flags |= AH_DHCP_HST;
++ else if (option == LOPT_DHOPT_INOTIFY)
++ new->flags |= AH_DHCP_OPT;
++ else if (option == LOPT_HOST_INOTIFY)
++ new->flags |= AH_HOSTS;
+ }
+
+ break;
+@@ -4052,9 +4066,14 @@ static void read_file(char *file, FILE *f, int hard_opt)
+ }
+
+ #ifdef HAVE_DHCP
+-int option_read_hostsfile(char *file)
++int option_read_dynfile(char *file, int flags)
+ {
+- return one_file(file, LOPT_BANK);
++ if (flags & AH_DHCP_HST)
++ return one_file(file, LOPT_BANK);
++ else if (flags & AH_DHCP_OPT)
++ return one_file(file, LOPT_OPTS);
++
++ return 0;
+ }
+ #endif
+
+--
+2.1.0
+
--- /dev/null
+From aff3396280e944833f0e23d834aa6acd5fe2605a Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 31 Jan 2015 20:13:40 +0000
+Subject: [PATCH 39/55] Update copyrights for dawn of 2015.
+
+---
+ Makefile | 2 +-
+ src/auth.c | 2 +-
+ src/blockdata.c | 2 +-
+ src/bpf.c | 2 +-
+ src/cache.c | 2 +-
+ src/config.h | 2 +-
+ src/conntrack.c | 2 +-
+ src/dbus.c | 2 +-
+ src/dhcp-common.c | 2 +-
+ src/dhcp-protocol.h | 2 +-
+ src/dhcp.c | 2 +-
+ src/dhcp6-protocol.h | 2 +-
+ src/dhcp6.c | 2 +-
+ src/dns-protocol.h | 2 +-
+ src/dnsmasq.c | 2 +-
+ src/dnsmasq.h | 4 ++--
+ src/dnssec.c | 2 +-
+ src/domain.c | 2 +-
+ src/forward.c | 2 +-
+ src/helper.c | 2 +-
+ src/inotify.c | 2 +-
+ src/ip6addr.h | 2 +-
+ src/lease.c | 2 +-
+ src/log.c | 2 +-
+ src/loop.c | 2 +-
+ src/netlink.c | 2 +-
+ src/network.c | 2 +-
+ src/option.c | 2 +-
+ src/outpacket.c | 2 +-
+ src/radv-protocol.h | 2 +-
+ src/radv.c | 2 +-
+ src/rfc1035.c | 2 +-
+ src/rfc2131.c | 2 +-
+ src/rfc3315.c | 2 +-
+ src/slaac.c | 2 +-
+ src/tftp.c | 2 +-
+ src/util.c | 2 +-
+ 37 files changed, 38 insertions(+), 38 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index bcbd5571671d..21e4a5c4101c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,4 +1,4 @@
+-# dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++# dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+diff --git a/src/auth.c b/src/auth.c
+index 59e05d3da38e..15721e52793f 100644
+--- a/src/auth.c
++++ b/src/auth.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/blockdata.c b/src/blockdata.c
+index 5a70a7967fa3..c8f5eae811eb 100644
+--- a/src/blockdata.c
++++ b/src/blockdata.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/bpf.c b/src/bpf.c
+index 4416b1c07287..997d87421bed 100644
+--- a/src/bpf.c
++++ b/src/bpf.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/cache.c b/src/cache.c
+index abaf25ec0f18..117ae279fd4e 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/config.h b/src/config.h
+index 5e5009271eba..8def6f200461 100644
+--- a/src/config.h
++++ b/src/config.h
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/conntrack.c b/src/conntrack.c
+index 6a5133ab93af..0fa2da903b03 100644
+--- a/src/conntrack.c
++++ b/src/conntrack.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dbus.c b/src/dbus.c
+index a2a94dc85dac..5b69de518beb 100644
+--- a/src/dbus.c
++++ b/src/dbus.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dhcp-common.c b/src/dhcp-common.c
+index 9d13ac8df6f1..ce115202a646 100644
+--- a/src/dhcp-common.c
++++ b/src/dhcp-common.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dhcp-protocol.h b/src/dhcp-protocol.h
+index 4c0961472482..701b6cb3346e 100644
+--- a/src/dhcp-protocol.h
++++ b/src/dhcp-protocol.h
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dhcp.c b/src/dhcp.c
+index 7acf2c4311a9..f29be9b489a7 100644
+--- a/src/dhcp.c
++++ b/src/dhcp.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dhcp6-protocol.h b/src/dhcp6-protocol.h
+index 5927dc32f6af..928a2fa162ed 100644
+--- a/src/dhcp6-protocol.h
++++ b/src/dhcp6-protocol.h
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dhcp6.c b/src/dhcp6.c
+index bc48fdddd3de..3c56e77c6085 100644
+--- a/src/dhcp6.c
++++ b/src/dhcp6.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dns-protocol.h b/src/dns-protocol.h
+index 0aced3ce6952..16fade33d98c 100644
+--- a/src/dns-protocol.h
++++ b/src/dns-protocol.h
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index 2c629fe422aa..e903a24c8105 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 0c322a93993e..89e758b56a0a 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+@@ -14,7 +14,7 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+-#define COPYRIGHT "Copyright (c) 2000-2014 Simon Kelley"
++#define COPYRIGHT "Copyright (c) 2000-2015 Simon Kelley"
+
+ #ifndef NO_LARGEFILE
+ /* Ensure we can use files >2GB (log files may grow this big) */
+diff --git a/src/dnssec.c b/src/dnssec.c
+index d39ab85ed966..a8dfe3871c85 100644
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -1,5 +1,5 @@
+ /* dnssec.c is Copyright (c) 2012 Giovanni Bajo <rasky@develer.com>
+- and Copyright (c) 2012-2014 Simon Kelley
++ and Copyright (c) 2012-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/domain.c b/src/domain.c
+index fdd5e4f0838f..278698ca04b3 100644
+--- a/src/domain.c
++++ b/src/domain.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/forward.c b/src/forward.c
+index b17bc34f865f..438e9fa490b8 100644
+--- a/src/forward.c
++++ b/src/forward.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/helper.c b/src/helper.c
+index 4be53c361ee1..1fee72dead8c 100644
+--- a/src/helper.c
++++ b/src/helper.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/inotify.c b/src/inotify.c
+index c537f4c1562a..470d6ed99213 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/ip6addr.h b/src/ip6addr.h
+index c7dcb39c33fa..f0b7e820e227 100644
+--- a/src/ip6addr.h
++++ b/src/ip6addr.h
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/lease.c b/src/lease.c
+index 5d56b1b9147e..545bbb7fd09c 100644
+--- a/src/lease.c
++++ b/src/lease.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/log.c b/src/log.c
+index 8083a8697323..a5ac605c7c5d 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/loop.c b/src/loop.c
+index bb377ad12644..565f7d8e58e0 100644
+--- a/src/loop.c
++++ b/src/loop.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/netlink.c b/src/netlink.c
+index b39328376389..10f94db25a14 100644
+--- a/src/netlink.c
++++ b/src/netlink.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/network.c b/src/network.c
+index 14d2af2ce313..7045253d467b 100644
+--- a/src/network.c
++++ b/src/network.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/option.c b/src/option.c
+index 6ef80117cc8c..cb4e76ba0aa2 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/outpacket.c b/src/outpacket.c
+index dce68f7cb09f..5b1ff9318bbd 100644
+--- a/src/outpacket.c
++++ b/src/outpacket.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/radv-protocol.h b/src/radv-protocol.h
+index 72ccda49d7fe..4cc1ea426e69 100644
+--- a/src/radv-protocol.h
++++ b/src/radv-protocol.h
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/radv.c b/src/radv.c
+index 3c8b162dbd8e..6da125b864ae 100644
+--- a/src/radv.c
++++ b/src/radv.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index 262274fc5b80..5ef5ddb7485e 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/rfc2131.c b/src/rfc2131.c
+index 5c9040892f1d..55526443dc84 100644
+--- a/src/rfc2131.c
++++ b/src/rfc2131.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/rfc3315.c b/src/rfc3315.c
+index e593ec9c362c..c1ddc805988d 100644
+--- a/src/rfc3315.c
++++ b/src/rfc3315.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/slaac.c b/src/slaac.c
+index 351d6802f85e..abaad537e25a 100644
+--- a/src/slaac.c
++++ b/src/slaac.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/tftp.c b/src/tftp.c
+index a527911fc0df..a57a31514f44 100644
+--- a/src/tftp.c
++++ b/src/tftp.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/src/util.c b/src/util.c
+index d532444da207..91d02410b13f 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -1,4 +1,4 @@
+-/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley
++/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+--
+2.1.0
+
--- /dev/null
+From 3d04f46334d0e345f589eda1372e638b946fe637 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 31 Jan 2015 21:59:13 +0000
+Subject: [PATCH 40/55] inotify documentation updates.
+
+---
+ man/dnsmasq.8 | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 005b5cca8d1f..c858323d78bd 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -50,6 +50,10 @@ Additional hosts file. Read the specified file as well as /etc/hosts. If -h is g
+ only the specified file. This option may be repeated for more than one
+ additional hosts file. If a directory is given, then read all the files contained in that directory.
+ .TP
++.B --hostsdir=<path>
++Read all the hosts files contained in the directory. New or changed files
++are read automatically. See --dhcp-hostsdir for details.
++.TP
+ .B \-E, --expand-hosts
+ Add the domain to simple names (without a period) in /etc/hosts
+ in the same way as for DHCP-derived names. Note that this does not
+@@ -979,12 +983,14 @@ dhcp-optsfile will be re-read when dnsmasq receives SIGHUP. Note that
+ it is possible to encode the information in a
+ .TP
+ .B --dhcp-hostsdir=<path>
+-This is exactly equivalent to dhcp-hostfile, except for the following. The path MUST be a
++This is equivalent to dhcp-hostsfile, except for the following. The path MUST be a
+ directory, and not an individual file. Changed or new files within
+ the directory are read automatically, without the need to send SIGHUP.
+ If a file is deleted for changed after it has been read by dnsmasq, then the
+ host record it contained will remain until dnsmasq recieves a SIGHUP, or
+ is restarted; ie host records are only added dynamically.
++.B --dhcp-optsdir=<path>
++This is equivalent to dhcp-optsfile, with the differences noted for --dhcp-hostsdir.
+ .TP
+ .B --dhcp-boot
+ flag as DHCP options, using the options names bootfile-name,
+@@ -1791,7 +1797,8 @@ clears its cache and then re-loads
+ .I /etc/hosts
+ and
+ .I /etc/ethers
+-and any file given by --dhcp-hostsfile, --dhcp-optsfile or --addn-hosts.
++and any file given by --dhcp-hostsfile, --dhcp-hostsdir, --dhcp-optsfile,
++--dhcp-optsdir, --addn-hosts or --hostsdir.
+ The dhcp lease change script is called for all
+ existing DHCP leases. If
+ .B
+--
+2.1.0
+
--- /dev/null
+From 6ef15b34ca83c62a939f69356d5c3f7a6bfef3d0 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 31 Jan 2015 22:44:26 +0000
+Subject: [PATCH 41/55] Fix broken ECDSA DNSSEC signatures.
+
+---
+ CHANGELOG | 2 ++
+ src/dnssec.c | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index c05dec63c587..c80dc0fdbe9e 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -65,6 +65,8 @@ version 2.73
+ configured to do stateful DHCPv6. Thanks to Win King Wan
+ for the patch.
+
++ Fix broken DNSSEC validation of ECDSA signatures.
++
+
+ version 2.72
+ Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
+diff --git a/src/dnssec.c b/src/dnssec.c
+index a8dfe3871c85..26932373cd3e 100644
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -275,7 +275,7 @@ static int dnsmasq_ecdsa_verify(struct blockdata *key_data, unsigned int key_len
+ }
+
+ if (sig_len != 2*t || key_len != 2*t ||
+- (p = blockdata_retrieve(key_data, key_len, NULL)))
++ !(p = blockdata_retrieve(key_data, key_len, NULL)))
+ return 0;
+
+ mpz_import(x, t , 1, 1, 0, 0, p);
+--
+2.1.0
+
--- /dev/null
+From 106266761828a0acb006346ae47bf031dee46a5d Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sun, 1 Feb 2015 00:15:16 +0000
+Subject: [PATCH 42/55] BSD make support
+
+---
+ Makefile | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 21e4a5c4101c..2910320b6452 100644
+--- a/Makefile
++++ b/Makefile
+@@ -64,8 +64,10 @@ nettle_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG
+ gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP --copy -lgmp`
+ sunos_libs = `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket -lnsl -lposix4; fi`
+ version = -DVERSION='\"`$(top)/bld/get-version $(top)`\"'
+-copts_conf = .copts_$(shell $(CC) -DDNSMASQ_COMPILE_OPTS $(COPTS) -E $(top)/$(SRC)/dnsmasq.h | \
+- ( md5sum 2>/dev/null || md5 ) | cut -f 1 -d ' ')
++
++sum?=$(shell $(CC) -DDNSMASQ_COMPILE_OPTS $(COPTS) -E $(top)/$(SRC)/dnsmasq.h | ( md5sum 2>/dev/null || md5 ) | cut -f 1 -d ' ')
++sum!=$(CC) -DDNSMASQ_COMPILE_OPTS $(COPTS) -E $(top)/$(SRC)/dnsmasq.h | ( md5sum 2>/dev/null || md5 ) | cut -f 1 -d ' '
++copts_conf = .copts_$(sum)
+
+ objs = cache.o rfc1035.o util.o option.o forward.o network.o \
+ dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
+--
+2.1.0
+
--- /dev/null
+From 8d8a54ec79d9f96979fabbd97b1dd2ddebc7d78f Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sun, 1 Feb 2015 21:48:46 +0000
+Subject: [PATCH 43/55] Fix build failure on openBSD.
+
+---
+ src/tables.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/tables.c b/src/tables.c
+index dcdef794c4d2..aae1252708db 100644
+--- a/src/tables.c
++++ b/src/tables.c
+@@ -21,7 +21,7 @@
+ #if defined(HAVE_IPSET) && defined(HAVE_BSD_NETWORK)
+
+ #ifndef __FreeBSD__
+-#include <bsd/string.h>
++#include <string.h>
+ #endif
+
+ #include <sys/types.h>
+--
+2.1.0
+
--- /dev/null
+From d36b732c4cfa91ea09af64b5dc0f3a85a075e5bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= <thiebaud@weksteen.fr>
+Date: Mon, 2 Feb 2015 21:37:27 +0000
+Subject: [PATCH 44/55] Manpage typo fix.
+
+---
+ man/dnsmasq.8 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index c858323d78bd..27f85d40fbbb 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -516,7 +516,7 @@ zone files: the port, weight and priority numbers are in a different
+ order. More than one SRV record for a given service/domain is allowed,
+ all that match are returned.
+ .TP
+-.B --host-record=<name>[,<name>....][<IPv4-address>],[<IPv6-address>]
++.B --host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>]
+ Add A, AAAA and PTR records to the DNS. This adds one or more names to
+ the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may
+ appear in more than one
+--
+2.1.0
+
--- /dev/null
+From 2941d3ac898cf84b544e47c9735c5e4111711db1 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 2 Feb 2015 22:36:42 +0000
+Subject: [PATCH 45/55] Fixup dhcp-configs after reading extra hostfiles with
+ inotify.
+
+---
+ src/inotify.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/src/inotify.c b/src/inotify.c
+index 470d6ed99213..6f4cd79e0030 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -194,7 +194,19 @@ int inotify_check(time_t now)
+ strcat(path, in->name);
+
+ if (ah->flags & AH_HOSTS)
+- read_hostsfile(path, ah->index, 0, NULL, 0);
++ {
++ read_hostsfile(path, ah->index, 0, NULL, 0);
++#ifdef HAVE_DHCP
++ if (daemon->dhcp || daemon->doing_dhcp6)
++ {
++ /* Propogate the consequences of loading a new dhcp-host */
++ dhcp_update_configs(daemon->dhcp_conf);
++ lease_update_from_configs();
++ lease_update_file(now);
++ lease_update_dns(1);
++ }
++#endif
++ }
+ #ifdef HAVE_DHCP
+ else if (ah->flags & AH_DHCP_HST)
+ {
+--
+2.1.0
+
--- /dev/null
+From f9c863708c6b0aea31ff7a466647685dc739de50 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Tue, 3 Feb 2015 21:52:48 +0000
+Subject: [PATCH 46/55] Extra logging for inotify code.
+
+---
+ src/cache.c | 9 ++++-----
+ src/inotify.c | 4 +++-
+ src/option.c | 4 +++-
+ 3 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/src/cache.c b/src/cache.c
+index 117ae279fd4e..43245b771b53 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -1022,11 +1022,10 @@ int read_hostsfile(char *filename, unsigned int index, int cache_size, struct cr
+ fclose(f);
+
+ if (rhash)
+- {
+- rehash(name_count);
+- my_syslog(LOG_INFO, _("read %s - %d addresses"), filename, addr_count);
+- }
+-
++ rehash(name_count);
++
++ my_syslog(LOG_INFO, _("read %s - %d addresses"), filename, addr_count);
++
+ return name_count;
+ }
+
+diff --git a/src/inotify.c b/src/inotify.c
+index 6f4cd79e0030..44ce0c9af051 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -192,7 +192,9 @@ int inotify_check(time_t now)
+ strcpy(path, ah->fname);
+ strcat(path, "/");
+ strcat(path, in->name);
+-
++
++ my_syslog(LOG_INFO, _("inotify, new or changed file %s"), path);
++
+ if (ah->flags & AH_HOSTS)
+ {
+ read_hostsfile(path, ah->index, 0, NULL, 0);
+diff --git a/src/option.c b/src/option.c
+index cb4e76ba0aa2..e4b4865d07a5 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -4068,11 +4068,13 @@ static void read_file(char *file, FILE *f, int hard_opt)
+ #ifdef HAVE_DHCP
+ int option_read_dynfile(char *file, int flags)
+ {
++ my_syslog(MS_DHCP | LOG_INFO, _("read %s"), file);
++
+ if (flags & AH_DHCP_HST)
+ return one_file(file, LOPT_BANK);
+ else if (flags & AH_DHCP_OPT)
+ return one_file(file, LOPT_OPTS);
+-
++
+ return 0;
+ }
+ #endif
+--
+2.1.0
+
--- /dev/null
+From efb8b5566aafc1f3ce18514a2df93af5a2e4998c Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 7 Feb 2015 22:36:34 +0000
+Subject: [PATCH 47/55] man page typo.
+
+---
+ man/dnsmasq.8 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 27f85d40fbbb..5cdd186afaa0 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -989,6 +989,7 @@ the directory are read automatically, without the need to send SIGHUP.
+ If a file is deleted for changed after it has been read by dnsmasq, then the
+ host record it contained will remain until dnsmasq recieves a SIGHUP, or
+ is restarted; ie host records are only added dynamically.
++.TP
+ .B --dhcp-optsdir=<path>
+ This is equivalent to dhcp-optsfile, with the differences noted for --dhcp-hostsdir.
+ .TP
+--
+2.1.0
+
--- /dev/null
+From f4f400776b3c1aa303d1a0fcd500f0ab5bc970f2 Mon Sep 17 00:00:00 2001
+From: Shantanu Gadgil <shantanugadgil@yahoo.com>
+Date: Wed, 11 Feb 2015 20:16:59 +0000
+Subject: [PATCH 48/55] Fix get-version script which returned wrong tag in some
+ situations.
+
+---
+ bld/get-version | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bld/get-version b/bld/get-version
+index c246a3cc6a47..7ab75db729ac 100755
+--- a/bld/get-version
++++ b/bld/get-version
+@@ -20,7 +20,7 @@ else
+ vers=`cat $1/VERSION | sed 's/[(), ]/,/ g' | tr ',' '\n' | grep ^v[0-9]`
+
+ if [ $? -eq 0 ]; then
+- echo "${vers}" | sort | head -n 1 | sed 's/^v//'
++ echo "${vers}" | sort -r | head -n 1 | sed 's/^v//'
+ else
+ cat $1/VERSION
+ fi
+--
+2.1.0
+
--- /dev/null
+From 8ff70de618eb7de9147dbfbd4deca4a2dd62f0cb Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 14 Feb 2015 20:02:37 +0000
+Subject: [PATCH 49/55] Typos.
+
+---
+ src/inotify.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/inotify.c b/src/inotify.c
+index 44ce0c9af051..9422066257f5 100644
+--- a/src/inotify.c
++++ b/src/inotify.c
+@@ -104,7 +104,8 @@ void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revh
+ ah->wd = inotify_add_watch(daemon->inotifyfd, ah->fname, IN_CLOSE_WRITE | IN_MOVED_TO);
+ ah->flags |= AH_WD_DONE;
+ }
+- /* Read contents of dir _after_ calling add_watch, in the ho[e of avoiding
++
++ /* Read contents of dir _after_ calling add_watch, in the hope of avoiding
+ a race which misses files being added as we start */
+ if (ah->wd == -1 || !(dir_stream = opendir(ah->fname)))
+ {
+--
+2.1.0
+
--- /dev/null
+From caeea190f12efd20139f694aac4942d1ac00019f Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 14 Feb 2015 20:08:56 +0000
+Subject: [PATCH 50/55] Make dynamic hosts files work when --no-hosts set.
+
+---
+ src/cache.c | 21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/src/cache.c b/src/cache.c
+index 43245b771b53..c95624c42b1c 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -1133,17 +1133,18 @@ void cache_reload(void)
+ {
+ if (daemon->cachesize > 0)
+ my_syslog(LOG_INFO, _("cleared cache"));
+- return;
+ }
+-
+- if (!option_bool(OPT_NO_HOSTS))
+- total_size = read_hostsfile(HOSTSFILE, SRC_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
+-
+- daemon->addn_hosts = expand_filelist(daemon->addn_hosts);
+- for (ah = daemon->addn_hosts; ah; ah = ah->next)
+- if (!(ah->flags & AH_INACTIVE))
+- total_size = read_hostsfile(ah->fname, ah->index, total_size, (struct crec **)daemon->packet, revhashsz);
+-
++ else
++ {
++ if (!option_bool(OPT_NO_HOSTS))
++ total_size = read_hostsfile(HOSTSFILE, SRC_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
++
++ daemon->addn_hosts = expand_filelist(daemon->addn_hosts);
++ for (ah = daemon->addn_hosts; ah; ah = ah->next)
++ if (!(ah->flags & AH_INACTIVE))
++ total_size = read_hostsfile(ah->fname, ah->index, total_size, (struct crec **)daemon->packet, revhashsz);
++ }
++
+ #ifdef HAVE_INOTIFY
+ set_dynamic_inotify(AH_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
+ #endif
+--
+2.1.0
+
--- /dev/null
+From 28b879ac47b872af6e8c5e86d76806c69338434d Mon Sep 17 00:00:00 2001
+From: Chen Wei <weichen302@icloud.com>
+Date: Tue, 17 Feb 2015 22:07:35 +0000
+Subject: [PATCH 51/55] Fix trivial memory leaks to quieten valgrind.
+
+---
+ src/dnsmasq.c | 2 ++
+ src/option.c | 11 +++++++++--
+ 2 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index e903a24c8105..e6dabbf556f7 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -627,6 +627,8 @@ int main (int argc, char **argv)
+ }
+
+ #ifdef HAVE_LINUX_NETWORK
++ free(hdr);
++ free(data);
+ if (option_bool(OPT_DEBUG))
+ prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+ #endif
+diff --git a/src/option.c b/src/option.c
+index e4b4865d07a5..ae0ad002d8b8 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -4361,7 +4361,7 @@ void read_opts(int argc, char **argv, char *compile_opts)
+ {
+ char *buff = opt_malloc(MAXDNAME);
+ int option, conffile_opt = '7', testmode = 0;
+- char *arg, *conffile = CONFFILE;
++ char *arg, *conffile = NULL;
+
+ opterr = 0;
+
+@@ -4476,7 +4476,14 @@ void read_opts(int argc, char **argv, char *compile_opts)
+ }
+
+ if (conffile)
+- one_file(conffile, conffile_opt);
++ {
++ one_file(conffile, conffile_opt);
++ free(conffile);
++ }
++ else
++ {
++ one_file(CONFFILE, conffile_opt);
++ }
+
+ /* port might not be known when the address is parsed - fill in here */
+ if (daemon->servers)
+--
+2.1.0
+
--- /dev/null
+From 0705a7e2d57654b27c7e14f35ca77241c1821f4d Mon Sep 17 00:00:00 2001
+From: Tomas Hozza <thozza@redhat.com>
+Date: Mon, 23 Feb 2015 21:26:26 +0000
+Subject: [PATCH 52/55] Fix uninitialized value used in get_client_mac()
+
+---
+ src/dhcp6.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/dhcp6.c b/src/dhcp6.c
+index 3c56e77c6085..c7144f5fee7c 100644
+--- a/src/dhcp6.c
++++ b/src/dhcp6.c
+@@ -246,7 +246,9 @@ void get_client_mac(struct in6_addr *client, int iface, unsigned char *mac, unsi
+ neigh.code = 0;
+ neigh.reserved = 0;
+ neigh.target = *client;
+-
++ /* RFC4443 section-2.3: checksum has to be zero to be calculated */
++ neigh.checksum = 0;
++
+ memset(&addr, 0, sizeof(addr));
+ #ifdef HAVE_SOCKADDR_SA_LEN
+ addr.sin6_len = sizeof(struct sockaddr_in6);
+--
+2.1.0
+
--- /dev/null
+From 47b9ac59c715827252ae6e6732903c3dabb697fb Mon Sep 17 00:00:00 2001
+From: Joachim Zobel <jz-2014@heute-morgen.de>
+Date: Mon, 23 Feb 2015 21:38:11 +0000
+Subject: [PATCH 53/55] Log parsing utils in contrib/reverse-dns
+
+---
+ contrib/reverse-dns/README | 18 ++++++++++++++++++
+ contrib/reverse-dns/reverse_dns.sh | 29 +++++++++++++++++++++++++++++
+ contrib/reverse-dns/reverse_replace.sh | 28 ++++++++++++++++++++++++++++
+ 3 files changed, 75 insertions(+)
+ create mode 100644 contrib/reverse-dns/README
+ create mode 100644 contrib/reverse-dns/reverse_dns.sh
+ create mode 100644 contrib/reverse-dns/reverse_replace.sh
+
+diff --git a/contrib/reverse-dns/README b/contrib/reverse-dns/README
+new file mode 100644
+index 000000000000..f87eb77c4c22
+--- /dev/null
++++ b/contrib/reverse-dns/README
+@@ -0,0 +1,18 @@
++Hi.\r
++\r
++To translate my routers netstat-nat output into names that actually talk\r
++to me I have started writing to simple shell scripts. They require \r
++\r
++log-queries\r
++log-facility=/var/log/dnsmasq.log\r
++\r
++to be set. With\r
++\r
++netstat-nat -n -4 | reverse_replace.sh \r
++\r
++I get retranslated output.\r
++\r
++Sincerely,\r
++Joachim\r
++\r
++\r
+diff --git a/contrib/reverse-dns/reverse_dns.sh b/contrib/reverse-dns/reverse_dns.sh
+new file mode 100644
+index 000000000000..c0fff300a947
+--- /dev/null
++++ b/contrib/reverse-dns/reverse_dns.sh
+@@ -0,0 +1,29 @@
++#!/bin/bash
++# $Id: reverse_dns.sh 4 2015-02-17 20:14:59Z jo $
++#
++# Usage: reverse_dns.sh IP
++# Uses the dnsmasq query log to lookup the name
++# that was last queried to return the given IP.
++#
++
++IP=$1
++qmIP=`echo $IP | sed 's#\.#\\.#g'`
++LOG=/var/log/dnsmasq.log
++
++IP_regex='^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'
++
++if ! [[ $IP =~ $IP_regex ]]; then
++ echo -n $IP
++ exit
++fi
++
++NAME=`tac $LOG | \
++ grep " is $IP" | head -1 | \
++ sed "s#.* \([^ ]*\) is $qmIP.*#\1#" `
++
++if [ -z "$NAME" ]; then
++ echo -n $IP
++else
++ echo -n $NAME
++fi
++
+diff --git a/contrib/reverse-dns/reverse_replace.sh b/contrib/reverse-dns/reverse_replace.sh
+new file mode 100644
+index 000000000000..a11c164b7f19
+--- /dev/null
++++ b/contrib/reverse-dns/reverse_replace.sh
+@@ -0,0 +1,28 @@
++#!/bin/bash
++# $Id: reverse_replace.sh 4 2015-02-17 20:14:59Z jo $
++#
++# Usage e.g.: netstat -n -4 | reverse_replace.sh
++# Parses stdin for IP4 addresses and replaces them
++# with names retrieved by reverse_dns.sh
++#
++
++DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
++DNS=$DIR/reverse_dns.sh
++
++# sed regex
++IP_regex='[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
++
++while read LINE; do
++ if grep --quiet $IP_regex <<< "$LINE"; then
++ IPs=`sed "s#.*\b\($IP_regex\)\b.*#\1 #g" <<< "$LINE"`
++ IPs=($IPs)
++ for IP in "${IPs[@]}"
++ do
++ NAME=`$DNS $IP`
++ # echo "$NAME is $IP";
++ LINE="${LINE/$IP/$NAME}"
++ done
++ fi
++ echo $LINE
++done < /dev/stdin
++
+--
+2.1.0
+
--- /dev/null
+From f6e62e2af96f5fa0d1e3d93167a93a8f09bf6e61 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sun, 1 Mar 2015 18:17:54 +0000
+Subject: [PATCH 54/55] Add --dnssec-timestamp option and facility.
+
+---
+ CHANGELOG | 6 +++++
+ man/dnsmasq.8 | 6 +++++
+ src/dnsmasq.c | 11 +++++++-
+ src/dnsmasq.h | 2 ++
+ src/dnssec.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
+ src/option.c | 7 +++++
+ 6 files changed, 108 insertions(+), 6 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index c80dc0fdbe9e..4f4fa305deaa 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -66,6 +66,12 @@ version 2.73
+ for the patch.
+
+ Fix broken DNSSEC validation of ECDSA signatures.
++
++ Add --dnssec-timestamp option, which provides an automatic
++ way to detect when the system time becomes valid after boot
++ on systems without an RTC, whilst allowing DNS queries before the
++ clock is valid so that NTP can run. Thanks to
++ Kevin Darbyshire-Bryant for developing this idea.
+
+
+ version 2.72
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 5cdd186afaa0..097e7d75145c 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -674,6 +674,12 @@ that dnsmasq should be started with this flag when the platform determines that
+ reliable time is established, a SIGHUP should be sent to dnsmasq, which enables time checking, and purges the cache of DNS records
+ which have not been throughly checked.
+ .TP
++.B --dnssec-timestamp=<path>
++Enables an alternative way of checking the validity of the system time for DNSSEC (see --dnssec-no-timecheck). In this case, the
++system time is considered to be valid once it becomes later than the timestamp on the specified file. The file is created and
++its timestamp set automatically by dnsmasq. The file must be stored on a persistent filesystem, so that it and its mtime are carried
++over system restarts.
++.TP
+ .B --proxy-dnssec
+ Copy the DNSSEC Authenticated Data bit from upstream servers to downstream clients and cache it. This is an
+ alternative to having dnsmasq validate DNSSEC, but it depends on the security of the network between
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index e6dabbf556f7..769a19afe6c5 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -58,6 +58,9 @@ int main (int argc, char **argv)
+ struct dhcp_context *context;
+ struct dhcp_relay *relay;
+ #endif
++#ifdef HAVE_DNSSEC
++ int badtime;
++#endif
+
+ #ifdef LOCALEDIR
+ setlocale(LC_ALL, "");
+@@ -369,7 +372,11 @@ int main (int argc, char **argv)
+
+ if (baduser)
+ die(_("unknown user or group: %s"), baduser, EC_BADCONF);
+-
++
++#ifdef HAVE_DNSSEC
++ badtime = setup_timestamp(ent_pw->pw_uid);
++#endif
++
+ /* implement group defaults, "dip" if available, or group associated with uid */
+ if (!daemon->group_set && !gp)
+ {
+@@ -689,6 +696,8 @@ int main (int argc, char **argv)
+ my_syslog(LOG_INFO, _("DNSSEC validation enabled"));
+ if (option_bool(OPT_DNSSEC_TIME))
+ my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until first cache reload"));
++ if (badtime)
++ my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until system time valid"));
+ }
+ #endif
+
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 89e758b56a0a..b2f02dda63f0 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -986,6 +986,7 @@ extern struct daemon {
+ #endif
+ #ifdef HAVE_DNSSEC
+ struct ds_config *ds;
++ char *timestamp_file;
+ #endif
+
+ /* globally used stuff for DNS */
+@@ -1151,6 +1152,7 @@ int dnssec_chase_cname(time_t now, struct dns_header *header, size_t plen, char
+ int dnskey_keytag(int alg, int flags, unsigned char *rdata, int rdlen);
+ size_t filter_rrsigs(struct dns_header *header, size_t plen);
+ unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name);
++int setup_timestamp(uid_t uid);
+
+ /* util.c */
+ void rand_init(void);
+diff --git a/src/dnssec.c b/src/dnssec.c
+index 26932373cd3e..bf4406469de0 100644
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -34,6 +34,7 @@
+ #include <nettle/dsa-compat.h>
+ #endif
+
++#include <utime.h>
+
+ #define SERIAL_UNDEF -100
+ #define SERIAL_EQ 0
+@@ -394,17 +395,88 @@ static int serial_compare_32(unsigned long s1, unsigned long s2)
+ return SERIAL_UNDEF;
+ }
+
++/* Called at startup. If the timestamp file is configured and exists, put its mtime on
++ timestamp_time. If it doesn't exist, create it, and set the mtime to 1-1-2015.
++ Change the ownership to the user we'll be running as, so that we can update the mtime.
++*/
++static time_t timestamp_time;
++static int back_to_the_future;
++
++int setup_timestamp(uid_t uid)
++{
++ struct stat statbuf;
++
++ back_to_the_future = 0;
++
++ if (!option_bool(OPT_DNSSEC_VALID) || !daemon->timestamp_file)
++ return 0;
++
++ if (stat(daemon->timestamp_file, &statbuf) != -1)
++ {
++ timestamp_time = statbuf.st_mtime;
++ check_and_exit:
++ if (difftime(timestamp_time, time(0)) <= 0)
++ {
++ /* time already OK, update timestamp, and do key checking from the start. */
++ if (utime(daemon->timestamp_file, NULL) == -1)
++ my_syslog(LOG_ERR, _("failed to update mtime on %s: %s"), daemon->timestamp_file, strerror(errno));
++ back_to_the_future = 1;
++ return 0;
++ }
++ return 1;
++ }
++
++ if (errno == ENOENT)
++ {
++ int fd = open(daemon->timestamp_file, O_WRONLY | O_CREAT | O_NONBLOCK, 0666);
++ if (fd != -1)
++ {
++ struct utimbuf timbuf;
++
++ close(fd);
++
++ timestamp_time = timbuf.actime = timbuf.modtime = 1420070400; /* 1-1-2015 */
++ if (utime(daemon->timestamp_file, &timbuf) == 0 &&
++ (getuid() != 0 || chown(daemon->timestamp_file, uid, -1) == 0))
++ goto check_and_exit;
++ }
++ }
++
++ die(_("Cannot create timestamp file %s: %s" ), daemon->timestamp_file, EC_BADCONF);
++ return 0;
++}
++
+ /* Check whether today/now is between date_start and date_end */
+ static int check_date_range(unsigned long date_start, unsigned long date_end)
+ {
+- unsigned long curtime;
+-
++ unsigned long curtime = time(0);
++
+ /* Checking timestamps may be temporarily disabled */
+- if (option_bool(OPT_DNSSEC_TIME))
++
++ /* If the current time if _before_ the timestamp
++ on our persistent timestamp file, then assume the
++ time if not yet correct, and don't check the
++ key timestamps. As soon as the current time is
++ later then the timestamp, update the timestamp
++ and start checking keys */
++ if (daemon->timestamp_file)
++ {
++ if (back_to_the_future == 0 && difftime(timestamp_time, curtime) <= 0)
++ {
++ if (utime(daemon->timestamp_file, NULL) != 0)
++ my_syslog(LOG_ERR, _("failed to update mtime on %s: %s"), daemon->timestamp_file, strerror(errno));
++
++ back_to_the_future = 1;
++ set_option_bool(OPT_DNSSEC_TIME);
++ queue_event(EVENT_RELOAD); /* purge cache */
++ }
++
++ if (back_to_the_future == 0)
++ return 1;
++ }
++ else if (option_bool(OPT_DNSSEC_TIME))
+ return 1;
+
+- curtime = time(0);
+-
+ /* We must explicitly check against wanted values, because of SERIAL_UNDEF */
+ return serial_compare_32(curtime, date_start) == SERIAL_GT
+ && serial_compare_32(curtime, date_end) == SERIAL_LT;
+diff --git a/src/option.c b/src/option.c
+index ae0ad002d8b8..eace40bb566c 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -152,6 +152,7 @@ struct myoption {
+ #define LOPT_DHCP_INOTIFY 340
+ #define LOPT_DHOPT_INOTIFY 341
+ #define LOPT_HOST_INOTIFY 342
++#define LOPT_DNSSEC_STAMP 343
+
+ #ifdef HAVE_GETOPT_LONG
+ static const struct option opts[] =
+@@ -300,6 +301,7 @@ static const struct myoption opts[] =
+ { "dnssec-debug", 0, 0, LOPT_DNSSEC_DEBUG },
+ { "dnssec-check-unsigned", 0, 0, LOPT_DNSSEC_CHECK },
+ { "dnssec-no-timecheck", 0, 0, LOPT_DNSSEC_TIME },
++ { "dnssec-timestamp", 1, 0, LOPT_DNSSEC_STAMP },
+ #ifdef OPTION6_PREFIX_CLASS
+ { "dhcp-prefix-class", 1, 0, LOPT_PREF_CLSS },
+ #endif
+@@ -463,6 +465,7 @@ static struct {
+ { LOPT_DNSSEC_DEBUG, OPT_DNSSEC_DEBUG, NULL, gettext_noop("Disable upstream checking for DNSSEC debugging."), NULL },
+ { LOPT_DNSSEC_CHECK, OPT_DNSSEC_NO_SIGN, NULL, gettext_noop("Ensure answers without DNSSEC are in unsigned zones."), NULL },
+ { LOPT_DNSSEC_TIME, OPT_DNSSEC_TIME, NULL, gettext_noop("Don't check DNSSEC signature timestamps until first cache-reload"), NULL },
++ { LOPT_DNSSEC_STAMP, ARG_ONE, "<path>", gettext_noop("Timestamp file to verify system clock for DNSSEC"), NULL },
+ #ifdef OPTION6_PREFIX_CLASS
+ { LOPT_PREF_CLSS, ARG_DUP, "set:tag,<class>", gettext_noop("Specify DHCPv6 prefix class"), NULL },
+ #endif
+@@ -3867,6 +3870,10 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+ }
+
+ #ifdef HAVE_DNSSEC
++ case LOPT_DNSSEC_STAMP:
++ daemon->timestamp_file = opt_string_alloc(arg);
++ break;
++
+ case LOPT_TRUST_ANCHOR:
+ {
+ struct ds_config *new = opt_malloc(sizeof(struct ds_config));
+--
+2.1.0
+
--- /dev/null
+From 9003b50b13da624ca45f3e0cf99abb623b8d026b Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 2 Mar 2015 22:47:23 +0000
+Subject: [PATCH 55/55] Fix last commit to not crash if uid changing not
+ configured.
+
+---
+ src/dnsmasq.c | 2 +-
+ src/dnsmasq.h | 2 +-
+ src/dnssec.c | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index 769a19afe6c5..9e05c0e31569 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -374,7 +374,7 @@ int main (int argc, char **argv)
+ die(_("unknown user or group: %s"), baduser, EC_BADCONF);
+
+ #ifdef HAVE_DNSSEC
+- badtime = setup_timestamp(ent_pw->pw_uid);
++ badtime = setup_timestamp(ent_pw);
+ #endif
+
+ /* implement group defaults, "dip" if available, or group associated with uid */
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index b2f02dda63f0..a451cb4dd03c 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -1152,7 +1152,7 @@ int dnssec_chase_cname(time_t now, struct dns_header *header, size_t plen, char
+ int dnskey_keytag(int alg, int flags, unsigned char *rdata, int rdlen);
+ size_t filter_rrsigs(struct dns_header *header, size_t plen);
+ unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name);
+-int setup_timestamp(uid_t uid);
++int setup_timestamp(struct passwd *ent_pw);
+
+ /* util.c */
+ void rand_init(void);
+diff --git a/src/dnssec.c b/src/dnssec.c
+index bf4406469de0..c60eacf73c6b 100644
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -402,7 +402,7 @@ static int serial_compare_32(unsigned long s1, unsigned long s2)
+ static time_t timestamp_time;
+ static int back_to_the_future;
+
+-int setup_timestamp(uid_t uid)
++int setup_timestamp(struct passwd *ent_pw)
+ {
+ struct stat statbuf;
+
+@@ -437,7 +437,7 @@ int setup_timestamp(uid_t uid)
+
+ timestamp_time = timbuf.actime = timbuf.modtime = 1420070400; /* 1-1-2015 */
+ if (utime(daemon->timestamp_file, &timbuf) == 0 &&
+- (getuid() != 0 || chown(daemon->timestamp_file, uid, -1) == 0))
++ (!ent_pw || getuid() != 0 || chown(daemon->timestamp_file, ent_pw->pw_uid, -1) == 0))
+ goto check_and_exit;
+ }
+ }
+--
+2.1.0
+
--- /dev/null
+From 4c960fa90a975d20f75a1ecabd217247f1922c8f Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Wed, 4 Mar 2015 20:32:26 +0000
+Subject: [PATCH 56/57] New version of contrib/reverse-dns
+
+---
+ contrib/reverse-dns/README | 22 +++---
+ contrib/reverse-dns/reverse_replace.sh | 131 ++++++++++++++++++++++++++++-----
+ 2 files changed, 125 insertions(+), 28 deletions(-)
+
+diff --git a/contrib/reverse-dns/README b/contrib/reverse-dns/README
+index f87eb77c4c22..2ec4df1f957e 100644
+--- a/contrib/reverse-dns/README
++++ b/contrib/reverse-dns/README
+@@ -1,18 +1,18 @@
+-Hi.\r
++The script reads stdin and replaces all IP addresses with names before\r
++outputting it again. IPs from private networks are reverse looked up\r
++via dns. Other IP adresses are searched for in the dnsmasq query log.\r
++This gives names (CNAMEs if I understand DNS correctly) that are closer\r
++to the name the client originally asked for then the names obtained by\r
++reverse lookup. Just run\r
+ \r
+-To translate my routers netstat-nat output into names that actually talk\r
+-to me I have started writing to simple shell scripts. They require \r
++netstat -n -4 | ./reverse_replace.sh \r
++\r
++to see what it does. It needs \r
+ \r
+ log-queries\r
+ log-facility=/var/log/dnsmasq.log\r
+ \r
+-to be set. With\r
+-\r
+-netstat-nat -n -4 | reverse_replace.sh \r
+-\r
+-I get retranslated output.\r
+-\r
+-Sincerely,\r
+-Joachim\r
++in the dnsmasq configuration.\r
+ \r
++The script runs on debian (with ash installed) and on busybox.\r
+ \r
+diff --git a/contrib/reverse-dns/reverse_replace.sh b/contrib/reverse-dns/reverse_replace.sh
+index a11c164b7f19..5b4aebd71456 100644
+--- a/contrib/reverse-dns/reverse_replace.sh
++++ b/contrib/reverse-dns/reverse_replace.sh
+@@ -1,28 +1,125 @@
+-#!/bin/bash
+-# $Id: reverse_replace.sh 4 2015-02-17 20:14:59Z jo $
++#!/bin/ash
++# $Id: reverse_replace.sh 18 2015-03-01 16:12:35Z jo $
+ #
+ # Usage e.g.: netstat -n -4 | reverse_replace.sh
+ # Parses stdin for IP4 addresses and replaces them
+-# with names retrieved by reverse_dns.sh
++# with names retrieved by parsing the dnsmasq log.
++# This currently only gives CNAMEs. But these
++# usually tell ou more than the mones from reverse
++# lookups.
++#
++# This has been tested on debian and asuswrt. Plese
++# report successful tests on other platforms.
++#
++# Author: Joachim Zobel <jz-2014@heute-morgen.de>
++# License: Consider this MIT style licensed. You can
++# do as you ike, but you must not remove my name.
+ #
+
+-DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+-DNS=$DIR/reverse_dns.sh
++LOG=/var/log/dnsmasq.log
++MAX_LINES=15000
+
+-# sed regex
++# sed regex do match IPs
+ IP_regex='[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
++# private IP ranges
++IP_private='\(^127\.\)\|\(^192\.168\.\)\|\(^10\.\)\|\(^172\.1[6-9]\.\)\|\(^172\.2[0-9]\.\)\|\(^172\.3[0-1]\.\)'
+
+-while read LINE; do
+- if grep --quiet $IP_regex <<< "$LINE"; then
+- IPs=`sed "s#.*\b\($IP_regex\)\b.*#\1 #g" <<< "$LINE"`
+- IPs=($IPs)
+- for IP in "${IPs[@]}"
+- do
+- NAME=`$DNS $IP`
+- # echo "$NAME is $IP";
+- LINE="${LINE/$IP/$NAME}"
+- done
++#######################################################################
++# Find Commands
++
++HOST=nslookup
++if type host > /dev/null 2>&1; then
++ # echo "No need for nslookup, host is there"
++ HOST=host
++fi
++
++#######################################################################
++# Functions
++
++# Use shell variables for an (IP) lookup table
++create_lookup_table()
++{
++ # Parse log into lookup table
++ local CMDS="$( tail -"$MAX_LINES" "$LOG" | \
++ grep " is $IP_regex" | \
++ sed "s#.* \([^ ]*\) is \($IP_regex\).*#set_val \2 \1;#" )"
++
++ local IFS='
++'
++ for CMD in $CMDS
++ do
++ eval $CMD
++ done
++}
++
++set_val()
++{
++ local _IP=$(echo $1 | tr . _)
++ local KEY="__IP__$_IP"
++ eval "$KEY"=$2
++}
++
++get_val()
++{
++ local _IP=$(echo $1 | tr . _)
++ local KEY="__IP__$_IP"
++ eval echo -n '${'"$KEY"'}'
++}
++
++dns_lookup()
++{
++ local IP=$1
++
++ local RTN="$($HOST $IP | \
++ sed 's#\s\+#\n#g' | \
++ grep -v '^$' | \
++ tail -1 | tr -d '\n' | \
++ sed 's#\.$##')"
++ if echo $RTN | grep -q NXDOMAIN; then
++ echo -n $IP
++ else
++ echo -n "$RTN"
++ fi
++}
++
++reverse_dns()
++{
++ local IP=$1
++
++ # Skip if it is not an IP
++ if ! echo $IP | grep -q "^$IP_regex$"; then
++ echo -n $IP
++ return
++ fi
++
++ # Do a dns lookup, if it is a local IP
++ if echo $IP | grep -q $IP_private; then
++ dns_lookup $IP
++ return
+ fi
++
++ local NAME="$(get_val $IP)"
++
++ if [ -z "$NAME" ]; then
++ echo -n $IP
++ else
++ echo -n $NAME
++ fi
++}
++
++#######################################################################
++# Main
++create_lookup_table
++
++while read LINE; do
++ for IP in $(echo "$LINE" | \
++ sed "s#\b\($IP_regex\)\b#\n\1\n#g" | \
++ grep $IP_regex)
++ do
++ NAME=`reverse_dns $IP `
++ # echo "$NAME $IP"
++ LINE=`echo "$LINE" | sed "s#$IP#$NAME#" `
++ done
+ echo $LINE
+-done < /dev/stdin
++done
+
+--
+2.1.0
+
--- /dev/null
+From 360f2513ab12a9bf1e262d388dd2ea8a566590a3 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sat, 7 Mar 2015 18:28:06 +0000
+Subject: [PATCH 57/57] Tweak DNSSEC timestamp code to create file later,
+ removing need to chown it.
+
+---
+ man/dnsmasq.8 | 3 ++-
+ src/dnsmasq.c | 35 ++++++++++++++++++++++-------------
+ src/dnsmasq.h | 3 ++-
+ src/dnssec.c | 18 ++++++++++--------
+ 4 files changed, 36 insertions(+), 23 deletions(-)
+
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 097e7d75145c..2db780d90987 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -678,7 +678,8 @@ which have not been throughly checked.
+ Enables an alternative way of checking the validity of the system time for DNSSEC (see --dnssec-no-timecheck). In this case, the
+ system time is considered to be valid once it becomes later than the timestamp on the specified file. The file is created and
+ its timestamp set automatically by dnsmasq. The file must be stored on a persistent filesystem, so that it and its mtime are carried
+-over system restarts.
++over system restarts. The timestamp file is created after dnsmasq has dropped root, so it must be in a location writable by the
++unprivileged user that dnsmasq runs as.
+ .TP
+ .B --proxy-dnssec
+ Copy the DNSSEC Authenticated Data bit from upstream servers to downstream clients and cache it. This is an
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index 9e05c0e31569..f3e5bcffec4f 100644
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -58,9 +58,6 @@ int main (int argc, char **argv)
+ struct dhcp_context *context;
+ struct dhcp_relay *relay;
+ #endif
+-#ifdef HAVE_DNSSEC
+- int badtime;
+-#endif
+
+ #ifdef LOCALEDIR
+ setlocale(LC_ALL, "");
+@@ -156,10 +153,10 @@ int main (int argc, char **argv)
+ {
+ #ifdef HAVE_DNSSEC
+ if (!daemon->ds)
+- die(_("No trust anchors provided for DNSSEC"), NULL, EC_BADCONF);
++ die(_("no trust anchors provided for DNSSEC"), NULL, EC_BADCONF);
+
+ if (daemon->cachesize < CACHESIZ)
+- die(_("Cannot reduce cache size from default when DNSSEC enabled"), NULL, EC_BADCONF);
++ die(_("cannot reduce cache size from default when DNSSEC enabled"), NULL, EC_BADCONF);
+ #else
+ die(_("DNSSEC not available: set HAVE_DNSSEC in src/config.h"), NULL, EC_BADCONF);
+ #endif
+@@ -172,10 +169,10 @@ int main (int argc, char **argv)
+
+ #ifdef HAVE_CONNTRACK
+ if (option_bool(OPT_CONNTRACK) && (daemon->query_port != 0 || daemon->osport))
+- die (_("Cannot use --conntrack AND --query-port"), NULL, EC_BADCONF);
++ die (_("cannot use --conntrack AND --query-port"), NULL, EC_BADCONF);
+ #else
+ if (option_bool(OPT_CONNTRACK))
+- die(_("Conntrack support not available: set HAVE_CONNTRACK in src/config.h"), NULL, EC_BADCONF);
++ die(_("conntrack support not available: set HAVE_CONNTRACK in src/config.h"), NULL, EC_BADCONF);
+ #endif
+
+ #ifdef HAVE_SOLARIS_NETWORK
+@@ -195,7 +192,7 @@ int main (int argc, char **argv)
+
+ #ifndef HAVE_LOOP
+ if (option_bool(OPT_LOOP_DETECT))
+- die(_("Loop detection not available: set HAVE_LOOP in src/config.h"), NULL, EC_BADCONF);
++ die(_("loop detection not available: set HAVE_LOOP in src/config.h"), NULL, EC_BADCONF);
+ #endif
+
+ now = dnsmasq_time();
+@@ -373,10 +370,6 @@ int main (int argc, char **argv)
+ if (baduser)
+ die(_("unknown user or group: %s"), baduser, EC_BADCONF);
+
+-#ifdef HAVE_DNSSEC
+- badtime = setup_timestamp(ent_pw);
+-#endif
+-
+ /* implement group defaults, "dip" if available, or group associated with uid */
+ if (!daemon->group_set && !gp)
+ {
+@@ -693,10 +686,23 @@ int main (int argc, char **argv)
+ #ifdef HAVE_DNSSEC
+ if (option_bool(OPT_DNSSEC_VALID))
+ {
++ int rc;
++
++ /* Delay creating the timestamp file until here, after we've changed user, so that
++ it has the correct owner to allow updating the mtime later.
++ This means we have to report fatal errors via the pipe. */
++ if ((rc = setup_timestamp()) == -1)
++ {
++ send_event(err_pipe[1], EVENT_TIME_ERR, errno, daemon->timestamp_file);
++ _exit(0);
++ }
++
+ my_syslog(LOG_INFO, _("DNSSEC validation enabled"));
++
+ if (option_bool(OPT_DNSSEC_TIME))
+ my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until first cache reload"));
+- if (badtime)
++
++ if (rc == 1)
+ my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until system time valid"));
+ }
+ #endif
+@@ -1170,6 +1176,9 @@ static void fatal_event(struct event_desc *ev, char *msg)
+
+ case EVENT_TFTP_ERR:
+ die(_("TFTP directory %s inaccessible: %s"), msg, EC_FILE);
++
++ case EVENT_TIME_ERR:
++ die(_("cannot create timestamp file %s: %s" ), msg, EC_BADCONF);
+ }
+ }
+
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index a451cb4dd03c..fc7259881358 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -167,6 +167,7 @@ struct event_desc {
+ #define EVENT_INIT 21
+ #define EVENT_NEWADDR 22
+ #define EVENT_NEWROUTE 23
++#define EVENT_TIME_ERR 24
+
+ /* Exit codes. */
+ #define EC_GOOD 0
+@@ -1152,7 +1153,7 @@ int dnssec_chase_cname(time_t now, struct dns_header *header, size_t plen, char
+ int dnskey_keytag(int alg, int flags, unsigned char *rdata, int rdlen);
+ size_t filter_rrsigs(struct dns_header *header, size_t plen);
+ unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name);
+-int setup_timestamp(struct passwd *ent_pw);
++int setup_timestamp(void);
+
+ /* util.c */
+ void rand_init(void);
+diff --git a/src/dnssec.c b/src/dnssec.c
+index c60eacf73c6b..ad0d6f072ba2 100644
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -397,18 +397,21 @@ static int serial_compare_32(unsigned long s1, unsigned long s2)
+
+ /* Called at startup. If the timestamp file is configured and exists, put its mtime on
+ timestamp_time. If it doesn't exist, create it, and set the mtime to 1-1-2015.
+- Change the ownership to the user we'll be running as, so that we can update the mtime.
++ return -1 -> Cannot create file.
++ 0 -> not using timestamp, or timestamp exists and is in past.
++ 1 -> timestamp exists and is in future.
+ */
++
+ static time_t timestamp_time;
+ static int back_to_the_future;
+
+-int setup_timestamp(struct passwd *ent_pw)
++int setup_timestamp(void)
+ {
+ struct stat statbuf;
+
+ back_to_the_future = 0;
+
+- if (!option_bool(OPT_DNSSEC_VALID) || !daemon->timestamp_file)
++ if (!daemon->timestamp_file)
+ return 0;
+
+ if (stat(daemon->timestamp_file, &statbuf) != -1)
+@@ -428,7 +431,8 @@ int setup_timestamp(struct passwd *ent_pw)
+
+ if (errno == ENOENT)
+ {
+- int fd = open(daemon->timestamp_file, O_WRONLY | O_CREAT | O_NONBLOCK, 0666);
++ /* NB. for explanation of O_EXCL flag, see comment on pidfile in dnsmasq.c */
++ int fd = open(daemon->timestamp_file, O_WRONLY | O_CREAT | O_NONBLOCK | O_EXCL, 0666);
+ if (fd != -1)
+ {
+ struct utimbuf timbuf;
+@@ -436,14 +440,12 @@ int setup_timestamp(struct passwd *ent_pw)
+ close(fd);
+
+ timestamp_time = timbuf.actime = timbuf.modtime = 1420070400; /* 1-1-2015 */
+- if (utime(daemon->timestamp_file, &timbuf) == 0 &&
+- (!ent_pw || getuid() != 0 || chown(daemon->timestamp_file, ent_pw->pw_uid, -1) == 0))
++ if (utime(daemon->timestamp_file, &timbuf) == 0)
+ goto check_and_exit;
+ }
+ }
+
+- die(_("Cannot create timestamp file %s: %s" ), daemon->timestamp_file, EC_BADCONF);
+- return 0;
++ return -1;
+ }
+
+ /* Check whether today/now is between date_start and date_end */
+--
+2.1.0
+
+++ /dev/null
-From 800c5cc1e7438818fd80f08c2d472df249a6942d Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Mon, 15 Dec 2014 17:50:15 +0000
-Subject: [PATCH] Remove floor on EDNS0 packet size with DNSSEC.
-
----
- src/dnsmasq.c | 5 -----
- 1 files changed, 5 deletions(-)
-
-diff --git a/src/dnsmasq.c b/src/dnsmasq.c
-index bf2e25a..5c7750d 100644
---- a/src/dnsmasq.c
-+++ b/src/dnsmasq.c
-@@ -87,11 +87,6 @@ int main (int argc, char **argv)
-
- if (daemon->edns_pktsz < PACKETSZ)
- daemon->edns_pktsz = PACKETSZ;
--#ifdef HAVE_DNSSEC
-- /* Enforce min packet big enough for DNSSEC */
-- if (option_bool(OPT_DNSSEC_VALID) && daemon->edns_pktsz < EDNS_PKTSZ)
-- daemon->edns_pktsz = EDNS_PKTSZ;
--#endif
-
- daemon->packet_buff_sz = daemon->edns_pktsz > DNSMASQ_PACKETSZ ?
- daemon->edns_pktsz : DNSMASQ_PACKETSZ;
---
-1.7.10.4
-
+++ /dev/null
-From a9401d9542fae575d9ce2bb534cd4e598e9c7b8e Mon Sep 17 00:00:00 2001
-From: Michael Tremer <michael.tremer@ipfire.org>
-Date: Tue, 28 Oct 2014 21:14:41 +0100
-Subject: [PATCH 1/3] bogomips: Don't crash when no bogomips are available
-
-The RPi doesn't provide bogomips in /proc/cpuinfo any more
-and fireinfo crashed when trying to read that file
----
- src/fireinfo/cpu.py | 14 +++++++++-----
- src/fireinfo/system.py | 4 +++-
- 2 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/fireinfo/cpu.py b/src/fireinfo/cpu.py
-index 32d885db8124..541575af6bbb 100644
---- a/src/fireinfo/cpu.py
-+++ b/src/fireinfo/cpu.py
-@@ -80,12 +80,16 @@ class CPU(object):
- """
- Return the bogomips of this CPU.
- """
-- try:
-- bogomips = self.__cpuinfo["bogomips"]
-- except KeyError:
-- bogomips = self.__cpuinfo["BogoMIPS"]
-+ bogomips = None
-+
-+ for key in ("bogomips", "BogoMIPS"):
-+ try:
-+ bogomips = self.__cpuinfo[key]
-+ except KeyError:
-+ continue
-
-- return float(bogomips)
-+ if bogomips:
-+ return float(bogomips)
-
- @property
- def model(self):
-diff --git a/src/fireinfo/system.py b/src/fireinfo/system.py
-index 8e903e8e3449..890f58c05027 100644
---- a/src/fireinfo/system.py
-+++ b/src/fireinfo/system.py
-@@ -144,12 +144,14 @@ class System(object):
- "model_string" : self.cpu.model_string,
- "stepping" : self.cpu.stepping,
- "flags" : self.cpu.flags,
-- "bogomips" : self.cpu.bogomips,
- "speed" : self.cpu.speed,
- "family" : self.cpu.family,
- "count" : self.cpu.count
- }
-
-+ if self.cpu.bogomips:
-+ p["bogomips"] = self.cpu.bogomips
-+
- p["network"] = {
- "green" : self.network.has_green(),
- "blue" : self.network.has_blue(),
---
-1.9.3
-
+++ /dev/null
-From b9a068e26261007d4a0592fcb47f82658af2c775 Mon Sep 17 00:00:00 2001
-From: Michael Tremer <michael.tremer@ipfire.org>
-Date: Mon, 3 Nov 2014 21:33:45 +0100
-Subject: [PATCH 2/3] ARM: Read board model from device-tree in /proc
-
----
- src/fireinfo/system.py | 35 +++++++++--------------------------
- 1 file changed, 9 insertions(+), 26 deletions(-)
-
-diff --git a/src/fireinfo/system.py b/src/fireinfo/system.py
-index 890f58c05027..195832e9f7eb 100644
---- a/src/fireinfo/system.py
-+++ b/src/fireinfo/system.py
-@@ -304,27 +304,6 @@ class System(object):
- """
- return read_from_file("/sys/class/dmi/id/bios_vendor")
-
-- def vendor_model_tuple(self):
-- try:
-- s = self.__cpuinfo["Hardware"]
-- except KeyError:
-- return (None, None)
--
-- if s.startswith("ARM-Versatile"):
-- return ("ARM", s)
--
-- try:
-- v, m = s.split(" ", 1)
-- except ValueError:
-- if s.startswith("BCM"):
-- v = "Broadcom"
-- m = s
-- else:
-- v = None
-- m = s
--
-- return v, m
--
- @property
- def vendor(self):
- """
-@@ -337,8 +316,10 @@ class System(object):
- break
-
- if ret is None:
-- v, m = self.vendor_model_tuple()
-- ret = v
-+ try:
-+ return self.__cpuinfo["Hardware"]
-+ except KeyError:
-+ pass
-
- return ret
-
-@@ -353,9 +334,11 @@ class System(object):
- if ret:
- break
-
-- if ret is None:
-- v, m = self.vendor_model_tuple()
-- ret = m
-+ # Read device-tree model if available
-+ ret = read_from_file("/proc/device-tree/model")
-+ if ret:
-+ # replace the NULL byte with which the DT string ends
-+ ret = ret.replace(u"\u0000", "")
-
- return ret
-
---
-1.9.3
-
+++ /dev/null
-From 810fe43289f5b003cbf80ebb1d9a79f52a767cdb Mon Sep 17 00:00:00 2001
-From: Michael Tremer <michael.tremer@ipfire.org>
-Date: Mon, 15 Dec 2014 22:48:26 +0100
-Subject: [PATCH 3/3] Revert vendor/model for ARM to old behaviour
-
----
- src/fireinfo/system.py | 33 +++++++++++++++++++++++++++++----
- 1 file changed, 29 insertions(+), 4 deletions(-)
-
-diff --git a/src/fireinfo/system.py b/src/fireinfo/system.py
-index 195832e9f7eb..ce33837af747 100644
---- a/src/fireinfo/system.py
-+++ b/src/fireinfo/system.py
-@@ -304,6 +304,27 @@ class System(object):
- """
- return read_from_file("/sys/class/dmi/id/bios_vendor")
-
-+ def vendor_model_tuple(self):
-+ try:
-+ s = self.__cpuinfo["Hardware"]
-+ except KeyError:
-+ return (None, None)
-+
-+ if s.startswith("ARM-Versatile"):
-+ return ("ARM", s)
-+
-+ try:
-+ v, m = s.split(" ", 1)
-+ except ValueError:
-+ if s.startswith("BCM"):
-+ v = "Broadcom"
-+ m = s
-+ else:
-+ v = None
-+ m = s
-+
-+ return v, m
-+
- @property
- def vendor(self):
- """
-@@ -316,10 +337,10 @@ class System(object):
- break
-
- if ret is None:
-- try:
-- return self.__cpuinfo["Hardware"]
-- except KeyError:
-- pass
-+ if os.path.exists("/proc/device-tree"):
-+ ret = self.__cpuinfo.get("Hardware", None)
-+ else:
-+ ret, m = self.vendor_model_tuple()
-
- return ret
-
-@@ -340,6 +361,10 @@ class System(object):
- # replace the NULL byte with which the DT string ends
- ret = ret.replace(u"\u0000", "")
-
-+ # Fall back to read /proc/cpuinfo
-+ if not ret:
-+ v, ret = self.vendor_model_tuple()
-+
- return ret
-
- @property
---
-1.9.3
-
--- /dev/null
+commit 48b67d71ec677d1b3168e52a68b644784cead604
+Author: Andreas Schwab <schwab@redhat.com>
+Date: Wed Sep 14 12:12:25 2011 +0200
+
+ Also relocate in dependency order when doing symbol dependency testing
+
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 764140d..324d979 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -2027,24 +2027,21 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+ {
+ /* We have to do symbol dependency testing. */
+ struct relocate_args args;
+- struct link_map *l;
++ unsigned int i;
+
+ args.reloc_mode = GLRO(dl_lazy) ? RTLD_LAZY : 0;
+
+- l = main_map;
+- while (l->l_next != NULL)
+- l = l->l_next;
+- do
++ i = main_map->l_searchlist.r_nlist;
++ while (i-- > 0)
+ {
++ struct link_map *l = main_map->l_initfini[i];
+ if (l != &GL(dl_rtld_map) && ! l->l_faked)
+ {
+ args.l = l;
+ _dl_receive_error (print_unresolved, relocate_doit,
+ &args);
+ }
+- l = l->l_prev;
+ }
+- while (l != NULL);
+
+ if ((GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
+ && rtld_multiple_ref)
--- /dev/null
+commit 4d653a59ffeae0f46f76a40230e2cfa9587b7e7e
+Author: Siddhesh Poyarekar <siddhesh@redhat.com>
+Date: Fri May 30 22:43:52 2014 +0530
+
+ Add mmap usage in malloc_info output
+
+ The current malloc_info xml output only has information about
+ allocations on the heap. Display information about number of mappings
+ and total mmapped size to this to complete the picture.
+
+diff -pruN a/malloc/malloc.c b/malloc/malloc.c
+--- a/malloc/malloc.c 2014-06-02 07:35:22.573256155 +0530
++++ b/malloc/malloc.c 2014-06-02 07:34:58.856257177 +0530
+@@ -6553,12 +6553,14 @@ malloc_info (int options, FILE *fp)
+ fprintf (fp,
+ "<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
+ "<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
++ "<total type=\"mmap\" count=\"%d\" size=\"%zu\"/>\n"
+ "<system type=\"current\" size=\"%zu\"/>\n"
+ "<system type=\"max\" size=\"%zu\"/>\n"
+ "<aspace type=\"total\" size=\"%zu\"/>\n"
+ "<aspace type=\"mprotect\" size=\"%zu\"/>\n"
+ "</malloc>\n",
+ total_nfastblocks, total_fastavail, total_nblocks, total_avail,
++ mp_.n_mmaps, mp_.mmapped_mem,
+ total_system, total_max_system,
+ total_aspace, total_aspace_mprotect);
+
--- /dev/null
+commit 028478fa40d85a73b19638dbe3f83b1acebf370c
+Author: Ulrich Drepper <drepper@gmail.com>
+Date: Thu Mar 10 12:51:33 2011 -0500
+
+ Fix copy relocations handling of unique objects.
+
+ 2011-03-06 Ulrich Drepper <drepper@gmail.com>
+
+and a part of:
+
+commit 33f85a3fb9fe432e0ebf6a3481bc2d5e29cb605f
+Author: Ulrich Drepper <drepper@gmail.com>
+Date: Thu Mar 10 03:18:21 2011 -0500
+
+ Don't run tests checking xecutable stack when SELinux is enforcing.
+
+since the latter incorrectly had a bit of the former changes.
+
+Additionally, the test case needs -lstdc++ to build.
+
+diff --git a/elf/Makefile b/elf/Makefile
+index c427679..56cb1b1 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -201,7 +201,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
+ unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
+ tst-audit1 tst-audit2 tst-audit9 \
+ tst-stackguard1 tst-addr1 tst-thrlock \
+- tst-unique1 tst-unique2
++ tst-unique1 tst-unique2 tst-unique3
+ # reldep9
+ test-srcs = tst-pathopt
+ tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
+@@ -255,6 +255,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
+ order2mod1 order2mod2 order2mod3 order2mod4 \
+ tst-unique1mod1 tst-unique1mod2 \
+ tst-unique2mod1 tst-unique2mod2 \
++ tst-unique3lib tst-unique3lib2 \
+ tst-auditmod9a tst-auditmod9b
+ ifeq (yes,$(have-initfini-array))
+ modules-names += tst-array2dep tst-array5dep
+@@ -1178,6 +1179,11 @@ $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \
+ $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so
+ $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so
+
++LDLIBS-tst-unique3lib.so = -lstdc++
++LDLIBS-tst-unique3lib2.so = -lstdc++
++$(objpfx)tst-unique3: $(libdl) $(objpfx)tst-unique3lib.so
++$(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so
++
+ ifeq (yes,$(config-cflags-avx))
+ CFLAGS-tst-audit4.c += -mavx
+ CFLAGS-tst-auditmod4a.c += -mavx
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 78c8669..874a4bb 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -364,8 +363,19 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
+ if (entries[idx].hashval == new_hash
+ && strcmp (entries[idx].name, undef_name) == 0)
+ {
+- result->s = entries[idx].sym;
+- result->m = (struct link_map *) entries[idx].map;
++ if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
++ {
++ /* We possibly have to initialize the central
++ copy from the copy addressed through the
++ relocation. */
++ result->s = sym;
++ result->m = (struct link_map *) map;
++ }
++ else
++ {
++ result->s = entries[idx].sym;
++ result->m = (struct link_map *) entries[idx].map;
++ }
+ __rtld_lock_unlock_recursive (tab->lock);
+ return 1;
+ }
+diff --git a/elf/tst-unique3.cc b/elf/tst-unique3.cc
+new file mode 100644
+index 0000000..b2c9593
+--- /dev/null
++++ b/elf/tst-unique3.cc
+@@ -0,0 +1,23 @@
++#include "tst-unique3.h"
++#include <cstdio>
++#include "../dlfcn/dlfcn.h"
++
++int t = S<char>::i;
++
++int
++main (void)
++{
++ std::printf ("%d %d\n", S<char>::i, t);
++ int result = S<char>::i++ != 1 || t != 1;
++ result |= in_lib ();
++ void *d = dlopen ("$ORIGIN/tst-unique3lib2.so", RTLD_LAZY);
++ int (*fp) ();
++ if (d == NULL || (fp = (int(*)()) dlsym (d, "in_lib2")) == NULL)
++ {
++ std::printf ("failed to get symbol in_lib2\n");
++ return 1;
++ }
++ result |= fp ();
++ dlclose (d);
++ return result;
++}
+diff --git a/elf/tst-unique3.h b/elf/tst-unique3.h
+new file mode 100644
+index 0000000..716d236
+--- /dev/null
++++ b/elf/tst-unique3.h
+@@ -0,0 +1,8 @@
++// BZ 12510
++template<typename T>
++struct S
++{
++ static int i;
++};
++
++extern int in_lib (void);
+diff --git a/elf/tst-unique3lib.cc b/elf/tst-unique3lib.cc
+new file mode 100644
+index 0000000..fa8e85a
+--- /dev/null
++++ b/elf/tst-unique3lib.cc
+@@ -0,0 +1,11 @@
++#include <cstdio>
++#include "tst-unique3.h"
++template<typename T> int S<T>::i = 1;
++static int i = S<char>::i;
++
++int
++in_lib (void)
++{
++ std::printf ("in_lib: %d %d\n", S<char>::i, i);
++ return S<char>::i++ != 2 || i != 1;
++}
+diff --git a/elf/tst-unique3lib2.cc b/elf/tst-unique3lib2.cc
+new file mode 100644
+index 0000000..17d817e
+--- /dev/null
++++ b/elf/tst-unique3lib2.cc
+@@ -0,0 +1,12 @@
++#include <cstdio>
++#include "tst-unique3.h"
++
++template<typename T> int S<T>::i;
++
++extern "C"
++int
++in_lib2 ()
++{
++ std::printf ("in_lib2: %d\n", S<char>::i);
++ return S<char>::i != 3;
++}
+diff --git a/include/bits/dlfcn.h b/include/bits/dlfcn.h
+index cb4a5c2..c31a645 100644
+--- a/include/bits/dlfcn.h
++++ b/include/bits/dlfcn.h
+@@ -1,4 +1,3 @@
+ #include_next <bits/dlfcn.h>
+
+-extern void _dl_mcount_wrapper_check (void *__selfpc);
+ libc_hidden_proto (_dl_mcount_wrapper_check)
--- /dev/null
+commit 7cbcdb3699584db8913ca90f705d6337633ee10f
+Author: Siddhesh Poyarekar <siddhesh@redhat.com>
+Date: Fri Oct 25 10:22:12 2013 +0530
+
+ Fix stack overflow due to large AF_INET6 requests
+
+ Resolves #16072 (CVE-2013-4458).
+
+ This patch fixes another stack overflow in getaddrinfo when it is
+ called with AF_INET6. The AF_UNSPEC case was fixed as CVE-2013-1914,
+ but the AF_INET6 case went undetected back then.
+
+commit 91ce40854d0b7f865cf5024ef95a8026b76096f3
+Author: Florian Weimer <fweimer@redhat.com>
+Date: Fri Aug 16 09:38:52 2013 +0200
+
+ CVE-2013-4237, BZ #14699: Buffer overflow in readdir_r
+
+ * sysdeps/posix/dirstream.h (struct __dirstream): Add errcode
+ member.
+ * sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode
+ member.
+ * sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member.
+ * sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit.
+ Return delayed error code. Remove GETDENTS_64BIT_ALIGNED
+ conditional.
+ * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define
+ GETDENTS_64BIT_ALIGNED.
+ * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
+ * manual/filesys.texi (Reading/Closing Directory): Document
+ ENAMETOOLONG return value of readdir_r. Recommend readdir more
+ strongly.
+ * manual/conf.texi (Limits for Files): Add portability note to
+ NAME_MAX, PATH_MAX.
+ (Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX.
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index e6ce4cf..8ff74b4 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -197,7 +197,22 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
+ &rc, &herrno, NULL, &localcanon)); \
+ if (rc != ERANGE || herrno != NETDB_INTERNAL) \
+ break; \
+- tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen); \
++ if (!malloc_tmpbuf && __libc_use_alloca (alloca_used + 2 * tmpbuflen)) \
++ tmpbuf = extend_alloca_account (tmpbuf, tmpbuflen, 2 * tmpbuflen, \
++ alloca_used); \
++ else \
++ { \
++ char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL, \
++ 2 * tmpbuflen); \
++ if (newp == NULL) \
++ { \
++ result = -EAI_MEMORY; \
++ goto free_and_return; \
++ } \
++ tmpbuf = newp; \
++ malloc_tmpbuf = true; \
++ tmpbuflen = 2 * tmpbuflen; \
++ } \
+ } \
+ if (status == NSS_STATUS_SUCCESS && rc == 0) \
+ h = &th; \
+@@ -209,7 +224,8 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
+ { \
+ __set_h_errno (herrno); \
+ _res.options = old_res_options; \
+- return -EAI_SYSTEM; \
++ result = -EAI_SYSTEM; \
++ goto free_and_return; \
+ } \
+ if (herrno == TRY_AGAIN) \
+ no_data = EAI_AGAIN; \
+
+diff --git a/manual/conf.texi b/manual/conf.texi
+index 7eb8b36..c720063 100644
+--- a/manual/conf.texi
++++ b/manual/conf.texi
+@@ -1149,6 +1149,9 @@ typed ahead as input. @xref{I/O Queues}.
+ @comment POSIX.1
+ @deftypevr Macro int NAME_MAX
+ The uniform system limit (if any) for the length of a file name component.
++
++@strong{Portability Note:} On some systems, the GNU C Library defines
++@code{NAME_MAX}, but does not actually enforce this limit.
+ @end deftypevr
+
+ @comment limits.h
+@@ -1157,6 +1160,9 @@ including the terminating null character.
+ @deftypevr Macro int PATH_MAX
+ The uniform system limit (if any) for the length of an entire file name (that
+ is, the argument given to system calls such as @code{open}).
++
++@strong{Portability Note:} The GNU C Library does not enforce this limit
++even if @code{PATH_MAX} is defined.
+ @end deftypevr
+
+ @cindex limits, pipe buffer size
+@@ -1476,6 +1482,9 @@ Inquire about the value of @code{POSIX_REC_MIN_XFER_SIZE}.
+ Inquire about the value of @code{POSIX_REC_XFER_ALIGN}.
+ @end table
+
++@strong{Portability Note:} On some systems, the GNU C Library does not
++enforce @code{_PC_NAME_MAX} or @code{_PC_PATH_MAX} limits.
++
+ @node Utility Limits
+ @section Utility Program Capacity Limits
+
+diff --git a/manual/filesys.texi b/manual/filesys.texi
+index 1df9cf2..814c210 100644
+--- a/manual/filesys.texi
++++ b/manual/filesys.texi
+@@ -444,9 +444,9 @@ symbols are declared in the header file @file{dirent.h}.
+ @comment POSIX.1
+ @deftypefun {struct dirent *} readdir (DIR *@var{dirstream})
+ This function reads the next entry from the directory. It normally
+-returns a pointer to a structure containing information about the file.
+-This structure is statically allocated and can be rewritten by a
+-subsequent call.
++returns a pointer to a structure containing information about the
++file. This structure is associated with the @var{dirstream} handle
++and can be rewritten by a subsequent call.
+
+ @strong{Portability Note:} On some systems @code{readdir} may not
+ return entries for @file{.} and @file{..}, even though these are always
+@@ -461,19 +461,61 @@ conditions are defined for this function:
+ The @var{dirstream} argument is not valid.
+ @end table
+
+-@code{readdir} is not thread safe. Multiple threads using
+-@code{readdir} on the same @var{dirstream} may overwrite the return
+-value. Use @code{readdir_r} when this is critical.
++To distinguish between an end-of-directory condition or an error, you
++must set @code{errno} to zero before calling @code{readdir}. To avoid
++entering an infinite loop, you should stop reading from the directory
++after the first error.
++
++In POSIX.1-2008, @code{readdir} is not thread-safe. In the GNU C Library
++implementation, it is safe to call @code{readdir} concurrently on
++different @var{dirstream}s, but multiple threads accessing the same
++@var{dirstream} result in undefined behavior. @code{readdir_r} is a
++fully thread-safe alternative, but suffers from poor portability (see
++below). It is recommended that you use @code{readdir}, with external
++locking if multiple threads access the same @var{dirstream}.
+ @end deftypefun
+
+ @comment dirent.h
+ @comment GNU
+ @deftypefun int readdir_r (DIR *@var{dirstream}, struct dirent *@var{entry}, struct dirent **@var{result})
+-This function is the reentrant version of @code{readdir}. Like
+-@code{readdir} it returns the next entry from the directory. But to
+-prevent conflicts between simultaneously running threads the result is
+-not stored in statically allocated memory. Instead the argument
+-@var{entry} points to a place to store the result.
++This function is a version of @code{readdir} which performs internal
++locking. Like @code{readdir} it returns the next entry from the
++directory. To prevent conflicts between simultaneously running
++threads the result is stored inside the @var{entry} object.
++
++@strong{Portability Note:} It is recommended to use @code{readdir}
++instead of @code{readdir_r} for the following reasons:
++
++@itemize @bullet
++@item
++On systems which do not define @code{NAME_MAX}, it may not be possible
++to use @code{readdir_r} safely because the caller does not specify the
++length of the buffer for the directory entry.
++
++@item
++On some systems, @code{readdir_r} cannot read directory entries with
++very long names. If such a name is encountered, the GNU C Library
++implementation of @code{readdir_r} returns with an error code of
++@code{ENAMETOOLONG} after the final directory entry has been read. On
++other systems, @code{readdir_r} may return successfully, but the
++@code{d_name} member may not be NUL-terminated or may be truncated.
++
++@item
++POSIX-1.2008 does not guarantee that @code{readdir} is thread-safe,
++even when access to the same @var{dirstream} is serialized. But in
++current implementations (including the GNU C Library), it is safe to call
++@code{readdir} concurrently on different @var{dirstream}s, so there is
++no need to use @code{readdir_r} in most multi-threaded programs. In
++the rare case that multiple threads need to read from the same
++@var{dirstream}, it is still better to use @code{readdir} and external
++synchronization.
++
++@item
++It is expected that future versions of POSIX will obsolete
++@code{readdir_r} and mandate the level of thread safety for
++@code{readdir} which is provided by the GNU C Library and other
++implementations today.
++@end itemize
+
+ Normally @code{readdir_r} returns zero and sets @code{*@var{result}}
+ to @var{entry}. If there are no more entries in the directory or an
+@@ -481,15 +523,6 @@ error is detected, @code{readdir_r} sets @code{*@var{result}} to a
+ null pointer and returns a nonzero error code, also stored in
+ @code{errno}, as described for @code{readdir}.
+
+-@strong{Portability Note:} On some systems @code{readdir_r} may not
+-return a NUL terminated string for the file name, even when there is no
+-@code{d_reclen} field in @code{struct dirent} and the file
+-name is the maximum allowed size. Modern systems all have the
+-@code{d_reclen} field, and on old systems multi-threading is not
+-critical. In any case there is no such problem with the @code{readdir}
+-function, so that even on systems without the @code{d_reclen} member one
+-could use multiple threads by using external locking.
+-
+ It is also important to look at the definition of the @code{struct
+ dirent} type. Simply passing a pointer to an object of this type for
+ the second parameter of @code{readdir_r} might not be enough. Some
+diff --git a/sysdeps/unix/dirstream.h b/sysdeps/unix/dirstream.h
+index a7a074d..8e8570d 100644
+--- a/sysdeps/unix/dirstream.h
++++ b/sysdeps/unix/dirstream.h
+@@ -39,6 +39,8 @@ struct __dirstream
+
+ off_t filepos; /* Position of next entry to read. */
+
++ int errcode; /* Delayed error code. */
++
+ /* Directory block. */
+ char data[0] __attribute__ ((aligned (__alignof__ (void*))));
+ };
+diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c
+index ddfc3a7..fc05b0f 100644
+--- a/sysdeps/unix/opendir.c
++++ b/sysdeps/unix/opendir.c
+@@ -231,6 +231,7 @@ __alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp)
+ dirp->size = 0;
+ dirp->offset = 0;
+ dirp->filepos = 0;
++ dirp->errcode = 0;
+
+ return dirp;
+ }
+diff --git a/sysdeps/unix/readdir_r.c b/sysdeps/unix/readdir_r.c
+index b5a8e2e..8ed5c3f 100644
+--- a/sysdeps/unix/readdir_r.c
++++ b/sysdeps/unix/readdir_r.c
+@@ -40,6 +40,7 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
+ DIRENT_TYPE *dp;
+ size_t reclen;
+ const int saved_errno = errno;
++ int ret;
+
+ __libc_lock_lock (dirp->lock);
+
+@@ -70,10 +71,10 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
+ bytes = 0;
+ __set_errno (saved_errno);
+ }
++ if (bytes < 0)
++ dirp->errcode = errno;
+
+ dp = NULL;
+- /* Reclen != 0 signals that an error occurred. */
+- reclen = bytes != 0;
+ break;
+ }
+ dirp->size = (size_t) bytes;
+@@ -106,28 +107,46 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
+ dirp->filepos += reclen;
+ #endif
+
+- /* Skip deleted files. */
++#ifdef NAME_MAX
++ if (reclen > offsetof (DIRENT_TYPE, d_name) + NAME_MAX + 1)
++ {
++ /* The record is very long. It could still fit into the
++ caller-supplied buffer if we can skip padding at the
++ end. */
++ size_t namelen = _D_EXACT_NAMLEN (dp);
++ if (namelen <= NAME_MAX)
++ reclen = offsetof (DIRENT_TYPE, d_name) + namelen + 1;
++ else
++ {
++ /* The name is too long. Ignore this file. */
++ dirp->errcode = ENAMETOOLONG;
++ dp->d_ino = 0;
++ continue;
++ }
++ }
++#endif
++
++ /* Skip deleted and ignored files. */
+ }
+ while (dp->d_ino == 0);
+
+ if (dp != NULL)
+ {
+-#ifdef GETDENTS_64BIT_ALIGNED
+- /* The d_reclen value might include padding which is not part of
+- the DIRENT_TYPE data structure. */
+- reclen = MIN (reclen, sizeof (DIRENT_TYPE));
+-#endif
+ *result = memcpy (entry, dp, reclen);
+-#ifdef GETDENTS_64BIT_ALIGNED
++#ifdef _DIRENT_HAVE_D_RECLEN
+ entry->d_reclen = reclen;
+ #endif
++ ret = 0;
+ }
+ else
+- *result = NULL;
++ {
++ *result = NULL;
++ ret = dirp->errcode;
++ }
+
+ __libc_lock_unlock (dirp->lock);
+
+- return dp != NULL ? 0 : reclen ? errno : 0;
++ return ret;
+ }
+
+ #ifdef __READDIR_R_ALIAS
+diff --git a/sysdeps/unix/rewinddir.c b/sysdeps/unix/rewinddir.c
+index 2935a8e..d4991ad 100644
+--- a/sysdeps/unix/rewinddir.c
++++ b/sysdeps/unix/rewinddir.c
+@@ -33,5 +33,6 @@ rewinddir (dirp)
+ dirp->filepos = 0;
+ dirp->offset = 0;
+ dirp->size = 0;
++ dirp->errcode = 0;
+ __libc_lock_unlock (dirp->lock);
+ }
+diff --git a/sysdeps/unix/sysv/linux/i386/readdir64_r.c b/sysdeps/unix/sysv/linux/i386/readdir64_r.c
+index 8ebbcfd..a7d114e 100644
+--- a/sysdeps/unix/sysv/linux/i386/readdir64_r.c
++++ b/sysdeps/unix/sysv/linux/i386/readdir64_r.c
+@@ -18,7 +18,6 @@
+ #define __READDIR_R __readdir64_r
+ #define __GETDENTS __getdents64
+ #define DIRENT_TYPE struct dirent64
+-#define GETDENTS_64BIT_ALIGNED 1
+
+ #include <sysdeps/unix/readdir_r.c>
+
--- /dev/null
+commit 41488498b6d9440ee66ab033808cce8323bba7ac
+Author: Florian Weimer <fweimer@redhat.com>
+Date: Wed Sep 3 19:45:43 2014 +0200
+
+ CVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325]
+
+ These changes are based on the fix for BZ #14134 in commit
+ 6e230d11837f3ae7b375ea69d7905f0d18eb79e5.
+
+diff --git a/iconvdata/Makefile b/iconvdata/Makefile
+index 0a410a1..b6327d6 100644
+--- a/iconvdata/Makefile
++++ b/iconvdata/Makefile
+@@ -297,6 +297,7 @@ $(objpfx)tst-iconv7.out: $(objpfx)gconv-modules \
+ $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
+ $(addprefix $(objpfx),$(modules.so)) \
+ $(common-objdir)/iconv/iconv_prog TESTS
++ iconv_modules="$(modules)" \
+ $(SHELL) -e $< $(common-objdir) > $@
+
+ $(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \
+diff --git a/iconvdata/ibm1364.c b/iconvdata/ibm1364.c
+index 0b5484f..cf80993 100644
+--- a/iconvdata/ibm1364.c
++++ b/iconvdata/ibm1364.c
+@@ -221,7 +221,8 @@ enum
+ ++rp2; \
+ \
+ uint32_t res; \
+- if (__builtin_expect (ch < rp2->start, 0) \
++ if (__builtin_expect (rp2->start == 0xffff, 0) \
++ || __builtin_expect (ch < rp2->start, 0) \
+ || (res = DB_TO_UCS4[ch + rp2->idx], \
+ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
+ { \
+diff --git a/iconvdata/ibm932.c b/iconvdata/ibm932.c
+index f5dca59..aa69d65 100644
+--- a/iconvdata/ibm932.c
++++ b/iconvdata/ibm932.c
+@@ -74,11 +74,12 @@
+ } \
+ \
+ ch = (ch * 0x100) + inptr[1]; \
++ /* ch was less than 0xfd. */ \
++ assert (ch < 0xfd00); \
+ while (ch > rp2->end) \
+ ++rp2; \
+ \
+- if (__builtin_expect (rp2 == NULL, 0) \
+- || __builtin_expect (ch < rp2->start, 0) \
++ if (__builtin_expect (ch < rp2->start, 0) \
+ || (res = __ibm932db_to_ucs4[ch + rp2->idx], \
+ __builtin_expect (res, '\1') == 0 && ch !=0)) \
+ { \
+diff --git a/iconvdata/ibm933.c b/iconvdata/ibm933.c
+index f46dfb5..461fb5e 100644
+--- a/iconvdata/ibm933.c
++++ b/iconvdata/ibm933.c
+@@ -162,7 +162,7 @@ enum
+ while (ch > rp2->end) \
+ ++rp2; \
+ \
+- if (__builtin_expect (rp2 == NULL, 0) \
++ if (__builtin_expect (rp2->start == 0xffff, 0) \
+ || __builtin_expect (ch < rp2->start, 0) \
+ || (res = __ibm933db_to_ucs4[ch + rp2->idx], \
+ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
+diff --git a/iconvdata/ibm935.c b/iconvdata/ibm935.c
+index a8e4e6c..132d816 100644
+--- a/iconvdata/ibm935.c
++++ b/iconvdata/ibm935.c
+@@ -162,7 +162,7 @@ enum
+ while (ch > rp2->end) \
+ ++rp2; \
+ \
+- if (__builtin_expect (rp2 == NULL, 0) \
++ if (__builtin_expect (rp2->start == 0xffff, 0) \
+ || __builtin_expect (ch < rp2->start, 0) \
+ || (res = __ibm935db_to_ucs4[ch + rp2->idx], \
+ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
+diff --git a/iconvdata/ibm937.c b/iconvdata/ibm937.c
+index 239be61..69b154d 100644
+--- a/iconvdata/ibm937.c
++++ b/iconvdata/ibm937.c
+@@ -162,7 +162,7 @@ enum
+ while (ch > rp2->end) \
+ ++rp2; \
+ \
+- if (__builtin_expect (rp2 == NULL, 0) \
++ if (__builtin_expect (rp2->start == 0xffff, 0) \
+ || __builtin_expect (ch < rp2->start, 0) \
+ || (res = __ibm937db_to_ucs4[ch + rp2->idx], \
+ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
+diff --git a/iconvdata/ibm939.c b/iconvdata/ibm939.c
+index 5d0db36..9936e2c 100644
+--- a/iconvdata/ibm939.c
++++ b/iconvdata/ibm939.c
+@@ -162,7 +162,7 @@ enum
+ while (ch > rp2->end) \
+ ++rp2; \
+ \
+- if (__builtin_expect (rp2 == NULL, 0) \
++ if (__builtin_expect (rp2->start == 0xffff, 0) \
+ || __builtin_expect (ch < rp2->start, 0) \
+ || (res = __ibm939db_to_ucs4[ch + rp2->idx], \
+ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
+diff --git a/iconvdata/ibm943.c b/iconvdata/ibm943.c
+index be0c14f..c5d5742 100644
+--- a/iconvdata/ibm943.c
++++ b/iconvdata/ibm943.c
+@@ -75,11 +75,12 @@
+ } \
+ \
+ ch = (ch * 0x100) + inptr[1]; \
++ /* ch was less than 0xfd. */ \
++ assert (ch < 0xfd00); \
+ while (ch > rp2->end) \
+ ++rp2; \
+ \
+- if (__builtin_expect (rp2 == NULL, 0) \
+- || __builtin_expect (ch < rp2->start, 0) \
++ if (__builtin_expect (ch < rp2->start, 0) \
+ || (res = __ibm943db_to_ucs4[ch + rp2->idx], \
+ __builtin_expect (res, '\1') == 0 && ch !=0)) \
+ { \
+diff --git a/iconvdata/run-iconv-test.sh b/iconvdata/run-iconv-test.sh
+index c98c929..5dfb69f 100755
+--- a/iconvdata/run-iconv-test.sh
++++ b/iconvdata/run-iconv-test.sh
+@@ -184,6 +184,24 @@ while read utf8 from filename; do
+
+ done < TESTS2
+
++# Check for crashes in decoders.
++printf '\016\377\377\377\377\377\377\377' > $temp1
++for from in $iconv_modules ; do
++ echo $ac_n "test decoder $from $ac_c"
++ PROG=`eval echo $ICONV`
++ if $PROG < $temp1 >/dev/null 2>&1 ; then
++ : # fall through
++ else
++ status=$?
++ if test $status -gt 1 ; then
++ echo "/FAILED"
++ failed=1
++ continue
++ fi
++ fi
++ echo "OK"
++done
++
+ exit $failed
+ # Local Variables:
+ # mode:shell-script
--- /dev/null
+#
+# This is a special patch for rhel-6 to fix recursive dlopen.
+# It is likely the upstream patch will always be too risky for
+# rhel-6 and will involve reorganizing the way in which recursive
+# dlopen is allowed to operate and how the _r_debug and stap
+# points are used by gdb for the recursive case.
+#
+# This fix changes the internal API to duplicate the ldconfig
+# cache data. This means that at any point the cache can be
+# unmapped without any consequences. The caller is responsible
+# fore freeing the returned string.
+#
+# A regression test is added to verify the assertion for _r_debug
+# is no longer triggered due to the recursive dlopen. The test to
+# verify the fix in _dl_load_cache_lookup is not automated and
+# has to be run by hand.
+#
+diff -urN glibc-2.12-2-gc4ccff1/elf/dl-cache.c glibc-2.12-2-gc4ccff1.mod/elf/dl-cache.c
+--- glibc-2.12-2-gc4ccff1/elf/dl-cache.c 2010-05-04 07:27:23.000000000 -0400
++++ glibc-2.12-2-gc4ccff1.mod/elf/dl-cache.c 2014-12-10 21:54:08.801985045 -0500
+@@ -175,9 +175,12 @@
+
+
+ /* Look up NAME in ld.so.cache and return the file name stored there,
+- or null if none is found. */
+-
+-const char *
++ or null if none is found.
++ The caller is responsible for freeing the returned string. The ld.so.cache
++ may be unmapped at any time by a completing recursive dlopen and
++ this function must take care that it does not return references to
++ any data in the mapping. */
++char *
+ internal_function
+ _dl_load_cache_lookup (const char *name)
+ {
+@@ -290,7 +293,17 @@
+ && best != NULL)
+ _dl_debug_printf (" trying file=%s\n", best);
+
+- return best;
++ if (best == NULL)
++ return NULL;
++
++ /* The double copy is *required* since malloc may be interposed
++ and call dlopen itself whose completion would unmap the data
++ we are accessing. Therefore we must make the copy of the
++ mapping data without using malloc. */
++ char *temp;
++ temp = alloca (strlen (best) + 1);
++ strcpy (temp, best);
++ return strdup (temp);
+ }
+
+ #ifndef MAP_COPY
+diff -urN glibc-2.12-2-gc4ccff1/elf/dl-load.c glibc-2.12-2-gc4ccff1.mod/elf/dl-load.c
+--- glibc-2.12-2-gc4ccff1/elf/dl-load.c 2014-12-10 11:03:17.966048404 -0500
++++ glibc-2.12-2-gc4ccff1.mod/elf/dl-load.c 2014-12-10 21:47:29.319387538 -0500
+@@ -2126,7 +2126,7 @@
+ {
+ /* Check the list of libraries in the file /etc/ld.so.cache,
+ for compatibility with Linux's ldconfig program. */
+- const char *cached = _dl_load_cache_lookup (name);
++ char *cached = _dl_load_cache_lookup (name);
+
+ if (cached != NULL)
+ {
+@@ -2156,6 +2156,7 @@
+ if (memcmp (cached, dirp, system_dirs_len[cnt]) == 0)
+ {
+ /* The prefix matches. Don't use the entry. */
++ free (cached);
+ cached = NULL;
+ break;
+ }
+@@ -2172,14 +2173,9 @@
+ &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
+ LA_SER_CONFIG, &found_other_class, false);
+ if (__builtin_expect (fd != -1, 1))
+- {
+- realname = local_strdup (cached);
+- if (realname == NULL)
+- {
+- __close (fd);
+- fd = -1;
+- }
+- }
++ realname = cached;
++ else
++ free (cached);
+ }
+ }
+ }
+diff -urN glibc-2.12-2-gc4ccff1/elf/dl-open.c glibc-2.12-2-gc4ccff1.mod/elf/dl-open.c
+--- glibc-2.12-2-gc4ccff1/elf/dl-open.c 2014-12-10 11:03:18.083048497 -0500
++++ glibc-2.12-2-gc4ccff1.mod/elf/dl-open.c 2014-12-10 20:34:16.017503638 -0500
+@@ -220,7 +220,11 @@
+ }
+ }
+
+- assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
++ /* One might be tempted to assert that we are RT_CONSISTENT at this point, but that
++ may not be true if this is a recursive call to dlopen.
++ TODO: Fix all of the debug state so we end up at RT_CONSISTENT only when the last
++ recursive dlopen completes. */
++ _dl_debug_initialize (0, args->nsid);
+
+ /* Load the named object. */
+ struct link_map *new;
+diff -urN glibc-2.12-2-gc4ccff1/sysdeps/generic/ldsodefs.h glibc-2.12-2-gc4ccff1.mod/sysdeps/generic/ldsodefs.h
+--- glibc-2.12-2-gc4ccff1/sysdeps/generic/ldsodefs.h 2014-12-10 11:03:17.944048387 -0500
++++ glibc-2.12-2-gc4ccff1.mod/sysdeps/generic/ldsodefs.h 2014-12-10 21:46:14.071344018 -0500
+@@ -996,8 +996,8 @@
+ internal_function;
+
+ /* Look up NAME in ld.so.cache and return the file name stored there,
+- or null if none is found. */
+-extern const char *_dl_load_cache_lookup (const char *name)
++ or null if none is found. Caller must free returned string. */
++extern char *_dl_load_cache_lookup (const char *name)
+ internal_function;
+
+ /* If the system does not support MAP_COPY we cannot leave the file open
+diff -urN glibc-2.12-2-gc4ccff1/dlfcn/Makefile glibc-2.12-2-gc4ccff1.mod/dlfcn/Makefile
+--- glibc-2.12-2-gc4ccff1/dlfcn/Makefile 2010-05-04 07:27:23.000000000 -0400
++++ glibc-2.12-2-gc4ccff1.mod/dlfcn/Makefile 2014-12-11 16:58:55.719803063 -0500
+@@ -42,12 +42,12 @@
+ ifeq (yes,$(build-shared))
+ tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
+ bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
+- bug-atexit3 tstatexit
++ bug-atexit3 tstatexit tst-rec-dlopen
+ endif
+ modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \
+ defaultmod2 errmsg1mod modatexit modcxaatexit \
+ bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \
+- bug-atexit2-lib bug-atexit3-lib
++ bug-atexit2-lib bug-atexit3-lib moddummy1 moddummy2
+
+ failtestmod.so-no-z-defs = yes
+ glreflib2.so-no-z-defs = yes
+@@ -142,6 +142,8 @@
+ $(objpfx)bug-atexit3-lib.so: $(common-objpfx)libc.so \
+ $(common-objpfx)libc_nonshared.a
+
++LDLIBS-tst-rec-dlopen = -ldl
++$(objpfx)tst-rec-dlopen: $(libdl)
+
+ # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
+ # This ensures they will load libc.so for needed symbols if loaded by
+diff -urN glibc-2.12-2-gc4ccff1/dlfcn/moddummy1.c glibc-2.12-2-gc4ccff1.mod/dlfcn/moddummy1.c
+--- glibc-2.12-2-gc4ccff1/dlfcn/moddummy1.c 1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.12-2-gc4ccff1.mod/dlfcn/moddummy1.c 2014-12-11 16:57:54.108797285 -0500
+@@ -0,0 +1,13 @@
++/* Provide a dummy DSO for tst-recursive-dlopen to use. */
++#include <stdio.h>
++#include <stdlib.h>
++
++int called_dummy1;
++
++void
++dummy1 (void)
++{
++ printf ("Called dummy1()\n");
++ called_dummy1++;
++}
++
+diff -urN glibc-2.12-2-gc4ccff1/dlfcn/moddummy2.c glibc-2.12-2-gc4ccff1.mod/dlfcn/moddummy2.c
+--- glibc-2.12-2-gc4ccff1/dlfcn/moddummy2.c 1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.12-2-gc4ccff1.mod/dlfcn/moddummy2.c 2014-12-11 16:57:54.108797285 -0500
+@@ -0,0 +1,13 @@
++/* Provide a dummy DSO for tst-recursive-dlopen to use. */
++#include <stdio.h>
++#include <stdlib.h>
++
++int called_dummy2;
++
++void
++dummy2 (void)
++{
++ printf ("Called dummy2()\n");
++ called_dummy2++;
++}
++
+diff -urN glibc-2.12-2-gc4ccff1/dlfcn/tst-rec-dlopen.c glibc-2.12-2-gc4ccff1.mod/dlfcn/tst-rec-dlopen.c
+--- glibc-2.12-2-gc4ccff1/dlfcn/tst-rec-dlopen.c 1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.12-2-gc4ccff1.mod/dlfcn/tst-rec-dlopen.c 2014-12-11 20:53:28.617848774 -0500
+@@ -0,0 +1,145 @@
++/* Test recursive dlopen using malloc hooks.
++ Copyright (C) 1998-2014 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <malloc.h>
++#include <dlfcn.h>
++
++#define DSO "moddummy1.so"
++#define FUNC "dummy1"
++
++#define DSO1 "moddummy2.so"
++#define FUNC1 "dummy2"
++
++/* Prevent the compiler from moving the assignment to called_func
++ before (*func)() since the compiler doesn't know we might abort
++ or catch a SIGSEGV signal and it may move the store. */
++volatile int called_func;
++
++/* Prototype for my hook. */
++void *custom_malloc_hook (size_t, const void *);
++
++/* Pointer to old malloc hooks. */
++void *(*old_malloc_hook) (size_t, const void *);
++
++/* Call function func_name in DSO dso_name via dlopen. */
++void
++call_func (const char *dso_name, const char *func_name)
++{
++ int ret;
++ void *dso;
++ void (*func) (void);
++ char *err;
++
++ /* Open the DSO. */
++ dso = dlopen (dso_name, RTLD_NOW|RTLD_GLOBAL);
++ if (dso == NULL)
++ {
++ err = dlerror ();
++ fprintf (stderr, "%s\n", err);
++ exit (1);
++ }
++ /* Clear any errors. */
++ dlerror ();
++
++ /* Lookup func. */
++ *(void **) (&func) = dlsym (dso, func_name);
++ if (func == NULL)
++ {
++ err = dlerror ();
++ if (err != NULL)
++ {
++ fprintf (stderr, "%s\n", err);
++ exit (1);
++ }
++ }
++ /* Call func. */
++ (*func) ();
++ called_func = 1;
++
++ /* Close the library and look for errors too. */
++ ret = dlclose (dso);
++ if (ret != 0)
++ {
++ err = dlerror ();
++ fprintf (stderr, "%s\n", err);
++ exit (1);
++ }
++
++}
++
++/* Empty hook that does nothing. */
++void *
++custom_malloc_hook (size_t size, const void *caller)
++{
++ void *result;
++ /* Restore old hooks. */
++ __malloc_hook = old_malloc_hook;
++ /* First call a function in another library via dlopen. */
++ call_func (DSO1, FUNC1);
++ /* Called recursively. */
++ result = malloc (size);
++ /* Restore new hooks. */
++ __malloc_hook = custom_malloc_hook;
++ return result;
++}
++
++static int
++do_test (void)
++{
++ /* Save old hook. */
++ old_malloc_hook = __malloc_hook;
++ /* Install new hook. */
++ __malloc_hook = custom_malloc_hook;
++
++ /* Bug 17702 fixes two things:
++ * A recursive dlopen unmapping the ld.so.cache.
++ * An assertion that _r_debug is RT_CONSISTENT at entry to dlopen.
++ We can only test the latter. Testing the former requires modifying
++ ld.so.conf to cache the dummy libraries, then running ldconfig,
++ then run the test. If you do all of that (and glibc's test
++ infrastructure doesn't support that yet) then the test will
++ SEGFAULT without the fix. If you don't do that, then the test
++ will abort because of the assert described in detail below. */
++ call_func (DSO, FUNC);
++
++ /* Restore old hook. */
++ __malloc_hook = old_malloc_hook;
++
++ /* The function dummy2() is called by the malloc hook. Check to
++ see that it was called. This ensures the second recursive
++ dlopen happened and we called the function in that library.
++
++ Before the fix you either get a SIGSEGV when accessing mmap'd
++ ld.so.cache data or an assertion failure about _r_debug not
++ beint RT_CONSISTENT. We don't test for the SIGSEGV since it
++ would require finding moddummy1 or moddummy2 in the cache and
++ we don't have any infrastructure to test that, but the _r_debug
++ assertion triggers. */
++ if (called_func > 0)
++ printf ("PASS: Function call_func() called more than once.\n");
++ else
++ printf ("FAIL: Function call_func() not called.\n");
++
++ return 0;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
--- /dev/null
+#
+# commit a39208bd7fb76c1b01c127b4c61f9bfd915bfe7c
+# Author: Carlos O'Donell <carlos@redhat.com>
+# Date: Wed Nov 19 11:44:12 2014 -0500
+#
+# CVE-2014-7817: wordexp fails to honour WRDE_NOCMD.
+#
+# The function wordexp() fails to properly handle the WRDE_NOCMD
+# flag when processing arithmetic inputs in the form of "$((... ``))"
+# where "..." can be anything valid. The backticks in the arithmetic
+# epxression are evaluated by in a shell even if WRDE_NOCMD forbade
+# command substitution. This allows an attacker to attempt to pass
+# dangerous commands via constructs of the above form, and bypass
+# the WRDE_NOCMD flag. This patch fixes this by checking for WRDE_NOCMD
+# in exec_comm(), the only place that can execute a shell. All other
+# checks for WRDE_NOCMD are superfluous and removed.
+#
+# We expand the testsuite and add 3 new regression tests of roughly
+# the same form but with a couple of nested levels.
+#
+# On top of the 3 new tests we add fork validation to the WRDE_NOCMD
+# testing. If any forks are detected during the execution of a wordexp()
+# call with WRDE_NOCMD, the test is marked as failed. This is slightly
+# heuristic since vfork might be used in the future, but it provides a
+# higher level of assurance that no shells were executed as part of
+# command substitution with WRDE_NOCMD in effect. In addition it doesn't
+# require libpthread or libdl, instead we use the public implementation
+# namespace function __register_atfork (already part of the public ABI
+# for libpthread).
+#
+# Tested on x86_64 with no regressions.
+#
+diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c
+index 4957006..bdd65e4 100644
+--- a/posix/wordexp-test.c
++++ b/posix/wordexp-test.c
+@@ -27,6 +27,25 @@
+
+ #define IFS " \n\t"
+
++extern void *__dso_handle __attribute__ ((__weak__, __visibility__ ("hidden")));
++extern int __register_atfork (void (*) (void), void (*) (void), void (*) (void), void *);
++
++static int __app_register_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void))
++{
++ return __register_atfork (prepare, parent, child,
++ &__dso_handle == NULL ? NULL : __dso_handle);
++}
++
++/* Number of forks seen. */
++static int registered_forks;
++
++/* For each fork increment the fork count. */
++static void
++register_fork (void)
++{
++ registered_forks++;
++}
++
+ struct test_case_struct
+ {
+ int retval;
+@@ -206,6 +225,12 @@ struct test_case_struct
+ { WRDE_SYNTAX, NULL, "$((2+))", 0, 0, { NULL, }, IFS },
+ { WRDE_SYNTAX, NULL, "`", 0, 0, { NULL, }, IFS },
+ { WRDE_SYNTAX, NULL, "$((010+4+))", 0, 0, { NULL }, IFS },
++ /* Test for CVE-2014-7817. We test 3 combinations of command
++ substitution inside an arithmetic expression to make sure that
++ no commands are executed and error is returned. */
++ { WRDE_CMDSUB, NULL, "$((`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS },
++ { WRDE_CMDSUB, NULL, "$((1+`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS },
++ { WRDE_CMDSUB, NULL, "$((1+$((`echo 1`))))", WRDE_NOCMD, 0, { NULL, }, IFS },
+
+ { -1, NULL, NULL, 0, 0, { NULL, }, IFS },
+ };
+@@ -258,6 +283,15 @@ main (int argc, char *argv[])
+ return -1;
+ }
+
++ /* If we are not allowed to do command substitution, we install
++ fork handlers to verify that no forks happened. No forks should
++ happen at all if command substitution is disabled. */
++ if (__app_register_atfork (register_fork, NULL, NULL) != 0)
++ {
++ printf ("Failed to register fork handler.\n");
++ return -1;
++ }
++
+ for (test = 0; test_case[test].retval != -1; test++)
+ if (testit (&test_case[test]))
+ ++fail;
+@@ -367,6 +401,9 @@ testit (struct test_case_struct *tc)
+
+ printf ("Test %d (%s): ", ++tests, tc->words);
+
++ if (tc->flags & WRDE_NOCMD)
++ registered_forks = 0;
++
+ if (tc->flags & WRDE_APPEND)
+ {
+ /* initial wordexp() call, to be appended to */
+@@ -378,6 +415,13 @@ testit (struct test_case_struct *tc)
+ }
+ retval = wordexp (tc->words, &we, tc->flags);
+
++ if ((tc->flags & WRDE_NOCMD)
++ && (registered_forks > 0))
++ {
++ printf ("FAILED fork called for WRDE_NOCMD\n");
++ return 1;
++ }
++
+ if (tc->flags & WRDE_DOOFFS)
+ start_offs = sav_we.we_offs;
+
+diff --git a/posix/wordexp.c b/posix/wordexp.c
+index b6b65dd..26f3a26 100644
+--- a/posix/wordexp.c
++++ b/posix/wordexp.c
+@@ -893,6 +893,10 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length,
+ pid_t pid;
+ int noexec = 0;
+
++ /* Do nothing if command substitution should not succeed. */
++ if (flags & WRDE_NOCMD)
++ return WRDE_CMDSUB;
++
+ /* Don't fork() unless necessary */
+ if (!comm || !*comm)
+ return 0;
+@@ -2082,9 +2086,6 @@ parse_dollars (char **word, size_t *word_length, size_t *max_length,
+ }
+ }
+
+- if (flags & WRDE_NOCMD)
+- return WRDE_CMDSUB;
+-
+ (*offset) += 2;
+ return parse_comm (word, word_length, max_length, words, offset, flags,
+ quoted? NULL : pwordexp, ifs, ifs_white);
+@@ -2196,9 +2197,6 @@ parse_dquote (char **word, size_t *word_length, size_t *max_length,
+ break;
+
+ case '`':
+- if (flags & WRDE_NOCMD)
+- return WRDE_CMDSUB;
+-
+ ++(*offset);
+ error = parse_backtick (word, word_length, max_length, words,
+ offset, flags, NULL, NULL, NULL);
+@@ -2357,12 +2355,6 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags)
+ break;
+
+ case '`':
+- if (flags & WRDE_NOCMD)
+- {
+- error = WRDE_CMDSUB;
+- goto do_error;
+- }
+-
+ ++words_offset;
+ error = parse_backtick (&word, &word_length, &max_length, words,
+ &words_offset, flags, pwordexp, ifs,
--- /dev/null
+commit d5dd6189d506068ed11c8bfa1e1e9bffde04decd
+Author: Andreas Schwab <schwab@suse.de>
+Date: Mon Jan 21 17:41:28 2013 +0100
+
+ Fix parsing of numeric hosts in gethostbyname_r
+
+diff --git a/nss/digits_dots.c b/nss/digits_dots.c
+index 2b86295..e007ef4 100644
+--- a/nss/digits_dots.c
++++ b/nss/digits_dots.c
+@@ -46,7 +46,10 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+ {
+ if (h_errnop)
+ *h_errnop = NETDB_INTERNAL;
+- *result = NULL;
++ if (buffer_size == NULL)
++ *status = NSS_STATUS_TRYAGAIN;
++ else
++ *result = NULL;
+ return -1;
+ }
+
+@@ -83,14 +86,16 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+ }
+
+ size_needed = (sizeof (*host_addr)
+- + sizeof (*h_addr_ptrs) + strlen (name) + 1);
++ + sizeof (*h_addr_ptrs)
++ + sizeof (*h_alias_ptr) + strlen (name) + 1);
+
+ if (buffer_size == NULL)
+ {
+ if (buflen < size_needed)
+ {
++ *status = NSS_STATUS_TRYAGAIN;
+ if (h_errnop != NULL)
+- *h_errnop = TRY_AGAIN;
++ *h_errnop = NETDB_INTERNAL;
+ __set_errno (ERANGE);
+ goto done;
+ }
+@@ -109,7 +114,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+ *buffer_size = 0;
+ __set_errno (save);
+ if (h_errnop != NULL)
+- *h_errnop = TRY_AGAIN;
++ *h_errnop = NETDB_INTERNAL;
+ *result = NULL;
+ goto done;
+ }
+@@ -149,7 +154,9 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+ if (! ok)
+ {
+ *h_errnop = HOST_NOT_FOUND;
+- if (buffer_size)
++ if (buffer_size == NULL)
++ *status = NSS_STATUS_NOTFOUND;
++ else
+ *result = NULL;
+ goto done;
+ }
+@@ -190,7 +197,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+ if (buffer_size == NULL)
+ *status = NSS_STATUS_SUCCESS;
+ else
+- *result = resbuf;
++ *result = resbuf;
+ goto done;
+ }
+
+@@ -201,15 +208,6 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+
+ if ((isxdigit (name[0]) && strchr (name, ':') != NULL) || name[0] == ':')
+ {
+- const char *cp;
+- char *hostname;
+- typedef unsigned char host_addr_t[16];
+- host_addr_t *host_addr;
+- typedef char *host_addr_list_t[2];
+- host_addr_list_t *h_addr_ptrs;
+- size_t size_needed;
+- int addr_size;
+-
+ switch (af)
+ {
+ default:
+@@ -225,7 +223,10 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+ /* This is not possible. We cannot represent an IPv6 address
+ in an `struct in_addr' variable. */
+ *h_errnop = HOST_NOT_FOUND;
+- *result = NULL;
++ if (buffer_size == NULL)
++ *status = NSS_STATUS_NOTFOUND;
++ else
++ *result = NULL;
+ goto done;
+
+ case AF_INET6:
+@@ -233,42 +234,6 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+ break;
+ }
+
+- size_needed = (sizeof (*host_addr)
+- + sizeof (*h_addr_ptrs) + strlen (name) + 1);
+-
+- if (buffer_size == NULL && buflen < size_needed)
+- {
+- if (h_errnop != NULL)
+- *h_errnop = TRY_AGAIN;
+- __set_errno (ERANGE);
+- goto done;
+- }
+- else if (buffer_size != NULL && *buffer_size < size_needed)
+- {
+- char *new_buf;
+- *buffer_size = size_needed;
+- new_buf = realloc (*buffer, *buffer_size);
+-
+- if (new_buf == NULL)
+- {
+- save = errno;
+- free (*buffer);
+- __set_errno (save);
+- *buffer = NULL;
+- *buffer_size = 0;
+- *result = NULL;
+- goto done;
+- }
+- *buffer = new_buf;
+- }
+-
+- memset (*buffer, '\0', size_needed);
+-
+- host_addr = (host_addr_t *) *buffer;
+- h_addr_ptrs = (host_addr_list_t *)
+- ((char *) host_addr + sizeof (*host_addr));
+- hostname = (char *) h_addr_ptrs + sizeof (*h_addr_ptrs);
+-
+ for (cp = name;; ++cp)
+ {
+ if (!*cp)
+@@ -281,7 +246,9 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
+ if (inet_pton (AF_INET6, name, host_addr) <= 0)
+ {
+ *h_errnop = HOST_NOT_FOUND;
+- if (buffer_size)
++ if (buffer_size == NULL)
++ *status = NSS_STATUS_NOTFOUND;
++ else
+ *result = NULL;
+ goto done;
+ }
+diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
+index 1067744..44d00f4 100644
+--- a/nss/getXXbyYY_r.c
++++ b/nss/getXXbyYY_r.c
+@@ -179,6 +179,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
+ case -1:
+ return errno;
+ case 1:
++#ifdef NEED_H_ERRNO
++ any_service = true;
++#endif
+ goto done;
+ }
+ #endif
+diff --git a/nss/test-digits-dots.c b/nss/test-digits-dots.c
+new file mode 100644
+index 0000000..1efa344
+--- /dev/null
++++ b/nss/test-digits-dots.c
+@@ -0,0 +1,38 @@
++/* Copyright (C) 2013 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++/* Testcase for BZ #15014 */
++
++#include <stdlib.h>
++#include <netdb.h>
++#include <errno.h>
++
++static int
++do_test (void)
++{
++ char buf[32];
++ struct hostent *result = NULL;
++ struct hostent ret;
++ int h_err = 0;
++ int err;
++
++ err = gethostbyname_r ("1.2.3.4", &ret, buf, sizeof (buf), &result, &h_err);
++ return err == ERANGE && h_err == NETDB_INTERNAL ? EXIT_SUCCESS : EXIT_FAILURE;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
--- /dev/null
+commit d26dfc60edc8c6dd160eefff16a734152a835ca0
+Author: Martin von Gagern <Martin.vGagern@gmx.net>
+Date: Sat May 14 21:25:43 2011 -0400
+
+ Fix handling of static TLS in dlopen'ed objects
+
+ When dynamically loading a library along with several dependencies, calls to
+ _dl_add_to_slotinfo and _dl_update_slotinfo can become intermixed. As a
+ consequence, _dl_update_slotinfo will update the generation counter of the dtv
+ although not all of the slots belonging to that generation have been added.
+ Subsequent calls to _dl_add_to_slotinfo will add more slots to the same
+ generation, for which no storage will be allocated, as the dtv generation
+ checks will claim no work is necessary. This will lead to uninitialized dtv
+ entries and will likely cause a SIGSEGV when thread local variables are
+ accessed.
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 8d9657d..6efb86c 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -76,6 +76,7 @@ distribute := rtld-Rules \
+ tst-tlsmod12.c tst-tls10.h tst-alignmod.c tst-alignmod2.c \
+ circlemod1.c circlemod1a.c circlemod2.c circlemod2a.c \
+ circlemod3.c circlemod3a.c nodlopenmod2.c \
++ tst-tls19mod1.c tst-tls19mod2.c tst-tls19mod3.c \
+ tls-macros.h \
+ reldep8mod1.c reldep8mod2.c reldep8mod3.c \
+ nodel2mod1.c nodel2mod2.c nodel2mod3.c \
+@@ -194,7 +195,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
+ restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
+ circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
+ tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
+- tst-tls16 tst-tls17 tst-tls18 tst-tls-dlinfo \
++ tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \
+ tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
+ tst-dlmodcount tst-dlopenrpath tst-deep1 \
+ tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
+@@ -240,6 +241,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
+ $(patsubst %,tst-tlsmod17a%,$(tlsmod17a-suffixes)) \
+ tst-tlsmod17b \
+ $(patsubst %,tst-tlsmod18a%,$(tlsmod18a-suffixes)) \
++ tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \
+ circlemod1 circlemod1a circlemod2 circlemod2a \
+ circlemod3 circlemod3a \
+ reldep8mod1 reldep8mod2 reldep8mod3 \
+@@ -525,6 +527,8 @@ $(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so
+ # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
+ $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so
+ $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so
++$(objpfx)tst-tls19mod1.so: $(objpfx)tst-tls19mod2.so $(objpfx)tst-tls19mod3.so
++$(objpfx)tst-tls19mod3.so: $(objpfx)ld.so
+ $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so
+ $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so
+ $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so
+@@ -822,6 +826,9 @@ $(patsubst %,$(objpfx)%.os,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.os : t
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $<
+ $(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so
+
++$(objpfx)tst-tls19: $(libdl)
++$(objpfx)tst-tls19.out: $(objpfx)tst-tls19mod1.so
++
+ CFLAGS-tst-align.c = $(stack-align-test-flags)
+ CFLAGS-tst-align2.c = $(stack-align-test-flags)
+ CFLAGS-tst-alignmod.c = $(stack-align-test-flags)
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index cf8e8cc..8d90b56 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -347,6 +347,7 @@ dl_open_worker (void *a)
+ /* If the file is not loaded now as a dependency, add the search
+ list of the newly loaded object to the scope. */
+ bool any_tls = false;
++ unsigned int first_static_tls = new->l_searchlist.r_nlist;
+ for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)
+ {
+ struct link_map *imap = new->l_searchlist.r_list[i];
+@@ -425,30 +426,9 @@ dl_open_worker (void *a)
+ might have to increase its size. */
+ _dl_add_to_slotinfo (imap);
+
+- if (imap->l_need_tls_init)
+- {
+- /* For static TLS we have to allocate the memory here
+- and now. This includes allocating memory in the DTV.
+- But we cannot change any DTV other than our own. So,
+- if we cannot guarantee that there is room in the DTV
+- we don't even try it and fail the load.
+-
+- XXX We could track the minimum DTV slots allocated in
+- all threads. */
+- if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
+- _dl_signal_error (0, "dlopen", NULL, N_("\
+-cannot load any more object with static TLS"));
+-
+- imap->l_need_tls_init = 0;
+-#ifdef SHARED
+- /* Update the slot information data for at least the
+- generation of the DSO we are allocating data for. */
+- _dl_update_slotinfo (imap->l_tls_modid);
+-#endif
+-
+- GL(dl_init_static_tls) (imap);
+- assert (imap->l_need_tls_init == 0);
+- }
++ if (imap->l_need_tls_init
++ && first_static_tls == new->l_searchlist.r_nlist)
++ first_static_tls = i;
+
+ /* We have to bump the generation counter. */
+ any_tls = true;
+@@ -460,6 +440,40 @@ cannot load any more object with static TLS"));
+ _dl_fatal_printf (N_("\
+ TLS generation counter wrapped! Please report this."));
+
++ /* We need a second pass for static tls data, because _dl_update_slotinfo
++ must not be run while calls to _dl_add_to_slotinfo are still pending. */
++ for (unsigned int i = first_static_tls; i < new->l_searchlist.r_nlist; ++i)
++ {
++ struct link_map *imap = new->l_searchlist.r_list[i];
++
++ if (imap->l_need_tls_init
++ && ! imap->l_init_called
++ && imap->l_tls_blocksize > 0)
++ {
++ /* For static TLS we have to allocate the memory here and
++ now. This includes allocating memory in the DTV. But we
++ cannot change any DTV other than our own. So, if we
++ cannot guarantee that there is room in the DTV we don't
++ even try it and fail the load.
++
++ XXX We could track the minimum DTV slots allocated in
++ all threads. */
++ if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
++ _dl_signal_error (0, "dlopen", NULL, N_("\
++cannot load any more object with static TLS"));
++
++ imap->l_need_tls_init = 0;
++#ifdef SHARED
++ /* Update the slot information data for at least the
++ generation of the DSO we are allocating data for. */
++ _dl_update_slotinfo (imap->l_tls_modid);
++#endif
++
++ GL(dl_init_static_tls) (imap);
++ assert (imap->l_need_tls_init == 0);
++ }
++ }
++
+ /* Notify the debugger all new objects have been relocated. */
+ if (relocation_in_progress)
+ LIBC_PROBE (rtld_reloc_complete, 3, args->nsid, r, new);
+diff --git a/elf/tst-tls19.c b/elf/tst-tls19.c
+new file mode 100644
+index 0000000..acbc1d6
+--- /dev/null
++++ b/elf/tst-tls19.c
+@@ -0,0 +1,27 @@
++// BZ 12453
++#include <stdio.h>
++#include <dlfcn.h>
++
++
++static int
++do_test (void)
++{
++ void* dl = dlopen ("tst-tls19mod1.so", RTLD_LAZY | RTLD_GLOBAL);
++ if (dl == NULL)
++ {
++ printf ("Error loading tst-tls19mod1.so: %s\n", dlerror ());
++ return 1;
++ }
++
++ int (*fn) (void) = dlsym (dl, "foo");
++ if (fn == NULL)
++ {
++ printf("Error obtaining symbol foo\n");
++ return 1;
++ }
++
++ return fn ();
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+diff --git a/elf/tst-tls19mod1.c b/elf/tst-tls19mod1.c
+new file mode 100644
+index 0000000..2790097
+--- /dev/null
++++ b/elf/tst-tls19mod1.c
+@@ -0,0 +1,15 @@
++#include <stdio.h>
++
++extern int bar (void);
++extern int baz (void);
++
++int
++foo (void)
++{
++ int v1 = bar ();
++ int v2 = baz ();
++
++ printf ("bar=%d, baz=%d\n", v1, v2);
++
++ return v1 != 666 || v2 != 42;
++}
+diff --git a/elf/tst-tls19mod2.c b/elf/tst-tls19mod2.c
+new file mode 100644
+index 0000000..cae702f
+--- /dev/null
++++ b/elf/tst-tls19mod2.c
+@@ -0,0 +1,13 @@
++static int __thread tbar __attribute__ ((tls_model ("initial-exec"))) = 666;
++
++void
++setter (int a)
++{
++ tbar = a;
++}
++
++int
++bar (void)
++{
++ return tbar;
++}
+diff --git a/elf/tst-tls19mod3.c b/elf/tst-tls19mod3.c
+new file mode 100644
+index 0000000..e7b2801
+--- /dev/null
++++ b/elf/tst-tls19mod3.c
+@@ -0,0 +1,16 @@
++#include <stdio.h>
++
++static int __thread tbaz __attribute__ ((tls_model ("local-dynamic"))) = 42;
++
++void
++setter2 (int a)
++{
++ tbaz = a;
++}
++
++int
++baz (void)
++{
++ printf ("&tbaz=%p\n", &tbaz);
++ return tbaz;
++}
+++ /dev/null
-Add initial support for cm-fx6 module.
-
-cm-fx6 is a module based on mx6q SoC with the following features:
-- Up to 4GB of DDR3
-- 1 LCD/DVI output port
-- 1 HDMI output port
-- 2 LVDS LCD ports
-- Gigabit Ethernet
-- Analog Audio
-- CAN
-- SATA
-- NAND
-- PCIE
-
-This patch allows to boot up the module, configures the serial console,
-the Ethernet adapter and the heartbeat led.
-
-cm-fx6 is embedded inside the Utilite computer.
-
-Signed-off-by: Valentin Raevsky <valentin@compulab.co.il>
-Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
----
-
-Shawn, can this still be applied for 3.13 ?
-
-diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
-index f0895c5..7521a34 100644
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -117,6 +117,7 @@ dtb-$(CONFIG_ARCH_MXC) += \
- imx6dl-sabresd.dtb \
- imx6dl-wandboard.dtb \
- imx6q-arm2.dtb \
-+ imx6q-cm-fx6.dtb \
- imx6q-sabreauto.dtb \
- imx6q-sabrelite.dtb \
- imx6q-sabresd.dtb \
-diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts
-new file mode 100644
-index 0000000..2419751
---- /dev/null
-+++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts
-@@ -0,0 +1,53 @@
-+/*
-+ * Copyright 2013 CompuLab Ltd.
-+ *
-+ * Author: Valentin Raevsky <valentin@compulab.co.il>
-+ *
-+ * The code contained herein is licensed under the GNU General Public
-+ * License. You may obtain a copy of the GNU General Public License
-+ * Version 2 or later at the following locations:
-+ *
-+ * http://www.opensource.org/licenses/gpl-license.html
-+ * http://www.gnu.org/copyleft/gpl.html
-+ */
-+
-+/dts-v1/;
-+#include "imx6q.dtsi"
-+
-+/ {
-+ model = "CompuLab CM-FX6";
-+ compatible = "compulab,cm-fx6", "fsl,imx6q";
-+
-+ memory {
-+ reg = <0x10000000 0x80000000>;
-+ };
-+
-+ leds {
-+ compatible = "gpio-leds";
-+
-+ heartbeat-led {
-+ label = "Heartbeat";
-+ gpios = <&gpio2 31 0>;
-+ linux,default-trigger = "heartbeat";
-+ };
-+ };
-+};
-+
-+&fec {
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&pinctrl_enet_1>;
-+ phy-mode = "rgmii";
-+ status = "okay";
-+};
-+
-+&gpmi {
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&pinctrl_gpmi_nand_1>;
-+ status = "okay";
-+};
-+
-+&uart4 {
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&pinctrl_uart4_1>;
-+ status = "okay";
-+};
--- /dev/null
+diff -Naur linux-3.14.25.org/drivers/net/wireless/rt2x00/rt2800lib.c linux-3.14.25/drivers/net/wireless/rt2x00/rt2800lib.c
+--- linux-3.14.25.org/drivers/net/wireless/rt2x00/rt2800lib.c 2014-11-21 18:23:44.000000000 +0100
++++ linux-3.14.25/drivers/net/wireless/rt2x00/rt2800lib.c 2014-12-03 11:30:58.813355413 +0100
+@@ -4847,7 +4847,8 @@
+ rt2x00_set_field32(®, TXOP_CTRL_CFG_EXT_CWMIN, 0);
+ rt2800_register_write(rt2x00dev, TXOP_CTRL_CFG, reg);
+
+- reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002;
++// reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002;
++ reg = 0x00000002;
+ rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg);
+
+ rt2800_register_read(rt2x00dev, TX_RTS_CFG, ®);
--- /dev/null
+diff -Naur linux-3.14.25.org/drivers/net/wireless/rt2x00/rt2800lib.c linux-3.14.25/drivers/net/wireless/rt2x00/rt2800lib.c
+--- linux-3.14.25.org/drivers/net/wireless/rt2x00/rt2800lib.c 2014-12-03 11:30:58.000000000 +0100
++++ linux-3.14.25/drivers/net/wireless/rt2x00/rt2800lib.c 2014-12-03 12:15:45.743454351 +0100
+@@ -1557,7 +1557,7 @@
+ if (!is_zero_ether_addr((const u8 *)conf->bssid)) {
+ reg = le32_to_cpu(conf->bssid[1]);
+ rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_ID_MASK, 3);
+- rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_BCN_NUM, 7);
++ rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_BCN_NUM, 0);
+ conf->bssid[1] = cpu_to_le32(reg);
+ }
+
--- /dev/null
+From 77e3b7f055f824e4d6587faa73bd4aacd0c307e8 Mon Sep 17 00:00:00 2001
+From: hayeswang <hayeswang@realtek.com>
+Date: Wed, 9 Jul 2014 14:52:51 +0800
+Subject: [PATCH] r8169: disable L23
+
+For RTL8411, RTL8111G, RTL8402, RTL8105, and RTL8106, disable the feature
+of entering the L2/L3 link state of the PCIe. When the nic starts the process
+of entering the L2/L3 link state and the PCI reset occurs before the work
+is finished, the work would be queued and continue after the next the PCI
+reset occurs. This causes the device stays in L2/L3 link state, and the system
+couldn't find the device.
+
+Signed-off-by: Hayes Wang <hayeswang@realtek.com>
+Acked-by: Francois Romieu <romieu@fr.zoreil.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/realtek/r8169.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
+index 3ff7bc3..b94f658 100644
+--- a/drivers/net/ethernet/realtek/r8169.c
++++ b/drivers/net/ethernet/realtek/r8169.c
+@@ -538,6 +538,7 @@ enum rtl_register_content {
+ MagicPacket = (1 << 5), /* Wake up when receives a Magic Packet */
+ LinkUp = (1 << 4), /* Wake up when the cable connection is re-established */
+ Jumbo_En0 = (1 << 2), /* 8168 only. Reserved in the 8168b */
++ Rdy_to_L23 = (1 << 1), /* L23 Enable */
+ Beacon_en = (1 << 0), /* 8168 only. Reserved in the 8168b */
+
+ /* Config4 register */
+@@ -4897,6 +4898,21 @@ static void rtl_enable_clock_request(struct pci_dev *pdev)
+ PCI_EXP_LNKCTL_CLKREQ_EN);
+ }
+
++static void rtl_pcie_state_l2l3_enable(struct rtl8169_private *tp, bool enable)
++{
++ void __iomem *ioaddr = tp->mmio_addr;
++ u8 data;
++
++ data = RTL_R8(Config3);
++
++ if (enable)
++ data |= Rdy_to_L23;
++ else
++ data &= ~Rdy_to_L23;
++
++ RTL_W8(Config3, data);
++}
++
+ #define R8168_CPCMD_QUIRK_MASK (\
+ EnableBist | \
+ Mac_dbgo_oe | \
+@@ -5246,6 +5262,7 @@ static void rtl_hw_start_8411(struct rtl8169_private *tp)
+ };
+
+ rtl_hw_start_8168f(tp);
++ rtl_pcie_state_l2l3_enable(tp, false);
+
+ rtl_ephy_init(tp, e_info_8168f_1, ARRAY_SIZE(e_info_8168f_1));
+
+@@ -5284,6 +5301,8 @@ static void rtl_hw_start_8168g_1(struct rtl8169_private *tp)
+
+ rtl_w1w0_eri(tp, 0x2fc, ERIAR_MASK_0001, 0x01, 0x06, ERIAR_EXGMAC);
+ rtl_w1w0_eri(tp, 0x1b0, ERIAR_MASK_0011, 0x0000, 0x1000, ERIAR_EXGMAC);
++
++ rtl_pcie_state_l2l3_enable(tp, false);
+ }
+
+ static void rtl_hw_start_8168g_2(struct rtl8169_private *tp)
+@@ -5536,6 +5555,8 @@ static void rtl_hw_start_8105e_1(struct rtl8169_private *tp)
+ RTL_W8(DLLPR, RTL_R8(DLLPR) | PFM_EN);
+
+ rtl_ephy_init(tp, e_info_8105e_1, ARRAY_SIZE(e_info_8105e_1));
++
++ rtl_pcie_state_l2l3_enable(tp, false);
+ }
+
+ static void rtl_hw_start_8105e_2(struct rtl8169_private *tp)
+@@ -5571,6 +5592,8 @@ static void rtl_hw_start_8402(struct rtl8169_private *tp)
+ rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+ rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+ rtl_w1w0_eri(tp, 0x0d4, ERIAR_MASK_0011, 0x0e00, 0xff00, ERIAR_EXGMAC);
++
++ rtl_pcie_state_l2l3_enable(tp, false);
+ }
+
+ static void rtl_hw_start_8106(struct rtl8169_private *tp)
+@@ -5583,6 +5606,8 @@ static void rtl_hw_start_8106(struct rtl8169_private *tp)
+ RTL_W32(MISC, (RTL_R32(MISC) | DISABLE_LAN_EN) & ~EARLY_TALLY_EN);
+ RTL_W8(MCU, RTL_R8(MCU) | EN_NDP | EN_OOB_RESET);
+ RTL_W8(DLLPR, RTL_R8(DLLPR) & ~PFM_EN);
++
++ rtl_pcie_state_l2l3_enable(tp, false);
+ }
+
+ static void rtl_hw_start_8101(struct net_device *dev)
+--
+1.8.5.2
+
--- /dev/null
+From 7f558e6e8abee42cc966e2cb64be0de875797e07 Mon Sep 17 00:00:00 2001
+From: Arne Fitzenreiter <arne_f@ipfire.org>
+Date: Fri, 20 Feb 2015 10:01:26 +0100
+Subject: [PATCH] sun7i: dts: lamobo-r1: fix sata pwr regulator pin.
+
+Lamobo-R1 use PB3 instead of PB8 for controlling the SATA power regulator.
+---
+ arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
+index 1eb6c9b..d634d2f 100644
+--- a/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
++++ b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
+@@ -166,6 +166,16 @@
+ reg = <1>;
+ };
+ };
++
++ pio: pinctrl@01c20800 {
++ ahci_pwr_pin_a: ahci_pwr_pin@0 {
++ allwinner,pins = "PB3";
++ allwinner,function = "gpio_out";
++ allwinner,drive = <0>;
++ allwinner,pull = <0>;
++ };
++ };
++
+ };
+
+ leds {
+@@ -181,6 +191,14 @@
+ };
+
+ reg_ahci_5v: ahci-5v {
++ compatible = "regulator-fixed";
++ pinctrl-names = "default";
++ pinctrl-0 = <&ahci_pwr_pin_a>;
++ regulator-name = "ahci-5v";
++ regulator-min-microvolt = <5000000>;
++ regulator-max-microvolt = <5000000>;
++ enable-active-high;
++ gpio = <&pio 1 3 0>;
+ status = "okay";
+ };
+
+--
+1.8.5.2
+
--- /dev/null
+commit 650a3ad5151958b99a95836fb8b84b8aa18da1be
+Author: Tobias Brunner <tobias@strongswan.org>
+Date: Wed Feb 25 08:09:11 2015 +0100
+
+ ike-sa-manager: Make sure the message ID of initial messages is 0
+
+ It is mandated by the RFCs and it is expected by the task managers.
+
+ Initial messages with invalid MID will be treated like regular messages,
+ so no IKE_SA will be created for them. Instead, if the responder SPI is 0
+ no SA will be found and the message is rejected with ALERT_INVALID_IKE_SPI.
+ If an SPI is set and we do find an SA, then we either ignore the message
+ because the MID is unexpected, or because we don't allow initial messages
+ on established connections.
+
+ There is one exception, though, if an attacker can slip in an IKE_SA_INIT
+ with both SPIs set before the client's IKE_AUTH is handled by the server,
+ it does get processed (see next commit).
+
+ References #816.
+
+diff --git a/src/libcharon/sa/ike_sa_manager.c b/src/libcharon/sa/ike_sa_manager.c
+index d0cbd47..5e2b925 100644
+--- a/src/libcharon/sa/ike_sa_manager.c
++++ b/src/libcharon/sa/ike_sa_manager.c
+@@ -1184,7 +1184,8 @@ METHOD(ike_sa_manager_t, checkout_by_message, ike_sa_t*,
+
+ DBG2(DBG_MGR, "checkout IKE_SA by message");
+
+- if (id->get_responder_spi(id) == 0)
++ if (id->get_responder_spi(id) == 0 &&
++ message->get_message_id(message) == 0)
+ {
+ if (message->get_major_version(message) == IKEV2_MAJOR_VERSION)
+ {
--- /dev/null
+commit dd0ebb54837298c869389d36a0b42eefdb893dd6
+Author: Tobias Brunner <tobias@strongswan.org>
+Date: Wed Feb 25 08:30:33 2015 +0100
+
+ ikev2: Only accept initial messages in specific states
+
+ The previous code allowed an attacker to slip in an IKE_SA_INIT with
+ both SPIs and MID 1 set when an IKE_AUTH would be expected instead.
+
+ References #816.
+
+diff --git a/src/libcharon/sa/ikev2/task_manager_v2.c b/src/libcharon/sa/ikev2/task_manager_v2.c
+index be84e71..540d4dc 100644
+--- a/src/libcharon/sa/ikev2/task_manager_v2.c
++++ b/src/libcharon/sa/ikev2/task_manager_v2.c
+@@ -1304,17 +1304,16 @@ METHOD(task_manager_t, process_message, status_t,
+ {
+ if (mid == this->responding.mid)
+ {
+- /* reject initial messages once established */
+- if (msg->get_exchange_type(msg) == IKE_SA_INIT ||
+- msg->get_exchange_type(msg) == IKE_AUTH)
++ /* reject initial messages if not received in specific states */
++ if ((msg->get_exchange_type(msg) == IKE_SA_INIT &&
++ this->ike_sa->get_state(this->ike_sa) != IKE_CREATED) ||
++ (msg->get_exchange_type(msg) == IKE_AUTH &&
++ this->ike_sa->get_state(this->ike_sa) != IKE_CONNECTING))
+ {
+- if (this->ike_sa->get_state(this->ike_sa) != IKE_CREATED &&
+- this->ike_sa->get_state(this->ike_sa) != IKE_CONNECTING)
+- {
+- DBG1(DBG_IKE, "ignoring %N in established IKE_SA state",
+- exchange_type_names, msg->get_exchange_type(msg));
+- return FAILED;
+- }
++ DBG1(DBG_IKE, "ignoring %N in IKE_SA state %N",
++ exchange_type_names, msg->get_exchange_type(msg),
++ ike_sa_state_names, this->ike_sa->get_state(this->ike_sa));
++ return FAILED;
+ }
+ if (!this->ike_sa->supports_extension(this->ike_sa, EXT_MOBIKE))
+ { /* with MOBIKE, we do no implicit updates */
--- /dev/null
+commit eb251906298b529fa53b8a99746a9a7a9f318dd5
+Author: Tobias Brunner <tobias@strongswan.org>
+Date: Wed Feb 25 08:18:58 2015 +0100
+
+ ikev2: Don't destroy the SA if an IKE_SA_INIT with unexpected MID is received
+
+ This reverts 8f727d800751 ("Clean up IKE_SA state if IKE_SA_INIT request
+ does not have message ID 0") because it allowed to close any IKE_SA by
+ sending an IKE_SA_INIT with an unexpected MID and both SPIs set to those
+ of that SA.
+
+ The next commit will prevent SAs from getting created for IKE_SA_INIT messages
+ with invalid MID.
+
+ Fixes #816.
+
+diff --git a/src/libcharon/sa/ikev2/task_manager_v2.c b/src/libcharon/sa/ikev2/task_manager_v2.c
+index 48266aa..be84e71 100644
+--- a/src/libcharon/sa/ikev2/task_manager_v2.c
++++ b/src/libcharon/sa/ikev2/task_manager_v2.c
+@@ -1355,10 +1355,6 @@ METHOD(task_manager_t, process_message, status_t,
+ {
+ DBG1(DBG_IKE, "received message ID %d, expected %d. Ignored",
+ mid, this->responding.mid);
+- if (msg->get_exchange_type(msg) == IKE_SA_INIT)
+- { /* clean up IKE_SA state if IKE_SA_INIT has invalid msg ID */
+- return DESTROY_ME;
+- }
+ }
+ }
+ else
--- /dev/null
+From cd2c30a56ec9bdab8b3923851509f27a4fd6f537 Mon Sep 17 00:00:00 2001
+From: Tobias Brunner <tobias@strongswan.org>
+Date: Tue, 10 Feb 2015 19:03:44 +0100
+Subject: [PATCH] ikev1: Set protocol ID and SPIs in INITIAL-CONTACT
+ notification payloads
+
+The payload we sent before is not compliant with RFC 2407 and thus some
+peers might abort negotiation (e.g. with an INVALID-PROTOCOL-ID error).
+
+ #819
+---
+ src/libcharon/sa/ikev1/tasks/main_mode.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/src/libcharon/sa/ikev1/tasks/main_mode.c b/src/libcharon/sa/ikev1/tasks/main_mode.c
+index 5065e70..3ea4a2a 100644
+--- a/src/libcharon/sa/ikev1/tasks/main_mode.c
++++ b/src/libcharon/sa/ikev1/tasks/main_mode.c
+@@ -213,6 +213,10 @@ static void add_initial_contact(private_main_mode_t *this, message_t *message,
+ {
+ identification_t *idr;
+ host_t *host;
++ notify_payload_t *notify;
++ ike_sa_id_t *ike_sa_id;
++ u_int64_t spi_i, spi_r;
++ chunk_t spi;
+
+ idr = this->ph1->get_id(this->ph1, this->peer_cfg, FALSE);
+ if (idr && !idr->contains_wildcards(idr))
+@@ -224,8 +228,15 @@ static void add_initial_contact(private_main_mode_t *this, message_t *message,
+ if (!charon->ike_sa_manager->has_contact(charon->ike_sa_manager,
+ idi, idr, host->get_family(host)))
+ {
+- message->add_notify(message, FALSE, INITIAL_CONTACT_IKEV1,
+- chunk_empty);
++ notify = notify_payload_create_from_protocol_and_type(
++ PLV1_NOTIFY, PROTO_IKE, INITIAL_CONTACT_IKEV1);
++ ike_sa_id = this->ike_sa->get_id(this->ike_sa);
++ spi_i = ike_sa_id->get_initiator_spi(ike_sa_id);
++ spi_r = ike_sa_id->get_responder_spi(ike_sa_id);
++ spi = chunk_cata("cc", chunk_from_thing(spi_i),
++ chunk_from_thing(spi_r));
++ notify->set_spi_data(notify, spi);
++ message->add_payload(message, (payload_t*)notify);
+ }
+ }
+ }
+--
+1.7.9.5
+
--- /dev/null
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/cmd_boot.c u-boot-sunxi/arch/arm/cpu/armv7/cmd_boot.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/cmd_boot.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/cmd_boot.c 2014-09-06 16:58:35.193953144 +0200
+@@ -0,0 +1,20 @@
++/*
++ * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++/*
++ * Misc boot support
++ */
++#include <common.h>
++#include <command.h>
++
++#ifdef CONFIG_CMD_GO
++unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
++ char * const argv[])
++{
++ invalidate_icache_all();
++ return entry(argc, argv);
++}
++#endif
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/Makefile u-boot-sunxi/arch/arm/cpu/armv7/Makefile
+--- u-boot-2014.04/arch/arm/cpu/armv7/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/arch/arm/cpu/armv7/Makefile 2014-09-06 16:58:35.185953145 +0200
+@@ -11,8 +11,9 @@
+
+ obj-y += cpu.o
+ obj-y += syslib.o
++obj-y += cmd_boot.o
+
+-ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY),)
++ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI),)
+ ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
+ obj-y += lowlevel_init.o
+ endif
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/board.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/board.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/board.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/board.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,166 @@
++/*
++ * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * Some init for sunxi platform.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <i2c.h>
++#include <netdev.h>
++#include <miiphy.h>
++#include <serial.h>
++#ifdef CONFIG_SPL_BUILD
++#include <spl.h>
++#endif
++#include <asm/gpio.h>
++#include <asm/io.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/sys_proto.h>
++#include <asm/arch/timer.h>
++#include <asm/arch/watchdog.h>
++
++#ifdef CONFIG_SPL_BUILD
++/* Pointer to the global data structure for SPL */
++DECLARE_GLOBAL_DATA_PTR;
++
++/* The sunxi internal brom will try to loader external bootloader
++ * from mmc0, nand flash, mmc2.
++ * Unfortunately we can't check how SPL was loaded so assume
++ * it's always the first SD/MMC controller
++ */
++u32 spl_boot_device(void)
++{
++ return BOOT_DEVICE_MMC1;
++}
++
++/* No confirmation data available in SPL yet. Hardcode bootmode */
++u32 spl_boot_mode(void)
++{
++ return MMCSD_MODE_RAW;
++}
++#endif
++
++int gpio_init(void)
++{
++#if CONFIG_CONS_INDEX == 1 && defined(CONFIG_UART0_PORT_F)
++#if defined(CONFIG_SUN4I) || defined(CONFIG_SUN7I)
++ /* disable GPB22,23 as uart0 tx,rx to avoid conflict */
++ sunxi_gpio_set_cfgpin(SUNXI_GPB(22), SUNXI_GPIO_INPUT);
++ sunxi_gpio_set_cfgpin(SUNXI_GPB(23), SUNXI_GPIO_INPUT);
++#endif
++ sunxi_gpio_set_cfgpin(SUNXI_GPF(2), SUNXI_GPF2_UART0_TX);
++ sunxi_gpio_set_cfgpin(SUNXI_GPF(4), SUNXI_GPF4_UART0_RX);
++ sunxi_gpio_set_pull(SUNXI_GPF(4), 1);
++#elif CONFIG_CONS_INDEX == 1 && (defined(CONFIG_SUN4I) || defined(CONFIG_SUN7I))
++ sunxi_gpio_set_cfgpin(SUNXI_GPB(22), SUN4I_GPB22_UART0_TX);
++ sunxi_gpio_set_cfgpin(SUNXI_GPB(23), SUN4I_GPB23_UART0_RX);
++ sunxi_gpio_set_pull(SUNXI_GPB(23), 1);
++#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_SUN6I)
++ sunxi_gpio_set_cfgpin(SUNXI_GPH(20), 2);
++ sunxi_gpio_set_cfgpin(SUNXI_GPH(21), 2);
++ sunxi_gpio_set_pull(SUNXI_GPH(21), 1);
++#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_SUN5I)
++ sunxi_gpio_set_cfgpin(SUNXI_GPB(19), SUN5I_GPB19_UART0_TX);
++ sunxi_gpio_set_cfgpin(SUNXI_GPB(20), SUN5I_GPB20_UART0_RX);
++ sunxi_gpio_set_pull(SUNXI_GPB(20), 1);
++#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_SUN5I)
++ sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG3_UART1_TX);
++ sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG4_UART1_RX);
++ sunxi_gpio_set_pull(SUNXI_GPG(4), 1);
++#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_SUN8I)
++ sunxi_gpio_set_cfgpin(SUNXI_GPL(2), SUN8I_GPL2_R_UART_TX);
++ sunxi_gpio_set_cfgpin(SUNXI_GPL(3), SUN8I_GPL3_R_UART_RX);
++ sunxi_gpio_set_pull(SUNXI_GPL(3), 1);
++#else
++#error Unsupported console port number. Please fix pin mux settings in board.c
++#endif
++
++ return 0;
++}
++
++void reset_cpu(ulong addr)
++{
++ watchdog_set(0);
++ while (1);
++}
++
++/* do some early init */
++void s_init(void)
++{
++#if !defined CONFIG_SPL_BUILD && (defined CONFIG_SUN7I || defined CONFIG_SUN6I)
++ /* Enable SMP mode for CPU0, by setting bit 6 of Auxiliary Ctl reg */
++ asm volatile(
++ "mrc p15, 0, r0, c1, c0, 1\n"
++ "orr r0, r0, #1 << 6\n"
++ "mcr p15, 0, r0, c1, c0, 1\n");
++#endif
++
++ watchdog_init();
++ clock_init();
++ timer_init();
++ gpio_init();
++ i2c_init_board();
++
++#ifdef CONFIG_SPL_BUILD
++ gd = &gdata;
++ preloader_console_init();
++
++#ifdef CONFIG_SPL_I2C_SUPPORT
++ /* Needed early by sunxi_board_init if PMU is enabled */
++ i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
++#endif
++#endif
++/* No SPL on sun6i, so we do sunxi_board_init() from non spl there */
++#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_SUN6I) || defined(CONFIG_SUN8I)
++ sunxi_board_init();
++#endif
++}
++
++#ifndef CONFIG_SYS_DCACHE_OFF
++void enable_caches(void)
++{
++ /* Enable D-cache. I-cache is already enabled in start.S */
++ dcache_enable();
++}
++#endif
++
++#ifdef CONFIG_CMD_NET
++/*
++ * Initializes on-chip ethernet controllers.
++ * to override, implement board_eth_init()
++ */
++int cpu_eth_init(bd_t *bis)
++{
++ __maybe_unused int rc;
++
++#ifdef CONFIG_MACPWR
++ gpio_direction_output(CONFIG_MACPWR, 1);
++ mdelay(200);
++#endif
++
++#ifdef CONFIG_SUNXI_EMAC
++ rc = sunxi_emac_initialize(bis);
++ if (rc < 0) {
++ printf("sunxi: failed to initialize emac\n");
++ return rc;
++ }
++#endif
++
++#ifdef CONFIG_SUNXI_GMAC
++ rc = sunxi_gmac_initialize(bis);
++ if (rc < 0) {
++ printf("sunxi: failed to initialize gmac\n");
++ return rc;
++ }
++#endif
++
++ return 0;
++}
++#endif
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/clock.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/clock.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/clock.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/clock.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,25 @@
++/*
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/sys_proto.h>
++
++int clock_init(void)
++{
++#ifdef CONFIG_SPL_BUILD
++ clock_init_safe();
++#endif
++ clock_init_uart();
++
++ return 0;
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/clock_sun4i.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/clock_sun4i.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/clock_sun4i.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,188 @@
++/*
++ * sun4i, sun5i and sun7i specific clock code
++ *
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/sys_proto.h>
++
++#ifdef CONFIG_SPL_BUILD
++void clock_init_safe(void)
++{
++ struct sunxi_ccm_reg * const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ /* Set safe defaults until PMU is configured */
++ writel(AXI_DIV_1 << AXI_DIV_SHIFT |
++ AHB_DIV_2 << AHB_DIV_SHIFT |
++ APB0_DIV_1 << APB0_DIV_SHIFT |
++ CPU_CLK_SRC_OSC24M << CPU_CLK_SRC_SHIFT,
++ &ccm->cpu_ahb_apb0_cfg);
++ writel(PLL1_CFG_DEFAULT, &ccm->pll1_cfg);
++ sdelay(200);
++ writel(AXI_DIV_1 << AXI_DIV_SHIFT |
++ AHB_DIV_2 << AHB_DIV_SHIFT |
++ APB0_DIV_1 << APB0_DIV_SHIFT |
++ CPU_CLK_SRC_PLL1 << CPU_CLK_SRC_SHIFT,
++ &ccm->cpu_ahb_apb0_cfg);
++#ifdef CONFIG_SUN7I
++ writel(0x1 << AHB_GATE_OFFSET_DMA | readl(&ccm->ahb_gate0),
++ &ccm->ahb_gate0);
++#endif
++ writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg);
++}
++#endif
++
++void clock_init_uart(void)
++{
++ struct sunxi_ccm_reg *const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ /* uart clock source is apb1 */
++ writel(APB1_CLK_SRC_OSC24M|
++ APB1_CLK_RATE_N_1|
++ APB1_CLK_RATE_M(1),
++ &ccm->apb1_clk_div_cfg);
++
++ /* open the clock for uart */
++ setbits_le32(&ccm->apb1_gate,
++ CLK_GATE_OPEN << (APB1_GATE_UART_SHIFT+CONFIG_CONS_INDEX-1));
++}
++
++int clock_twi_onoff(int port, int state)
++{
++ struct sunxi_ccm_reg *const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ if (port > 2)
++ return -1;
++
++ /* set the apb clock gate for twi */
++ if (state)
++ setbits_le32(&ccm->apb1_gate,
++ CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT+port));
++ else
++ clrbits_le32(&ccm->apb1_gate,
++ CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT+port));
++
++ return 0;
++}
++
++#ifdef CONFIG_SPL_BUILD
++#define PLL1_CFG(N, K, M, P) ( 1 << CCM_PLL1_CFG_ENABLE_SHIFT | \
++ 0 << CCM_PLL1_CFG_VCO_RST_SHIFT | \
++ 8 << CCM_PLL1_CFG_VCO_BIAS_SHIFT | \
++ 0 << CCM_PLL1_CFG_PLL4_EXCH_SHIFT | \
++ 16 << CCM_PLL1_CFG_BIAS_CUR_SHIFT | \
++ (P)<< CCM_PLL1_CFG_DIVP_SHIFT | \
++ 2 << CCM_PLL1_CFG_LCK_TMR_SHIFT | \
++ (N)<< CCM_PLL1_CFG_FACTOR_N_SHIFT | \
++ (K)<< CCM_PLL1_CFG_FACTOR_K_SHIFT | \
++ 0 << CCM_PLL1_CFG_SIG_DELT_PAT_IN_SHIFT | \
++ 0 << CCM_PLL1_CFG_SIG_DELT_PAT_EN_SHIFT | \
++ (M)<< CCM_PLL1_CFG_FACTOR_M_SHIFT)
++
++static struct {
++ u32 pll1_cfg;
++ unsigned int freq;
++} pll1_para[] = {
++ /* This array must be ordered by frequency. */
++ { PLL1_CFG(16, 0, 0, 0), 384000000 },
++ { PLL1_CFG(16, 1, 0, 0), 768000000 },
++ { PLL1_CFG(20, 1, 0, 0), 960000000 },
++ { PLL1_CFG(21, 1, 0, 0), 1008000000},
++ { PLL1_CFG(22, 1, 0, 0), 1056000000},
++ { PLL1_CFG(23, 1, 0, 0), 1104000000},
++ { PLL1_CFG(24, 1, 0, 0), 1152000000},
++ { PLL1_CFG(25, 1, 0, 0), 1200000000},
++ { PLL1_CFG(26, 1, 0, 0), 1248000000},
++ { PLL1_CFG(27, 1, 0, 0), 1296000000},
++ { PLL1_CFG(28, 1, 0, 0), 1344000000},
++ { PLL1_CFG(29, 1, 0, 0), 1392000000},
++ { PLL1_CFG(30, 1, 0, 0), 1440000000},
++ { PLL1_CFG(31, 1, 0, 0), 1488000000},
++ /* Final catchall entry */
++ { PLL1_CFG(31, 1, 0, 0), ~0},
++};
++
++void clock_set_pll1(unsigned int hz)
++{
++ int i = 0;
++ int axi, ahb, apb0;
++ struct sunxi_ccm_reg * const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ /* Find target frequency */
++ while (pll1_para[i].freq < hz)
++ i++;
++
++ hz = pll1_para[i].freq;
++
++ /* Calculate system clock divisors */
++ axi = DIV_ROUND_UP(hz, 432000000); /* Max 450MHz */
++ ahb = DIV_ROUND_UP(hz/axi, 204000000); /* Max 250MHz */
++ apb0 = 2; /* Max 150MHz */
++
++ printf("CPU: %uHz, AXI/AHB/APB: %d/%d/%d\n", hz, axi, ahb, apb0);
++
++ /* Map divisors to register values */
++ axi = axi - 1;
++ if (ahb > 4)
++ ahb = 3;
++ else if (ahb > 2)
++ ahb = 2;
++ else if (ahb > 1)
++ ahb = 1;
++ else
++ ahb = 0;
++
++ apb0 = apb0 - 1;
++
++ /* Switch to 24MHz clock while changing PLL1 */
++ writel(AXI_DIV_1 << AXI_DIV_SHIFT |
++ AHB_DIV_2 << AHB_DIV_SHIFT |
++ APB0_DIV_1 << APB0_DIV_SHIFT |
++ CPU_CLK_SRC_OSC24M << CPU_CLK_SRC_SHIFT,
++ &ccm->cpu_ahb_apb0_cfg);
++ sdelay(20);
++
++ /* Configure sys clock divisors */
++ writel(axi << AXI_DIV_SHIFT |
++ ahb << AHB_DIV_SHIFT |
++ apb0 << APB0_DIV_SHIFT |
++ CPU_CLK_SRC_OSC24M << CPU_CLK_SRC_SHIFT,
++ &ccm->cpu_ahb_apb0_cfg);
++
++ /* Configure PLL1 at the desired frequency */
++ writel(pll1_para[i].pll1_cfg, &ccm->pll1_cfg);
++ sdelay(200);
++
++ /* Switch CPU to PLL1 */
++ writel(axi << AXI_DIV_SHIFT |
++ ahb << AHB_DIV_SHIFT |
++ apb0 << APB0_DIV_SHIFT |
++ CPU_CLK_SRC_PLL1 << CPU_CLK_SRC_SHIFT,
++ &ccm->cpu_ahb_apb0_cfg);
++ sdelay(20);
++}
++#endif
++
++unsigned int clock_get_pll6(void)
++{
++ struct sunxi_ccm_reg *const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++ uint32_t rval = readl(&ccm->pll6_cfg);
++ int n = ((rval & CCM_PLL6_CTRL_N_MASK) >> CCM_PLL6_CTRL_N_SHIFT);
++ int k = ((rval & CCM_PLL6_CTRL_K_MASK) >> CCM_PLL6_CTRL_K_SHIFT) + 1;
++ return 24000000 * n * k / 2;
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/clock_sun6i.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/clock_sun6i.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/clock_sun6i.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,110 @@
++/*
++ * sun6i specific clock code
++ *
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/prcm.h>
++#include <asm/arch/sys_proto.h>
++
++#ifdef CONFIG_SPL_BUILD
++void clock_init_safe(void)
++{
++ struct sunxi_ccm_reg * const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++ struct sunxi_prcm_reg * const prcm =
++ (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;
++
++ /* Set PLL ldo voltage without this PLL6 does not work properly */
++ writel(PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN |
++ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140) |
++ PRCM_PLL_CTRL_LDO_KEY, &prcm->pll_ctrl1);
++ writel(PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN |
++ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140) |
++ PRCM_PLL_CTRL_LDO_KEY, &prcm->pll_ctrl1);
++ writel(PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN |
++ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140),
++ &prcm->pll_ctrl1);
++
++ /* AXI and PLL1 settings from boot0 / boot1, PLL1 set to 486 Mhz */
++ writel(AXI_DIV_3 << AXI_DIV_SHIFT |
++ ATB_DIV_2 << ATB_DIV_SHIFT |
++ CPU_CLK_SRC_OSC24M << CPU_CLK_SRC_SHIFT,
++ &ccm->cpu_axi_cfg);
++ writel(PLL1_CFG_DEFAULT, &ccm->pll1_cfg);
++ sdelay(200);
++ writel(AXI_DIV_3 << AXI_DIV_SHIFT |
++ ATB_DIV_2 << ATB_DIV_SHIFT |
++ CPU_CLK_SRC_PLL1 << CPU_CLK_SRC_SHIFT,
++ &ccm->cpu_axi_cfg);
++
++ writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg);
++}
++#endif
++
++void clock_init_uart(void)
++{
++ struct sunxi_ccm_reg *const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++#if CONFIG_CONS_INDEX < 5
++ /* uart clock source is apb2 */
++ writel(APB2_CLK_SRC_OSC24M|
++ APB2_CLK_RATE_N_1|
++ APB2_CLK_RATE_M(1),
++ &ccm->apb2_div);
++
++ /* open the clock for uart */
++ setbits_le32(&ccm->apb2_gate,
++ CLK_GATE_OPEN << (APB2_GATE_UART_SHIFT+CONFIG_CONS_INDEX-1));
++
++ /* deassert uart reset */
++ setbits_le32(&ccm->apb2_reset_cfg,
++ 1 << (APB2_RESET_UART_SHIFT+CONFIG_CONS_INDEX-1));
++#else
++ /* enable R_PIO and R_UART clocks, and de-assert resets */
++ prcm_apb0_enable(PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_UART);
++#endif
++
++ /* Dup with clock_init_safe(), drop once sun6i SPL support lands */
++ writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg);
++}
++
++int clock_twi_onoff(int port, int state)
++{
++ struct sunxi_ccm_reg *const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ if (port > 3)
++ return -1;
++
++ /* set the apb clock gate for twi */
++ if (state)
++ setbits_le32(&ccm->apb2_gate,
++ CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port));
++ else
++ clrbits_le32(&ccm->apb2_gate,
++ CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port));
++
++ return 0;
++}
++
++unsigned int clock_get_pll6(void)
++{
++ struct sunxi_ccm_reg *const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++ uint32_t rval = readl(&ccm->pll6_cfg);
++ int n = ((rval & CCM_PLL6_CTRL_N_MASK) >> CCM_PLL6_CTRL_N_SHIFT) + 1;
++ int k = ((rval & CCM_PLL6_CTRL_K_MASK) >> CCM_PLL6_CTRL_K_SHIFT) + 1;
++ return 24000000 * n * k / 2;
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,29 @@
++/*
++ * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/watchdog.h>
++
++int do_sunxi_watchdog(cmd_tbl_t *cmdtp, int flag, int argc, const char *argv[])
++{
++ unsigned long interval;
++
++ if (argc < 2) {
++ printf("usage: watchdog seconds\n");
++ printf("over %d to disable watchdog\n", WDT_MAX_TIMEOUT);
++ }
++ interval = simple_strtoul(argv[1], NULL, 10);
++ watchdog_set((unsigned int)interval);
++
++ return 0;
++}
++
++U_BOOT_CMD(
++ watchdog, 2, 1, do_sunxi_watchdog,
++ "Set watchdog [0 - 16]. [17+} disables",
++ ""
++);
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/config.mk u-boot-sunxi/arch/arm/cpu/armv7/sunxi/config.mk
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/config.mk 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/config.mk 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,8 @@
++# Build a combined spl + u-boot image
++ifdef CONFIG_SPL
++ifndef CONFIG_SPL_BUILD
++ifndef CONFIG_SPL_FEL
++ALL-y += u-boot-sunxi-with-spl.bin
++endif
++endif
++endif
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/cpu_info.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/cpu_info.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/cpu_info.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/cpu_info.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,38 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/cpu.h>
++
++#ifdef CONFIG_DISPLAY_CPUINFO
++int print_cpuinfo(void)
++{
++#ifdef CONFIG_SUN4I
++ puts("CPU: Allwinner A10 (SUN4I)\n");
++#elif defined CONFIG_SUN5I
++ u32 val = readl(SUNXI_SID_BASE + 0x08);
++ switch ((val >> 12) & 0xf) {
++ case 0: puts("CPU: Allwinner A12 (SUN5I)\n"); break;
++ case 3: puts("CPU: Allwinner A13 (SUN5I)\n"); break;
++ case 7: puts("CPU: Allwinner A10s (SUN5I)\n"); break;
++ default: puts("CPU: Allwinner A1X (SUN5I)\n");
++ }
++#elif defined CONFIG_SUN6I
++ puts("CPU: Allwinner A31 (SUN6I)\n");
++#elif defined CONFIG_SUN7I
++ puts("CPU: Allwinner A20 (SUN7I)\n");
++#elif defined CONFIG_SUN8I
++ puts("CPU: Allwinner A23 (SUN8I)\n");
++#else
++#warning Please update cpu_info.c with correct CPU information
++ puts("CPU: SUNXI Family\n");
++#endif
++ return 0;
++}
++#endif
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/dram.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/dram.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/dram.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,693 @@
++/*
++ * sunxi DRAM controller initialization
++ * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++ * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
++ *
++ * Based on sun4i Linux kernel sources mach-sunxi/pm/standby/dram*.c
++ * and earlier U-Boot Allwiner A10 SPL work
++ *
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Berg Xing <bergxing@allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++/*
++ * Unfortunately the only documentation we have on the sun7i DRAM
++ * controller is Allwinner boot0 + boot1 code, and that code uses
++ * magic numbers & shifts with no explanations. Hence this code is
++ * rather undocumented and full of magic.
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/dram.h>
++#include <asm/arch/timer.h>
++#include <asm/arch/sys_proto.h>
++
++#define CPU_CFG_CHIP_VER(n) ((n) << 6)
++#define CPU_CFG_CHIP_VER_MASK CPU_CFG_CHIP_VER(0x3)
++#define CPU_CFG_CHIP_REV_A 0x0
++#define CPU_CFG_CHIP_REV_C1 0x1
++#define CPU_CFG_CHIP_REV_C2 0x2
++#define CPU_CFG_CHIP_REV_B 0x3
++
++/*
++ * Wait up to 1s for mask to be clear in given reg.
++ */
++static void await_completion(u32 *reg, u32 mask)
++{
++ unsigned long tmo = timer_get_us() + 1000000;
++
++ while (readl(reg) & mask) {
++ if (timer_get_us() > tmo)
++ panic("Timeout initialising DRAM\n");
++ }
++}
++
++static void mctl_ddr3_reset(void)
++{
++ struct sunxi_dram_reg *dram =
++ (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++
++#ifdef CONFIG_SUN4I
++ struct sunxi_timer_reg *timer =
++ (struct sunxi_timer_reg *)SUNXI_TIMER_BASE;
++ u32 reg_val;
++
++ writel(0, &timer->cpu_cfg);
++ reg_val = readl(&timer->cpu_cfg);
++
++ if ((reg_val & CPU_CFG_CHIP_VER_MASK) !=
++ CPU_CFG_CHIP_VER(CPU_CFG_CHIP_REV_A)) {
++ setbits_le32(&dram->mcr, DRAM_MCR_RESET);
++ udelay(2);
++ clrbits_le32(&dram->mcr, DRAM_MCR_RESET);
++ } else
++#endif
++ {
++ clrbits_le32(&dram->mcr, DRAM_MCR_RESET);
++ udelay(2);
++ setbits_le32(&dram->mcr, DRAM_MCR_RESET);
++ }
++}
++
++static void mctl_set_drive(void)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++
++#ifdef CONFIG_SUN7I
++ clrsetbits_le32(&dram->mcr, DRAM_MCR_MODE_NORM(0x3) | (0x3 << 28),
++#else
++ clrsetbits_le32(&dram->mcr, DRAM_MCR_MODE_NORM(0x3),
++#endif
++ DRAM_MCR_MODE_EN(0x3) |
++ 0xffc);
++}
++
++static void mctl_itm_disable(void)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++
++ clrsetbits_le32(&dram->ccr, DRAM_CCR_INIT, DRAM_CCR_ITM_OFF);
++}
++
++static void mctl_itm_enable(void)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++
++ clrbits_le32(&dram->ccr, DRAM_CCR_ITM_OFF);
++}
++
++static void mctl_enable_dll0(u32 phase)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++
++ clrsetbits_le32(&dram->dllcr[0], 0x3f << 6,
++ ((phase >> 16) & 0x3f) << 6);
++ clrsetbits_le32(&dram->dllcr[0], DRAM_DLLCR_NRESET, DRAM_DLLCR_DISABLE);
++ udelay(2);
++
++ clrbits_le32(&dram->dllcr[0], DRAM_DLLCR_NRESET | DRAM_DLLCR_DISABLE);
++ udelay(22);
++
++ clrsetbits_le32(&dram->dllcr[0], DRAM_DLLCR_DISABLE, DRAM_DLLCR_NRESET);
++ udelay(22);
++}
++
++/*
++ * Note: This differs from pm/standby in that it checks the bus width
++ */
++static void mctl_enable_dllx(u32 phase)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++ u32 i, n, bus_width;
++
++ bus_width = readl(&dram->dcr);
++
++ if ((bus_width & DRAM_DCR_BUS_WIDTH_MASK) ==
++ DRAM_DCR_BUS_WIDTH(DRAM_DCR_BUS_WIDTH_32BIT))
++ n = DRAM_DCR_NR_DLLCR_32BIT;
++ else
++ n = DRAM_DCR_NR_DLLCR_16BIT;
++
++ for (i = 1; i < n; i++) {
++ clrsetbits_le32(&dram->dllcr[i], 0xf << 14,
++ (phase & 0xf) << 14);
++ clrsetbits_le32(&dram->dllcr[i], DRAM_DLLCR_NRESET,
++ DRAM_DLLCR_DISABLE);
++ phase >>= 4;
++ }
++ udelay(2);
++
++ for (i = 1; i < n; i++)
++ clrbits_le32(&dram->dllcr[i], DRAM_DLLCR_NRESET |
++ DRAM_DLLCR_DISABLE);
++ udelay(22);
++
++ for (i = 1; i < n; i++)
++ clrsetbits_le32(&dram->dllcr[i], DRAM_DLLCR_DISABLE,
++ DRAM_DLLCR_NRESET);
++ udelay(22);
++}
++
++static u32 hpcr_value[32] = {
++#ifdef CONFIG_SUN5I
++ 0, 0, 0, 0,
++ 0, 0, 0, 0,
++ 0, 0, 0, 0,
++ 0, 0, 0, 0,
++ 0x1031, 0x1031, 0x0735, 0x1035,
++ 0x1035, 0x0731, 0x1031, 0,
++ 0x0301, 0x0301, 0x0301, 0x0301,
++ 0x0301, 0x0301, 0x0301, 0
++#endif
++#ifdef CONFIG_SUN4I
++ 0x0301, 0x0301, 0x0301, 0x0301,
++ 0x0301, 0x0301, 0, 0,
++ 0, 0, 0, 0,
++ 0, 0, 0, 0,
++ 0x1031, 0x1031, 0x0735, 0x5031,
++ 0x1035, 0x0731, 0x1031, 0x0735,
++ 0x1035, 0x1031, 0x0731, 0x1035,
++ 0x1031, 0x0301, 0x0301, 0x0731
++#endif
++#ifdef CONFIG_SUN7I
++ 0x0301, 0x0301, 0x0301, 0x0301,
++ 0x0301, 0x0301, 0x0301, 0x0301,
++ 0, 0, 0, 0,
++ 0, 0, 0, 0,
++ 0x1031, 0x1031, 0x0735, 0x1035,
++ 0x1035, 0x0731, 0x1031, 0x0735,
++ 0x1035, 0x1031, 0x0731, 0x1035,
++ 0x0001, 0x1031, 0, 0x1031
++ /* last row differs from boot0 source table
++ * 0x1031, 0x0301, 0x0301, 0x0731
++ * but boot0 code skips #28 and #30, and sets #29 and #31 to the
++ * value from #28 entry (0x1031)
++ */
++#endif
++};
++
++static void mctl_configure_hostport(void)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++ u32 i;
++
++ for (i = 0; i < 32; i++)
++ writel(hpcr_value[i], &dram->hpcr[i]);
++}
++
++static void mctl_setup_dram_clock(u32 clk)
++{
++ u32 reg_val;
++ struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ /* setup DRAM PLL */
++ reg_val = readl(&ccm->pll5_cfg);
++ reg_val &= ~CCM_PLL5_CTRL_M_MASK; /* set M to 0 (x1) */
++ reg_val &= ~CCM_PLL5_CTRL_K_MASK; /* set K to 0 (x1) */
++ reg_val &= ~CCM_PLL5_CTRL_N_MASK; /* set N to 0 (x0) */
++ reg_val &= ~CCM_PLL5_CTRL_P_MASK; /* set P to 0 (x1) */
++ if (clk >= 540 && clk < 552) {
++ /* dram = 540MHz, pll5p = 540MHz */
++ reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
++ reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(3));
++ reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(15));
++ reg_val |= CCM_PLL5_CTRL_P(1);
++ } else if (clk >= 512 && clk < 528) {
++ /* dram = 512MHz, pll5p = 384MHz */
++ reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(3));
++ reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(4));
++ reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(16));
++ reg_val |= CCM_PLL5_CTRL_P(2);
++ } else if (clk >= 496 && clk < 504) {
++ /* dram = 496MHz, pll5p = 372MHz */
++ reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(3));
++ reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(2));
++ reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(31));
++ reg_val |= CCM_PLL5_CTRL_P(2);
++ } else if (clk >= 468 && clk < 480) {
++ /* dram = 468MHz, pll5p = 468MHz */
++ reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
++ reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(3));
++ reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(13));
++ reg_val |= CCM_PLL5_CTRL_P(1);
++ } else if (clk >= 396 && clk < 408) {
++ /* dram = 396MHz, pll5p = 396MHz */
++ reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
++ reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(3));
++ reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(11));
++ reg_val |= CCM_PLL5_CTRL_P(1);
++ } else {
++ /* any other frequency that is a multiple of 24 */
++ reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
++ reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(2));
++ reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(clk / 24));
++ reg_val |= CCM_PLL5_CTRL_P(CCM_PLL5_CTRL_P_X(2));
++ }
++ reg_val &= ~CCM_PLL5_CTRL_VCO_GAIN; /* PLL VCO Gain off */
++ reg_val |= CCM_PLL5_CTRL_EN; /* PLL On */
++ writel(reg_val, &ccm->pll5_cfg);
++ udelay(5500);
++
++ setbits_le32(&ccm->pll5_cfg, CCM_PLL5_CTRL_DDR_CLK);
++
++#if defined(CONFIG_SUN4I) || defined(CONFIG_SUN7I)
++ /* reset GPS */
++ clrbits_le32(&ccm->gps_clk_cfg, CCM_GPS_CTRL_RESET | CCM_GPS_CTRL_GATE);
++ setbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_GPS);
++ udelay(1);
++ clrbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_GPS);
++#endif
++
++#if defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I)
++ /* setup MBUS clock */
++ reg_val = CCM_MBUS_CTRL_GATE |
++#if defined(CONFIG_SUN7I) && defined(CONFIG_FAST_MBUS)
++ CCM_MBUS_CTRL_CLK_SRC(CCM_MBUS_CTRL_CLK_SRC_PLL6) |
++ CCM_MBUS_CTRL_N(CCM_MBUS_CTRL_N_X(1)) |
++ CCM_MBUS_CTRL_M(CCM_MBUS_CTRL_M_X(3));
++#elif defined(CONFIG_SUN7I) && !defined(CONFIG_FAST_MBUS)
++ CCM_MBUS_CTRL_CLK_SRC(CCM_MBUS_CTRL_CLK_SRC_PLL6) |
++ CCM_MBUS_CTRL_N(CCM_MBUS_CTRL_N_X(2)) |
++ CCM_MBUS_CTRL_M(CCM_MBUS_CTRL_M_X(2));
++#else /* defined(CONFIG_SUN5I) */
++ CCM_MBUS_CTRL_CLK_SRC(CCM_MBUS_CTRL_CLK_SRC_PLL5) |
++ CCM_MBUS_CTRL_N(CCM_MBUS_CTRL_N_X(1)) |
++ CCM_MBUS_CTRL_M(CCM_MBUS_CTRL_M_X(2));
++#endif
++ writel(reg_val, &ccm->mbus_clk_cfg);
++#endif
++
++ /*
++ * open DRAMC AHB & DLL register clock
++ * close it first
++ */
++#if defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I)
++ clrbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_SDRAM | CCM_AHB_GATE_DLL);
++#else
++ clrbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_SDRAM);
++#endif
++ udelay(22);
++
++ /* then open it */
++#if defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I)
++ setbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_SDRAM | CCM_AHB_GATE_DLL);
++#else
++ setbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_SDRAM);
++#endif
++ udelay(22);
++}
++
++static int dramc_scan_readpipe(void)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++ u32 reg_val;
++
++ /* data training trigger */
++#ifdef CONFIG_SUN7I
++ clrbits_le32(&dram->csr, DRAM_CSR_FAILED);
++#endif
++ setbits_le32(&dram->ccr, DRAM_CCR_DATA_TRAINING);
++
++ /* check whether data training process has completed */
++ await_completion(&dram->ccr, DRAM_CCR_DATA_TRAINING);
++
++ /* check data training result */
++ reg_val = readl(&dram->csr);
++ if (reg_val & DRAM_CSR_FAILED)
++ return -1;
++
++ return 0;
++}
++
++static int dramc_scan_dll_para(void)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++ const u32 dqs_dly[7] = {0x3, 0x2, 0x1, 0x0, 0xe, 0xd, 0xc};
++ const u32 clk_dly[15] = {0x07, 0x06, 0x05, 0x04, 0x03,
++ 0x02, 0x01, 0x00, 0x08, 0x10,
++ 0x18, 0x20, 0x28, 0x30, 0x38};
++ u32 clk_dqs_count[15];
++ u32 dqs_i, clk_i, cr_i;
++ u32 max_val, min_val;
++ u32 dqs_index, clk_index;
++
++ /* Find DQS_DLY Pass Count for every CLK_DLY */
++ for (clk_i = 0; clk_i < 15; clk_i++) {
++ clk_dqs_count[clk_i] = 0;
++ clrsetbits_le32(&dram->dllcr[0], 0x3f << 6,
++ (clk_dly[clk_i] & 0x3f) << 6);
++ for (dqs_i = 0; dqs_i < 7; dqs_i++) {
++ for (cr_i = 1; cr_i < 5; cr_i++) {
++ clrsetbits_le32(&dram->dllcr[cr_i],
++ 0x4f << 14,
++ (dqs_dly[dqs_i] & 0x4f) << 14);
++ }
++ udelay(2);
++ if (dramc_scan_readpipe() == 0)
++ clk_dqs_count[clk_i]++;
++ }
++ }
++ /* Test DQS_DLY Pass Count for every CLK_DLY from up to down */
++ for (dqs_i = 15; dqs_i > 0; dqs_i--) {
++ max_val = 15;
++ min_val = 15;
++ for (clk_i = 0; clk_i < 15; clk_i++) {
++ if (clk_dqs_count[clk_i] == dqs_i) {
++ max_val = clk_i;
++ if (min_val == 15)
++ min_val = clk_i;
++ }
++ }
++ if (max_val < 15)
++ break;
++ }
++
++ /* Check if Find a CLK_DLY failed */
++ if (!dqs_i)
++ goto fail;
++
++ /* Find the middle index of CLK_DLY */
++ clk_index = (max_val + min_val) >> 1;
++ if ((max_val == (15 - 1)) && (min_val > 0))
++ /* if CLK_DLY[MCTL_CLK_DLY_COUNT] is very good, then the middle
++ * value can be more close to the max_val
++ */
++ clk_index = (15 + clk_index) >> 1;
++ else if ((max_val < (15 - 1)) && (min_val == 0))
++ /* if CLK_DLY[0] is very good, then the middle value can be more
++ * close to the min_val
++ */
++ clk_index >>= 1;
++ if (clk_dqs_count[clk_index] < dqs_i)
++ clk_index = min_val;
++
++ /* Find the middle index of DQS_DLY for the CLK_DLY got above, and Scan
++ * read pipe again
++ */
++ clrsetbits_le32(&dram->dllcr[0], 0x3f << 6,
++ (clk_dly[clk_index] & 0x3f) << 6);
++ max_val = 7;
++ min_val = 7;
++ for (dqs_i = 0; dqs_i < 7; dqs_i++) {
++ clk_dqs_count[dqs_i] = 0;
++ for (cr_i = 1; cr_i < 5; cr_i++) {
++ clrsetbits_le32(&dram->dllcr[cr_i],
++ 0x4f << 14,
++ (dqs_dly[dqs_i] & 0x4f) << 14);
++ }
++ udelay(2);
++ if (dramc_scan_readpipe() == 0) {
++ clk_dqs_count[dqs_i] = 1;
++ max_val = dqs_i;
++ if (min_val == 7)
++ min_val = dqs_i;
++ }
++ }
++
++ if (max_val < 7) {
++ dqs_index = (max_val + min_val) >> 1;
++ if ((max_val == (7-1)) && (min_val > 0))
++ dqs_index = (7 + dqs_index) >> 1;
++ else if ((max_val < (7-1)) && (min_val == 0))
++ dqs_index >>= 1;
++ if (!clk_dqs_count[dqs_index])
++ dqs_index = min_val;
++ for (cr_i = 1; cr_i < 5; cr_i++) {
++ clrsetbits_le32(&dram->dllcr[cr_i],
++ 0x4f << 14,
++ (dqs_dly[dqs_index] & 0x4f) << 14);
++ }
++ udelay(2);
++ return dramc_scan_readpipe();
++ }
++
++fail:
++ clrbits_le32(&dram->dllcr[0], 0x3f << 6);
++ for (cr_i = 1; cr_i < 5; cr_i++)
++ clrbits_le32(&dram->dllcr[cr_i], 0x4f << 14);
++ udelay(2);
++
++ return dramc_scan_readpipe();
++}
++
++static void dramc_clock_output_en(u32 on)
++{
++#if defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I)
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++
++ if (on)
++ setbits_le32(&dram->mcr, DRAM_MCR_DCLK_OUT);
++ else
++ clrbits_le32(&dram->mcr, DRAM_MCR_DCLK_OUT);
++#endif
++#ifdef CONFIG_SUN4I
++ struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++ if (on)
++ setbits_le32(&ccm->dram_clk_cfg, CCM_DRAM_CTRL_DCLK_OUT);
++ else
++ clrbits_le32(&ccm->dram_clk_cfg, CCM_DRAM_CTRL_DCLK_OUT);
++#endif
++}
++
++static const u16 tRFC_table[2][6] = {
++ /* 256Mb 512Mb 1Gb 2Gb 4Gb 8Gb */
++ /* DDR2 75ns 105ns 127.5ns 195ns 327.5ns invalid */
++ { 77, 108, 131, 200, 336, 336 },
++ /* DDR3 invalid 90ns 110ns 160ns 300ns 350ns */
++ { 93, 93, 113, 164, 308, 359 }
++};
++
++static void dramc_set_autorefresh_cycle(u32 clk, u32 type, u32 density)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++ u32 tRFC, tREFI;
++
++ tRFC = (tRFC_table[type][density] * clk + 1023) >> 10;
++ tREFI = (7987 * clk) >> 10; /* <= 7.8us */
++
++ writel(DRAM_DRR_TREFI(tREFI) | DRAM_DRR_TRFC(tRFC), &dram->drr);
++}
++
++unsigned long dramc_init(struct dram_para *para)
++{
++ struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
++ u32 reg_val;
++ u32 density;
++ int ret_val;
++
++ /* check input dram parameter structure */
++ if (!para)
++ return 0;
++
++ /* setup DRAM relative clock */
++ mctl_setup_dram_clock(para->clock);
++
++#ifdef CONFIG_SUN5I
++ /* Disable any pad power save control */
++ writel(0, &dram->ppwrsctl);
++#endif
++
++ /* reset external DRAM */
++#ifndef CONFIG_SUN7I
++ mctl_ddr3_reset();
++#endif
++ mctl_set_drive();
++
++ /* dram clock off */
++ dramc_clock_output_en(0);
++
++#ifdef CONFIG_SUN4I
++ /* select dram controller 1 */
++ writel(DRAM_CSEL_MAGIC, &dram->csel);
++#endif
++
++ mctl_itm_disable();
++ mctl_enable_dll0(para->tpr3);
++
++ /* configure external DRAM */
++ reg_val = 0x0;
++ if (para->type == DRAM_MEMORY_TYPE_DDR3)
++ reg_val |= DRAM_DCR_TYPE_DDR3;
++ reg_val |= DRAM_DCR_IO_WIDTH(para->io_width >> 3);
++
++ if (para->density == 256)
++ density = DRAM_DCR_CHIP_DENSITY_256M;
++ else if (para->density == 512)
++ density = DRAM_DCR_CHIP_DENSITY_512M;
++ else if (para->density == 1024)
++ density = DRAM_DCR_CHIP_DENSITY_1024M;
++ else if (para->density == 2048)
++ density = DRAM_DCR_CHIP_DENSITY_2048M;
++ else if (para->density == 4096)
++ density = DRAM_DCR_CHIP_DENSITY_4096M;
++ else if (para->density == 8192)
++ density = DRAM_DCR_CHIP_DENSITY_8192M;
++ else
++ density = DRAM_DCR_CHIP_DENSITY_256M;
++
++ reg_val |= DRAM_DCR_CHIP_DENSITY(density);
++ reg_val |= DRAM_DCR_BUS_WIDTH((para->bus_width >> 3) - 1);
++ reg_val |= DRAM_DCR_RANK_SEL(para->rank_num - 1);
++ reg_val |= DRAM_DCR_CMD_RANK_ALL;
++ reg_val |= DRAM_DCR_MODE(DRAM_DCR_MODE_INTERLEAVE);
++ writel(reg_val, &dram->dcr);
++
++#ifdef CONFIG_SUN7I
++ setbits_le32(&dram->zqcr1, (0x1 << 24) | (0x1 << 1));
++ if (para->tpr4 & 0x2)
++ clrsetbits_le32(&dram->zqcr1, (0x1 << 24), (0x1 << 1));
++ dramc_clock_output_en(1);
++#endif
++
++#if (defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I))
++ /* set odt impendance divide ratio */
++ reg_val = ((para->zq) >> 8) & 0xfffff;
++ reg_val |= ((para->zq) & 0xff) << 20;
++ reg_val |= (para->zq) & 0xf0000000;
++ writel(reg_val, &dram->zqcr0);
++#endif
++
++#ifdef CONFIG_SUN7I
++ /* Set CKE Delay to about 1ms */
++ setbits_le32(&dram->idcr, 0x1ffff);
++#endif
++
++#ifdef CONFIG_SUN7I
++ if ((readl(&dram->ppwrsctl) & 0x1) != 0x1)
++ mctl_ddr3_reset();
++ else
++ setbits_le32(&dram->mcr, DRAM_MCR_RESET);
++#else
++ /* dram clock on */
++ dramc_clock_output_en(1);
++#endif
++
++ udelay(1);
++
++ await_completion(&dram->ccr, DRAM_CCR_INIT);
++
++ mctl_enable_dllx(para->tpr3);
++
++#ifdef CONFIG_SUN4I
++ /* set odt impedance divide ratio */
++ reg_val = ((para->zq) >> 8) & 0xfffff;
++ reg_val |= ((para->zq) & 0xff) << 20;
++ reg_val |= (para->zq) & 0xf0000000;
++ writel(reg_val, &dram->zqcr0);
++#endif
++
++#ifdef CONFIG_SUN4I
++ /* set I/O configure register */
++ reg_val = 0x00cc0000;
++ reg_val |= (para->odt_en) & 0x3;
++ reg_val |= ((para->odt_en) & 0x3) << 30;
++ writel(reg_val, &dram->iocr);
++#endif
++
++ /* set refresh period */
++ dramc_set_autorefresh_cycle(para->clock, para->type - 2, density);
++
++ /* set timing parameters */
++ writel(para->tpr0, &dram->tpr0);
++ writel(para->tpr1, &dram->tpr1);
++ writel(para->tpr2, &dram->tpr2);
++
++ if (para->type == DRAM_MEMORY_TYPE_DDR3) {
++ reg_val = DRAM_MR_BURST_LENGTH(0x0);
++#if (defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I))
++ reg_val |= DRAM_MR_POWER_DOWN;
++#endif
++ reg_val |= DRAM_MR_CAS_LAT(para->cas - 4);
++ reg_val |= DRAM_MR_WRITE_RECOVERY(0x5);
++ } else if (para->type == DRAM_MEMORY_TYPE_DDR2) {
++ reg_val = DRAM_MR_BURST_LENGTH(0x2);
++ reg_val |= DRAM_MR_CAS_LAT(para->cas);
++ reg_val |= DRAM_MR_WRITE_RECOVERY(0x5);
++ }
++ writel(reg_val, &dram->mr);
++
++ writel(para->emr1, &dram->emr);
++ writel(para->emr2, &dram->emr2);
++ writel(para->emr3, &dram->emr3);
++
++ /* set DQS window mode */
++ clrsetbits_le32(&dram->ccr, DRAM_CCR_DQS_DRIFT_COMP, DRAM_CCR_DQS_GATE);
++
++#ifdef CONFIG_SUN7I
++ /* Command rate timing mode 2T & 1T */
++ if (para->tpr4 & 0x1)
++ setbits_le32(&dram->ccr, DRAM_CCR_COMMAND_RATE_1T);
++#endif
++ /* reset external DRAM */
++ setbits_le32(&dram->ccr, DRAM_CCR_INIT);
++ await_completion(&dram->ccr, DRAM_CCR_INIT);
++
++#ifdef CONFIG_SUN7I
++ /* setup zq calibration manual */
++ reg_val = readl(&dram->ppwrsctl);
++ if ((reg_val & 0x1) == 1) {
++ /* super_standby_flag = 1 */
++
++ reg_val = readl(0x01c20c00 + 0x120); /* rtc */
++ reg_val &= 0x000fffff;
++ reg_val |= 0x17b00000;
++ writel(reg_val, &dram->zqcr0);
++
++ /* exit self-refresh state */
++ clrsetbits_le32(&dram->dcr, 0x1f << 27, 0x12 << 27);
++ /* check whether command has been executed */
++ await_completion(&dram->dcr, 0x1 << 31);
++
++ udelay(2);
++
++ /* dram pad hold off */
++ setbits_le32(&dram->ppwrsctl, 0x16510000);
++
++ await_completion(&dram->ppwrsctl, 0x1);
++
++ /* exit self-refresh state */
++ clrsetbits_le32(&dram->dcr, 0x1f << 27, 0x12 << 27);
++
++ /* check whether command has been executed */
++ await_completion(&dram->dcr, 0x1 << 31);
++
++ udelay(2);
++
++ /* issue a refresh command */
++ clrsetbits_le32(&dram->dcr, 0x1f << 27, 0x13 << 27);
++ await_completion(&dram->dcr, 0x1 << 31);
++
++ udelay(2);
++ }
++#endif
++
++ /* scan read pipe value */
++ mctl_itm_enable();
++ if (para->tpr3 & (0x1 << 31)) {
++ ret_val = dramc_scan_dll_para();
++ if (ret_val == 0)
++ para->tpr3 =
++ (((readl(&dram->dllcr[0]) >> 6) & 0x3f) << 16) |
++ (((readl(&dram->dllcr[1]) >> 14) & 0xf) << 0) |
++ (((readl(&dram->dllcr[2]) >> 14) & 0xf) << 4) |
++ (((readl(&dram->dllcr[3]) >> 14) & 0xf) << 8) |
++ (((readl(&dram->dllcr[4]) >> 14) & 0xf) << 12
++ );
++ } else {
++ ret_val = dramc_scan_readpipe();
++ }
++
++ if (ret_val < 0)
++ return 0;
++
++ /* configure all host port */
++ mctl_configure_hostport();
++
++ return get_ram_size((long *)PHYS_SDRAM_0, PHYS_SDRAM_0_SIZE);
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/early_print.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/early_print.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/early_print.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/early_print.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,55 @@
++/*
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * Early uart print for debugging.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/cpu.h>
++#include <asm/arch/early_print.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/sys_proto.h>
++
++static int uart_initialized = 0;
++
++#if CONFIG_CONS_INDEX < 5
++#define UART CONFIG_CONS_INDEX-1
++#else
++/* SUNXI_R_UART_BASE */
++#define UART 2922
++#endif
++
++void uart_init(void) {
++
++ /* select dll dlh */
++ writel(UART_LCR_DLAB, UART_LCR(UART));
++ /* set baudrate */
++ writel(0, UART_DLH(UART));
++ writel(BAUD_115200, UART_DLL(UART));
++ /* set line control */
++ writel(LC_8_N_1, UART_LCR(UART));
++
++ uart_initialized = 1;
++}
++
++#define TX_READY (readl(UART_LSR(UART)) & UART_LSR_TEMT)
++
++void uart_putc(char c) {
++
++ while (!TX_READY)
++ ;
++ writel(c, UART_THR(UART));
++}
++
++void uart_puts(const char *s) {
++
++ while (*s)
++ uart_putc(*s++);
++}
++
++
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/Makefile u-boot-sunxi/arch/arm/cpu/armv7/sunxi/Makefile
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/Makefile 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,44 @@
++#
++# (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++#
++# Based on some other Makefile
++# (C) Copyright 2000-2003
++# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++#
++# SPDX-License-Identifier: GPL-2.0+
++#
++obj-y += timer.o
++obj-y += board.o
++obj-y += clock.o
++obj-y += pinmux.o
++obj-y += watchdog.o
++obj-$(CONFIG_SUN6I) += prcm.o
++obj-$(CONFIG_SUN8I) += prcm.o
++obj-$(CONFIG_SUN6I) += p2wi.o
++obj-$(CONFIG_SUN4I) += clock_sun4i.o
++obj-$(CONFIG_SUN5I) += clock_sun4i.o
++obj-$(CONFIG_SUN6I) += clock_sun6i.o
++obj-$(CONFIG_SUN7I) += clock_sun4i.o
++obj-$(CONFIG_SUN8I) += clock_sun6i.o
++ifdef DEBUG
++obj-y += early_print.o
++endif
++obj-$(CONFIG_BOARD_POSTCLK_INIT) += postclk_init.o
++obj-$(CONFIG_SYS_SECONDARY_ON) += secondary_init.o
++obj-$(CONFIG_SYS_SECONDARY_ON) += smp.o
++
++ifndef CONFIG_SPL_BUILD
++obj-y += cpu_info.o
++ifdef CONFIG_CMD_WATCHDOG
++obj-$(CONFIG_CMD_WATCHDOG) += cmd_watchdog.o
++endif
++endif
++
++ifdef CONFIG_SPL_BUILD
++obj-$(CONFIG_SUN4I) += dram.o
++obj-$(CONFIG_SUN5I) += dram.o
++obj-$(CONFIG_SUN7I) += dram.o
++ifdef CONFIG_SPL_FEL
++obj-y += start.o
++endif
++endif
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/p2wi.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/p2wi.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/p2wi.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/p2wi.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,120 @@
++/*
++ * Sunxi A31 Power Management Unit
++ *
++ * (C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
++ * http://linux-sunxi.org
++ *
++ * Based on sun6i sources and earlier U-Boot Allwiner A10 SPL work
++ *
++ * (C) Copyright 2006-2013
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Berg Xing <bergxing@allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <errno.h>
++#include <asm/io.h>
++#include <asm/arch/cpu.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/p2wi.h>
++#include <asm/arch/prcm.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/sys_proto.h>
++
++void p2wi_init(void)
++{
++ struct sunxi_p2wi_reg *p2wi = (struct sunxi_p2wi_reg *)SUNXI_P2WI_BASE;
++
++ /* Enable p2wi and PIO clk, and de-assert their resets */
++ prcm_apb0_enable(PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_P2WI);
++
++ sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUNXI_GPL0_R_P2WI_SCK);
++ sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUNXI_GPL1_R_P2WI_SDA);
++
++ /* Reset p2wi controller and set clock to CLKIN(12)/8 = 1.5 MHz */
++ writel(P2WI_CTRL_RESET, &p2wi->ctrl);
++ sdelay(0x100);
++ writel(P2WI_CC_SDA_OUT_DELAY(1) | P2WI_CC_CLK_DIV(8),
++ &p2wi->cc);
++}
++
++int p2wi_set_pmu_address(u8 slave_addr, u8 ctrl_reg, u8 init_data)
++{
++ struct sunxi_p2wi_reg *p2wi = (struct sunxi_p2wi_reg *)SUNXI_P2WI_BASE;
++ int i;
++
++ writel(P2WI_PM_DEV_ADDR(slave_addr) |
++ P2WI_PM_CTRL_ADDR(ctrl_reg) |
++ P2WI_PM_INIT_DATA(init_data) |
++ P2WI_PM_INIT_SEND,
++ &p2wi->pm);
++ for (i = 0xffffff; i != 0; i--)
++ if (!(readl(&p2wi->pm) & P2WI_PM_INIT_SEND))
++ break;
++ if (readl(&p2wi->pm) & P2WI_PM_INIT_SEND)
++ return -EFAULT;
++
++ return 0;
++}
++
++int p2wi_read(const u8 addr, u8 *data)
++{
++ struct sunxi_p2wi_reg *p2wi = (struct sunxi_p2wi_reg *)SUNXI_P2WI_BASE;
++ int i, ret = 0;
++ u8 reg;
++
++ writel(P2WI_DATADDR_BYTE_1(addr), &p2wi->dataddr0);
++ writel(P2WI_DATA_NUM_BYTES(1) |
++ P2WI_DATA_NUM_BYTES_READ, &p2wi->numbytes);
++ writel(P2WI_STAT_TRANS_DONE, &p2wi->status);
++ writel(P2WI_CTRL_TRANS_START, &p2wi->ctrl);
++
++ for (i = 0xffffff; i != 0; i--) {
++ reg = readl(&p2wi->status);
++ if (reg & P2WI_STAT_TRANS_ERR) {
++ ret = -EIO;
++ break;
++ }
++ if (reg & P2WI_STAT_TRANS_DONE)
++ break;
++ }
++
++ if (i == 0)
++ ret = -ETIME;
++
++ *data = readl(&p2wi->data0) & P2WI_DATA_BYTE_1_MASK;
++ writel(reg, &p2wi->status); /* Clear status bits */
++ return ret;
++}
++
++int p2wi_write(const u8 addr, u8 data)
++{
++ struct sunxi_p2wi_reg *p2wi = (struct sunxi_p2wi_reg *)SUNXI_P2WI_BASE;
++ int i, ret = 0;
++ u8 reg;
++
++ writel(P2WI_DATADDR_BYTE_1(addr), &p2wi->dataddr0);
++ writel(P2WI_DATA_BYTE_1(data), &p2wi->data0);
++ writel(P2WI_DATA_NUM_BYTES(1), &p2wi->numbytes);
++ writel(P2WI_STAT_TRANS_DONE, &p2wi->status);
++ writel(P2WI_CTRL_TRANS_START, &p2wi->ctrl);
++
++ for (i = 0xffffff; i != 0; i--) {
++ reg = readl(&p2wi->status);
++ if (reg & P2WI_STAT_TRANS_ERR) {
++ ret = -EIO;
++ break;
++ }
++ if (reg & P2WI_STAT_TRANS_DONE)
++ break;
++ }
++
++ if (i == 0)
++ ret = -ETIME;
++
++ writel(reg, &p2wi->status); /* Clear status bits */
++ return ret;
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/pinmux.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/pinmux.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/pinmux.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/pinmux.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,61 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/gpio.h>
++
++int sunxi_gpio_set_cfgpin(u32 pin, u32 val)
++{
++ u32 bank = GPIO_BANK(pin);
++ u32 index = GPIO_CFG_INDEX(pin);
++ u32 offset = GPIO_CFG_OFFSET(pin);
++ struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
++
++ clrsetbits_le32(&pio->cfg[0] + index, 0xf << offset, val << offset);
++
++ return 0;
++}
++
++int sunxi_gpio_get_cfgpin(u32 pin)
++{
++ u32 cfg;
++ u32 bank = GPIO_BANK(pin);
++ u32 index = GPIO_CFG_INDEX(pin);
++ u32 offset = GPIO_CFG_OFFSET(pin);
++ struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
++
++ cfg = readl(&pio->cfg[0] + index);
++ cfg >>= offset;
++
++ return cfg & 0xf;
++}
++
++int sunxi_gpio_set_drv(u32 pin, u32 val)
++{
++ u32 bank = GPIO_BANK(pin);
++ u32 index = GPIO_DRV_INDEX(pin);
++ u32 offset = GPIO_DRV_OFFSET(pin);
++ struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
++
++ clrsetbits_le32(&pio->drv[0] + index, 0x3 << offset, val << offset);
++
++ return 0;
++}
++
++int sunxi_gpio_set_pull(u32 pin, u32 val)
++{
++ u32 bank = GPIO_BANK(pin);
++ u32 index = GPIO_PULL_INDEX(pin);
++ u32 offset = GPIO_PULL_OFFSET(pin);
++ struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
++
++ clrsetbits_le32(&pio->pull[0] + index, 0x3 << offset, val << offset);
++
++ return 0;
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/postclk_init.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/postclk_init.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/postclk_init.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/postclk_init.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,20 @@
++/*
++ * (C) Copyright 2013
++ * Carl van Schaik <carl@ok-labs.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#if defined(CONFIG_SYS_SECONDARY_ON)
++#include <asm/arch/smp.h>
++#endif
++
++
++int board_postclk_init(void)
++{
++#if defined(CONFIG_SYS_SECONDARY_ON)
++ startup_secondaries();
++#endif
++ return 0;
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/prcm.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/prcm.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/prcm.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/prcm.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,35 @@
++/*
++ * Sunxi A31 Power Management Unit
++ *
++ * (C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
++ * http://linux-sunxi.org
++ *
++ * Based on sun6i sources and earlier U-Boot Allwiner A10 SPL work
++ *
++ * (C) Copyright 2006-2013
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Berg Xing <bergxing@allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <errno.h>
++#include <asm/io.h>
++#include <asm/arch/cpu.h>
++#include <asm/arch/prcm.h>
++#include <asm/arch/sys_proto.h>
++
++/* APB0 clock gate and reset bit offsets are the same. */
++void prcm_apb0_enable(u32 flags)
++{
++ struct sunxi_prcm_reg *prcm =
++ (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;
++
++ /* open the clock for module */
++ setbits_le32(&prcm->apb0_gate, flags);
++
++ /* deassert reset for module */
++ setbits_le32(&prcm->apb0_reset, flags);
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/secondary_init.S u-boot-sunxi/arch/arm/cpu/armv7/sunxi/secondary_init.S
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/secondary_init.S 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/secondary_init.S 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,31 @@
++/*
++ * A lowlevel_init function that sets up the stack to call a C function to
++ * perform further init.
++ *
++ * (C) Copyright 2013
++ * Carl van Schaik <carl@ok-labs.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#include <asm-offsets.h>
++#include <config.h>
++#include <linux/linkage.h>
++
++ENTRY(secondary_init)
++ /* Get cpu number : r5 */
++ mrc p15, 0, r5, c0, c0, 5
++ and r5, r5, #0xff
++
++ /*
++ * Setup a secondary stack, each core gets 128 bytes.
++ */
++ ldr sp, =secondary_stack
++ mov r0, #0x80
++ add sp, sp, r0, lsl r5
++
++ /*
++ * Jump to C
++ */
++ bl secondary_start
++ENDPROC(secondary_init)
++
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/smp.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/smp.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/smp.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/smp.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,80 @@
++/*
++ * (C) Copyright 2013
++ * Carl van Schaik <carl@ok-labs.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/smp.h>
++#include <asm/arch/cpucfg.h>
++
++/* Right now we assume only a single secondary as in sun7i */
++#if defined(CONFIG_SUN7I)
++#define NUM_CORES 2
++#else
++#error unsupported SoC
++#endif
++
++static void secondary_pen(void)
++{
++ struct sunxi_cpucfg *cpucfg = (struct sunxi_cpucfg *)SUNXI_CPUCFG_BASE;
++
++ while (1) {
++ __asm__ __volatile__("wfe" ::: "memory");
++
++ unsigned long boot_addr = readl(&cpucfg->boot_addr);
++
++ __asm__ __volatile__(
++ "mov r14, %0 \n"
++ "bx r14 \n"
++ : : "r" (boot_addr)
++ );
++ };
++}
++
++u32 secondary_stack[32*(NUM_CORES-1)];
++
++void secondary_start(void)
++{
++ secondary_pen();
++}
++
++/* Power on secondaries */
++void startup_secondaries(void)
++{
++ int i;
++ struct sunxi_cpucfg *cpucfg = (struct sunxi_cpucfg *)SUNXI_CPUCFG_BASE;
++
++ writel((u32)secondary_init, &cpucfg->boot_addr);
++
++ for (i = 1; i < NUM_CORES; i++) {
++ /* Assert CPU reset just in case */
++ writel(CPU_RESET_SET, &cpucfg->cpu[i].reset_ctrl);
++ /* Ensure CPU reset also invalidates L1 caches */
++ clrbits_le32(&cpucfg->general_ctrl,
++ GENERAL_CTRL_NO_L1_RESET_CPU(i));
++ /* Lock CPU */
++ clrbits_le32(&cpucfg->debug1_ctrl, 1 << i);
++
++ /* Ramp up power to CPU1 */
++ assert(i == 1);
++ u32 j = 0xff << 1;
++ do {
++ j = j >> 1;
++ writel(j, &cpucfg->cpu1_power_clamp);
++ } while (j != 0);
++
++ udelay(10*1000); /* 10ms */
++
++ clrbits_le32(&cpucfg->cpu1_power_off, 1);
++ /* Release CPU reset */
++ writel(CPU_RESET_CLEAR, &cpucfg->cpu[i].reset_ctrl);
++
++ /* Unlock CPU */
++ setbits_le32(&cpucfg->debug1_ctrl, 1 << i);
++
++ printf("Secondary CPU%d power-on\n", i);
++ }
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/start.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/start.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/start.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/start.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1 @@
++/* Intentionally empty. Only needed to get FEL SPL link line right */
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/timer.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/timer.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/timer.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/timer.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,113 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/arch/timer.h>
++
++DECLARE_GLOBAL_DATA_PTR;
++
++#define TIMER_MODE (0x0 << 7) /* continuous mode */
++#define TIMER_DIV (0x0 << 4) /* pre scale 1 */
++#define TIMER_SRC (0x1 << 2) /* osc24m */
++#define TIMER_RELOAD (0x1 << 1) /* reload internal value */
++#define TIMER_EN (0x1 << 0) /* enable timer */
++
++#define TIMER_CLOCK (24 * 1000 * 1000)
++#define COUNT_TO_USEC(x) ((x) / 24)
++#define USEC_TO_COUNT(x) ((x) * 24)
++#define TICKS_PER_HZ (TIMER_CLOCK / CONFIG_SYS_HZ)
++#define TICKS_TO_HZ(x) ((x) / TICKS_PER_HZ)
++
++#define TIMER_LOAD_VAL 0xffffffff
++
++#define TIMER_NUM 0 /* we use timer 0 */
++
++/* read the 32-bit timer */
++static ulong read_timer(void)
++{
++ struct sunxi_timer_reg *timers =
++ (struct sunxi_timer_reg *)SUNXI_TIMER_BASE;
++ struct sunxi_timer *timer = &timers->timer[TIMER_NUM];
++
++ /*
++ * The hardware timer counts down, therefore we invert to
++ * produce an incrementing timer.
++ */
++ return ~readl(&timer->val);
++}
++
++/* init timer register */
++int timer_init(void)
++{
++ struct sunxi_timer_reg *timers =
++ (struct sunxi_timer_reg *)SUNXI_TIMER_BASE;
++ struct sunxi_timer *timer = &timers->timer[TIMER_NUM];
++ writel(TIMER_LOAD_VAL, &timer->inter);
++ writel(TIMER_MODE | TIMER_DIV | TIMER_SRC | TIMER_RELOAD | TIMER_EN,
++ &timer->ctl);
++
++ return 0;
++}
++
++/* timer without interrupts */
++ulong get_timer(ulong base)
++{
++ return get_timer_masked() - base;
++}
++
++ulong get_timer_masked(void)
++{
++ /* current tick value */
++ ulong now = TICKS_TO_HZ(read_timer());
++
++ if (now >= gd->arch.lastinc) /* normal (non rollover) */
++ gd->arch.tbl += (now - gd->arch.lastinc);
++ else {
++ /* rollover */
++ gd->arch.tbl += (TICKS_TO_HZ(TIMER_LOAD_VAL)
++ - gd->arch.lastinc) + now;
++ }
++ gd->arch.lastinc = now;
++
++ return gd->arch.tbl;
++}
++
++/* delay x useconds */
++void __udelay(unsigned long usec)
++{
++ long tmo = USEC_TO_COUNT(usec);
++ ulong now, last = read_timer();
++
++ while (tmo > 0) {
++ now = read_timer();
++ if (now > last) /* normal (non rollover) */
++ tmo -= now - last;
++ else /* rollover */
++ tmo -= TIMER_LOAD_VAL - last + now;
++ last = now;
++ }
++}
++
++/*
++ * This function is derived from PowerPC code (read timebase as long long).
++ * On ARM it just returns the timer value.
++ */
++unsigned long long get_ticks(void)
++{
++ return get_timer(0);
++}
++
++/*
++ * This function is derived from PowerPC code (timebase clock frequency).
++ * On ARM it returns the number of timer ticks per second.
++ */
++ulong get_tbclk(void)
++{
++ return CONFIG_SYS_HZ;
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds u-boot-sunxi/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,77 @@
++/*
++ * (C) Copyright 2013
++ * Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(s_init)
++SECTIONS
++{
++ . = 0x00002000;
++
++ . = ALIGN(4);
++ .text :
++ {
++ *(.text.s_init)
++ *(.text*)
++ }
++
++ . = ALIGN(4);
++ .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
++
++ . = ALIGN(4);
++ .data : {
++ *(.data*)
++ }
++
++ . = ALIGN(4);
++ . = .;
++
++ . = ALIGN(4);
++ .rel.dyn : {
++ __rel_dyn_start = .;
++ *(.rel*)
++ __rel_dyn_end = .;
++ }
++
++ .dynsym : {
++ __dynsym_start = .;
++ *(.dynsym)
++ }
++
++ . = ALIGN(4);
++ .note.gnu.build-id :
++ {
++ *(.note.gnu.build-id)
++ }
++ _end = .;
++
++ . = ALIGN(4096);
++ .mmutable : {
++ *(.mmutable)
++ }
++
++ .bss_start __rel_dyn_start (OVERLAY) : {
++ KEEP(*(.__bss_start));
++ __bss_base = .;
++ }
++
++ .bss __bss_base (OVERLAY) : {
++ *(.bss*)
++ . = ALIGN(4);
++ __bss_limit = .;
++ }
++
++ .bss_end __bss_limit (OVERLAY) : {
++ KEEP(*(.__bss_end));
++ }
++
++ /DISCARD/ : { *(.dynstr*) }
++ /DISCARD/ : { *(.dynamic*) }
++ /DISCARD/ : { *(.plt*) }
++ /DISCARD/ : { *(.interp*) }
++ /DISCARD/ : { *(.gnu*) }
++ /DISCARD/ : { *(.note*) }
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds u-boot-sunxi/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,52 @@
++/*
++ * (C) Copyright 2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * Based on omap-common/u-boot-spl.lds:
++ *
++ * (C) Copyright 2002
++ * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
++ *
++ * (C) Copyright 2010
++ * Texas Instruments, <www.ti.com>
++ * Aneesh V <aneesh@ti.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
++ LENGTH = CONFIG_SPL_MAX_SIZE }
++MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
++ LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
++
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(_start)
++SECTIONS
++{
++ .text :
++ {
++ __start = .;
++ arch/arm/cpu/armv7/start.o (.text)
++ *(.text*)
++ } > .sram
++
++ . = ALIGN(4);
++ .rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
++
++ . = ALIGN(4);
++ .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
++
++ . = ALIGN(4);
++ __image_copy_end = .;
++ _end = .;
++
++ .bss :
++ {
++ . = ALIGN(4);
++ __bss_start = .;
++ *(.bss*)
++ . = ALIGN(4);
++ __bss_end = .;
++ } > .sdram
++}
+diff -ruN u-boot-2014.04/arch/arm/cpu/armv7/sunxi/watchdog.c u-boot-sunxi/arch/arm/cpu/armv7/sunxi/watchdog.c
+--- u-boot-2014.04/arch/arm/cpu/armv7/sunxi/watchdog.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/cpu/armv7/sunxi/watchdog.c 2014-09-06 16:58:35.317953141 +0200
+@@ -0,0 +1,83 @@
++/*
++ * Watchdog driver for the Allwinner sunxi platform.
++ * Copyright (C) 2013 Oliver Schinagl <oliver@schinagl.nl>
++ * http://www.linux-sunxi.org/
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <asm/io.h>
++#include <asm/arch/timer.h>
++#include <asm/arch/watchdog.h>
++#include <common.h>
++#include <watchdog.h>
++
++
++#define WDT_CTRL_RESTART (0x1 << 0)
++#define WDT_CTRL_KEY (0x0a57 << 1)
++
++#define WDT_MODE_EN (0x1 << 0)
++#define WDT_MODE_RESET_EN (0x1 << 1)
++#define WDT_MAX_TIMEOUT 16
++#define WDT_MODE_TIMEOUT(n) \
++ (wdt_timeout_map[(n) < WDT_MAX_TIMEOUT ? (n) : WDT_MAX_TIMEOUT] << 3)
++
++
++/*
++ * Watchdog timeout table. The sunxi cores only use 4 bits for the watchdog as
++ * set by the table below. The gaps are filled by rounding up to the next
++ * second up.
++ */
++const unsigned int wdt_timeout_map[] = {
++ [0] = 0b0000, /* 0.5s*/
++ [1] = 0b0001, /* 1s */
++ [2] = 0b0010, /* 2s */
++ [3] = 0b0011, /* 3s */
++ [4] = 0b0100, /* 4s */
++ [5] = 0b0101, /* 5s */
++ [6] = 0b0110, /* 6s */
++ [7] = 0b0111, /* 8s */
++ [8] = 0b0111, /* 8s */
++ [9] = 0b1000, /* 10s */
++ [10] = 0b1000, /* 10s */
++ [11] = 0b1001, /* 12s */
++ [12] = 0b1001, /* 12s */
++ [13] = 0b1010, /* 14s */
++ [14] = 0b1010, /* 14s */
++ [15] = 0b1011, /* 16s */
++ [16] = 0b1011, /* 16s */
++};
++
++
++void watchdog_reset(void)
++{
++ static const struct sunxi_wdog *wdog =
++ &((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
++
++ writel(WDT_CTRL_KEY | WDT_CTRL_RESTART, &wdog->ctl);
++}
++
++void watchdog_set(int timeout)
++{
++ static struct sunxi_wdog *const wdog =
++ &((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
++
++ /* Set timeout, reset & enable */
++ if (timeout >= 0) {
++ writel(WDT_MODE_TIMEOUT(timeout) |
++ WDT_MODE_RESET_EN | WDT_MODE_EN,
++ &wdog->mode);
++ } else {
++ writel(0, &wdog->mode);
++ }
++ watchdog_reset();
++}
++
++void watchdog_init(void)
++{
++#ifdef CONFIG_WATCHDOG
++ watchdog_set(WDT_MAX_TIMEOUT);
++#else
++ watchdog_set(WDT_OFF); /* no timeout */
++#endif
++}
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/clock.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/clock.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/clock.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/clock.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,33 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_CLOCK_H
++#define _SUNXI_CLOCK_H
++
++#include <linux/types.h>
++
++#define CLK_GATE_OPEN 0x1
++#define CLK_GATE_CLOSE 0x0
++
++/* clock control module regs definition */
++#if defined(CONFIG_SUN6I) || defined(CONFIG_SUN8I)
++#include <asm/arch/clock_sun6i.h>
++#else
++#include <asm/arch/clock_sun4i.h>
++#endif
++
++#ifndef __ASSEMBLY__
++int clock_init(void);
++int clock_twi_onoff(int port, int state);
++void clock_set_pll1(unsigned int hz);
++unsigned int clock_get_pll6(void);
++void clock_init_safe(void);
++void clock_init_uart(void);
++#endif
++
++#endif /* _SUNXI_CLOCK_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/clock_sun4i.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/clock_sun4i.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/clock_sun4i.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/clock_sun4i.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,256 @@
++/*
++ * sun4i, sun5i and sun7i clock register definitions
++ *
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_CLOCK_SUN4I_H
++#define _SUNXI_CLOCK_SUN4I_H
++
++struct sunxi_ccm_reg {
++ u32 pll1_cfg; /* 0x00 pll1 control */
++ u32 pll1_tun; /* 0x04 pll1 tuning */
++ u32 pll2_cfg; /* 0x08 pll2 control */
++ u32 pll2_tun; /* 0x0c pll2 tuning */
++ u32 pll3_cfg; /* 0x10 pll3 control */
++ u8 res0[0x4];
++ u32 pll4_cfg; /* 0x18 pll4 control */
++ u8 res1[0x4];
++ u32 pll5_cfg; /* 0x20 pll5 control */
++ u32 pll5_tun; /* 0x24 pll5 tuning */
++ u32 pll6_cfg; /* 0x28 pll6 control */
++ u32 pll6_tun; /* 0x2c pll6 tuning */
++ u32 pll7_cfg; /* 0x30 pll7 control */
++ u32 pll1_tun2; /* 0x34 pll5 tuning2 */
++ u8 res2[0x4];
++ u32 pll5_tun2; /* 0x3c pll5 tuning2 */
++ u8 res3[0xc];
++ u32 pll_lock_dbg; /* 0x4c pll lock time debug */
++ u32 osc24m_cfg; /* 0x50 osc24m control */
++ u32 cpu_ahb_apb0_cfg; /* 0x54 cpu,ahb and apb0 divide ratio */
++ u32 apb1_clk_div_cfg; /* 0x58 apb1 clock dividor */
++ u32 axi_gate; /* 0x5c axi module clock gating */
++ u32 ahb_gate0; /* 0x60 ahb module clock gating 0 */
++ u32 ahb_gate1; /* 0x64 ahb module clock gating 1 */
++ u32 apb0_gate; /* 0x68 apb0 module clock gating */
++ u32 apb1_gate; /* 0x6c apb1 module clock gating */
++ u8 res4[0x10];
++ u32 nand_sclk_cfg; /* 0x80 nand sub clock control */
++ u32 ms_sclk_cfg; /* 0x84 memory stick sub clock control */
++ u32 sd0_clk_cfg; /* 0x88 sd0 clock control */
++ u32 sd1_clk_cfg; /* 0x8c sd1 clock control */
++ u32 sd2_clk_cfg; /* 0x90 sd2 clock control */
++ u32 sd3_clk_cfg; /* 0x94 sd3 clock control */
++ u32 ts_clk_cfg; /* 0x98 transport stream clock control */
++ u32 ss_clk_cfg; /* 0x9c */
++ u32 spi0_clk_cfg; /* 0xa0 */
++ u32 spi1_clk_cfg; /* 0xa4 */
++ u32 spi2_clk_cfg; /* 0xa8 */
++ u32 pata_clk_cfg; /* 0xac */
++ u32 ir0_clk_cfg; /* 0xb0 */
++ u32 ir1_clk_cfg; /* 0xb4 */
++ u32 iis_clk_cfg; /* 0xb8 */
++ u32 ac97_clk_cfg; /* 0xbc */
++ u32 spdif_clk_cfg; /* 0xc0 */
++ u32 keypad_clk_cfg; /* 0xc4 */
++ u32 sata_clk_cfg; /* 0xc8 */
++ u32 usb_clk_cfg; /* 0xcc */
++ u32 gps_clk_cfg; /* 0xd0 */
++ u32 spi3_clk_cfg; /* 0xd4 */
++ u8 res5[0x28];
++ u32 dram_clk_cfg; /* 0x100 */
++ u32 be0_clk_cfg; /* 0x104 */
++ u32 be1_clk_cfg; /* 0x108 */
++ u32 fe0_clk_cfg; /* 0x10c */
++ u32 fe1_clk_cfg; /* 0x110 */
++ u32 mp_clk_cfg; /* 0x114 */
++ u32 lcd0_ch0_clk_cfg; /* 0x118 */
++ u32 lcd1_ch0_clk_cfg; /* 0x11c */
++ u32 csi_isp_clk_cfg; /* 0x120 */
++ u8 res6[0x4];
++ u32 tvd_clk_reg; /* 0x128 */
++ u32 lcd0_ch1_clk_cfg; /* 0x12c */
++ u32 lcd1_ch1_clk_cfg; /* 0x130 */
++ u32 csi0_clk_cfg; /* 0x134 */
++ u32 csi1_clk_cfg; /* 0x138 */
++ u32 ve_clk_cfg; /* 0x13c */
++ u32 audio_codec_clk_cfg; /* 0x140 */
++ u32 avs_clk_cfg; /* 0x144 */
++ u32 ace_clk_cfg; /* 0x148 */
++ u32 lvds_clk_cfg; /* 0x14c */
++ u32 hdmi_clk_cfg; /* 0x150 */
++ u32 mali_clk_cfg; /* 0x154 */
++ u8 res7[0x4];
++ u32 mbus_clk_cfg; /* 0x15c */
++ u8 res8[0x4];
++ u32 gmac_clk_cfg; /* 0x164 */
++};
++
++/* apb1 bit field */
++#define APB1_CLK_SRC_OSC24M (0x0 << 24)
++#define APB1_CLK_SRC_PLL6 (0x1 << 24)
++#define APB1_CLK_SRC_LOSC (0x2 << 24)
++#define APB1_CLK_SRC_MASK (0x3 << 24)
++#define APB1_CLK_RATE_N_1 (0x0 << 16)
++#define APB1_CLK_RATE_N_2 (0x1 << 16)
++#define APB1_CLK_RATE_N_4 (0x2 << 16)
++#define APB1_CLK_RATE_N_8 (0x3 << 16)
++#define APB1_CLK_RATE_N_MASK (3 << 16)
++#define APB1_CLK_RATE_M(m) (((m)-1) << 0)
++#define APB1_CLK_RATE_M_MASK (0x1f << 0)
++
++/* apb1 gate field */
++#define APB1_GATE_UART_SHIFT (16)
++#define APB1_GATE_UART_MASK (0xff << APB1_GATE_UART_SHIFT)
++#define APB1_GATE_TWI_SHIFT (0)
++#define APB1_GATE_TWI_MASK (0xf << APB1_GATE_TWI_SHIFT)
++
++/* clock divide */
++#define AXI_DIV_SHIFT (0)
++#define AXI_DIV_1 0
++#define AXI_DIV_2 1
++#define AXI_DIV_3 2
++#define AXI_DIV_4 3
++#define AHB_DIV_SHIFT (4)
++#define AHB_DIV_1 0
++#define AHB_DIV_2 1
++#define AHB_DIV_4 2
++#define AHB_DIV_8 3
++#define APB0_DIV_SHIFT (8)
++#define APB0_DIV_1 0
++#define APB0_DIV_2 1
++#define APB0_DIV_4 2
++#define APB0_DIV_8 3
++#define CPU_CLK_SRC_SHIFT (16)
++#define CPU_CLK_SRC_OSC24M 1
++#define CPU_CLK_SRC_PLL1 2
++
++#define CCM_PLL1_CFG_ENABLE_SHIFT 31
++#define CCM_PLL1_CFG_VCO_RST_SHIFT 30
++#define CCM_PLL1_CFG_VCO_BIAS_SHIFT 26
++#define CCM_PLL1_CFG_PLL4_EXCH_SHIFT 25
++#define CCM_PLL1_CFG_BIAS_CUR_SHIFT 20
++#define CCM_PLL1_CFG_DIVP_SHIFT 16
++#define CCM_PLL1_CFG_LCK_TMR_SHIFT 13
++#define CCM_PLL1_CFG_FACTOR_N_SHIFT 8
++#define CCM_PLL1_CFG_FACTOR_K_SHIFT 4
++#define CCM_PLL1_CFG_SIG_DELT_PAT_IN_SHIFT 3
++#define CCM_PLL1_CFG_SIG_DELT_PAT_EN_SHIFT 2
++#define CCM_PLL1_CFG_FACTOR_M_SHIFT 0
++
++#define PLL1_CFG_DEFAULT 0xa1005000
++
++#define PLL6_CFG_DEFAULT 0xa1009911
++
++/* nand clock */
++#define NAND_CLK_SRC_OSC24 0
++#define NAND_CLK_DIV_N 0
++#define NAND_CLK_DIV_M 0
++
++/* gps clock */
++#define GPS_SCLK_GATING_OFF 0
++#define GPS_RESET 0
++
++/* ahb clock gate bit offset */
++#define AHB_GATE_OFFSET_GPS 26
++#define AHB_GATE_OFFSET_SATA 25
++#define AHB_GATE_OFFSET_PATA 24
++#define AHB_GATE_OFFSET_SPI3 23
++#define AHB_GATE_OFFSET_SPI2 22
++#define AHB_GATE_OFFSET_SPI1 21
++#define AHB_GATE_OFFSET_SPI0 20
++#define AHB_GATE_OFFSET_TS0 18
++#define AHB_GATE_OFFSET_EMAC 17
++#define AHB_GATE_OFFSET_ACE 16
++#define AHB_GATE_OFFSET_DLL 15
++#define AHB_GATE_OFFSET_SDRAM 14
++#define AHB_GATE_OFFSET_NAND 13
++#define AHB_GATE_OFFSET_MS 12
++#define AHB_GATE_OFFSET_MMC3 11
++#define AHB_GATE_OFFSET_MMC2 10
++#define AHB_GATE_OFFSET_MMC1 9
++#define AHB_GATE_OFFSET_MMC0 8
++#define AHB_GATE_OFFSET_MMC(n) (AHB_GATE_OFFSET_MMC0 + (n))
++#define AHB_GATE_OFFSET_BIST 7
++#define AHB_GATE_OFFSET_DMA 6
++#define AHB_GATE_OFFSET_SS 5
++#define AHB_GATE_OFFSET_USB_OHCI1 4
++#define AHB_GATE_OFFSET_USB_EHCI1 3
++#define AHB_GATE_OFFSET_USB_OHCI0 2
++#define AHB_GATE_OFFSET_USB_EHCI0 1
++#define AHB_GATE_OFFSET_USB 0
++
++/* ahb clock gate bit offset (second register) */
++#define AHB_GATE_OFFSET_GMAC 17
++
++#define CCM_AHB_GATE_GPS (0x1 << 26)
++#define CCM_AHB_GATE_SDRAM (0x1 << 14)
++#define CCM_AHB_GATE_DLL (0x1 << 15)
++#define CCM_AHB_GATE_ACE (0x1 << 16)
++
++#define CCM_PLL5_CTRL_M(n) (((n) & 0x3) << 0)
++#define CCM_PLL5_CTRL_M_MASK CCM_PLL5_CTRL_M(0x3)
++#define CCM_PLL5_CTRL_M_X(n) ((n) - 1)
++#define CCM_PLL5_CTRL_M1(n) (((n) & 0x3) << 2)
++#define CCM_PLL5_CTRL_M1_MASK CCM_PLL5_CTRL_M1(0x3)
++#define CCM_PLL5_CTRL_M1_X(n) ((n) - 1)
++#define CCM_PLL5_CTRL_K(n) (((n) & 0x3) << 4)
++#define CCM_PLL5_CTRL_K_MASK CCM_PLL5_CTRL_K(0x3)
++#define CCM_PLL5_CTRL_K_X(n) ((n) - 1)
++#define CCM_PLL5_CTRL_LDO (0x1 << 7)
++#define CCM_PLL5_CTRL_N(n) (((n) & 0x1f) << 8)
++#define CCM_PLL5_CTRL_N_MASK CCM_PLL5_CTRL_N(0x1f)
++#define CCM_PLL5_CTRL_N_X(n) (n)
++#define CCM_PLL5_CTRL_P(n) (((n) & 0x3) << 16)
++#define CCM_PLL5_CTRL_P_MASK CCM_PLL5_CTRL_P(0x3)
++#define CCM_PLL5_CTRL_P_X(n) ((n) - 1)
++#define CCM_PLL5_CTRL_BW (0x1 << 18)
++#define CCM_PLL5_CTRL_VCO_GAIN (0x1 << 19)
++#define CCM_PLL5_CTRL_BIAS(n) (((n) & 0x1f) << 20)
++#define CCM_PLL5_CTRL_BIAS_MASK CCM_PLL5_CTRL_BIAS(0x1f)
++#define CCM_PLL5_CTRL_BIAS_X(n) ((n) - 1)
++#define CCM_PLL5_CTRL_VCO_BIAS (0x1 << 25)
++#define CCM_PLL5_CTRL_DDR_CLK (0x1 << 29)
++#define CCM_PLL5_CTRL_BYPASS (0x1 << 30)
++#define CCM_PLL5_CTRL_EN (0x1 << 31)
++
++#define CCM_PLL6_CTRL_N_SHIFT 8
++#define CCM_PLL6_CTRL_N_MASK (0x1f << CCM_PLL6_CTRL_N_SHIFT)
++#define CCM_PLL6_CTRL_K_SHIFT 4
++#define CCM_PLL6_CTRL_K_MASK (0x3 << CCM_PLL6_CTRL_K_SHIFT)
++
++#define CCM_GPS_CTRL_RESET (0x1 << 0)
++#define CCM_GPS_CTRL_GATE (0x1 << 1)
++
++#define CCM_DRAM_CTRL_DCLK_OUT (0x1 << 15)
++
++#define CCM_MBUS_CTRL_M(n) (((n) & 0xf) << 0)
++#define CCM_MBUS_CTRL_M_MASK CCM_MBUS_CTRL_M(0xf)
++#define CCM_MBUS_CTRL_M_X(n) ((n) - 1)
++#define CCM_MBUS_CTRL_N(n) (((n) & 0xf) << 16)
++#define CCM_MBUS_CTRL_N_MASK CCM_MBUS_CTRL_N(0xf)
++#define CCM_MBUS_CTRL_N_X(n) (((n) >> 3) ? 3 : (((n) >> 2) ? 2 : (((n) >> 1) ? 1 : 0)))
++#define CCM_MBUS_CTRL_CLK_SRC(n) (((n) & 0x3) << 24)
++#define CCM_MBUS_CTRL_CLK_SRC_MASK CCM_MBUS_CTRL_CLK_SRC(0x3)
++#define CCM_MBUS_CTRL_CLK_SRC_HOSC 0x0
++#define CCM_MBUS_CTRL_CLK_SRC_PLL6 0x1
++#define CCM_MBUS_CTRL_CLK_SRC_PLL5 0x2
++#define CCM_MBUS_CTRL_GATE (0x1 << 31)
++
++#define CCM_MMC_CTRL_OSCM24 (0x0 << 24)
++#define CCM_MMC_CTRL_PLL6 (0x1 << 24)
++#define CCM_MMC_CTRL_PLL5 (0x2 << 24)
++
++#define CCM_MMC_CTRL_ENABLE (0x1 << 31)
++
++#define CCM_GMAC_CTRL_TX_CLK_SRC_MII 0x0
++#define CCM_GMAC_CTRL_TX_CLK_SRC_EXT_RGMII 0x1
++#define CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII 0x2
++#define CCM_GMAC_CTRL_GPIT_MII (0x0 << 2)
++#define CCM_GMAC_CTRL_GPIT_RGMII (0x1 << 2)
++
++#endif /* _SUNXI_CLOCK_SUN4I_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/clock_sun6i.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/clock_sun6i.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/clock_sun6i.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,205 @@
++/*
++ * sun6i clock register definitions
++ *
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_CLOCK_SUN6I_H
++#define _SUNXI_CLOCK_SUN6I_H
++
++struct sunxi_ccm_reg {
++ u32 pll1_cfg; /* 0x00 pll1 control */
++ u32 reserved0;
++ u32 pll2_cfg; /* 0x08 pll2 control */
++ u32 reserved1;
++ u32 pll3_cfg; /* 0x10 pll3 control */
++ u32 reserved2;
++ u32 pll4_cfg; /* 0x18 pll4 control */
++ u32 reserved3;
++ u32 pll5_cfg; /* 0x20 pll5 control */
++ u32 reserved4;
++ u32 pll6_cfg; /* 0x28 pll6 control */
++ u32 reserved5;
++ u32 pll7_cfg; /* 0x30 pll7 control */
++ u32 reserved6;
++ u32 pll8_cfg; /* 0x38 pll8 control */
++ u32 reserved7;
++ u32 mipi_pll_cfg; /* 0x40 MIPI pll control */
++ u32 pll9_cfg; /* 0x44 pll9 control */
++ u32 pll10_cfg; /* 0x48 pll10 control */
++ u32 reserved8;
++ u32 cpu_axi_cfg; /* 0x50 CPU/AXI divide ratio */
++ u32 ahb1_apb1_div; /* 0x54 AHB1/APB1 divide ratio */
++ u32 apb2_div; /* 0x58 APB2 divide ratio */
++ u32 axi_gate; /* 0x5c axi module clock gating */
++ u32 ahb_gate0; /* 0x60 ahb module clock gating 0 */
++ u32 ahb_gate1; /* 0x64 ahb module clock gating 1 */
++ u32 apb1_gate; /* 0x68 apb1 module clock gating */
++ u32 apb2_gate; /* 0x6c apb2 module clock gating */
++ u32 reserved9[4];
++ u32 nand0_clk_cfg; /* 0x80 nand0 clock control */
++ u32 nand1_clk_cfg; /* 0x84 nand1 clock control */
++ u32 sd0_clk_cfg; /* 0x88 sd0 clock control */
++ u32 sd1_clk_cfg; /* 0x8c sd1 clock control */
++ u32 sd2_clk_cfg; /* 0x90 sd2 clock control */
++ u32 sd3_clk_cfg; /* 0x94 sd3 clock control */
++ u32 ts_clk_cfg; /* 0x98 transport stream clock control */
++ u32 ss_clk_cfg; /* 0x9c security system clock control */
++ u32 spi0_clk_cfg; /* 0xa0 spi0 clock control */
++ u32 spi1_clk_cfg; /* 0xa4 spi1 clock control */
++ u32 spi2_clk_cfg; /* 0xa8 spi2 clock control */
++ u32 spi3_clk_cfg; /* 0xac spi3 clock control */
++ u32 i2s0_clk_cfg; /* 0xb0 I2S0 clock control*/
++ u32 i2s1_clk_cfg; /* 0xb4 I2S1 clock control */
++ u32 reserved10[2];
++ u32 spdif_clk_cfg; /* 0xc0 SPDIF clock control */
++ u32 reserved11[2];
++ u32 usb_clk_cfg; /* 0xcc USB clock control */
++ u32 gmac_clk_cfg; /* 0xd0 GMAC clock control */
++ u32 reserved12[7];
++ u32 mdfs_clk_cfg; /* 0xf0 MDFS clock control */
++ u32 dram_clk_cfg; /* 0xf4 DRAM configuration clock control */
++ u32 reserved13[2];
++ u32 dram_clk_gate; /* 0x100 DRAM module gating */
++ u32 be0_clk_cfg; /* 0x104 BE0 module clock */
++ u32 be1_clk_cfg; /* 0x108 BE1 module clock */
++ u32 fe0_clk_cfg; /* 0x10c FE0 module clock */
++ u32 fe1_clk_cfg; /* 0x110 FE1 module clock */
++ u32 mp_clk_cfg; /* 0x114 MP module clock */
++ u32 lcd0_ch0_clk_cfg; /* 0x118 LCD0 CH0 module clock */
++ u32 lcd1_ch0_clk_cfg; /* 0x11c LCD1 CH0 module clock */
++ u32 reserved14[3];
++ u32 lcd0_ch1_clk_cfg; /* 0x12c LCD0 CH1 module clock */
++ u32 lcd1_ch1_clk_cfg; /* 0x130 LCD1 CH1 module clock */
++ u32 csi0_clk_cfg; /* 0x134 CSI0 module clock */
++ u32 csi1_clk_cfg; /* 0x138 CSI1 module clock */
++ u32 ve_clk_cfg; /* 0x13c VE module clock */
++ u32 adda_clk_cfg; /* 0x140 ADDA module clock */
++ u32 avs_clk_cfg; /* 0x144 AVS module clock */
++ u32 dmic_clk_cfg; /* 0x148 Digital Mic module clock*/
++ u32 reserved15;
++ u32 hdmi_clk_cfg; /* 0x150 HDMI module clock */
++ u32 ps_clk_cfg; /* 0x154 PS module clock */
++ u32 mtc_clk_cfg; /* 0x158 MTC module clock */
++ u32 mbus0_clk_cfg; /* 0x15c MBUS0 module clock */
++ u32 mbus1_clk_cfg; /* 0x160 MBUS1 module clock */
++ u32 reserved16;
++ u32 mipi_dsi_clk_cfg; /* 0x168 MIPI DSI clock control */
++ u32 mipi_csi_clk_cfg; /* 0x16c MIPI CSI clock control */
++ u32 reserved17[4];
++ u32 iep_drc0_clk_cfg; /* 0x180 IEP DRC0 module clock */
++ u32 iep_drc1_clk_cfg; /* 0x184 IEP DRC1 module clock */
++ u32 iep_deu0_clk_cfg; /* 0x188 IEP DEU0 module clock */
++ u32 iep_deu1_clk_cfg; /* 0x18c IEP DEU1 module clock */
++ u32 reserved18[4];
++ u32 gpu_core_clk_cfg; /* 0x1a0 GPU core clock config */
++ u32 gpu_mem_clk_cfg; /* 0x1a4 GPU memory clock config */
++ u32 gpu_hyd_clk_cfg; /* 0x1a0 GPU HYD clock config */
++ u32 reserved19[21];
++ u32 pll_lock; /* 0x200 PLL Lock Time */
++ u32 pll1_lock; /* 0x204 PLL1 Lock Time */
++ u32 reserved20[6];
++ u32 pll1_bias_cfg; /* 0x220 PLL1 Bias config */
++ u32 pll2_bias_cfg; /* 0x224 PLL2 Bias config */
++ u32 pll3_bias_cfg; /* 0x228 PLL3 Bias config */
++ u32 pll4_bias_cfg; /* 0x22c PLL4 Bias config */
++ u32 pll5_bias_cfg; /* 0x230 PLL5 Bias config */
++ u32 pll6_bias_cfg; /* 0x234 PLL6 Bias config */
++ u32 pll7_bias_cfg; /* 0x238 PLL7 Bias config */
++ u32 pll8_bias_cfg; /* 0x23c PLL8 Bias config */
++ u32 mipi_bias_cfg; /* 0x240 MIPI Bias config */
++ u32 pll9_bias_cfg; /* 0x244 PLL9 Bias config */
++ u32 pll10_bias_cfg; /* 0x248 PLL10 Bias config */
++ u32 reserved21[13];
++ u32 pll1_pattern_cfg; /* 0x280 PLL1 Pattern config */
++ u32 pll2_pattern_cfg; /* 0x284 PLL2 Pattern config */
++ u32 pll3_pattern_cfg; /* 0x288 PLL3 Pattern config */
++ u32 pll4_pattern_cfg; /* 0x28c PLL4 Pattern config */
++ u32 pll5_pattern_cfg; /* 0x290 PLL5 Pattern config */
++ u32 pll6_pattern_cfg; /* 0x294 PLL6 Pattern config */
++ u32 pll7_pattern_cfg; /* 0x298 PLL7 Pattern config */
++ u32 pll8_pattern_cfg; /* 0x29c PLL8 Pattern config */
++ u32 mipi_pattern_cfg; /* 0x2a0 MIPI Pattern config */
++ u32 pll9_pattern_cfg; /* 0x2a4 PLL9 Pattern config */
++ u32 pll10_pattern_cfg; /* 0x2a8 PLL10 Pattern config */
++ u32 reserved22[5];
++ u32 ahb_reset0_cfg; /* 0x2c0 AHB1 Reset 0 config */
++ u32 ahb_reset1_cfg; /* 0x2c4 AHB1 Reset 1 config */
++ u32 ahb_reset2_cfg; /* 0x2c8 AHB1 Reset 2 config */
++ u32 reserved23;
++ u32 apb1_reset_cfg; /* 0x2d0 APB1 Reset config */
++ u32 reserved24;
++ u32 apb2_reset_cfg; /* 0x2d8 APB2 Reset config */
++};
++
++/* apb2 bit field */
++#define APB2_CLK_SRC_LOSC (0x0 << 24)
++#define APB2_CLK_SRC_OSC24M (0x1 << 24)
++#define APB2_CLK_SRC_PLL6 (0x2 << 24)
++#define APB2_CLK_SRC_MASK (0x3 << 24)
++#define APB2_CLK_RATE_N_1 (0x0 << 16)
++#define APB2_CLK_RATE_N_2 (0x1 << 16)
++#define APB2_CLK_RATE_N_4 (0x2 << 16)
++#define APB2_CLK_RATE_N_8 (0x3 << 16)
++#define APB2_CLK_RATE_N_MASK (3 << 16)
++#define APB2_CLK_RATE_M(m) (((m)-1) << 0)
++#define APB2_CLK_RATE_M_MASK (0x1f << 0)
++
++/* apb2 gate field */
++#define APB2_GATE_UART_SHIFT (16)
++#define APB2_GATE_UART_MASK (0xff << APB2_GATE_UART_SHIFT)
++#define APB2_GATE_TWI_SHIFT (0)
++#define APB2_GATE_TWI_MASK (0xf << APB2_GATE_TWI_SHIFT)
++
++/* cpu_axi_cfg bits */
++#define AXI_DIV_SHIFT 0
++#define ATB_DIV_SHIFT 8
++#define CPU_CLK_SRC_SHIFT 16
++
++#define AXI_DIV_1 0
++#define AXI_DIV_2 1
++#define AXI_DIV_3 2
++#define AXI_DIV_4 3
++#define ATB_DIV_1 0
++#define ATB_DIV_2 1
++#define ATB_DIV_4 2
++#define CPU_CLK_SRC_OSC24M 1
++#define CPU_CLK_SRC_PLL1 2
++
++#define PLL1_CFG_DEFAULT 0x90011b21
++
++#define PLL6_CFG_DEFAULT 0x90041811
++
++#define CCM_PLL6_CTRL_N_SHIFT 8
++#define CCM_PLL6_CTRL_N_MASK (0x1f << CCM_PLL6_CTRL_N_SHIFT)
++#define CCM_PLL6_CTRL_K_SHIFT 4
++#define CCM_PLL6_CTRL_K_MASK (0x3 << CCM_PLL6_CTRL_K_SHIFT)
++
++#define AHB_GATE_OFFSET_MMC3 11
++#define AHB_GATE_OFFSET_MMC2 10
++#define AHB_GATE_OFFSET_MMC1 9
++#define AHB_GATE_OFFSET_MMC0 8
++#define AHB_GATE_OFFSET_MMC(n) (AHB_GATE_OFFSET_MMC0 + (n))
++
++#define CCM_MMC_CTRL_OSCM24 (0x0 << 24)
++#define CCM_MMC_CTRL_PLL6 (0x1 << 24)
++
++#define CCM_MMC_CTRL_ENABLE (0x1 << 31)
++
++#define AHB_RESET_OFFSET_MMC3 11
++#define AHB_RESET_OFFSET_MMC2 10
++#define AHB_RESET_OFFSET_MMC1 9
++#define AHB_RESET_OFFSET_MMC0 8
++#define AHB_RESET_OFFSET_MMC(n) (AHB_RESET_OFFSET_MMC0 + (n))
++
++/* apb2 reset */
++#define APB2_RESET_UART_SHIFT (16)
++#define APB2_RESET_UART_MASK (0xff << APB2_RESET_UART_SHIFT)
++#define APB2_RESET_TWI_SHIFT (0)
++#define APB2_RESET_TWI_MASK (0xf << APB2_RESET_TWI_SHIFT)
++
++#endif /* _SUNXI_CLOCK_SUN6I_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/cpucfg.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/cpucfg.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/cpucfg.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/cpucfg.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,55 @@
++/*
++ * (C) Copyright 2013
++ * Carl van Schaik <carl@ok-labs.com>
++ *
++ * CPU configuration registers for the sun7i (A20).
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_CPUCFG_H_
++#define _SUNXI_CPUCFG_H_
++
++#ifndef __ASSEMBLY__
++
++struct sunxi_cpu_ctrl {
++ u32 reset_ctrl;
++ u32 cpu_ctrl;
++ u32 status;
++ u32 _res[13];
++};
++
++#define CPU_RESET_SET 0
++#define CPU_RESET_CLEAR 3
++
++#define CPU_STATUS_SMP (1 << 0)
++#define CPU_STATUS_WFE (1 << 1)
++#define CPU_STATUS_WFI (1 << 2)
++
++struct sunxi_cpucfg {
++ u32 _res1[16]; /* 0x000 */
++ struct sunxi_cpu_ctrl cpu[2]; /* 0x040 */
++ u32 _res2[48]; /* 0x0c0 */
++ u32 _res3; /* 0x180 */
++ u32 general_ctrl; /* 0x184 */
++ u32 _res4[2]; /* 0x188 */
++ u32 event_input; /* 0x190 */
++ u32 _res5[4]; /* 0x194 */
++ u32 boot_addr; /* 0x1a4 - also known as PRIVATE_REG */
++ u32 _res6[2]; /* 0x1a8 */
++ u32 cpu1_power_clamp; /* 0x1b0 */
++ u32 cpu1_power_off; /* 0x1b4 */
++ u32 _res7[10]; /* 0x1b8 */
++ u32 debug0_ctrl; /* 0x1e0 */
++ u32 debug1_ctrl; /* 0x1e4 */
++};
++
++#define GENERAL_CTRL_NO_L1_RESET_CPU(x) (1UL << (x))
++#define GENERAL_CTRL_NO_L2_AUTO_RESET (1UL << 4)
++#define GENERAL_CTRL_L2_RESET_SET (0UL << 5)
++#define GENERAL_CTRL_L2_RESET_CLEAR (1UL << 5)
++#define GENERAL_CTRL_CFGSDISABLE (1UL << 8)
++
++#endif /* __ASSEMBLY__ */
++
++#endif /* _SUNXI_CPUCFG_H_ */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/cpu.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/cpu.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/cpu.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/cpu.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,141 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_CPU_H
++#define _SUNXI_CPU_H
++
++#define SUNXI_SRAM_A1_BASE 0x00000000
++#define SUNXI_SRAM_A1_SIZE (16 * 1024) /* 16 kiB */
++
++#define SUNXI_SRAM_A2_BASE 0x00004000 /* 16 kiB */
++#define SUNXI_SRAM_A3_BASE 0x00008000 /* 13 kiB */
++#define SUNXI_SRAM_A4_BASE 0x0000b400 /* 3 kiB */
++#define SUNXI_SRAM_D_BASE 0x00010000 /* 4 kiB */
++#define SUNXI_SRAM_B_BASE 0x00020000 /* 64 kiB (secure) */
++
++#define SUNXI_SRAMC_BASE 0x01c00000
++#define SUNXI_DRAMC_BASE 0x01c01000
++#define SUNXI_DMA_BASE 0x01c02000
++#define SUNXI_NFC_BASE 0x01c03000
++#define SUNXI_TS_BASE 0x01c04000
++#define SUNXI_SPI0_BASE 0x01c05000
++#define SUNXI_SPI1_BASE 0x01c06000
++#define SUNXI_MS_BASE 0x01c07000
++#define SUNXI_TVD_BASE 0x01c08000
++#define SUNXI_CSI0_BASE 0x01c09000
++#define SUNXI_TVE0_BASE 0x01c0a000
++#define SUNXI_EMAC_BASE 0x01c0b000
++#define SUNXI_LCD0_BASE 0x01c0C000
++#define SUNXI_LCD1_BASE 0x01c0d000
++#define SUNXI_VE_BASE 0x01c0e000
++#define SUNXI_MMC0_BASE 0x01c0f000
++#define SUNXI_MMC1_BASE 0x01c10000
++#define SUNXI_MMC2_BASE 0x01c11000
++#define SUNXI_MMC3_BASE 0x01c12000
++#define SUNXI_USB0_BASE 0x01c13000
++#define SUNXI_USB1_BASE 0x01c14000
++#define SUNXI_SS_BASE 0x01c15000
++#define SUNXI_HDMI_BASE 0x01c16000
++#define SUNXI_SPI2_BASE 0x01c17000
++#define SUNXI_SATA_BASE 0x01c18000
++#define SUNXI_PATA_BASE 0x01c19000
++#define SUNXI_ACE_BASE 0x01c1a000
++#define SUNXI_TVE1_BASE 0x01c1b000
++#define SUNXI_USB2_BASE 0x01c1c000
++#define SUNXI_CSI1_BASE 0x01c1d000
++#define SUNXI_TZASC_BASE 0x01c1e000
++#define SUNXI_SPI3_BASE 0x01c1f000
++
++#define SUNXI_CCM_BASE 0x01c20000
++#define SUNXI_INTC_BASE 0x01c20400
++#define SUNXI_PIO_BASE 0x01c20800
++#define SUNXI_TIMER_BASE 0x01c20c00
++#define SUNXI_SPDIF_BASE 0x01c21000
++#define SUNXI_AC97_BASE 0x01c21400
++#define SUNXI_IR0_BASE 0x01c21800
++#define SUNXI_IR1_BASE 0x01c21c00
++
++#define SUNXI_IIS_BASE 0x01c22400
++#define SUNXI_LRADC_BASE 0x01c22800
++#define SUNXI_AD_DA_BASE 0x01c22c00
++#define SUNXI_KEYPAD_BASE 0x01c23000
++#define SUNXI_TZPC_BASE 0x01c23400
++#define SUNXI_SID_BASE 0x01c23800
++#define SUNXI_SJTAG_BASE 0x01c23c00
++
++#define SUNXI_TP_BASE 0x01c25000
++#define SUNXI_PMU_BASE 0x01c25400
++#define SUNXI_CPUCFG_BASE 0x01c25c00 /* sun7i only ? */
++
++#define SUNXI_UART0_BASE 0x01c28000
++#define SUNXI_UART1_BASE 0x01c28400
++#define SUNXI_UART2_BASE 0x01c28800
++#define SUNXI_UART3_BASE 0x01c28c00
++#define SUNXI_UART4_BASE 0x01c29000
++#define SUNXI_UART5_BASE 0x01c29400
++#define SUNXI_UART6_BASE 0x01c29800
++#define SUNXI_UART7_BASE 0x01c29c00
++#define SUNXI_PS2_0_BASE 0x01c2a000
++#define SUNXI_PS2_1_BASE 0x01c2a400
++
++#define SUNXI_TWI0_BASE 0x01c2ac00
++#define SUNXI_TWI1_BASE 0x01c2b000
++#define SUNXI_TWI2_BASE 0x01c2b400
++
++#define SUNXI_CAN_BASE 0x01c2bc00
++
++#define SUNXI_SCR_BASE 0x01c2c400
++
++#define SUNXI_GPS_BASE 0x01c30000
++#define SUNXI_MALI400_BASE 0x01c40000
++#define SUNXI_GMAC_BASE 0x01c50000
++
++#define SUNXI_DRAM_COM_BASE 0x01c62000
++#define SUNXI_DRAM_CTL_BASE 0x01c63000
++#define SUNXI_DRAM_PHY_CH1_BASE 0x01c65000
++#define SUNXI_DRAM_PHY_CH2_BASE 0x01c66000
++
++/* module sram */
++#define SUNXI_SRAM_C_BASE 0x01d00000
++
++#define SUNXI_DE_FE0_BASE 0x01e00000
++#define SUNXI_DE_FE1_BASE 0x01e20000
++#define SUNXI_DE_BE0_BASE 0x01e60000
++#define SUNXI_DE_BE1_BASE 0x01e40000
++#define SUNXI_MP_BASE 0x01e80000
++#define SUNXI_AVG_BASE 0x01ea0000
++
++#define SUNXI_PRCM_BASE 0x01f01400
++#define SUNXI_R_UART_BASE 0x01f02800
++#define SUNXI_R_PIO_BASE 0x01f02c00
++#define SUNXI_P2WI_BASE 0x01f03400
++
++/* CoreSight Debug Module */
++#define SUNXI_CSDM_BASE 0x3f500000
++
++#define SUNXI_DDRII_DDRIII_BASE 0x40000000 /* 2 GiB */
++
++#define SUNXI_BROM_BASE 0xffff0000 /* 32 kiB */
++
++#define SUNXI_CPU_CFG (SUNXI_TIMER_BASE + 0x13c)
++
++#ifndef __ASSEMBLY__
++/* boot type */
++enum sunxi_boot_type_t {
++ SUNXI_BOOT_TYPE_NULL,
++ SUNXI_BOOT_TYPE_MMC0,
++ SUNXI_BOOT_TYPE_NAND,
++ SUNXI_BOOT_TYPE_MMC2,
++ SUNXI_BOOT_TYPE_SPI
++};
++
++void sunxi_board_init(void);
++void sunxi_reset(void);
++#endif /* __ASSEMBLY__ */
++
++#endif /* _CPU_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/dram.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/dram.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/dram.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/dram.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,179 @@
++/*
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Berg Xing <bergxing@allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * Sunxi platform dram register definition.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_DRAM_H
++#define _SUNXI_DRAM_H
++
++#include <linux/types.h>
++
++struct sunxi_dram_reg {
++ u32 ccr; /* 0x00 controller configuration register */
++ u32 dcr; /* 0x04 dram configuration register */
++ u32 iocr; /* 0x08 i/o configuration register */
++ u32 csr; /* 0x0c controller status register */
++ u32 drr; /* 0x10 dram refresh register */
++ u32 tpr0; /* 0x14 dram timing parameters register 0 */
++ u32 tpr1; /* 0x18 dram timing parameters register 1 */
++ u32 tpr2; /* 0x1c dram timing parameters register 2 */
++ u32 gdllcr; /* 0x20 global dll control register */
++ u8 res0[0x28];
++ u32 rslr0; /* 0x4c rank system latency register */
++ u32 rslr1; /* 0x50 rank system latency register */
++ u8 res1[0x8];
++ u32 rdgr0; /* 0x5c rank dqs gating register */
++ u32 rdgr1; /* 0x60 rank dqs gating register */
++ u8 res2[0x34];
++ u32 odtcr; /* 0x98 odt configuration register */
++ u32 dtr0; /* 0x9c data training register 0 */
++ u32 dtr1; /* 0xa0 data training register 1 */
++ u32 dtar; /* 0xa4 data training address register */
++ u32 zqcr0; /* 0xa8 zq control register 0 */
++ u32 zqcr1; /* 0xac zq control register 1 */
++ u32 zqsr; /* 0xb0 zq status register */
++ u32 idcr; /* 0xb4 initializaton delay configure reg */
++ u8 res3[0x138];
++ u32 mr; /* 0x1f0 mode register */
++ u32 emr; /* 0x1f4 extended mode register */
++ u32 emr2; /* 0x1f8 extended mode register */
++ u32 emr3; /* 0x1fc extended mode register */
++ u32 dllctr; /* 0x200 dll control register */
++ u32 dllcr[5]; /* 0x204 dll control register 0(byte 0) */
++ /* 0x208 dll control register 1(byte 1) */
++ /* 0x20c dll control register 2(byte 2) */
++ /* 0x210 dll control register 3(byte 3) */
++ /* 0x214 dll control register 4(byte 4) */
++ u32 dqtr0; /* 0x218 dq timing register */
++ u32 dqtr1; /* 0x21c dq timing register */
++ u32 dqtr2; /* 0x220 dq timing register */
++ u32 dqtr3; /* 0x224 dq timing register */
++ u32 dqstr; /* 0x228 dqs timing register */
++ u32 dqsbtr; /* 0x22c dqsb timing register */
++ u32 mcr; /* 0x230 mode configure register */
++ u8 res[0x8];
++ u32 ppwrsctl; /* 0x23c pad power save control */
++ u32 apr; /* 0x240 arbiter period register */
++ u32 pldtr; /* 0x244 priority level data threshold reg */
++ u8 res5[0x8];
++ u32 hpcr[32]; /* 0x250 host port configure register */
++ u8 res6[0x10];
++ u32 csel; /* 0x2e0 controller select register */
++};
++
++struct dram_para {
++ u32 clock;
++ u32 type;
++ u32 rank_num;
++ u32 density;
++ u32 io_width;
++ u32 bus_width;
++ u32 cas;
++ u32 zq;
++ u32 odt_en;
++ u32 size;
++ u32 tpr0;
++ u32 tpr1;
++ u32 tpr2;
++ u32 tpr3;
++ u32 tpr4;
++ u32 tpr5;
++ u32 emr1;
++ u32 emr2;
++ u32 emr3;
++};
++
++#define DRAM_CCR_COMMAND_RATE_1T (0x1 << 5)
++#define DRAM_CCR_DQS_GATE (0x1 << 14)
++#define DRAM_CCR_DQS_DRIFT_COMP (0x1 << 17)
++#define DRAM_CCR_ITM_OFF (0x1 << 28)
++#define DRAM_CCR_DATA_TRAINING (0x1 << 30)
++#define DRAM_CCR_INIT (0x1 << 31)
++
++#define DRAM_MEMORY_TYPE_DDR1 1
++#define DRAM_MEMORY_TYPE_DDR2 2
++#define DRAM_MEMORY_TYPE_DDR3 3
++#define DRAM_MEMORY_TYPE_LPDDR2 4
++#define DRAM_MEMORY_TYPE_LPDDR 5
++#define DRAM_DCR_TYPE (0x1 << 0)
++#define DRAM_DCR_TYPE_DDR2 0x0
++#define DRAM_DCR_TYPE_DDR3 0x1
++#define DRAM_DCR_IO_WIDTH(n) (((n) & 0x3) << 1)
++#define DRAM_DCR_IO_WIDTH_MASK DRAM_DCR_IO_WIDTH(0x3)
++#define DRAM_DCR_IO_WIDTH_8BIT 0x0
++#define DRAM_DCR_IO_WIDTH_16BIT 0x1
++#define DRAM_DCR_CHIP_DENSITY(n) (((n) & 0x7) << 3)
++#define DRAM_DCR_CHIP_DENSITY_MASK DRAM_DCR_CHIP_DENSITY(0x7)
++#define DRAM_DCR_CHIP_DENSITY_256M 0x0
++#define DRAM_DCR_CHIP_DENSITY_512M 0x1
++#define DRAM_DCR_CHIP_DENSITY_1024M 0x2
++#define DRAM_DCR_CHIP_DENSITY_2048M 0x3
++#define DRAM_DCR_CHIP_DENSITY_4096M 0x4
++#define DRAM_DCR_CHIP_DENSITY_8192M 0x5
++#define DRAM_DCR_BUS_WIDTH(n) (((n) & 0x7) << 6)
++#define DRAM_DCR_BUS_WIDTH_MASK DRAM_DCR_BUS_WIDTH(0x7)
++#define DRAM_DCR_BUS_WIDTH_32BIT 0x3
++#define DRAM_DCR_BUS_WIDTH_16BIT 0x1
++#define DRAM_DCR_BUS_WIDTH_8BIT 0x0
++#define DRAM_DCR_NR_DLLCR_32BIT 5
++#define DRAM_DCR_NR_DLLCR_16BIT 3
++#define DRAM_DCR_NR_DLLCR_8BIT 2
++#define DRAM_DCR_RANK_SEL(n) (((n) & 0x3) << 10)
++#define DRAM_DCR_RANK_SEL_MASK DRAM_DCR_CMD_RANK(0x3)
++#define DRAM_DCR_CMD_RANK_ALL (0x1 << 12)
++#define DRAM_DCR_MODE(n) (((n) & 0x3) << 13)
++#define DRAM_DCR_MODE_MASK DRAM_DCR_MODE(0x3)
++#define DRAM_DCR_MODE_SEQ 0x0
++#define DRAM_DCR_MODE_INTERLEAVE 0x1
++
++#define DRAM_CSR_FAILED (0x1 << 20)
++
++#define DRAM_DRR_TRFC(n) ((n) & 0xff)
++#define DRAM_DRR_TREFI(n) (((n) & 0xffff) << 8)
++#define DRAM_DRR_BURST(n) ((((n) - 1) & 0xf) << 24)
++
++#define DRAM_MCR_MODE_NORM(n) (((n) & 0x3) << 0)
++#define DRAM_MCR_MODE_NORM_MASK DRAM_MCR_MOD_NORM(0x3)
++#define DRAM_MCR_MODE_DQ_OUT(n) (((n) & 0x3) << 2)
++#define DRAM_MCR_MODE_DQ_OUT_MASK DRAM_MCR_MODE_DQ_OUT(0x3)
++#define DRAM_MCR_MODE_ADDR_OUT(n) (((n) & 0x3) << 4)
++#define DRAM_MCR_MODE_ADDR_OUT_MASK DRAM_MCR_MODE_ADDR_OUT(0x3)
++#define DRAM_MCR_MODE_DQ_IN_OUT(n) (((n) & 0x3) << 6)
++#define DRAM_MCR_MODE_DQ_IN_OUT_MASK DRAM_MCR_MODE_DQ_IN_OUT(0x3)
++#define DRAM_MCR_MODE_DQ_TURNON_DELAY(n) (((n) & 0x7) << 8)
++#define DRAM_MCR_MODE_DQ_TURNON_DELAY_MASK DRAM_MCR_MODE_DQ_TURNON_DELAY(0x7)
++#define DRAM_MCR_MODE_ADDR_IN (0x1 << 11)
++#define DRAM_MCR_RESET (0x1 << 12)
++#define DRAM_MCR_MODE_EN(n) (((n) & 0x3) << 13)
++#define DRAM_MCR_MODE_EN_MASK DRAM_MCR_MOD_EN(0x3)
++#define DRAM_MCR_DCLK_OUT (0x1 << 16)
++
++#define DRAM_DLLCR_NRESET (0x1 << 30)
++#define DRAM_DLLCR_DISABLE (0x1 << 31)
++
++#define DRAM_ZQCR0_IMP_DIV(n) (((n) & 0xff) << 20)
++#define DRAM_ZQCR0_IMP_DIV_MASK DRAM_ZQCR0_IMP_DIV(0xff)
++
++#define DRAM_IOCR_ODT_EN(n) ((((n) & 0x3) << 30) | ((n) & 0x3) << 0)
++#define DRAM_IOCR_ODT_EN_MASK DRAM_IOCR_ODT_EN(0x3)
++
++#define DRAM_MR_BURST_LENGTH(n) (((n) & 0x7) << 0)
++#define DRAM_MR_BURST_LENGTH_MASK DRAM_MR_BURST_LENGTH(0x7)
++#define DRAM_MR_CAS_LAT(n) (((n) & 0x7) << 4)
++#define DRAM_MR_CAS_LAT_MASK DRAM_MR_CAS_LAT(0x7)
++#define DRAM_MR_WRITE_RECOVERY(n) (((n) & 0x7) << 9)
++#define DRAM_MR_WRITE_RECOVERY_MASK DRAM_MR_WRITE_RECOVERY(0x7)
++#define DRAM_MR_POWER_DOWN (0x1 << 12)
++
++#define DRAM_CSEL_MAGIC 0x16237495
++
++unsigned long sunxi_dram_init(void);
++unsigned long dramc_init(struct dram_para *para);
++
++#endif /* _SUNXI_DRAM_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/early_print.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/early_print.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/early_print.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/early_print.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,58 @@
++/*
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * Early uart print for debugging.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_EARLY_PRINT_H
++#define _SUNXI_EARLY_PRINT_H
++
++#include <asm/arch/cpu.h>
++
++#define SUNXI_UART_BASE SUNXI_UART0_BASE
++
++#define UART_OFFSET 0x400
++
++/* receive buffer register */
++#define UART_RBR(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0x0)
++/* transmit holding register */
++#define UART_THR(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0x0)
++/* divisor latch low register */
++#define UART_DLL(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0x0)
++
++/* divisor latch high register */
++#define UART_DLH(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0x4)
++/* interrupt enable reigster */
++#define UART_IER(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0x4)
++
++/* interrupt identity register */
++#define UART_IIR(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0x8)
++/* fifo control register */
++#define UART_FCR(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0x8)
++
++/* line control register */
++#define UART_LCR(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0xc)
++#define UART_LCR_DLAB (0x1 << 7)
++
++/* line status register */
++#define UART_LSR(n) (SUNXI_UART_BASE + (n) * UART_OFFSET + 0x14)
++#define UART_LSR_TEMT (0x1 << 6)
++
++
++#define BAUD_115200 (0xd) /* 24 * 1000 * 1000 / 16 / 115200 = 13 */
++#define NO_PARITY (0)
++#define ONE_STOP_BIT (0)
++#define DAT_LEN_8_BITS (3)
++#define LC_8_N_1 (NO_PARITY << 3 | ONE_STOP_BIT << 2 | DAT_LEN_8_BITS)
++
++#ifndef __ASSEMBLY__
++void uart_init(void);
++void uart_putc(char c);
++void uart_puts(const char *s);
++#endif /* __ASSEMBLY__ */
++
++#endif /* _SUNXI_EARLY_PRINT_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/gpio.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/gpio.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/gpio.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/gpio.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,174 @@
++/*
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_GPIO_H
++#define _SUNXI_GPIO_H
++
++#include <linux/types.h>
++#include <asm/arch/cpu.h>
++
++/*
++ * sunxi has 9 banks of gpio, they are:
++ * PA0 - PA17 | PB0 - PB23 | PC0 - PC24
++ * PD0 - PD27 | PE0 - PE31 | PF0 - PF5
++ * PG0 - PG9 | PH0 - PH27 | PI0 - PI12
++ */
++
++#define SUNXI_GPIO_A 0
++#define SUNXI_GPIO_B 1
++#define SUNXI_GPIO_C 2
++#define SUNXI_GPIO_D 3
++#define SUNXI_GPIO_E 4
++#define SUNXI_GPIO_F 5
++#define SUNXI_GPIO_G 6
++#define SUNXI_GPIO_H 7
++#define SUNXI_GPIO_I 8
++#define SUNXI_GPIO_BANKS 9
++
++/*
++ * sun6i has atleast 1 additional bank, note banks J K don't exist!
++ * PL0 - PL1 at the very least is known.
++ *
++ * Note this bank is at a different register offset!
++ */
++#define SUNXI_GPIO_L 9
++
++struct sunxi_gpio {
++ u32 cfg[4];
++ u32 dat;
++ u32 drv[2];
++ u32 pull[2];
++};
++
++/* gpio interrupt control */
++struct sunxi_gpio_int {
++ u32 cfg[3];
++ u32 ctl;
++ u32 sta;
++ u32 deb; /* interrupt debounce */
++};
++
++struct sunxi_gpio_reg {
++ struct sunxi_gpio gpio_bank[SUNXI_GPIO_BANKS];
++ u8 res[0xbc];
++ struct sunxi_gpio_int gpio_int;
++};
++
++#define BANK_TO_GPIO(bank) (((bank) < SUNXI_GPIO_BANKS) ? \
++ &((struct sunxi_gpio_reg *)SUNXI_PIO_BASE)->gpio_bank[bank] : \
++ (struct sunxi_gpio *)SUNXI_R_PIO_BASE)
++
++#define GPIO_BANK(pin) ((pin) >> 5)
++#define GPIO_NUM(pin) ((pin) & 0x1f)
++
++#define GPIO_CFG_INDEX(pin) (((pin) & 0x1f) >> 3)
++#define GPIO_CFG_OFFSET(pin) ((((pin) & 0x1f) & 0x7) << 2)
++
++#define GPIO_DRV_INDEX(pin) (((pin) & 0x1f) >> 4)
++#define GPIO_DRV_OFFSET(pin) ((((pin) & 0x1f) & 0xf) << 1)
++
++#define GPIO_PULL_INDEX(pin) (((pin) & 0x1f) >> 4)
++#define GPIO_PULL_OFFSET(pin) ((((pin) & 0x1f) & 0xf) << 1)
++
++/* GPIO bank sizes */
++#define SUNXI_GPIO_A_NR 32
++#define SUNXI_GPIO_B_NR 32
++#define SUNXI_GPIO_C_NR 32
++#define SUNXI_GPIO_D_NR 32
++#define SUNXI_GPIO_E_NR 32
++#define SUNXI_GPIO_F_NR 32
++#define SUNXI_GPIO_G_NR 32
++#define SUNXI_GPIO_H_NR 32
++#define SUNXI_GPIO_I_NR 32
++#define SUNXI_GPIO_L_NR 32
++
++#define SUNXI_GPIO_NEXT(__gpio) \
++ ((__gpio##_START) + (__gpio##_NR) + 0)
++
++enum sunxi_gpio_number {
++ SUNXI_GPIO_A_START = 0,
++ SUNXI_GPIO_B_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_A),
++ SUNXI_GPIO_C_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_B),
++ SUNXI_GPIO_D_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_C),
++ SUNXI_GPIO_E_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_D),
++ SUNXI_GPIO_F_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_E),
++ SUNXI_GPIO_G_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_F),
++ SUNXI_GPIO_H_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_G),
++ SUNXI_GPIO_I_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_H),
++ SUNXI_GPIO_L_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_I),
++};
++
++/* SUNXI GPIO number definitions */
++#define SUNXI_GPA(_nr) (SUNXI_GPIO_A_START + (_nr))
++#define SUNXI_GPB(_nr) (SUNXI_GPIO_B_START + (_nr))
++#define SUNXI_GPC(_nr) (SUNXI_GPIO_C_START + (_nr))
++#define SUNXI_GPD(_nr) (SUNXI_GPIO_D_START + (_nr))
++#define SUNXI_GPE(_nr) (SUNXI_GPIO_E_START + (_nr))
++#define SUNXI_GPF(_nr) (SUNXI_GPIO_F_START + (_nr))
++#define SUNXI_GPG(_nr) (SUNXI_GPIO_G_START + (_nr))
++#define SUNXI_GPH(_nr) (SUNXI_GPIO_H_START + (_nr))
++#define SUNXI_GPI(_nr) (SUNXI_GPIO_I_START + (_nr))
++#define SUNXI_GPL(_nr) (SUNXI_GPIO_L_START + (_nr))
++
++/* GPIO pin function config */
++#define SUNXI_GPIO_INPUT 0
++#define SUNXI_GPIO_OUTPUT 1
++
++#define SUNXI_GPA0_EMAC 2
++#define SUN7I_GPA0_GMAC 5
++
++#define SUNXI_GPB0_TWI0 2
++
++#define SUN4I_GPB22_UART0_TX 2
++#define SUN4I_GPB23_UART0_RX 2
++
++#define SUN5I_GPB19_UART0_TX 2
++#define SUN5I_GPB20_UART0_RX 2
++
++#define SUN5I_GPG3_UART1_TX 4
++#define SUN5I_GPG4_UART1_RX 4
++
++#define SUNXI_GPC6_SDC2 3
++
++#define SUNXI_GPF0_SDC0 2
++
++#define SUNXI_GPF2_SDC0 2
++
++#ifdef CONFIG_SUN8I
++#define SUNXI_GPF2_UART0_TX 3
++#define SUNXI_GPF4_UART0_RX 3
++#else
++#define SUNXI_GPF2_UART0_TX 4
++#define SUNXI_GPF4_UART0_RX 4
++#endif
++
++#define SUN4I_GPG0_SDC1 4
++
++#define SUN4I_GPH22_SDC1 5
++
++#define SUN4I_GPI4_SDC3 2
++
++/* GPIO pin pull-up/down config */
++#define SUNXI_GPIO_PULL_DISABLE 0
++#define SUNXI_GPIO_PULL_UP 1
++#define SUNXI_GPIO_PULL_DOWN 2
++
++#define SUNXI_GPL0_R_P2WI_SCK 3
++#define SUNXI_GPL1_R_P2WI_SDA 3
++
++#define SUN8I_GPL2_R_UART_TX 2
++#define SUN8I_GPL3_R_UART_RX 2
++
++int sunxi_gpio_set_cfgpin(u32 pin, u32 val);
++int sunxi_gpio_get_cfgpin(u32 pin);
++int sunxi_gpio_set_drv(u32 pin, u32 val);
++int sunxi_gpio_set_pull(u32 pin, u32 val);
++int sunxi_name_to_gpio(const char *name);
++#define name_to_gpio(name) sunxi_name_to_gpio(name)
++
++#endif /* _SUNXI_GPIO_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/i2c.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/i2c.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/i2c.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/i2c.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,15 @@
++/*
++ * Copyright 2014 - Hans de Goede <hdegoede@redhat.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#ifndef _SUNXI_I2C_H_
++#define _SUNXI_I2C_H_
++
++#include <asm/arch/cpu.h>
++
++#define CONFIG_I2C_MVTWSI_BASE SUNXI_TWI0_BASE
++/* This is abp0-clk on sun4i/5i/7i / abp1-clk on sun6i/sun8i which is 24MHz */
++#define CONFIG_SYS_TCLK 24000000
++
++#endif
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/mmc.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/mmc.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/mmc.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/mmc.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,122 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Aaron <leafy.myeh@allwinnertech.com>
++ *
++ * MMC register definition for allwinner sunxi platform.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_MMC_H
++#define _SUNXI_MMC_H
++
++#include <linux/types.h>
++
++struct sunxi_mmc {
++ u32 gctrl; /* 0x00 global control */
++ u32 clkcr; /* 0x04 clock control */
++ u32 timeout; /* 0x08 time out */
++ u32 width; /* 0x0c bus width */
++ u32 blksz; /* 0x10 block size */
++ u32 bytecnt; /* 0x14 byte count */
++ u32 cmd; /* 0x18 command */
++ u32 arg; /* 0x1c argument */
++ u32 resp0; /* 0x20 response 0 */
++ u32 resp1; /* 0x24 response 1 */
++ u32 resp2; /* 0x28 response 2 */
++ u32 resp3; /* 0x2c response 3 */
++ u32 imask; /* 0x30 interrupt mask */
++ u32 mint; /* 0x34 masked interrupt status */
++ u32 rint; /* 0x38 raw interrupt status */
++ u32 status; /* 0x3c status */
++ u32 ftrglevel; /* 0x40 FIFO threshold watermark*/
++ u32 funcsel; /* 0x44 function select */
++ u32 cbcr; /* 0x48 CIU byte count */
++ u32 bbcr; /* 0x4c BIU byte count */
++ u32 dbgc; /* 0x50 debug enable */
++ u32 res0[11];
++ u32 dmac; /* 0x80 internal DMA control */
++ u32 dlba; /* 0x84 internal DMA descr list base address */
++ u32 idst; /* 0x88 internal DMA status */
++ u32 idie; /* 0x8c internal DMA interrupt enable */
++ u32 chda; /* 0x90 */
++ u32 cbda; /* 0x94 */
++};
++
++#define SUNXI_MMC_CLK_POWERSAVE (0x1 << 17)
++#define SUNXI_MMC_CLK_ENABLE (0x1 << 16)
++#define SUNXI_MMC_CLK_DIVIDER_MASK (0xff)
++
++#define SUNXI_MMC_GCTRL_SOFT_RESET (0x1 << 0)
++#define SUNXI_MMC_GCTRL_FIFO_RESET (0x1 << 1)
++#define SUNXI_MMC_GCTRL_DMA_RESET (0x1 << 2)
++#define SUNXI_MMC_GCTRL_RESET (SUNXI_MMC_GCTRL_SOFT_RESET|\
++ SUNXI_MMC_GCTRL_FIFO_RESET|\
++ SUNXI_MMC_GCTRL_DMA_RESET)
++#define SUNXI_MMC_GCTRL_DMA_ENABLE (0x1 << 5)
++#define SUNXI_MMC_GCTRL_ACCESS_BY_AHB (0x1 << 31)
++
++#define SUNXI_MMC_CMD_RESP_EXPIRE (0x1 << 6)
++#define SUNXI_MMC_CMD_LONG_RESPONSE (0x1 << 7)
++#define SUNXI_MMC_CMD_CHK_RESPONSE_CRC (0x1 << 8)
++#define SUNXI_MMC_CMD_DATA_EXPIRE (0x1 << 9)
++#define SUNXI_MMC_CMD_WRITE (0x1 << 10)
++#define SUNXI_MMC_CMD_AUTO_STOP (0x1 << 12)
++#define SUNXI_MMC_CMD_WAIT_PRE_OVER (0x1 << 13)
++#define SUNXI_MMC_CMD_SEND_INIT_SEQ (0x1 << 15)
++#define SUNXI_MMC_CMD_UPCLK_ONLY (0x1 << 21)
++#define SUNXI_MMC_CMD_START (0x1 << 31)
++
++#define SUNXI_MMC_RINT_RESP_ERROR (0x1 << 1)
++#define SUNXI_MMC_RINT_COMMAND_DONE (0x1 << 2)
++#define SUNXI_MMC_RINT_DATA_OVER (0x1 << 3)
++#define SUNXI_MMC_RINT_TX_DATA_REQUEST (0x1 << 4)
++#define SUNXI_MMC_RINT_RX_DATA_REQUEST (0x1 << 5)
++#define SUNXI_MMC_RINT_RESP_CRC_ERROR (0x1 << 6)
++#define SUNXI_MMC_RINT_DATA_CRC_ERROR (0x1 << 7)
++#define SUNXI_MMC_RINT_RESP_TIMEOUT (0x1 << 8)
++#define SUNXI_MMC_RINT_DATA_TIMEOUT (0x1 << 9)
++#define SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE (0x1 << 10)
++#define SUNXI_MMC_RINT_FIFO_RUN_ERROR (0x1 << 11)
++#define SUNXI_MMC_RINT_HARD_WARE_LOCKED (0x1 << 12)
++#define SUNXI_MMC_RINT_START_BIT_ERROR (0x1 << 13)
++#define SUNXI_MMC_RINT_AUTO_COMMAND_DONE (0x1 << 14)
++#define SUNXI_MMC_RINT_END_BIT_ERROR (0x1 << 15)
++#define SUNXI_MMC_RINT_SDIO_INTERRUPT (0x1 << 16)
++#define SUNXI_MMC_RINT_CARD_INSERT (0x1 << 30)
++#define SUNXI_MMC_RINT_CARD_REMOVE (0x1 << 31)
++#define SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT \
++ (SUNXI_MMC_RINT_RESP_ERROR | \
++ SUNXI_MMC_RINT_RESP_CRC_ERROR | \
++ SUNXI_MMC_RINT_DATA_CRC_ERROR | \
++ SUNXI_MMC_RINT_RESP_TIMEOUT | \
++ SUNXI_MMC_RINT_DATA_TIMEOUT | \
++ SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE | \
++ SUNXI_MMC_RINT_FIFO_RUN_ERROR | \
++ SUNXI_MMC_RINT_HARD_WARE_LOCKED | \
++ SUNXI_MMC_RINT_START_BIT_ERROR | \
++ SUNXI_MMC_RINT_END_BIT_ERROR) /* 0xbfc2 */
++#define SUNXI_MMC_RINT_INTERRUPT_DONE_BIT \
++ (SUNXI_MMC_RINT_AUTO_COMMAND_DONE | \
++ SUNXI_MMC_RINT_DATA_OVER | \
++ SUNXI_MMC_RINT_COMMAND_DONE | \
++ SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE)
++
++#define SUNXI_MMC_STATUS_RXWL_FLAG (0x1 << 0)
++#define SUNXI_MMC_STATUS_TXWL_FLAG (0x1 << 1)
++#define SUNXI_MMC_STATUS_FIFO_EMPTY (0x1 << 2)
++#define SUNXI_MMC_STATUS_FIFO_FULL (0x1 << 3)
++#define SUNXI_MMC_STATUS_CARD_PRESENT (0x1 << 8)
++#define SUNXI_MMC_STATUS_CARD_DATA_BUSY (0x1 << 9)
++#define SUNXI_MMC_STATUS_DATA_FSM_BUSY (0x1 << 10)
++
++#define SUNXI_MMC_IDMAC_RESET (0x1 << 0)
++#define SUNXI_MMC_IDMAC_FIXBURST (0x1 << 1)
++#define SUNXI_MMC_IDMAC_ENABLE (0x1 << 7)
++
++#define SUNXI_MMC_IDIE_TXIRQ (0x1 << 0)
++#define SUNXI_MMC_IDIE_RXIRQ (0x1 << 1)
++
++int sunxi_mmc_init(int sdc_no);
++#endif /* _SUNXI_MMC_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/p2wi.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/p2wi.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/p2wi.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/p2wi.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,142 @@
++/*
++ * Sunxi platform Push-Push i2c register definition.
++ *
++ * (c) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
++ * http://linux-sunxi.org
++ *
++ * (c)Copyright 2006-2013
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Berg Xing <bergxing@allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_P2WI_H
++#define _SUNXI_P2WI_H
++
++#include <linux/types.h>
++
++#define P2WI_CTRL_RESET (0x1 << 0)
++#define P2WI_CTRL_IRQ_EN (0x1 << 1)
++#define P2WI_CTRL_TRANS_ABORT (0x1 << 6)
++#define P2WI_CTRL_TRANS_START (0x1 << 7)
++
++#define __P2WI_CC_CLK(n) (((n) & 0xff) << 0)
++#define P2WI_CC_CLK_MASK __P2WI_CC_CLK_DIV(0xff)
++#define __P2WI_CC_CLK_DIV(n) (((n) >> 1) - 1)
++#define P2WI_CC_CLK_DIV(n) \
++ __P2WI_CC_CLK(__P2WI_CC_CLK_DIV(n))
++#define P2WI_CC_SDA_OUT_DELAY(n) (((n) & 0x7) << 8)
++#define P2WI_CC_SDA_OUT_DELAY_MASK P2WI_CC_SDA_OUT_DELAY(0x7)
++
++#define P2WI_IRQ_TRANS_DONE (0x1 << 0)
++#define P2WI_IRQ_TRANS_ERR (0x1 << 1)
++#define P2WI_IRQ_LOAD_BUSY (0x1 << 2)
++
++#define P2WI_STAT_TRANS_DONE (0x1 << 0)
++#define P2WI_STAT_TRANS_ERR (0x1 << 1)
++#define P2WI_STAT_LOAD_BUSY (0x1 << 2)
++#define __P2WI_STAT_TRANS_ERR(n) (((n) & 0xff) << 8)
++#define P2WI_STAT_TRANS_ERR_MASK __P2WI_STAT_TRANS_ERR_ID(0xff)
++#define __P2WI_STAT_TRANS_ERR_BYTE_1 0x01
++#define __P2WI_STAT_TRANS_ERR_BYTE_2 0x02
++#define __P2WI_STAT_TRANS_ERR_BYTE_3 0x04
++#define __P2WI_STAT_TRANS_ERR_BYTE_4 0x08
++#define __P2WI_STAT_TRANS_ERR_BYTE_5 0x10
++#define __P2WI_STAT_TRANS_ERR_BYTE_6 0x20
++#define __P2WI_STAT_TRANS_ERR_BYTE_7 0x40
++#define __P2WI_STAT_TRANS_ERR_BYTE_8 0x80
++#define P2WI_STAT_TRANS_ERR_BYTE_1 \
++ __P2WI_STAT_TRANS_ERR(__P2WI_STAT_TRANS_ERR_BYTE_1)
++#define P2WI_STAT_TRANS_ERR_BYTE_2 \
++ __P2WI_STAT_TRANS_ERR(__P2WI_STAT_TRANS_ERR_BYTE_2)
++#define P2WI_STAT_TRANS_ERR_BYTE_3 \
++ __P2WI_STAT_TRANS_ERR(__P2WI_STAT_TRANS_ERR_BYTE_3)
++#define P2WI_STAT_TRANS_ERR_BYTE_4 \
++ __P2WI_STAT_TRANS_ERR(__P2WI_STAT_TRANS_ERR_BYTE_4)
++#define P2WI_STAT_TRANS_ERR_BYTE_5 \
++ __P2WI_STAT_TRANS_ERR(__P2WI_STAT_TRANS_ERR_BYTE_5)
++#define P2WI_STAT_TRANS_ERR_BYTE_6 \
++ __P2WI_STAT_TRANS_ERR(__P2WI_STAT_TRANS_ERR_BYTE_6)
++#define P2WI_STAT_TRANS_ERR_BYTE_7 \
++ __P2WI_STAT_TRANS_ERR(__P2WI_STAT_TRANS_ERR_BYTE_7)
++#define P2WI_STAT_TRANS_ERR_BYTE_8 \
++ __P2WI_STAT_TRANS_ERR(__P2WI_STAT_TRANS_ERR_BYTE_8)
++
++#define P2WI_DATADDR_BYTE_1(n) (((n) & 0xff) << 0)
++#define P2WI_DATADDR_BYTE_1_MASK P2WI_DATADDR_BYTE_1(0xff)
++#define P2WI_DATADDR_BYTE_2(n) (((n) & 0xff) << 8)
++#define P2WI_DATADDR_BYTE_2_MASK P2WI_DATADDR_BYTE_2(0xff)
++#define P2WI_DATADDR_BYTE_3(n) (((n) & 0xff) << 16)
++#define P2WI_DATADDR_BYTE_3_MASK P2WI_DATADDR_BYTE_3(0xff)
++#define P2WI_DATADDR_BYTE_4(n) (((n) & 0xff) << 24)
++#define P2WI_DATADDR_BYTE_4_MASK P2WI_DATADDR_BYTE_4(0xff)
++#define P2WI_DATADDR_BYTE_5(n) (((n) & 0xff) << 0)
++#define P2WI_DATADDR_BYTE_5_MASK P2WI_DATADDR_BYTE_5(0xff)
++#define P2WI_DATADDR_BYTE_6(n) (((n) & 0xff) << 8)
++#define P2WI_DATADDR_BYTE_6_MASK P2WI_DATADDR_BYTE_6(0xff)
++#define P2WI_DATADDR_BYTE_7(n) (((n) & 0xff) << 16)
++#define P2WI_DATADDR_BYTE_7_MASK P2WI_DATADDR_BYTE_7(0xff)
++#define P2WI_DATADDR_BYTE_8(n) (((n) & 0xff) << 24)
++#define P2WI_DATADDR_BYTE_8_MASK P2WI_DATADDR_BYTE_8(0xff)
++
++#define __P2WI_DATA_NUM_BYTES(n) (((n) & 0x7) << 0)
++#define P2WI_DATA_NUM_BYTES_MASK __P2WI_DATA_NUM_BYTES(0x7)
++#define P2WI_DATA_NUM_BYTES(n) __P2WI_DATA_NUM_BYTES((n) - 1)
++#define P2WI_DATA_NUM_BYTES_READ (0x1 << 4)
++
++#define P2WI_DATA_BYTE_1(n) (((n) & 0xff) << 0)
++#define P2WI_DATA_BYTE_1_MASK P2WI_DATA_BYTE_1(0xff)
++#define P2WI_DATA_BYTE_2(n) (((n) & 0xff) << 8)
++#define P2WI_DATA_BYTE_2_MASK P2WI_DATA_BYTE_2(0xff)
++#define P2WI_DATA_BYTE_3(n) (((n) & 0xff) << 16)
++#define P2WI_DATA_BYTE_3_MASK P2WI_DATA_BYTE_3(0xff)
++#define P2WI_DATA_BYTE_4(n) (((n) & 0xff) << 24)
++#define P2WI_DATA_BYTE_4_MASK P2WI_DATA_BYTE_4(0xff)
++#define P2WI_DATA_BYTE_5(n) (((n) & 0xff) << 0)
++#define P2WI_DATA_BYTE_5_MASK P2WI_DATA_BYTE_5(0xff)
++#define P2WI_DATA_BYTE_6(n) (((n) & 0xff) << 8)
++#define P2WI_DATA_BYTE_6_MASK P2WI_DATA_BYTE_6(0xff)
++#define P2WI_DATA_BYTE_7(n) (((n) & 0xff) << 16)
++#define P2WI_DATA_BYTE_7_MASK P2WI_DATA_BYTE_7(0xff)
++#define P2WI_DATA_BYTE_8(n) (((n) & 0xff) << 24)
++#define P2WI_DATA_BYTE_8_MASK P2WI_DATA_BYTE_8(0xff)
++
++#define P2WI_LINECTRL_SDA_CTRL_EN (0x1 << 0)
++#define P2WI_LINECTRL_SDA_OUT_HIGH (0x1 << 1)
++#define P2WI_LINECTRL_SCL_CTRL_EN (0x1 << 2)
++#define P2WI_LINECTRL_SCL_OUT_HIGH (0x1 << 3)
++#define P2WI_LINECTRL_SDA_STATE_HIGH (0x1 << 4)
++#define P2WI_LINECTRL_SCL_STATE_HIGH (0x1 << 5)
++
++#define P2WI_PM_DEV_ADDR(n) (((n) & 0xff) << 0)
++#define P2WI_PM_DEV_ADDR_MASK P2WI_PM_DEV_ADDR(0xff)
++#define P2WI_PM_CTRL_ADDR(n) (((n) & 0xff) << 8)
++#define P2WI_PM_CTRL_ADDR_MASK P2WI_PM_CTRL_ADDR(0xff)
++#define P2WI_PM_INIT_DATA(n) (((n) & 0xff) << 16)
++#define P2WI_PM_INIT_DATA_MASK P2WI_PM_INIT_DATA(0xff)
++#define P2WI_PM_INIT_SEND (0x1 << 31)
++
++#ifndef __ASSEMBLY__
++struct sunxi_p2wi_reg {
++ u32 ctrl; /* 0x00 control */
++ u32 cc; /* 0x04 clock control */
++ u32 irq; /* 0x08 interrupt */
++ u32 status; /* 0x0c status */
++ u32 dataddr0; /* 0x10 data address 0 */
++ u32 dataddr1; /* 0x14 data address 1 */
++ u32 numbytes; /* 0x18 num bytes */
++ u32 data0; /* 0x1c data buffer 0 */
++ u32 data1; /* 0x20 data buffer 1 */
++ u32 linectrl; /* 0x24 line control */
++ u32 pm; /* 0x28 power management */
++};
++
++void p2wi_init(void);
++int p2wi_set_pmu_address(u8 slave_addr, u8 ctrl_reg, u8 init_data);
++int p2wi_read(const u8 addr, u8 *data);
++int p2wi_write(const u8 addr, u8 data);
++
++#endif /* __ASSEMBLY__ */
++#endif /* _SUNXI_P2WI_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/prcm.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/prcm.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/prcm.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/prcm.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,238 @@
++/*
++ * Sunxi A31 Power Management Unit register definition.
++ *
++ * (C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
++ * http://linux-sunxi.org
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Berg Xing <bergxing@allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_PRCM_H
++#define _SUNXI_PRCM_H
++
++#define __PRCM_CPUS_CFG_PRE(n) (((n) & 0x3) << 4)
++#define PRCM_CPUS_CFG_PRE_MASK __PRCM_CPUS_CFG_PRE(0x3)
++#define __PRCM_CPUS_CFG_PRE_DIV(n) (((n) >> 1) - 1)
++#define PRCM_CPUS_CFG_PRE_DIV(n) \
++ __PRCM_CPUS_CFG_PRE(__PRCM_CPUS_CFG_CLK_PRE(n))
++#define __PRCM_CPUS_CFG_POST(n) (((n) & 0x1f) << 8)
++#define PRCM_CPUS_CFG_POST_MASK __PRCM_CPUS_CFG_POST(0x1f)
++#define __PRCM_CPUS_CFG_POST_DIV(n) ((n) - 1)
++#define PRCM_CPUS_CFG_POST_DIV(n) \
++ __PRCM_CPUS_CFG_POST_DIV(__PRCM_CPUS_CFG_POST_DIV(n))
++#define __PRCM_CPUS_CFG_CLK_SRC(n) (((n) & 0x3) << 16)
++#define PRCM_CPUS_CFG_CLK_SRC_MASK __PRCM_CPUS_CFG_CLK_SRC(0x3)
++#define __PRCM_CPUS_CFG_CLK_SRC_LOSC 0x0
++#define __PRCM_CPUS_CFG_CLK_SRC_HOSC 0x1
++#define __PRCM_CPUS_CFG_CLK_SRC_PLL6 0x2
++#define __PRCM_CPUS_CFG_CLK_SRC_PDIV 0x3
++#define PRCM_CPUS_CFG_CLK_SRC_LOSC \
++ __PRCM_CPUS_CFG_CLK_SRC(__PRCM_CPUS_CFG_CLK_SRC_LOSC)
++#define PRCM_CPUS_CFG_CLK_SRC_HOSC \
++ __PRCM_CPUS_CFG_CLK_SRC(__PRCM_CPUS_CFG_CLK_SRC_HOSC)
++#define PRCM_CPUS_CFG_CLK_SRC_PLL6 \
++ __PRCM_CPUS_CFG_CLK_SRC(__PRCM_CPUS_CFG_CLK_SRC_PLL6)
++#define PRCM_CPUS_CFG_CLK_SRC_PDIV \
++ __PRCM_CPUS_CFG_CLK_SRC(__PRCM_CPUS_CFG_CLK_SRC_PDIV)
++
++#define __PRCM_APB0_RATIO(n) (((n) & 0x3) <<0)
++#define PRCM_APB0_RATIO_DIV_MASK __PRCM_APB0_RATIO_DIV(0x3)
++#define __PRCM_APB0_RATIO_DIV(n) (((n) >> 1) - 1)
++#define PRCM_APB0_RATIO_DIV(n) \
++ __PRCM_APB0_RATIO(__PRCM_APB0_RATIO_DIV(n))
++
++#define PRCM_CPU_CFG_NEON_CLK_EN (0x1 << 0)
++#define PRCM_CPU_CFG_CPU_CLK_EN (0x1 << 1)
++
++#define PRCM_APB0_GATE_PIO (0x1 << 0)
++#define PRCM_APB0_GATE_IR (0x1 << 1)
++#define PRCM_APB0_GATE_TIMER01 (0x1 << 2)
++#define PRCM_APB0_GATE_P2WI (0x1 << 3)
++#define PRCM_APB0_GATE_UART (0x1 << 4)
++#define PRCM_APB0_GATE_1WIRE (0x1 << 5)
++#define PRCM_APB0_GATE_I2C (0x1 << 6)
++
++#define PRCM_APB0_RESET_PIO (0x1 << 0)
++#define PRCM_APB0_RESET_IR (0x1 << 1)
++#define PRCM_APB0_RESET_TIMER01 (0x1 << 2)
++#define PRCM_APB0_RESET_P2WI (0x1 << 3)
++#define PRCM_APB0_RESET_UART (0x1 << 4)
++#define PRCM_APB0_RESET_1WIRE (0x1 << 5)
++#define PRCM_APB0_RESET_I2C (0x1 << 6)
++
++#define PRCM_PLL_CTRL_PLL_BIAS (0x1 << 0)
++#define PRCM_PLL_CTRL_HOSC_GAIN_ENH (0x1 << 1)
++#define __PRCM_PLL_CTRL_USB_CLK_SRC(n) (((n) & 0x3) << 4)
++#define PRCM_PLL_CTRL_USB_CLK_SRC_MASK \
++ __PRCM_PLL_CTRL_USB_CLK_SRC(0x3)
++#define __PRCM_PLL_CTRL_USB_CLK_0 0x0
++#define __PRCM_PLL_CTRL_USB_CLK_1 0x1
++#define __PRCM_PLL_CTRL_USB_CLK_2 0x2
++#define __PRCM_PLL_CTRL_USB_CLK_3 0x3
++#define PRCM_PLL_CTRL_USB_CLK_0 \
++ __PRCM_PLL_CTRL_USB_CLK_SRC(__PRCM_PLL_CTRL_USB_CLK_0)
++#define PRCM_PLL_CTRL_USB_CLK_1 \
++ __PRCM_PLL_CTRL_USB_CLK_SRC(__PRCM_PLL_CTRL_USB_CLK_1)
++#define PRCM_PLL_CTRL_USB_CLK_2 \
++ __PRCM_PLL_CTRL_USB_CLK_SRC(__PRCM_PLL_CTRL_USB_CLK_2)
++#define PRCM_PLL_CTRL_USB_CLK_3 \
++ __PRCM_PLL_CTRL_USB_CLK_SRC(__PRCM_PLL_CTRL_USB_CLK_3)
++#define __PRCM_PLL_CTRL_INT_PLL_IN_SEL(n) (((n) & 0x3) << 12)
++#define PRCM_PLL_CTRL_INT_PLL_IN_SEL_MASK \
++ __PRCM_PLL_CTRL_INT_PLL_IN_SEL(0x3)
++#define PRCM_PLL_CTRL_INT_PLL_IN_SEL(n) \
++ __PRCM_PLL_CTRL_INT_PLL_IN_SEL(n)
++#define __PRCM_PLL_CTRL_HOSC_CLK_SEL(n) (((n) & 0x3) << 20)
++#define PRCM_PLL_CTRL_HOSC_CLK_SEL_MASK \
++ __PRCM_PLL_CTRL_HOSC_CLK_SEL(0x3)
++#define __PRCM_PLL_CTRL_HOSC_CLK_0 0x0
++#define __PRCM_PLL_CTRL_HOSC_CLK_1 0x1
++#define __PRCM_PLL_CTRL_HOSC_CLK_2 0x2
++#define __PRCM_PLL_CTRL_HOSC_CLK_3 0x3
++#define PRCM_PLL_CTRL_HOSC_CLK_0 \
++ __PRCM_PLL_CTRL_HOSC_CLK_SEL(__PRCM_PLL_CTRL_HOSC_CLK_0)
++#define PRCM_PLL_CTRL_HOSC_CLK_1 \
++ __PRCM_PLL_CTRL_HOSC_CLK_SEL(__PRCM_PLL_CTRL_HOSC_CLK_1)
++#define PRCM_PLL_CTRL_HOSC_CLK_2 \
++ __PRCM_PLL_CTRL_HOSC_CLK_SEL(__PRCM_PLL_CTRL_HOSC_CLK_2)
++#define PRCM_PLL_CTRL_HOSC_CLK_3 \
++ __PRCM_PLL_CTRL_HOSC_CLK_SEL(__PRCM_PLL_CTRL_HOSC_CLK_3)
++#define PRCM_PLL_CTRL_PLL_TST_SRC_EXT (0x1 << 24)
++#define PRCM_PLL_CTRL_LDO_DIGITAL_EN (0x1 << 0)
++#define PRCM_PLL_CTRL_LDO_ANALOG_EN (0x1 << 1)
++#define PRCM_PLL_CTRL_EXT_OSC_EN (0x1 << 2)
++#define PRCM_PLL_CTRL_CLK_TST_EN (0x1 << 3)
++#define PRCM_PLL_CTRL_IN_PWR_HIGH (0x1 << 15) /* 3.3 for hi 2.5 for lo */
++#define __PRCM_PLL_CTRL_VDD_LDO_OUT(n) (((n) & 0x7) << 16)
++#define PRCM_PLL_CTRL_LDO_OUT_MASK \
++ __PRCM_PLL_CTRL_LDO_OUT(0x7)
++/* When using the low voltage 20 mV steps, and high voltage 30 mV steps */
++#define PRCM_PLL_CTRL_LDO_OUT_L(n) \
++ __PRCM_PLL_CTRL_VDD_LDO_OUT((((n) - 1000) / 20) & 0x7)
++#define PRCM_PLL_CTRL_LDO_OUT_H(n) \
++ __PRCM_PLL_CTRL_VDD_LDO_OUT((((n) - 1160) / 30) & 0x7)
++#define PRCM_PLL_CTRL_LDO_OUT_LV(n) \
++ __PRCM_PLL_CTRL_VDD_LDO_OUT((((n) & 0x7) * 20) + 1000)
++#define PRCM_PLL_CTRL_LDO_OUT_HV(n) \
++ __PRCM_PLL_CTRL_VDD_LDO_OUT((((n) & 0x7) * 30) + 1160)
++#define PRCM_PLL_CTRL_LDO_KEY (0xa7 << 24)
++
++#define PRCM_CLK_1WIRE_GATE (0x1 << 31)
++
++#define __PRCM_CLK_MOD0_M(n) (((n) & 0xf) << 0)
++#define PRCM_CLK_MOD0_M_MASK __PRCM_CLK_MOD0_M(0xf)
++#define __PRCM_CLK_MOD0_M_X(n) (n - 1)
++#define PRCM_CLK_MOD0_M(n) __PRCM_CLK_MOD0_M(__PRCM_CLK_MOD0_M_X(n))
++#define PRCM_CLK_MOD0_OUT_PHASE(n) (((n) & 0x7) << 8)
++#define PRCM_CLK_MOD0_OUT_PHASE_MASK(n) PRCM_CLK_MOD0_OUT_PHASE(0x7)
++#define _PRCM_CLK_MOD0_N(n) (((n) & 0x3) << 16)
++#define PRCM_CLK_MOD0_N_MASK __PRCM_CLK_MOD_N(0x3)
++#define __PRCM_CLK_MOD0_N_X(n) (((n) >> 1) -1)
++#define PRCM_CLK_MOD0_N(n) __PRCM_CLK_MOD0_N(__PRCM_CLK_MOD0_N_X(n))
++#define PRCM_CLK_MOD0_SMPL_PHASE(n) (((n) & 0x7) << 20)
++#define PRCM_CLK_MOD0_SMPL_PHASE_MASK PRCM_CLK_MOD0_SMPL_PHASE(0x7)
++#define PRCM_CLK_MOD0_SRC_SEL(n) (((n) & 0x7) << 24)
++#define PRCM_CLK_MOD0_SRC_SEL_MASK PRCM_CLK_MOD0_SRC_SEL(0x7)
++#define PRCM_CLK_MOD0_GATE_EN (0x1 << 31)
++
++#define PRCM_APB0_RESET_PIO (0x1 << 0)
++#define PRCM_APB0_RESET_IR (0x1 << 1)
++#define PRCM_APB0_RESET_TIMER01 (0x1 << 2)
++#define PRCM_APB0_RESET_P2WI (0x1 << 3)
++#define PRCM_APB0_RESET_UART (0x1 << 4)
++#define PRCM_APB0_RESET_1WIRE (0x1 << 5)
++#define PRCM_APB0_RESET_I2C (0x1 << 6)
++
++#define __PRCM_CLK_OUTD_M(n) (((n) & 0x7) << 8)
++#define PRCM_CLK_OUTD_M_MASK __PRCM_CLK_OUTD_M(0x7)
++#define __PRCM_CLK_OUTD_M_X() ((n) - 1)
++#define PRCM_CLK_OUTD_M(n) __PRCM_CLK_OUTD_M(__PRCM_CLK_OUTD_M_X(n))
++#define __PRCM_CLK_OUTD_N(n) (((n) & 0x7) << 20)
++#define PRCM_CLK_OUTD_N_MASK __PRCM_CLK_OUTD_N(0x7)
++#define __PRCM_CLK_OUTD_N_X(n) (((n) >> 1) - 1)
++#define PRCM_CLK_OUTD_N(n) __PRCM_CLK_OUTD_N(__PRCM_CLK_OUTD_N_X(n)
++#define __PRCM_CLK_OUTD_SRC_SEL(n) (((n) & 0x3) << 24)
++#define PRCM_CLK_OUTD_SRC_SEL_MASK __PRCM_CLK_OUTD_SRC_SEL(0x3)
++#define __PRCM_CLK_OUTD_SRC_LOSC2 0x0
++#define __PRCM_CLK_OUTD_SRC_LOSC 0x1
++#define __PRCM_CLK_OUTD_SRC_HOSC 0x2
++#define __PRCM_CLK_OUTD_SRC_ERR 0x3
++#define PRCM_CLK_OUTD_SRC_LOSC2 \
++#deifne __PRCM_CLK_OUTD_SRC_SEL(__PRCM_CLK_OUTD_SRC_LOSC2)
++#define PRCM_CLK_OUTD_SRC_LOSC \
++#deifne __PRCM_CLK_OUTD_SRC_SEL(__PRCM_CLK_OUTD_SRC_LOSC)
++#define PRCM_CLK_OUTD_SRC_HOSC \
++#deifne __PRCM_CLK_OUTD_SRC_SEL(__PRCM_CLK_OUTD_SRC_HOSC)
++#define PRCM_CLK_OUTD_SRC_ERR \
++#deifne __PRCM_CLK_OUTD_SRC_SEL(__PRCM_CLK_OUTD_SRC_ERR)
++#define PRCM_CLK_OUTD_EN (0x1 << 31)
++
++#define PRCM_CPU0_PWROFF (0x1 << 0)
++#define PRCM_CPU1_PWROFF (0x1 << 1)
++#define PRCM_CPU2_PWROFF (0x1 << 2)
++#define PRCM_CPU3_PWROFF (0x1 << 3)
++#define PRCM_CPU_ALL_PWROFF (0xf << 0)
++
++#define PRCM_VDD_SYS_DRAM_CH0_PAD_HOLD_PWROFF (0x1 << 0)
++#define PRCM_VDD_SYS_DRAM_CH1_PAD_HOLD_PWROFF (0x1 << 1)
++#define PRCM_VDD_SYS_AVCC_A_PWROFF (0x1 << 2)
++#define PRCM_VDD_SYS_CPU0_VDD_PWROFF (0x1 << 3)
++
++#define PRCM_VDD_GPU_PWROFF (0x1 << 0)
++
++#define PRCM_VDD_SYS_RESET (0x1 << 0)
++
++#define PRCM_CPU1_PWR_CLAMP(n) (((n) & 0xff) << 0)
++#define PRCM_CPU1_PWR_CLAMP_MASK PRCM_CPU1_PWR_CLAMP(0xff)
++
++#define PRCM_CPU2_PWR_CLAMP(n) (((n) & 0xff) << 0)
++#define PRCM_CPU2_PWR_CLAMP_MASK PRCM_CPU2_PWR_CLAMP(0xff)
++
++#define PRCM_CPU3_PWR_CLAMP(n) (((n) & 0xff) << 0)
++#define PRCM_CPU3_PWR_CLAMP_MASK PRCM_CPU3_PWR_CLAMP(0xff)
++
++#ifndef __ASSEMBLY__
++struct sunxi_prcm_reg {
++ u32 cpus_cfg; /* 0x000 */
++ u8 res0[0x8]; /* 0x004 */
++ u32 apb0_ratio; /* 0x00c */
++ u32 cpu0_cfg; /* 0x010 */
++ u32 cpu1_cfg; /* 0x014 */
++ u32 cpu2_cfg; /* 0x018 */
++ u32 cpu3_cfg; /* 0x01c */
++ u8 res1[0x8]; /* 0x020 */
++ u32 apb0_gate; /* 0x028 */
++ u8 res2[0x14]; /* 0x02c */
++ u32 pll_ctrl0; /* 0x040 */
++ u32 pll_ctrl1; /* 0x044 */
++ u8 res3[0x8]; /* 0x048 */
++ u32 clk_1wire; /* 0x050 */
++ u32 clk_ir; /* 0x054 */
++ u8 res4[0x58]; /* 0x058 */
++ u32 apb0_reset; /* 0x0b0 */
++ u8 res5[0x3c]; /* 0x0b4 */
++ u32 clk_outd; /* 0x0f0 */
++ u8 res6[0xc]; /* 0x0f4 */
++ u32 cpu_pwroff; /* 0x100 */
++ u8 res7[0xc]; /* 0x104 */
++ u32 vdd_sys_pwroff; /* 0x110 */
++ u8 res8[0x4]; /* 0x114 */
++ u32 gpu_pwroff; /* 0x118 */
++ u8 res9[0x4]; /* 0x11c */
++ u32 vdd_pwr_reset; /* 0x120 */
++ u8 res10[0x20]; /* 0x124 */
++ u32 cpu1_pwr_clamp; /* 0x144 */
++ u32 cpu2_pwr_clamp; /* 0x148 */
++ u32 cpu3_pwr_clamp; /* 0x14c */
++ u8 res11[0x30]; /* 0x150 */
++ u32 dram_pwr; /* 0x180 */
++ u8 res12[0xc]; /* 0x184 */
++ u32 dram_tst; /* 0x190 */
++};
++
++void prcm_apb0_enable(u32 flags);
++#endif /* __ASSEMBLY__ */
++#endif /* _PRCM_H */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/smp.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/smp.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/smp.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/smp.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,22 @@
++/*
++ * (C) Copyright 2013
++ * Carl van Schaik <carl@ok-labs.com>
++ *
++ * CPU configuration registers for the sun7i (A20).
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_SMP_H_
++#define _SUNXI_SMP_H_
++
++#ifndef __ASSEMBLY__
++
++void startup_secondaries(void);
++
++/* Assembly entry point */
++extern void secondary_init(void);
++
++#endif /* __ASSEMBLY__ */
++
++#endif /* _SUNXI_SMP_H_ */
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/spl.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/spl.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/spl.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/spl.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,20 @@
++/*
++ * This is a copy of omap3/spl.h:
++ *
++ * (C) Copyright 2012
++ * Texas Instruments, <www.ti.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#ifndef _ASM_ARCH_SPL_H_
++#define _ASM_SPL_H_
++
++#define BOOT_DEVICE_NONE 0
++#define BOOT_DEVICE_XIP 1
++#define BOOT_DEVICE_NAND 2
++#define BOOT_DEVICE_ONE_NAND 3
++#define BOOT_DEVICE_MMC2 5 /*emmc*/
++#define BOOT_DEVICE_MMC1 6
++#define BOOT_DEVICE_XIPWAIT 7
++#define BOOT_DEVICE_MMC2_2 0xff
++#endif
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/sys_proto.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/sys_proto.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/sys_proto.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/sys_proto.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,16 @@
++/*
++ * (C) Copyright 2007-2012
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SYS_PROTO_H_
++#define _SYS_PROTO_H_
++
++#include <linux/types.h>
++
++void sdelay(unsigned long);
++
++#endif
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/timer.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/timer.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/timer.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/timer.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,88 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * Configuration settings for the Allwinner A10-evb board.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_TIMER_H_
++#define _SUNXI_TIMER_H_
++
++#ifndef __ASSEMBLY__
++
++#include <linux/types.h>
++
++/* General purpose timer */
++struct sunxi_timer {
++ u32 ctl;
++ u32 inter;
++ u32 val;
++ u8 res[4];
++};
++
++/* Audio video sync*/
++struct sunxi_avs {
++ u32 ctl; /* 0x80 */
++ u32 cnt0; /* 0x84 */
++ u32 cnt1; /* 0x88 */
++ u32 div; /* 0x8c */
++};
++
++/* 64 bit counter */
++struct sunxi_64cnt {
++ u32 ctl; /* 0xa0 */
++ u32 lo; /* 0xa4 */
++ u32 hi; /* 0xa8 */
++};
++
++/* Watchdog */
++struct sunxi_wdog {
++ u32 ctl; /* 0x90 */
++ u32 mode; /* 0x94 */
++};
++
++/* Rtc */
++struct sunxi_rtc {
++ u32 ctl; /* 0x100 */
++ u32 yymmdd; /* 0x104 */
++ u32 hhmmss; /* 0x108 */
++};
++
++/* Alarm */
++struct sunxi_alarm {
++ u32 ddhhmmss; /* 0x10c */
++ u32 hhmmss; /* 0x110 */
++ u32 en; /* 0x114 */
++ u32 irqen; /* 0x118 */
++ u32 irqsta; /* 0x11c */
++};
++
++/* Timer general purpose register */
++struct sunxi_tgp {
++ u32 tgpd;
++};
++
++struct sunxi_timer_reg {
++ u32 tirqen; /* 0x00 */
++ u32 tirqsta; /* 0x04 */
++ u8 res1[8];
++ struct sunxi_timer timer[6]; /* We have 6 timers */
++ u8 res2[16];
++ struct sunxi_avs avs;
++ struct sunxi_wdog wdog;
++ u8 res3[8];
++ struct sunxi_64cnt cnt64;
++ u8 res4[0x58];
++ struct sunxi_rtc rtc;
++ struct sunxi_alarm alarm;
++ struct sunxi_tgp tgp[4];
++ u8 res5[8];
++ u32 cpu_cfg;
++};
++
++#endif /* __ASSEMBLY__ */
++
++#endif
+diff -ruN u-boot-2014.04/arch/arm/include/asm/arch-sunxi/watchdog.h u-boot-sunxi/arch/arm/include/asm/arch-sunxi/watchdog.h
+--- u-boot-2014.04/arch/arm/include/asm/arch-sunxi/watchdog.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/arch/arm/include/asm/arch-sunxi/watchdog.h 2014-09-06 16:58:35.381953139 +0200
+@@ -0,0 +1,22 @@
++/*
++ * Watchdog driver for the Allwinner sunxi platform.
++ * Copyright (C) 2013 Oliver Schinagl <oliver@schinagl.nl>
++ * http://www.linux-sunxi.org/
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_WATCHDOG_H_
++#define _SUNXI_WATCHDOG_H_
++
++/* Timeout limits */
++#define WDT_MAX_TIMEOUT 16
++#define WDT_OFF -1
++
++#ifndef __ASSEMBLY__
++void watchdog_reset(void);
++void watchdog_set(int timeout);
++void watchdog_init(void);
++#endif /* __ASSEMBLY__ */
++
++#endif
+diff -ruN u-boot-2014.04/board/sunxi/board.c u-boot-sunxi/board/sunxi/board.c
+--- u-boot-2014.04/board/sunxi/board.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/board.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,239 @@
++/*
++ * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
++ * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
++ *
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * Some board init for the Allwinner A10-evb board.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#ifdef CONFIG_AXP152_POWER
++#include <axp152.h>
++#endif
++#ifdef CONFIG_AXP209_POWER
++#include <axp209.h>
++#endif
++#ifdef CONFIG_AXP221_POWER
++#include <axp221.h>
++#endif
++#include <asm/arch/clock.h>
++#include <asm/arch/cpu.h>
++#include <asm/arch/dram.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/mmc.h>
++#include <asm/io.h>
++#include <net.h>
++
++DECLARE_GLOBAL_DATA_PTR;
++
++/* add board specific code here */
++int board_init(void)
++{
++ int id_pfr1;
++
++ gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
++
++ asm volatile("mrc p15, 0, %0, c0, c1, 1" : "=r"(id_pfr1));
++ debug("id_pfr1: 0x%08x\n", id_pfr1);
++ /* Generic Timer Extension available? */
++ if ((id_pfr1 >> 16) & 0xf) {
++ debug("Setting CNTFRQ\n");
++ /* CNTFRQ == 24 MHz */
++ asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r"(24000000));
++ }
++
++#ifdef CONFIG_STATUS_LED
++ status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
++#endif
++ return 0;
++}
++
++#ifdef CONFIG_DISPLAY_BOARDINFO
++int checkboard(void)
++{
++ printf("Board: %s\n", CONFIG_SYS_BOARD_NAME);
++
++ return 0;
++}
++#endif
++
++int dram_init(void)
++{
++ gd->ram_size = get_ram_size((long *)PHYS_SDRAM_0, PHYS_SDRAM_0_SIZE);
++
++ return 0;
++}
++
++#ifdef CONFIG_GENERIC_MMC
++static void mmc_pinmux_setup(int sdc)
++{
++ unsigned int pin;
++
++ switch (sdc) {
++ case 0:
++ /* D1-PF0, D0-PF1, CLK-PF2, CMD-PF3, D3-PF4, D4-PF5 */
++ for (pin = SUNXI_GPF(0); pin <= SUNXI_GPF(5); pin++) {
++ sunxi_gpio_set_cfgpin(pin, SUNXI_GPF0_SDC0);
++ sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
++ sunxi_gpio_set_drv(pin, 2);
++ }
++ break;
++
++ case 1:
++ /* CMD-PH22, CLK-PH23, D0~D3-PH24~27 : 5 */
++ for (pin = SUNXI_GPH(22); pin <= SUNXI_GPH(27); pin++) {
++ sunxi_gpio_set_cfgpin(pin, SUN4I_GPH22_SDC1);
++ sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
++ sunxi_gpio_set_drv(pin, 2);
++ }
++ break;
++
++ case 2:
++ /* CMD-PC6, CLK-PC7, D0-PC8, D1-PC9, D2-PC10, D3-PC11 */
++ for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(11); pin++) {
++ sunxi_gpio_set_cfgpin(pin, SUNXI_GPC6_SDC2);
++ sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
++ sunxi_gpio_set_drv(pin, 2);
++ }
++ break;
++
++ case 3:
++ /* CMD-PI4, CLK-PI5, D0~D3-PI6~9 : 2 */
++ for (pin = SUNXI_GPI(4); pin <= SUNXI_GPI(9); pin++) {
++ sunxi_gpio_set_cfgpin(pin, SUN4I_GPI4_SDC3);
++ sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
++ sunxi_gpio_set_drv(pin, 2);
++ }
++ break;
++
++ default:
++ printf("sunxi: invalid MMC slot %d for pinmux setup\n", sdc);
++ break;
++ }
++}
++
++int board_mmc_init(bd_t *bis)
++{
++ mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT);
++ sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT);
++#if !defined (CONFIG_SPL_BUILD) && defined (CONFIG_MMC_SUNXI_SLOT_EXTRA)
++ mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA);
++ sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA);
++#endif
++
++ return 0;
++}
++#endif
++
++void i2c_init_board(void)
++{
++ sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUNXI_GPB0_TWI0);
++ sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUNXI_GPB0_TWI0);
++ clock_twi_onoff(0, 1);
++}
++
++#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_SUN6I) || defined(CONFIG_SUN8I)
++void sunxi_board_init(void)
++{
++ int power_failed = 0;
++#if !defined(CONFIG_SUN6I) && !defined(CONFIG_SUN8I)
++ unsigned long ramsize;
++#endif
++
++#ifdef CONFIG_AXP152_POWER
++ power_failed = axp152_init();
++ power_failed |= axp152_set_dcdc2(1400);
++ power_failed |= axp152_set_dcdc3(1500);
++ power_failed |= axp152_set_dcdc4(1250);
++ power_failed |= axp152_set_ldo2(3000);
++#endif
++#ifdef CONFIG_AXP209_POWER
++ power_failed |= axp209_init();
++ power_failed |= axp209_set_dcdc2(1400);
++#ifdef CONFIG_FAST_MBUS
++ power_failed |= axp209_set_dcdc3(1300);
++#else
++ power_failed |= axp209_set_dcdc3(1250);
++#endif
++ power_failed |= axp209_set_ldo2(3000);
++ power_failed |= axp209_set_ldo3(2800);
++ power_failed |= axp209_set_ldo4(2800);
++#endif
++#ifdef CONFIG_AXP221_POWER
++ power_failed = axp221_init();
++ power_failed |= axp221_set_dcdc1(3300);
++ power_failed |= axp221_set_dcdc2(1200);
++ power_failed |= axp221_set_dcdc3(1260);
++ power_failed |= axp221_set_dcdc4(1200);
++ power_failed |= axp221_set_dcdc5(1500);
++#ifdef CONFIG_ENABLE_DLDO1_POWER
++ power_failed |= axp221_set_dldo1(3300);
++#endif
++#endif
++
++#if !defined(CONFIG_SUN6I) && !defined(CONFIG_SUN8I)
++ printf("DRAM:");
++ ramsize = sunxi_dram_init();
++ printf(" %lu MiB\n", ramsize >> 20);
++ if (!ramsize)
++ hang();
++
++ /*
++ * Only clock up the CPU to full speed if we are reasonably
++ * assured it's being powered with suitable core voltage
++ */
++ if (!power_failed)
++ clock_set_pll1(CONFIG_CLK_FULL_SPEED);
++ else
++ printf("Failed to set core voltage! Can't set CPU frequency\n");
++#endif
++}
++#endif
++
++#if defined(CONFIG_SPL_OS_BOOT) && defined(CONFIG_AXP209_POWER)
++int spl_start_uboot(void)
++{
++ if (axp209_poweron_by_dc())
++ return 0;
++ axp209_power_button(); /* Clear any pending button event */
++ mdelay(100);
++ return axp209_power_button();
++}
++#endif
++
++#ifdef CONFIG_SPL_DISPLAY_PRINT
++void spl_display_print(void)
++{
++ printf("Board: %s\n", CONFIG_SYS_BOARD_NAME);
++}
++#endif
++
++#ifdef CONFIG_MISC_INIT_R
++int misc_init_r(void)
++{
++ if (!getenv("ethaddr")) {
++ uint32_t reg_val = readl(SUNXI_SID_BASE);
++
++ if (reg_val) {
++ uint8_t mac_addr[6];
++
++ mac_addr[0] = 0x02; /* Non OUI / registered MAC address */
++ mac_addr[1] = (reg_val >> 0) & 0xff;
++ reg_val = readl(SUNXI_SID_BASE + 0x0c);
++ mac_addr[2] = (reg_val >> 24) & 0xff;
++ mac_addr[3] = (reg_val >> 16) & 0xff;
++ mac_addr[4] = (reg_val >> 8) & 0xff;
++ mac_addr[5] = (reg_val >> 0) & 0xff;
++
++ eth_setenv_enetaddr("ethaddr", mac_addr);
++ }
++ }
++
++ return 0;
++}
++#endif
+diff -ruN u-boot-2014.04/board/sunxi/dram_a10_olinuxino_l.c u-boot-sunxi/board/sunxi/dram_a10_olinuxino_l.c
+--- u-boot-2014.04/board/sunxi/dram_a10_olinuxino_l.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_a10_olinuxino_l.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 480,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_a13_oli_micro.c u-boot-sunxi/board/sunxi/dram_a13_oli_micro.c
+--- u-boot-2014.04/board/sunxi/dram_a13_oli_micro.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_a13_oli_micro.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,32 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 256,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0x10,
++ .emr3 = 0,
++
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_a13_olinuxino.c u-boot-sunxi/board/sunxi/dram_a13_olinuxino.c
+--- u-boot-2014.04/board/sunxi/dram_a13_olinuxino.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_a13_olinuxino.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_a20_olinuxino_l2.c u-boot-sunxi/board/sunxi/dram_a20_olinuxino_l2.c
+--- u-boot-2014.04/board/sunxi/dram_a20_olinuxino_l2.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_a20_olinuxino_l2.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 480,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_a20_olinuxino_l.c u-boot-sunxi/board/sunxi/dram_a20_olinuxino_l.c
+--- u-boot-2014.04/board/sunxi/dram_a20_olinuxino_l.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_a20_olinuxino_l.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 480,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_ainol_aw1.c u-boot-sunxi/board/sunxi/dram_ainol_aw1.c
+--- u-boot-2014.04/board/sunxi/dram_ainol_aw1.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_ainol_aw1.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7b,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 1,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_auxtek_t003.c u-boot-sunxi/board/sunxi/dram_auxtek_t003.c
+--- u-boot-2014.04/board/sunxi/dram_auxtek_t003.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_auxtek_t003.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_cubieboard.c u-boot-sunxi/board/sunxi/dram_cubieboard.c
+--- u-boot-2014.04/board/sunxi/dram_cubieboard.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_cubieboard.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 480,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_cubietruck.c u-boot-sunxi/board/sunxi/dram_cubietruck.c
+--- u-boot-2014.04/board/sunxi/dram_cubietruck.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_cubietruck.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 2048,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0x0,
++ .tpr4 = 0x1,
++ .tpr5 = 0x0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0x0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_eu3000.c u-boot-sunxi/board/sunxi/dram_eu3000.c
+--- u-boot-2014.04/board/sunxi/dram_eu3000.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_eu3000.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7b,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 1,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_forfun_q88db.c u-boot-sunxi/board/sunxi/dram_forfun_q88db.c
+--- u-boot-2014.04/board/sunxi/dram_forfun_q88db.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_forfun_q88db.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 0x7b,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_gooseberry_a721.c u-boot-sunxi/board/sunxi/dram_gooseberry_a721.c
+--- u-boot-2014.04/board/sunxi/dram_gooseberry_a721.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_gooseberry_a721.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 360,
++ .type = 3,
++ .rank_num = 1,
++ .density = 1024,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_h6.c u-boot-sunxi/board/sunxi/dram_h6.c
+--- u-boot-2014.04/board/sunxi/dram_h6.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_h6.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 360,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_hackberry.c u-boot-sunxi/board/sunxi/dram_hackberry.c
+--- u-boot-2014.04/board/sunxi/dram_hackberry.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_hackberry.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 1,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_icou_fatty_i.c u-boot-sunxi/board/sunxi/dram_icou_fatty_i.c
+--- u-boot-2014.04/board/sunxi/dram_icou_fatty_i.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_icou_fatty_i.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 1,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_inet_k70hc.c u-boot-sunxi/board/sunxi/dram_inet_k70hc.c
+--- u-boot-2014.04/board/sunxi/dram_inet_k70hc.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_inet_k70hc.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x12331a7f,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 1,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_linksprite_pcduino3.c u-boot-sunxi/board/sunxi/dram_linksprite_pcduino3.c
+--- u-boot-2014.04/board/sunxi/dram_linksprite_pcduino3.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_linksprite_pcduino3.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 480,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7a,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0x0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_megafeis_a08.c u-boot-sunxi/board/sunxi/dram_megafeis_a08.c
+--- u-boot-2014.04/board/sunxi/dram_megafeis_a08.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_megafeis_a08.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_merrii_m2.c u-boot-sunxi/board/sunxi/dram_merrii_m2.c
+--- u-boot-2014.04/board/sunxi/dram_merrii_m2.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_merrii_m2.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 127,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0x0,
++ .tpr4 = 0x0,
++ .tpr5 = 0x0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0x0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_mini_x_a10s.c u-boot-sunxi/board/sunxi/dram_mini_x_a10s.c
+--- u-boot-2014.04/board/sunxi/dram_mini_x_a10s.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_mini_x_a10s.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_mk802_a10s.c u-boot-sunxi/board/sunxi/dram_mk802_a10s.c
+--- u-boot-2014.04/board/sunxi/dram_mk802_a10s.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_mk802_a10s.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_mk802ii_a20.c u-boot-sunxi/board/sunxi/dram_mk802ii_a20.c
+--- u-boot-2014.04/board/sunxi/dram_mk802ii_a20.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_mk802ii_a20.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 360,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_olimex_a13_som.c u-boot-sunxi/board/sunxi/dram_olimex_a13_som.c
+--- u-boot-2014.04/board/sunxi/dram_olimex_a13_som.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_olimex_a13_som.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,32 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0x10,
++ .emr3 = 0,
++
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_pov_protab2.c u-boot-sunxi/board/sunxi/dram_pov_protab2.c
+--- u-boot-2014.04/board/sunxi/dram_pov_protab2.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_pov_protab2.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_pov_protab2_xxl.c u-boot-sunxi/board/sunxi/dram_pov_protab2_xxl.c
+--- u-boot-2014.04/board/sunxi/dram_pov_protab2_xxl.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_pov_protab2_xxl.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_pov_tab_p703.c u-boot-sunxi/board/sunxi/dram_pov_tab_p703.c
+--- u-boot-2014.04/board/sunxi/dram_pov_tab_p703.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_pov_tab_p703.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 360,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 0x56b9697b,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_r7dongle.c u-boot-sunxi/board/sunxi/dram_r7dongle.c
+--- u-boot-2014.04/board/sunxi/dram_r7dongle.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_r7dongle.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x04,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sanei_n90.c u-boot-sunxi/board/sunxi/dram_sanei_n90.c
+--- u-boot-2014.04/board/sunxi/dram_sanei_n90.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sanei_n90.c 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,30 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 456,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 1,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_semitime_g2.c u-boot-sunxi/board/sunxi/dram_semitime_g2.c
+--- u-boot-2014.04/board/sunxi/dram_semitime_g2.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_semitime_g2.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7b,
++ .odt_en = 0,
++ .size = 1024, /* in MiB */
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0x00,
++ .tpr4 = 0x00,
++ .tpr5 = 0x00,
++ .emr1 = 0x00,
++ .emr2 = 0x10,
++ .emr3 = 0x00,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_312_1024_iow8.c u-boot-sunxi/board/sunxi/dram_sun4i_312_1024_iow8.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_312_1024_iow8.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_312_1024_iow8.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 312,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_360_1024_iow16.c u-boot-sunxi/board/sunxi/dram_sun4i_360_1024_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_360_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_360_1024_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 360,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_360_1024_iow8.c u-boot-sunxi/board/sunxi/dram_sun4i_360_1024_iow8.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_360_1024_iow8.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_360_1024_iow8.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 360,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_360_512.c u-boot-sunxi/board/sunxi/dram_sun4i_360_512.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_360_512.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_360_512.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 360,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_384_1024_iow16.c u-boot-sunxi/board/sunxi/dram_sun4i_384_1024_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_384_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_384_1024_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_384_1024_iow8.c u-boot-sunxi/board/sunxi/dram_sun4i_384_1024_iow8.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_384_1024_iow8.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_384_1024_iow8.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_408_1024_iow16.c u-boot-sunxi/board/sunxi/dram_sun4i_408_1024_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_408_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_408_1024_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_408_1024_iow8.c u-boot-sunxi/board/sunxi/dram_sun4i_408_1024_iow8.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_408_1024_iow8.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_408_1024_iow8.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun4i_408_512.c u-boot-sunxi/board/sunxi/dram_sun4i_408_512.c
+--- u-boot-2014.04/board/sunxi/dram_sun4i_408_512.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun4i_408_512.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 0x7b,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun5i_408_1024_iow16.c u-boot-sunxi/board/sunxi/dram_sun5i_408_1024_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun5i_408_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun5i_408_1024_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7b,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun5i_408_512_busw16_iow8.c u-boot-sunxi/board/sunxi/dram_sun5i_408_512_busw16_iow8.c
+--- u-boot-2014.04/board/sunxi/dram_sun5i_408_512_busw16_iow8.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun5i_408_512_busw16_iow8.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 1,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun5i_432_512_busw16_iow16.c u-boot-sunxi/board/sunxi/dram_sun5i_432_512_busw16_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun5i_432_512_busw16_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun5i_432_512_busw16_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun7i_360_512_busw16_iow16.c u-boot-sunxi/board/sunxi/dram_sun7i_360_512_busw16_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun7i_360_512_busw16_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun7i_360_512_busw16_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 360,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun7i_384_1024_iow16.c u-boot-sunxi/board/sunxi/dram_sun7i_384_1024_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun7i_384_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun7i_384_1024_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun7i_384_512_busw16_iow16.c u-boot-sunxi/board/sunxi/dram_sun7i_384_512_busw16_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun7i_384_512_busw16_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun7i_384_512_busw16_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun7i_432_1024_iow16.c u-boot-sunxi/board/sunxi/dram_sun7i_432_1024_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun7i_432_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun7i_432_1024_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 1,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_sun7i_460_1024_iow16.c u-boot-sunxi/board/sunxi/dram_sun7i_460_1024_iow16.c
+--- u-boot-2014.04/board/sunxi/dram_sun7i_460_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_sun7i_460_1024_iow16.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 480,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0x0,
++ .tpr4 = 0x1,
++ .tpr5 = 0x0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0x0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_wexler_tab_7200.c u-boot-sunxi/board/sunxi/dram_wexler_tab_7200.c
+--- u-boot-2014.04/board/sunxi/dram_wexler_tab_7200.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_wexler_tab_7200.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include "common.h"
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 384,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 0x7f,
++ .odt_en = 1,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 1,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_wobo_i5.c u-boot-sunxi/board/sunxi/dram_wobo_i5.c
+--- u-boot-2014.04/board/sunxi/dram_wobo_i5.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_wobo_i5.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 9,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x04,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_xzpad700.c u-boot-sunxi/board/sunxi/dram_xzpad700.c
+--- u-boot-2014.04/board/sunxi/dram_xzpad700.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_xzpad700.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 408,
++ .type = 3,
++ .rank_num = 1,
++ .density = 4096,
++ .io_width = 16,
++ .bus_width = 16,
++ .cas = 9,
++ .zq = 0x56b9487b,
++ .odt_en = 0,
++ .size = 512,
++ .tpr0 = 0x42d899b7,
++ .tpr1 = 0xa090,
++ .tpr2 = 0x22a00,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0x10,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/dram_zatab.c u-boot-sunxi/board/sunxi/dram_zatab.c
+--- u-boot-2014.04/board/sunxi/dram_zatab.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/dram_zatab.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,31 @@
++/* this file is generated, don't edit it yourself */
++
++#include <common.h>
++#include <asm/arch/dram.h>
++
++static struct dram_para dram_para = {
++ .clock = 432,
++ .type = 3,
++ .rank_num = 1,
++ .density = 2048,
++ .io_width = 8,
++ .bus_width = 32,
++ .cas = 6,
++ .zq = 123,
++ .odt_en = 0,
++ .size = 1024,
++ .tpr0 = 0x30926692,
++ .tpr1 = 0x1090,
++ .tpr2 = 0x1a0c8,
++ .tpr3 = 0,
++ .tpr4 = 0,
++ .tpr5 = 0,
++ .emr1 = 0x4,
++ .emr2 = 0,
++ .emr3 = 0,
++};
++
++unsigned long sunxi_dram_init(void)
++{
++ return dramc_init(&dram_para);
++}
+diff -ruN u-boot-2014.04/board/sunxi/gmac.c u-boot-sunxi/board/sunxi/gmac.c
+--- u-boot-2014.04/board/sunxi/gmac.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/gmac.c 2014-09-06 16:58:36.165953115 +0200
+@@ -0,0 +1,43 @@
++#include <common.h>
++#include <netdev.h>
++#include <miiphy.h>
++#include <asm/gpio.h>
++#include <asm/io.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/gpio.h>
++
++int sunxi_gmac_initialize(bd_t *bis)
++{
++ int pin;
++ struct sunxi_ccm_reg *const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ /* Set up clock gating */
++ setbits_le32(&ccm->ahb_gate1, 0x1 << AHB_GATE_OFFSET_GMAC);
++
++ /* Set MII clock */
++#ifdef CONFIG_RGMII
++ setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
++ CCM_GMAC_CTRL_GPIT_RGMII);
++#else
++ setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_MII |
++ CCM_GMAC_CTRL_GPIT_MII);
++#endif
++
++ /* Configure pin mux settings for GMAC */
++ for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {
++#ifdef CONFIG_RGMII
++ /* skip unused pins in RGMII mode */
++ if (pin == SUNXI_GPA(9) || pin == SUNXI_GPA(14))
++ continue;
++#endif
++ sunxi_gpio_set_cfgpin(pin, SUN7I_GPA0_GMAC);
++ sunxi_gpio_set_drv(pin, 3);
++ }
++
++#ifdef CONFIG_RGMII
++ return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII);
++#else
++ return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII);
++#endif
++}
+diff -ruN u-boot-2014.04/board/sunxi/Makefile u-boot-sunxi/board/sunxi/Makefile
+--- u-boot-2014.04/board/sunxi/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/board/sunxi/Makefile 2014-09-06 16:58:36.161953116 +0200
+@@ -0,0 +1,95 @@
++#
++# (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++#
++# Based on some other board Makefile
++#
++# (C) Copyright 2000-2003
++# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++#
++# SPDX-License-Identifier: GPL-2.0+
++#
++obj-y += board.o
++obj-$(CONFIG_SUNXI_GMAC) += gmac.o
++obj-$(CONFIG_A10_MID_1GB) += dram_sun4i_360_1024_iow16.o
++obj-$(CONFIG_A10_OLINUXINO_L) += dram_a10_olinuxino_l.o
++obj-$(CONFIG_A10S_OLINUXINO_M) += dram_sun5i_432_512_busw16_iow16.o
++obj-$(CONFIG_A13_OLINUXINO) += dram_a13_olinuxino.o
++obj-$(CONFIG_A13_OLINUXINOM) += dram_a13_oli_micro.o
++obj-$(CONFIG_A13_MID) += dram_sun5i_408_512_busw16_iow8.o
++obj-$(CONFIG_A20_OLINUXINO_L) += dram_a20_olinuxino_l.o
++obj-$(CONFIG_A20_OLINUXINO_L2) += dram_a20_olinuxino_l2.o
++obj-$(CONFIG_A20_OLINUXINO_M) += dram_sun7i_384_1024_iow16.o
++obj-$(CONFIG_A20_SOM) += dram_sun7i_384_1024_iow16.o
++obj-$(CONFIG_AINOL_AW1) += dram_ainol_aw1.o
++obj-$(CONFIG_AMPE_A76) += dram_sun5i_432_512_busw16_iow16.o
++obj-$(CONFIG_AUXTEK_T003) += dram_auxtek_t003.o
++obj-$(CONFIG_AUXTEK_T004) += dram_sun5i_432_512_busw16_iow16.o
++obj-$(CONFIG_BA10_TV_BOX) += dram_sun4i_384_1024_iow8.o
++obj-$(CONFIG_COBY_MID7042) += dram_sun4i_408_1024_iow16.o
++obj-$(CONFIG_COBY_MID8042) += dram_sun4i_360_1024_iow16.o
++obj-$(CONFIG_COBY_MID9742) += dram_sun4i_408_1024_iow16.o
++obj-$(CONFIG_MARSBOARD_A10) += dram_sun4i_360_1024_iow16.o
++obj-$(CONFIG_MARSBOARD_A20) += dram_sun4i_360_1024_iow16.o
++obj-$(CONFIG_CUBIEBOARD) += dram_cubieboard.o
++obj-$(CONFIG_CUBIEBOARD2) += dram_sun7i_460_1024_iow16.o
++obj-$(CONFIG_BANANAPI) += dram_sun7i_432_1024_iow16.o
++obj-$(CONFIG_CUBIETRUCK) += dram_cubietruck.o
++obj-$(CONFIG_DNS_M82) += dram_sun4i_360_1024_iow16.o
++obj-$(CONFIG_EOMA68_A10) += dram_sun4i_360_1024_iow8.o
++obj-$(CONFIG_EOMA68_A20) += dram_sun7i_384_1024_iow16.o
++obj-$(CONFIG_EU3000) += dram_eu3000.o
++obj-$(CONFIG_FORFUN_Q88DB) += dram_forfun_q88db.o
++obj-$(CONFIG_GOOSEBERRY_A721) += dram_gooseberry_a721.o
++obj-$(CONFIG_H6) += dram_h6.o
++obj-$(CONFIG_HACKBERRY) += dram_hackberry.o
++obj-$(CONFIG_HBD_MID_S906) += dram_sun7i_432_1024_iow16.o
++obj-$(CONFIG_HCORE_HC860) += dram_sun4i_384_1024_iow16.o
++obj-$(CONFIG_HYUNDAI_A7) += dram_sun4i_360_512.o
++obj-$(CONFIG_A7HD) += dram_sun4i_360_1024_iow8.o
++obj-$(CONFIG_I12_TVBOX) += dram_sun7i_384_1024_iow16.o
++obj-$(CONFIG_ICOU_FATTY_I) += dram_icou_fatty_i.o
++obj-$(CONFIG_INTERRA3) += dram_mk802ii_a20.o
++obj-$(CONFIG_INET_86VZ) += dram_sun5i_432_512_busw16_iow16.o
++obj-$(CONFIG_INET97F_II) += dram_sun4i_408_512.o
++obj-$(CONFIG_INET_K70HC) += dram_inet_k70hc.o
++obj-$(CONFIG_ITEADA10) += dram_cubieboard.o
++obj-$(CONFIG_ITEADA20) += dram_sun7i_460_1024_iow16.o
++obj-$(CONFIG_JESURUN_Q5) += dram_sun4i_312_1024_iow8.o
++obj-$(CONFIG_K1001L1C) += dram_sun7i_384_1024_iow16.o
++obj-$(CONFIG_KURIO_7S) += dram_sun7i_432_1024_iow16.o
++obj-$(CONFIG_LANGCENT_H6S) += dram_sun7i_360_512_busw16_iow16.o
++obj-$(CONFIG_LINKSPRITE_PCDUINO3) += dram_linksprite_pcduino3.o
++obj-$(CONFIG_MEFAFEIS_A08) += dram_megafeis_a08.o
++obj-$(CONFIG_MELE_A1000) += dram_sun4i_360_512.o
++obj-$(CONFIG_MELE_A1000G) += dram_sun4i_360_1024_iow8.o
++obj-$(CONFIG_MELE_A3700) += dram_sun4i_360_1024_iow8.o
++obj-$(CONFIG_MERRII_HUMMINGBIRD_A20) += dram_sun7i_460_1024_iow16.o
++obj-$(CONFIG_MINI_X) += dram_sun4i_360_512.o
++obj-$(CONFIG_MINI_X_1GB) += dram_sun4i_360_1024_iow16.o
++obj-$(CONFIG_MINI_X_A10S) += dram_mini_x_a10s.o
++obj-$(CONFIG_MK802) += dram_sun4i_360_512.o
++obj-$(CONFIG_MK802_1GB) += dram_sun4i_360_1024_iow16.o
++obj-$(CONFIG_MK802_A10S) += dram_mk802_a10s.o
++obj-$(CONFIG_MK802II) += dram_sun4i_408_1024_iow8.o
++obj-$(CONFIG_MK802II_A20) += dram_mk802ii_a20.o
++obj-$(CONFIG_MK808C_A20) += dram_sun7i_384_1024_iow16.o
++obj-$(CONFIG_OLIMEX_A13_SOM) += dram_olimex_a13_som.o
++obj-$(CONFIG_PCDUINO) += dram_sun4i_408_1024_iow8.o
++obj-$(CONFIG_PENGPOD700) += dram_sun4i_384_1024_iow8.o
++obj-$(CONFIG_PENGPOD1000) += dram_sun4i_408_1024_iow16.o
++obj-$(CONFIG_PINERIVER-H25) += dram_sun5i_408_1024_iow16.o
++obj-$(CONFIG_POV_TAB_P703) += dram_pov_tab_p703.o
++obj-$(CONFIG_POV_PROTAB2) += dram_pov_protab2.o
++obj-$(CONFIG_POV_PROTAB2_XXL) += dram_pov_protab2_xxl.o
++obj-$(CONFIG_QT840A) += dram_sun7i_384_512_busw16_iow16.o
++obj-$(CONFIG_R7DONGLE) += dram_r7dongle.o
++obj-$(CONFIG_SANEI_N90) += dram_sanei_n90.o
++obj-$(CONFIG_SEMITIME_G2) += dram_semitime_g2.o
++obj-$(CONFIG_TZX_Q8_713B6) += dram_sun5i_408_512_busw16_iow8.o
++obj-$(CONFIG_TZX_Q8_713B7) += dram_sun5i_408_512_busw16_iow8.o
++obj-$(CONFIG_UHOST_U1A) += dram_sun4i_360_1024_iow8.o
++obj-$(CONFIG_WEXLER_TAB_7200) += dram_wexler_tab_7200.o
++obj-$(CONFIG_WOBO_I5) += dram_wobo_i5.o
++obj-$(CONFIG_XZPAD700) += dram_xzpad700.o
++obj-$(CONFIG_ZATAB) += dram_zatab.o
++obj-$(CONFIG_MERRII_M2) += dram_merrii_m2.o
+diff -ruN u-boot-2014.04/boards.cfg u-boot-sunxi/boards.cfg
+--- u-boot-2014.04/boards.cfg 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/boards.cfg 2014-09-06 16:58:36.185953115 +0200
+@@ -371,6 +371,111 @@
+ Active arm armv7 s5pc1xx samsung goni s5p_goni - Mateusz Zalega <m.zalega@samsung.com>
+ Active arm armv7 s5pc1xx samsung smdkc100 smdkc100 - Minkyu Kang <mk7.kang@samsung.com>
+ Active arm armv7 socfpga altera socfpga socfpga_cyclone5 - -
++Active arm armv7 sunxi - sunxi A10_MID_1GB sun4i:A10_MID_1GB,SPL -
++Active arm armv7 sunxi - sunxi A10-OLinuXino-Lime sun4i:A10_OLINUXINO_L,STATUSLED=226,SPL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi A10s-OLinuXino-M sun5i:A10S_OLINUXINO_M,STATUSLED=131,AXP152_POWER,CONS_INDEX=1,SPL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi A10s-OLinuXino-M_FEL sun5i:A10S_OLINUXINO_M,STATUSLED=131,AXP152_POWER,CONS_INDEX=1,SPL_FEL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi A13-OLinuXino sun5i:A13_OLINUXINO,SPL,STATUSLED=201,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi A13-OLinuXino_FEL sun5i:A13_OLINUXINO,SPL_FEL,STATUSLED=201,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi A13-OLinuXino_FEL_sdcon sun5i:A13_OLINUXINO,SPL_FEL,STATUSLED=201,UART0_PORT_F -
++Active arm armv7 sunxi - sunxi A13-OLinuXinoM sun5i:A13_OLINUXINOM,SPL,NO_AXP,STATUSLED=201,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi A13-OLinuXinoM_FEL sun5i:A13_OLINUXINOM,SPL_FEL,NO_AXP,STATUSLED=201,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi A13_MID sun5i:A13_MID,SPL,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi A20-OLinuXino_Lime sun7i:A20_OLINUXINO_L,CONS_INDEX=1,STATUSLED=226,SPL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi A20-OLinuXino_Lime2 sun7i:A20_OLINUXINO_L2,CONS_INDEX=1,STATUSLED=226,SPL,SUNXI_GMAC -
++Active arm armv7 sunxi - sunxi A20-OLinuXino_MICRO sun7i:A20_OLINUXINO_M,CONS_INDEX=1,STATUSLED=226,SPL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi A20-OLinuXino_MICRO_FEL sun7i:A20_OLINUXINO_M,CONS_INDEX=1,STATUSLED=226,SPL_FEL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi A20-SOM sun7i:A20_SOM,SPL,SUNXI_GMAC,RGMII,STATUSLED1=245,FAST_MBUS -
++Active arm armv7 sunxi - sunxi Ainol_AW1 sun7i:AINOL_AW1,SPL -
++Active arm armv7 sunxi - sunxi Ampe_A76 sun5i:AMPE_A76,SPL,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi Auxtek-T003 sun5i:AUXTEK_T003,SPL,AXP152_POWER,STATUSLED=34 -
++Active arm armv7 sunxi - sunxi Auxtek-T004 sun5i:AUXTEK_T004,SPL,AXP152_POWER,STATUSLED=34 -
++Active arm armv7 sunxi - sunxi ba10_tv_box sun4i:BA10_TV_BOX,SPL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi Bananapi sun7i:BANANAPI,SPL,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),STATUSLED=244,STATUSLED1=245,FAST_MBUS -
++Active arm armv7 sunxi - sunxi Bananapi_FEL sun7i:BANANAPI,SPL_FEL,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),STATUSLED=244,STATUSLED1=245,FAST_MBUS -
++Active arm armv7 sunxi - sunxi Coby_MID7042 sun4i:COBY_MID7042,SPL -
++Active arm armv7 sunxi - sunxi Coby_MID8042 sun4i:COBY_MID8042,SPL -
++Active arm armv7 sunxi - sunxi Coby_MID9742 sun4i:COBY_MID9742,SPL -
++Active arm armv7 sunxi - sunxi Iteaduino_Plus_A10 sun4i:ITEADA10,SPL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 -
++Active arm armv7 sunxi - sunxi Iteaduino_Plus_A20 sun7i:ITEADA20,SPL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 -
++Active arm armv7 sunxi - sunxi Colombus sun6i:COLOMBUS,AXP221_POWER,ENABLE_DLDO1_POWER -
++Active arm armv7 sunxi - sunxi Ippo_q8h sun8i:IPPO_Q8H,NO_AXP,CONS_INDEX=5 -
++Active arm armv7 sunxi - sunxi Cubieboard sun4i:CUBIEBOARD,SPL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 -
++Active arm armv7 sunxi - sunxi Cubieboard2 sun7i:CUBIEBOARD2,SPL,SUNXI_GMAC,STATUSLED=244,STATUSLED1=245,FAST_MBUS -
++Active arm armv7 sunxi - sunxi Cubieboard2_FEL sun7i:CUBIEBOARD2,SPL_FEL,SUNXI_GMAC,STATUSLED=244,STATUSLED1=245,FAST_MBUS -
++Active arm armv7 sunxi - sunxi Cubietruck sun7i:CUBIETRUCK,SPL,SUNXI_GMAC,RGMII,STATUSLED=245,STATUSLED1=244,STATUSLED2=235,STATUSLED3=231,FAST_MBUS -
++Active arm armv7 sunxi - sunxi Cubietruck_FEL sun7i:CUBIETRUCK,SPL_FEL,SUNXI_GMAC,RGMII,STATUSLED=245,STATUSLED1=244,STATUSLED2=235,STATUSLED3=231,FAST_MBUS -
++Active arm armv7 sunxi - sunxi Cubieboard_FEL sun4i:CUBIEBOARD,SPL_FEL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 -
++Active arm armv7 sunxi - sunxi DNS_M82 sun4i:DNS_M82,SPL -
++Active arm armv7 sunxi - sunxi EOMA68_A10 sun4i:EOMA68_A10,SPL,MMC_SUNXI_SLOT=3,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi EOMA68_A10_FEL sun4i:EOMA68_A10,SPL_FEL,MMC_SUNXI_SLOT=3,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi EOMA68_A20 sun7i:EOMA68_A20,SPL,MMC_SUNXI_SLOT=3,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi EOMA68_A20_FEL sun7i:EOMA68_A20,SPL_FEL,MMC_SUNXI_SLOT=3,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi EU3000 sun7i:EU3000,SPL -
++Active arm armv7 sunxi - sunxi Forfun_Q88DB sun7i:FORFUN_Q88DB,SPL -
++Active arm armv7 sunxi - sunxi Gooseberry_A721 sun4i:GOOSEBERRY_A721,SPL -
++Active arm armv7 sunxi - sunxi H6 sun4i:H6,SPL -
++Active arm armv7 sunxi - sunxi Hackberry sun4i:HACKBERRY,SPL,SUNXI_EMAC,MACPWR=SUNXI_GPH(19) -
++Active arm armv7 sunxi - sunxi HBD_MID_S906 sun7i:HBD_MID_S906,SPL -
++Active arm armv7 sunxi - sunxi HCore_HC860 sun4i:HCORE_HC860,SPL -
++Active arm armv7 sunxi - sunxi Hyundai_A7 sun4i:HYUNDAI_A7,SPL -
++Active arm armv7 sunxi - sunxi Hyundai_A7HD sun4i:A7HD,SPL -
++Active arm armv7 sunxi - sunxi i12-tvbox sun7i:I12_TVBOX,SPL,FAST_MBUS,STATUSLED=244 -
++Active arm armv7 sunxi - sunxi ICOU_Fatty_I sun7i:ICOU_FATTY_I,SPL -
++Active arm armv7 sunxi - sunxi Interra-3 sun7i:INTERRA3,SPL,SUNXI_GMAC,FAST_MBUS,MMC_SUNXI_SLOT=2 -
++Active arm armv7 sunxi - sunxi INet_86VZ sun5i:INET_86VZ,SPL -
++Active arm armv7 sunxi - sunxi INet_86VZ_FEL sun5i:INET_86VZ,SPL_FEL,UART0_PORT_F -
++Active arm armv7 sunxi - sunxi INet97F-II sun4i:INET97F_II,SPL -
++Active arm armv7 sunxi - sunxi INet_K70HC sun7i:INET_K70HC,SPL -
++Active arm armv7 sunxi - sunxi Jesurun-Q5 sun4i:JESURUN_Q5,SPL,SUNXI_EMAC,STATUSLED=244 -
++Active arm armv7 sunxi - sunxi K1001L1C sun7i:K1001L1C,SPL -
++Active arm armv7 sunxi - sunxi Kurio_7S sun7i:KURIO_7S,SPL -
++Active arm armv7 sunxi - sunxi Langcent_H6S sun7i:LANGCENT_H6S,SPL -
++Active arm armv7 sunxi - sunxi Linksprite_pcDuino3 sun7i:LINKSPRITE_PCDUINO3,SPL,SUNXI_GMAC,FAST_MBUS -
++Active arm armv7 sunxi - sunxi Marsboard_A10 sun4i:MARSBOARD_A10,SPL,SUNXI_EMAC,NO_AXP -
++Active arm armv7 sunxi - sunxi Marsboard_A20 sun7i:MARSBOARD_A20,SPL,SUNXI_EMAC,NO_AXP -
++Active arm armv7 sunxi - sunxi Marsboard_A20_debug sun7i:MARSBOARD_A20,SPL,SUNXI_EMAC,NO_AXP,SYS_SECONDARY_ON -
++Active arm armv7 sunxi - sunxi Megafeis_A08 sun5i:MEFAFEIS_A08,SPL -
++Active arm armv7 sunxi - sunxi Mele_A1000 sun4i:MELE_A1000,SPL,SUNXI_EMAC,MACPWR=SUNXI_GPH(15),STATUSLED=234 -
++Active arm armv7 sunxi - sunxi Mele_A1000_FEL sun4i:MELE_A1000,SPL_FEL,SUNXI_EMAC,MACPWR=SUNXI_GPH(15),STATUSLED=234 -
++Active arm armv7 sunxi - sunxi Mele_A1000G sun4i:MELE_A1000G,SPL,SUNXI_EMAC,MACPWR=SUNXI_GPH(15),STATUSLED=234 -
++Active arm armv7 sunxi - sunxi Mele_A3700 sun4i:MELE_A3700,SPL,SUNXI_EMAC,MACPWR=SUNXI_GPH(15),STATUSLED=234 -
++Active arm armv7 sunxi - sunxi Merrii_Hummingbird_A20 sun7i:MERRII_HUMMINGBIRD_A20,SPL -
++Active arm armv7 sunxi - sunxi merrii_m2 sun7i:MERRII_M2,SPL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi Mini-X sun4i:MINI_X,SPL -
++Active arm armv7 sunxi - sunxi Mini-X-1Gb sun4i:MINI_X_1GB,SPL -
++Active arm armv7 sunxi - sunxi Mini-X_A10s sun5i:MINI_X_A10S,SPL -
++Active arm armv7 sunxi - sunxi mk802 sun4i:MK802,SPL,NO_AXP -
++Active arm armv7 sunxi - sunxi mk802-1gb sun4i:MK802_1GB,SPL,NO_AXP -
++Active arm armv7 sunxi - sunxi mk802_a10s sun5i:MK802_A10S,SPL,AXP152_POWER,STATUSLED=34 -
++Active arm armv7 sunxi - sunxi mk802ii_A20 sun7i:MK802II_A20,SPL -
++Active arm armv7 sunxi - sunxi mk802ii sun4i:MK802II,SPL -
++Active arm armv7 sunxi - sunxi mk808c_A20 sun7i:MK808C_A20,SPL -
++Active arm armv7 sunxi - sunxi OLIMEX-A13-SOM sun5i:OLIMEX_A13_SOM,SPL,NO_AXP,STATUSLED=201,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi pcDuino sun4i:PCDUINO,SPL,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi pengpod1000 sun4i:PENGPOD1000,SPL -
++Active arm armv7 sunxi - sunxi pengpod700 sun4i:PENGPOD700,SPL -
++Active arm armv7 suxni - sunxi pineriver-h25 sun5i:PINERIVER-H25,SPL
++Active arm armv7 sunxi - sunxi POV_TAB_P703 sun5i:POV_TAB_P703,SPL -
++Active arm armv7 sunxi - sunxi PoV_ProTab2_IPS9 sun4i:POV_PROTAB2,SPL -
++Active arm armv7 sunxi - sunxi PoV_ProTab2_IPS_3g sun4i:POV_PROTAB2,SPL -
++Active arm armv7 sunxi - sunxi PoV_ProTab2_XXL sun4i:POV_PROTAB2_XXL,SPL -
++Active arm armv7 sunxi - sunxi qt840a sun7i:QT840A,SPL,FAST_MBUS,STATUSLED=244 -
++Active arm armv7 sunxi - sunxi r7-tv-dongle sun5i:R7DONGLE,SPL,AXP152_POWER,STATUSLED=34 -
++Active arm armv7 sunxi - sunxi Sanei_N90 sun4i:SANEI_N90,SPL -
++Active arm armv7 sunxi - sunxi Semitime_G2 sun5i:SEMITIME_G2,SPL,AXP152_POWER,STATUSLED=34 -
++Active arm armv7 sunxi - sunxi sun4i sun4i:SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi sun4i_sdcon sun4i:UART0_PORT_F,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi sun5i sun5i:SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi sun5i_sdcon sun5i:UART0_PORT_F,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi sun5i_uart1 sun5i:CONS_INDEX=2,SUNXI_EMAC -
++Active arm armv7 sunxi - sunxi TZX-Q8-713B6 sun5i:TZX_Q8_713B6,SPL,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi TZX-Q8-713B7 sun5i:TZX_Q8_713B7,SPL,CONS_INDEX=2 -
++Active arm armv7 sunxi - sunxi uhost_u1a sun4i:UHOST_U1A,SPL,STATUSLED=34 -
++Active arm armv7 sunxi - sunxi Wexler_TAB_7200 sun7i:WEXLER_TAB_7200,SPL -
++Active arm armv7 sunxi - sunxi wobo-i5 sun5i:WOBO_I5,SPL,STATUSLED=34 -
++Active arm armv7 sunxi - sunxi xzpad700 sun5i:XZPAD700,SPL -
++Active arm armv7 sunxi - sunxi zatab sun4i:ZATAB,SPL -
+ Active arm armv7 u8500 st-ericsson snowball snowball - Mathieu Poirier <mathieu.poirier@linaro.org>
+ Active arm armv7 u8500 st-ericsson u8500 u8500_href - -
+ Active arm armv7 vf610 freescale vf610twr vf610twr vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg Alison Wang <b18965@freescale.com>
+diff -ruN u-boot-2014.04/common/spl/spl_mmc.c u-boot-sunxi/common/spl/spl_mmc.c
+--- u-boot-2014.04/common/spl/spl_mmc.c 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/common/spl/spl_mmc.c 2014-09-06 16:58:36.205953114 +0200
+@@ -29,8 +29,10 @@
+ if (err == 0)
+ goto end;
+
+- if (image_get_magic(header) != IH_MAGIC)
++ if (image_get_magic(header) != IH_MAGIC) {
++ printf("spl: not an uImage at %lu\n", sector);
+ return -1;
++ }
+
+ spl_parse_image_header(header);
+
+diff -ruN u-boot-2014.04/drivers/gpio/Makefile u-boot-sunxi/drivers/gpio/Makefile
+--- u-boot-2014.04/drivers/gpio/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/gpio/Makefile 2014-09-06 16:58:36.253953113 +0200
+@@ -34,3 +34,4 @@
+ obj-$(CONFIG_ADI_GPIO2) += adi_gpio2.o
+ obj-$(CONFIG_TCA642X) += tca642x.o
+ oby-$(CONFIG_SX151X) += sx151x.o
++obj-$(CONFIG_SUNXI_GPIO) += sunxi_gpio.o
+diff -ruN u-boot-2014.04/drivers/gpio/sunxi_gpio.c u-boot-sunxi/drivers/gpio/sunxi_gpio.c
+--- u-boot-2014.04/drivers/gpio/sunxi_gpio.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/drivers/gpio/sunxi_gpio.c 2014-09-06 16:58:36.253953113 +0200
+@@ -0,0 +1,102 @@
++/*
++ * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * Based on earlier arch/arm/cpu/armv7/sunxi/gpio.c:
++ *
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <asm/io.h>
++#include <asm/gpio.h>
++
++static int sunxi_gpio_output(u32 pin, u32 val)
++{
++ u32 dat;
++ u32 bank = GPIO_BANK(pin);
++ u32 num = GPIO_NUM(pin);
++ struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
++
++ dat = readl(&pio->dat);
++ if (val)
++ dat |= 0x1 << num;
++ else
++ dat &= ~(0x1 << num);
++
++ writel(dat, &pio->dat);
++
++ return 0;
++}
++
++static int sunxi_gpio_input(u32 pin)
++{
++ u32 dat;
++ u32 bank = GPIO_BANK(pin);
++ u32 num = GPIO_NUM(pin);
++ struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
++
++ dat = readl(&pio->dat);
++ dat >>= num;
++
++ return dat & 0x1;
++}
++
++int gpio_request(unsigned gpio, const char *label)
++{
++ return 0;
++}
++
++int gpio_free(unsigned gpio)
++{
++ return 0;
++}
++
++int gpio_direction_input(unsigned gpio)
++{
++ sunxi_gpio_set_cfgpin(gpio, SUNXI_GPIO_INPUT);
++
++ return sunxi_gpio_input(gpio);
++}
++
++int gpio_direction_output(unsigned gpio, int value)
++{
++ sunxi_gpio_set_cfgpin(gpio, SUNXI_GPIO_OUTPUT);
++
++ return sunxi_gpio_output(gpio, value);
++}
++
++int gpio_get_value(unsigned gpio)
++{
++ return sunxi_gpio_input(gpio);
++}
++
++int gpio_set_value(unsigned gpio, int value)
++{
++ return sunxi_gpio_output(gpio, value);
++}
++
++int sunxi_name_to_gpio(const char *name)
++{
++ int group = 0;
++ int groupsize = 9 * 32;
++ long pin;
++ char *eptr;
++ if (*name == 'P' || *name == 'p')
++ name++;
++ if (*name >= 'A') {
++ group = *name - (*name > 'a' ? 'a' : 'A');
++ groupsize = 32;
++ name++;
++ }
++
++ pin = simple_strtol(name, &eptr, 10);
++ if (!*name || *eptr)
++ return -1;
++ if (pin < 0 || pin > groupsize || group >= 9)
++ return -1;
++ return group * 32 + pin;
++}
+diff -ruN u-boot-2014.04/drivers/i2c/Makefile u-boot-sunxi/drivers/i2c/Makefile
+--- u-boot-2014.04/drivers/i2c/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/i2c/Makefile 2014-09-06 16:58:36.265953112 +0200
+@@ -27,5 +27,6 @@
+ obj-$(CONFIG_SYS_I2C_S3C24X0) += s3c24x0_i2c.o
+ obj-$(CONFIG_SYS_I2C_SH) += sh_i2c.o
+ obj-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
++obj-$(CONFIG_SYS_I2C_SUNXI) += mvtwsi.o
+ obj-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
+ obj-$(CONFIG_SYS_I2C_ZYNQ) += zynq_i2c.o
+diff -ruN u-boot-2014.04/drivers/i2c/mvtwsi.c u-boot-sunxi/drivers/i2c/mvtwsi.c
+--- u-boot-2014.04/drivers/i2c/mvtwsi.c 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/i2c/mvtwsi.c 2014-09-06 16:58:36.265953112 +0200
+@@ -22,6 +22,8 @@
+ #include <asm/arch/orion5x.h>
+ #elif defined(CONFIG_KIRKWOOD)
+ #include <asm/arch/kirkwood.h>
++#elif defined(CONFIG_SUNXI)
++#include <asm/arch/i2c.h>
+ #else
+ #error Driver mvtwsi not supported by SoC or board
+ #endif
+@@ -30,6 +32,20 @@
+ * TWSI register structure
+ */
+
++#ifdef CONFIG_SUNXI
++
++struct mvtwsi_registers {
++ u32 slave_address;
++ u32 xtnd_slave_addr;
++ u32 data;
++ u32 control;
++ u32 status;
++ u32 baudrate;
++ u32 soft_reset;
++};
++
++#else
++
+ struct mvtwsi_registers {
+ u32 slave_address;
+ u32 data;
+@@ -43,6 +59,8 @@
+ u32 soft_reset;
+ };
+
++#endif
++
+ /*
+ * Control register fields
+ */
+@@ -216,21 +234,7 @@
+ */
+
+ #define TWSI_FREQUENCY(m, n) \
+- ((u8) (CONFIG_SYS_TCLK / (10 * (m + 1) * 2 * (1 << n))))
+-
+-/*
+- * These are required to be reprogrammed before enabling the controller
+- * because a reset loses them.
+- * Default values come from the spec, but a twsi_reset will change them.
+- * twsi_slave_address left uninitialized lest checkpatch.pl complains.
+- */
+-
+-/* Baudrate generator: m (bits 7..4) =4, n (bits 3..0) =4 */
+-static u8 twsi_baud_rate = 0x44; /* baudrate at controller reset */
+-/* Default frequency corresponding to default m=4, n=4 */
+-static u8 twsi_actual_speed = TWSI_FREQUENCY(4, 4);
+-/* Default slave address is 0 (so is an uninitialized static) */
+-static u8 twsi_slave_address;
++ (CONFIG_SYS_TCLK / (10 * (m + 1) * (1 << n)))
+
+ /*
+ * Reset controller.
+@@ -238,7 +242,7 @@
+ * Controller reset also resets the baud rate and slave address, so
+ * re-establish them.
+ */
+-static void twsi_reset(void)
++static void twsi_reset(u8 baud_rate, u8 slave_address)
+ {
+ /* ensure controller will be enabled by any twsi*() function */
+ twsi_control_flags = MVTWSI_CONTROL_TWSIEN;
+@@ -247,9 +251,9 @@
+ /* wait 2 ms -- this is what the Marvell LSP does */
+ udelay(20000);
+ /* set baud rate */
+- writel(twsi_baud_rate, &twsi->baudrate);
++ writel(baud_rate, &twsi->baudrate);
+ /* set slave address even though we don't use it */
+- writel(twsi_slave_address, &twsi->slave_address);
++ writel(slave_address, &twsi->slave_address);
+ writel(0, &twsi->xtnd_slave_addr);
+ /* assert STOP but don't care for the result */
+ (void) twsi_stop(0);
+@@ -277,12 +281,8 @@
+ }
+ }
+ }
+- /* save baud rate and slave for later calls to twsi_reset */
+- twsi_baud_rate = baud;
+- twsi_actual_speed = highest_speed;
+- twsi_slave_address = slaveadd;
+ /* reset controller */
+- twsi_reset();
++ twsi_reset(baud, slaveadd);
+ }
+
+ /*
+diff -ruN u-boot-2014.04/drivers/mmc/Makefile u-boot-sunxi/drivers/mmc/Makefile
+--- u-boot-2014.04/drivers/mmc/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/mmc/Makefile 2014-09-06 16:58:36.281953112 +0200
+@@ -28,6 +28,7 @@
+ obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
+ obj-$(CONFIG_DWMMC) += dw_mmc.o
+ obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
++obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
+ obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
+ obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
+ ifdef CONFIG_SPL_BUILD
+diff -ruN u-boot-2014.04/drivers/mmc/sunxi_mmc.c u-boot-sunxi/drivers/mmc/sunxi_mmc.c
+--- u-boot-2014.04/drivers/mmc/sunxi_mmc.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/drivers/mmc/sunxi_mmc.c 2014-09-06 16:58:36.281953112 +0200
+@@ -0,0 +1,385 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Aaron <leafy.myeh@allwinnertech.com>
++ *
++ * MMC driver for allwinner sunxi platform.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <malloc.h>
++#include <mmc.h>
++#include <asm/io.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/cpu.h>
++#include <asm/arch/mmc.h>
++
++struct sunxi_mmc_host {
++ unsigned mmc_no;
++ uint32_t *mclkreg;
++ unsigned database;
++ unsigned fatal_err;
++ unsigned mod_clk;
++ struct sunxi_mmc *reg;
++ struct mmc_config cfg;
++};
++
++/* support 4 mmc hosts */
++struct sunxi_mmc_host mmc_host[4];
++
++static int mmc_resource_init(int sdc_no)
++{
++ struct sunxi_mmc_host *mmchost = &mmc_host[sdc_no];
++ struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ debug("init mmc %d resource\n", sdc_no);
++
++ switch (sdc_no) {
++ case 0:
++ mmchost->reg = (struct sunxi_mmc *)SUNXI_MMC0_BASE;
++ mmchost->mclkreg = &ccm->sd0_clk_cfg;
++ break;
++ case 1:
++ mmchost->reg = (struct sunxi_mmc *)SUNXI_MMC1_BASE;
++ mmchost->mclkreg = &ccm->sd1_clk_cfg;
++ break;
++ case 2:
++ mmchost->reg = (struct sunxi_mmc *)SUNXI_MMC2_BASE;
++ mmchost->mclkreg = &ccm->sd2_clk_cfg;
++ break;
++ case 3:
++ mmchost->reg = (struct sunxi_mmc *)SUNXI_MMC3_BASE;
++ mmchost->mclkreg = &ccm->sd3_clk_cfg;
++ break;
++ default:
++ printf("Wrong mmc number %d\n", sdc_no);
++ return -1;
++ }
++#ifdef CONFIG_SUN6I
++ mmchost->database = (unsigned int)mmchost->reg + 0x200;
++#else
++ mmchost->database = (unsigned int)mmchost->reg + 0x100;
++#endif
++ mmchost->mmc_no = sdc_no;
++
++ return 0;
++}
++
++static int mmc_clk_io_on(int sdc_no)
++{
++ unsigned int pll_clk;
++ unsigned int divider;
++ struct sunxi_mmc_host *mmchost = &mmc_host[sdc_no];
++ struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++
++ debug("init mmc %d clock and io\n", sdc_no);
++
++ /* config ahb clock */
++ setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_MMC(sdc_no));
++
++#if defined(CONFIG_SUN6I) || defined(CONFIG_SUN8I)
++ /* unassert reset */
++ setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_RESET_OFFSET_MMC(sdc_no));
++#endif
++
++ /* config mod clock */
++ pll_clk = clock_get_pll6();
++ /* should be close to 100 MHz but no more, so round up */
++ divider = ((pll_clk + 99999999) / 100000000) - 1;
++ writel(CCM_MMC_CTRL_ENABLE | CCM_MMC_CTRL_PLL6 | divider,
++ mmchost->mclkreg);
++ mmchost->mod_clk = pll_clk / (divider + 1);
++
++ return 0;
++}
++
++static int mmc_update_clk(struct mmc *mmc)
++{
++ struct sunxi_mmc_host *mmchost = mmc->priv;
++ unsigned int cmd;
++ unsigned timeout_msecs = 2000;
++
++ cmd = SUNXI_MMC_CMD_START |
++ SUNXI_MMC_CMD_UPCLK_ONLY |
++ SUNXI_MMC_CMD_WAIT_PRE_OVER;
++ writel(cmd, &mmchost->reg->cmd);
++ while (readl(&mmchost->reg->cmd) & SUNXI_MMC_CMD_START) {
++ if (!timeout_msecs--)
++ return -1;
++ udelay(1000);
++ }
++
++ /* clock update sets various irq status bits, clear these */
++ writel(readl(&mmchost->reg->rint), &mmchost->reg->rint);
++
++ return 0;
++}
++
++static int mmc_config_clock(struct mmc *mmc, unsigned div)
++{
++ struct sunxi_mmc_host *mmchost = mmc->priv;
++ unsigned rval = readl(&mmchost->reg->clkcr);
++
++ /* Disable Clock */
++ rval &= ~SUNXI_MMC_CLK_ENABLE;
++ writel(rval, &mmchost->reg->clkcr);
++ if (mmc_update_clk(mmc))
++ return -1;
++
++ /* Change Divider Factor */
++ rval &= ~SUNXI_MMC_CLK_DIVIDER_MASK;
++ rval |= div;
++ writel(rval, &mmchost->reg->clkcr);
++ if (mmc_update_clk(mmc))
++ return -1;
++ /* Re-enable Clock */
++ rval |= SUNXI_MMC_CLK_ENABLE;
++ writel(rval, &mmchost->reg->clkcr);
++
++ if (mmc_update_clk(mmc))
++ return -1;
++
++ return 0;
++}
++
++static void mmc_set_ios(struct mmc *mmc)
++{
++ struct sunxi_mmc_host *mmchost = mmc->priv;
++ unsigned int clkdiv = 0;
++
++ debug("set ios: bus_width: %x, clock: %d, mod_clk: %d\n",
++ mmc->bus_width, mmc->clock, mmchost->mod_clk);
++
++ /* Change clock first */
++ clkdiv = (mmchost->mod_clk + (mmc->clock >> 1)) / mmc->clock / 2;
++ if (mmc->clock) {
++ if (mmc_config_clock(mmc, clkdiv)) {
++ mmchost->fatal_err = 1;
++ return;
++ }
++ }
++
++ /* Change bus width */
++ if (mmc->bus_width == 8)
++ writel(0x2, &mmchost->reg->width);
++ else if (mmc->bus_width == 4)
++ writel(0x1, &mmchost->reg->width);
++ else
++ writel(0x0, &mmchost->reg->width);
++}
++
++static int mmc_core_init(struct mmc *mmc)
++{
++ struct sunxi_mmc_host *mmchost = mmc->priv;
++
++ /* Reset controller */
++ writel(SUNXI_MMC_GCTRL_RESET, &mmchost->reg->gctrl);
++ udelay(1000);
++
++ return 0;
++}
++
++static int mmc_trans_data_by_cpu(struct mmc *mmc, struct mmc_data *data)
++{
++ struct sunxi_mmc_host *mmchost = mmc->priv;
++ const int reading = !!(data->flags & MMC_DATA_READ);
++ const uint32_t status_bit = reading ? SUNXI_MMC_STATUS_FIFO_EMPTY :
++ SUNXI_MMC_STATUS_FIFO_FULL;
++ unsigned i;
++ unsigned byte_cnt = data->blocksize * data->blocks;
++ unsigned timeout_msecs = 2000;
++ unsigned *buff = (unsigned int *)(reading ? data->dest : data->src);
++
++ /* Always read / write data through the CPU */
++ setbits_le32(&mmchost->reg->gctrl, SUNXI_MMC_GCTRL_ACCESS_BY_AHB);
++
++ for (i = 0; i < (byte_cnt >> 2); i++) {
++ while (readl(&mmchost->reg->status) & status_bit) {
++ if (!timeout_msecs--)
++ return -1;
++ udelay(1000);
++ }
++
++ if (reading)
++ buff[i] = readl(mmchost->database);
++ else
++ writel(buff[i], mmchost->database);
++ }
++
++ return 0;
++}
++
++static int mmc_rint_wait(struct mmc *mmc, unsigned int timeout_msecs,
++ unsigned int done_bit, const char *what)
++{
++ struct sunxi_mmc_host *mmchost = mmc->priv;
++ unsigned int status;
++
++ do {
++ status = readl(&mmchost->reg->rint);
++ if (!timeout_msecs-- ||
++ (status & SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT)) {
++ debug("%s timeout %x\n", what,
++ status & SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT);
++ return TIMEOUT;
++ }
++ udelay(1000);
++ } while (!(status & done_bit));
++
++ return 0;
++}
++
++static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
++ struct mmc_data *data)
++{
++ struct sunxi_mmc_host *mmchost = mmc->priv;
++ unsigned int cmdval = SUNXI_MMC_CMD_START;
++ unsigned int timeout_msecs;
++ int error = 0;
++ unsigned int status = 0;
++ unsigned int bytecnt = 0;
++
++ if (mmchost->fatal_err)
++ return -1;
++ if (cmd->resp_type & MMC_RSP_BUSY)
++ debug("mmc cmd %d check rsp busy\n", cmd->cmdidx);
++ if (cmd->cmdidx == 12)
++ return 0;
++
++ if (!cmd->cmdidx)
++ cmdval |= SUNXI_MMC_CMD_SEND_INIT_SEQ;
++ if (cmd->resp_type & MMC_RSP_PRESENT)
++ cmdval |= SUNXI_MMC_CMD_RESP_EXPIRE;
++ if (cmd->resp_type & MMC_RSP_136)
++ cmdval |= SUNXI_MMC_CMD_LONG_RESPONSE;
++ if (cmd->resp_type & MMC_RSP_CRC)
++ cmdval |= SUNXI_MMC_CMD_CHK_RESPONSE_CRC;
++
++ if (data) {
++ if ((u32) data->dest & 0x3) {
++ error = -1;
++ goto out;
++ }
++
++ cmdval |= SUNXI_MMC_CMD_DATA_EXPIRE|SUNXI_MMC_CMD_WAIT_PRE_OVER;
++ if (data->flags & MMC_DATA_WRITE)
++ cmdval |= SUNXI_MMC_CMD_WRITE;
++ if (data->blocks > 1)
++ cmdval |= SUNXI_MMC_CMD_AUTO_STOP;
++ writel(data->blocksize, &mmchost->reg->blksz);
++ writel(data->blocks * data->blocksize, &mmchost->reg->bytecnt);
++ }
++
++ debug("mmc %d, cmd %d(0x%08x), arg 0x%08x\n", mmchost->mmc_no,
++ cmd->cmdidx, cmdval | cmd->cmdidx, cmd->cmdarg);
++ writel(cmd->cmdarg, &mmchost->reg->arg);
++
++ if (!data)
++ writel(cmdval | cmd->cmdidx, &mmchost->reg->cmd);
++
++ /*
++ * transfer data and check status
++ * STATREG[2] : FIFO empty
++ * STATREG[3] : FIFO full
++ */
++ if (data) {
++ int ret = 0;
++
++ bytecnt = data->blocksize * data->blocks;
++ debug("trans data %d bytes\n", bytecnt);
++ writel(cmdval | cmd->cmdidx, &mmchost->reg->cmd);
++ ret = mmc_trans_data_by_cpu(mmc, data);
++ if (ret) {
++ error = readl(&mmchost->reg->rint) & \
++ SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT;
++ error = TIMEOUT;
++ goto out;
++ }
++ }
++
++ error = mmc_rint_wait(mmc, 0xfffff, SUNXI_MMC_RINT_COMMAND_DONE, "cmd");
++ if (error)
++ goto out;
++
++ if (data) {
++ timeout_msecs = 120;
++ debug("cacl timeout %x msec\n", timeout_msecs);
++ error = mmc_rint_wait(mmc, timeout_msecs,
++ data->blocks > 1 ?
++ SUNXI_MMC_RINT_AUTO_COMMAND_DONE :
++ SUNXI_MMC_RINT_DATA_OVER,
++ "data");
++ if (error)
++ goto out;
++ }
++
++ if (cmd->resp_type & MMC_RSP_BUSY) {
++ timeout_msecs = 2000;
++ do {
++ status = readl(&mmchost->reg->status);
++ if (!timeout_msecs--) {
++ debug("busy timeout\n");
++ error = TIMEOUT;
++ goto out;
++ }
++ udelay(1000);
++ } while (status & SUNXI_MMC_STATUS_CARD_DATA_BUSY);
++ }
++
++ if (cmd->resp_type & MMC_RSP_136) {
++ cmd->response[0] = readl(&mmchost->reg->resp3);
++ cmd->response[1] = readl(&mmchost->reg->resp2);
++ cmd->response[2] = readl(&mmchost->reg->resp1);
++ cmd->response[3] = readl(&mmchost->reg->resp0);
++ debug("mmc resp 0x%08x 0x%08x 0x%08x 0x%08x\n",
++ cmd->response[3], cmd->response[2],
++ cmd->response[1], cmd->response[0]);
++ } else {
++ cmd->response[0] = readl(&mmchost->reg->resp0);
++ debug("mmc resp 0x%08x\n", cmd->response[0]);
++ }
++out:
++ if (error < 0) {
++ writel(SUNXI_MMC_GCTRL_RESET, &mmchost->reg->gctrl);
++ mmc_update_clk(mmc);
++ }
++ writel(0xffffffff, &mmchost->reg->rint);
++ writel(readl(&mmchost->reg->gctrl) | SUNXI_MMC_GCTRL_FIFO_RESET,
++ &mmchost->reg->gctrl);
++
++ return error;
++}
++
++static const struct mmc_ops sunxi_mmc_ops = {
++ .send_cmd = mmc_send_cmd,
++ .set_ios = mmc_set_ios,
++ .init = mmc_core_init,
++};
++
++int sunxi_mmc_init(int sdc_no)
++{
++ struct mmc_config *cfg = &mmc_host[sdc_no].cfg;
++
++ memset(&mmc_host[sdc_no], 0, sizeof(struct sunxi_mmc_host));
++
++ cfg->name = "SUNXI SD/MMC";
++ cfg->ops = &sunxi_mmc_ops;
++
++ cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
++ cfg->host_caps = MMC_MODE_4BIT;
++ cfg->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
++ cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
++
++ cfg->f_min = 400000;
++ cfg->f_max = 52000000;
++
++ mmc_resource_init(sdc_no);
++ mmc_clk_io_on(sdc_no);
++
++ if (mmc_create(cfg, &mmc_host[sdc_no]) == NULL)
++ return -1;
++
++ return 0;
++}
+diff -ruN u-boot-2014.04/drivers/net/designware.c u-boot-sunxi/drivers/net/designware.c
+--- u-boot-2014.04/drivers/net/designware.c 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/net/designware.c 2014-09-06 16:58:36.301953111 +0200
+@@ -249,7 +249,7 @@
+ rx_descs_init(dev);
+ tx_descs_init(dev);
+
+- writel(FIXEDBURST | PRIORXTX_41 | BURST_16, &dma_p->busmode);
++ writel(FIXEDBURST | PRIORXTX_41 | DMA_PBL, &dma_p->busmode);
+
+ writel(readl(&dma_p->opmode) | FLUSHTXFIFO | STOREFORWARD,
+ &dma_p->opmode);
+@@ -280,10 +280,18 @@
+ u32 desc_num = priv->tx_currdescnum;
+ struct dmamacdescr *desc_p = &priv->tx_mac_descrtable[desc_num];
+
+- /* Invalidate only "status" field for the following check */
+- invalidate_dcache_range((unsigned long)&desc_p->txrx_status,
+- (unsigned long)&desc_p->txrx_status +
+- sizeof(desc_p->txrx_status));
++ /*
++ * Strictly we only need to invalidate the "txrx_status" field
++ * for the following check, but on some platforms we cannot
++ * invalidate only 4 bytes, so roundup to
++ * ARCH_DMA_MINALIGN. This is safe because the individual
++ * descriptors in the array are each aligned to
++ * ARCH_DMA_MINALIGN.
++ */
++ invalidate_dcache_range(
++ (unsigned long)desc_p,
++ (unsigned long)desc_p +
++ roundup(sizeof(desc_p->txrx_status), ARCH_DMA_MINALIGN));
+
+ /* Check if the descriptor is owned by CPU */
+ if (desc_p->txrx_status & DESC_TXSTS_OWNBYDMA) {
+@@ -351,7 +359,7 @@
+ /* Invalidate received data */
+ invalidate_dcache_range((unsigned long)desc_p->dmamac_addr,
+ (unsigned long)desc_p->dmamac_addr +
+- length);
++ roundup(length, ARCH_DMA_MINALIGN));
+
+ NetReceive(desc_p->dmamac_addr, length);
+
+@@ -390,6 +398,8 @@
+ if (!phydev)
+ return -1;
+
++ phy_connect_dev(phydev, dev);
++
+ phydev->supported &= PHY_GBIT_FEATURES;
+ phydev->advertising = phydev->supported;
+
+@@ -412,7 +422,8 @@
+ * Since the priv structure contains the descriptors which need a strict
+ * buswidth alignment, memalign is used to allocate memory
+ */
+- priv = (struct dw_eth_dev *) memalign(16, sizeof(struct dw_eth_dev));
++ priv = (struct dw_eth_dev *) memalign(ARCH_DMA_MINALIGN,
++ sizeof(struct dw_eth_dev));
+ if (!priv) {
+ free(dev);
+ return -ENOMEM;
+diff -ruN u-boot-2014.04/drivers/net/designware.h u-boot-sunxi/drivers/net/designware.h
+--- u-boot-2014.04/drivers/net/designware.h 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/net/designware.h 2014-09-06 16:58:36.301953111 +0200
+@@ -77,18 +77,18 @@
+
+ #define DW_DMA_BASE_OFFSET (0x1000)
+
++/* Default DMA Burst length */
++#ifndef CONFIG_DW_GMAC_DEFAULT_DMA_PBL
++#define CONFIG_DW_GMAC_DEFAULT_DMA_PBL 8
++#endif
++
+ /* Bus mode register definitions */
+ #define FIXEDBURST (1 << 16)
+ #define PRIORXTX_41 (3 << 14)
+ #define PRIORXTX_31 (2 << 14)
+ #define PRIORXTX_21 (1 << 14)
+ #define PRIORXTX_11 (0 << 14)
+-#define BURST_1 (1 << 8)
+-#define BURST_2 (2 << 8)
+-#define BURST_4 (4 << 8)
+-#define BURST_8 (8 << 8)
+-#define BURST_16 (16 << 8)
+-#define BURST_32 (32 << 8)
++#define DMA_PBL (CONFIG_DW_GMAC_DEFAULT_DMA_PBL<<8)
+ #define RXHIGHPRIO (1 << 1)
+ #define DMAMAC_SRST (1 << 0)
+
+@@ -215,15 +215,14 @@
+ #endif
+
+ struct dw_eth_dev {
+- u32 interface;
+- u32 tx_currdescnum;
+- u32 rx_currdescnum;
+-
+ struct dmamacdescr tx_mac_descrtable[CONFIG_TX_DESCR_NUM];
+ struct dmamacdescr rx_mac_descrtable[CONFIG_RX_DESCR_NUM];
++ char txbuffs[TX_TOTAL_BUFSIZE] __aligned(ARCH_DMA_MINALIGN);
++ char rxbuffs[RX_TOTAL_BUFSIZE] __aligned(ARCH_DMA_MINALIGN);
+
+- char txbuffs[TX_TOTAL_BUFSIZE];
+- char rxbuffs[RX_TOTAL_BUFSIZE];
++ u32 interface;
++ u32 tx_currdescnum;
++ u32 rx_currdescnum;
+
+ struct eth_mac_regs *mac_regs_p;
+ struct eth_dma_regs *dma_regs_p;
+diff -ruN u-boot-2014.04/drivers/net/Makefile u-boot-sunxi/drivers/net/Makefile
+--- u-boot-2014.04/drivers/net/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/net/Makefile 2014-09-06 16:58:36.297953112 +0200
+@@ -50,7 +50,7 @@
+ obj-$(CONFIG_SH_ETHER) += sh_eth.o
+ obj-$(CONFIG_SMC91111) += smc91111.o
+ obj-$(CONFIG_SMC911X) += smc911x.o
+-obj-$(CONFIG_SUNXI_WEMAC) += sunxi_wemac.o
++obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o
+ obj-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
+ obj-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o
+ obj-$(CONFIG_DRIVER_TI_CPSW) += cpsw.o
+diff -ruN u-boot-2014.04/drivers/net/sunxi_emac.c u-boot-sunxi/drivers/net/sunxi_emac.c
+--- u-boot-2014.04/drivers/net/sunxi_emac.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/drivers/net/sunxi_emac.c 2014-09-06 16:58:36.317953111 +0200
+@@ -0,0 +1,521 @@
++/*
++ * sunxi_emac.c -- Allwinner A10 ethernet driver
++ *
++ * (C) Copyright 2012, Stefan Roese <sr@denx.de>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <linux/err.h>
++#include <malloc.h>
++#include <miiphy.h>
++#include <net.h>
++#include <asm/io.h>
++#include <asm/arch/clock.h>
++#include <asm/arch/gpio.h>
++
++/* EMAC register */
++struct emac_regs {
++ u32 ctl; /* 0x00 */
++ u32 tx_mode; /* 0x04 */
++ u32 tx_flow; /* 0x08 */
++ u32 tx_ctl0; /* 0x0c */
++ u32 tx_ctl1; /* 0x10 */
++ u32 tx_ins; /* 0x14 */
++ u32 tx_pl0; /* 0x18 */
++ u32 tx_pl1; /* 0x1c */
++ u32 tx_sta; /* 0x20 */
++ u32 tx_io_data; /* 0x24 */
++ u32 tx_io_data1;/* 0x28 */
++ u32 tx_tsvl0; /* 0x2c */
++ u32 tx_tsvh0; /* 0x30 */
++ u32 tx_tsvl1; /* 0x34 */
++ u32 tx_tsvh1; /* 0x38 */
++ u32 rx_ctl; /* 0x3c */
++ u32 rx_hash0; /* 0x40 */
++ u32 rx_hash1; /* 0x44 */
++ u32 rx_sta; /* 0x48 */
++ u32 rx_io_data; /* 0x4c */
++ u32 rx_fbc; /* 0x50 */
++ u32 int_ctl; /* 0x54 */
++ u32 int_sta; /* 0x58 */
++ u32 mac_ctl0; /* 0x5c */
++ u32 mac_ctl1; /* 0x60 */
++ u32 mac_ipgt; /* 0x64 */
++ u32 mac_ipgr; /* 0x68 */
++ u32 mac_clrt; /* 0x6c */
++ u32 mac_maxf; /* 0x70 */
++ u32 mac_supp; /* 0x74 */
++ u32 mac_test; /* 0x78 */
++ u32 mac_mcfg; /* 0x7c */
++ u32 mac_mcmd; /* 0x80 */
++ u32 mac_madr; /* 0x84 */
++ u32 mac_mwtd; /* 0x88 */
++ u32 mac_mrdd; /* 0x8c */
++ u32 mac_mind; /* 0x90 */
++ u32 mac_ssrr; /* 0x94 */
++ u32 mac_a0; /* 0x98 */
++ u32 mac_a1; /* 0x9c */
++};
++
++/* SRAMC register */
++struct sunxi_sramc_regs {
++ u32 ctrl0;
++ u32 ctrl1;
++};
++
++/* 0: Disable 1: Aborted frame enable(default) */
++#define EMAC_TX_AB_M (0x1 << 0)
++/* 0: CPU 1: DMA(default) */
++#define EMAC_TX_TM (0x1 << 1)
++
++#define EMAC_TX_SETUP (0)
++
++/* 0: DRQ asserted 1: DRQ automatically(default) */
++#define EMAC_RX_DRQ_MODE (0x1 << 1)
++/* 0: CPU 1: DMA(default) */
++#define EMAC_RX_TM (0x1 << 2)
++/* 0: Normal(default) 1: Pass all Frames */
++#define EMAC_RX_PA (0x1 << 4)
++/* 0: Normal(default) 1: Pass Control Frames */
++#define EMAC_RX_PCF (0x1 << 5)
++/* 0: Normal(default) 1: Pass Frames with CRC Error */
++#define EMAC_RX_PCRCE (0x1 << 6)
++/* 0: Normal(default) 1: Pass Frames with Length Error */
++#define EMAC_RX_PLE (0x1 << 7)
++/* 0: Normal 1: Pass Frames length out of range(default) */
++#define EMAC_RX_POR (0x1 << 8)
++/* 0: Not accept 1: Accept unicast Packets(default) */
++#define EMAC_RX_UCAD (0x1 << 16)
++/* 0: Normal(default) 1: DA Filtering */
++#define EMAC_RX_DAF (0x1 << 17)
++/* 0: Not accept 1: Accept multicast Packets(default) */
++#define EMAC_RX_MCO (0x1 << 20)
++/* 0: Disable(default) 1: Enable Hash filter */
++#define EMAC_RX_MHF (0x1 << 21)
++/* 0: Not accept 1: Accept Broadcast Packets(default) */
++#define EMAC_RX_BCO (0x1 << 22)
++/* 0: Disable(default) 1: Enable SA Filtering */
++#define EMAC_RX_SAF (0x1 << 24)
++/* 0: Normal(default) 1: Inverse Filtering */
++#define EMAC_RX_SAIF (0x1 << 25)
++
++#define EMAC_RX_SETUP (EMAC_RX_POR | EMAC_RX_UCAD | EMAC_RX_DAF | \
++ EMAC_RX_MCO | EMAC_RX_BCO)
++
++/* 0: Disable 1: Enable Receive Flow Control(default) */
++#define EMAC_MAC_CTL0_RFC (0x1 << 2)
++/* 0: Disable 1: Enable Transmit Flow Control(default) */
++#define EMAC_MAC_CTL0_TFC (0x1 << 3)
++
++#define EMAC_MAC_CTL0_SETUP (EMAC_MAC_CTL0_RFC | EMAC_MAC_CTL0_TFC)
++
++/* 0: Disable 1: Enable MAC Frame Length Checking(default) */
++#define EMAC_MAC_CTL1_FLC (0x1 << 1)
++/* 0: Disable(default) 1: Enable Huge Frame */
++#define EMAC_MAC_CTL1_HF (0x1 << 2)
++/* 0: Disable(default) 1: Enable MAC Delayed CRC */
++#define EMAC_MAC_CTL1_DCRC (0x1 << 3)
++/* 0: Disable 1: Enable MAC CRC(default) */
++#define EMAC_MAC_CTL1_CRC (0x1 << 4)
++/* 0: Disable 1: Enable MAC PAD Short frames(default) */
++#define EMAC_MAC_CTL1_PC (0x1 << 5)
++/* 0: Disable(default) 1: Enable MAC PAD Short frames and append CRC */
++#define EMAC_MAC_CTL1_VC (0x1 << 6)
++/* 0: Disable(default) 1: Enable MAC auto detect Short frames */
++#define EMAC_MAC_CTL1_ADP (0x1 << 7)
++/* 0: Disable(default) 1: Enable */
++#define EMAC_MAC_CTL1_PRE (0x1 << 8)
++/* 0: Disable(default) 1: Enable */
++#define EMAC_MAC_CTL1_LPE (0x1 << 9)
++/* 0: Disable(default) 1: Enable no back off */
++#define EMAC_MAC_CTL1_NB (0x1 << 12)
++/* 0: Disable(default) 1: Enable */
++#define EMAC_MAC_CTL1_BNB (0x1 << 13)
++/* 0: Disable(default) 1: Enable */
++#define EMAC_MAC_CTL1_ED (0x1 << 14)
++
++#define EMAC_MAC_CTL1_SETUP (EMAC_MAC_CTL1_FLC | EMAC_MAC_CTL1_CRC | \
++ EMAC_MAC_CTL1_PC)
++
++#define EMAC_MAC_IPGT 0x15
++
++#define EMAC_MAC_NBTB_IPG1 0xc
++#define EMAC_MAC_NBTB_IPG2 0x12
++
++#define EMAC_MAC_CW 0x37
++#define EMAC_MAC_RM 0xf
++
++#define EMAC_MAC_MFL 0x0600
++
++/* Receive status */
++#define EMAC_CRCERR (0x1 << 4)
++#define EMAC_LENERR (0x3 << 5)
++
++#define DMA_CPU_TRRESHOLD 2000
++
++struct emac_eth_dev {
++ u32 speed;
++ u32 duplex;
++ u32 phy_configured;
++ int link_printed;
++};
++
++struct emac_rxhdr {
++ s16 rx_len;
++ u16 rx_status;
++};
++
++static void emac_inblk_32bit(void *reg, void *data, int count)
++{
++ int cnt = (count + 3) >> 2;
++
++ if (cnt) {
++ u32 *buf = data;
++
++ do {
++ u32 x = readl(reg);
++ *buf++ = x;
++ } while (--cnt);
++ }
++}
++
++static void emac_outblk_32bit(void *reg, void *data, int count)
++{
++ int cnt = (count + 3) >> 2;
++
++ if (cnt) {
++ const u32 *buf = data;
++
++ do {
++ writel(*buf++, reg);
++ } while (--cnt);
++ }
++}
++
++/* Read a word from phyxcer */
++static int emac_phy_read(const char *devname, unsigned char addr,
++ unsigned char reg, unsigned short *value)
++{
++ struct eth_device *dev = eth_get_dev_by_name(devname);
++ struct emac_regs *regs = (struct emac_regs *)dev->iobase;
++
++ /* issue the phy address and reg */
++ writel(addr << 8 | reg, ®s->mac_madr);
++
++ /* pull up the phy io line */
++ writel(0x1, ®s->mac_mcmd);
++
++ /* Wait read complete */
++ mdelay(1);
++
++ /* push down the phy io line */
++ writel(0x0, ®s->mac_mcmd);
++
++ /* and write data */
++ *value = readl(®s->mac_mrdd);
++
++ return 0;
++}
++
++/* Write a word to phyxcer */
++static int emac_phy_write(const char *devname, unsigned char addr,
++ unsigned char reg, unsigned short value)
++{
++ struct eth_device *dev = eth_get_dev_by_name(devname);
++ struct emac_regs *regs = (struct emac_regs *)dev->iobase;
++
++ /* issue the phy address and reg */
++ writel(addr << 8 | reg, ®s->mac_madr);
++
++ /* pull up the phy io line */
++ writel(0x1, ®s->mac_mcmd);
++
++ /* Wait write complete */
++ mdelay(1);
++
++ /* push down the phy io line */
++ writel(0x0, ®s->mac_mcmd);
++
++ /* and write data */
++ writel(value, ®s->mac_mwtd);
++
++ return 0;
++}
++
++static void emac_setup(struct eth_device *dev)
++{
++ struct emac_regs *regs = (struct emac_regs *)dev->iobase;
++ u32 reg_val;
++ u16 phy_val;
++ u32 duplex_flag;
++
++ /* Set up TX */
++ writel(EMAC_TX_SETUP, ®s->tx_mode);
++
++ /* Set up RX */
++ writel(EMAC_RX_SETUP, ®s->rx_ctl);
++
++ /* Set MAC */
++ /* Set MAC CTL0 */
++ writel(EMAC_MAC_CTL0_SETUP, ®s->mac_ctl0);
++
++ /* Set MAC CTL1 */
++ emac_phy_read(dev->name, 1, 0, &phy_val);
++ debug("PHY SETUP, reg 0 value: %x\n", phy_val);
++ duplex_flag = !!(phy_val & (1 << 8));
++
++ reg_val = 0;
++ if (duplex_flag)
++ reg_val = (0x1 << 0);
++ writel(EMAC_MAC_CTL1_SETUP | reg_val, ®s->mac_ctl1);
++
++ /* Set up IPGT */
++ writel(EMAC_MAC_IPGT, ®s->mac_ipgt);
++
++ /* Set up IPGR */
++ writel(EMAC_MAC_NBTB_IPG2 | (EMAC_MAC_NBTB_IPG1 << 8), ®s->mac_ipgr);
++
++ /* Set up Collison window */
++ writel(EMAC_MAC_RM | (EMAC_MAC_CW << 8), ®s->mac_clrt);
++
++ /* Set up Max Frame Length */
++ writel(EMAC_MAC_MFL, ®s->mac_maxf);
++}
++
++static void emac_reset(struct eth_device *dev)
++{
++ struct emac_regs *regs = (struct emac_regs *)dev->iobase;
++
++ debug("resetting device\n");
++
++ /* RESET device */
++ writel(0, ®s->ctl);
++ udelay(200);
++
++ writel(1, ®s->ctl);
++ udelay(200);
++}
++
++static int sunxi_emac_eth_init(struct eth_device *dev, bd_t *bd)
++{
++ struct emac_regs *regs = (struct emac_regs *)dev->iobase;
++ struct emac_eth_dev *priv = dev->priv;
++ u16 phy_reg;
++
++ /* Init EMAC */
++
++ /* Flush RX FIFO */
++ setbits_le32(®s->rx_ctl, 0x8);
++ udelay(1);
++
++ /* Init MAC */
++
++ /* Soft reset MAC */
++ clrbits_le32(®s->mac_ctl0, 0x1 << 15);
++
++ /* Clear RX counter */
++ writel(0x0, ®s->rx_fbc);
++ udelay(1);
++
++ /* Set up EMAC */
++ emac_setup(dev);
++
++ writel(dev->enetaddr[0] << 16 | dev->enetaddr[1] << 8 |
++ dev->enetaddr[2], ®s->mac_a1);
++ writel(dev->enetaddr[3] << 16 | dev->enetaddr[4] << 8 |
++ dev->enetaddr[5], ®s->mac_a0);
++
++ mdelay(1);
++
++ emac_reset(dev);
++
++ /* PHY POWER UP */
++ emac_phy_read(dev->name, 1, 0, &phy_reg);
++ emac_phy_write(dev->name, 1, 0, phy_reg & (~(0x1 << 11)));
++ mdelay(1);
++
++ emac_phy_read(dev->name, 1, 0, &phy_reg);
++
++ priv->speed = miiphy_speed(dev->name, 0);
++ priv->duplex = miiphy_duplex(dev->name, 0);
++
++ /* Print link status only once */
++ if (!priv->link_printed) {
++ printf("ENET Speed is %d Mbps - %s duplex connection\n",
++ priv->speed, (priv->duplex == HALF) ? "HALF" : "FULL");
++ priv->link_printed = 1;
++ }
++
++ /* Set EMAC SPEED depend on PHY */
++ clrsetbits_le32(®s->mac_supp, 1 << 8,
++ ((phy_reg & (0x1 << 13)) >> 13) << 8);
++
++ /* Set duplex depend on phy */
++ clrsetbits_le32(®s->mac_ctl1, 1 << 0,
++ ((phy_reg & (0x1 << 8)) >> 8) << 0);
++
++ /* Enable RX/TX */
++ setbits_le32(®s->ctl, 0x7);
++
++ return 0;
++}
++
++static void sunxi_emac_eth_halt(struct eth_device *dev)
++{
++ /* Nothing to do here */
++}
++
++static int sunxi_emac_eth_recv(struct eth_device *dev)
++{
++ struct emac_regs *regs = (struct emac_regs *)dev->iobase;
++ struct emac_rxhdr rxhdr;
++ u32 rxcount;
++ u32 reg_val;
++ int rx_len;
++ int rx_status;
++ int good_packet;
++
++ /* Check packet ready or not */
++
++ /* Race warning: The first packet might arrive with
++ * the interrupts disabled, but the second will fix
++ */
++ rxcount = readl(®s->rx_fbc);
++ if (!rxcount) {
++ /* Had one stuck? */
++ rxcount = readl(®s->rx_fbc);
++ if (!rxcount)
++ return 0;
++ }
++
++ reg_val = readl(®s->rx_io_data);
++ if (reg_val != 0x0143414d) {
++ /* Disable RX */
++ clrbits_le32(®s->ctl, 0x1 << 2);
++
++ /* Flush RX FIFO */
++ setbits_le32(®s->rx_ctl, 0x1 << 3);
++ while (readl(®s->rx_ctl) & (0x1 << 3))
++ ;
++
++ /* Enable RX */
++ setbits_le32(®s->ctl, 0x1 << 2);
++
++ return 0;
++ }
++
++ /* A packet ready now
++ * Get status/length
++ */
++ good_packet = 1;
++
++ emac_inblk_32bit(®s->rx_io_data, &rxhdr, sizeof(rxhdr));
++
++ rx_len = rxhdr.rx_len;
++ rx_status = rxhdr.rx_status;
++
++ /* Packet Status check */
++ if (rx_len < 0x40) {
++ good_packet = 0;
++ debug("RX: Bad Packet (runt)\n");
++ }
++
++ /* rx_status is identical to RSR register. */
++ if (0 & rx_status & (EMAC_CRCERR | EMAC_LENERR)) {
++ good_packet = 0;
++ if (rx_status & EMAC_CRCERR)
++ printf("crc error\n");
++ if (rx_status & EMAC_LENERR)
++ printf("length error\n");
++ }
++
++ /* Move data from EMAC */
++ if (good_packet) {
++ if (rx_len > DMA_CPU_TRRESHOLD) {
++ printf("Received packet is too big (len=%d)\n", rx_len);
++ } else {
++ emac_inblk_32bit((void *)®s->rx_io_data,
++ NetRxPackets[0], rx_len);
++
++ /* Pass to upper layer */
++ NetReceive(NetRxPackets[0], rx_len);
++ return rx_len;
++ }
++ }
++
++ return 0;
++}
++
++static int sunxi_emac_eth_send(struct eth_device *dev, void *packet, int len)
++{
++ struct emac_regs *regs = (struct emac_regs *)dev->iobase;
++
++ /* Select channel 0 */
++ writel(0, ®s->tx_ins);
++
++ /* Write packet */
++ emac_outblk_32bit((void *)®s->tx_io_data, packet, len);
++
++ /* Set TX len */
++ writel(len, ®s->tx_pl0);
++
++ /* Start translate from fifo to phy */
++ setbits_le32(®s->tx_ctl0, 1);
++
++ return 0;
++}
++
++int sunxi_emac_initialize(void)
++{
++ struct sunxi_ccm_reg *const ccm =
++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
++ struct sunxi_sramc_regs *sram =
++ (struct sunxi_sramc_regs *)SUNXI_SRAMC_BASE;
++ struct emac_regs *regs =
++ (struct emac_regs *)SUNXI_EMAC_BASE;
++ struct eth_device *dev;
++ struct emac_eth_dev *priv;
++ int pin;
++
++ dev = malloc(sizeof(*dev));
++ if (dev == NULL)
++ return -ENOMEM;
++
++ priv = (struct emac_eth_dev *)malloc(sizeof(struct emac_eth_dev));
++ if (!priv) {
++ free(dev);
++ return -ENOMEM;
++ }
++
++ memset(dev, 0, sizeof(*dev));
++ memset(priv, 0, sizeof(struct emac_eth_dev));
++
++ /* Map SRAM to EMAC */
++ setbits_le32(&sram->ctrl1, 0x5 << 2);
++
++ /* Configure pin mux settings for MII Ethernet */
++ for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(17); pin++)
++ sunxi_gpio_set_cfgpin(pin, SUNXI_GPA0_EMAC);
++
++ /* Set up clock gating */
++ setbits_le32(&ccm->ahb_gate0, 0x1 << AHB_GATE_OFFSET_EMAC);
++
++ /* Set MII clock */
++ clrsetbits_le32(®s->mac_mcfg, 0xf << 2, 0xd << 2);
++
++ dev->iobase = (int)regs;
++ dev->priv = priv;
++ dev->init = sunxi_emac_eth_init;
++ dev->halt = sunxi_emac_eth_halt;
++ dev->send = sunxi_emac_eth_send;
++ dev->recv = sunxi_emac_eth_recv;
++ strcpy(dev->name, "emac");
++
++ eth_register(dev);
++
++ miiphy_register(dev->name, emac_phy_read, emac_phy_write);
++
++ return 0;
++}
+diff -ruN u-boot-2014.04/drivers/net/sunxi_wemac.c u-boot-sunxi/drivers/net/sunxi_wemac.c
+--- u-boot-2014.04/drivers/net/sunxi_wemac.c 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/net/sunxi_wemac.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,525 +0,0 @@
+-/*
+- * sunxi_wemac.c -- Allwinner A10 ethernet driver
+- *
+- * (C) Copyright 2012, Stefan Roese <sr@denx.de>
+- *
+- * SPDX-License-Identifier: GPL-2.0+
+- */
+-
+-#include <common.h>
+-#include <malloc.h>
+-#include <net.h>
+-#include <miiphy.h>
+-#include <linux/err.h>
+-#include <asm/io.h>
+-#include <asm/arch/clock.h>
+-#include <asm/arch/gpio.h>
+-
+-/* EMAC register */
+-struct wemac_regs {
+- u32 ctl; /* 0x00 */
+- u32 tx_mode; /* 0x04 */
+- u32 tx_flow; /* 0x08 */
+- u32 tx_ctl0; /* 0x0c */
+- u32 tx_ctl1; /* 0x10 */
+- u32 tx_ins; /* 0x14 */
+- u32 tx_pl0; /* 0x18 */
+- u32 tx_pl1; /* 0x1c */
+- u32 tx_sta; /* 0x20 */
+- u32 tx_io_data; /* 0x24 */
+- u32 tx_io_data1; /* 0x28 */
+- u32 tx_tsvl0; /* 0x2c */
+- u32 tx_tsvh0; /* 0x30 */
+- u32 tx_tsvl1; /* 0x34 */
+- u32 tx_tsvh1; /* 0x38 */
+- u32 rx_ctl; /* 0x3c */
+- u32 rx_hash0; /* 0x40 */
+- u32 rx_hash1; /* 0x44 */
+- u32 rx_sta; /* 0x48 */
+- u32 rx_io_data; /* 0x4c */
+- u32 rx_fbc; /* 0x50 */
+- u32 int_ctl; /* 0x54 */
+- u32 int_sta; /* 0x58 */
+- u32 mac_ctl0; /* 0x5c */
+- u32 mac_ctl1; /* 0x60 */
+- u32 mac_ipgt; /* 0x64 */
+- u32 mac_ipgr; /* 0x68 */
+- u32 mac_clrt; /* 0x6c */
+- u32 mac_maxf; /* 0x70 */
+- u32 mac_supp; /* 0x74 */
+- u32 mac_test; /* 0x78 */
+- u32 mac_mcfg; /* 0x7c */
+- u32 mac_mcmd; /* 0x80 */
+- u32 mac_madr; /* 0x84 */
+- u32 mac_mwtd; /* 0x88 */
+- u32 mac_mrdd; /* 0x8c */
+- u32 mac_mind; /* 0x90 */
+- u32 mac_ssrr; /* 0x94 */
+- u32 mac_a0; /* 0x98 */
+- u32 mac_a1; /* 0x9c */
+-};
+-
+-/* SRAMC register */
+-struct sunxi_sramc_regs {
+- u32 ctrl0;
+- u32 ctrl1;
+-};
+-
+-/* 0: Disable 1: Aborted frame enable(default) */
+-#define EMAC_TX_AB_M (0x1 << 0)
+-/* 0: CPU 1: DMA(default) */
+-#define EMAC_TX_TM (0x1 << 1)
+-
+-#define EMAC_TX_SETUP (0)
+-
+-/* 0: DRQ asserted 1: DRQ automatically(default) */
+-#define EMAC_RX_DRQ_MODE (0x1 << 1)
+-/* 0: CPU 1: DMA(default) */
+-#define EMAC_RX_TM (0x1 << 2)
+-/* 0: Normal(default) 1: Pass all Frames */
+-#define EMAC_RX_PA (0x1 << 4)
+-/* 0: Normal(default) 1: Pass Control Frames */
+-#define EMAC_RX_PCF (0x1 << 5)
+-/* 0: Normal(default) 1: Pass Frames with CRC Error */
+-#define EMAC_RX_PCRCE (0x1 << 6)
+-/* 0: Normal(default) 1: Pass Frames with Length Error */
+-#define EMAC_RX_PLE (0x1 << 7)
+-/* 0: Normal 1: Pass Frames length out of range(default) */
+-#define EMAC_RX_POR (0x1 << 8)
+-/* 0: Not accept 1: Accept unicast Packets(default) */
+-#define EMAC_RX_UCAD (0x1 << 16)
+-/* 0: Normal(default) 1: DA Filtering */
+-#define EMAC_RX_DAF (0x1 << 17)
+-/* 0: Not accept 1: Accept multicast Packets(default) */
+-#define EMAC_RX_MCO (0x1 << 20)
+-/* 0: Disable(default) 1: Enable Hash filter */
+-#define EMAC_RX_MHF (0x1 << 21)
+-/* 0: Not accept 1: Accept Broadcast Packets(default) */
+-#define EMAC_RX_BCO (0x1 << 22)
+-/* 0: Disable(default) 1: Enable SA Filtering */
+-#define EMAC_RX_SAF (0x1 << 24)
+-/* 0: Normal(default) 1: Inverse Filtering */
+-#define EMAC_RX_SAIF (0x1 << 25)
+-
+-#define EMAC_RX_SETUP (EMAC_RX_POR | EMAC_RX_UCAD | EMAC_RX_DAF | \
+- EMAC_RX_MCO | EMAC_RX_BCO)
+-
+-/* 0: Disable 1: Enable Receive Flow Control(default) */
+-#define EMAC_MAC_CTL0_RFC (0x1 << 2)
+-/* 0: Disable 1: Enable Transmit Flow Control(default) */
+-#define EMAC_MAC_CTL0_TFC (0x1 << 3)
+-
+-#define EMAC_MAC_CTL0_SETUP (EMAC_MAC_CTL0_RFC | EMAC_MAC_CTL0_TFC)
+-
+-/* 0: Disable 1: Enable MAC Frame Length Checking(default) */
+-#define EMAC_MAC_CTL1_FLC (0x1 << 1)
+-/* 0: Disable(default) 1: Enable Huge Frame */
+-#define EMAC_MAC_CTL1_HF (0x1 << 2)
+-/* 0: Disable(default) 1: Enable MAC Delayed CRC */
+-#define EMAC_MAC_CTL1_DCRC (0x1 << 3)
+-/* 0: Disable 1: Enable MAC CRC(default) */
+-#define EMAC_MAC_CTL1_CRC (0x1 << 4)
+-/* 0: Disable 1: Enable MAC PAD Short frames(default) */
+-#define EMAC_MAC_CTL1_PC (0x1 << 5)
+-/* 0: Disable(default) 1: Enable MAC PAD Short frames and append CRC */
+-#define EMAC_MAC_CTL1_VC (0x1 << 6)
+-/* 0: Disable(default) 1: Enable MAC auto detect Short frames */
+-#define EMAC_MAC_CTL1_ADP (0x1 << 7)
+-/* 0: Disable(default) 1: Enable */
+-#define EMAC_MAC_CTL1_PRE (0x1 << 8)
+-/* 0: Disable(default) 1: Enable */
+-#define EMAC_MAC_CTL1_LPE (0x1 << 9)
+-/* 0: Disable(default) 1: Enable no back off */
+-#define EMAC_MAC_CTL1_NB (0x1 << 12)
+-/* 0: Disable(default) 1: Enable */
+-#define EMAC_MAC_CTL1_BNB (0x1 << 13)
+-/* 0: Disable(default) 1: Enable */
+-#define EMAC_MAC_CTL1_ED (0x1 << 14)
+-
+-#define EMAC_MAC_CTL1_SETUP (EMAC_MAC_CTL1_FLC | EMAC_MAC_CTL1_CRC | \
+- EMAC_MAC_CTL1_PC)
+-
+-#define EMAC_MAC_IPGT 0x15
+-
+-#define EMAC_MAC_NBTB_IPG1 0xC
+-#define EMAC_MAC_NBTB_IPG2 0x12
+-
+-#define EMAC_MAC_CW 0x37
+-#define EMAC_MAC_RM 0xF
+-
+-#define EMAC_MAC_MFL 0x0600
+-
+-/* Receive status */
+-#define EMAC_CRCERR (1 << 4)
+-#define EMAC_LENERR (3 << 5)
+-
+-#define DMA_CPU_TRRESHOLD 2000
+-
+-struct wemac_eth_dev {
+- u32 speed;
+- u32 duplex;
+- u32 phy_configured;
+- int link_printed;
+-};
+-
+-struct wemac_rxhdr {
+- s16 rx_len;
+- u16 rx_status;
+-};
+-
+-static void wemac_inblk_32bit(void *reg, void *data, int count)
+-{
+- int cnt = (count + 3) >> 2;
+-
+- if (cnt) {
+- u32 *buf = data;
+-
+- do {
+- u32 x = readl(reg);
+- *buf++ = x;
+- } while (--cnt);
+- }
+-}
+-
+-static void wemac_outblk_32bit(void *reg, void *data, int count)
+-{
+- int cnt = (count + 3) >> 2;
+-
+- if (cnt) {
+- const u32 *buf = data;
+-
+- do {
+- writel(*buf++, reg);
+- } while (--cnt);
+- }
+-}
+-
+-/*
+- * Read a word from phyxcer
+- */
+-static int wemac_phy_read(const char *devname, unsigned char addr,
+- unsigned char reg, unsigned short *value)
+-{
+- struct eth_device *dev = eth_get_dev_by_name(devname);
+- struct wemac_regs *regs = (struct wemac_regs *)dev->iobase;
+-
+- /* issue the phy address and reg */
+- writel(addr << 8 | reg, ®s->mac_madr);
+-
+- /* pull up the phy io line */
+- writel(0x1, ®s->mac_mcmd);
+-
+- /* Wait read complete */
+- mdelay(1);
+-
+- /* push down the phy io line */
+- writel(0x0, ®s->mac_mcmd);
+-
+- /* and write data */
+- *value = readl(®s->mac_mrdd);
+-
+- return 0;
+-}
+-
+-/*
+- * Write a word to phyxcer
+- */
+-static int wemac_phy_write(const char *devname, unsigned char addr,
+- unsigned char reg, unsigned short value)
+-{
+- struct eth_device *dev = eth_get_dev_by_name(devname);
+- struct wemac_regs *regs = (struct wemac_regs *)dev->iobase;
+-
+- /* issue the phy address and reg */
+- writel(addr << 8 | reg, ®s->mac_madr);
+-
+- /* pull up the phy io line */
+- writel(0x1, ®s->mac_mcmd);
+-
+- /* Wait write complete */
+- mdelay(1);
+-
+- /* push down the phy io line */
+- writel(0x0, ®s->mac_mcmd);
+-
+- /* and write data */
+- writel(value, ®s->mac_mwtd);
+-
+- return 0;
+-}
+-
+-static void emac_setup(struct eth_device *dev)
+-{
+- struct wemac_regs *regs = (struct wemac_regs *)dev->iobase;
+- u32 reg_val;
+- u16 phy_val;
+- u32 duplex_flag;
+-
+- /* Set up TX */
+- writel(EMAC_TX_SETUP, ®s->tx_mode);
+-
+- /* Set up RX */
+- writel(EMAC_RX_SETUP, ®s->rx_ctl);
+-
+- /* Set MAC */
+- /* Set MAC CTL0 */
+- writel(EMAC_MAC_CTL0_SETUP, ®s->mac_ctl0);
+-
+- /* Set MAC CTL1 */
+- wemac_phy_read(dev->name, 1, 0, &phy_val);
+- debug("PHY SETUP, reg 0 value: %x\n", phy_val);
+- duplex_flag = !!(phy_val & (1 << 8));
+-
+- reg_val = 0;
+- if (duplex_flag)
+- reg_val = (0x1 << 0);
+- writel(EMAC_MAC_CTL1_SETUP | reg_val, ®s->mac_ctl1);
+-
+- /* Set up IPGT */
+- writel(EMAC_MAC_IPGT, ®s->mac_ipgt);
+-
+- /* Set up IPGR */
+- writel(EMAC_MAC_NBTB_IPG2 | (EMAC_MAC_NBTB_IPG1 << 8), ®s->mac_ipgr);
+-
+- /* Set up Collison window */
+- writel(EMAC_MAC_RM | (EMAC_MAC_CW << 8), ®s->mac_clrt);
+-
+- /* Set up Max Frame Length */
+- writel(EMAC_MAC_MFL, ®s->mac_maxf);
+-}
+-
+-static void wemac_reset(struct eth_device *dev)
+-{
+- struct wemac_regs *regs = (struct wemac_regs *)dev->iobase;
+-
+- debug("resetting device\n");
+-
+- /* RESET device */
+- writel(0, ®s->ctl);
+- udelay(200);
+-
+- writel(1, ®s->ctl);
+- udelay(200);
+-}
+-
+-static int sunxi_wemac_eth_init(struct eth_device *dev, bd_t *bd)
+-{
+- struct wemac_regs *regs = (struct wemac_regs *)dev->iobase;
+- struct wemac_eth_dev *priv = dev->priv;
+- u16 phy_reg;
+-
+- /* Init EMAC */
+-
+- /* Flush RX FIFO */
+- setbits_le32(®s->rx_ctl, 0x8);
+- udelay(1);
+-
+- /* Init MAC */
+-
+- /* Soft reset MAC */
+- clrbits_le32(®s->mac_ctl0, 1 << 15);
+-
+- /* Set MII clock */
+- clrsetbits_le32(®s->mac_mcfg, 0xf << 2, 0xd << 2);
+-
+- /* Clear RX counter */
+- writel(0x0, ®s->rx_fbc);
+- udelay(1);
+-
+- /* Set up EMAC */
+- emac_setup(dev);
+-
+- writel(dev->enetaddr[0] << 16 | dev->enetaddr[1] << 8 |
+- dev->enetaddr[2], ®s->mac_a1);
+- writel(dev->enetaddr[3] << 16 | dev->enetaddr[4] << 8 |
+- dev->enetaddr[5], ®s->mac_a0);
+-
+- mdelay(1);
+-
+- wemac_reset(dev);
+-
+- /* PHY POWER UP */
+- wemac_phy_read(dev->name, 1, 0, &phy_reg);
+- wemac_phy_write(dev->name, 1, 0, phy_reg & (~(1 << 11)));
+- mdelay(1);
+-
+- wemac_phy_read(dev->name, 1, 0, &phy_reg);
+-
+- priv->speed = miiphy_speed(dev->name, 0);
+- priv->duplex = miiphy_duplex(dev->name, 0);
+-
+- /* Print link status only once */
+- if (!priv->link_printed) {
+- printf("ENET Speed is %d Mbps - %s duplex connection\n",
+- priv->speed, (priv->duplex == HALF) ? "HALF" : "FULL");
+- priv->link_printed = 1;
+- }
+-
+- /* Set EMAC SPEED depend on PHY */
+- clrsetbits_le32(®s->mac_supp, 1 << 8,
+- ((phy_reg & (1 << 13)) >> 13) << 8);
+-
+- /* Set duplex depend on phy */
+- clrsetbits_le32(®s->mac_ctl1, 1 << 0,
+- ((phy_reg & (1 << 8)) >> 8) << 0);
+-
+- /* Enable RX/TX */
+- setbits_le32(®s->ctl, 0x7);
+-
+- return 0;
+-}
+-
+-static void sunxi_wemac_eth_halt(struct eth_device *dev)
+-{
+- /* Nothing to do here */
+-}
+-
+-static int sunxi_wemac_eth_recv(struct eth_device *dev)
+-{
+- struct wemac_regs *regs = (struct wemac_regs *)dev->iobase;
+- struct wemac_rxhdr rxhdr;
+- u32 rxcount;
+- u32 reg_val;
+- int rx_len;
+- int rx_status;
+- int good_packet;
+-
+- /* Check packet ready or not */
+-
+- /*
+- * Race warning: The first packet might arrive with
+- * the interrupts disabled, but the second will fix
+- */
+- rxcount = readl(®s->rx_fbc);
+- if (!rxcount) {
+- /* Had one stuck? */
+- rxcount = readl(®s->rx_fbc);
+- if (!rxcount)
+- return 0;
+- }
+-
+- reg_val = readl(®s->rx_io_data);
+- if (reg_val != 0x0143414d) {
+- /* Disable RX */
+- clrbits_le32(®s->ctl, 1 << 2);
+-
+- /* Flush RX FIFO */
+- setbits_le32(®s->rx_ctl, 1 << 3);
+- while (readl(®s->rx_ctl) & (1 << 3))
+- ;
+-
+- /* Enable RX */
+- setbits_le32(®s->ctl, 1 << 2);
+-
+- return 0;
+- }
+-
+- /*
+- * A packet ready now
+- * Get status/length
+- */
+- good_packet = 1;
+-
+- wemac_inblk_32bit(®s->rx_io_data, &rxhdr, sizeof(rxhdr));
+-
+- rx_len = rxhdr.rx_len;
+- rx_status = rxhdr.rx_status;
+-
+- /* Packet Status check */
+- if (rx_len < 0x40) {
+- good_packet = 0;
+- debug("RX: Bad Packet (runt)\n");
+- }
+-
+- /* rx_status is identical to RSR register. */
+- if (0 & rx_status & (EMAC_CRCERR | EMAC_LENERR)) {
+- good_packet = 0;
+- if (rx_status & EMAC_CRCERR)
+- printf("crc error\n");
+- if (rx_status & EMAC_LENERR)
+- printf("length error\n");
+- }
+-
+- /* Move data from WEMAC */
+- if (good_packet) {
+- if (rx_len > DMA_CPU_TRRESHOLD) {
+- printf("Received packet is too big (len=%d)\n", rx_len);
+- } else {
+- wemac_inblk_32bit((void *)®s->rx_io_data,
+- NetRxPackets[0], rx_len);
+-
+- /* Pass to upper layer */
+- NetReceive(NetRxPackets[0], rx_len);
+- return rx_len;
+- }
+- }
+-
+- return 0;
+-}
+-
+-static int sunxi_wemac_eth_send(struct eth_device *dev, void *packet, int len)
+-{
+- struct wemac_regs *regs = (struct wemac_regs *)dev->iobase;
+-
+- /* Select channel 0 */
+- writel(0, ®s->tx_ins);
+-
+- /* Write packet */
+- wemac_outblk_32bit((void *)®s->tx_io_data, packet, len);
+-
+- /* Set TX len */
+- writel(len, ®s->tx_pl0);
+-
+- /* Start translate from fifo to phy */
+- setbits_le32(®s->tx_ctl0, 1);
+-
+- return 0;
+-}
+-
+-int sunxi_wemac_initialize(void)
+-{
+- struct sunxi_ccm_reg *const ccm =
+- (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+- struct sunxi_sramc_regs *sram =
+- (struct sunxi_sramc_regs *)SUNXI_SRAMC_BASE;
+- struct eth_device *dev;
+- struct wemac_eth_dev *priv;
+- int pin;
+-
+- dev = malloc(sizeof(*dev));
+- if (dev == NULL)
+- return -ENOMEM;
+-
+- priv = (struct wemac_eth_dev *)malloc(sizeof(struct wemac_eth_dev));
+- if (!priv) {
+- free(dev);
+- return -ENOMEM;
+- }
+-
+- memset(dev, 0, sizeof(*dev));
+- memset(priv, 0, sizeof(struct wemac_eth_dev));
+-
+- /* Map SRAM to EMAC */
+- setbits_le32(&sram->ctrl1, 0x5 << 2);
+-
+- /* Configure pin mux settings for MII Ethernet */
+- for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(17); pin++)
+- sunxi_gpio_set_cfgpin(pin, 2);
+-
+- /* Set up clock gating */
+- setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_EMAC);
+-
+- dev->iobase = SUNXI_EMAC_BASE;
+- dev->priv = priv;
+- dev->init = sunxi_wemac_eth_init;
+- dev->halt = sunxi_wemac_eth_halt;
+- dev->send = sunxi_wemac_eth_send;
+- dev->recv = sunxi_wemac_eth_recv;
+- strcpy(dev->name, "wemac");
+-
+- eth_register(dev);
+-
+- miiphy_register(dev->name, wemac_phy_read, wemac_phy_write);
+-
+- return 0;
+-}
+diff -ruN u-boot-2014.04/drivers/power/axp152.c u-boot-sunxi/drivers/power/axp152.c
+--- u-boot-2014.04/drivers/power/axp152.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/drivers/power/axp152.c 2014-09-06 16:58:36.321953111 +0200
+@@ -0,0 +1,112 @@
++/*
++ * (C) Copyright 2012
++ * Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#include <common.h>
++#include <i2c.h>
++#include <axp152.h>
++
++enum axp152_reg {
++ AXP152_CHIP_VERSION = 0x3,
++ AXP152_DCDC2_VOLTAGE = 0x23,
++ AXP152_DCDC3_VOLTAGE = 0x27,
++ AXP152_DCDC4_VOLTAGE = 0x2B,
++ AXP152_LDO2_VOLTAGE = 0x2A,
++ AXP152_SHUTDOWN = 0x32,
++};
++
++#define AXP152_POWEROFF (1 << 7)
++
++static int axp152_write(enum axp152_reg reg, u8 val)
++{
++ return i2c_write(0x30, reg, 1, &val, 1);
++}
++
++static int axp152_read(enum axp152_reg reg, u8 *val)
++{
++ return i2c_read(0x30, reg, 1, val, 1);
++}
++
++static int axp152_mvolt_to_target(int mvolt, int min, int max, int div)
++{
++ if (mvolt < min)
++ mvolt = min;
++ else if (mvolt > max)
++ mvolt = max;
++
++ return (mvolt - min) / div;
++}
++
++int axp152_set_dcdc2(int mvolt)
++{
++ int rc, target;
++ u8 current;
++
++ target = axp152_mvolt_to_target(mvolt, 700, 2275, 25);
++
++ /* Do we really need to be this gentle? It has built-in voltage slope */
++ while ((rc = axp152_read(AXP152_DCDC2_VOLTAGE, ¤t)) == 0 &&
++ current != target) {
++ if (current < target)
++ current++;
++ else
++ current--;
++ rc = axp152_write(AXP152_DCDC2_VOLTAGE, current);
++ if (rc)
++ break;
++ }
++ return rc;
++}
++
++int axp152_set_dcdc3(int mvolt)
++{
++ int target = axp152_mvolt_to_target(mvolt, 700, 3500, 25);
++
++ return axp152_write(AXP152_DCDC3_VOLTAGE, target);
++}
++
++int axp152_set_dcdc4(int mvolt)
++{
++ int target = axp152_mvolt_to_target(mvolt, 700, 3500, 25);
++
++ return axp152_write(AXP152_DCDC4_VOLTAGE, target);
++}
++
++int axp152_set_ldo2(int mvolt)
++{
++ int target = axp152_mvolt_to_target(mvolt, 700, 3500, 100);
++
++ return axp152_write(AXP152_LDO2_VOLTAGE, target);
++}
++
++void axp152_poweroff(void)
++{
++ u8 val;
++
++ if (axp152_read(AXP152_SHUTDOWN, &val) != 0)
++ return;
++
++ val |= AXP152_POWEROFF;
++
++ if (axp152_write(AXP152_SHUTDOWN, val) != 0)
++ return;
++
++ udelay(10000); /* wait for power to drain */
++}
++
++int axp152_init(void)
++{
++ u8 ver;
++ int rc;
++
++ rc = axp152_read(AXP152_CHIP_VERSION, &ver);
++ if (rc)
++ return rc;
++
++ if (ver != 0x05)
++ return -1;
++
++ return 0;
++}
+diff -ruN u-boot-2014.04/drivers/power/axp209.c u-boot-sunxi/drivers/power/axp209.c
+--- u-boot-2014.04/drivers/power/axp209.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/drivers/power/axp209.c 2014-09-06 16:58:36.321953111 +0200
+@@ -0,0 +1,180 @@
++/*
++ * (C) Copyright 2012
++ * Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <i2c.h>
++#include <axp209.h>
++
++enum axp209_reg {
++ AXP209_POWER_STATUS = 0x00,
++ AXP209_CHIP_VERSION = 0x03,
++ AXP209_DCDC2_VOLTAGE = 0x23,
++ AXP209_DCDC3_VOLTAGE = 0x27,
++ AXP209_LDO24_VOLTAGE = 0x28,
++ AXP209_LDO3_VOLTAGE = 0x29,
++ AXP209_IRQ_STATUS5 = 0x4c,
++ AXP209_SHUTDOWN = 0x32,
++};
++
++#define AXP209_POWER_STATUS_ON_BY_DC (1 << 0)
++
++#define AXP209_IRQ5_PEK_UP (1 << 6)
++#define AXP209_IRQ5_PEK_DOWN (1 << 5)
++
++#define AXP209_POWEROFF (1 << 7)
++
++static int axp209_write(enum axp209_reg reg, u8 val)
++{
++ return i2c_write(0x34, reg, 1, &val, 1);
++}
++
++static int axp209_read(enum axp209_reg reg, u8 *val)
++{
++ return i2c_read(0x34, reg, 1, val, 1);
++}
++
++static int axp209_mvolt_to_cfg(int mvolt, int min, int max, int div)
++{
++ if (mvolt < min)
++ mvolt = min;
++ else if (mvolt > max)
++ mvolt = max;
++
++ return (mvolt - min) / div;
++}
++
++int axp209_set_dcdc2(int mvolt)
++{
++ int cfg, rc;
++ u8 current;
++
++ cfg = axp209_mvolt_to_cfg(mvolt, 700, 2275, 25);
++
++ /* Do we really need to be this gentle? It has built-in voltage slope */
++ while ((rc = axp209_read(AXP209_DCDC2_VOLTAGE, ¤t)) == 0 &&
++ current != cfg) {
++ if (current < cfg)
++ current++;
++ else
++ current--;
++
++ rc = axp209_write(AXP209_DCDC2_VOLTAGE, current);
++ if (rc)
++ break;
++ }
++
++ return rc;
++}
++
++int axp209_set_dcdc3(int mvolt)
++{
++ int cfg = axp209_mvolt_to_cfg(mvolt, 700, 3500, 25);
++
++ return axp209_write(AXP209_DCDC3_VOLTAGE, cfg);
++}
++
++int axp209_set_ldo2(int mvolt)
++{
++ int rc, cfg;
++ u8 reg;
++
++ cfg = axp209_mvolt_to_cfg(mvolt, 1800, 3300, 100);
++
++ rc = axp209_read(AXP209_LDO24_VOLTAGE, ®);
++ if (rc)
++ return rc;
++
++ /* LDO2 configuration is in upper 4 bits */
++ reg = (reg & 0x0f) | (cfg << 4);
++ return axp209_write(AXP209_LDO24_VOLTAGE, reg);
++}
++
++int axp209_set_ldo3(int mvolt)
++{
++ int cfg = axp209_mvolt_to_cfg(mvolt, 700, 2275, 25);
++
++ if (mvolt == -1)
++ cfg = 0x80; /* determined by LDO3IN pin */
++
++ return axp209_write(AXP209_LDO3_VOLTAGE, cfg);
++}
++
++int axp209_set_ldo4(int mvolt)
++{
++ int cfg, rc;
++ static const int vindex[] = {
++ 1250, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2500,
++ 2700, 2800, 3000, 3100, 3200, 3300
++ };
++ u8 reg;
++
++ /* Translate mvolt to register cfg value, requested <= selected */
++ for (cfg = 15; vindex[cfg] > mvolt && cfg > 0; cfg--);
++
++ rc = axp209_read(AXP209_LDO24_VOLTAGE, ®);
++ if (rc)
++ return rc;
++
++ /* LDO4 configuration is in lower 4 bits */
++ reg = (reg & 0xf0) | (cfg << 0);
++ return axp209_write(AXP209_LDO24_VOLTAGE, reg);
++}
++
++void axp209_poweroff(void)
++{
++ u8 val;
++
++ if (axp209_read(AXP209_SHUTDOWN, &val) != 0)
++ return;
++
++ val |= AXP209_POWEROFF;
++
++ if (axp209_write(AXP209_SHUTDOWN, val) != 0)
++ return;
++
++ udelay(10000); /* wait for power to drain */
++}
++
++int axp209_init(void)
++{
++ u8 ver;
++ int rc;
++
++ rc = axp209_read(AXP209_CHIP_VERSION, &ver);
++ if (rc)
++ return rc;
++
++ /* Low 4 bits is chip version */
++ ver &= 0x0f;
++
++ if (ver != 0x1)
++ return -1;
++
++ return 0;
++}
++
++int axp209_poweron_by_dc(void)
++{
++ u8 v;
++
++ if (axp209_read(AXP209_POWER_STATUS, &v))
++ return 0;
++
++ return (v & AXP209_POWER_STATUS_ON_BY_DC);
++}
++
++int axp209_power_button(void)
++{
++ u8 v;
++
++ if (axp209_read(AXP209_IRQ_STATUS5, &v))
++ return 0;
++
++ axp209_write(AXP209_IRQ_STATUS5, AXP209_IRQ5_PEK_DOWN);
++
++ return v & AXP209_IRQ5_PEK_DOWN;
++}
+diff -ruN u-boot-2014.04/drivers/power/axp221.c u-boot-sunxi/drivers/power/axp221.c
+--- u-boot-2014.04/drivers/power/axp221.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/drivers/power/axp221.c 2014-09-06 16:58:36.321953111 +0200
+@@ -0,0 +1,73 @@
++/*
++ * (C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#include <common.h>
++#include <errno.h>
++#include <asm/arch/p2wi.h>
++#include <axp221.h>
++
++int axp221_set_dcdc1(unsigned int mvolt)
++{
++ return p2wi_write(AXP221_DCDC1_CTRL, (mvolt - 1600) / 100);
++}
++
++int axp221_set_dcdc2(unsigned int mvolt)
++{
++ return p2wi_write(AXP221_DCDC2_CTRL, (mvolt - 600) / 20);
++}
++
++int axp221_set_dcdc3(unsigned int mvolt)
++{
++ return p2wi_write(AXP221_DCDC3_CTRL, (mvolt - 600) / 20);
++}
++
++int axp221_set_dcdc4(unsigned int mvolt)
++{
++ return p2wi_write(AXP221_DCDC4_CTRL, (mvolt - 600) / 20);
++}
++
++int axp221_set_dcdc5(unsigned int mvolt)
++{
++ return p2wi_write(AXP221_DCDC5_CTRL, (mvolt - 600) / 20);
++}
++
++int axp221_set_dldo1(unsigned int mvolt)
++{
++ int ret;
++ u8 val;
++
++ ret = p2wi_write(AXP221_DLDO1_CTRL, (mvolt - 700) / 100);
++ if (ret)
++ return ret;
++
++ ret = p2wi_read(AXP221_OUTPUT_CTRL2, &val);
++ if (ret)
++ return ret;
++
++ val |= 1 << 3;
++ return p2wi_write(AXP221_OUTPUT_CTRL2, val);
++}
++
++int axp221_init(void)
++{
++ u8 axp_chip_id;
++ int ret;
++
++ p2wi_init();
++ ret = p2wi_set_pmu_address(AXP221_CHIP_ADDR, AXP221_CTRL_ADDR,
++ AXP221_INIT_DATA);
++ if (ret)
++ return ret;
++
++ ret = p2wi_read(AXP221_CHIP_ID, &axp_chip_id);
++ if (ret)
++ return ret;
++
++ if (!(axp_chip_id == 0x6 || axp_chip_id == 0x7 || axp_chip_id == 0x17))
++ return -ENODEV;
++
++ return 0;
++}
+diff -ruN u-boot-2014.04/drivers/power/Makefile u-boot-sunxi/drivers/power/Makefile
+--- u-boot-2014.04/drivers/power/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/power/Makefile 2014-09-06 16:58:36.321953111 +0200
+@@ -5,6 +5,9 @@
+ # SPDX-License-Identifier: GPL-2.0+
+ #
+
++obj-$(CONFIG_AXP152_POWER) += axp152.o
++obj-$(CONFIG_AXP209_POWER) += axp209.o
++obj-$(CONFIG_AXP221_POWER) += axp221.o
+ obj-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o
+ obj-$(CONFIG_FTPMU010_POWER) += ftpmu010.o
+ obj-$(CONFIG_TPS6586X_POWER) += tps6586x.o
+diff -ruN u-boot-2014.04/drivers/serial/arm_dcc.c u-boot-sunxi/drivers/serial/arm_dcc.c
+--- u-boot-2014.04/drivers/serial/arm_dcc.c 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/drivers/serial/arm_dcc.c 2014-09-06 16:58:36.329953111 +0200
+@@ -29,7 +29,7 @@
+ #include <common.h>
+ #include <serial.h>
+
+-#if defined(CONFIG_CPU_V6)
++#if defined(CONFIG_CPU_V6) || 1
+ /*
+ * ARMV6
+ */
+diff -ruN u-boot-2014.04/.git/config u-boot-sunxi/.git/config
+--- u-boot-2014.04/.git/config 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/config 2014-09-06 16:58:35.001953150 +0200
+@@ -0,0 +1,11 @@
++[core]
++ repositoryformatversion = 0
++ filemode = true
++ bare = false
++ logallrefupdates = true
++[remote "origin"]
++ fetch = +refs/heads/*:refs/remotes/origin/*
++ url = https://github.com/linux-sunxi/u-boot-sunxi
++[branch "sunxi"]
++ remote = origin
++ merge = refs/heads/sunxi
+diff -ruN u-boot-2014.04/.git/description u-boot-sunxi/.git/description
+--- u-boot-2014.04/.git/description 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/description 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1 @@
++Unnamed repository; edit this file 'description' to name the repository.
+diff -ruN u-boot-2014.04/.git/HEAD u-boot-sunxi/.git/HEAD
+--- u-boot-2014.04/.git/HEAD 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/HEAD 2014-09-06 16:58:35.001953150 +0200
+@@ -0,0 +1 @@
++ref: refs/heads/sunxi
+diff -ruN u-boot-2014.04/.git/hooks/applypatch-msg.sample u-boot-sunxi/.git/hooks/applypatch-msg.sample
+--- u-boot-2014.04/.git/hooks/applypatch-msg.sample 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/hooks/applypatch-msg.sample 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,15 @@
++#!/bin/sh
++#
++# An example hook script to check the commit log message taken by
++# applypatch from an e-mail message.
++#
++# The hook should exit with non-zero status after issuing an
++# appropriate message if it wants to stop the commit. The hook is
++# allowed to edit the commit message file.
++#
++# To enable this hook, rename this file to "applypatch-msg".
++
++. git-sh-setup
++test -x "$GIT_DIR/hooks/commit-msg" &&
++ exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
++:
+diff -ruN u-boot-2014.04/.git/hooks/commit-msg.sample u-boot-sunxi/.git/hooks/commit-msg.sample
+--- u-boot-2014.04/.git/hooks/commit-msg.sample 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/hooks/commit-msg.sample 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,24 @@
++#!/bin/sh
++#
++# An example hook script to check the commit log message.
++# Called by "git commit" with one argument, the name of the file
++# that has the commit message. The hook should exit with non-zero
++# status after issuing an appropriate message if it wants to stop the
++# commit. The hook is allowed to edit the commit message file.
++#
++# To enable this hook, rename this file to "commit-msg".
++
++# Uncomment the below to add a Signed-off-by line to the message.
++# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
++# hook is more suited to it.
++#
++# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
++# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
++
++# This example catches duplicate Signed-off-by lines.
++
++test "" = "$(grep '^Signed-off-by: ' "$1" |
++ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
++ echo >&2 Duplicate Signed-off-by lines.
++ exit 1
++}
+diff -ruN u-boot-2014.04/.git/hooks/post-update.sample u-boot-sunxi/.git/hooks/post-update.sample
+--- u-boot-2014.04/.git/hooks/post-update.sample 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/hooks/post-update.sample 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,8 @@
++#!/bin/sh
++#
++# An example hook script to prepare a packed repository for use over
++# dumb transports.
++#
++# To enable this hook, rename this file to "post-update".
++
++exec git update-server-info
+diff -ruN u-boot-2014.04/.git/hooks/pre-applypatch.sample u-boot-sunxi/.git/hooks/pre-applypatch.sample
+--- u-boot-2014.04/.git/hooks/pre-applypatch.sample 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/hooks/pre-applypatch.sample 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,14 @@
++#!/bin/sh
++#
++# An example hook script to verify what is about to be committed
++# by applypatch from an e-mail message.
++#
++# The hook should exit with non-zero status after issuing an
++# appropriate message if it wants to stop the commit.
++#
++# To enable this hook, rename this file to "pre-applypatch".
++
++. git-sh-setup
++test -x "$GIT_DIR/hooks/pre-commit" &&
++ exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
++:
+diff -ruN u-boot-2014.04/.git/hooks/pre-commit.sample u-boot-sunxi/.git/hooks/pre-commit.sample
+--- u-boot-2014.04/.git/hooks/pre-commit.sample 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/hooks/pre-commit.sample 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,50 @@
++#!/bin/sh
++#
++# An example hook script to verify what is about to be committed.
++# Called by "git commit" with no arguments. The hook should
++# exit with non-zero status after issuing an appropriate message if
++# it wants to stop the commit.
++#
++# To enable this hook, rename this file to "pre-commit".
++
++if git rev-parse --verify HEAD >/dev/null 2>&1
++then
++ against=HEAD
++else
++ # Initial commit: diff against an empty tree object
++ against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
++fi
++
++# If you want to allow non-ascii filenames set this variable to true.
++allownonascii=$(git config hooks.allownonascii)
++
++# Redirect output to stderr.
++exec 1>&2
++
++# Cross platform projects tend to avoid non-ascii filenames; prevent
++# them from being added to the repository. We exploit the fact that the
++# printable range starts at the space character and ends with tilde.
++if [ "$allownonascii" != "true" ] &&
++ # Note that the use of brackets around a tr range is ok here, (it's
++ # even required, for portability to Solaris 10's /usr/bin/tr), since
++ # the square bracket bytes happen to fall in the designated range.
++ test $(git diff --cached --name-only --diff-filter=A -z $against |
++ LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
++then
++ echo "Error: Attempt to add a non-ascii file name."
++ echo
++ echo "This can cause problems if you want to work"
++ echo "with people on other platforms."
++ echo
++ echo "To be portable it is advisable to rename the file ..."
++ echo
++ echo "If you know what you are doing you can disable this"
++ echo "check using:"
++ echo
++ echo " git config hooks.allownonascii true"
++ echo
++ exit 1
++fi
++
++# If there are whitespace errors, print the offending file names and fail.
++exec git diff-index --check --cached $against --
+diff -ruN u-boot-2014.04/.git/hooks/prepare-commit-msg.sample u-boot-sunxi/.git/hooks/prepare-commit-msg.sample
+--- u-boot-2014.04/.git/hooks/prepare-commit-msg.sample 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/hooks/prepare-commit-msg.sample 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,36 @@
++#!/bin/sh
++#
++# An example hook script to prepare the commit log message.
++# Called by "git commit" with the name of the file that has the
++# commit message, followed by the description of the commit
++# message's source. The hook's purpose is to edit the commit
++# message file. If the hook fails with a non-zero status,
++# the commit is aborted.
++#
++# To enable this hook, rename this file to "prepare-commit-msg".
++
++# This hook includes three examples. The first comments out the
++# "Conflicts:" part of a merge commit.
++#
++# The second includes the output of "git diff --name-status -r"
++# into the message, just before the "git status" output. It is
++# commented because it doesn't cope with --amend or with squashed
++# commits.
++#
++# The third example adds a Signed-off-by line to the message, that can
++# still be edited. This is rarely a good idea.
++
++case "$2,$3" in
++ merge,)
++ /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
++
++# ,|template,)
++# /usr/bin/perl -i.bak -pe '
++# print "\n" . `git diff --cached --name-status -r`
++# if /^#/ && $first++ == 0' "$1" ;;
++
++ *) ;;
++esac
++
++# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
++# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+diff -ruN u-boot-2014.04/.git/hooks/pre-rebase.sample u-boot-sunxi/.git/hooks/pre-rebase.sample
+--- u-boot-2014.04/.git/hooks/pre-rebase.sample 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/hooks/pre-rebase.sample 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,169 @@
++#!/bin/sh
++#
++# Copyright (c) 2006, 2008 Junio C Hamano
++#
++# The "pre-rebase" hook is run just before "git rebase" starts doing
++# its job, and can prevent the command from running by exiting with
++# non-zero status.
++#
++# The hook is called with the following parameters:
++#
++# $1 -- the upstream the series was forked from.
++# $2 -- the branch being rebased (or empty when rebasing the current branch).
++#
++# This sample shows how to prevent topic branches that are already
++# merged to 'next' branch from getting rebased, because allowing it
++# would result in rebasing already published history.
++
++publish=next
++basebranch="$1"
++if test "$#" = 2
++then
++ topic="refs/heads/$2"
++else
++ topic=`git symbolic-ref HEAD` ||
++ exit 0 ;# we do not interrupt rebasing detached HEAD
++fi
++
++case "$topic" in
++refs/heads/??/*)
++ ;;
++*)
++ exit 0 ;# we do not interrupt others.
++ ;;
++esac
++
++# Now we are dealing with a topic branch being rebased
++# on top of master. Is it OK to rebase it?
++
++# Does the topic really exist?
++git show-ref -q "$topic" || {
++ echo >&2 "No such branch $topic"
++ exit 1
++}
++
++# Is topic fully merged to master?
++not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
++if test -z "$not_in_master"
++then
++ echo >&2 "$topic is fully merged to master; better remove it."
++ exit 1 ;# we could allow it, but there is no point.
++fi
++
++# Is topic ever merged to next? If so you should not be rebasing it.
++only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
++only_next_2=`git rev-list ^master ${publish} | sort`
++if test "$only_next_1" = "$only_next_2"
++then
++ not_in_topic=`git rev-list "^$topic" master`
++ if test -z "$not_in_topic"
++ then
++ echo >&2 "$topic is already up-to-date with master"
++ exit 1 ;# we could allow it, but there is no point.
++ else
++ exit 0
++ fi
++else
++ not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
++ /usr/bin/perl -e '
++ my $topic = $ARGV[0];
++ my $msg = "* $topic has commits already merged to public branch:\n";
++ my (%not_in_next) = map {
++ /^([0-9a-f]+) /;
++ ($1 => 1);
++ } split(/\n/, $ARGV[1]);
++ for my $elem (map {
++ /^([0-9a-f]+) (.*)$/;
++ [$1 => $2];
++ } split(/\n/, $ARGV[2])) {
++ if (!exists $not_in_next{$elem->[0]}) {
++ if ($msg) {
++ print STDERR $msg;
++ undef $msg;
++ }
++ print STDERR " $elem->[1]\n";
++ }
++ }
++ ' "$topic" "$not_in_next" "$not_in_master"
++ exit 1
++fi
++
++<<\DOC_END
++
++This sample hook safeguards topic branches that have been
++published from being rewound.
++
++The workflow assumed here is:
++
++ * Once a topic branch forks from "master", "master" is never
++ merged into it again (either directly or indirectly).
++
++ * Once a topic branch is fully cooked and merged into "master",
++ it is deleted. If you need to build on top of it to correct
++ earlier mistakes, a new topic branch is created by forking at
++ the tip of the "master". This is not strictly necessary, but
++ it makes it easier to keep your history simple.
++
++ * Whenever you need to test or publish your changes to topic
++ branches, merge them into "next" branch.
++
++The script, being an example, hardcodes the publish branch name
++to be "next", but it is trivial to make it configurable via
++$GIT_DIR/config mechanism.
++
++With this workflow, you would want to know:
++
++(1) ... if a topic branch has ever been merged to "next". Young
++ topic branches can have stupid mistakes you would rather
++ clean up before publishing, and things that have not been
++ merged into other branches can be easily rebased without
++ affecting other people. But once it is published, you would
++ not want to rewind it.
++
++(2) ... if a topic branch has been fully merged to "master".
++ Then you can delete it. More importantly, you should not
++ build on top of it -- other people may already want to
++ change things related to the topic as patches against your
++ "master", so if you need further changes, it is better to
++ fork the topic (perhaps with the same name) afresh from the
++ tip of "master".
++
++Let's look at this example:
++
++ o---o---o---o---o---o---o---o---o---o "next"
++ / / / /
++ / a---a---b A / /
++ / / / /
++ / / c---c---c---c B /
++ / / / \ /
++ / / / b---b C \ /
++ / / / / \ /
++ ---o---o---o---o---o---o---o---o---o---o---o "master"
++
++
++A, B and C are topic branches.
++
++ * A has one fix since it was merged up to "next".
++
++ * B has finished. It has been fully merged up to "master" and "next",
++ and is ready to be deleted.
++
++ * C has not merged to "next" at all.
++
++We would want to allow C to be rebased, refuse A, and encourage
++B to be deleted.
++
++To compute (1):
++
++ git rev-list ^master ^topic next
++ git rev-list ^master next
++
++ if these match, topic has not merged in next at all.
++
++To compute (2):
++
++ git rev-list master..topic
++
++ if this is empty, it is fully merged to "master".
++
++DOC_END
+diff -ruN u-boot-2014.04/.git/hooks/update.sample u-boot-sunxi/.git/hooks/update.sample
+--- u-boot-2014.04/.git/hooks/update.sample 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/hooks/update.sample 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,128 @@
++#!/bin/sh
++#
++# An example hook script to blocks unannotated tags from entering.
++# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
++#
++# To enable this hook, rename this file to "update".
++#
++# Config
++# ------
++# hooks.allowunannotated
++# This boolean sets whether unannotated tags will be allowed into the
++# repository. By default they won't be.
++# hooks.allowdeletetag
++# This boolean sets whether deleting tags will be allowed in the
++# repository. By default they won't be.
++# hooks.allowmodifytag
++# This boolean sets whether a tag may be modified after creation. By default
++# it won't be.
++# hooks.allowdeletebranch
++# This boolean sets whether deleting branches will be allowed in the
++# repository. By default they won't be.
++# hooks.denycreatebranch
++# This boolean sets whether remotely creating branches will be denied
++# in the repository. By default this is allowed.
++#
++
++# --- Command line
++refname="$1"
++oldrev="$2"
++newrev="$3"
++
++# --- Safety check
++if [ -z "$GIT_DIR" ]; then
++ echo "Don't run this script from the command line." >&2
++ echo " (if you want, you could supply GIT_DIR then run" >&2
++ echo " $0 <ref> <oldrev> <newrev>)" >&2
++ exit 1
++fi
++
++if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
++ echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
++ exit 1
++fi
++
++# --- Config
++allowunannotated=$(git config --bool hooks.allowunannotated)
++allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
++denycreatebranch=$(git config --bool hooks.denycreatebranch)
++allowdeletetag=$(git config --bool hooks.allowdeletetag)
++allowmodifytag=$(git config --bool hooks.allowmodifytag)
++
++# check for no description
++projectdesc=$(sed -e '1q' "$GIT_DIR/description")
++case "$projectdesc" in
++"Unnamed repository"* | "")
++ echo "*** Project description file hasn't been set" >&2
++ exit 1
++ ;;
++esac
++
++# --- Check types
++# if $newrev is 0000...0000, it's a commit to delete a ref.
++zero="0000000000000000000000000000000000000000"
++if [ "$newrev" = "$zero" ]; then
++ newrev_type=delete
++else
++ newrev_type=$(git cat-file -t $newrev)
++fi
++
++case "$refname","$newrev_type" in
++ refs/tags/*,commit)
++ # un-annotated tag
++ short_refname=${refname##refs/tags/}
++ if [ "$allowunannotated" != "true" ]; then
++ echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
++ echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
++ exit 1
++ fi
++ ;;
++ refs/tags/*,delete)
++ # delete tag
++ if [ "$allowdeletetag" != "true" ]; then
++ echo "*** Deleting a tag is not allowed in this repository" >&2
++ exit 1
++ fi
++ ;;
++ refs/tags/*,tag)
++ # annotated tag
++ if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
++ then
++ echo "*** Tag '$refname' already exists." >&2
++ echo "*** Modifying a tag is not allowed in this repository." >&2
++ exit 1
++ fi
++ ;;
++ refs/heads/*,commit)
++ # branch
++ if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
++ echo "*** Creating a branch is not allowed in this repository" >&2
++ exit 1
++ fi
++ ;;
++ refs/heads/*,delete)
++ # delete branch
++ if [ "$allowdeletebranch" != "true" ]; then
++ echo "*** Deleting a branch is not allowed in this repository" >&2
++ exit 1
++ fi
++ ;;
++ refs/remotes/*,commit)
++ # tracking branch
++ ;;
++ refs/remotes/*,delete)
++ # delete tracking branch
++ if [ "$allowdeletebranch" != "true" ]; then
++ echo "*** Deleting a tracking branch is not allowed in this repository" >&2
++ exit 1
++ fi
++ ;;
++ *)
++ # Anything else (is there anything else?)
++ echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
++ exit 1
++ ;;
++esac
++
++# --- Finished
++exit 0
+Binary files u-boot-2014.04/.git/index and u-boot-sunxi/.git/index differ
+diff -ruN u-boot-2014.04/.git/info/exclude u-boot-sunxi/.git/info/exclude
+--- u-boot-2014.04/.git/info/exclude 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/info/exclude 2014-09-06 16:58:09.553953909 +0200
+@@ -0,0 +1,6 @@
++# git ls-files --others --exclude-from=.git/info/exclude
++# Lines that start with '#' are comments.
++# For a project mostly in C, the following would be a good set of
++# exclude patterns (uncomment them if you want to use them):
++# *.[oa]
++# *~
+diff -ruN u-boot-2014.04/.git/logs/HEAD u-boot-sunxi/.git/logs/HEAD
+--- u-boot-2014.04/.git/logs/HEAD 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/logs/HEAD 2014-09-06 16:58:35.001953150 +0200
+@@ -0,0 +1 @@
++0000000000000000000000000000000000000000 509d96d4f1f602d62d36db660973249e16f9d088 Zoltan HERPAI <wigyori@uid0.hu> 1410015515 +0200 clone: from https://github.com/linux-sunxi/u-boot-sunxi
+diff -ruN u-boot-2014.04/.git/logs/refs/heads/sunxi u-boot-sunxi/.git/logs/refs/heads/sunxi
+--- u-boot-2014.04/.git/logs/refs/heads/sunxi 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/logs/refs/heads/sunxi 2014-09-06 16:58:35.001953150 +0200
+@@ -0,0 +1 @@
++0000000000000000000000000000000000000000 509d96d4f1f602d62d36db660973249e16f9d088 Zoltan HERPAI <wigyori@uid0.hu> 1410015515 +0200 clone: from https://github.com/linux-sunxi/u-boot-sunxi
+diff -ruN u-boot-2014.04/.git/logs/refs/remotes/origin/HEAD u-boot-sunxi/.git/logs/refs/remotes/origin/HEAD
+--- u-boot-2014.04/.git/logs/refs/remotes/origin/HEAD 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/logs/refs/remotes/origin/HEAD 2014-09-06 16:58:35.001953150 +0200
+@@ -0,0 +1 @@
++0000000000000000000000000000000000000000 509d96d4f1f602d62d36db660973249e16f9d088 Zoltan HERPAI <wigyori@uid0.hu> 1410015515 +0200 clone: from https://github.com/linux-sunxi/u-boot-sunxi
+Binary files u-boot-2014.04/.git/objects/pack/pack-67611423d2b8399a45fe3205d396caff441c8135.idx and u-boot-sunxi/.git/objects/pack/pack-67611423d2b8399a45fe3205d396caff441c8135.idx differ
+Binary files u-boot-2014.04/.git/objects/pack/pack-67611423d2b8399a45fe3205d396caff441c8135.pack and u-boot-sunxi/.git/objects/pack/pack-67611423d2b8399a45fe3205d396caff441c8135.pack differ
+diff -ruN u-boot-2014.04/.git/packed-refs u-boot-sunxi/.git/packed-refs
+--- u-boot-2014.04/.git/packed-refs 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/packed-refs 2014-09-06 16:58:35.001953150 +0200
+@@ -0,0 +1,25 @@
++# pack-refs with: peeled
++3212c6fd4beaa14a21a57e5241022702c986f82e refs/remotes/origin/lichee-dev
++c0860ba179bc0cf016831ceeeacd0dd4e287a860 refs/remotes/origin/lichee-dev-a20
++1076d3bdd67db39f34bc91857c636525874441ae refs/remotes/origin/lichee/lichee-dev
++40b4fba701c1824cc60c7ab966f4a5dd674e947d refs/remotes/origin/lichee/lichee-dev-ICS
++cf54463fd782c690cf790ca35b5a15504b57c287 refs/remotes/origin/lichee/lichee-dev-mmc
++218f643881c0dabd7e40cdb21a757416fa80afb2 refs/remotes/origin/old/sunxi-current
++509d96d4f1f602d62d36db660973249e16f9d088 refs/remotes/origin/sunxi
++43fb1236c3330676f49220cc1dfc235eb0558e4c refs/remotes/origin/sunxi-patchqueue
++80fd9a5c5b87ba2f48f4a71b666839870e780be6 refs/remotes/origin/wip/a20
++27113637710a574d1fb6325817ffa9ced7afe019 refs/tags/v2011.09-sun4i
++^22b38fa5c0348ac4f285f038999f9a617f98e73a
++9ba56441491542cd06b30c514e544d96b29ef801 refs/tags/v2011.09-sun4i-20120808
++88eacf3372855579760ba6bc8fa3e0d4e53fdef8 refs/tags/v2012.10-sunxi
++1ae18d97d24c5d6dd4cb7949d8e5fb602728601c refs/tags/v2013.01-sunxi
++fc40799c144d035c595c4abe3032a03be8f0e2c4 refs/tags/v2013.01.01-sunxi
++90c8c0c88362d1e39bb1433f04b9a21bb1c74e45 refs/tags/v2013.04-sunxi
++57ff4519ba0f47f1647f7def5864ae4c9ef3e6a0 refs/tags/v2013.07-rc1-sunxi
++c416374795b584f025a80b1f81db215456567155 refs/tags/v2013.07-sunxi
++8969c6f654248ececdfcf05eb51de9a8bc0a8703 refs/tags/v2013.07-sunxi.2
++88b1df7ee9c15c821a2209791f513b21596f21b4 refs/tags/v2013.07-sunxi.3
++569c37da7dfd4ed93b6e8b5993df760b9ed18c8d refs/tags/v2013.07-sunxi.4
++7a63a6882876b76e47746c1254e8cd1120a52b0d refs/tags/v2013.10-rc1-sunxi
++951e509384822e39149c22f44cde6a01f5105c40 refs/tags/v2013.10-rc2-sunxi
++09ef3a640a3eb58e66eedcf239193e2ab548e730 refs/tags/v2013.10-sunxi
+diff -ruN u-boot-2014.04/.git/refs/heads/sunxi u-boot-sunxi/.git/refs/heads/sunxi
+--- u-boot-2014.04/.git/refs/heads/sunxi 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/refs/heads/sunxi 2014-09-06 16:58:35.001953150 +0200
+@@ -0,0 +1 @@
++509d96d4f1f602d62d36db660973249e16f9d088
+diff -ruN u-boot-2014.04/.git/refs/remotes/origin/HEAD u-boot-sunxi/.git/refs/remotes/origin/HEAD
+--- u-boot-2014.04/.git/refs/remotes/origin/HEAD 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/.git/refs/remotes/origin/HEAD 2014-09-06 16:58:35.001953150 +0200
+@@ -0,0 +1 @@
++ref: refs/remotes/origin/sunxi
+diff -ruN u-boot-2014.04/include/axp152.h u-boot-sunxi/include/axp152.h
+--- u-boot-2014.04/include/axp152.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/axp152.h 2014-09-06 16:58:36.397953109 +0200
+@@ -0,0 +1,11 @@
++/*
++ * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++int axp152_set_dcdc2(int mvolt);
++int axp152_set_dcdc3(int mvolt);
++int axp152_set_dcdc4(int mvolt);
++int axp152_set_ldo2(int mvolt);
++void axp152_poweroff(void);
++int axp152_init(void);
+diff -ruN u-boot-2014.04/include/axp209.h u-boot-sunxi/include/axp209.h
+--- u-boot-2014.04/include/axp209.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/axp209.h 2014-09-06 16:58:36.397953109 +0200
+@@ -0,0 +1,15 @@
++/*
++ * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++extern int axp209_set_dcdc2(int mvolt);
++extern int axp209_set_dcdc3(int mvolt);
++extern int axp209_set_ldo2(int mvolt);
++extern int axp209_set_ldo3(int mvolt);
++extern int axp209_set_ldo4(int mvolt);
++extern void axp209_poweroff(void);
++extern int axp209_init(void);
++extern int axp209_poweron_by_dc(void);
++extern int axp209_power_button(void);
+diff -ruN u-boot-2014.04/include/axp221.h u-boot-sunxi/include/axp221.h
+--- u-boot-2014.04/include/axp221.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/axp221.h 2014-09-06 16:58:36.397953109 +0200
+@@ -0,0 +1,30 @@
++/*
++ * (C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
++ *
++ * X-Powers AXP221 Power Management IC driver
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#define AXP221_CHIP_ADDR 0x68
++#define AXP221_CTRL_ADDR 0x3e
++#define AXP221_INIT_DATA 0x3e
++
++#define AXP221_CHIP_ID 0x03
++#define AXP221_OUTPUT_CTRL1 0x10
++#define AXP221_OUTPUT_CTRL2 0x12
++#define AXP221_OUTPUT_CTRL3 0x13
++#define AXP221_DLDO1_CTRL 0x15
++#define AXP221_DCDC1_CTRL 0x21
++#define AXP221_DCDC2_CTRL 0x22
++#define AXP221_DCDC3_CTRL 0x23
++#define AXP221_DCDC4_CTRL 0x24
++#define AXP221_DCDC5_CTRL 0x25
++
++int axp221_set_dcdc1(unsigned int mvolt);
++int axp221_set_dcdc2(unsigned int mvolt);
++int axp221_set_dcdc3(unsigned int mvolt);
++int axp221_set_dcdc4(unsigned int mvolt);
++int axp221_set_dcdc5(unsigned int mvolt);
++int axp221_set_dldo1(unsigned int mvolt);
++int axp221_init(void);
+diff -ruN u-boot-2014.04/include/config_fallbacks.h u-boot-sunxi/include/config_fallbacks.h
+--- u-boot-2014.04/include/config_fallbacks.h 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/include/config_fallbacks.h 2014-09-06 16:58:36.401953108 +0200
+@@ -55,6 +55,10 @@
+ #define HAVE_BLOCK_DEVICE
+ #endif
+
++#ifndef CONFIG_SYS_BOARD_NAME
++#define CONFIG_SYS_BOARD_NAME CONFIG_SYS_TARGET
++#endif
++
+ #if (defined(CONFIG_PARTITION_UUIDS) || \
+ defined(CONFIG_EFI_PARTITION) || \
+ defined(CONFIG_RANDOM_UUID) || \
+diff -ruN u-boot-2014.04/include/configs/sun4i.h u-boot-sunxi/include/configs/sun4i.h
+--- u-boot-2014.04/include/configs/sun4i.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/configs/sun4i.h 2014-09-06 16:58:36.461953107 +0200
+@@ -0,0 +1,25 @@
++/*
++ * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * Configuration settings for the Allwinner A10 (sun4i) CPU
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/*
++ * A10 specific configuration
++ */
++#define CONFIG_SUN4I /* sun4i SoC generation */
++#define CONFIG_CLK_FULL_SPEED 1008000000
++
++#define CONFIG_SYS_PROMPT "sun4i# "
++#define CONFIG_MACH_TYPE 4104
++
++/*
++ * Include common sunxi configuration where most the settings are
++ */
++#include <configs/sunxi-common.h>
++
++#endif /* __CONFIG_H */
+diff -ruN u-boot-2014.04/include/configs/sun5i.h u-boot-sunxi/include/configs/sun5i.h
+--- u-boot-2014.04/include/configs/sun5i.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/configs/sun5i.h 2014-09-06 16:58:36.461953107 +0200
+@@ -0,0 +1,25 @@
++/*
++ * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * Configuration settings for the Allwinner A13 (sun5i) CPU
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/*
++ * High Level Configuration Options
++ */
++#define CONFIG_SUN5I /* sun5i SoC generation */
++#define CONFIG_CLK_FULL_SPEED 1008000000
++
++#define CONFIG_SYS_PROMPT "sun5i# "
++#define CONFIG_MACH_TYPE 4138
++
++/*
++ * Include common sunxi configuration where most the settings are
++ */
++#include <configs/sunxi-common.h>
++
++#endif /* __CONFIG_H */
+diff -ruN u-boot-2014.04/include/configs/sun6i.h u-boot-sunxi/include/configs/sun6i.h
+--- u-boot-2014.04/include/configs/sun6i.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/configs/sun6i.h 2014-09-06 16:58:36.461953107 +0200
+@@ -0,0 +1,43 @@
++/*
++ * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
++ * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
++ * (C) Copyright 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
++ *
++ * Configuration settings for the Allwinner A31 (sun6i) CPU
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/*
++ * A31 specific configuration
++ */
++#define CONFIG_SUN6I /* sun6i SoC generation */
++
++#define CONFIG_SYS_PROMPT "sun6i# "
++#define CONFIG_MACH_TYPE 3892
++
++/*
++ * Include common sunxi configuration where most the settings are
++ */
++#include <configs/sunxi-common.h>
++
++#endif /* __CONFIG_H */
+diff -ruN u-boot-2014.04/include/configs/sun7i.h u-boot-sunxi/include/configs/sun7i.h
+--- u-boot-2014.04/include/configs/sun7i.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/configs/sun7i.h 2014-09-06 16:58:36.461953107 +0200
+@@ -0,0 +1,30 @@
++/*
++ * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
++ * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
++ *
++ * Configuration settings for the Allwinner A20 (sun7i) CPU
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/*
++ * A20 specific configuration
++ */
++#define CONFIG_SUN7I /* sun7i SoC generation */
++#define CONFIG_CLK_FULL_SPEED 912000000
++
++#define CONFIG_SYS_PROMPT "sun7i# "
++#define CONFIG_MACH_TYPE 4283
++
++#if defined(CONFIG_SYS_SECONDARY_ON)
++#define CONFIG_BOARD_POSTCLK_INIT 1
++#endif
++
++/*
++ * Include common sunxi configuration where most the settings are
++ */
++#include <configs/sunxi-common.h>
++
++#endif /* __CONFIG_H */
+diff -ruN u-boot-2014.04/include/configs/sun8i.h u-boot-sunxi/include/configs/sun8i.h
+--- u-boot-2014.04/include/configs/sun8i.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/configs/sun8i.h 2014-09-06 16:58:36.461953107 +0200
+@@ -0,0 +1,28 @@
++/*
++ * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
++ * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
++ * (C) Copyright 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
++ * (C) Copyright 2014 Chen-Yu Tsai <wens@csie.org>
++ *
++ * Configuration settings for the Allwinner A23 (sun8i) CPU
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/*
++ * A23 specific configuration
++ */
++#define CONFIG_SUN8I /* sun8i SoC generation */
++
++#define CONFIG_SYS_PROMPT "sun8i# "
++#define CONFIG_MACH_TYPE 4137
++
++/*
++ * Include common sunxi configuration where most the settings are
++ */
++#include <configs/sunxi-common.h>
++
++#endif /* __CONFIG_H */
+diff -ruN u-boot-2014.04/include/configs/sunxi-common.h u-boot-sunxi/include/configs/sunxi-common.h
+--- u-boot-2014.04/include/configs/sunxi-common.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/include/configs/sunxi-common.h 2014-09-06 16:58:36.461953107 +0200
+@@ -0,0 +1,427 @@
++/*
++ * (C) Copyright 2012-2012 Henrik Nordstrom <henrik@henriknordstrom.net>
++ *
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * Configuration settings for the Allwinner sunxi series of boards.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#ifndef _SUNXI_COMMON_CONFIG_H
++#define _SUNXI_COMMON_CONFIG_H
++
++/*
++ * High Level Configuration Options
++ */
++#define CONFIG_SUNXI /* sunxi family */
++#ifdef CONFIG_SPL_BUILD
++#ifndef CONFIG_SPL_FEL
++#define CONFIG_SYS_THUMB_BUILD /* Thumbs mode to save space in SPL */
++#endif
++#endif
++
++#include <asm/arch/cpu.h> /* get chip and board defs */
++
++#define CONFIG_SYS_TEXT_BASE 0x4a000000
++
++/*
++ * Display CPU and Board information
++ */
++#define CONFIG_DISPLAY_CPUINFO
++#define CONFIG_DISPLAY_BOARDINFO
++
++/* Serial & console */
++#define CONFIG_SYS_NS16550
++#define CONFIG_SYS_NS16550_SERIAL
++/* ns16550 reg in the low bits of cpu reg */
++#define CONFIG_SYS_NS16550_REG_SIZE -4
++#define CONFIG_SYS_NS16550_CLK 24000000
++#define CONFIG_SYS_NS16550_COM1 SUNXI_UART0_BASE
++#define CONFIG_SYS_NS16550_COM2 SUNXI_UART1_BASE
++#define CONFIG_SYS_NS16550_COM3 SUNXI_UART2_BASE
++#define CONFIG_SYS_NS16550_COM4 SUNXI_UART3_BASE
++#define CONFIG_SYS_NS16550_COM5 SUNXI_R_UART_BASE
++
++/* DRAM Base */
++#define CONFIG_SYS_SDRAM_BASE 0x40000000
++#define CONFIG_SYS_INIT_RAM_ADDR 0x0
++#define CONFIG_SYS_INIT_RAM_SIZE 0x8000 /* 32 KiB */
++
++#define CONFIG_SYS_INIT_SP_OFFSET \
++ (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
++#define CONFIG_SYS_INIT_SP_ADDR \
++ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
++
++/* A10 has 1 banks of DRAM, we use only bank 1 in U-Boot */
++#define CONFIG_NR_DRAM_BANKS 1
++#define PHYS_SDRAM_0 CONFIG_SYS_SDRAM_BASE
++#if defined(CONFIG_SUN6I) || defined(CONFIG_SUN7I)
++#define PHYS_SDRAM_0_SIZE 0x80000000 /* 2 GiB */
++#else
++#define PHYS_SDRAM_0_SIZE 0x40000000 /* 1 GiB */
++#endif
++#if 0
++/* Nand config */
++#define CONFIG_NAND
++#define CONFIG_NAND_SUNXI
++#define CONFIG_CMD_NAND /* NAND support */
++#define CONFIG_SYS_MAX_NAND_DEVICE 1
++#define CONFIG_SYS_NAND_BASE 0x00
++#endif
++
++#define CONFIG_CMD_MEMORY
++#define CONFIG_CMD_SETEXPR
++
++#define CONFIG_SETUP_MEMORY_TAGS
++#define CONFIG_CMDLINE_TAG
++#define CONFIG_INITRD_TAG
++
++/* mmc config */
++/* Can't use MMC slot 0 if the UART is directed there */
++#if !defined CONFIG_UART0_PORT_F || CONFIG_MMC_SUNXI_SLOT != 0
++#define CONFIG_MMC
++#define CONFIG_GENERIC_MMC
++#define CONFIG_CMD_MMC
++#define CONFIG_MMC_SUNXI
++#ifndef CONFIG_MMC_SUNXI_SLOT
++#define CONFIG_MMC_SUNXI_SLOT 0
++#endif
++#define CONFIG_ENV_IS_IN_MMC
++#define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */
++#endif
++
++/* 4MB of malloc() pool */
++#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (4 << 20))
++
++/*
++ * Miscellaneous configurable options
++ */
++#define CONFIG_CMD_ECHO
++#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
++#define CONFIG_SYS_PBSIZE 384 /* Print Buffer Size */
++#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
++#define CONFIG_SYS_GENERIC_BOARD
++
++/* Boot Argument Buffer Size */
++#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
++
++#define CONFIG_SYS_LOAD_ADDR 0x48000000 /* default load address */
++
++/* standalone support */
++#define CONFIG_STANDALONE_LOAD_ADDR 0x48000000
++
++#define CONFIG_SYS_HZ 1000
++
++/* baudrate */
++#define CONFIG_BAUDRATE 115200
++
++/* The stack sizes are set up in start.S using the settings below */
++#define CONFIG_STACKSIZE (256 << 10) /* 256 KiB */
++
++/* FLASH and environment organization */
++
++#define CONFIG_SYS_NO_FLASH
++
++#define CONFIG_SYS_MONITOR_LEN (512 << 10) /* 512 KiB */
++#define CONFIG_IDENT_STRING " Allwinner Technology"
++
++#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */
++#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
++
++#ifdef CONFIG_SPL_FEL
++#define RUN_BOOT_RAM "run boot_ram;"
++#else
++#define RUN_BOOT_RAM ""
++#endif
++
++#define CONFIG_BOOTCOMMAND \
++ RUN_BOOT_RAM \
++ "if run loadbootenv; then " \
++ "echo Loaded environment from ${bootenv};" \
++ "env import -t ${scriptaddr} ${filesize};" \
++ "fi;" \
++ "if test -n \\\"${uenvcmd}\\\"; then " \
++ "echo Running uenvcmd ...;" \
++ "run uenvcmd;" \
++ "fi;" \
++ "if run loadbootscr; then "\
++ "echo Jumping to ${bootscr};" \
++ "source ${scriptaddr};" \
++ "fi;" \
++ "run autoboot;" \
++ ""
++
++#ifdef CONFIG_CMD_WATCHDOG
++#define RESET_WATCHDOG "watchdog 0"
++#else
++#define RESET_WATCHDOG "true"
++#endif
++
++#define CONFIG_EXTRA_ENV_SETTINGS \
++ "bootm_size=0x10000000\0" \
++ "console=ttyS0,115200\0" \
++ "panicarg=panic=10\0" \
++ "extraargs=\0" \
++ "loglevel=8\0" \
++ "scriptaddr=0x44000000\0" \
++ "device=mmc\0" \
++ "partition=0:1\0" \
++ "setargs=" \
++ "if test -z \\\\\"$root\\\\\"; then"\
++ " if test \\\\\"$bootpath\\\\\" = \"/boot/\"; then"\
++ " root=\"/dev/mmcblk0p1 rootwait\";"\
++ " else" \
++ " root=\"/dev/mmcblk0p2 rootwait\";"\
++ " fi;"\
++ " fi;"\
++ " setenv bootargs console=${console} root=${root}" \
++ " loglevel=${loglevel} ${panicarg} ${extraargs}" \
++ "\0" \
++ "kernel=uImage\0" \
++ "bootenv=uEnv.txt\0" \
++ "bootscr=boot.scr\0" \
++ "script=script.bin\0" \
++ "loadbootscr=" \
++ "fatload $device $partition $scriptaddr ${bootscr}" \
++ " || " \
++ "ext2load $device $partition $scriptaddr boot/${bootscr}" \
++ " ||" \
++ "ext2load $device $partition $scriptaddr ${bootscr}" \
++ "\0" \
++ "loadbootenv=" \
++ "fatload $device $partition $scriptaddr ${bootenv}" \
++ " || " \
++ "ext2load $device $partition $scriptaddr boot/${bootenv}" \
++ " || " \
++ "ext2load $device $partition $scriptaddr ${bootenv}" \
++ "\0" \
++ "loadkernel=" \
++ "if "\
++ "bootpath=/boot/" \
++ " && " \
++ "ext2load $device $partition 0x43000000 ${bootpath}${script}" \
++ " && " \
++ "ext2load $device $partition 0x48000000 ${bootpath}${kernel}" \
++ ";then true; elif " \
++ "bootpath=/" \
++ " && " \
++ "fatload $device $partition 0x43000000 ${script}" \
++ " && " \
++ "fatload $device $partition 0x48000000 ${kernel}" \
++ ";then true; elif " \
++ "bootpath=/" \
++ " && " \
++ "ext2load $device $partition 0x43000000 ${bootpath}${script}" \
++ " && " \
++ "ext2load $device $partition 0x48000000 ${bootpath}${kernel}" \
++ ";then true; else "\
++ "false" \
++ ";fi" \
++ "\0" \
++ "autoboot=" \
++ "run loadkernel" \
++ " && " \
++ "run setargs" \
++ " && " \
++ RESET_WATCHDOG \
++ " && " \
++ "bootm 0x48000000" \
++ "\0" \
++ "boot_ram=" \
++ "saved_stdout=$stdout;setenv stdout nc;"\
++ "if iminfo 0x41000000; then" \
++ " " RESET_WATCHDOG ";"\
++ " setenv stdout $saved_stdout;" \
++ " source 0x41000000;" \
++ "else" \
++ " setenv stdout $saved_stdout;" \
++ "fi" \
++ "\0" \
++ ""
++
++#define CONFIG_SYS_BOOT_GET_CMDLINE
++
++#include <config_cmd_default.h>
++
++#define CONFIG_FAT_WRITE /* enable write access */
++
++#define CONFIG_SPL_FRAMEWORK
++#define CONFIG_SPL_LIBCOMMON_SUPPORT
++#define CONFIG_SPL_SERIAL_SUPPORT
++#define CONFIG_SPL_LIBGENERIC_SUPPORT
++#define CONFIG_SPL_DISPLAY_PRINT
++
++/* Falcon boot mode support */
++/* Disabled by default on sun4i/sun7i. Many GCC versions produces a too
++ * large SPL for A10/A20 with this on. sun5i however accepts a much larger
++ * SPL
++ */
++#if defined( CONFIG_SUN5I ) || defined ( CONFIG_SYS_THUMB_BUILD )
++#define CONFIG_SPL_OS_BOOT
++#endif
++
++#ifdef CONFIG_SPL_FEL
++
++#define CONFIG_SPL
++#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds"
++#define CONFIG_SPL_START_S_PATH "arch/arm/cpu/armv7/sunxi"
++#define CONFIG_SPL_TEXT_BASE 0x2000
++#define CONFIG_SPL_MAX_SIZE 0x4000 /* 16 KiB */
++
++#else /* CONFIG_SPL */
++
++#define CONFIG_SPL_BSS_START_ADDR 0x4ff80000
++#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KiB */
++
++#define CONFIG_SPL_TEXT_BASE 0x20 /* sram start+header */
++#ifdef CONFIG_SUN5I
++#define CONFIG_SPL_MAX_SIZE 0x75e0 /* 7748+ is used */
++#else
++#define CONFIG_SPL_MAX_SIZE 0x5fe0 /* 24KB on sun4i/sun7i */
++#endif
++
++#define CONFIG_SPL_LIBDISK_SUPPORT
++#define CONFIG_SPL_MMC_SUPPORT
++
++#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds"
++
++#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 80 /* 40KiB */
++#define CONFIG_SPL_PAD_TO 32768 /* decimal for 'dd' */
++
++#endif /* CONFIG_SPL */
++/* end of 32 KiB in sram */
++#define LOW_LEVEL_SRAM_STACK 0x00008000 /* End of sram */
++#define CONFIG_SPL_STACK LOW_LEVEL_SRAM_STACK
++#define CONFIG_SYS_SPL_MALLOC_START 0x4ff00000
++#define CONFIG_SYS_SPL_MALLOC_SIZE 0x00080000 /* 512 KiB */
++
++#ifdef CONFIG_SPL_OS_BOOT
++#define CONFIG_CMD_SPL
++#define CONFIG_SYS_SPL_ARGS_ADDR (PHYS_SDRAM_0 + 0x100)
++#ifdef CONFIG_SPL_MMC_SUPPORT
++#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 1344
++#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 256
++#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 1600
++#endif
++#endif
++
++#undef CONFIG_CMD_FPGA
++#undef CONFIG_CMD_NET
++#undef CONFIG_CMD_NFS
++
++/* I2C */
++#if !defined CONFIG_SUN6I && !defined CONFIG_SUN8I
++#define CONFIG_SPL_I2C_SUPPORT
++#endif
++/* No CONFIG_SYS_I2C as we use the non converted mvtwsi driver */
++#define CONFIG_HARD_I2C
++#define CONFIG_SYS_I2C_SUNXI
++#define CONFIG_SYS_I2C_SPEED 400000
++#define CONFIG_SYS_I2C_SLAVE 0x7f
++#define CONFIG_CMD_I2C
++
++/* Watchdog */
++#if 0
++#define CONFIG_WATCHDOG /* automatic watchdog support */
++#define CONFIG_CMD_WATCHDOG /* watchdog command setting the watchdog timeout */
++#endif
++
++/* GPIO */
++#define CONFIG_SUNXI_GPIO
++#define CONFIG_CMD_GPIO
++
++/* PMU */
++#if !defined CONFIG_AXP152_POWER && !defined CONFIG_AXP221_POWER && !defined CONFIG_NO_AXP
++#define CONFIG_AXP209_POWER
++#endif
++#if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER || defined CONFIG_AXP221_POWER
++#define CONFIG_SPL_POWER_SUPPORT
++#endif
++
++#ifdef CONFIG_STATUSLED
++#define STATUS_LED_BIT CONFIG_STATUSLED
++#endif
++#ifdef CONFIG_STATUSLED1
++#define STATUS_LED_BIT1 CONFIG_STATUSLED1
++#endif
++#ifdef CONFIG_STATUSLED2
++#define STATUS_LED_BIT2 CONFIG_STATUSLED2
++#endif
++#ifdef CONFIG_STATUSLED3
++#define STATUS_LED_BIT3 CONFIG_STATUSLED3
++#endif
++
++#ifndef CONFIG_SPL_BUILD
++#ifdef STATUS_LED_BIT
++#define CONFIG_GPIO_LED
++#define CONFIG_STATUS_LED
++#ifndef STATUS_LED_BOOT
++#define STATUS_LED_BOOT 0
++#endif
++#ifndef STATUS_LED_STATE
++#define STATUS_LED_STATE STATUS_LED_ON
++#define STATUS_LED_PERIOD 1
++#endif
++#ifndef STATUS_LED_STATE1
++#define STATUS_LED_STATE1 STATUS_LED_OFF
++#define STATUS_LED_PERIOD1 1
++#endif
++#ifndef STATUS_LED_STATE2
++#define STATUS_LED_STATE2 STATUS_LED_OFF
++#define STATUS_LED_PERIOD2 1
++#endif
++#ifndef STATUS_LED_STATE3
++#define STATUS_LED_STATE3 STATUS_LED_OFF
++#define STATUS_LED_PERIOD3 1
++#endif
++#define CONFIG_BOARD_SPECIFIC_LED
++#define CONFIG_CMD_LED
++#endif
++#endif
++
++/* Define this to have serial channel 1 (UART0) redirected to SD port */
++/* #define CONFIG_UART0_PORT_F */
++
++#ifndef CONFIG_CONS_INDEX
++#define CONFIG_CONS_INDEX 1 /* UART0 */
++#endif
++
++/* Ethernet support */
++#ifdef CONFIG_SUNXI_EMAC
++#define CONFIG_MII /* MII PHY management */
++#endif
++
++#ifdef CONFIG_SUNXI_GMAC
++#define CONFIG_DESIGNWARE_ETH /* GMAC can use designware driver */
++#define CONFIG_DW_AUTONEG
++#define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */
++#define CONFIG_PHY_ADDR 1
++#define CONFIG_MII /* MII PHY management */
++#define CONFIG_PHYLIB
++#endif
++
++#ifdef CONFIG_CMD_NET
++#define CONFIG_CMD_NFS
++#define CONFIG_CMD_DNS
++#define CONFIG_NETCONSOLE
++#define CONFIG_BOOTP_DNS2
++#define CONFIG_BOOTP_SEND_HOSTNAME
++#endif
++
++#if !defined CONFIG_ENV_IS_IN_MMC && \
++ !defined CONFIG_ENV_IS_IN_NAND && \
++ !defined CONFIG_ENV_IS_IN_FAT && \
++ !defined CONFIG_ENV_IS_IN_SPI_FLASH
++#define CONFIG_ENV_IS_NOWHERE
++#endif
++
++#define CONFIG_MISC_INIT_R
++
++#ifndef CONFIG_SPL_BUILD
++#include <config_distro_defaults.h>
++#endif
++
++#endif /* _SUNXI_COMMON_CONFIG_H */
+diff -ruN u-boot-2014.04/include/netdev.h u-boot-sunxi/include/netdev.h
+--- u-boot-2014.04/include/netdev.h 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/include/netdev.h 2014-09-06 16:58:36.485953106 +0200
+@@ -79,7 +79,8 @@
+ int skge_initialize(bd_t *bis);
+ int smc91111_initialize(u8 dev_num, int base_addr);
+ int smc911x_initialize(u8 dev_num, int base_addr);
+-int sunxi_wemac_initialize(bd_t *bis);
++int sunxi_emac_initialize(bd_t *bis);
++int sunxi_gmac_initialize(bd_t *bis);
+ int tsi108_eth_initialize(bd_t *bis);
+ int uec_standard_init(bd_t *bis);
+ int uli526x_initialize(bd_t *bis);
+diff -ruN u-boot-2014.04/Makefile u-boot-sunxi/Makefile
+--- u-boot-2014.04/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/Makefile 2014-09-06 16:58:35.065953148 +0200
+@@ -870,6 +870,13 @@
+ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
+ $(call if_changed,pad_cat)
+
++ifneq ($(CONFIG_SUNXI),)
++OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
++ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
++u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
++ $(call if_changed,pad_cat)
++endif
++
+ ifneq ($(CONFIG_TEGRA),)
+ OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+ u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
+@@ -1081,6 +1088,9 @@
+ spl/u-boot-spl: tools prepare
+ $(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all
+
++spl/sunxi-spl.bin: spl/u-boot-spl
++ @:
++
+ tpl/u-boot-tpl.bin: tools prepare
+ $(Q)$(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y
+
+diff -ruN u-boot-2014.04/mkconfig u-boot-sunxi/mkconfig
+--- u-boot-2014.04/mkconfig 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/mkconfig 2014-09-06 16:58:36.509953105 +0200
+@@ -174,6 +174,7 @@
+ echo "#define CONFIG_SYS_ARCH \"${arch}\"" >> config.h
+ echo "#define CONFIG_SYS_CPU \"${cpu}\"" >> config.h
+ echo "#define CONFIG_SYS_BOARD \"${board}\"" >> config.h
++echo "#define CONFIG_SYS_TARGET \"${BOARD_NAME}\"" >> config.h
+
+ [ "${vendor}" ] && echo "#define CONFIG_SYS_VENDOR \"${vendor}\"" >> config.h
+
+diff -ruN u-boot-2014.04/snapshot.commit u-boot-sunxi/snapshot.commit
+--- u-boot-2014.04/snapshot.commit 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/snapshot.commit 2014-09-06 16:58:36.521953105 +0200
+@@ -1 +1 @@
+-dda0dbfc69f3d560c87f5be85f127ed862ea6721 Mon, 14 Apr 2014 15:19:24 -0400
++$Format:%H %cD$
+diff -ruN u-boot-2014.04/spl/Makefile u-boot-sunxi/spl/Makefile
+--- u-boot-2014.04/spl/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/spl/Makefile 2014-09-06 16:58:36.521953105 +0200
+@@ -188,6 +188,12 @@
+ ALL-y += $(obj)/$(BOARD)-spl.bin
+ endif
+
++ifdef CONFIG_SUNXI
++ifndef CONFIG_SPL_FEL
++ALL-y += $(obj)/sunxi-spl.bin
++endif
++endif
++
+ all: $(ALL-y)
+
+ ifdef CONFIG_SAMSUNG
+@@ -215,6 +221,13 @@
+ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
+ endif
+
++ifdef CONFIG_SUNXI
++quiet_cmd_mksunxiboot = MKSUNXI $@
++cmd_mksunxiboot = $(objtree)/tools/mksunxiboot $< $@
++$(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin
++ $(call if_changed,mksunxiboot)
++endif
++
+ quiet_cmd_u-boot-spl = LD $@
+ cmd_u-boot-spl = cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
+ $(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \
+diff -ruN u-boot-2014.04/tools/.gitignore u-boot-sunxi/tools/.gitignore
+--- u-boot-2014.04/tools/.gitignore 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/tools/.gitignore 2014-09-06 16:58:36.521953105 +0200
+@@ -9,6 +9,7 @@
+ /mkexynosspl
+ /mpc86x_clk
+ /mxsboot
++/mksunxiboot
+ /ncb
+ /proftool
+ /relocate-rela
+diff -ruN u-boot-2014.04/tools/Makefile u-boot-sunxi/tools/Makefile
+--- u-boot-2014.04/tools/Makefile 2014-04-14 21:19:24.000000000 +0200
++++ u-boot-sunxi/tools/Makefile 2014-09-06 16:58:36.521953105 +0200
+@@ -120,6 +120,8 @@
+ hostprogs-$(CONFIG_MX28) += mxsboot$(SFX)
+ HOSTCFLAGS_mxsboot$(SFX).o := -pedantic
+
++hostprogs-$(CONFIG_SUNXI) += mksunxiboot$(SFX)
++
+ hostprogs-$(CONFIG_NETCONSOLE) += ncb$(SFX)
+ hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
+
+diff -ruN u-boot-2014.04/tools/mksunxiboot.c u-boot-sunxi/tools/mksunxiboot.c
+--- u-boot-2014.04/tools/mksunxiboot.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/tools/mksunxiboot.c 2014-09-06 16:58:36.529953105 +0200
+@@ -0,0 +1,140 @@
++/*
++ * (C) Copyright 2007-2011
++ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
++ * Tom Cubie <tangliang@allwinnertech.com>
++ *
++ * a simple tool to generate bootable image for sunxi platform.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++#include <fcntl.h>
++#include <stdio.h>
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++
++/* boot head definition from sun4i boot code */
++struct boot_file_head {
++ uint32_t b_instruction; /* one intruction jumping to real code */
++ uint8_t magic[8]; /* ="eGON.BT0" or "eGON.BT1", not C-style str */
++ uint32_t check_sum; /* generated by PC */
++ uint32_t length; /* generated by PC */
++ /*
++ * We use a simplified header, only filling in what is needed
++ * by the boot ROM. To be compatible with Allwinner tools we
++ * would need to implement the proper fields here instead of
++ * padding.
++ */
++ uint8_t pad[12]; /* align to 32 bytes */
++};
++
++#define BOOT0_MAGIC "eGON.BT0"
++#define STAMP_VALUE 0x5F0A6C39
++
++/* check sum functon from sun4i boot code */
++int gen_check_sum(struct boot_file_head *head_p)
++{
++ uint32_t length;
++ uint32_t *buf;
++ uint32_t loop;
++ uint32_t i;
++ uint32_t sum;
++
++ length = head_p->length;
++ if ((length & 0x3) != 0) /* must 4-byte-aligned */
++ return -1;
++ buf = (uint32_t *)head_p;
++ head_p->check_sum = STAMP_VALUE; /* fill stamp */
++ loop = length >> 2;
++
++ /* calculate the sum */
++ for (i = 0, sum = 0; i < loop; i++)
++ sum += buf[i];
++
++ /* write back check sum */
++ head_p->check_sum = sum;
++
++ return 0;
++}
++
++#define ALIGN(x, a) __ALIGN_MASK((x), (typeof(x))(a)-1)
++#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
++
++#define SUN4I_SRAM_SIZE 0x7600 /* 0x7748+ is used by BROM */
++#define SRAM_LOAD_MAX_SIZE (SUN4I_SRAM_SIZE - sizeof(struct boot_file_head))
++#define BLOCK_SIZE 512
++
++struct boot_img {
++ struct boot_file_head header;
++ char code[SRAM_LOAD_MAX_SIZE];
++ char pad[BLOCK_SIZE];
++};
++
++int main(int argc, char *argv[])
++{
++ int fd_in, fd_out;
++ struct boot_img img;
++ unsigned file_size;
++ int count;
++
++ if (argc < 2) {
++ printf("\tThis program makes an input bin file to sun4i " \
++ "bootable image.\n" \
++ "\tUsage: %s input_file out_putfile\n", argv[0]);
++ return EXIT_FAILURE;
++ }
++
++ fd_in = open(argv[1], O_RDONLY);
++ if (fd_in < 0) {
++ perror("Open input file");
++ return EXIT_FAILURE;
++ }
++
++ memset(img.pad, 0, BLOCK_SIZE);
++
++ /* get input file size */
++ file_size = lseek(fd_in, 0, SEEK_END);
++
++ if (file_size > SRAM_LOAD_MAX_SIZE) {
++ fprintf(stderr, "ERROR: File too large!\n");
++ return EXIT_FAILURE;
++ }
++
++ fd_out = open(argv[2], O_WRONLY | O_CREAT, 0666);
++ if (fd_out < 0) {
++ perror("Open output file");
++ return EXIT_FAILURE;
++ }
++
++ /* read file to buffer to calculate checksum */
++ lseek(fd_in, 0, SEEK_SET);
++ count = read(fd_in, img.code, file_size);
++ if (count != file_size) {
++ perror("Reading input image");
++ return EXIT_FAILURE;
++ }
++
++ /* fill the header */
++ img.header.b_instruction = /* b instruction */
++ 0xEA000000 | /* jump to the first instr after the header */
++ ((sizeof(struct boot_file_head) / sizeof(int) - 2)
++ & 0x00FFFFFF);
++ memcpy(img.header.magic, BOOT0_MAGIC, 8); /* no '0' termination */
++ img.header.length =
++ ALIGN(file_size + sizeof(struct boot_file_head), BLOCK_SIZE);
++ gen_check_sum(&img.header);
++
++ count = write(fd_out, &img, img.header.length);
++ if (count != img.header.length) {
++ perror("Writing output");
++ return EXIT_FAILURE;
++ }
++
++ close(fd_in);
++ close(fd_out);
++
++ return EXIT_SUCCESS;
++}
+diff -ruN u-boot-2014.04/tools/mksunxiboot.README u-boot-sunxi/tools/mksunxiboot.README
+--- u-boot-2014.04/tools/mksunxiboot.README 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-sunxi/tools/mksunxiboot.README 2014-09-06 16:58:36.529953105 +0200
+@@ -0,0 +1,13 @@
++This program make a arm binary file can be loaded by Allwinner A10 and related
++chips from storage media such as nand and mmc.
++
++More information about A10 boot, please refer to
++http://rhombus-tech.net/allwinner_a10/a10_boot_process/
++
++To compile this program, just type make, you will get 'mksunxiboot'.
++
++To use it,
++$./mksunxiboot u-boot.bin u-boot-mmc.bin
++then you can write it to a mmc card with dd.
++$sudo dd if=u-boot-mmc.bin of=/dev/sdb bs=1024 seek=8
++then insert your mmc card to your A10 tablet, you can boot from mmc card.
--- /dev/null
+From 86f31982ac62e80fe586cad2e0a49a7b22e3d4ee Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:07 +0000
+Subject: [PATCH] ARM: HYP/non-sec: move switch to non-sec to the last boot
+ phase
+
+Having the switch to non-secure in the "prep" phase is causing
+all kind of troubles, as that stage can be called multiple times.
+
+Instead, move the switch to non-secure to the last possible phase,
+when there is no turning back anymore.
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/lib/bootm.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
+index 47ee070..10634a4 100644
+--- a/arch/arm/lib/bootm.c
++++ b/arch/arm/lib/bootm.c
+@@ -242,7 +242,6 @@ static void boot_prep_linux(bootm_headers_t *images)
+ printf("FDT and ATAGS support not compiled in - hanging\n");
+ hang();
+ }
+- do_nonsec_virt_switch();
+ }
+
+ /* Subcommand: GO */
+@@ -287,8 +286,10 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
+ else
+ r2 = gd->bd->bi_boot_params;
+
+- if (!fake)
++ if (!fake) {
++ do_nonsec_virt_switch();
+ kernel_entry(0, machid, r2);
++ }
+ #endif
+ }
+
+From c26d288f6cbc6d53219001d42476f314c403257b Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:08 +0000
+Subject: [PATCH] ARM: HYP/non-sec: add a barrier after setting SCR.NS==1
+
+A CP15 instruction execution can be reordered, requiring an
+isb to be sure it is executed in program order.
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/cpu/armv7/nonsec_virt.S | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/cpu/armv7/nonsec_virt.S b/arch/arm/cpu/armv7/nonsec_virt.S
+index 6367e09..12de5c2 100644
+--- a/arch/arm/cpu/armv7/nonsec_virt.S
++++ b/arch/arm/cpu/armv7/nonsec_virt.S
+@@ -46,6 +46,7 @@ _secure_monitor:
+ #endif
+
+ mcr p15, 0, r1, c1, c1, 0 @ write SCR (with NS bit set)
++ isb
+
+ #ifdef CONFIG_ARMV7_VIRT
+ mrceq p15, 0, r0, c12, c0, 1 @ get MVBAR value
+From 06feeea3c84cc58ff3d5c19f6a430886495f86ce Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:09 +0000
+Subject: [PATCH] ARM: non-sec: reset CNTVOFF to zero
+
+Before switching to non-secure, make sure that CNTVOFF is set
+to zero on all CPUs. Otherwise, kernel running in non-secure
+without HYP enabled (hence using virtual timers) may observe
+timers that are not synchronized, effectively seeing time
+going backward...
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/cpu/armv7/nonsec_virt.S | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/cpu/armv7/nonsec_virt.S b/arch/arm/cpu/armv7/nonsec_virt.S
+index 12de5c2..b5c946f 100644
+--- a/arch/arm/cpu/armv7/nonsec_virt.S
++++ b/arch/arm/cpu/armv7/nonsec_virt.S
+@@ -38,10 +38,10 @@ _secure_monitor:
+ bic r1, r1, #0x4e @ clear IRQ, FIQ, EA, nET bits
+ orr r1, r1, #0x31 @ enable NS, AW, FW bits
+
+-#ifdef CONFIG_ARMV7_VIRT
+ mrc p15, 0, r0, c0, c1, 1 @ read ID_PFR1
+ and r0, r0, #CPUID_ARM_VIRT_MASK @ mask virtualization bits
+ cmp r0, #(1 << CPUID_ARM_VIRT_SHIFT)
++#ifdef CONFIG_ARMV7_VIRT
+ orreq r1, r1, #0x100 @ allow HVC instruction
+ #endif
+
+@@ -52,7 +52,14 @@ _secure_monitor:
+ mrceq p15, 0, r0, c12, c0, 1 @ get MVBAR value
+ mcreq p15, 4, r0, c12, c0, 0 @ write HVBAR
+ #endif
++ bne 1f
+
++ @ Reset CNTVOFF to 0 before leaving monitor mode
++ mrc p15, 0, r0, c0, c1, 1 @ read ID_PFR1
++ ands r0, r0, #CPUID_ARM_GENTIMER_MASK @ test arch timer bits
++ movne r0, #0
++ mcrrne p15, 4, r0, r0, c14 @ Reset CNTVOFF to zero
++1:
+ movs pc, lr @ return to non-secure SVC
+
+ _hyp_trap:
+From 054bcf5147ff5a20298bce5b3bdfbf3e1c797594 Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:10 +0000
+Subject: [PATCH] ARM: add missing HYP mode constant
+
+In order to be able to use the various mode constants (far more
+readable than random hex values), add the missing HYP and A
+values.
+
+Also update arm/lib/interrupts.c to display HYP instead of an
+unknown value.
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/include/asm/proc-armv/ptrace.h | 2 ++
+ arch/arm/lib/interrupts.c | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/include/asm/proc-armv/ptrace.h b/arch/arm/include/asm/proc-armv/ptrace.h
+index 21aef58..71df5a9 100644
+--- a/arch/arm/include/asm/proc-armv/ptrace.h
++++ b/arch/arm/include/asm/proc-armv/ptrace.h
+@@ -38,12 +38,14 @@ struct pt_regs {
+ #define IRQ_MODE 0x12
+ #define SVC_MODE 0x13
+ #define ABT_MODE 0x17
++#define HYP_MODE 0x1a
+ #define UND_MODE 0x1b
+ #define SYSTEM_MODE 0x1f
+ #define MODE_MASK 0x1f
+ #define T_BIT 0x20
+ #define F_BIT 0x40
+ #define I_BIT 0x80
++#define A_BIT 0x100
+ #define CC_V_BIT (1 << 28)
+ #define CC_C_BIT (1 << 29)
+ #define CC_Z_BIT (1 << 30)
+diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c
+index 758b013..f6b7c03 100644
+--- a/arch/arm/lib/interrupts.c
++++ b/arch/arm/lib/interrupts.c
+@@ -103,7 +103,7 @@ void show_regs (struct pt_regs *regs)
+ "UK12_26", "UK13_26", "UK14_26", "UK15_26",
+ "USER_32", "FIQ_32", "IRQ_32", "SVC_32",
+ "UK4_32", "UK5_32", "UK6_32", "ABT_32",
+- "UK8_32", "UK9_32", "UK10_32", "UND_32",
++ "UK8_32", "UK9_32", "HYP_32", "UND_32",
+ "UK12_32", "UK13_32", "UK14_32", "SYS_32",
+ };
+
+From 213a8d9b7e613210d3c7d8b99c95b454ad0527d8 Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:11 +0000
+Subject: [PATCH] ARM: HYP/non-sec: add separate section for secure code
+
+In anticipation of refactoring the HYP/non-secure code to run
+from secure RAM, add a new linker section that will contain that
+code.
+
+Nothing is using it just yet.
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/config.mk | 2 +-
+ arch/arm/cpu/u-boot.lds | 30 ++++++++++++++++++++++++++++++
+ arch/arm/lib/sections.c | 2 ++
+ 3 files changed, 33 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/config.mk b/arch/arm/config.mk
+index 66ecc2e..2bdfca5 100644
+--- a/arch/arm/config.mk
++++ b/arch/arm/config.mk
+@@ -113,7 +113,7 @@ endif
+ ifdef CONFIG_ARM64
+ OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn
+ else
+-OBJCOPYFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn
++OBJCOPYFLAGS += -j .text -j .secure_text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn
+ endif
+
+ ifneq ($(CONFIG_IMX_CONFIG),)
+diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
+index 33c1f99..f45885d 100644
+--- a/arch/arm/cpu/u-boot.lds
++++ b/arch/arm/cpu/u-boot.lds
+@@ -7,6 +7,8 @@
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
++#include <config.h>
++
+ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+ OUTPUT_ARCH(arm)
+ ENTRY(_start)
+@@ -22,6 +24,34 @@ SECTIONS
+ *(.text*)
+ }
+
++#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT) || defined(CONFIG_ARMV7_PSCI)
++
++#ifndef CONFIG_ARMV7_SECURE_BASE
++#define CONFIG_ARMV7_SECURE_BASE
++#endif
++
++ .__secure_start : {
++ . = ALIGN(0x1000);
++ *(.__secure_start)
++ }
++
++ .secure_text CONFIG_ARMV7_SECURE_BASE :
++ AT(ADDR(.__secure_start) + SIZEOF(.__secure_start))
++ {
++ *(._secure.text)
++ }
++
++ . = LOADADDR(.__secure_start) +
++ SIZEOF(.__secure_start) +
++ SIZEOF(.secure_text);
++
++ __secure_end_lma = .;
++ .__secure_end : AT(__secure_end_lma) {
++ *(.__secure_end)
++ LONG(0x1d1071c); /* Must output something to reset LMA */
++ }
++#endif
++
+ . = ALIGN(4);
+ .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+
+diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c
+index 5b30bcb..a1205c3 100644
+--- a/arch/arm/lib/sections.c
++++ b/arch/arm/lib/sections.c
+@@ -25,4 +25,6 @@ char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
+ char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
+ char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start")));
+ char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
++char __secure_start[0] __attribute__((section(".__secure_start")));
++char __secure_end[0] __attribute__((section(".__secure_end")));
+ char _end[0] __attribute__((section(".__end")));
+From d7ebd8f57e84ea92ef0cf55080f0acec9c6d1ace Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:12 +0000
+Subject: [PATCH] ARM: HYP/non-sec: allow relocation to secure RAM
+
+The current non-sec switching code suffers from one major issue:
+it cannot run in secure RAM, as a large part of u-boot still needs
+to be run while we're switched to non-secure.
+
+This patch reworks the whole HYP/non-secure strategy by:
+- making sure the secure code is the *last* thing u-boot executes
+ before entering the payload
+- performing an exception return from secure mode directly into
+ the payload
+- allowing the code to be dynamically relocated to secure RAM
+ before switching to non-secure.
+
+This involves quite a bit of horrible code, specially as u-boot
+relocation is quite primitive.
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/cpu/armv7/nonsec_virt.S | 161 +++++++++++++++++++--------------------
+ arch/arm/cpu/armv7/virt-v7.c | 59 +++++---------
+ arch/arm/include/asm/armv7.h | 10 ++-
+ arch/arm/include/asm/secure.h | 26 +++++++
+ arch/arm/lib/bootm.c | 22 +++---
+ 5 files changed, 138 insertions(+), 140 deletions(-)
+ create mode 100644 arch/arm/include/asm/secure.h
+
+diff --git a/arch/arm/cpu/armv7/nonsec_virt.S b/arch/arm/cpu/armv7/nonsec_virt.S
+index b5c946f..2a43e3c 100644
+--- a/arch/arm/cpu/armv7/nonsec_virt.S
++++ b/arch/arm/cpu/armv7/nonsec_virt.S
+@@ -10,10 +10,13 @@
+ #include <linux/linkage.h>
+ #include <asm/gic.h>
+ #include <asm/armv7.h>
++#include <asm/proc-armv/ptrace.h>
+
+ .arch_extension sec
+ .arch_extension virt
+
++ .pushsection ._secure.text, "ax"
++
+ .align 5
+ /* the vector table for secure state and HYP mode */
+ _monitor_vectors:
+@@ -22,51 +25,86 @@ _monitor_vectors:
+ adr pc, _secure_monitor
+ .word 0
+ .word 0
+- adr pc, _hyp_trap
++ .word 0
+ .word 0
+ .word 0
+
++.macro is_cpu_virt_capable tmp
++ mrc p15, 0, \tmp, c0, c1, 1 @ read ID_PFR1
++ and \tmp, \tmp, #CPUID_ARM_VIRT_MASK @ mask virtualization bits
++ cmp \tmp, #(1 << CPUID_ARM_VIRT_SHIFT)
++.endm
++
+ /*
+ * secure monitor handler
+ * U-boot calls this "software interrupt" in start.S
+ * This is executed on a "smc" instruction, we use a "smc #0" to switch
+ * to non-secure state.
+- * We use only r0 and r1 here, due to constraints in the caller.
++ * r0, r1, r2: passed to the callee
++ * ip: target PC
+ */
+ _secure_monitor:
+- mrc p15, 0, r1, c1, c1, 0 @ read SCR
+- bic r1, r1, #0x4e @ clear IRQ, FIQ, EA, nET bits
+- orr r1, r1, #0x31 @ enable NS, AW, FW bits
++ mrc p15, 0, r5, c1, c1, 0 @ read SCR
++ bic r5, r5, #0x4e @ clear IRQ, FIQ, EA, nET bits
++ orr r5, r5, #0x31 @ enable NS, AW, FW bits
+
+- mrc p15, 0, r0, c0, c1, 1 @ read ID_PFR1
+- and r0, r0, #CPUID_ARM_VIRT_MASK @ mask virtualization bits
+- cmp r0, #(1 << CPUID_ARM_VIRT_SHIFT)
++ mov r6, #SVC_MODE @ default mode is SVC
++ is_cpu_virt_capable r4
+ #ifdef CONFIG_ARMV7_VIRT
+- orreq r1, r1, #0x100 @ allow HVC instruction
++ orreq r5, r5, #0x100 @ allow HVC instruction
++ moveq r6, #HYP_MODE @ Enter the kernel as HYP
+ #endif
+
+- mcr p15, 0, r1, c1, c1, 0 @ write SCR (with NS bit set)
++ mcr p15, 0, r5, c1, c1, 0 @ write SCR (with NS bit set)
+ isb
+
+-#ifdef CONFIG_ARMV7_VIRT
+- mrceq p15, 0, r0, c12, c0, 1 @ get MVBAR value
+- mcreq p15, 4, r0, c12, c0, 0 @ write HVBAR
+-#endif
+ bne 1f
+
+ @ Reset CNTVOFF to 0 before leaving monitor mode
+- mrc p15, 0, r0, c0, c1, 1 @ read ID_PFR1
+- ands r0, r0, #CPUID_ARM_GENTIMER_MASK @ test arch timer bits
+- movne r0, #0
+- mcrrne p15, 4, r0, r0, c14 @ Reset CNTVOFF to zero
++ mrc p15, 0, r4, c0, c1, 1 @ read ID_PFR1
++ ands r4, r4, #CPUID_ARM_GENTIMER_MASK @ test arch timer bits
++ movne r4, #0
++ mcrrne p15, 4, r4, r4, c14 @ Reset CNTVOFF to zero
+ 1:
+- movs pc, lr @ return to non-secure SVC
+-
+-_hyp_trap:
+- mrs lr, elr_hyp @ for older asm: .byte 0x00, 0xe3, 0x0e, 0xe1
+- mov pc, lr @ do no switch modes, but
+- @ return to caller
+-
++ mov lr, ip
++ mov ip, #(F_BIT | I_BIT | A_BIT) @ Set A, I and F
++ tst lr, #1 @ Check for Thumb PC
++ orrne ip, ip, #T_BIT @ Set T if Thumb
++ orr ip, ip, r6 @ Slot target mode in
++ msr spsr_cxfs, ip @ Set full SPSR
++ movs pc, lr @ ERET to non-secure
++
++ENTRY(_do_nonsec_entry)
++ mov ip, r0
++ mov r0, r1
++ mov r1, r2
++ mov r2, r3
++ smc #0
++ENDPROC(_do_nonsec_entry)
++
++.macro get_cbar_addr addr
++#ifdef CONFIG_ARM_GIC_BASE_ADDRESS
++ ldr \addr, =CONFIG_ARM_GIC_BASE_ADDRESS
++#else
++ mrc p15, 4, \addr, c15, c0, 0 @ read CBAR
++ bfc \addr, #0, #15 @ clear reserved bits
++#endif
++.endm
++
++.macro get_gicd_addr addr
++ get_cbar_addr \addr
++ add \addr, \addr, #GIC_DIST_OFFSET @ GIC dist i/f offset
++.endm
++
++.macro get_gicc_addr addr, tmp
++ get_cbar_addr \addr
++ is_cpu_virt_capable \tmp
++ movne \tmp, #GIC_CPU_OFFSET_A9 @ GIC CPU offset for A9
++ moveq \tmp, #GIC_CPU_OFFSET_A15 @ GIC CPU offset for A15/A7
++ add \addr, \addr, \tmp
++.endm
++
++#ifndef CONFIG_ARMV7_PSCI
+ /*
+ * Secondary CPUs start here and call the code for the core specific parts
+ * of the non-secure and HYP mode transition. The GIC distributor specific
+@@ -74,31 +112,21 @@ _hyp_trap:
+ * Then they go back to wfi and wait to be woken up by the kernel again.
+ */
+ ENTRY(_smp_pen)
+- mrs r0, cpsr
+- orr r0, r0, #0xc0
+- msr cpsr, r0 @ disable interrupts
+- ldr r1, =_start
+- mcr p15, 0, r1, c12, c0, 0 @ set VBAR
++ cpsid i
++ cpsid f
+
+ bl _nonsec_init
+- mov r12, r0 @ save GICC address
+-#ifdef CONFIG_ARMV7_VIRT
+- bl _switch_to_hyp
+-#endif
+-
+- ldr r1, [r12, #GICC_IAR] @ acknowledge IPI
+- str r1, [r12, #GICC_EOIR] @ signal end of interrupt
+
+ adr r0, _smp_pen @ do not use this address again
+ b smp_waitloop @ wait for IPIs, board specific
+ ENDPROC(_smp_pen)
++#endif
+
+ /*
+ * Switch a core to non-secure state.
+ *
+ * 1. initialize the GIC per-core interface
+ * 2. allow coprocessor access in non-secure modes
+- * 3. switch the cpu mode (by calling "smc #0")
+ *
+ * Called from smp_pen by secondary cores and directly by the BSP.
+ * Do not assume that the stack is available and only use registers
+@@ -108,38 +136,23 @@ ENDPROC(_smp_pen)
+ * though, but we check this in C before calling this function.
+ */
+ ENTRY(_nonsec_init)
+-#ifdef CONFIG_ARM_GIC_BASE_ADDRESS
+- ldr r2, =CONFIG_ARM_GIC_BASE_ADDRESS
+-#else
+- mrc p15, 4, r2, c15, c0, 0 @ read CBAR
+- bfc r2, #0, #15 @ clear reserved bits
+-#endif
+- add r3, r2, #GIC_DIST_OFFSET @ GIC dist i/f offset
++ get_gicd_addr r3
++
+ mvn r1, #0 @ all bits to 1
+ str r1, [r3, #GICD_IGROUPRn] @ allow private interrupts
+
+- mrc p15, 0, r0, c0, c0, 0 @ read MIDR
+- ldr r1, =MIDR_PRIMARY_PART_MASK
+- and r0, r0, r1 @ mask out variant and revision
++ get_gicc_addr r3, r1
+
+- ldr r1, =MIDR_CORTEX_A7_R0P0 & MIDR_PRIMARY_PART_MASK
+- cmp r0, r1 @ check for Cortex-A7
+-
+- ldr r1, =MIDR_CORTEX_A15_R0P0 & MIDR_PRIMARY_PART_MASK
+- cmpne r0, r1 @ check for Cortex-A15
+-
+- movne r1, #GIC_CPU_OFFSET_A9 @ GIC CPU offset for A9
+- moveq r1, #GIC_CPU_OFFSET_A15 @ GIC CPU offset for A15/A7
+- add r3, r2, r1 @ r3 = GIC CPU i/f addr
+-
+- mov r1, #1 @ set GICC_CTLR[enable]
++ mov r1, #3 @ Enable both groups
+ str r1, [r3, #GICC_CTLR] @ and clear all other bits
+ mov r1, #0xff
+ str r1, [r3, #GICC_PMR] @ set priority mask register
+
++ mrc p15, 0, r0, c1, c1, 2
+ movw r1, #0x3fff
+- movt r1, #0x0006
+- mcr p15, 0, r1, c1, c1, 2 @ NSACR = all copros to non-sec
++ movt r1, #0x0004
++ orr r0, r0, r1
++ mcr p15, 0, r0, c1, c1, 2 @ NSACR = all copros to non-sec
+
+ /* The CNTFRQ register of the generic timer needs to be
+ * programmed in secure state. Some primary bootloaders / firmware
+@@ -157,21 +170,9 @@ ENTRY(_nonsec_init)
+
+ adr r1, _monitor_vectors
+ mcr p15, 0, r1, c12, c0, 1 @ set MVBAR to secure vectors
+-
+- mrc p15, 0, ip, c12, c0, 0 @ save secure copy of VBAR
+-
+ isb
+- smc #0 @ call into MONITOR mode
+-
+- mcr p15, 0, ip, c12, c0, 0 @ write non-secure copy of VBAR
+-
+- mov r1, #1
+- str r1, [r3, #GICC_CTLR] @ enable non-secure CPU i/f
+- add r2, r2, #GIC_DIST_OFFSET
+- str r1, [r2, #GICD_CTLR] @ allow private interrupts
+
+ mov r0, r3 @ return GICC address
+-
+ bx lr
+ ENDPROC(_nonsec_init)
+
+@@ -183,18 +184,10 @@ ENTRY(smp_waitloop)
+ ldr r1, [r1]
+ cmp r0, r1 @ make sure we dont execute this code
+ beq smp_waitloop @ again (due to a spurious wakeup)
+- mov pc, r1
++ mov r0, r1
++ b _do_nonsec_entry
+ ENDPROC(smp_waitloop)
+ .weak smp_waitloop
+ #endif
+
+-ENTRY(_switch_to_hyp)
+- mov r0, lr
+- mov r1, sp @ save SVC copy of LR and SP
+- isb
+- hvc #0 @ for older asm: .byte 0x70, 0x00, 0x40, 0xe1
+- mov sp, r1
+- mov lr, r0 @ restore SVC copy of LR and SP
+-
+- bx lr
+-ENDPROC(_switch_to_hyp)
++ .popsection
+diff --git a/arch/arm/cpu/armv7/virt-v7.c b/arch/arm/cpu/armv7/virt-v7.c
+index 2cd604f..6500030 100644
+--- a/arch/arm/cpu/armv7/virt-v7.c
++++ b/arch/arm/cpu/armv7/virt-v7.c
+@@ -13,17 +13,10 @@
+ #include <asm/armv7.h>
+ #include <asm/gic.h>
+ #include <asm/io.h>
++#include <asm/secure.h>
+
+ unsigned long gic_dist_addr;
+
+-static unsigned int read_cpsr(void)
+-{
+- unsigned int reg;
+-
+- asm volatile ("mrs %0, cpsr\n" : "=r" (reg));
+- return reg;
+-}
+-
+ static unsigned int read_id_pfr1(void)
+ {
+ unsigned int reg;
+@@ -72,6 +65,18 @@ static unsigned long get_gicd_base_address(void)
+ #endif
+ }
+
++static void relocate_secure_section(void)
++{
++#ifdef CONFIG_ARMV7_SECURE_BASE
++ size_t sz = __secure_end - __secure_start;
++
++ memcpy((void *)CONFIG_ARMV7_SECURE_BASE, __secure_start, sz);
++ flush_dcache_range(CONFIG_ARMV7_SECURE_BASE,
++ CONFIG_ARMV7_SECURE_BASE + sz + 1);
++ invalidate_icache_all();
++#endif
++}
++
+ static void kick_secondary_cpus_gic(unsigned long gicdaddr)
+ {
+ /* kick all CPUs (except this one) by writing to GICD_SGIR */
+@@ -83,35 +88,7 @@ void __weak smp_kick_all_cpus(void)
+ kick_secondary_cpus_gic(gic_dist_addr);
+ }
+
+-int armv7_switch_hyp(void)
+-{
+- unsigned int reg;
+-
+- /* check whether we are in HYP mode already */
+- if ((read_cpsr() & 0x1f) == 0x1a) {
+- debug("CPU already in HYP mode\n");
+- return 0;
+- }
+-
+- /* check whether the CPU supports the virtualization extensions */
+- reg = read_id_pfr1();
+- if ((reg & CPUID_ARM_VIRT_MASK) != 1 << CPUID_ARM_VIRT_SHIFT) {
+- printf("HYP mode: Virtualization extensions not implemented.\n");
+- return -1;
+- }
+-
+- /* call the HYP switching code on this CPU also */
+- _switch_to_hyp();
+-
+- if ((read_cpsr() & 0x1F) != 0x1a) {
+- printf("HYP mode: switch not successful.\n");
+- return -1;
+- }
+-
+- return 0;
+-}
+-
+-int armv7_switch_nonsec(void)
++int armv7_init_nonsec(void)
+ {
+ unsigned int reg;
+ unsigned itlinesnr, i;
+@@ -147,11 +124,13 @@ int armv7_switch_nonsec(void)
+ for (i = 1; i <= itlinesnr; i++)
+ writel((unsigned)-1, gic_dist_addr + GICD_IGROUPRn + 4 * i);
+
+- smp_set_core_boot_addr((unsigned long)_smp_pen, -1);
++#ifndef CONFIG_ARMV7_PSCI
++ smp_set_core_boot_addr((unsigned long)secure_ram_addr(_smp_pen), -1);
+ smp_kick_all_cpus();
++#endif
+
+ /* call the non-sec switching code on this CPU also */
+- _nonsec_init();
+-
++ relocate_secure_section();
++ secure_ram_addr(_nonsec_init)();
+ return 0;
+ }
+diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
+index 395444e..11476dd 100644
+--- a/arch/arm/include/asm/armv7.h
++++ b/arch/arm/include/asm/armv7.h
+@@ -78,13 +78,17 @@ void v7_outer_cache_inval_range(u32 start, u32 end);
+
+ #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+
+-int armv7_switch_nonsec(void);
+-int armv7_switch_hyp(void);
++int armv7_init_nonsec(void);
+
+ /* defined in assembly file */
+ unsigned int _nonsec_init(void);
++void _do_nonsec_entry(void *target_pc, unsigned long r0,
++ unsigned long r1, unsigned long r2);
+ void _smp_pen(void);
+-void _switch_to_hyp(void);
++
++extern char __secure_start[];
++extern char __secure_end[];
++
+ #endif /* CONFIG_ARMV7_NONSEC || CONFIG_ARMV7_VIRT */
+
+ #endif /* ! __ASSEMBLY__ */
+diff --git a/arch/arm/include/asm/secure.h b/arch/arm/include/asm/secure.h
+new file mode 100644
+index 0000000..effdb18
+--- /dev/null
++++ b/arch/arm/include/asm/secure.h
+@@ -0,0 +1,26 @@
++#ifndef __ASM_SECURE_H
++#define __ASM_SECURE_H
++
++#include <config.h>
++
++#ifdef CONFIG_ARMV7_SECURE_BASE
++/*
++ * Warning, horror ahead.
++ *
++ * The target code lives in our "secure ram", but u-boot doesn't know
++ * that, and has blindly added reloc_off to every relocation
++ * entry. Gahh. Do the opposite conversion. This hack also prevents
++ * GCC from generating code veeners, which u-boot doesn't relocate at
++ * all...
++ */
++#define secure_ram_addr(_fn) ({ \
++ DECLARE_GLOBAL_DATA_PTR; \
++ void *__fn = _fn; \
++ typeof(_fn) *__tmp = (__fn - gd->reloc_off); \
++ __tmp; \
++ })
++#else
++#define secure_ram_addr(_fn) (_fn)
++#endif
++
++#endif
+diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
+index 10634a4..61aa14e 100644
+--- a/arch/arm/lib/bootm.c
++++ b/arch/arm/lib/bootm.c
+@@ -20,6 +20,7 @@
+ #include <libfdt.h>
+ #include <fdt_support.h>
+ #include <asm/bootm.h>
++#include <asm/secure.h>
+ #include <linux/compiler.h>
+
+ #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+@@ -184,27 +185,17 @@ static void setup_end_tag(bd_t *bd)
+
+ __weak void setup_board_tags(struct tag **in_params) {}
+
++#ifdef CONFIG_ARM64
+ static void do_nonsec_virt_switch(void)
+ {
+-#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+- if (armv7_switch_nonsec() == 0)
+-#ifdef CONFIG_ARMV7_VIRT
+- if (armv7_switch_hyp() == 0)
+- debug("entered HYP mode\n");
+-#else
+- debug("entered non-secure state\n");
+-#endif
+-#endif
+-
+-#ifdef CONFIG_ARM64
+ smp_kick_all_cpus();
+ flush_dcache_all(); /* flush cache before swtiching to EL2 */
+ armv8_switch_to_el2();
+ #ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+ armv8_switch_to_el1();
+ #endif
+-#endif
+ }
++#endif
+
+ /* Subcommand: PREP */
+ static void boot_prep_linux(bootm_headers_t *images)
+@@ -287,8 +278,13 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
+ r2 = gd->bd->bi_boot_params;
+
+ if (!fake) {
+- do_nonsec_virt_switch();
++#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
++ armv7_init_nonsec();
++ secure_ram_addr(_do_nonsec_entry)(kernel_entry,
++ 0, machid, r2);
++#else
+ kernel_entry(0, machid, r2);
++#endif
+ }
+ #endif
+ }
+From 8ea1554da4a6e556d3213a77cf59daa1c154bdb5 Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:13 +0000
+Subject: [PATCH] ARM: HYP/non-sec: add generic ARMv7 PSCI code
+
+Implement core support for PSCI. As this is generic code, it doesn't
+implement anything really useful (all the functions are returning
+Not Implemented).
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/cpu/armv7/Makefile | 4 ++
+ arch/arm/cpu/armv7/psci.S | 105 ++++++++++++++++++++++++++++++++++++++++++++
+ arch/arm/include/asm/psci.h | 35 +++++++++++++++
+ 3 files changed, 144 insertions(+)
+ create mode 100644 arch/arm/cpu/armv7/psci.S
+ create mode 100644 arch/arm/include/asm/psci.h
+
+diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
+index 6f17771..0cf5c45 100644
+--- a/arch/arm/cpu/armv7/Makefile
++++ b/arch/arm/cpu/armv7/Makefile
+@@ -24,6 +24,10 @@ obj-y += nonsec_virt.o
+ obj-y += virt-v7.o
+ endif
+
++ifneq ($(CONFIG_ARMV7_PSCI),)
++obj-y += psci.o
++endif
++
+ obj-$(CONFIG_KONA) += kona-common/
+ obj-$(CONFIG_OMAP_COMMON) += omap-common/
+ obj-$(CONFIG_TEGRA) += tegra-common/
+diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S
+new file mode 100644
+index 0000000..a9341e0
+--- /dev/null
++++ b/arch/arm/cpu/armv7/psci.S
+@@ -0,0 +1,105 @@
++/*
++ * Copyright (C) 2013 - ARM Ltd
++ * Author: Marc Zyngier <marc.zyngier@arm.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <config.h>
++#include <linux/linkage.h>
++#include <asm/psci.h>
++
++ .pushsection ._secure.text, "ax"
++
++ .arch_extension sec
++
++ .align 5
++ .globl _psci_vectors
++_psci_vectors:
++ b default_psci_vector @ reset
++ b default_psci_vector @ undef
++ b _smc_psci @ smc
++ b default_psci_vector @ pabort
++ b default_psci_vector @ dabort
++ b default_psci_vector @ hyp
++ b default_psci_vector @ irq
++ b psci_fiq_enter @ fiq
++
++ENTRY(psci_fiq_enter)
++ movs pc, lr
++ENDPROC(psci_fiq_enter)
++.weak psci_fiq_enter
++
++ENTRY(default_psci_vector)
++ movs pc, lr
++ENDPROC(default_psci_vector)
++.weak default_psci_vector
++
++ENTRY(psci_cpu_suspend)
++ENTRY(psci_cpu_off)
++ENTRY(psci_cpu_on)
++ENTRY(psci_migrate)
++ mov r0, #ARM_PSCI_RET_NI @ Return -1 (Not Implemented)
++ mov pc, lr
++ENDPROC(psci_migrate)
++ENDPROC(psci_cpu_on)
++ENDPROC(psci_cpu_off)
++ENDPROC(psci_cpu_suspend)
++.weak psci_cpu_suspend
++.weak psci_cpu_off
++.weak psci_cpu_on
++.weak psci_migrate
++
++_psci_table:
++ .word ARM_PSCI_FN_CPU_SUSPEND
++ .word psci_cpu_suspend
++ .word ARM_PSCI_FN_CPU_OFF
++ .word psci_cpu_off
++ .word ARM_PSCI_FN_CPU_ON
++ .word psci_cpu_on
++ .word ARM_PSCI_FN_MIGRATE
++ .word psci_migrate
++ .word 0
++ .word 0
++
++_smc_psci:
++ push {r3-r7,lr}
++
++ @ Switch to secure
++ mrc p15, 0, r7, c1, c1, 0
++ bic r4, r7, #1
++ mcr p15, 0, r4, c1, c1, 0
++ isb
++
++ adr r4, _psci_table
++1: ldr r5, [r4] @ Load PSCI function ID
++ ldr r6, [r4, #4] @ Load target PC
++ cmp r5, #0 @ If reach the end, bail out
++ mvneq r0, #0 @ Return -1 (Not Implemented)
++ beq 2f
++ cmp r0, r5 @ If not matching, try next entry
++ addne r4, r4, #8
++ bne 1b
++ cmp r6, #0 @ Not implemented
++ moveq r0, #ARM_PSCI_RET_NI
++ beq 2f
++
++ blx r6 @ Execute PSCI function
++
++ @ Switch back to non-secure
++ mcr p15, 0, r7, c1, c1, 0
++
++2: pop {r3-r7, lr}
++ movs pc, lr @ Return to the kernel
++
++ .popsection
+diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
+new file mode 100644
+index 0000000..704b4b0
+--- /dev/null
++++ b/arch/arm/include/asm/psci.h
+@@ -0,0 +1,35 @@
++/*
++ * Copyright (C) 2013 - ARM Ltd
++ * Author: Marc Zyngier <marc.zyngier@arm.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#ifndef __ARM_PSCI_H__
++#define __ARM_PSCI_H__
++
++/* PSCI interface */
++#define ARM_PSCI_FN_BASE 0x95c1ba5e
++#define ARM_PSCI_FN(n) (ARM_PSCI_FN_BASE + (n))
++
++#define ARM_PSCI_FN_CPU_SUSPEND ARM_PSCI_FN(0)
++#define ARM_PSCI_FN_CPU_OFF ARM_PSCI_FN(1)
++#define ARM_PSCI_FN_CPU_ON ARM_PSCI_FN(2)
++#define ARM_PSCI_FN_MIGRATE ARM_PSCI_FN(3)
++
++#define ARM_PSCI_RET_SUCCESS 0
++#define ARM_PSCI_RET_NI (-1)
++#define ARM_PSCI_RET_INVAL (-2)
++#define ARM_PSCI_RET_DENIED (-3)
++
++#endif /* __ARM_PSCI_H__ */
+From 0ca6171c385fed00125b320592ee94922f44f13a Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:14 +0000
+Subject: [PATCH] ARM: HYP/non-sec: add the option for a second-stage monitor
+
+Allow the switch to a second stage secure monitor just before
+switching to non-secure.
+
+This allows a resident piece of firmware to be active once the
+kernel has been entered (the u-boot monitor is dead anyway,
+its pages being reused).
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/cpu/armv7/nonsec_virt.S | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/cpu/armv7/nonsec_virt.S b/arch/arm/cpu/armv7/nonsec_virt.S
+index 2a43e3c..745670e 100644
+--- a/arch/arm/cpu/armv7/nonsec_virt.S
++++ b/arch/arm/cpu/armv7/nonsec_virt.S
+@@ -44,10 +44,19 @@ _monitor_vectors:
+ * ip: target PC
+ */
+ _secure_monitor:
++#ifdef CONFIG_ARMV7_PSCI
++ ldr r5, =_psci_vectors @ Switch to the next monitor
++ mcr p15, 0, r5, c12, c0, 1
++ isb
++
++ @ Obtain a secure stack, and configure the PSCI backend
++ bl psci_arch_init
++#endif
++
+ mrc p15, 0, r5, c1, c1, 0 @ read SCR
+- bic r5, r5, #0x4e @ clear IRQ, FIQ, EA, nET bits
++ bic r5, r5, #0x4a @ clear IRQ, EA, nET bits
+ orr r5, r5, #0x31 @ enable NS, AW, FW bits
+-
++ @ FIQ preserved for secure mode
+ mov r6, #SVC_MODE @ default mode is SVC
+ is_cpu_virt_capable r4
+ #ifdef CONFIG_ARMV7_VIRT
+From 9aa373162eb2cc0055a6e4ecd46977c911de1124 Mon Sep 17 00:00:00 2001
+From: Ma Haijun <mahaijuns@gmail.com>
+Date: Sat, 15 Feb 2014 12:51:10 +0000
+Subject: [PATCH] ARM: convert arch_fixup_memory_node to a generic FDT fixup
+ function
+
+Some architecture needs extra device tree setup. Instead of adding
+yet another hook, convert arch_fixup_memory_node to be a generic
+FDT fixup function.
+
+[maz: collapsed 3 patches into one, rewrote commit message]
+
+Signed-off-by: Ma Haijun <mahaijuns@gmail.com>
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/lib/bootm-fdt.c | 2 +-
+ arch/arm/lib/bootm.c | 2 +-
+ common/image-fdt.c | 7 +++++--
+ include/common.h | 6 +++---
+ 4 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
+index e40691d..8394e15 100644
+--- a/arch/arm/lib/bootm-fdt.c
++++ b/arch/arm/lib/bootm-fdt.c
+@@ -20,7 +20,7 @@
+
+ DECLARE_GLOBAL_DATA_PTR;
+
+-int arch_fixup_memory_node(void *blob)
++int arch_fixup_fdt(void *blob)
+ {
+ bd_t *bd = gd->bd;
+ int bank;
+diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
+index 61aa14e..4cff6b0 100644
+--- a/arch/arm/lib/bootm.c
++++ b/arch/arm/lib/bootm.c
+@@ -357,7 +357,7 @@ void boot_prep_vxworks(bootm_headers_t *images)
+ if (images->ft_addr) {
+ off = fdt_path_offset(images->ft_addr, "/memory");
+ if (off < 0) {
+- if (arch_fixup_memory_node(images->ft_addr))
++ if (arch_fixup_fdt(images->ft_addr))
+ puts("## WARNING: fixup memory failed!\n");
+ }
+ }
+diff --git a/common/image-fdt.c b/common/image-fdt.c
+index a54a919..6f074de 100644
+--- a/common/image-fdt.c
++++ b/common/image-fdt.c
+@@ -445,7 +445,7 @@ __weak int ft_verify_fdt(void *fdt)
+ return 1;
+ }
+
+-__weak int arch_fixup_memory_node(void *blob)
++__weak int arch_fixup_fdt(void *blob)
+ {
+ return 0;
+ }
+@@ -462,7 +462,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
+ puts(" - must RESET the board to recover.\n");
+ return -1;
+ }
+- arch_fixup_memory_node(blob);
++ if (arch_fixup_fdt(blob) < 0) {
++ puts("ERROR: arch specific fdt fixup failed");
++ return -1;
++ }
+ if (IMAGE_OF_BOARD_SETUP)
+ ft_board_setup(blob, gd->bd);
+ fdt_fixup_ethernet(blob);
+diff --git a/include/common.h b/include/common.h
+index cbd3c9e..700b015 100644
+--- a/include/common.h
++++ b/include/common.h
+@@ -326,14 +326,14 @@ int arch_early_init_r(void);
+ void board_show_dram(ulong size);
+
+ /**
+- * arch_fixup_memory_node() - Write arch-specific memory information to fdt
++ * arch_fixup_fdt() - Write arch-specific information to fdt
+ *
+- * Defined in arch/$(ARCH)/lib/bootm.c
++ * Defined in arch/$(ARCH)/lib/bootm-fdt.c
+ *
+ * @blob: FDT blob to write to
+ * @return 0 if ok, or -ve FDT_ERR_... on failure
+ */
+-int arch_fixup_memory_node(void *blob);
++int arch_fixup_fdt(void *blob);
+
+ /* common/flash.c */
+ void flash_perror (int);
+From ccdf689da800c9f1c5226146e936b071c7ec8800 Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:15 +0000
+Subject: [PATCH] ARM: HYP/non-sec/PSCI: emit DT nodes
+
+Generate the PSCI node in the device tree.
+
+Also add a reserve section for the "secure" code that lives in
+in normal RAM, so that the kernel knows it'd better not trip on
+it.
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/cpu/armv7/Makefile | 1 +
+ arch/arm/cpu/armv7/virt-dt.c | 100 +++++++++++++++++++++++++++++++++++++++++++
+ arch/arm/include/asm/armv7.h | 1 +
+ arch/arm/lib/bootm-fdt.c | 11 ++++-
+ 4 files changed, 111 insertions(+), 2 deletions(-)
+ create mode 100644 arch/arm/cpu/armv7/virt-dt.c
+
+diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
+index 0cf5c45..93a5a69 100644
+--- a/arch/arm/cpu/armv7/Makefile
++++ b/arch/arm/cpu/armv7/Makefile
+@@ -22,6 +22,7 @@ endif
+ ifneq ($(CONFIG_ARMV7_NONSEC)$(CONFIG_ARMV7_VIRT),)
+ obj-y += nonsec_virt.o
+ obj-y += virt-v7.o
++obj-y += virt-dt.o
+ endif
+
+ ifneq ($(CONFIG_ARMV7_PSCI),)
+diff --git a/arch/arm/cpu/armv7/virt-dt.c b/arch/arm/cpu/armv7/virt-dt.c
+new file mode 100644
+index 0000000..0b0d6a7
+--- /dev/null
++++ b/arch/arm/cpu/armv7/virt-dt.c
+@@ -0,0 +1,100 @@
++/*
++ * Copyright (C) 2013 - ARM Ltd
++ * Author: Marc Zyngier <marc.zyngier@arm.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <common.h>
++#include <stdio_dev.h>
++#include <linux/ctype.h>
++#include <linux/types.h>
++#include <asm/global_data.h>
++#include <libfdt.h>
++#include <fdt_support.h>
++#include <asm/armv7.h>
++#include <asm/psci.h>
++
++static int fdt_psci(void *fdt)
++{
++#ifdef CONFIG_ARMV7_PSCI
++ int nodeoff;
++ int tmp;
++
++ nodeoff = fdt_path_offset(fdt, "/cpus");
++ if (nodeoff < 0) {
++ printf("couldn't find /cpus\n");
++ return nodeoff;
++ }
++
++ /* add 'enable-method = "psci"' to each cpu node */
++ for (tmp = fdt_first_subnode(fdt, nodeoff);
++ tmp >= 0;
++ tmp = fdt_next_subnode(fdt, tmp)) {
++ const struct fdt_property *prop;
++ int len;
++
++ prop = fdt_get_property(fdt, tmp, "device_type", &len);
++ if (!prop)
++ continue;
++ if (len < 4)
++ continue;
++ if (strcmp(prop->data, "cpu"))
++ continue;
++
++ fdt_setprop_string(fdt, tmp, "enable-method", "psci");
++ }
++
++ nodeoff = fdt_path_offset(fdt, "/psci");
++ if (nodeoff < 0) {
++ nodeoff = fdt_path_offset(fdt, "/");
++ if (nodeoff < 0)
++ return nodeoff;
++
++ nodeoff = fdt_add_subnode(fdt, nodeoff, "psci");
++ if (nodeoff < 0)
++ return nodeoff;
++ }
++
++ tmp = fdt_setprop_string(fdt, nodeoff, "compatible", "arm,psci");
++ if (tmp)
++ return tmp;
++ tmp = fdt_setprop_string(fdt, nodeoff, "method", "smc");
++ if (tmp)
++ return tmp;
++ tmp = fdt_setprop_u32(fdt, nodeoff, "cpu_suspend", ARM_PSCI_FN_CPU_SUSPEND);
++ if (tmp)
++ return tmp;
++ tmp = fdt_setprop_u32(fdt, nodeoff, "cpu_off", ARM_PSCI_FN_CPU_OFF);
++ if (tmp)
++ return tmp;
++ tmp = fdt_setprop_u32(fdt, nodeoff, "cpu_on", ARM_PSCI_FN_CPU_ON);
++ if (tmp)
++ return tmp;
++ tmp = fdt_setprop_u32(fdt, nodeoff, "migrate", ARM_PSCI_FN_MIGRATE);
++ if (tmp)
++ return tmp;
++#endif
++ return 0;
++}
++
++int armv7_update_dt(void *fdt)
++{
++#ifndef CONFIG_ARMV7_SECURE_BASE
++ /* secure code lives in RAM, keep it alive */
++ fdt_add_mem_rsv(fdt, (unsigned long)__secure_start,
++ __secure_end - __secure_start);
++#endif
++
++ return fdt_psci(fdt);
++}
+diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
+index 11476dd..323f282 100644
+--- a/arch/arm/include/asm/armv7.h
++++ b/arch/arm/include/asm/armv7.h
+@@ -79,6 +79,7 @@ void v7_outer_cache_inval_range(u32 start, u32 end);
+ #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+
+ int armv7_init_nonsec(void);
++int armv7_update_dt(void *fdt);
+
+ /* defined in assembly file */
+ unsigned int _nonsec_init(void);
+diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
+index 8394e15..ccb76c7 100644
+--- a/arch/arm/lib/bootm-fdt.c
++++ b/arch/arm/lib/bootm-fdt.c
+@@ -17,13 +17,14 @@
+
+ #include <common.h>
+ #include <fdt_support.h>
++#include <asm/armv7.h>
+
+ DECLARE_GLOBAL_DATA_PTR;
+
+ int arch_fixup_fdt(void *blob)
+ {
+ bd_t *bd = gd->bd;
+- int bank;
++ int bank, ret;
+ u64 start[CONFIG_NR_DRAM_BANKS];
+ u64 size[CONFIG_NR_DRAM_BANKS];
+
+@@ -32,5 +33,11 @@ int arch_fixup_fdt(void *blob)
+ size[bank] = bd->bi_dram[bank].size;
+ }
+
+- return fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
++ ret = fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
++ if (ret)
++ return ret;
++
++#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
++ return armv7_update_dt(blob);
++#endif
+ }
+From d5ee64675e6481e4f29e48e494ea132cd74786c8 Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:17 +0000
+Subject: [PATCH] sunxi: HYP/non-sec: add sun7i PSCI backend
+
+So far, only supporting the CPU_ON method.
+Other functions can be added later.
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ arch/arm/cpu/armv7/sunxi/Makefile | 3 +
+ arch/arm/cpu/armv7/sunxi/psci.S | 162 ++++++++++++++++++++++++++++++++++++++
+ include/configs/sun7i.h | 6 ++
+ 3 files changed, 171 insertions(+)
+ create mode 100644 arch/arm/cpu/armv7/sunxi/psci.S
+
+diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile
+index 19e4b17..0df6772 100644
+--- a/arch/arm/cpu/armv7/sunxi/Makefile
++++ b/arch/arm/cpu/armv7/sunxi/Makefile
+@@ -32,6 +32,9 @@ obj-y += cpu_info.o
+ ifdef CONFIG_CMD_WATCHDOG
+ obj-$(CONFIG_CMD_WATCHDOG) += cmd_watchdog.o
+ endif
++ifdef CONFIG_ARMV7_PSCI
++obj-y += psci.o
++endif
+ endif
+
+ ifdef CONFIG_SPL_BUILD
+diff --git a/arch/arm/cpu/armv7/sunxi/psci.S b/arch/arm/cpu/armv7/sunxi/psci.S
+new file mode 100644
+index 0000000..0084c81
+--- /dev/null
++++ b/arch/arm/cpu/armv7/sunxi/psci.S
+@@ -0,0 +1,162 @@
++/*
++ * Copyright (C) 2013 - ARM Ltd
++ * Author: Marc Zyngier <marc.zyngier@arm.com>
++ *
++ * Based on code by Carl van Schaik <carl@ok-labs.com>.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <config.h>
++#include <asm/psci.h>
++#include <asm/arch/cpu.h>
++
++/*
++ * Memory layout:
++ *
++ * SECURE_RAM to text_end :
++ * ._secure_text section
++ * text_end to ALIGN_PAGE(text_end):
++ * nothing
++ * ALIGN_PAGE(text_end) to ALIGN_PAGE(text_end) + 0x1000)
++ * 1kB of stack per CPU (4 CPUs max).
++ */
++
++ .pushsection ._secure.text, "ax"
++
++ .arch_extension sec
++
++#define ONE_MS (CONFIG_SYS_CLK_FREQ / 1000)
++#define TEN_MS (10 * ONE_MS)
++
++.macro timer_wait reg, ticks
++ @ Program CNTP_TVAL
++ movw \reg, #(\ticks & 0xffff)
++ movt \reg, #(\ticks >> 16)
++ mcr p15, 0, \reg, c14, c2, 0
++ isb
++ @ Enable physical timer, mask interrupt
++ mov \reg, #3
++ mcr p15, 0, \reg, c14, c2, 1
++ @ Poll physical timer until ISTATUS is on
++1: isb
++ mrc p15, 0, \reg, c14, c2, 1
++ ands \reg, \reg, #4
++ bne 1b
++ @ Disable timer
++ mov \reg, #0
++ mcr p15, 0, \reg, c14, c2, 1
++ isb
++.endm
++
++.globl psci_arch_init
++psci_arch_init:
++ mrc p15, 0, r5, c1, c1, 0 @ Read SCR
++ bic r5, r5, #1 @ Secure mode
++ mcr p15, 0, r5, c1, c1, 0 @ Write SCR
++ isb
++
++ mrc p15, 0, r4, c0, c0, 5 @ MPIDR
++ and r4, r4, #3 @ cpu number in cluster
++ mov r5, #400 @ 1kB of stack per CPU
++ mul r4, r4, r5
++
++ adr r5, text_end @ end of text
++ add r5, r5, #0x2000 @ Skip two pages
++ lsr r5, r5, #12 @ Align to start of page
++ lsl r5, r5, #12
++ sub sp, r5, r4 @ here's our stack!
++
++ bx lr
++
++ @ r1 = target CPU
++ @ r2 = target PC
++.globl psci_cpu_on
++psci_cpu_on:
++ adr r0, _target_pc
++ str r2, [r0]
++ dsb
++
++ movw r0, #(SUNXI_CPUCFG_BASE & 0xffff)
++ movt r0, #(SUNXI_CPUCFG_BASE >> 16)
++
++ @ CPU mask
++ and r1, r1, #3 @ only care about first cluster
++ mov r4, #1
++ lsl r4, r4, r1
++
++ adr r6, _sunxi_cpu_entry
++ str r6, [r0, #0x1a4] @ PRIVATE_REG (boot vector)
++
++ @ Assert reset on target CPU
++ mov r6, #0
++ lsl r5, r1, #6 @ 64 bytes per CPU
++ add r5, r5, #0x40 @ Offset from base
++ add r5, r5, r0 @ CPU control block
++ str r6, [r5] @ Reset CPU
++
++ @ l1 invalidate
++ ldr r6, [r0, #0x184]
++ bic r6, r6, r4
++ str r6, [r0, #0x184]
++
++ @ Lock CPU
++ ldr r6, [r0, #0x1e4]
++ bic r6, r6, r4
++ str r6, [r0, #0x1e4]
++
++ @ Release power clamp
++ movw r6, #0x1ff
++ movt r6, #0
++1: lsrs r6, r6, #1
++ str r6, [r0, #0x1b0]
++ bne 1b
++
++ timer_wait r1, TEN_MS
++
++ @ Clear power gating
++ ldr r6, [r0, #0x1b4]
++ bic r6, r6, #1
++ str r6, [r0, #0x1b4]
++
++ @ Deassert reset on target CPU
++ mov r6, #3
++ str r6, [r5]
++
++ @ Unlock CPU
++ ldr r6, [r0, #0x1e4]
++ orr r6, r6, r4
++ str r6, [r0, #0x1e4]
++
++ mov r0, #ARM_PSCI_RET_SUCCESS @ Return PSCI_RET_SUCCESS
++ mov pc, lr
++
++_target_pc:
++ .word 0
++
++_sunxi_cpu_entry:
++ @ Set SMP bit
++ mrc p15, 0, r0, c1, c0, 1
++ orr r0, r0, #0x40
++ mcr p15, 0, r0, c1, c0, 1
++ isb
++
++ bl _nonsec_init
++ bl psci_arch_init
++
++ adr r0, _target_pc
++ ldr r0, [r0]
++ b _do_nonsec_entry
++
++text_end:
++ .popsection
+diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
+index 11cc9ea..bae7b37 100644
+--- a/include/configs/sun7i.h
++++ b/include/configs/sun7i.h
+@@ -22,6 +22,12 @@
+ #define CONFIG_BOARD_POSTCLK_INIT 1
+ #endif
+
++#define CONFIG_ARMV7_VIRT 1
++#define CONFIG_ARMV7_NONSEC 1
++#define CONFIG_ARMV7_PSCI 1
++#define CONFIG_ARMV7_PSCI_NR_CPUS 2
++#define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_B_BASE
++
+ /*
+ * Include common sunxi configuration where most the settings are
+ */
+From a74a847c3727209a45c30a80c01b930938941dd4 Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Sat, 7 Dec 2013 11:19:18 +0000
+Subject: [PATCH] sunxi: HYP/non-sec: configure CNTFRQ on all CPUs
+
+CNTFRQ needs to be properly configured on all CPUs. Otherwise,
+virtual machines hoping to find valuable information on secondary
+CPUs will be disapointed...
+
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+---
+ include/configs/sun7i.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
+index bae7b37..58a254b 100644
+--- a/include/configs/sun7i.h
++++ b/include/configs/sun7i.h
+@@ -27,6 +27,7 @@
+ #define CONFIG_ARMV7_PSCI 1
+ #define CONFIG_ARMV7_PSCI_NR_CPUS 2
+ #define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_B_BASE
++#define CONFIG_SYS_CLK_FREQ 24000000
+
+ /*
+ * Include common sunxi configuration where most the settings are
--- /dev/null
+diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c
+index e7ff952..f58c963 100644
+--- a/board/sunxi/gmac.c
++++ b/board/sunxi/gmac.c
+@@ -24,6 +24,15 @@ int sunxi_gmac_initialize(bd_t *bis)
+ CCM_GMAC_CTRL_GPIT_MII);
+ #endif
+
++ /*
++ * HdG: this is necessary to get GMAC to work reliable on the
++ * Bananapi. We don't know what these undocumented bits do, so this
++ * is a Bananapi specific hack for now.
++ */
++#ifdef CONFIG_BANANAPI
++ setbits_le32(&ccm->gmac_clk_cfg, 0x3 << 10);
++#endif
++
+ /* Configure pin mux settings for GMAC */
+ for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {
+ #ifdef CONFIG_RGMII
COREVER=$(cat /opt/pakfire/db/core/mine)
# FIXME: edit this lines before release
-URL="http://download.ipfire.org/releases/ipfire-2.x/2.15-core$COREVER/"
-ISO="ipfire-2.15.i586-full-core$COREVER.iso"
+URL="http://download.ipfire.org/releases/ipfire-2.x/2.17-core$COREVER/"
+ISO="ipfire-2.17.i586-full-core$COREVER.iso"
if [ -z $1 ]; then
echo usage: $0 backup-file
--- /dev/null
+#!/bin/bash
+############################################################################
+# #
+# This file is part of the IPFire Firewall. #
+# #
+# IPFire is free software; you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation; either version 2 of the License, or #
+# (at your option) any later version. #
+# #
+# IPFire is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with IPFire; if not, write to the Free Software #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+# #
+# Copyright (C) 2014 IPFire Team <info@ipfire.org>. #
+# #
+############################################################################
+
+GRUB_INSTALL_ARGS="--no-floppy --recheck"
+
+function find_bootloader_device() {
+ local mp
+ for mp in /boot /; do
+ if find_device "${mp}"; then
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+function find_device() {
+ local mountpoint="${1}"
+
+ local root
+ local dev mp fs flags rest
+ while read -r dev mp fs flags rest; do
+ # Skip unwanted entries
+ [ "${dev}" = "rootfs" ] && continue
+
+ if [ "${mp}" = "${mountpoint}" ] && [ -b "${dev}" ]; then
+ root="$(basename "${dev}")"
+ break
+ fi
+ done < /proc/mounts
+
+ # Get the actual device from the partition that holds /
+ while [ -n "${root}" ]; do
+ if [ -e "/sys/block/${root}" ]; then
+ echo "${root}"
+ return 0
+ fi
+
+ # Remove last character
+ root="${root::-1}"
+ done
+
+ return 1
+}
+
+function device_is_mdraid() {
+ local device="${1}"
+
+ [ -d "/sys/block/${device}/md" ]
+}
+
+function mdraid_get_slaves() {
+ local device="${1}"
+
+ local slave
+ for slave in /sys/block/${device}/slaves/*; do
+ basename "${slave}"
+ done 2>/dev/null
+}
+
+function grub_update_config() {
+ echo "Updating configuration..."
+
+ if ! grub-mkconfig -o /boot/grub/grub.cfg &>/dev/null; then
+ echo "Could not update configuration. Aborting." >&2
+ return 1
+ fi
+
+ return 0
+}
+
+function grub_install() {
+ local device="${1}"
+
+ echo "Installing GRUB on ${device}..."
+
+ if [ ! -b "${device}" ]; then
+ echo "${device} does not exist or is not a block device" >&2
+ return 1
+ fi
+
+ local args
+ for args in "" "--force"; do
+ if grub-install ${GRUB_INSTALL_ARGS} ${args} "${device}" &>/dev/null; then
+ return 0
+ fi
+ done
+
+ echo "Could not install GRUB on ${device}" >&2
+ return 1
+}
+
+function main() {
+ # Find the root device
+ local device="$(find_bootloader_device)"
+ if [ -z "${device}" ]; then
+ echo "Could not find root device. Aborting." >&2
+ exit 1
+ fi
+
+ echo "Found bootloader device: /dev/${device}"
+
+ # Update configuration files
+ grub_update_config || exit $?
+
+ # Handle mdraid devices
+ if device_is_mdraid "${device}"; then
+ local slave
+ for slave in $(mdraid_get_slaves "${device}"); do
+ grub_install "/dev/${slave}"
+ done
+
+ # Handle normal block devices
+ else
+ grub_install "/dev/${device}"
+ fi
+
+ return 0
+}
+
+# Run main function
+main
}
}
-int create_udev(void)
-{
- #define UDEV_NET_CONF "/etc/udev/rules.d/30-persistent-network.rules"
- FILE *fp;
- int i;
-
- if ( (fp = fopen(UDEV_NET_CONF, "w")) == NULL ) {
- fprintf(stderr,"Couldn't open" UDEV_NET_CONF);
- return 1;
- }
-
- for (i = 0 ; i < 4 ; i++)
- {
- if (strcmp(knics[i].macaddr, "")) {
- fprintf(fp,"\n# %s\nACTION==\"add\", SUBSYSTEM==\"net\", ATTR{type}==\"1\", ATTR{address}==\"%s\", NAME=\"%s0\"\n", knics[i].description, knics[i].macaddr, lcolourcard[i]);
- }
- }
- fclose(fp);
- return 0;
-}
-
int write_configs_netudev(int card , int colour)
{
char commandstring[STRING_SIZE];
} else {
rename_nics();
}
- create_udev();
return 1;
}
+ar
+ca
+cs_CZ
+da
de
+el_GR
+es
+fa
+fr
+hr
+hu
+id
+it
+ja
+jv
+km_KH
+nl
+pl
+pt_BR
+pt_PT
+ro_RO
+ru
+rw
+sk
+sq
+sr
+su
+sv
+th
+tk
+tr
+uk
+uz@Latn
+vi
+zh
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2014-08-24 14:21+0000\n"
+"Last-Translator: Henrik Simonsen <cybermaze@gmail.com>\n"
"Language-Team: Danish (http://www.transifex.com/projects/p/ipfire/language/da/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Current config: %s\n"
"\n"
"%s"
-msgstr ""
+msgstr "Nuværende konfiguration: %s\n\n%s"
#: networking.c:268
msgid "Network configuration menu"
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 18:01+0000\n"
+"PO-Revision-Date: 2014-08-24 19:39+0000\n"
"Last-Translator: Stefan Schantl <stefan.schantl@ipfire.org>\n"
"Language-Team: German (http://www.transifex.com/projects/p/ipfire/language/de/)\n"
"MIME-Version: 1.0\n"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr "Bitte geben Sie den Hostname der Maschine ein."
+msgstr "Bitte geben Sie den Hostnamen der Maschine ein."
#: hostname.c:53
msgid "Hostname cannot be empty."
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr "Wählen Sie aus dieser Liste den Tastatur-Typ aus, den Sie benutzen."
+msgstr "Bitte wählen Sie aus der Liste das gewünschte Tastatur-Layout aus."
#: main.c:68 timezone.c:77
msgid "Timezone"
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Roberto Peña <roberto.pena@northsecure.es>, 2015
+# Roberto Peña <roberto.pena@northsecure.es>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-02-01 09:37+0000\n"
+"Last-Translator: Roberto Peña <roberto.pena@northsecure.es>\n"
"Language-Team: Spanish (http://www.transifex.com/projects/p/ipfire/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "Dirección inicial:"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "Dirección final:"
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "DNS primario:"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "DNS secundario:"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "Concesión por defecto (mins):"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "Concesión máxima (mins):"
#: dhcp.c:56
msgid "Domain name suffix:"
-msgstr ""
+msgstr "Sufijo del nombre de dominio:"
#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "No se puede abrir archivo de configuración"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "Configuración del servidor DHCP"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "Configurar el servidor DHCP mediante la introducción de la información de configuración."
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "Habilitado"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
#: timezone.c:78
msgid "OK"
-msgstr ""
+msgstr "Ok"
#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "Cancelar"
#: dhcp.c:156
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "Los siguientes campos son inválidos:\n\n"
#: dhcp.c:159
msgid "Start address"
-msgstr ""
+msgstr "Dirección de inicio"
#: dhcp.c:165
msgid "End address"
-msgstr ""
+msgstr "Dirección final"
#: dhcp.c:173 networking.c:755
msgid "Primary DNS"
-msgstr ""
+msgstr "DNS primario"
#: dhcp.c:182 networking.c:764
msgid "Secondary DNS"
-msgstr ""
+msgstr "DNS secundario"
#: dhcp.c:189
msgid "Default lease time"
-msgstr ""
+msgstr "Tiempo de concesión por defecto"
#: dhcp.c:195
msgid "Max. lease time"
-msgstr ""
+msgstr "Concesión máx. de tiempo"
#: domainname.c:42 main.c:70
msgid "Domain name"
-msgstr ""
+msgstr "Nombre de dominio"
#: domainname.c:42
msgid "Enter Domain name"
-msgstr ""
+msgstr "Introduzca el nombre de dominio"
#: domainname.c:48
msgid "Domain name cannot be empty."
-msgstr ""
+msgstr "El nombre de dominio no puede estar vacio."
#: domainname.c:50
msgid "Domain name cannot contain spaces."
-msgstr ""
+msgstr "El nombre de dominio no puede contener espacios."
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "El nombre de dominio sólo puede contener letras, números, guiones y puntos."
#: hostname.c:46 main.c:69
msgid "Hostname"
-msgstr ""
+msgstr "Nombre de host"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr ""
+msgstr "Introduzca el nombre de host de la máquina."
#: hostname.c:53
msgid "Hostname cannot be empty."
-msgstr ""
+msgstr "El nombre de host no puede estar vacio."
#: hostname.c:55
msgid "Hostname cannot contain spaces."
-msgstr ""
+msgstr "El nombre de host no puede contener espacios."
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
-msgstr ""
+msgstr "El nombre de host sólo puede contener letras, números y guiones."
#: keymap.c:84 main.c:67
msgid "Keyboard mapping"
-msgstr ""
+msgstr "Mapa del teclado"
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr ""
+msgstr "Elija el tipo de teclado que está utilizando de la lista de abajo."
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "Zona horaria"
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "Networking"
#: main.c:72 misc.c:147
msgid "ISDN"
-msgstr ""
+msgstr "RDSI"
#: main.c:73
msgid "'root' password"
-msgstr ""
+msgstr "Contraseña de 'root'"
#: main.c:74
msgid "'admin' password"
-msgstr ""
+msgstr "Contraseña de 'admin'"
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> entre elementos | <Space> seleccionar"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "Menú de las secciones"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "Seleccione el elemento que desea configurar."
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Salir"
#: main.c:172
msgid "Setup is complete."
-msgstr ""
+msgstr "La instalación está completa."
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Advertencia"
#: main.c:175
msgid ""
"Initial setup was not entirely complete. You must ensure that Setup is "
"properly finished by running setup again at the shell."
-msgstr ""
+msgstr "La instalación inicial no ha sido completada enteramente. Debe asegurarse que está correctamente finalizada ejecutando la instalación en el shell."
#: misc.c:62
#, c-format
msgid "Unable to write %s/main/hostname.conf"
-msgstr ""
+msgstr "No se puede escribir %s/main/hostname.conf"
#: misc.c:71
msgid "Unable to open main hosts file."
-msgstr ""
+msgstr "No se puede abrir archivo principal host."
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "No se puede escribir /etc/hosts."
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr "No se puede escribir /etc/hosts.deny."
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "No se puede escribir /etc/hosts.allow."
#: misc.c:136
msgid "Unable to set hostname."
-msgstr ""
+msgstr "No se puede establecer el nombre del host."
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
-msgstr ""
+msgstr "Escaneando y configurando los dispositivos RDSI."
#: misc.c:148
msgid "Unable to scan for ISDN devices."
-msgstr ""
+msgstr "Incapaz de buscar los dispositivos RDSI."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "Interfaz - %s"
#: netstuff.c:91
#, c-format
msgid "Enter the IP address information for the %s interface."
-msgstr ""
+msgstr "Introduzca la información de la dirección IP para la interfaz %s."
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Estático"
#: netstuff.c:104
msgid "DHCP"
-msgstr ""
+msgstr "DHCP"
#: netstuff.c:105
msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
-msgstr ""
+msgstr "PPP DIALUP (PPPoE, modem, ATM ...)"
#: netstuff.c:113
msgid "DHCP Hostname:"
-msgstr ""
+msgstr "Nombre del host DHCP:"
#: netstuff.c:115
msgid "Force DHCP MTU:"
-msgstr ""
+msgstr "Forzar DHCP MTU:"
#: netstuff.c:134
msgid "IP address:"
-msgstr ""
+msgstr "Dirección IP:"
#: netstuff.c:146
msgid "Network mask:"
-msgstr ""
+msgstr "Máscara de red:"
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
-msgstr ""
+msgstr "Los siguientes campos son inválidos:"
#: netstuff.c:183
msgid "IP address"
-msgstr ""
+msgstr "Dirección IP"
#: netstuff.c:189
msgid "Network mask"
-msgstr ""
+msgstr "Máscara de red"
#: netstuff.c:198
msgid "DHCP hostname"
-msgstr ""
+msgstr "Nombre del host DHCP"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
-msgstr ""
+msgstr "No definido"
#: netstuff.c:669
#, c-format
msgid "Please choose a networkcard for the following interface - %s."
-msgstr ""
+msgstr "Por favor elija una tarjeta de red para la siguiente interfaz - %s."
#: netstuff.c:672
msgid "Extended Network Menu"
-msgstr ""
+msgstr "Menú Extendido de Red"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Seleccionar"
#: netstuff.c:673
msgid "Identify"
-msgstr ""
+msgstr "Identificar"
#: netstuff.c:678
msgid "Device Identification"
-msgstr ""
+msgstr "Identificación del dispositivo"
#: netstuff.c:678
msgid "The lights on the selected port should flash now for 10 seconds..."
-msgstr ""
+msgstr "Las luces en el puerto seleccionado deben parpadear ahora durante 10 segundos ..."
#: netstuff.c:679
msgid "Identification is not supported by this interface."
-msgstr ""
+msgstr "La identificación no es compatible con esta interfaz."
#: netstuff.c:691
msgid "There are no unassigned interfaces on your system."
-msgstr ""
+msgstr "No hay interfaces no asignadas en el sistema."
#: netstuff.c:732
#, c-format
msgid "Do you really want to remove the assigned %s interface?"
-msgstr ""
+msgstr "¿Realmente desea eliminar la interfaz asignada %s?"
#: netstuff.c:755
msgid "Select network driver"
-msgstr ""
+msgstr "Seleccionar controlador de red"
#: netstuff.c:755
msgid "Set additional module parameters"
-msgstr ""
+msgstr "Establecer parámetros de los módulos adicionales"
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "Leyendo módulo..."
#: netstuff.c:777
msgid "Unable to load driver module."
-msgstr ""
+msgstr "No se puede cargar el módulo controlador."
#: netstuff.c:780
msgid "Module name cannot be blank."
-msgstr ""
+msgstr "Nombre del módulo no puede estar en blanco."
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "Deteniendo la red..."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "Reiniciando la red..."
#: networking.c:146
msgid "No GREEN interface assigned."
-msgstr ""
+msgstr "No asignada la interfaz GREEN."
#: networking.c:152
msgid "Missing an IP address on GREEN."
-msgstr ""
+msgstr "Falta la dirección IP en GREEN."
#: networking.c:163
msgid "Error"
-msgstr ""
+msgstr "Error"
#: networking.c:163
msgid "Ignore"
-msgstr ""
+msgstr "Ignorar"
#: networking.c:164
msgid "No RED interface assigned."
-msgstr ""
+msgstr "No asignada la interfaz RED."
#: networking.c:173
msgid "Missing an IP address on RED."
-msgstr ""
+msgstr "Falta la dirección IP en RED."
#: networking.c:183
msgid "No ORANGE interface assigned."
-msgstr ""
+msgstr "No asignada la interfaz ORANGE."
#: networking.c:189
msgid "Missing an IP address on ORANGE."
-msgstr ""
+msgstr "Falta la dirección IP en ORANGE."
#: networking.c:199
msgid "No BLUE interface assigned."
-msgstr ""
+msgstr "No asignada la interfaz BLUE."
#: networking.c:205
msgid "Missing an IP address on BLUE."
-msgstr ""
+msgstr "Falta la dirección IP en BLUE."
#: networking.c:217
msgid "Misssing DNS."
-msgstr ""
+msgstr "Falta DNS."
#: networking.c:224
msgid "Missing Default Gateway."
-msgstr ""
+msgstr "Falta Puerta de Enlace predeterminada."
#: networking.c:237 networking.c:304
msgid "Network configuration type"
-msgstr ""
+msgstr "Tipo de configuración de red"
#: networking.c:238 networking.c:409
msgid "Drivers and card assignments"
-msgstr ""
+msgstr "Asignación de controladores y tarjetas"
#: networking.c:239 networking.c:640
msgid "Address settings"
-msgstr ""
+msgstr "Configuración de dirección"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
-msgstr ""
+msgstr "Configuración de DNS y Puerta de Enlace"
#: networking.c:260
msgid "When configuration is complete, a network restart will be required."
-msgstr ""
+msgstr "Cuando haya finalizado la configuración, será necesario el reinicio de la red."
#: networking.c:267
#, c-format
"Current config: %s\n"
"\n"
"%s"
-msgstr ""
+msgstr "Configuración actual: %s\n\n%s"
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "Menú de la configuración de red"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
-msgstr ""
+msgstr "Hecho"
#: networking.c:300
#, c-format
"list those interfaces which have ethernet attached. If you change this "
"setting, a network restart will be required, and you will have to "
"reconfigure the network driver assignments."
-msgstr ""
+msgstr "Seleccione la configuración de la red para %s. La lista de los siguientes tipos de configuración tienen que tener una conexión ethernet. Si cambia esta configuración, se requiere un reinicio de la red, y tendrá que volver a configurar las asignaciones de controlador de red."
#: networking.c:307
#, c-format
"Not enough netcards for your choice.\n"
"\n"
"Needed: %d - Available: %d\n"
-msgstr ""
+msgstr "No hay suficientes tarjetas de red para su elección.\n\nNecesarias: %d - Disponibles: %d\n"
#: networking.c:359
msgid ""
"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
"\n"
-msgstr ""
+msgstr "Configurar los controladores de red y la interfaz que se ha asignado a cada tarjeta. La configuración actual es la siguiente:\n\n"
#: networking.c:408
msgid "Do you wish to change these settings?"
-msgstr ""
+msgstr "¿Desea cambiar esta configuración?"
#: networking.c:447
msgid "Restarting non-local network..."
-msgstr ""
+msgstr "Reiniciando redes no locales..."
#: networking.c:464
msgid ""
"Please choose the interface you wish to change.\n"
"\n"
-msgstr ""
+msgstr "Por favor, elija la interfaz que desea cambiar.\n\n"
#: networking.c:519
msgid "Assigned Cards"
-msgstr ""
+msgstr "Tarjetas asignadas"
#: networking.c:520
msgid "Remove"
-msgstr ""
+msgstr "Quitar"
#: networking.c:556 networking.c:649
#, c-format
"connection to the %s machine will be broken, and you will have to reconnect "
"on the new IP. This is a risky operation, and should only be attempted if "
"you have physical access to the machine, should something go wrong."
-msgstr ""
+msgstr "Si cambia esta dirección IP y tiene iniciada una sesión en el sistema de forma remota, la conexión a la máquina %s será cortada y tendrá que volver a conectar en la nueva IP. Esta es una operación arriesgada, y sólo debe intentarse si tiene acceso físico a la máquina, por si algo sale mal."
#: networking.c:641
msgid "Select the interface you wish to reconfigure."
-msgstr ""
+msgstr "Seleccione la interfaz que desea reconfigurar."
#: networking.c:729
msgid "Default gateway:"
-msgstr ""
+msgstr "Puerta de Enlace predeterminada:"
#: networking.c:744
msgid ""
"Enter the DNS and gateway information. These settings are used only with "
"Static IP (and DHCP if DNS set) on the RED interface."
-msgstr ""
+msgstr "Introduzca la información del DNS y la Puerta de Enlace. Estos ajustes se utilizan sólo con IP estática (y DHCP si está configurado DNS) en la interfaz de RED."
#: networking.c:773
msgid "Default gateway"
-msgstr ""
+msgstr "Puerta de Enlace predeterminada"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
-msgstr ""
+msgstr "DNS secundario especificado sin DNS primario"
#: passwords.c:33
msgid ""
"Enter the 'root' user password. Login as this user for commandline access."
-msgstr ""
+msgstr "Introduzca la contraseña de 'root'. Iniciar la sesión como este usuario para el acceso de linea de comandos."
#: passwords.c:38 passwords.c:61
msgid "Setting password"
-msgstr ""
+msgstr "Configuración de la contraseña"
#: passwords.c:38
msgid "Setting 'root' password...."
-msgstr ""
+msgstr "Configuración de la contraseña de 'root'..."
#: passwords.c:39
msgid "Problem setting 'root' password."
-msgstr ""
+msgstr "Problema en la configuración de la contraseña de 'root'."
#: passwords.c:53
#, c-format
msgid ""
"Enter %s 'admin' user password. This is the user to use for logging into the"
" %s web administration pages."
-msgstr ""
+msgstr "Introduzca contraseña de usuario %s 'admin'. Este es el usuario que se utiliza para iniciar sesión en las páginas de administración web de %s."
#: passwords.c:60
#, c-format
msgid "Setting %s 'admin' user password..."
-msgstr ""
+msgstr "Configuración de la contraseña del usuario %s 'admin'..."
#: passwords.c:62
#, c-format
msgid "Problem setting %s 'admin' user password."
-msgstr ""
+msgstr "Problemas al configurar la contraseña del usuario %s 'admin'."
#: passwords.c:76
msgid "Password:"
-msgstr ""
+msgstr "Contraseña:"
#: passwords.c:77
msgid "Again:"
-msgstr ""
+msgstr "De nuevo:"
#: passwords.c:95
msgid "Password cannot be blank."
-msgstr ""
+msgstr "La contraseña no puede estar en blanco."
#: passwords.c:102
msgid "Passwords do not match."
-msgstr ""
+msgstr "Las contraseñas no coinciden."
#: passwords.c:109
msgid "Password cannot contain spaces."
-msgstr ""
+msgstr "La contraseña no puede contener espacios."
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
-msgstr ""
+msgstr "Seleccione la zona horaria de donde se encuentra en la lista de abajo."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
-# Khalil Delavaran <khalil.delavaran@gmail.com>, 2014
+# hashem ghavami <hashem.wolf@gmail.com>, 2014
+# Khalil Delavaran <khalil.delavaran@gmail.com>, 2014-2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-01-26 06:42+0000\n"
+"Last-Translator: Khalil Delavaran <khalil.delavaran@gmail.com>\n"
"Language-Team: Persian (http://www.transifex.com/projects/p/ipfire/language/fa/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "نمی توان فایل پیکربندی را باز کرد"
#: dhcp.c:111
msgid "DHCP server configuration"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "سرویس دهنده DHcp با داده و تنظیمات وارد شده پیکربندی شد"
#: dhcp.c:125
msgid "Enabled"
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "شاخص های زیر اشتباه هستند:\n\n"
#: dhcp.c:159
msgid "Start address"
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "نام دامنه ممکن است شامل حروف، اعداد، خط فاصله و دوره های باشذ"
#: hostname.c:46 main.c:69
msgid "Hostname"
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
-msgstr ""
+msgstr "نام هاست ممکن است شامل حروف، اعداد و خط فاصله باشد."
#: keymap.c:84 main.c:67
msgid "Keyboard mapping"
-msgstr ""
+msgstr "نگاشت کیبورد"
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr ""
+msgstr "نوع کی بورد خود را از لیست زیر گزینش کنید."
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "منطقه زمانی"
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "شبکه بندی"
#: main.c:72 misc.c:147
msgid "ISDN"
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
-msgstr ""
+msgstr " <Tab>/<Alt-Tab> میان عنصری | <Space> گزینش"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "برش منو"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "اینترفیسی که قصد پیکربندی دوباره آنرا دارید گزینش کنید."
#: main.c:99
msgid "Quit"
msgid ""
"Initial setup was not entirely complete. You must ensure that Setup is "
"properly finished by running setup again at the shell."
-msgstr ""
+msgstr "راه اندازی به پایان نرسیده است. شما با اجرای دوباره راه اندازی در خط فرمان باید مطمئن شوید که راه اندازی پایان یافته است."
#: misc.c:62
#, c-format
msgid "Unable to write %s/main/hostname.conf"
-msgstr ""
+msgstr "نمی توان %s/main/hostname.conf را نوشت."
#: misc.c:71
msgid "Unable to open main hosts file."
-msgstr ""
+msgstr "نمی توان فایل هاست های اصلی را باز کرد."
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "نمی توان در /etc/hosts نوشت."
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr "نمی توان در /etc/hosts.deny نوشت."
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "نمی توان در /etc/hosts.allow نوشت."
#: misc.c:136
msgid "Unable to set hostname."
-msgstr ""
+msgstr "نمی توان نام هاست را پیکربندی کرد."
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
-msgstr ""
+msgstr "پویش و پیکربندی دستگاه های ISDN."
#: misc.c:148
msgid "Unable to scan for ISDN devices."
-msgstr ""
+msgstr "نمی توان دستگاههای ISDN را پویش کرد."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "اینترفیس - %s"
#: netstuff.c:91
#, c-format
msgid "Enter the IP address information for the %s interface."
-msgstr ""
+msgstr "داده های آدرس IP برای اینترفیس %s را بنویسید."
#: netstuff.c:103
msgid "Static"
#: netstuff.c:115
msgid "Force DHCP MTU:"
-msgstr ""
+msgstr "DHCP MTU به زور:"
#: netstuff.c:134
msgid "IP address:"
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
-msgstr ""
+msgstr "شاخص های زیر اشتباه هستند"
#: netstuff.c:183
msgid "IP address"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
-msgstr ""
+msgstr "تنظیم نشده"
#: netstuff.c:669
#, c-format
msgid "Please choose a networkcard for the following interface - %s."
-msgstr ""
+msgstr "خواهشمند است یک کارت شبکه برای اینترفیس %s زیر گزینش کنید."
#: netstuff.c:672
msgid "Extended Network Menu"
-msgstr ""
+msgstr "منوی گسترده شبکه"
#: netstuff.c:673 networking.c:520
msgid "Select"
#: netstuff.c:673
msgid "Identify"
-msgstr ""
+msgstr "شناختن"
#: netstuff.c:678
msgid "Device Identification"
-msgstr ""
+msgstr "شناسایی دستگاه"
#: netstuff.c:678
msgid "The lights on the selected port should flash now for 10 seconds..."
-msgstr ""
+msgstr "چراغ های پورت گزینش شده، هم اکنون باید برای 10 ثانیه چشمک بزنند..."
#: netstuff.c:679
msgid "Identification is not supported by this interface."
-msgstr ""
+msgstr "این اینترفیس شناسایی را پشتیبانی نمی کند."
#: netstuff.c:691
msgid "There are no unassigned interfaces on your system."
-msgstr ""
+msgstr "هیچ رابط اختصاص داده نشده بر روی سیستم شما وجود ندارد."
#: netstuff.c:732
#, c-format
msgid "Do you really want to remove the assigned %s interface?"
-msgstr ""
+msgstr "آیا شما واقعا می خواهید اینترفیس %s اختصاص داده شده را پاک کنید؟"
#: netstuff.c:755
msgid "Select network driver"
#: netstuff.c:755
msgid "Set additional module parameters"
-msgstr ""
+msgstr "پیکربندی پارامترهای افزوده ماژول"
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "بارگذاری ماژول..."
#: netstuff.c:777
msgid "Unable to load driver module."
-msgstr ""
+msgstr "نمی توان راه انداز ماژول را بارگذاری کرد."
#: netstuff.c:780
msgid "Module name cannot be blank."
-msgstr ""
+msgstr "نام ماژول نمی تواند پوچ باشد."
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "از کار انداختن شبکه..."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "شروع دوباره شبکه..."
#: networking.c:146
msgid "No GREEN interface assigned."
-msgstr ""
+msgstr "به اینترفیس سبز میزانی داده نشده است."
#: networking.c:152
msgid "Missing an IP address on GREEN."
-msgstr ""
+msgstr "آدرس IP بر روی سبز یافت نشد."
#: networking.c:163
msgid "Error"
#: networking.c:164
msgid "No RED interface assigned."
-msgstr ""
+msgstr "برای اینترفیس قرمز میزانی داده نشده است."
#: networking.c:173
msgid "Missing an IP address on RED."
-msgstr ""
+msgstr "آدرس IP بر روی قرمز یافت نشد."
#: networking.c:183
msgid "No ORANGE interface assigned."
-msgstr ""
+msgstr "برای اینترفیس نارنجی میزانی داده نشده است."
#: networking.c:189
msgid "Missing an IP address on ORANGE."
-msgstr ""
+msgstr "آدرس IP بر روی نارنجی یافت نشد."
#: networking.c:199
msgid "No BLUE interface assigned."
-msgstr ""
+msgstr "برای اینترفیس آبی میزانی داده نشده است."
#: networking.c:205
msgid "Missing an IP address on BLUE."
-msgstr ""
+msgstr "آدرس IP بر روی آبی یافت نشد."
#: networking.c:217
msgid "Misssing DNS."
-msgstr ""
+msgstr "DNS یافت نشد."
#: networking.c:224
msgid "Missing Default Gateway."
-msgstr ""
+msgstr "Gateway پیش پندار یافت نشد."
#: networking.c:237 networking.c:304
msgid "Network configuration type"
-msgstr ""
+msgstr "چگونگی پیکربندی شبکه"
#: networking.c:238 networking.c:409
msgid "Drivers and card assignments"
-msgstr ""
+msgstr "راه انداز ها و تکالیف کارت ها"
#: networking.c:239 networking.c:640
msgid "Address settings"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
-msgstr ""
+msgstr "پیکربندی DNS و Gateway"
#: networking.c:260
msgid "When configuration is complete, a network restart will be required."
-msgstr ""
+msgstr "وقتی پیکربندی کامل شد سرویس شبکه در صورت نیاز راه اندازی مجدد خواهد شد"
#: networking.c:267
#, c-format
"Current config: %s\n"
"\n"
"%s"
-msgstr ""
+msgstr "پیکربندی جاری: %s\n\n%s"
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "منوی پیکربندی شبکه"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
"list those interfaces which have ethernet attached. If you change this "
"setting, a network restart will be required, and you will have to "
"reconfigure the network driver assignments."
-msgstr ""
+msgstr "پیکربندی شبکه برای %s را گزینش کنید. لیست روش های پیکربندی زیر آن اینترفیس ها، وقتیکه به شبکه متصل شده اند. اگر شما پیکربندی را دگرگون سازید، یک شبکه نیاز به خاموش روشن دارد، و شما راه انداز شبکه اختصاص داده شده را دوباره پیکربندی کنید."
#: networking.c:307
#, c-format
"Not enough netcards for your choice.\n"
"\n"
"Needed: %d - Available: %d\n"
-msgstr ""
+msgstr "کارتهای شبکه برای گزینش شما کافی نیست.\n\nنیازمند: %d - در دسترس: %d\n"
#: networking.c:359
msgid ""
"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
"\n"
-msgstr ""
+msgstr "پیکربندی راه اندازهای شبکه، که به اینترفیس هر کارت اختصاص داده شده است. پیکربندی کنونی در زیر آمده است:\n\n"
#: networking.c:408
msgid "Do you wish to change these settings?"
-msgstr ""
+msgstr "ایا قصد دارید این تنظیمات تغییر دهید؟"
#: networking.c:447
msgid "Restarting non-local network..."
-msgstr ""
+msgstr "شروع دوباره شبکه..."
#: networking.c:464
msgid ""
"Please choose the interface you wish to change.\n"
"\n"
-msgstr ""
+msgstr "خواهشمند است اینترفیسی را که می خواهید دگرگون سازید را گزینش کنید.\n\n"
#: networking.c:519
msgid "Assigned Cards"
-msgstr ""
+msgstr "کارت های واگذار شده"
#: networking.c:520
msgid "Remove"
"connection to the %s machine will be broken, and you will have to reconnect "
"on the new IP. This is a risky operation, and should only be attempted if "
"you have physical access to the machine, should something go wrong."
-msgstr ""
+msgstr "اگر شما این IP را تغییر دهید، و شما از راه ریموت وارد شده باشید، اتصال شما به سیستم %s شکسته می شود، و شما با IP جدید دوباره وصل شوید. این کار شما، ریسک دارد، و فقط باید دسترسی فیزیکی به سیستم داشته باشید، این کار شما اشتباه است."
#: networking.c:641
msgid "Select the interface you wish to reconfigure."
-msgstr ""
+msgstr "اینترفیس که قصد پیکربندی مجدد را دارید انتخاب کنید"
#: networking.c:729
msgid "Default gateway:"
msgid ""
"Enter the DNS and gateway information. These settings are used only with "
"Static IP (and DHCP if DNS set) on the RED interface."
-msgstr ""
+msgstr "اطلاعات gateway و DNS را بنویسید. این پیکربندی ها فقط با IP استاتیک (و DHCP اگر DNS نوشته شده باشد) بر روی اینترفیس قرمز بکار می روند."
#: networking.c:773
msgid "Default gateway"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
-msgstr ""
+msgstr "دومین DNS بدون پیکربندی نخستین DNS"
#: passwords.c:33
msgid ""
"Enter the 'root' user password. Login as this user for commandline access."
-msgstr ""
+msgstr "رمز عبور کاربر ریشه را وارد کنید.این کاربر سطح دسترسی خط فرمان را فراهم میکند"
#: passwords.c:38 passwords.c:61
msgid "Setting password"
msgid ""
"Enter %s 'admin' user password. This is the user to use for logging into the"
" %s web administration pages."
-msgstr ""
+msgstr "گذرواژه کاربر 'admin' %s را بنویسید. این کاربر برای ورود به برگه مدیریت وب %s می باشد."
#: passwords.c:60
#, c-format
#: passwords.c:62
#, c-format
msgid "Problem setting %s 'admin' user password."
-msgstr ""
+msgstr "ایراد در پیکربندی %s گذر واژه کاربر 'admin'"
#: passwords.c:76
msgid "Password:"
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
-msgstr ""
+msgstr " از لیست منطقه زمانی خود را انتخاب کنید"
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# irenee Munyaneza <muirenee@yahoo.fr>, 2014
+# nonux <nonux@free.fr>, 2015
+# Sebastien Labrie <fonkyy@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-02-17 23:25+0000\n"
+"Last-Translator: nonux <nonux@free.fr>\n"
"Language-Team: French (http://www.transifex.com/projects/p/ipfire/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "Adresse du début :"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "Adresse de fin : "
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "DNS primaire:"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "DNS secondaire:"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "Bail par défaut (mins) :"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "Bail maximum (mins) :"
#: dhcp.c:56
msgid "Domain name suffix:"
-msgstr ""
+msgstr "Suffixe du nom de domaine : "
#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "Impossible d'ouvrir le fichier de paramètres"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "Configuration du serveur DHCP"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "Activé"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "Annuler"
#: dhcp.c:156
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "Les champs suivants sont invalides:\n\n"
#: dhcp.c:159
msgid "Start address"
-msgstr ""
+msgstr "Adresse du début :"
#: dhcp.c:165
msgid "End address"
-msgstr ""
+msgstr "Adresse de fin : "
#: dhcp.c:173 networking.c:755
msgid "Primary DNS"
-msgstr ""
+msgstr "DNS primaire"
#: dhcp.c:182 networking.c:764
msgid "Secondary DNS"
-msgstr ""
+msgstr "DNS secondaire"
#: dhcp.c:189
msgid "Default lease time"
-msgstr ""
+msgstr "Bail par défaut"
#: dhcp.c:195
msgid "Max. lease time"
-msgstr ""
+msgstr "Bail maximum"
#: domainname.c:42 main.c:70
msgid "Domain name"
-msgstr ""
+msgstr "Nom de domaine"
#: domainname.c:42
msgid "Enter Domain name"
-msgstr ""
+msgstr "Entrez le nom de domaine"
#: domainname.c:48
msgid "Domain name cannot be empty."
-msgstr ""
+msgstr "Le nom de domaine ne peut pas être vide."
#: domainname.c:50
msgid "Domain name cannot contain spaces."
-msgstr ""
+msgstr "Le nom de domaine ne peut pas contenir d'espace."
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "Le nom de domaine ne peut contenir que des lettres, nombres, traits d'union ou point."
#: hostname.c:46 main.c:69
msgid "Hostname"
-msgstr ""
+msgstr "Nom d'hôte"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr ""
+msgstr "Entrez le nom d'hôte de la machine."
#: hostname.c:53
msgid "Hostname cannot be empty."
-msgstr ""
+msgstr "Le nom de domaine ne peut pas être vide."
#: hostname.c:55
msgid "Hostname cannot contain spaces."
-msgstr ""
+msgstr "Le nom de domaine ne doit pas contenir d'espaces."
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "Fuseau horaire"
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "Réseau"
#: main.c:72 misc.c:147
msgid "ISDN"
#: main.c:73
msgid "'root' password"
-msgstr ""
+msgstr "Mot de passe \"root\""
#: main.c:74
msgid "'admin' password"
-msgstr ""
+msgstr "Most de passe \"admin\""
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "Menu de sélection"
#: main.c:98
msgid "Select the item you wish to configure."
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Quitter"
#: main.c:172
msgid "Setup is complete."
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Avertissement"
#: main.c:175
msgid ""
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "Impossible d'écrire /etc/hosts."
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr "Impossible d'écrire /etc/hosts.deny."
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "Impossible d'écrire /etc/hosts.allow."
#: misc.c:136
msgid "Unable to set hostname."
-msgstr ""
+msgstr "Impossible de définir le nom d'hôte"
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "Interface - %s"
#: netstuff.c:91
#, c-format
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Statique"
#: netstuff.c:104
msgid "DHCP"
-msgstr ""
+msgstr "DHCP"
#: netstuff.c:105
msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
#: netstuff.c:113
msgid "DHCP Hostname:"
-msgstr ""
+msgstr "Nom d'hôte DHCP:"
#: netstuff.c:115
msgid "Force DHCP MTU:"
#: netstuff.c:134
msgid "IP address:"
-msgstr ""
+msgstr "Adresse IP"
#: netstuff.c:146
msgid "Network mask:"
-msgstr ""
+msgstr "Masque de sous-réseau : "
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
-msgstr ""
+msgstr "Les champs suivants sont invalides : "
#: netstuff.c:183
msgid "IP address"
-msgstr ""
+msgstr "Adresse IP"
#: netstuff.c:189
msgid "Network mask"
-msgstr ""
+msgstr "Masque de réseau"
#: netstuff.c:198
msgid "DHCP hostname"
-msgstr ""
+msgstr "Nom d'hôte DHCP"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Sélectionner"
#: netstuff.c:673
msgid "Identify"
#: netstuff.c:678
msgid "Device Identification"
-msgstr ""
+msgstr "Identification du périphérique"
#: netstuff.c:678
msgid "The lights on the selected port should flash now for 10 seconds..."
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "Chargement du module..."
#: netstuff.c:777
msgid "Unable to load driver module."
#: netstuff.c:780
msgid "Module name cannot be blank."
-msgstr ""
+msgstr "Le nom du module ne doit pas être vide"
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "Arrêt du réseau..."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "Re-démarrage du réseau..."
#: networking.c:146
msgid "No GREEN interface assigned."
-msgstr ""
+msgstr "Pas d'interface VERTE assignée."
#: networking.c:152
msgid "Missing an IP address on GREEN."
#: networking.c:163
msgid "Error"
-msgstr ""
+msgstr "Erreur"
#: networking.c:163
msgid "Ignore"
#: networking.c:164
msgid "No RED interface assigned."
-msgstr ""
+msgstr "Pas d'interface ROUGE assignée."
#: networking.c:173
msgid "Missing an IP address on RED."
#: networking.c:183
msgid "No ORANGE interface assigned."
-msgstr ""
+msgstr "Pas d'interface ORANGE assignée."
#: networking.c:189
msgid "Missing an IP address on ORANGE."
#: networking.c:199
msgid "No BLUE interface assigned."
-msgstr ""
+msgstr "Pas d'interface BLEUE assignée."
#: networking.c:205
msgid "Missing an IP address on BLUE."
#: networking.c:239 networking.c:640
msgid "Address settings"
-msgstr ""
+msgstr "Configuration d'adresse"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "Menu de configuration Reseau"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
-msgstr ""
+msgstr "Terminé"
#: networking.c:300
#, c-format
#: networking.c:519
msgid "Assigned Cards"
-msgstr ""
+msgstr "Cartes attribuées"
#: networking.c:520
msgid "Remove"
#: networking.c:729
msgid "Default gateway:"
-msgstr ""
+msgstr "Passerelle par defaut"
#: networking.c:744
msgid ""
#: networking.c:773
msgid "Default gateway"
-msgstr ""
+msgstr "Passerelle par défaut"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
#: passwords.c:38 passwords.c:61
msgid "Setting password"
-msgstr ""
+msgstr "Configuration du mot de passe"
#: passwords.c:38
msgid "Setting 'root' password...."
#: passwords.c:76
msgid "Password:"
-msgstr ""
+msgstr "Mot de passe"
#: passwords.c:77
msgid "Again:"
-msgstr ""
+msgstr "Encore"
#: passwords.c:95
msgid "Password cannot be blank."
-msgstr ""
+msgstr "Le mot de passe ne doit pas être vide"
#: passwords.c:102
msgid "Passwords do not match."
#: passwords.c:109
msgid "Password cannot contain spaces."
-msgstr ""
+msgstr "Le mot de passe ne doit pas contenir des espaces"
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-08-21 15:12+0000\n"
+"PO-Revision-Date: 2014-10-31 14:31+0000\n"
+"Last-Translator: Blago Culjak <blago.culjak@hotmail.com>\n"
+"Language-Team: Croatian (http://www.transifex.com/projects/p/ipfire/language/hr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: hr\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+
+#: dhcp.c:50
+msgid "Start address:"
+msgstr "Početna adresa:"
+
+#: dhcp.c:51
+msgid "End address:"
+msgstr "Krajna adresa:"
+
+#: dhcp.c:52 networking.c:717
+msgid "Primary DNS:"
+msgstr "Primarni DNS:"
+
+#: dhcp.c:53 networking.c:723
+msgid "Secondary DNS:"
+msgstr "Sekundarni DNS:"
+
+#: dhcp.c:54
+msgid "Default lease (mins):"
+msgstr "Zadani zakup (min):"
+
+#: dhcp.c:55
+msgid "Max lease (mins):"
+msgstr "Max zakup (min):"
+
+#: dhcp.c:56
+msgid "Domain name suffix:"
+msgstr "Sufiks naziva domene:"
+
+#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
+#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
+#: networking.c:134 networking.c:255 networking.c:291 networking.c:346
+#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
+#: networking.c:713 timezone.c:63
+msgid "Unable to open settings file"
+msgstr "Nije moguće otvoriti datoteku s postavkama"
+
+#: dhcp.c:111
+msgid "DHCP server configuration"
+msgstr "Konfiguracija DHCP poslužitelja"
+
+#: dhcp.c:116
+msgid "Configure the DHCP server by entering the settings information."
+msgstr "Konfiguracija DHCP poslužitelj s unosom postavki."
+
+#: dhcp.c:125
+msgid "Enabled"
+msgstr "Omogućeno"
+
+#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
+#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
+#: networking.c:269 networking.c:305 networking.c:409 networking.c:560
+#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
+#: timezone.c:78
+msgid "OK"
+msgstr "OK"
+
+#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
+#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
+#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
+#: passwords.c:89 timezone.c:78
+msgid "Cancel"
+msgstr "Otkazati"
+
+#: dhcp.c:156
+msgid ""
+"The following fields are invalid:\n"
+"\n"
+msgstr "Sljedeća polja su nevažeća:\n\n"
+
+#: dhcp.c:159
+msgid "Start address"
+msgstr "Početna adresa"
+
+#: dhcp.c:165
+msgid "End address"
+msgstr "Završna adresa"
+
+#: dhcp.c:173 networking.c:755
+msgid "Primary DNS"
+msgstr "Primarni DNS"
+
+#: dhcp.c:182 networking.c:764
+msgid "Secondary DNS"
+msgstr "Sekundarni DNS"
+
+#: dhcp.c:189
+msgid "Default lease time"
+msgstr "Zadano vrijeme zakupa"
+
+#: dhcp.c:195
+msgid "Max. lease time"
+msgstr "Max. vrijeme zakupa"
+
+#: domainname.c:42 main.c:70
+msgid "Domain name"
+msgstr "Naziv domene"
+
+#: domainname.c:42
+msgid "Enter Domain name"
+msgstr "Unesite naziv domene"
+
+#: domainname.c:48
+msgid "Domain name cannot be empty."
+msgstr "Naziv domene ne smije biti prazan."
+
+#: domainname.c:50
+msgid "Domain name cannot contain spaces."
+msgstr "Naziv domene ne smije sadržavati razmake."
+
+#: domainname.c:53
+msgid "Domain name may only contain letters, numbers, hyphens and periods."
+msgstr "Naziv domene može sadržavati samo slova, brojeve, crtice i točkice."
+
+#: hostname.c:46 main.c:69
+msgid "Hostname"
+msgstr "Ime računala"
+
+#: hostname.c:46
+msgid "Enter the machine's hostname."
+msgstr "Upišite naziv računala."
+
+#: hostname.c:53
+msgid "Hostname cannot be empty."
+msgstr "Naziv računala ne može biti prazan."
+
+#: hostname.c:55
+msgid "Hostname cannot contain spaces."
+msgstr "Naziv računala ne može sadržavati razmake."
+
+#: hostname.c:58
+msgid "Hostname may only contain letters, numbers and hyphens."
+msgstr "Naziv računala može sadržavati samo slova, brojeve i crtice."
+
+#: keymap.c:84 main.c:67
+msgid "Keyboard mapping"
+msgstr "Vrsta tipkovnice"
+
+#: keymap.c:85
+msgid "Choose the type of keyboard you are using from the list below."
+msgstr "Izaberite vrstu tipkovnice koju koristite s popisa u nastavku."
+
+#: main.c:68 timezone.c:77
+msgid "Timezone"
+msgstr "Vremenska zona"
+
+#: main.c:71 networking.c:110 networking.c:115 networking.c:447
+msgid "Networking"
+msgstr "Mreža"
+
+#: main.c:72 misc.c:147
+msgid "ISDN"
+msgstr "ISDN"
+
+#: main.c:73
+msgid "'root' password"
+msgstr "'root' lozinka"
+
+#: main.c:74
+msgid "'admin' password"
+msgstr "'admin' lozinka"
+
+#: main.c:90
+msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
+msgstr " <Tab>/<Alt-Tab> odabiranje drugih opcija | <Space> Izaberi"
+
+#: main.c:97
+msgid "Section menu"
+msgstr "Izbornik"
+
+#: main.c:98
+msgid "Select the item you wish to configure."
+msgstr "Odaberite stavku koju želite konfigurirati."
+
+#: main.c:99
+msgid "Quit"
+msgstr "Odustati"
+
+#: main.c:172
+msgid "Setup is complete."
+msgstr "Podešavanje je dovršeno."
+
+#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
+msgid "Warning"
+msgstr "Upozorenje"
+
+#: main.c:175
+msgid ""
+"Initial setup was not entirely complete. You must ensure that Setup is "
+"properly finished by running setup again at the shell."
+msgstr "Početno postavljanje nije u potpunosti završeno. Morate završiti postavljanje prije ponovnog postavljanja u shellu."
+
+#: misc.c:62
+#, c-format
+msgid "Unable to write %s/main/hostname.conf"
+msgstr "Nije moguće zapisati %s/main/hostname.conf"
+
+#: misc.c:71
+msgid "Unable to open main hosts file."
+msgstr "Nije moguće otvoriti glavnu hosts datoteku."
+
+#: misc.c:76
+msgid "Unable to write /etc/hosts."
+msgstr "Nije moguće zapisati /etc/hosts."
+
+#: misc.c:117
+msgid "Unable to write /etc/hosts.deny."
+msgstr "Nije moguće zapisati /etc/hosts.deny"
+
+#: misc.c:125
+msgid "Unable to write /etc/hosts.allow."
+msgstr "Nije moguće zapisati /etc/hosts.allow."
+
+#: misc.c:136
+msgid "Unable to set hostname."
+msgstr "Nije moguće postaviti naziv računala (hostname)."
+
+#: misc.c:147
+msgid "Scanning and configuring ISDN devices."
+msgstr "Skeniranje i postavljanje ISDN uređaja."
+
+#: misc.c:148
+msgid "Unable to scan for ISDN devices."
+msgstr "Nije moguće skenirati ISDN uređaj."
+
+#: netstuff.c:86
+#, c-format
+msgid "Interface - %s"
+msgstr "Sučelje - %s"
+
+#: netstuff.c:91
+#, c-format
+msgid "Enter the IP address information for the %s interface."
+msgstr "Unesite podatke o IP adresi za %s sučelje."
+
+#: netstuff.c:103
+msgid "Static"
+msgstr "Statička"
+
+#: netstuff.c:104
+msgid "DHCP"
+msgstr "DHCP"
+
+#: netstuff.c:105
+msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
+msgstr "PPP DIALUP (PPPoE, modem, ATM ...)"
+
+#: netstuff.c:113
+msgid "DHCP Hostname:"
+msgstr "DHCP naziv računala:"
+
+#: netstuff.c:115
+msgid "Force DHCP MTU:"
+msgstr "Prisili DHCP MTU:"
+
+#: netstuff.c:134
+msgid "IP address:"
+msgstr "IP adresa:"
+
+#: netstuff.c:146
+msgid "Network mask:"
+msgstr "Mreža maska:"
+
+#: netstuff.c:173 networking.c:749
+msgid "The following fields are invalid:"
+msgstr "Sljedeća polja su nevažeća:"
+
+#: netstuff.c:183
+msgid "IP address"
+msgstr "IP adresa"
+
+#: netstuff.c:189
+msgid "Network mask"
+msgstr "Mreža maska"
+
+#: netstuff.c:198
+msgid "DHCP hostname"
+msgstr "DHCP naziv računala"
+
+#: netstuff.c:396 netstuff.c:709
+msgid "Unset"
+msgstr "Nije postavljeno"
+
+#: netstuff.c:669
+#, c-format
+msgid "Please choose a networkcard for the following interface - %s."
+msgstr "Odaberite mrežnu karticu za sučelje - %s."
+
+#: netstuff.c:672
+msgid "Extended Network Menu"
+msgstr "Dodatni izbornik mreže"
+
+#: netstuff.c:673 networking.c:520
+msgid "Select"
+msgstr "Odabrati"
+
+#: netstuff.c:673
+msgid "Identify"
+msgstr "Identificirati"
+
+#: netstuff.c:678
+msgid "Device Identification"
+msgstr "Identifikacija uređaja"
+
+#: netstuff.c:678
+msgid "The lights on the selected port should flash now for 10 seconds..."
+msgstr "Svjetla na odabranom ulazu bi trebala bljeskati 10 sekundi..."
+
+#: netstuff.c:679
+msgid "Identification is not supported by this interface."
+msgstr "Identifikacija ne podržava ovo sučelje."
+
+#: netstuff.c:691
+msgid "There are no unassigned interfaces on your system."
+msgstr "Nema dodijeljenih sučelja na vašem sustavu."
+
+#: netstuff.c:732
+#, c-format
+msgid "Do you really want to remove the assigned %s interface?"
+msgstr "Da li stvarno želite ukloniti dodijeljeno %s sučelje?"
+
+#: netstuff.c:755
+msgid "Select network driver"
+msgstr "Odaberite mrežni driver"
+
+#: netstuff.c:755
+msgid "Set additional module parameters"
+msgstr "Postavite dodatne parametre modula"
+
+#: netstuff.c:762
+msgid "Loading module..."
+msgstr "Očitavam modul..."
+
+#: netstuff.c:777
+msgid "Unable to load driver module."
+msgstr "Nije moguće učitati upravljački modul."
+
+#: netstuff.c:780
+msgid "Module name cannot be blank."
+msgstr "Naziv modula ne može biti prazan."
+
+#: networking.c:110
+msgid "Stopping network..."
+msgstr "Zaustavljanje mreže..."
+
+#: networking.c:115
+msgid "Restarting network..."
+msgstr "Ponovno pokretanje mreže..."
+
+#: networking.c:146
+msgid "No GREEN interface assigned."
+msgstr "Nije dodijeljeno GREEN sučelje."
+
+#: networking.c:152
+msgid "Missing an IP address on GREEN."
+msgstr "Nedostaje IP adresa na GREEN sučelju."
+
+#: networking.c:163
+msgid "Error"
+msgstr "Pogreška"
+
+#: networking.c:163
+msgid "Ignore"
+msgstr "Ignorirati"
+
+#: networking.c:164
+msgid "No RED interface assigned."
+msgstr "Nije dodijeljeno RED sučelje."
+
+#: networking.c:173
+msgid "Missing an IP address on RED."
+msgstr "Nedostaje IP adresu na RED sučelju."
+
+#: networking.c:183
+msgid "No ORANGE interface assigned."
+msgstr "Nije dodijeljeno ORANGE sučelje."
+
+#: networking.c:189
+msgid "Missing an IP address on ORANGE."
+msgstr "Nedostaje IP adresu na Orange sučelju."
+
+#: networking.c:199
+msgid "No BLUE interface assigned."
+msgstr "Nije dodijeljeno BLUE sučelje."
+
+#: networking.c:205
+msgid "Missing an IP address on BLUE."
+msgstr "Nedostaje IP adresu na BLUE sučelju."
+
+#: networking.c:217
+msgid "Misssing DNS."
+msgstr "Nedostaje DNS."
+
+#: networking.c:224
+msgid "Missing Default Gateway."
+msgstr "Nedostaje Zadani Gateway."
+
+#: networking.c:237 networking.c:304
+msgid "Network configuration type"
+msgstr "Tip mrežnih postavki"
+
+#: networking.c:238 networking.c:409
+msgid "Drivers and card assignments"
+msgstr "Driveri i dodjele kartice"
+
+#: networking.c:239 networking.c:640
+msgid "Address settings"
+msgstr "Postavke adresa"
+
+#: networking.c:240 networking.c:743
+msgid "DNS and Gateway settings"
+msgstr "DNS i Gateway postavke"
+
+#: networking.c:260
+msgid "When configuration is complete, a network restart will be required."
+msgstr "Kad konfiguracija je završi, ponovno pokretanje mreže je obvezno."
+
+#: networking.c:267
+#, c-format
+msgid ""
+"Current config: %s\n"
+"\n"
+"%s"
+msgstr "Trenutna konfiguracija:%s\n\n%s"
+
+#: networking.c:268
+msgid "Network configuration menu"
+msgstr "Izbornik postavki mreže"
+
+#: networking.c:269 networking.c:520 networking.c:642
+msgid "Done"
+msgstr "Završeno"
+
+#: networking.c:300
+#, c-format
+msgid ""
+"Select the network configuration for %s. The following configuration types "
+"list those interfaces which have ethernet attached. If you change this "
+"setting, a network restart will be required, and you will have to "
+"reconfigure the network driver assignments."
+msgstr "Odaberite konfiguraciju mreže za %s. Sljedeća lista su vrste postavki onih Ethernet sučelja koja su dodana. Ako promijenite ovu postavku, ponovno pokretanje mreže će biti potrebno, a vi ćete morati ponovno dodijeliti mrežne drivere."
+
+#: networking.c:307
+#, c-format
+msgid ""
+"Not enough netcards for your choice.\n"
+"\n"
+"Needed: %d - Available: %d\n"
+msgstr "Nema dovoljno nmrežnih kartica za vaš izbor.\n\nPotrebno: %d - Dostupno: %d\n"
+
+#: networking.c:359
+msgid ""
+"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
+"\n"
+msgstr "Konfiguracija mrežnih upravljačkih programa, svakome sučelju kojemu kartica je dodijeljena. Trenutna konfiguracija: \n\n"
+
+#: networking.c:408
+msgid "Do you wish to change these settings?"
+msgstr "Želite li promijeniti ove postavke?"
+
+#: networking.c:447
+msgid "Restarting non-local network..."
+msgstr "Ponovno pokretanje ne-lokalne mreže ..."
+
+#: networking.c:464
+msgid ""
+"Please choose the interface you wish to change.\n"
+"\n"
+msgstr "Odaberite sučelje koje želite promijeniti. \n\n"
+
+#: networking.c:519
+msgid "Assigned Cards"
+msgstr "Dodijeljene kartice"
+
+#: networking.c:520
+msgid "Remove"
+msgstr "Ukloniti"
+
+#: networking.c:556 networking.c:649
+#, c-format
+msgid ""
+"If you change this IP address, and you are logged in remotely, your "
+"connection to the %s machine will be broken, and you will have to reconnect "
+"on the new IP. This is a risky operation, and should only be attempted if "
+"you have physical access to the machine, should something go wrong."
+msgstr "Ako promijenite ovu IP adresu, i ako ste prijavljeni udaljeno, vaša veza s %s će biti prekinuta, a vi ćete morati ponovno povezati na novu IP adresu. Pošto je ovo rizično, te bi trebali ovo raditi samo ako imate fizički pristup uređaju, ako nešto pođe krivo."
+
+#: networking.c:641
+msgid "Select the interface you wish to reconfigure."
+msgstr "Izaberite sučelje koje želite ponovo konfigurirati."
+
+#: networking.c:729
+msgid "Default gateway:"
+msgstr "Zadani pristupnik (gateway):"
+
+#: networking.c:744
+msgid ""
+"Enter the DNS and gateway information. These settings are used only with "
+"Static IP (and DHCP if DNS set) on the RED interface."
+msgstr "Unesite DNS i gateway informacije. Ove postavke se koristite samo s Statičkim IP-om (i DHCP ako je DNS postavljen) na RED sučelju."
+
+#: networking.c:773
+msgid "Default gateway"
+msgstr "Zadani pristupnik (gateway):"
+
+#: networking.c:780
+msgid "Secondary DNS specified without a Primary DNS"
+msgstr "Sekundarni DNS je naveden bez Primarnog DNSa"
+
+#: passwords.c:33
+msgid ""
+"Enter the 'root' user password. Login as this user for commandline access."
+msgstr "Unesite 'root' lozinku. Prijavite se kao ovoj korisnik za Commandline pristup."
+
+#: passwords.c:38 passwords.c:61
+msgid "Setting password"
+msgstr "Postavljanje lozinke"
+
+#: passwords.c:38
+msgid "Setting 'root' password...."
+msgstr "Postavljanje 'root' lozinke...."
+
+#: passwords.c:39
+msgid "Problem setting 'root' password."
+msgstr "Problem s postavljanjem 'root' lozinke."
+
+#: passwords.c:53
+#, c-format
+msgid ""
+"Enter %s 'admin' user password. This is the user to use for logging into the"
+" %s web administration pages."
+msgstr "Upišite %s 'admin' lozinku. To je korisnik koji se prijavljiva na %s web sučelje za administraciju."
+
+#: passwords.c:60
+#, c-format
+msgid "Setting %s 'admin' user password..."
+msgstr "Postavljanje %s 'admin' korisničke lozinke ..."
+
+#: passwords.c:62
+#, c-format
+msgid "Problem setting %s 'admin' user password."
+msgstr "Problem postavljanja %s 'admin' korisničke lozinke."
+
+#: passwords.c:76
+msgid "Password:"
+msgstr "Lozinka:"
+
+#: passwords.c:77
+msgid "Again:"
+msgstr "Ponovno:"
+
+#: passwords.c:95
+msgid "Password cannot be blank."
+msgstr "Lozinka ne može biti prazna."
+
+#: passwords.c:102
+msgid "Passwords do not match."
+msgstr "Lozinke se ne podudaraju."
+
+#: passwords.c:109
+msgid "Password cannot contain spaces."
+msgstr "Lozinka ne može sadržavati razmak."
+
+#: timezone.c:77
+msgid "Choose the timezone you are in from the list below."
+msgstr "Odaberite vremensku zonu u kojoj se nalazite na popisu."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# luX <lucianocataldo@gmail.com>, 2014
+# Mario <mc9085@mclink.it>, 2014
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2014-09-30 13:22+0000\n"
+"Last-Translator: Mario <mc9085@mclink.it>\n"
"Language-Team: Italian (http://www.transifex.com/projects/p/ipfire/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "Indirizzo iniziale:"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "Indirizzo finale:"
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "DNS primario:"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "DNS secondario:"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "Durata di Default del lease (min):"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "Durata massima del lease (min):"
#: dhcp.c:56
msgid "Domain name suffix:"
-msgstr ""
+msgstr "Suffisso del nome di Dominio:"
#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "Impossibile aprire il file delle impostazioni"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "Configurazione server DHCP"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "Configura il server DHCP immettendo le informazioni necessarie."
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "Abilitato"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
#: timezone.c:78
msgid "OK"
-msgstr ""
+msgstr "OK"
#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "Annulla"
#: dhcp.c:156
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "I seguenti campi non sono validi:\n\n"
#: dhcp.c:159
msgid "Start address"
-msgstr ""
+msgstr "Indirizzo iniziale"
#: dhcp.c:165
msgid "End address"
-msgstr ""
+msgstr "Indirizzo finale"
#: dhcp.c:173 networking.c:755
msgid "Primary DNS"
-msgstr ""
+msgstr "DNS primario"
#: dhcp.c:182 networking.c:764
msgid "Secondary DNS"
-msgstr ""
+msgstr "DNS secondario"
#: dhcp.c:189
msgid "Default lease time"
-msgstr ""
+msgstr "Tempo di lease di Default"
#: dhcp.c:195
msgid "Max. lease time"
-msgstr ""
+msgstr "Tempo di lease massimo"
#: domainname.c:42 main.c:70
msgid "Domain name"
-msgstr ""
+msgstr "Nome di Dominio"
#: domainname.c:42
msgid "Enter Domain name"
-msgstr ""
+msgstr "Inserire il nome del Dominio"
#: domainname.c:48
msgid "Domain name cannot be empty."
-msgstr ""
+msgstr "Il nome di Dominio non può essere vuoto."
#: domainname.c:50
msgid "Domain name cannot contain spaces."
-msgstr ""
+msgstr "Il nome di dominio non può contenere spazi."
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "Il nome del Dominio può contenere solamente lettere, numeri, trattini e punti."
#: hostname.c:46 main.c:69
msgid "Hostname"
-msgstr ""
+msgstr "Nome host"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr ""
+msgstr "Inserire il nome host della macchina."
#: hostname.c:53
msgid "Hostname cannot be empty."
-msgstr ""
+msgstr "Il nome host non può essere vuoto."
#: hostname.c:55
msgid "Hostname cannot contain spaces."
-msgstr ""
+msgstr "Il nome host non può contenere spazi"
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
-msgstr ""
+msgstr "Il nome host può contenere solo lettere, numeri e trattini."
#: keymap.c:84 main.c:67
msgid "Keyboard mapping"
-msgstr ""
+msgstr "Mappatura della tastiera"
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr ""
+msgstr "Scegli la configurazione della tua tastiera dalla lista sottostante."
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "Fuso orario"
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "Networking"
#: main.c:72 misc.c:147
msgid "ISDN"
-msgstr ""
+msgstr "ISDN"
#: main.c:73
msgid "'root' password"
-msgstr ""
+msgstr "Password di 'root'"
#: main.c:74
msgid "'admin' password"
-msgstr ""
+msgstr "Password di 'admin'"
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> spostati tra gli elementi | <Space> selezione"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "Menu di sezione"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "Scegli l'elemento che vuoi configurare."
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Abbandona"
#: main.c:172
msgid "Setup is complete."
-msgstr ""
+msgstr "L'installazione è completata."
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Attenzione"
#: main.c:175
msgid ""
"Initial setup was not entirely complete. You must ensure that Setup is "
"properly finished by running setup again at the shell."
-msgstr ""
+msgstr "Il setup iniziale non è stato completato. Completa il Setup inserendo la stinga \"setup\" nella shell. "
#: misc.c:62
#, c-format
msgid "Unable to write %s/main/hostname.conf"
-msgstr ""
+msgstr "Impossibile scrivere %s/main/hostname.conf"
#: misc.c:71
msgid "Unable to open main hosts file."
-msgstr ""
+msgstr "Impossibile aprire il file hosts principale."
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "Impossibile scrivere /etc/hosts."
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr "Impossibile scrivere /etc/hosts.deny."
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "Impossibile scrivere /etc/hosts.allow."
#: misc.c:136
msgid "Unable to set hostname."
-msgstr ""
+msgstr "Impossibile impostare l'hostname."
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
-msgstr ""
+msgstr "Scansionando e configurando i dispositivi ISDN."
#: misc.c:148
msgid "Unable to scan for ISDN devices."
-msgstr ""
+msgstr "Impossibile scansionare i dispositivi ISDN."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "Interfaccia - %s"
#: netstuff.c:91
#, c-format
msgid "Enter the IP address information for the %s interface."
-msgstr ""
+msgstr "Inserisci l'indirizzo IP per l'interfaccia %s."
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Statico"
#: netstuff.c:104
msgid "DHCP"
-msgstr ""
+msgstr "DHCP"
#: netstuff.c:105
msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
-msgstr ""
+msgstr "PPP DIALUP (PPPoE, modem, ATM ...)"
#: netstuff.c:113
msgid "DHCP Hostname:"
-msgstr ""
+msgstr "DHCP Hostname:"
#: netstuff.c:115
msgid "Force DHCP MTU:"
-msgstr ""
+msgstr "Forza DHCP MTU:"
#: netstuff.c:134
msgid "IP address:"
-msgstr ""
+msgstr "Indirizzo IP:"
#: netstuff.c:146
msgid "Network mask:"
-msgstr ""
+msgstr "Maschera di rete:"
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
-msgstr ""
+msgstr "I seguenti campi non sono validi:"
#: netstuff.c:183
msgid "IP address"
-msgstr ""
+msgstr "Indirizzo IP"
#: netstuff.c:189
msgid "Network mask"
-msgstr ""
+msgstr "Maschera di rete"
#: netstuff.c:198
msgid "DHCP hostname"
-msgstr ""
+msgstr "DHCP hostname"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
-msgstr ""
+msgstr "Non stabilito"
#: netstuff.c:669
#, c-format
msgid "Please choose a networkcard for the following interface - %s."
-msgstr ""
+msgstr "Scegli una interfaccia di rete tra le seguenti - %s."
#: netstuff.c:672
msgid "Extended Network Menu"
-msgstr ""
+msgstr "Menu di Rete esteso"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Selezionare"
#: netstuff.c:673
msgid "Identify"
-msgstr ""
+msgstr "Identificare"
#: netstuff.c:678
msgid "Device Identification"
-msgstr ""
+msgstr "Identificazione del dispositivo"
#: netstuff.c:678
msgid "The lights on the selected port should flash now for 10 seconds..."
-msgstr ""
+msgstr "I led della porta selezionata lampeggeranno ora per 10 secondi... "
#: netstuff.c:679
msgid "Identification is not supported by this interface."
-msgstr ""
+msgstr "L'identificazione non è supportata da questa interfaccia."
#: netstuff.c:691
msgid "There are no unassigned interfaces on your system."
-msgstr ""
+msgstr "Non ci sono interfacce non assegnate nel sistema."
#: netstuff.c:732
#, c-format
msgid "Do you really want to remove the assigned %s interface?"
-msgstr ""
+msgstr "Vuoi veramente rimuovere l'assegnazione dell'l'interfaccia %s?"
#: netstuff.c:755
msgid "Select network driver"
-msgstr ""
+msgstr "Scegli un driver di rete"
#: netstuff.c:755
msgid "Set additional module parameters"
-msgstr ""
+msgstr "Inserisci parametri addizionali per il modulo"
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "Caricando il modulo..."
#: netstuff.c:777
msgid "Unable to load driver module."
-msgstr ""
+msgstr "Impossibile caricare i driver per il modulo."
#: netstuff.c:780
msgid "Module name cannot be blank."
-msgstr ""
+msgstr "Il nome del modulo non può essere lasciato in bianco."
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "Arrestando la rete..."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "Riavviando la rete..."
#: networking.c:146
msgid "No GREEN interface assigned."
-msgstr ""
+msgstr "Non è stata assegnata l'interfaccia GREEN."
#: networking.c:152
msgid "Missing an IP address on GREEN."
-msgstr ""
+msgstr "Indirizzo IP dell'interfaccia GREEN mancante."
#: networking.c:163
msgid "Error"
-msgstr ""
+msgstr "Errore"
#: networking.c:163
msgid "Ignore"
-msgstr ""
+msgstr "Ignora"
#: networking.c:164
msgid "No RED interface assigned."
-msgstr ""
+msgstr "Non è stata assegnata l'interfaccia RED."
#: networking.c:173
msgid "Missing an IP address on RED."
-msgstr ""
+msgstr "Indirizzo IP dell'interfaccia RED mancante."
#: networking.c:183
msgid "No ORANGE interface assigned."
-msgstr ""
+msgstr "Non è stata assegnata l'interfaccia ORANGE."
#: networking.c:189
msgid "Missing an IP address on ORANGE."
-msgstr ""
+msgstr "Indirizzo IP dell'interfaccia ORANGE mancante."
#: networking.c:199
msgid "No BLUE interface assigned."
-msgstr ""
+msgstr "Non è stata assegnata l'interfaccia BLUE."
#: networking.c:205
msgid "Missing an IP address on BLUE."
-msgstr ""
+msgstr "Indirizzo IP dell'interfaccia BLUE mancante."
#: networking.c:217
msgid "Misssing DNS."
-msgstr ""
+msgstr "DNS mancanti."
#: networking.c:224
msgid "Missing Default Gateway."
-msgstr ""
+msgstr "Manca il Gateway di Default."
#: networking.c:237 networking.c:304
msgid "Network configuration type"
-msgstr ""
+msgstr "Tipo di configurazione di rete."
#: networking.c:238 networking.c:409
msgid "Drivers and card assignments"
-msgstr ""
+msgstr "Assegnazione dei driver e delle schede"
#: networking.c:239 networking.c:640
msgid "Address settings"
-msgstr ""
+msgstr "Impostazioni dell'indirizzo"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
-msgstr ""
+msgstr "Impostazioni DNG e Gateway"
#: networking.c:260
msgid "When configuration is complete, a network restart will be required."
-msgstr ""
+msgstr "Quando la configurazione sarà completata, sarà necessario un riavvio della rete."
#: networking.c:267
#, c-format
"Current config: %s\n"
"\n"
"%s"
-msgstr ""
+msgstr "Configurazione corrente: %s\n\n%s"
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "Menu di configurazione della rete"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
-msgstr ""
+msgstr "Fatto"
#: networking.c:300
#, c-format
"list those interfaces which have ethernet attached. If you change this "
"setting, a network restart will be required, and you will have to "
"reconfigure the network driver assignments."
-msgstr ""
+msgstr "Scegli la configurazione di rete per l'interfaccia %s. I seguenti tipi di configurazione mostrano le interfacce con collegamento ethernet. Se cambi le impostazioni sarà richiesto un riavvio della rete, e sarà necessario riconfigurare le assegnazioni dei driver di rete."
#: networking.c:307
#, c-format
"Not enough netcards for your choice.\n"
"\n"
"Needed: %d - Available: %d\n"
-msgstr ""
+msgstr "Non solo più disponibili schede di rete per la tua scelta.\n\nRichieste: %d - Disponibili: %d\n"
#: networking.c:359
msgid ""
"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
"\n"
-msgstr ""
+msgstr "Configura i driver di rete e le assegnazioni delle schede alle interfacce. La configurazione attuale è la seguente:\n\n"
#: networking.c:408
msgid "Do you wish to change these settings?"
-msgstr ""
+msgstr "Desideri cambiare queste impostazioni?"
#: networking.c:447
msgid "Restarting non-local network..."
-msgstr ""
+msgstr "Riavviando la rete esterna..."
#: networking.c:464
msgid ""
"Please choose the interface you wish to change.\n"
"\n"
-msgstr ""
+msgstr "Seleziona l'interfaccia che desideri cambiare.\n\n"
#: networking.c:519
msgid "Assigned Cards"
-msgstr ""
+msgstr "Schede assegnate"
#: networking.c:520
msgid "Remove"
-msgstr ""
+msgstr "Rimuovi"
#: networking.c:556 networking.c:649
#, c-format
"connection to the %s machine will be broken, and you will have to reconnect "
"on the new IP. This is a risky operation, and should only be attempted if "
"you have physical access to the machine, should something go wrong."
-msgstr ""
+msgstr "Se cambi l'indirizzo IP e sei collegato in maniera remota, la connessione alla macchina %s sarà interrotta e sarà necessario riconnettersi usando il nuovo indirizzo. Questa è una operazione rischiosa e dovrebbe essere eseguita solamente se è disponibile un accesso fisico alla macchina, in caso qualcosa vada storto. "
#: networking.c:641
msgid "Select the interface you wish to reconfigure."
-msgstr ""
+msgstr "Scegli l'interfaccia che vuoi riconfigurare."
#: networking.c:729
msgid "Default gateway:"
-msgstr ""
+msgstr "Gateway di Default:"
#: networking.c:744
msgid ""
"Enter the DNS and gateway information. These settings are used only with "
"Static IP (and DHCP if DNS set) on the RED interface."
-msgstr ""
+msgstr "Immettere i parametri per il DNS ed il Gateway. Queste impostazioni saranno prese in considerazione solamente con l'opzione \"IP Statico\" (e DHCP se sono stati impostati i DNS) dell'interfaccia RED. "
#: networking.c:773
msgid "Default gateway"
-msgstr ""
+msgstr "Gateway di Default"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
-msgstr ""
+msgstr "E' stato specificato un DNS secondario senza un DNS primario"
#: passwords.c:33
msgid ""
"Enter the 'root' user password. Login as this user for commandline access."
-msgstr ""
+msgstr "Immettere la Password per l'utente 'root'. Quando ci si collega da riga di comando, usare questo utente."
#: passwords.c:38 passwords.c:61
msgid "Setting password"
-msgstr ""
+msgstr "Impostando la Password"
#: passwords.c:38
msgid "Setting 'root' password...."
-msgstr ""
+msgstr "Impostando la Password per l'utente 'root'..."
#: passwords.c:39
msgid "Problem setting 'root' password."
-msgstr ""
+msgstr "Problemi durante l'impostazione della Password per l'utente 'root'."
#: passwords.c:53
#, c-format
msgid ""
"Enter %s 'admin' user password. This is the user to use for logging into the"
" %s web administration pages."
-msgstr ""
+msgstr "Introdurre la Password per l'utente 'admin' di %s. Quando ci si collega all'interfaccia web di %s usare questo utente. "
#: passwords.c:60
#, c-format
msgid "Setting %s 'admin' user password..."
-msgstr ""
+msgstr "Impostando la Password dell'utente 'admin' di %s..."
#: passwords.c:62
#, c-format
msgid "Problem setting %s 'admin' user password."
-msgstr ""
+msgstr "Si sono verificati problemi durante la configurazione della Password dell'utente 'admin' di %s."
#: passwords.c:76
msgid "Password:"
-msgstr ""
+msgstr "Password:"
#: passwords.c:77
msgid "Again:"
-msgstr ""
+msgstr "Nuovamente:"
#: passwords.c:95
msgid "Password cannot be blank."
-msgstr ""
+msgstr "La Password non può essere vuota."
#: passwords.c:102
msgid "Passwords do not match."
-msgstr ""
+msgstr "Le password non corrispondono."
#: passwords.c:109
msgid "Password cannot contain spaces."
-msgstr ""
+msgstr "La Password non può contenere spazi."
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
-msgstr ""
+msgstr "Scegli il tuo fuso orario dalla lista sottostante."
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-08-21 15:12+0000\n"
+"PO-Revision-Date: 2014-08-12 10:08+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Javanese (http://www.transifex.com/projects/p/ipfire/language/jv/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: jv\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: dhcp.c:50
+msgid "Start address:"
+msgstr ""
+
+#: dhcp.c:51
+msgid "End address:"
+msgstr ""
+
+#: dhcp.c:52 networking.c:717
+msgid "Primary DNS:"
+msgstr ""
+
+#: dhcp.c:53 networking.c:723
+msgid "Secondary DNS:"
+msgstr ""
+
+#: dhcp.c:54
+msgid "Default lease (mins):"
+msgstr ""
+
+#: dhcp.c:55
+msgid "Max lease (mins):"
+msgstr ""
+
+#: dhcp.c:56
+msgid "Domain name suffix:"
+msgstr ""
+
+#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
+#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
+#: networking.c:134 networking.c:255 networking.c:291 networking.c:346
+#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
+#: networking.c:713 timezone.c:63
+msgid "Unable to open settings file"
+msgstr ""
+
+#: dhcp.c:111
+msgid "DHCP server configuration"
+msgstr ""
+
+#: dhcp.c:116
+msgid "Configure the DHCP server by entering the settings information."
+msgstr ""
+
+#: dhcp.c:125
+msgid "Enabled"
+msgstr ""
+
+#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
+#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
+#: networking.c:269 networking.c:305 networking.c:409 networking.c:560
+#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
+#: timezone.c:78
+msgid "OK"
+msgstr ""
+
+#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
+#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
+#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
+#: passwords.c:89 timezone.c:78
+msgid "Cancel"
+msgstr ""
+
+#: dhcp.c:156
+msgid ""
+"The following fields are invalid:\n"
+"\n"
+msgstr ""
+
+#: dhcp.c:159
+msgid "Start address"
+msgstr ""
+
+#: dhcp.c:165
+msgid "End address"
+msgstr ""
+
+#: dhcp.c:173 networking.c:755
+msgid "Primary DNS"
+msgstr ""
+
+#: dhcp.c:182 networking.c:764
+msgid "Secondary DNS"
+msgstr ""
+
+#: dhcp.c:189
+msgid "Default lease time"
+msgstr ""
+
+#: dhcp.c:195
+msgid "Max. lease time"
+msgstr ""
+
+#: domainname.c:42 main.c:70
+msgid "Domain name"
+msgstr ""
+
+#: domainname.c:42
+msgid "Enter Domain name"
+msgstr ""
+
+#: domainname.c:48
+msgid "Domain name cannot be empty."
+msgstr ""
+
+#: domainname.c:50
+msgid "Domain name cannot contain spaces."
+msgstr ""
+
+#: domainname.c:53
+msgid "Domain name may only contain letters, numbers, hyphens and periods."
+msgstr ""
+
+#: hostname.c:46 main.c:69
+msgid "Hostname"
+msgstr ""
+
+#: hostname.c:46
+msgid "Enter the machine's hostname."
+msgstr ""
+
+#: hostname.c:53
+msgid "Hostname cannot be empty."
+msgstr ""
+
+#: hostname.c:55
+msgid "Hostname cannot contain spaces."
+msgstr ""
+
+#: hostname.c:58
+msgid "Hostname may only contain letters, numbers and hyphens."
+msgstr ""
+
+#: keymap.c:84 main.c:67
+msgid "Keyboard mapping"
+msgstr ""
+
+#: keymap.c:85
+msgid "Choose the type of keyboard you are using from the list below."
+msgstr ""
+
+#: main.c:68 timezone.c:77
+msgid "Timezone"
+msgstr ""
+
+#: main.c:71 networking.c:110 networking.c:115 networking.c:447
+msgid "Networking"
+msgstr ""
+
+#: main.c:72 misc.c:147
+msgid "ISDN"
+msgstr ""
+
+#: main.c:73
+msgid "'root' password"
+msgstr ""
+
+#: main.c:74
+msgid "'admin' password"
+msgstr ""
+
+#: main.c:90
+msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
+msgstr ""
+
+#: main.c:97
+msgid "Section menu"
+msgstr ""
+
+#: main.c:98
+msgid "Select the item you wish to configure."
+msgstr ""
+
+#: main.c:99
+msgid "Quit"
+msgstr ""
+
+#: main.c:172
+msgid "Setup is complete."
+msgstr ""
+
+#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
+msgid "Warning"
+msgstr ""
+
+#: main.c:175
+msgid ""
+"Initial setup was not entirely complete. You must ensure that Setup is "
+"properly finished by running setup again at the shell."
+msgstr ""
+
+#: misc.c:62
+#, c-format
+msgid "Unable to write %s/main/hostname.conf"
+msgstr ""
+
+#: misc.c:71
+msgid "Unable to open main hosts file."
+msgstr ""
+
+#: misc.c:76
+msgid "Unable to write /etc/hosts."
+msgstr ""
+
+#: misc.c:117
+msgid "Unable to write /etc/hosts.deny."
+msgstr ""
+
+#: misc.c:125
+msgid "Unable to write /etc/hosts.allow."
+msgstr ""
+
+#: misc.c:136
+msgid "Unable to set hostname."
+msgstr ""
+
+#: misc.c:147
+msgid "Scanning and configuring ISDN devices."
+msgstr ""
+
+#: misc.c:148
+msgid "Unable to scan for ISDN devices."
+msgstr ""
+
+#: netstuff.c:86
+#, c-format
+msgid "Interface - %s"
+msgstr ""
+
+#: netstuff.c:91
+#, c-format
+msgid "Enter the IP address information for the %s interface."
+msgstr ""
+
+#: netstuff.c:103
+msgid "Static"
+msgstr ""
+
+#: netstuff.c:104
+msgid "DHCP"
+msgstr ""
+
+#: netstuff.c:105
+msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
+msgstr ""
+
+#: netstuff.c:113
+msgid "DHCP Hostname:"
+msgstr ""
+
+#: netstuff.c:115
+msgid "Force DHCP MTU:"
+msgstr ""
+
+#: netstuff.c:134
+msgid "IP address:"
+msgstr ""
+
+#: netstuff.c:146
+msgid "Network mask:"
+msgstr ""
+
+#: netstuff.c:173 networking.c:749
+msgid "The following fields are invalid:"
+msgstr ""
+
+#: netstuff.c:183
+msgid "IP address"
+msgstr ""
+
+#: netstuff.c:189
+msgid "Network mask"
+msgstr ""
+
+#: netstuff.c:198
+msgid "DHCP hostname"
+msgstr ""
+
+#: netstuff.c:396 netstuff.c:709
+msgid "Unset"
+msgstr ""
+
+#: netstuff.c:669
+#, c-format
+msgid "Please choose a networkcard for the following interface - %s."
+msgstr ""
+
+#: netstuff.c:672
+msgid "Extended Network Menu"
+msgstr ""
+
+#: netstuff.c:673 networking.c:520
+msgid "Select"
+msgstr ""
+
+#: netstuff.c:673
+msgid "Identify"
+msgstr ""
+
+#: netstuff.c:678
+msgid "Device Identification"
+msgstr ""
+
+#: netstuff.c:678
+msgid "The lights on the selected port should flash now for 10 seconds..."
+msgstr ""
+
+#: netstuff.c:679
+msgid "Identification is not supported by this interface."
+msgstr ""
+
+#: netstuff.c:691
+msgid "There are no unassigned interfaces on your system."
+msgstr ""
+
+#: netstuff.c:732
+#, c-format
+msgid "Do you really want to remove the assigned %s interface?"
+msgstr ""
+
+#: netstuff.c:755
+msgid "Select network driver"
+msgstr ""
+
+#: netstuff.c:755
+msgid "Set additional module parameters"
+msgstr ""
+
+#: netstuff.c:762
+msgid "Loading module..."
+msgstr ""
+
+#: netstuff.c:777
+msgid "Unable to load driver module."
+msgstr ""
+
+#: netstuff.c:780
+msgid "Module name cannot be blank."
+msgstr ""
+
+#: networking.c:110
+msgid "Stopping network..."
+msgstr ""
+
+#: networking.c:115
+msgid "Restarting network..."
+msgstr ""
+
+#: networking.c:146
+msgid "No GREEN interface assigned."
+msgstr ""
+
+#: networking.c:152
+msgid "Missing an IP address on GREEN."
+msgstr ""
+
+#: networking.c:163
+msgid "Error"
+msgstr ""
+
+#: networking.c:163
+msgid "Ignore"
+msgstr ""
+
+#: networking.c:164
+msgid "No RED interface assigned."
+msgstr ""
+
+#: networking.c:173
+msgid "Missing an IP address on RED."
+msgstr ""
+
+#: networking.c:183
+msgid "No ORANGE interface assigned."
+msgstr ""
+
+#: networking.c:189
+msgid "Missing an IP address on ORANGE."
+msgstr ""
+
+#: networking.c:199
+msgid "No BLUE interface assigned."
+msgstr ""
+
+#: networking.c:205
+msgid "Missing an IP address on BLUE."
+msgstr ""
+
+#: networking.c:217
+msgid "Misssing DNS."
+msgstr ""
+
+#: networking.c:224
+msgid "Missing Default Gateway."
+msgstr ""
+
+#: networking.c:237 networking.c:304
+msgid "Network configuration type"
+msgstr ""
+
+#: networking.c:238 networking.c:409
+msgid "Drivers and card assignments"
+msgstr ""
+
+#: networking.c:239 networking.c:640
+msgid "Address settings"
+msgstr ""
+
+#: networking.c:240 networking.c:743
+msgid "DNS and Gateway settings"
+msgstr ""
+
+#: networking.c:260
+msgid "When configuration is complete, a network restart will be required."
+msgstr ""
+
+#: networking.c:267
+#, c-format
+msgid ""
+"Current config: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: networking.c:268
+msgid "Network configuration menu"
+msgstr ""
+
+#: networking.c:269 networking.c:520 networking.c:642
+msgid "Done"
+msgstr ""
+
+#: networking.c:300
+#, c-format
+msgid ""
+"Select the network configuration for %s. The following configuration types "
+"list those interfaces which have ethernet attached. If you change this "
+"setting, a network restart will be required, and you will have to "
+"reconfigure the network driver assignments."
+msgstr ""
+
+#: networking.c:307
+#, c-format
+msgid ""
+"Not enough netcards for your choice.\n"
+"\n"
+"Needed: %d - Available: %d\n"
+msgstr ""
+
+#: networking.c:359
+msgid ""
+"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
+"\n"
+msgstr ""
+
+#: networking.c:408
+msgid "Do you wish to change these settings?"
+msgstr ""
+
+#: networking.c:447
+msgid "Restarting non-local network..."
+msgstr ""
+
+#: networking.c:464
+msgid ""
+"Please choose the interface you wish to change.\n"
+"\n"
+msgstr ""
+
+#: networking.c:519
+msgid "Assigned Cards"
+msgstr ""
+
+#: networking.c:520
+msgid "Remove"
+msgstr ""
+
+#: networking.c:556 networking.c:649
+#, c-format
+msgid ""
+"If you change this IP address, and you are logged in remotely, your "
+"connection to the %s machine will be broken, and you will have to reconnect "
+"on the new IP. This is a risky operation, and should only be attempted if "
+"you have physical access to the machine, should something go wrong."
+msgstr ""
+
+#: networking.c:641
+msgid "Select the interface you wish to reconfigure."
+msgstr ""
+
+#: networking.c:729
+msgid "Default gateway:"
+msgstr ""
+
+#: networking.c:744
+msgid ""
+"Enter the DNS and gateway information. These settings are used only with "
+"Static IP (and DHCP if DNS set) on the RED interface."
+msgstr ""
+
+#: networking.c:773
+msgid "Default gateway"
+msgstr ""
+
+#: networking.c:780
+msgid "Secondary DNS specified without a Primary DNS"
+msgstr ""
+
+#: passwords.c:33
+msgid ""
+"Enter the 'root' user password. Login as this user for commandline access."
+msgstr ""
+
+#: passwords.c:38 passwords.c:61
+msgid "Setting password"
+msgstr ""
+
+#: passwords.c:38
+msgid "Setting 'root' password...."
+msgstr ""
+
+#: passwords.c:39
+msgid "Problem setting 'root' password."
+msgstr ""
+
+#: passwords.c:53
+#, c-format
+msgid ""
+"Enter %s 'admin' user password. This is the user to use for logging into the"
+" %s web administration pages."
+msgstr ""
+
+#: passwords.c:60
+#, c-format
+msgid "Setting %s 'admin' user password..."
+msgstr ""
+
+#: passwords.c:62
+#, c-format
+msgid "Problem setting %s 'admin' user password."
+msgstr ""
+
+#: passwords.c:76
+msgid "Password:"
+msgstr ""
+
+#: passwords.c:77
+msgid "Again:"
+msgstr ""
+
+#: passwords.c:95
+msgid "Password cannot be blank."
+msgstr ""
+
+#: passwords.c:102
+msgid "Passwords do not match."
+msgstr ""
+
+#: passwords.c:109
+msgid "Password cannot contain spaces."
+msgstr ""
+
+#: timezone.c:77
+msgid "Choose the timezone you are in from the list below."
+msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Jacques Hylkema <j.hylkema@intronics.nl>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-02-03 07:00+0000\n"
+"Last-Translator: Jacques Hylkema <j.hylkema@intronics.nl>\n"
"Language-Team: Dutch (http://www.transifex.com/projects/p/ipfire/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "Start adres:"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "Eind adres:"
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "Primaire DNS:"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "Secundaire DNS:"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "Standaard lease (minuten):"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "Maximum lease (minuten):"
#: dhcp.c:56
msgid "Domain name suffix:"
-msgstr ""
+msgstr "Domein naam achtervoegsel:"
#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "Kon instellingen bestand niet openen"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "DHCP server configuratie"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "Configureer de DHCP server door de instellingen in te voeren."
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "Ingeschakeld"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
#: timezone.c:78
msgid "OK"
-msgstr ""
+msgstr "Oke"
#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "Annuleren"
#: dhcp.c:156
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "De volgende velden zijn ongeldig:\n\n"
#: dhcp.c:159
msgid "Start address"
-msgstr ""
+msgstr "Start adres"
#: dhcp.c:165
msgid "End address"
-msgstr ""
+msgstr "Eind adres"
#: dhcp.c:173 networking.c:755
msgid "Primary DNS"
-msgstr ""
+msgstr "Primaire DNS"
#: dhcp.c:182 networking.c:764
msgid "Secondary DNS"
-msgstr ""
+msgstr "Secundaire DNS"
#: dhcp.c:189
msgid "Default lease time"
-msgstr ""
+msgstr "Standaard lease tijd"
#: dhcp.c:195
msgid "Max. lease time"
-msgstr ""
+msgstr "Maximum lease tijd"
#: domainname.c:42 main.c:70
msgid "Domain name"
-msgstr ""
+msgstr "Domein naam"
#: domainname.c:42
msgid "Enter Domain name"
-msgstr ""
+msgstr "Voer domein naam in"
#: domainname.c:48
msgid "Domain name cannot be empty."
-msgstr ""
+msgstr "Domein naam kan niet leeg zijn."
#: domainname.c:50
msgid "Domain name cannot contain spaces."
-msgstr ""
+msgstr "Domein naam kan geen spaties bevatten."
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "Domein naam mag uitsluitend letters, nummers, koppeltekens en punten bevatten."
#: hostname.c:46 main.c:69
msgid "Hostname"
-msgstr ""
+msgstr "hostnaam"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr ""
+msgstr "Voer de hostnaam voor deze machine in."
#: hostname.c:53
msgid "Hostname cannot be empty."
-msgstr ""
+msgstr "Hostnaam kan niet leeg zijn."
#: hostname.c:55
msgid "Hostname cannot contain spaces."
-msgstr ""
+msgstr "Hostnaam kan geen spaties bevatten."
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
-msgstr ""
+msgstr " Hostnaam mag uitsluitend letters, nummers en koppeltekens bevatten."
#: keymap.c:84 main.c:67
msgid "Keyboard mapping"
-msgstr ""
+msgstr "Toetsenbord indeling"
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr ""
+msgstr "Kies het toetsenbord type dat je gebruikt uit onderstaande lijst."
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "Tijdzone"
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "Netwerken"
#: main.c:72 misc.c:147
msgid "ISDN"
-msgstr ""
+msgstr "ISDN"
#: main.c:73
msgid "'root' password"
-msgstr ""
+msgstr "'root' wachtwoord"
#: main.c:74
msgid "'admin' password"
-msgstr ""
+msgstr "'admin' wachtwoord"
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> tussen onderdelen | <Space> selecteer"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "Sectie menu"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "Selecteer het onderdeel dat je wil configureren."
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Stoppen"
#: main.c:172
msgid "Setup is complete."
-msgstr ""
+msgstr "Installatie is gereed."
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Waarschuwing"
#: main.c:175
msgid ""
"Initial setup was not entirely complete. You must ensure that Setup is "
"properly finished by running setup again at the shell."
-msgstr ""
+msgstr "Initiële configuratie was niet voltooid. Je moet ervoor zorgen dat de installatie wordt voltooid door 'setup' opnieuw uit te voeren vanaf de shell."
#: misc.c:62
#, c-format
msgid "Unable to write %s/main/hostname.conf"
-msgstr ""
+msgstr "Kon %s/main/hostname.conf niet wegschrijven"
#: misc.c:71
msgid "Unable to open main hosts file."
-msgstr ""
+msgstr "Kon het hosts bestand niet openen."
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "Kon /etc/hosts niet wegschrijven."
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr "Kon /etc/hosts.deny niet wegschrijven."
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "Kon /etc/hosts.allow niet wegschrijven."
#: misc.c:136
msgid "Unable to set hostname."
-msgstr ""
+msgstr "Kon de hostnaam niet instellen."
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
-msgstr ""
+msgstr "Scannen en configureren van ISDN apparaten."
#: misc.c:148
msgid "Unable to scan for ISDN devices."
-msgstr ""
+msgstr "Kon ISDN apparaten niet scannen."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "Interface - %s"
#: netstuff.c:91
#, c-format
msgid "Enter the IP address information for the %s interface."
-msgstr ""
+msgstr "Voer de IP adres gegevens in voor de %s interface."
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Statisch"
#: netstuff.c:104
msgid "DHCP"
-msgstr ""
+msgstr "DHCP"
#: netstuff.c:105
msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
-msgstr ""
+msgstr "PPP DIALUP (PPPoE, modem, ATM ...)"
#: netstuff.c:113
msgid "DHCP Hostname:"
-msgstr ""
+msgstr "DHCP Hostnaam:"
#: netstuff.c:115
msgid "Force DHCP MTU:"
-msgstr ""
+msgstr "Forceer DHCP MTU:"
#: netstuff.c:134
msgid "IP address:"
-msgstr ""
+msgstr "IP adres:"
#: netstuff.c:146
msgid "Network mask:"
-msgstr ""
+msgstr "Netwerk masker:"
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
-msgstr ""
+msgstr "De volgende velden zijn ongeldig:"
#: netstuff.c:183
msgid "IP address"
-msgstr ""
+msgstr "IP adres"
#: netstuff.c:189
msgid "Network mask"
-msgstr ""
+msgstr "Netwerk masker"
#: netstuff.c:198
msgid "DHCP hostname"
-msgstr ""
+msgstr "DHCP hostnaam"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
-msgstr ""
+msgstr "Niet ingesteld"
#: netstuff.c:669
#, c-format
msgid "Please choose a networkcard for the following interface - %s."
-msgstr ""
+msgstr "Kies een netwerkkaart voor de volgende interface - %s."
#: netstuff.c:672
msgid "Extended Network Menu"
-msgstr ""
+msgstr "Uitgebreid Netwerk Menu"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Selecteer"
#: netstuff.c:673
msgid "Identify"
-msgstr ""
+msgstr "Identificeer"
#: netstuff.c:678
msgid "Device Identification"
-msgstr ""
+msgstr "Apparaat identificatie"
#: netstuff.c:678
msgid "The lights on the selected port should flash now for 10 seconds..."
-msgstr ""
+msgstr "De lampjes op de geselecteerde netwerkkaart zouden nu 10 seconden moeten flikkeren..."
#: netstuff.c:679
msgid "Identification is not supported by this interface."
-msgstr ""
+msgstr "Identificatie wordt niet ondersteund door deze netwerkkaart."
#: netstuff.c:691
msgid "There are no unassigned interfaces on your system."
-msgstr ""
+msgstr "Er zijn geen niet-toegewezen netwerkkaarten in je systeem"
#: netstuff.c:732
#, c-format
msgid "Do you really want to remove the assigned %s interface?"
-msgstr ""
+msgstr "Wil je de toegewezen %s interface echt verwijderen?"
#: netstuff.c:755
msgid "Select network driver"
-msgstr ""
+msgstr "Selecteer netwerk stuurprogramma"
#: netstuff.c:755
msgid "Set additional module parameters"
-msgstr ""
+msgstr "Stel additionele module parameters in"
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "Bezig met laden van module..."
#: netstuff.c:777
msgid "Unable to load driver module."
-msgstr ""
+msgstr "Kan driver module niet laden."
#: netstuff.c:780
msgid "Module name cannot be blank."
-msgstr ""
+msgstr "Module naam mag niet leeg zijn."
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "Bezig met stoppen van netwerk..."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "Bezig met herstarten van netwerk..."
#: networking.c:146
msgid "No GREEN interface assigned."
-msgstr ""
+msgstr "Geen GROENE interface toegewezen."
#: networking.c:152
msgid "Missing an IP address on GREEN."
-msgstr ""
+msgstr "Geen IP adres toegewezen aan GROEN."
#: networking.c:163
msgid "Error"
-msgstr ""
+msgstr "Fout"
#: networking.c:163
msgid "Ignore"
-msgstr ""
+msgstr "Negeer"
#: networking.c:164
msgid "No RED interface assigned."
-msgstr ""
+msgstr "Geen RODE interface toegewezen."
#: networking.c:173
msgid "Missing an IP address on RED."
-msgstr ""
+msgstr "Geen IP adres toegewezen aan ROOD."
#: networking.c:183
msgid "No ORANGE interface assigned."
-msgstr ""
+msgstr "Geen ORANJE interface toegewezen."
#: networking.c:189
msgid "Missing an IP address on ORANGE."
-msgstr ""
+msgstr "Geen IP adres toegewezen aan ORANJE"
#: networking.c:199
msgid "No BLUE interface assigned."
-msgstr ""
+msgstr "Geen BLAUWE interface toegewezen."
#: networking.c:205
msgid "Missing an IP address on BLUE."
-msgstr ""
+msgstr "Geen IP adres toegewezen aan BLAUW."
#: networking.c:217
msgid "Misssing DNS."
-msgstr ""
+msgstr "DNS gegevens ontbreken."
#: networking.c:224
msgid "Missing Default Gateway."
-msgstr ""
+msgstr "Standaard gateway ontbreekt."
#: networking.c:237 networking.c:304
msgid "Network configuration type"
-msgstr ""
+msgstr "Netwerk configuratie type"
#: networking.c:238 networking.c:409
msgid "Drivers and card assignments"
-msgstr ""
+msgstr "Drivers en kaart toewijzingen"
#: networking.c:239 networking.c:640
msgid "Address settings"
-msgstr ""
+msgstr "Adres instellingen"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
-msgstr ""
+msgstr "DNS en Gateway instellingen"
#: networking.c:260
msgid "When configuration is complete, a network restart will be required."
-msgstr ""
+msgstr "Nadat de configuratie is voltooid, moet het netwerk worden herstart."
#: networking.c:267
#, c-format
"Current config: %s\n"
"\n"
"%s"
-msgstr ""
+msgstr "Huidige configuratie: %s\n\n%s"
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "Netwerk configuratie menu"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
-msgstr ""
+msgstr "Gereed"
#: networking.c:300
#, c-format
"list those interfaces which have ethernet attached. If you change this "
"setting, a network restart will be required, and you will have to "
"reconfigure the network driver assignments."
-msgstr ""
+msgstr "Selecteer de netwerk configuratie voor %s. De volgende configuratie types laten alleen de netwerkkaarten zien die op ethernet zijn aangesloten. Als je dit wijzigt, moet het netwerk worden herstart en moet je de netwerk driver toewijzingen opnieuw configureren."
#: networking.c:307
#, c-format
"Not enough netcards for your choice.\n"
"\n"
"Needed: %d - Available: %d\n"
-msgstr ""
+msgstr "Er zijn onvoldoende netwerkkaarten aanwezig voor je keuze.\n\nBenodigd: %d - Beschikbaar: %d\n"
#: networking.c:359
msgid ""
"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
"\n"
-msgstr ""
+msgstr "Configureer netwerk drivers, en welke netwerkkaart aan welke interface is toegewezen. De huidige configuratie is het volgende:\n\n"
#: networking.c:408
msgid "Do you wish to change these settings?"
-msgstr ""
+msgstr "Wil je deze instellingen wijzigen?"
#: networking.c:447
msgid "Restarting non-local network..."
-msgstr ""
+msgstr "Bezig met herstarten van het niet-lokale netwerk..."
#: networking.c:464
msgid ""
"Please choose the interface you wish to change.\n"
"\n"
-msgstr ""
+msgstr "Kies de interface die je wil wijzigen.\n\n"
#: networking.c:519
msgid "Assigned Cards"
-msgstr ""
+msgstr "Toegewezen kaarten"
#: networking.c:520
msgid "Remove"
-msgstr ""
+msgstr "Verwijder"
#: networking.c:556 networking.c:649
#, c-format
"connection to the %s machine will be broken, and you will have to reconnect "
"on the new IP. This is a risky operation, and should only be attempted if "
"you have physical access to the machine, should something go wrong."
-msgstr ""
+msgstr "Als je dit IP adres wijzigt en je bent op afstand ingelogd, dan zal je connectie naar de %s machine worden onderbroken en moet je opnieuw inloggen op het nieuwe IP adres. Dit is een risicovolle operatie die alleen zou moeten worden uitgevoerd als je fysieke toegang tot de machine hebt, mocht er iets misgaan."
#: networking.c:641
msgid "Select the interface you wish to reconfigure."
-msgstr ""
+msgstr "Selecteer de interface die je wil herconfigureren."
#: networking.c:729
msgid "Default gateway:"
-msgstr ""
+msgstr "Standaard gateway:"
#: networking.c:744
msgid ""
"Enter the DNS and gateway information. These settings are used only with "
"Static IP (and DHCP if DNS set) on the RED interface."
-msgstr ""
+msgstr "Voer de DNS en gatway informatie in. Deze instellingen worden alleen gebruikt indien een statisch IP adres (en DHCP indien DNS is ingesteld) voor de RODE interface is ingesteld."
#: networking.c:773
msgid "Default gateway"
-msgstr ""
+msgstr "Standaard gateway"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
-msgstr ""
+msgstr "Er is een secundaire DNS ingesteld zonder dat een primaire DNS is ingesteld"
#: passwords.c:33
msgid ""
"Enter the 'root' user password. Login as this user for commandline access."
-msgstr ""
+msgstr "Voer het 'root' wachtwoord in. Log als deze gebruiker in voor commando regel toegang."
#: passwords.c:38 passwords.c:61
msgid "Setting password"
-msgstr ""
+msgstr "Instellen wachtwoord"
#: passwords.c:38
msgid "Setting 'root' password...."
-msgstr ""
+msgstr "Instellen 'root' wachtwoord..."
#: passwords.c:39
msgid "Problem setting 'root' password."
-msgstr ""
+msgstr "Probleem bij instellen van 'root' wachtwoord."
#: passwords.c:53
#, c-format
msgid ""
"Enter %s 'admin' user password. This is the user to use for logging into the"
" %s web administration pages."
-msgstr ""
+msgstr "Voer het %s 'admin' gebruiker wachtwoord in. Dit is de gebruiker om mee in te loggen op de %s web administratie interface."
#: passwords.c:60
#, c-format
msgid "Setting %s 'admin' user password..."
-msgstr ""
+msgstr "Instellen %s 'admin' wachtwoord..."
#: passwords.c:62
#, c-format
msgid "Problem setting %s 'admin' user password."
-msgstr ""
+msgstr "Probleem bij instellen van %s 'admin' wachtwoord."
#: passwords.c:76
msgid "Password:"
-msgstr ""
+msgstr "Wachtwoord:"
#: passwords.c:77
msgid "Again:"
-msgstr ""
+msgstr "Nogmaals:"
#: passwords.c:95
msgid "Password cannot be blank."
-msgstr ""
+msgstr "Wachtwoord mag niet leeg zijn."
#: passwords.c:102
msgid "Passwords do not match."
-msgstr ""
+msgstr "Wachtwoorden komen niet overeen,"
#: passwords.c:109
msgid "Password cannot contain spaces."
-msgstr ""
+msgstr "Wachtwoord mag geen spaties bevatten."
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
-msgstr ""
+msgstr "Kies de tijdzone waar je bent uit onderstaande lijst."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# btelega <btelega@gmail.com>, 2014
+# Przemysław Karpeta <przemyslaw.karpeta@gmail.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2014-11-03 15:36+0000\n"
+"Last-Translator: Przemysław Karpeta <przemyslaw.karpeta@gmail.com>\n"
"Language-Team: Polish (http://www.transifex.com/projects/p/ipfire/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "Adres początkowy:"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "Adres końcowy:"
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "Główny DNS:"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "Pomocniczy DNS:"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "Domyślna dzierżawa (min.):"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "Maksymalna dzierżawa (min.):"
#: dhcp.c:56
msgid "Domain name suffix:"
-msgstr ""
+msgstr "Przyrostek domeny: "
#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "Nie można otworzyć pliku ustawień"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "Konfiguracja serwera DHCP "
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "Skonfiguruj serwer DHCP wprowadzając właściwe ustawienia."
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "Włączony"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
#: timezone.c:78
msgid "OK"
-msgstr ""
+msgstr "OK"
#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "Anuluj"
#: dhcp.c:156
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "Następujące pola są nieprawidłowe:\n\n"
#: dhcp.c:159
msgid "Start address"
-msgstr ""
+msgstr "Adres początkowy"
#: dhcp.c:165
msgid "End address"
-msgstr ""
+msgstr "Adres końcowy"
#: dhcp.c:173 networking.c:755
msgid "Primary DNS"
-msgstr ""
+msgstr "Główny DNS"
#: dhcp.c:182 networking.c:764
msgid "Secondary DNS"
-msgstr ""
+msgstr "Pomocniczy DNS"
#: dhcp.c:189
msgid "Default lease time"
-msgstr ""
+msgstr "Domyślny okres dzierżawy"
#: dhcp.c:195
msgid "Max. lease time"
-msgstr ""
+msgstr "Maksymalny okres dzierżawy"
#: domainname.c:42 main.c:70
msgid "Domain name"
-msgstr ""
+msgstr "Nazwa Domeny"
#: domainname.c:42
msgid "Enter Domain name"
-msgstr ""
+msgstr "Wpisz nazwę Domeny"
#: domainname.c:48
msgid "Domain name cannot be empty."
-msgstr ""
+msgstr "Nazwa Domeny nie może być pusta"
#: domainname.c:50
msgid "Domain name cannot contain spaces."
-msgstr ""
+msgstr "Nazwa domeny nie może zawierać spacji."
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "Nazwa domeny może zawierać jedynie litery, cyfry, myślniki i kropki."
#: hostname.c:46 main.c:69
msgid "Hostname"
-msgstr ""
+msgstr "Nazwa hosta"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr ""
+msgstr "Wprowadź nazwę hosta."
#: hostname.c:53
msgid "Hostname cannot be empty."
-msgstr ""
+msgstr "Nazwa hosta nie może być pusta."
#: hostname.c:55
msgid "Hostname cannot contain spaces."
-msgstr ""
+msgstr "Nazwa hosta nie może zawierać spacji."
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
-msgstr ""
+msgstr "Nazwa hosta może zawierać tylko litery, cyfry i myślniki."
#: keymap.c:84 main.c:67
msgid "Keyboard mapping"
-msgstr ""
+msgstr "Mapowanie klawiatury"
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr ""
+msgstr "Wybierz używany przez siebie typ klawiatury z poniższej listy."
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "Strefa czasowa"
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "Sieć"
#: main.c:72 misc.c:147
msgid "ISDN"
-msgstr ""
+msgstr "ISDN"
#: main.c:73
msgid "'root' password"
-msgstr ""
+msgstr "Hasło użytkownika 'root'"
#: main.c:74
msgid "'admin' password"
-msgstr ""
+msgstr "Hasło użytkownika 'admin'"
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
-msgstr ""
+msgstr " <Tab>/<Alt-Tab> przełącza między elementami | <Space> wybiera"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "Menu sekcji"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "Wybierz element który chcesz skonfigurować."
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Wyjście"
#: main.c:172
msgid "Setup is complete."
-msgstr ""
+msgstr "Instalacja zakończona"
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Ostrzeżenie"
#: main.c:175
msgid ""
"Initial setup was not entirely complete. You must ensure that Setup is "
"properly finished by running setup again at the shell."
-msgstr ""
+msgstr "Wstępna konfiguracjia nie została ukończona. Musisz upewnić się, że konfiguracja jest ukończona poprzez ponowne uruchomienie polecenia 'setup' w powłoce."
#: misc.c:62
#, c-format
msgid "Unable to write %s/main/hostname.conf"
-msgstr ""
+msgstr "Nie można zapisać %s/main/hostname.conf"
#: misc.c:71
msgid "Unable to open main hosts file."
-msgstr ""
+msgstr "Nie można otworzyc głównego pliku hosts."
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "Nie można zapisać /etc/hosts"
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr "Nie można zapisać /etc/hosts.deny"
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "Nie można zapisać /etc/hosts.allow"
#: misc.c:136
msgid "Unable to set hostname."
-msgstr ""
+msgstr "Ustawienie nazwy hosta niemożliwe."
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
-msgstr ""
+msgstr "Wykrywanie i konfiguracja urządzeń ISDN."
#: misc.c:148
msgid "Unable to scan for ISDN devices."
-msgstr ""
+msgstr "Wykrywanie urządzeń ISDN jest niemożliwe."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "Interfejs - %s"
#: netstuff.c:91
#, c-format
msgid "Enter the IP address information for the %s interface."
-msgstr ""
+msgstr "Wprowadź ustawienia adresu IP dla interfejsu %s."
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Statyczny"
#: netstuff.c:104
msgid "DHCP"
-msgstr ""
+msgstr "DHCP"
#: netstuff.c:105
msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
-msgstr ""
+msgstr "PPP DIALUP (PPPoE, modem, ATM ...)"
#: netstuff.c:113
msgid "DHCP Hostname:"
-msgstr ""
+msgstr "Nazwa hosta DHCP:"
#: netstuff.c:115
msgid "Force DHCP MTU:"
-msgstr ""
+msgstr "Wymuś DHCP MTU:"
#: netstuff.c:134
msgid "IP address:"
-msgstr ""
+msgstr "IP address:"
#: netstuff.c:146
msgid "Network mask:"
-msgstr ""
+msgstr "Maska podsieci:"
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
-msgstr ""
+msgstr "Następujące pola są nieprawidłowe:"
#: netstuff.c:183
msgid "IP address"
-msgstr ""
+msgstr "IP address"
#: netstuff.c:189
msgid "Network mask"
-msgstr ""
+msgstr "Maska podsieci"
#: netstuff.c:198
msgid "DHCP hostname"
-msgstr ""
+msgstr "Nazwa hosta DHCP"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
-msgstr ""
+msgstr "Wyłącz"
#: netstuff.c:669
#, c-format
msgid "Please choose a networkcard for the following interface - %s."
-msgstr ""
+msgstr "Proszę wybrać kartę sieciową dla następującego interfejsu - %s"
#: netstuff.c:672
msgid "Extended Network Menu"
-msgstr ""
+msgstr "Rozszerzone Menu Sieci"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Wybierz"
#: netstuff.c:673
msgid "Identify"
-msgstr ""
+msgstr "Zidentyfikuj"
#: netstuff.c:678
msgid "Device Identification"
-msgstr ""
+msgstr "Identyfikacja urządzenia"
#: netstuff.c:678
msgid "The lights on the selected port should flash now for 10 seconds..."
-msgstr ""
+msgstr "Kontrolki na wybranym porcie powinny migotać przez następne 10 sekund..."
#: netstuff.c:679
msgid "Identification is not supported by this interface."
-msgstr ""
+msgstr "Ten interfejs nie wspiera identyfikacji."
#: netstuff.c:691
msgid "There are no unassigned interfaces on your system."
-msgstr ""
+msgstr "Nie ma już nieprzydzielonych interfejsów w systemie."
#: netstuff.c:732
#, c-format
msgid "Do you really want to remove the assigned %s interface?"
-msgstr ""
+msgstr "Na pewno chcesz usunąć przydzielony interfejs %s ?"
#: netstuff.c:755
msgid "Select network driver"
-msgstr ""
+msgstr "Wybierz sterownik karty sieciowej"
#: netstuff.c:755
msgid "Set additional module parameters"
-msgstr ""
+msgstr "Ustaw dodatkowe parametry modułu"
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "Wczytywanie modułu..."
#: netstuff.c:777
msgid "Unable to load driver module."
-msgstr ""
+msgstr "Nie da się wczytać modułu."
#: netstuff.c:780
msgid "Module name cannot be blank."
-msgstr ""
+msgstr "Nazwa modułu nie może być pusta."
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "Zatrzymywanie sieci..."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "Ponowne uruchamianie sieci..."
#: networking.c:146
msgid "No GREEN interface assigned."
-msgstr ""
+msgstr "Interfejs GREEN nie został przypisany."
#: networking.c:152
msgid "Missing an IP address on GREEN."
-msgstr ""
+msgstr "Brak adresu IP na GREEN."
#: networking.c:163
msgid "Error"
-msgstr ""
+msgstr "Błąd"
#: networking.c:163
msgid "Ignore"
-msgstr ""
+msgstr "Ignoruj"
#: networking.c:164
msgid "No RED interface assigned."
-msgstr ""
+msgstr "Interfejs RED nie został przypisany."
#: networking.c:173
msgid "Missing an IP address on RED."
-msgstr ""
+msgstr "Brak adresu IP na RED."
#: networking.c:183
msgid "No ORANGE interface assigned."
-msgstr ""
+msgstr "Interfejs ORANGE nie został przypisany."
#: networking.c:189
msgid "Missing an IP address on ORANGE."
-msgstr ""
+msgstr "Brak adresu IP na ORANGE."
#: networking.c:199
msgid "No BLUE interface assigned."
-msgstr ""
+msgstr "Interfejs BLUE nie został przypisany."
#: networking.c:205
msgid "Missing an IP address on BLUE."
-msgstr ""
+msgstr "Brak adresu IP na BLUE."
#: networking.c:217
msgid "Misssing DNS."
-msgstr ""
+msgstr "Brakuje DNS."
#: networking.c:224
msgid "Missing Default Gateway."
-msgstr ""
+msgstr "Brakuje Bramy Domyślnej."
#: networking.c:237 networking.c:304
msgid "Network configuration type"
-msgstr ""
+msgstr "Rodzaj konfiguracji sieci"
#: networking.c:238 networking.c:409
msgid "Drivers and card assignments"
-msgstr ""
+msgstr "Przydziały sterowników i kart"
#: networking.c:239 networking.c:640
msgid "Address settings"
-msgstr ""
+msgstr "Ustawienia adresu"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
-msgstr ""
+msgstr "Ustawienia DNS i Bramy"
#: networking.c:260
msgid "When configuration is complete, a network restart will be required."
-msgstr ""
+msgstr "Po ukończeniu konfiguracji wymagane będzie ponowne uruchomienie sieci."
#: networking.c:267
#, c-format
"Current config: %s\n"
"\n"
"%s"
-msgstr ""
+msgstr "Obecna konfiguracja: %s\n\n%s"
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "Menu konfiguracji sieci"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
-msgstr ""
+msgstr "Zrobione"
#: networking.c:300
#, c-format
"list those interfaces which have ethernet attached. If you change this "
"setting, a network restart will be required, and you will have to "
"reconfigure the network driver assignments."
-msgstr ""
+msgstr "Wybierz konfigurację sieci dla %s. Poniższe typy konfiguracji wyświetlają interfejsy z przyłączonym ethernetem. Jeśli zmienisz te ustawienia, wymagany będzie restart sieci, i trzeba będzie zrekonfigurować przydziały sterowników kart sieciowych. "
#: networking.c:307
#, c-format
"Not enough netcards for your choice.\n"
"\n"
"Needed: %d - Available: %d\n"
-msgstr ""
+msgstr "Niewystarczająca liczba kart sieciowych.\n\nPotrzebne: %d - Dostępne: %d\n"
#: networking.c:359
msgid ""
"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
"\n"
-msgstr ""
+msgstr "Skonfiguruj sterowniki kart sieciowych, i przydziel karty do odpowiednich interfejsów. Obecna konfiguracja wygląda tak:\n\n"
#: networking.c:408
msgid "Do you wish to change these settings?"
-msgstr ""
+msgstr "Czy chcesz zmienić te ustawienia ?"
#: networking.c:447
msgid "Restarting non-local network..."
-msgstr ""
+msgstr "Ponowne uruchamianie sieci innych, niż lokalna..."
#: networking.c:464
msgid ""
"Please choose the interface you wish to change.\n"
"\n"
-msgstr ""
+msgstr "Wybierz interfejs, który chcesz zmienić.\n\n"
#: networking.c:519
msgid "Assigned Cards"
-msgstr ""
+msgstr "Przypisane Karty"
#: networking.c:520
msgid "Remove"
-msgstr ""
+msgstr "Usuń"
#: networking.c:556 networking.c:649
#, c-format
"connection to the %s machine will be broken, and you will have to reconnect "
"on the new IP. This is a risky operation, and should only be attempted if "
"you have physical access to the machine, should something go wrong."
-msgstr ""
+msgstr "Jeśli zmienisz ten adres IP, a jesteś zalogowany zdalnie, Twoje połączenie do maszyny %s zostanie zerwane, i trzeba będzie połączyć się ponownie na nowy adres IP. To ryzykowna operacja, która powinna byc podejmowana tylko w przypadku posiadania bezpośredniego, fizycznego dostępu do maszyny na wypadek, gdyby coś poszło źle."
#: networking.c:641
msgid "Select the interface you wish to reconfigure."
-msgstr ""
+msgstr "Zaznacz interfejs, który chcesz zrekonfigurować."
#: networking.c:729
msgid "Default gateway:"
-msgstr ""
+msgstr "Brama domyślna:"
#: networking.c:744
msgid ""
"Enter the DNS and gateway information. These settings are used only with "
"Static IP (and DHCP if DNS set) on the RED interface."
-msgstr ""
+msgstr "Wprowadź informacje o serwerze DNS i bramie. Te ustawienia stosuje się tylko do statycznego IP (i DHCP, gdzie DNS ustawia się ręcznie) na interfejsie RED."
#: networking.c:773
msgid "Default gateway"
-msgstr ""
+msgstr "Brama domyślna"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
-msgstr ""
+msgstr "Podano adres Zapasowego DNS bez podania adresu Podstawowego DNS."
#: passwords.c:33
msgid ""
"Enter the 'root' user password. Login as this user for commandline access."
-msgstr ""
+msgstr "Wprowadź hasło użytkownika 'root'. Zaloguj się jako ten użytkownik, aby uzyskać dostęp do linii poleceń."
#: passwords.c:38 passwords.c:61
msgid "Setting password"
-msgstr ""
+msgstr "Ustawienie hasła"
#: passwords.c:38
msgid "Setting 'root' password...."
-msgstr ""
+msgstr "Ustawianie hasła użytkownika 'root'...."
#: passwords.c:39
msgid "Problem setting 'root' password."
-msgstr ""
+msgstr "Problem z ustawieniem hasła użytkownika 'root'."
#: passwords.c:53
#, c-format
msgid ""
"Enter %s 'admin' user password. This is the user to use for logging into the"
" %s web administration pages."
-msgstr ""
+msgstr "Wprowadź haslo użytkownika 'admin' systemu %s. Zalogowanie się na tego użytkownika umożliwi dostęp do administracyjnej strony WWW %s."
#: passwords.c:60
#, c-format
msgid "Setting %s 'admin' user password..."
-msgstr ""
+msgstr "Ustawianie hasła użytkownika 'admin' systemu %s..."
#: passwords.c:62
#, c-format
msgid "Problem setting %s 'admin' user password."
-msgstr ""
+msgstr "Problem z ustawieniem hasła użytkownika 'admin' systemu %s."
#: passwords.c:76
msgid "Password:"
-msgstr ""
+msgstr "Hasło:"
#: passwords.c:77
msgid "Again:"
-msgstr ""
+msgstr "Ponownie:"
#: passwords.c:95
msgid "Password cannot be blank."
-msgstr ""
+msgstr "Hasło nie może być puste."
#: passwords.c:102
msgid "Passwords do not match."
-msgstr ""
+msgstr "Hasła nie są zgodne."
#: passwords.c:109
msgid "Password cannot contain spaces."
-msgstr ""
+msgstr "Hasło nie może zawierać spacji."
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
-msgstr ""
+msgstr "Wybierz strefę czasową w której się znajdujesz z listy poniżej."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# douglasdiasn <douglasdiasn@gmail.com>, 2015
+# Evertton de Lima <e.everttonlima@gmail.com>, 2015
+# Rafael Tavares <rafael@ibinetwork.com.br>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-02-16 23:15+0000\n"
+"Last-Translator: Evertton de Lima <e.everttonlima@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/ipfire/language/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "Endereço de Inicial:"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "Endereço final:"
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "DNS Primário:"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "DNS Secundário:"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "Tempo padrão (mins):"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "Tempo máximo (mins)"
#: dhcp.c:56
msgid "Domain name suffix:"
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "Não foi possível abrir o arquivo de configurações"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "Configurar servidor DHCP"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "Configurar servidor DHCP digitando as informações de configuração"
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "Habilitado"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
#: timezone.c:78
msgid "OK"
-msgstr ""
+msgstr "Ok"
#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "Cancelar"
#: dhcp.c:156
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "Os campos a seguir são inválidos: \n"
#: dhcp.c:159
msgid "Start address"
-msgstr ""
+msgstr "Endereço de Inicial"
#: dhcp.c:165
msgid "End address"
-msgstr ""
+msgstr "Endereço final"
#: dhcp.c:173 networking.c:755
msgid "Primary DNS"
-msgstr ""
+msgstr "DNS Primário"
#: dhcp.c:182 networking.c:764
msgid "Secondary DNS"
-msgstr ""
+msgstr "DNS Secundário"
#: dhcp.c:189
msgid "Default lease time"
-msgstr ""
+msgstr "Tempo padrão"
#: dhcp.c:195
msgid "Max. lease time"
-msgstr ""
+msgstr "Tempo máximo padrão"
#: domainname.c:42 main.c:70
msgid "Domain name"
-msgstr ""
+msgstr "Domínio "
#: domainname.c:42
msgid "Enter Domain name"
-msgstr ""
+msgstr "Entre com o nome do Domínio"
#: domainname.c:48
msgid "Domain name cannot be empty."
-msgstr ""
+msgstr "O nome de Domínio não pode ser vazio."
#: domainname.c:50
msgid "Domain name cannot contain spaces."
-msgstr ""
+msgstr "O nome de Domínio não pode conter \"espaços\"."
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "O nome de Domínio pode conter somente letras, números, hífens e pontos."
#: hostname.c:46 main.c:69
msgid "Hostname"
-msgstr ""
+msgstr "Hostname"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr ""
+msgstr "Entre com o nome do host."
#: hostname.c:53
msgid "Hostname cannot be empty."
-msgstr ""
+msgstr "O nome de Host não pode ser vazio."
#: hostname.c:55
msgid "Hostname cannot contain spaces."
-msgstr ""
+msgstr "O nome de Host não pode conter \"espaços\"."
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
-msgstr ""
+msgstr "O nome de Host pode conter somente Letras, números e hífens."
#: keymap.c:84 main.c:67
msgid "Keyboard mapping"
-msgstr ""
+msgstr "Selecione seu teclado"
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr ""
+msgstr "Escolha o tipo do teclado que você esta usando a partir da lista abaixo:"
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "Fuso horário "
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "Rede"
#: main.c:72 misc.c:147
msgid "ISDN"
-msgstr ""
+msgstr "ISDN"
#: main.c:73
msgid "'root' password"
-msgstr ""
+msgstr "senha 'ROOT'"
#: main.c:74
msgid "'admin' password"
-msgstr ""
+msgstr "senha 'ADMIN'"
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> entre elementos | <Space> seleciona"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "Menu de seleção"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "Selecione um item para configurar."
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Sair"
#: main.c:172
msgid "Setup is complete."
-msgstr ""
+msgstr "Configuração completa."
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Atenção"
#: main.c:175
msgid ""
"Initial setup was not entirely complete. You must ensure that Setup is "
"properly finished by running setup again at the shell."
-msgstr ""
+msgstr "O setup inicial não foi inteiramente completo. Você deve se certificar que o Setup foi finalizado corretamente rodando o setup novamente no shell."
#: misc.c:62
#, c-format
msgid "Unable to write %s/main/hostname.conf"
-msgstr ""
+msgstr "Não foi possível salvar %s/main/hostname.conf"
#: misc.c:71
msgid "Unable to open main hosts file."
-msgstr ""
+msgstr "Não foi possível abrir o arquivo de Hosts Principal"
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "Não foi possível salvar /etc/hosts."
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr "Não foi possível salvar /etc/hosts.deny."
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "Não foi possível salvar /etc/hosts.allow."
#: misc.c:136
msgid "Unable to set hostname."
-msgstr ""
+msgstr "Não foi possível aplicar o Hostname"
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
-msgstr ""
+msgstr "Escaneando e configurando dispositivos ISDN."
#: misc.c:148
msgid "Unable to scan for ISDN devices."
-msgstr ""
+msgstr "Não foi possível escanear por dispositivos ISDN."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "Interface - %s"
#: netstuff.c:91
#, c-format
msgid "Enter the IP address information for the %s interface."
-msgstr ""
+msgstr "Entre com a informação do endereço IP para a interface %s."
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Estático "
#: netstuff.c:104
msgid "DHCP"
-msgstr ""
+msgstr "Automático "
#: netstuff.c:105
msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
-msgstr ""
+msgstr "Discador PPP (PPPoE, modem, ATM ...)"
#: netstuff.c:113
msgid "DHCP Hostname:"
-msgstr ""
+msgstr "Nome do Host DHCP:"
#: netstuff.c:115
msgid "Force DHCP MTU:"
-msgstr ""
+msgstr "Forçar DHCP MTU:"
#: netstuff.c:134
msgid "IP address:"
-msgstr ""
+msgstr "Endereço IP:"
#: netstuff.c:146
msgid "Network mask:"
-msgstr ""
+msgstr "Mascara de rede:"
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
-msgstr ""
+msgstr "Os campos a seguir são inválidos:"
#: netstuff.c:183
msgid "IP address"
-msgstr ""
+msgstr "Endereço IP"
#: netstuff.c:189
msgid "Network mask"
-msgstr ""
+msgstr "Marcara de rede"
#: netstuff.c:198
msgid "DHCP hostname"
-msgstr ""
+msgstr "Nome do Host DHCP:"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
#: netstuff.c:669
#, c-format
msgid "Please choose a networkcard for the following interface - %s."
-msgstr ""
+msgstr "Favor selecionar a Placa de Rede para a interface - %s."
#: netstuff.c:672
msgid "Extended Network Menu"
-msgstr ""
+msgstr "Abrir o menu de redes"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Selecione"
#: netstuff.c:673
msgid "Identify"
-msgstr ""
+msgstr "Identifique"
#: netstuff.c:678
msgid "Device Identification"
-msgstr ""
+msgstr "Identificação do dispositivo"
#: netstuff.c:678
msgid "The lights on the selected port should flash now for 10 seconds..."
-msgstr ""
+msgstr "As luzes da porta selecionada deverão piscar por 10 segundos a partir de agora..."
#: netstuff.c:679
msgid "Identification is not supported by this interface."
-msgstr ""
+msgstr "Identificação não é suportada por esta interface."
#: netstuff.c:691
msgid "There are no unassigned interfaces on your system."
-msgstr ""
+msgstr "Não existem interfaces não associadas em seu sistema."
#: netstuff.c:732
#, c-format
msgid "Do you really want to remove the assigned %s interface?"
-msgstr ""
+msgstr "Você realmente quer remover a interface %s associada?"
#: netstuff.c:755
msgid "Select network driver"
-msgstr ""
+msgstr "Selecionar driver de rede"
#: netstuff.c:755
msgid "Set additional module parameters"
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "Carregando modulo..."
#: netstuff.c:777
msgid "Unable to load driver module."
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "Parando a rede..."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "Reiniciando a rede..."
#: networking.c:146
msgid "No GREEN interface assigned."
-msgstr ""
+msgstr "Nenhuma interface VERDE definida."
#: networking.c:152
msgid "Missing an IP address on GREEN."
-msgstr ""
+msgstr "Faltando endereço IP na interface VERDE."
#: networking.c:163
msgid "Error"
-msgstr ""
+msgstr "Erro"
#: networking.c:163
msgid "Ignore"
-msgstr ""
+msgstr "Ignorar"
#: networking.c:164
msgid "No RED interface assigned."
-msgstr ""
+msgstr "Nenhuma interface VERMELHA definida."
#: networking.c:173
msgid "Missing an IP address on RED."
-msgstr ""
+msgstr "Faltando endereço IP na interface VERMELHA."
#: networking.c:183
msgid "No ORANGE interface assigned."
-msgstr ""
+msgstr "Nenhuma interface LARANJA definida."
#: networking.c:189
msgid "Missing an IP address on ORANGE."
-msgstr ""
+msgstr "Faltando endereço IP na interface LARANJA."
#: networking.c:199
msgid "No BLUE interface assigned."
-msgstr ""
+msgstr "Nenhuma interface AZUL definida."
#: networking.c:205
msgid "Missing an IP address on BLUE."
-msgstr ""
+msgstr "Faltando endereço IP na interface AZUL."
#: networking.c:217
msgid "Misssing DNS."
-msgstr ""
+msgstr "Faltando DNS."
#: networking.c:224
msgid "Missing Default Gateway."
-msgstr ""
+msgstr "Faltando Gateway Padrão."
#: networking.c:237 networking.c:304
msgid "Network configuration type"
-msgstr ""
+msgstr "Tipo de configuração de rede"
#: networking.c:238 networking.c:409
msgid "Drivers and card assignments"
-msgstr ""
+msgstr "Definir Drivers e Placas"
#: networking.c:239 networking.c:640
msgid "Address settings"
-msgstr ""
+msgstr "Configurar endereços"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
-msgstr ""
+msgstr "Configurar Gateway e DNS"
#: networking.c:260
msgid "When configuration is complete, a network restart will be required."
-msgstr ""
+msgstr "Quando a configuração estiver completa, um reinício da rede será necessário."
#: networking.c:267
#, c-format
"Current config: %s\n"
"\n"
"%s"
-msgstr ""
+msgstr "Configuração atual: %s\n\n%s"
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "Menu de configuração de rede"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
-msgstr ""
+msgstr "Pronto"
#: networking.c:300
#, c-format
#: networking.c:408
msgid "Do you wish to change these settings?"
-msgstr ""
+msgstr "Você gostaria de alterar essas configurações?"
#: networking.c:447
msgid "Restarting non-local network..."
-msgstr ""
+msgstr "Reiniciando rede non-local..."
#: networking.c:464
msgid ""
#: networking.c:519
msgid "Assigned Cards"
-msgstr ""
+msgstr "Placas Definidas"
#: networking.c:520
msgid "Remove"
-msgstr ""
+msgstr "Remover"
#: networking.c:556 networking.c:649
#, c-format
#: networking.c:729
msgid "Default gateway:"
-msgstr ""
+msgstr "Gateway padrão:"
#: networking.c:744
msgid ""
#: networking.c:773
msgid "Default gateway"
-msgstr ""
+msgstr "Gateway padrão"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
-msgstr ""
+msgstr "DNS secundário especificado sem um DNS primário"
#: passwords.c:33
msgid ""
#: passwords.c:38 passwords.c:61
msgid "Setting password"
-msgstr ""
+msgstr "Configurar senha"
#: passwords.c:38
msgid "Setting 'root' password...."
-msgstr ""
+msgstr "Configurar senha 'root'"
#: passwords.c:39
msgid "Problem setting 'root' password."
-msgstr ""
+msgstr "Problema ao configurar senha 'root'"
#: passwords.c:53
#, c-format
#: passwords.c:76
msgid "Password:"
-msgstr ""
+msgstr "Senha:"
#: passwords.c:77
msgid "Again:"
-msgstr ""
+msgstr "Novamente:"
#: passwords.c:95
msgid "Password cannot be blank."
-msgstr ""
+msgstr "A senha não pode estar em branco."
#: passwords.c:102
msgid "Passwords do not match."
-msgstr ""
+msgstr "As senhas não coincidem."
#: passwords.c:109
msgid "Password cannot contain spaces."
-msgstr ""
+msgstr "A senha não pode conter espaços."
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
-msgstr ""
+msgstr "Selecione seu fuso horário na lista abaixo."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Andrei Burdea <ragulka@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-01-20 09:08+0000\n"
+"Last-Translator: Andrei Burdea <ragulka@gmail.com>\n"
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/ipfire/language/ro_RO/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "Adresa de Inceput"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "Adresa de Final"
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "Primul Server de Nume - NS1"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "Al Doilea Server de Nume - NS2"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "Alocarea de baza (minute)"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "Alocare Maxima (minute)"
#: dhcp.c:56
msgid "Domain name suffix:"
-msgstr ""
+msgstr "Sufix Nume Domeniu"
#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "Fisier de setari imposibil de deschis"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "Conficurearea serverului DHCP"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "Configureaza serverul DHCP introducand informatiile de setare"
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "Activat"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
#: timezone.c:78
msgid "OK"
-msgstr ""
+msgstr "OK"
#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "Renunta"
#: dhcp.c:156
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "Urmatoarele campuri sunt incorecte\n\n"
#: dhcp.c:159
msgid "Start address"
-msgstr ""
+msgstr "Adresa de Inceput"
#: dhcp.c:165
msgid "End address"
-msgstr ""
+msgstr "Adresa de Final"
#: dhcp.c:173 networking.c:755
msgid "Primary DNS"
-msgstr ""
+msgstr "Primul Server de Nume - NS1"
#: dhcp.c:182 networking.c:764
msgid "Secondary DNS"
-msgstr ""
+msgstr "Al Doilea Server de Nume - NS2"
#: dhcp.c:189
msgid "Default lease time"
-msgstr ""
+msgstr "Timpul pentru alocarea de baza"
#: dhcp.c:195
msgid "Max. lease time"
-msgstr ""
+msgstr "Timpul maxim pentru alocare"
#: domainname.c:42 main.c:70
msgid "Domain name"
-msgstr ""
+msgstr "Nume Domeniu"
#: domainname.c:42
msgid "Enter Domain name"
-msgstr ""
+msgstr "Introduceti Nume Domeniu"
#: domainname.c:48
msgid "Domain name cannot be empty."
-msgstr ""
+msgstr "Nume Domeniu nu poate fi gol"
#: domainname.c:50
msgid "Domain name cannot contain spaces."
-msgstr ""
+msgstr "Nume Domeniu nu poate contine spatii"
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "Nume Domeniu poate contine doar litere, numere, cratime sau paranteze"
#: hostname.c:46 main.c:69
msgid "Hostname"
-msgstr ""
+msgstr "Nume Gazda - HOST"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr ""
+msgstr "Introduceti Nume Gazda - HOST"
#: hostname.c:53
msgid "Hostname cannot be empty."
-msgstr ""
+msgstr "Nume Gazda - HOST - nu poate fi gol"
#: hostname.c:55
msgid "Hostname cannot contain spaces."
-msgstr ""
+msgstr "Nume Gazda - HOST - nu poate contine spatii"
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
-msgstr ""
+msgstr "Nume Gazda - HOST - poate contine doar litere, numere si cratime"
#: keymap.c:84 main.c:67
msgid "Keyboard mapping"
-msgstr ""
+msgstr "Cartografiere Tastatura - tipul de tastatura"
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr ""
+msgstr "Alegeti tipul de tastatura pe care o folositi din lista urmatoare"
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "Fus Orar"
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "Retea"
#: main.c:72 misc.c:147
msgid "ISDN"
-msgstr ""
+msgstr "ISDN"
#: main.c:73
msgid "'root' password"
-msgstr ""
+msgstr "Parola pentru utilizator 'root'"
#: main.c:74
msgid "'admin' password"
-msgstr ""
+msgstr "Parola pentru utilizator 'admin'"
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
-msgstr ""
+msgstr "<Tab>/<Alt-Tab> pentru comutare intre elemente | <Space> selecteaza"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "Meniu Sectiuni"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "Selectati articolul pe care doriti sa-l configurati"
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Iesire"
#: main.c:172
msgid "Setup is complete."
-msgstr ""
+msgstr "Setup-ul s-a incheiat"
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Atentie"
#: main.c:175
msgid ""
"Initial setup was not entirely complete. You must ensure that Setup is "
"properly finished by running setup again at the shell."
-msgstr ""
+msgstr "Setup-ul initial nu s-a finalizat. Trebuie sa va asigurati ca Setup-ul s-a incheiat corect ruland din nou operatiunea din shell."
#: misc.c:62
#, c-format
msgid "Unable to write %s/main/hostname.conf"
-msgstr ""
+msgstr "%s/main/hostname.conf nu a putut fi scris"
#: misc.c:71
msgid "Unable to open main hosts file."
-msgstr ""
+msgstr "fisierul principal de hosts nu a putut fi deschis"
#: misc.c:76
msgid "Unable to write /etc/hosts."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Andrei Skipin <skian2007@yandex.ru>, 2014
+# ellviss <kpe1501@gmail.com>, 2015
# bubnov_pi <ipfire@bubnov.su>, 2014
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-02-17 19:30+0000\n"
+"Last-Translator: ellviss <kpe1501@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/projects/p/ipfire/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "Выберите пункт меню для настройки"
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Выход"
#: main.c:172
msgid "Setup is complete."
-msgstr ""
+msgstr "Установка завершена"
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Предупреждение"
#: main.c:175
msgid ""
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "Недоступна запись в /etc/hosts."
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr "Недоступна запись в /etc/hosts.deny."
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "Недоступна запись в /etc/hosts.allow."
#: misc.c:136
msgid "Unable to set hostname."
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
-msgstr ""
+msgstr "Сканирование и конфигурирование ISDN устройств."
#: misc.c:148
msgid "Unable to scan for ISDN devices."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "Интерфейс - %s"
#: netstuff.c:91
#, c-format
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Статический"
#: netstuff.c:104
msgid "DHCP"
-msgstr ""
+msgstr "DHCP-сервер"
#: netstuff.c:105
msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
#: netstuff.c:113
msgid "DHCP Hostname:"
-msgstr ""
+msgstr "Имя хоста DHCP:"
#: netstuff.c:115
msgid "Force DHCP MTU:"
#: netstuff.c:134
msgid "IP address:"
-msgstr ""
+msgstr "IP-адрес:"
#: netstuff.c:146
msgid "Network mask:"
-msgstr ""
+msgstr "Сетевая маска:"
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
#: netstuff.c:183
msgid "IP address"
-msgstr ""
+msgstr "IP-адрес"
#: netstuff.c:189
msgid "Network mask"
-msgstr ""
+msgstr "Сетевая маска"
#: netstuff.c:198
msgid "DHCP hostname"
-msgstr ""
+msgstr "Имя хоста DHCP"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
#: netstuff.c:672
msgid "Extended Network Menu"
-msgstr ""
+msgstr "Расширенное сетевое меню"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Выберите"
#: netstuff.c:673
msgid "Identify"
#: netstuff.c:755
msgid "Select network driver"
-msgstr ""
+msgstr "Выберите сетевой драйвер"
#: netstuff.c:755
msgid "Set additional module parameters"
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "Модуль загружается..."
#: netstuff.c:777
msgid "Unable to load driver module."
-msgstr ""
+msgstr "Невозможно загрузить драйвер модуля."
#: netstuff.c:780
msgid "Module name cannot be blank."
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "Остановка сети.."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "Перезапуск сети..."
#: networking.c:146
msgid "No GREEN interface assigned."
#: networking.c:163
msgid "Error"
-msgstr ""
+msgstr "Ошибка"
#: networking.c:163
msgid "Ignore"
-msgstr ""
+msgstr "Игнорировать"
#: networking.c:164
msgid "No RED interface assigned."
#: networking.c:217
msgid "Misssing DNS."
-msgstr ""
+msgstr "Отсутствует DNS."
#: networking.c:224
msgid "Missing Default Gateway."
-msgstr ""
+msgstr "Отсутствует шлюз по умолчанию."
#: networking.c:237 networking.c:304
msgid "Network configuration type"
#: networking.c:239 networking.c:640
msgid "Address settings"
-msgstr ""
+msgstr "Настройки адреса"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
-msgstr ""
+msgstr "Настройка DNS и Шлюза"
#: networking.c:260
msgid "When configuration is complete, a network restart will be required."
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "Меню настройки сети"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
-msgstr ""
+msgstr "Успешно завершено."
#: networking.c:300
#, c-format
#: networking.c:408
msgid "Do you wish to change these settings?"
-msgstr ""
+msgstr "Вы уверены что хотите изменить эти настройки?"
#: networking.c:447
msgid "Restarting non-local network..."
#: networking.c:520
msgid "Remove"
-msgstr ""
+msgstr "Удалить"
#: networking.c:556 networking.c:649
#, c-format
#: networking.c:641
msgid "Select the interface you wish to reconfigure."
-msgstr ""
+msgstr "Выберете интерфейс для реконфигурации"
#: networking.c:729
msgid "Default gateway:"
-msgstr ""
+msgstr "Шлюз по умолчанию:"
#: networking.c:744
msgid ""
#: networking.c:773
msgid "Default gateway"
-msgstr ""
+msgstr "Шлюз по умолчанию"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
#: passwords.c:38 passwords.c:61
msgid "Setting password"
-msgstr ""
+msgstr "Установка пароля"
#: passwords.c:38
msgid "Setting 'root' password...."
-msgstr ""
+msgstr "Установка 'root' пароля..."
#: passwords.c:39
msgid "Problem setting 'root' password."
#: passwords.c:76
msgid "Password:"
-msgstr ""
+msgstr "Пароль:"
#: passwords.c:77
msgid "Again:"
-msgstr ""
+msgstr "Повторите пароль:"
#: passwords.c:95
msgid "Password cannot be blank."
-msgstr ""
+msgstr "Пароль не может быть пустым."
#: passwords.c:102
msgid "Passwords do not match."
-msgstr ""
+msgstr "Пароли не совпадают"
#: passwords.c:109
msgid "Password cannot contain spaces."
-msgstr ""
+msgstr "Пароль не может содержать пробелы"
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
-msgstr ""
+msgstr "Выберете временную зону в которой вы находитесь из списка ниже"
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-08-21 15:12+0000\n"
+"PO-Revision-Date: 2014-08-12 10:08+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Kinyarwanda (http://www.transifex.com/projects/p/ipfire/language/rw/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: rw\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: dhcp.c:50
+msgid "Start address:"
+msgstr ""
+
+#: dhcp.c:51
+msgid "End address:"
+msgstr ""
+
+#: dhcp.c:52 networking.c:717
+msgid "Primary DNS:"
+msgstr ""
+
+#: dhcp.c:53 networking.c:723
+msgid "Secondary DNS:"
+msgstr ""
+
+#: dhcp.c:54
+msgid "Default lease (mins):"
+msgstr ""
+
+#: dhcp.c:55
+msgid "Max lease (mins):"
+msgstr ""
+
+#: dhcp.c:56
+msgid "Domain name suffix:"
+msgstr ""
+
+#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
+#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
+#: networking.c:134 networking.c:255 networking.c:291 networking.c:346
+#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
+#: networking.c:713 timezone.c:63
+msgid "Unable to open settings file"
+msgstr ""
+
+#: dhcp.c:111
+msgid "DHCP server configuration"
+msgstr ""
+
+#: dhcp.c:116
+msgid "Configure the DHCP server by entering the settings information."
+msgstr ""
+
+#: dhcp.c:125
+msgid "Enabled"
+msgstr ""
+
+#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
+#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
+#: networking.c:269 networking.c:305 networking.c:409 networking.c:560
+#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
+#: timezone.c:78
+msgid "OK"
+msgstr ""
+
+#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
+#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
+#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
+#: passwords.c:89 timezone.c:78
+msgid "Cancel"
+msgstr ""
+
+#: dhcp.c:156
+msgid ""
+"The following fields are invalid:\n"
+"\n"
+msgstr ""
+
+#: dhcp.c:159
+msgid "Start address"
+msgstr ""
+
+#: dhcp.c:165
+msgid "End address"
+msgstr ""
+
+#: dhcp.c:173 networking.c:755
+msgid "Primary DNS"
+msgstr ""
+
+#: dhcp.c:182 networking.c:764
+msgid "Secondary DNS"
+msgstr ""
+
+#: dhcp.c:189
+msgid "Default lease time"
+msgstr ""
+
+#: dhcp.c:195
+msgid "Max. lease time"
+msgstr ""
+
+#: domainname.c:42 main.c:70
+msgid "Domain name"
+msgstr ""
+
+#: domainname.c:42
+msgid "Enter Domain name"
+msgstr ""
+
+#: domainname.c:48
+msgid "Domain name cannot be empty."
+msgstr ""
+
+#: domainname.c:50
+msgid "Domain name cannot contain spaces."
+msgstr ""
+
+#: domainname.c:53
+msgid "Domain name may only contain letters, numbers, hyphens and periods."
+msgstr ""
+
+#: hostname.c:46 main.c:69
+msgid "Hostname"
+msgstr ""
+
+#: hostname.c:46
+msgid "Enter the machine's hostname."
+msgstr ""
+
+#: hostname.c:53
+msgid "Hostname cannot be empty."
+msgstr ""
+
+#: hostname.c:55
+msgid "Hostname cannot contain spaces."
+msgstr ""
+
+#: hostname.c:58
+msgid "Hostname may only contain letters, numbers and hyphens."
+msgstr ""
+
+#: keymap.c:84 main.c:67
+msgid "Keyboard mapping"
+msgstr ""
+
+#: keymap.c:85
+msgid "Choose the type of keyboard you are using from the list below."
+msgstr ""
+
+#: main.c:68 timezone.c:77
+msgid "Timezone"
+msgstr ""
+
+#: main.c:71 networking.c:110 networking.c:115 networking.c:447
+msgid "Networking"
+msgstr ""
+
+#: main.c:72 misc.c:147
+msgid "ISDN"
+msgstr ""
+
+#: main.c:73
+msgid "'root' password"
+msgstr ""
+
+#: main.c:74
+msgid "'admin' password"
+msgstr ""
+
+#: main.c:90
+msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
+msgstr ""
+
+#: main.c:97
+msgid "Section menu"
+msgstr ""
+
+#: main.c:98
+msgid "Select the item you wish to configure."
+msgstr ""
+
+#: main.c:99
+msgid "Quit"
+msgstr ""
+
+#: main.c:172
+msgid "Setup is complete."
+msgstr ""
+
+#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
+msgid "Warning"
+msgstr ""
+
+#: main.c:175
+msgid ""
+"Initial setup was not entirely complete. You must ensure that Setup is "
+"properly finished by running setup again at the shell."
+msgstr ""
+
+#: misc.c:62
+#, c-format
+msgid "Unable to write %s/main/hostname.conf"
+msgstr ""
+
+#: misc.c:71
+msgid "Unable to open main hosts file."
+msgstr ""
+
+#: misc.c:76
+msgid "Unable to write /etc/hosts."
+msgstr ""
+
+#: misc.c:117
+msgid "Unable to write /etc/hosts.deny."
+msgstr ""
+
+#: misc.c:125
+msgid "Unable to write /etc/hosts.allow."
+msgstr ""
+
+#: misc.c:136
+msgid "Unable to set hostname."
+msgstr ""
+
+#: misc.c:147
+msgid "Scanning and configuring ISDN devices."
+msgstr ""
+
+#: misc.c:148
+msgid "Unable to scan for ISDN devices."
+msgstr ""
+
+#: netstuff.c:86
+#, c-format
+msgid "Interface - %s"
+msgstr ""
+
+#: netstuff.c:91
+#, c-format
+msgid "Enter the IP address information for the %s interface."
+msgstr ""
+
+#: netstuff.c:103
+msgid "Static"
+msgstr ""
+
+#: netstuff.c:104
+msgid "DHCP"
+msgstr ""
+
+#: netstuff.c:105
+msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
+msgstr ""
+
+#: netstuff.c:113
+msgid "DHCP Hostname:"
+msgstr ""
+
+#: netstuff.c:115
+msgid "Force DHCP MTU:"
+msgstr ""
+
+#: netstuff.c:134
+msgid "IP address:"
+msgstr ""
+
+#: netstuff.c:146
+msgid "Network mask:"
+msgstr ""
+
+#: netstuff.c:173 networking.c:749
+msgid "The following fields are invalid:"
+msgstr ""
+
+#: netstuff.c:183
+msgid "IP address"
+msgstr ""
+
+#: netstuff.c:189
+msgid "Network mask"
+msgstr ""
+
+#: netstuff.c:198
+msgid "DHCP hostname"
+msgstr ""
+
+#: netstuff.c:396 netstuff.c:709
+msgid "Unset"
+msgstr ""
+
+#: netstuff.c:669
+#, c-format
+msgid "Please choose a networkcard for the following interface - %s."
+msgstr ""
+
+#: netstuff.c:672
+msgid "Extended Network Menu"
+msgstr ""
+
+#: netstuff.c:673 networking.c:520
+msgid "Select"
+msgstr ""
+
+#: netstuff.c:673
+msgid "Identify"
+msgstr ""
+
+#: netstuff.c:678
+msgid "Device Identification"
+msgstr ""
+
+#: netstuff.c:678
+msgid "The lights on the selected port should flash now for 10 seconds..."
+msgstr ""
+
+#: netstuff.c:679
+msgid "Identification is not supported by this interface."
+msgstr ""
+
+#: netstuff.c:691
+msgid "There are no unassigned interfaces on your system."
+msgstr ""
+
+#: netstuff.c:732
+#, c-format
+msgid "Do you really want to remove the assigned %s interface?"
+msgstr ""
+
+#: netstuff.c:755
+msgid "Select network driver"
+msgstr ""
+
+#: netstuff.c:755
+msgid "Set additional module parameters"
+msgstr ""
+
+#: netstuff.c:762
+msgid "Loading module..."
+msgstr ""
+
+#: netstuff.c:777
+msgid "Unable to load driver module."
+msgstr ""
+
+#: netstuff.c:780
+msgid "Module name cannot be blank."
+msgstr ""
+
+#: networking.c:110
+msgid "Stopping network..."
+msgstr ""
+
+#: networking.c:115
+msgid "Restarting network..."
+msgstr ""
+
+#: networking.c:146
+msgid "No GREEN interface assigned."
+msgstr ""
+
+#: networking.c:152
+msgid "Missing an IP address on GREEN."
+msgstr ""
+
+#: networking.c:163
+msgid "Error"
+msgstr ""
+
+#: networking.c:163
+msgid "Ignore"
+msgstr ""
+
+#: networking.c:164
+msgid "No RED interface assigned."
+msgstr ""
+
+#: networking.c:173
+msgid "Missing an IP address on RED."
+msgstr ""
+
+#: networking.c:183
+msgid "No ORANGE interface assigned."
+msgstr ""
+
+#: networking.c:189
+msgid "Missing an IP address on ORANGE."
+msgstr ""
+
+#: networking.c:199
+msgid "No BLUE interface assigned."
+msgstr ""
+
+#: networking.c:205
+msgid "Missing an IP address on BLUE."
+msgstr ""
+
+#: networking.c:217
+msgid "Misssing DNS."
+msgstr ""
+
+#: networking.c:224
+msgid "Missing Default Gateway."
+msgstr ""
+
+#: networking.c:237 networking.c:304
+msgid "Network configuration type"
+msgstr ""
+
+#: networking.c:238 networking.c:409
+msgid "Drivers and card assignments"
+msgstr ""
+
+#: networking.c:239 networking.c:640
+msgid "Address settings"
+msgstr ""
+
+#: networking.c:240 networking.c:743
+msgid "DNS and Gateway settings"
+msgstr ""
+
+#: networking.c:260
+msgid "When configuration is complete, a network restart will be required."
+msgstr ""
+
+#: networking.c:267
+#, c-format
+msgid ""
+"Current config: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: networking.c:268
+msgid "Network configuration menu"
+msgstr ""
+
+#: networking.c:269 networking.c:520 networking.c:642
+msgid "Done"
+msgstr ""
+
+#: networking.c:300
+#, c-format
+msgid ""
+"Select the network configuration for %s. The following configuration types "
+"list those interfaces which have ethernet attached. If you change this "
+"setting, a network restart will be required, and you will have to "
+"reconfigure the network driver assignments."
+msgstr ""
+
+#: networking.c:307
+#, c-format
+msgid ""
+"Not enough netcards for your choice.\n"
+"\n"
+"Needed: %d - Available: %d\n"
+msgstr ""
+
+#: networking.c:359
+msgid ""
+"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
+"\n"
+msgstr ""
+
+#: networking.c:408
+msgid "Do you wish to change these settings?"
+msgstr ""
+
+#: networking.c:447
+msgid "Restarting non-local network..."
+msgstr ""
+
+#: networking.c:464
+msgid ""
+"Please choose the interface you wish to change.\n"
+"\n"
+msgstr ""
+
+#: networking.c:519
+msgid "Assigned Cards"
+msgstr ""
+
+#: networking.c:520
+msgid "Remove"
+msgstr ""
+
+#: networking.c:556 networking.c:649
+#, c-format
+msgid ""
+"If you change this IP address, and you are logged in remotely, your "
+"connection to the %s machine will be broken, and you will have to reconnect "
+"on the new IP. This is a risky operation, and should only be attempted if "
+"you have physical access to the machine, should something go wrong."
+msgstr ""
+
+#: networking.c:641
+msgid "Select the interface you wish to reconfigure."
+msgstr ""
+
+#: networking.c:729
+msgid "Default gateway:"
+msgstr ""
+
+#: networking.c:744
+msgid ""
+"Enter the DNS and gateway information. These settings are used only with "
+"Static IP (and DHCP if DNS set) on the RED interface."
+msgstr ""
+
+#: networking.c:773
+msgid "Default gateway"
+msgstr ""
+
+#: networking.c:780
+msgid "Secondary DNS specified without a Primary DNS"
+msgstr ""
+
+#: passwords.c:33
+msgid ""
+"Enter the 'root' user password. Login as this user for commandline access."
+msgstr ""
+
+#: passwords.c:38 passwords.c:61
+msgid "Setting password"
+msgstr ""
+
+#: passwords.c:38
+msgid "Setting 'root' password...."
+msgstr ""
+
+#: passwords.c:39
+msgid "Problem setting 'root' password."
+msgstr ""
+
+#: passwords.c:53
+#, c-format
+msgid ""
+"Enter %s 'admin' user password. This is the user to use for logging into the"
+" %s web administration pages."
+msgstr ""
+
+#: passwords.c:60
+#, c-format
+msgid "Setting %s 'admin' user password..."
+msgstr ""
+
+#: passwords.c:62
+#, c-format
+msgid "Problem setting %s 'admin' user password."
+msgstr ""
+
+#: passwords.c:76
+msgid "Password:"
+msgstr ""
+
+#: passwords.c:77
+msgid "Again:"
+msgstr ""
+
+#: passwords.c:95
+msgid "Password cannot be blank."
+msgstr ""
+
+#: passwords.c:102
+msgid "Passwords do not match."
+msgstr ""
+
+#: passwords.c:109
+msgid "Password cannot contain spaces."
+msgstr ""
+
+#: timezone.c:77
+msgid "Choose the timezone you are in from the list below."
+msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Ardit Dani <ardit.dani@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-02-02 22:35+0000\n"
+"Last-Translator: Ardit Dani <ardit.dani@gmail.com>\n"
"Language-Team: Albanian (http://www.transifex.com/projects/p/ipfire/language/sq/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "Anulo"
#: dhcp.c:156
msgid ""
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Statik"
#: netstuff.c:104
msgid "DHCP"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Përzgjedhje"
#: netstuff.c:673
msgid "Identify"
-msgstr ""
+msgstr "Identifikuesi"
#: netstuff.c:678
msgid "Device Identification"
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-08-21 15:12+0000\n"
+"PO-Revision-Date: 2014-08-12 10:08+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Serbian (http://www.transifex.com/projects/p/ipfire/language/sr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: sr\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: dhcp.c:50
+msgid "Start address:"
+msgstr ""
+
+#: dhcp.c:51
+msgid "End address:"
+msgstr ""
+
+#: dhcp.c:52 networking.c:717
+msgid "Primary DNS:"
+msgstr ""
+
+#: dhcp.c:53 networking.c:723
+msgid "Secondary DNS:"
+msgstr ""
+
+#: dhcp.c:54
+msgid "Default lease (mins):"
+msgstr ""
+
+#: dhcp.c:55
+msgid "Max lease (mins):"
+msgstr ""
+
+#: dhcp.c:56
+msgid "Domain name suffix:"
+msgstr ""
+
+#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
+#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
+#: networking.c:134 networking.c:255 networking.c:291 networking.c:346
+#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
+#: networking.c:713 timezone.c:63
+msgid "Unable to open settings file"
+msgstr ""
+
+#: dhcp.c:111
+msgid "DHCP server configuration"
+msgstr ""
+
+#: dhcp.c:116
+msgid "Configure the DHCP server by entering the settings information."
+msgstr ""
+
+#: dhcp.c:125
+msgid "Enabled"
+msgstr ""
+
+#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
+#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
+#: networking.c:269 networking.c:305 networking.c:409 networking.c:560
+#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
+#: timezone.c:78
+msgid "OK"
+msgstr ""
+
+#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
+#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
+#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
+#: passwords.c:89 timezone.c:78
+msgid "Cancel"
+msgstr ""
+
+#: dhcp.c:156
+msgid ""
+"The following fields are invalid:\n"
+"\n"
+msgstr ""
+
+#: dhcp.c:159
+msgid "Start address"
+msgstr ""
+
+#: dhcp.c:165
+msgid "End address"
+msgstr ""
+
+#: dhcp.c:173 networking.c:755
+msgid "Primary DNS"
+msgstr ""
+
+#: dhcp.c:182 networking.c:764
+msgid "Secondary DNS"
+msgstr ""
+
+#: dhcp.c:189
+msgid "Default lease time"
+msgstr ""
+
+#: dhcp.c:195
+msgid "Max. lease time"
+msgstr ""
+
+#: domainname.c:42 main.c:70
+msgid "Domain name"
+msgstr ""
+
+#: domainname.c:42
+msgid "Enter Domain name"
+msgstr ""
+
+#: domainname.c:48
+msgid "Domain name cannot be empty."
+msgstr ""
+
+#: domainname.c:50
+msgid "Domain name cannot contain spaces."
+msgstr ""
+
+#: domainname.c:53
+msgid "Domain name may only contain letters, numbers, hyphens and periods."
+msgstr ""
+
+#: hostname.c:46 main.c:69
+msgid "Hostname"
+msgstr ""
+
+#: hostname.c:46
+msgid "Enter the machine's hostname."
+msgstr ""
+
+#: hostname.c:53
+msgid "Hostname cannot be empty."
+msgstr ""
+
+#: hostname.c:55
+msgid "Hostname cannot contain spaces."
+msgstr ""
+
+#: hostname.c:58
+msgid "Hostname may only contain letters, numbers and hyphens."
+msgstr ""
+
+#: keymap.c:84 main.c:67
+msgid "Keyboard mapping"
+msgstr ""
+
+#: keymap.c:85
+msgid "Choose the type of keyboard you are using from the list below."
+msgstr ""
+
+#: main.c:68 timezone.c:77
+msgid "Timezone"
+msgstr ""
+
+#: main.c:71 networking.c:110 networking.c:115 networking.c:447
+msgid "Networking"
+msgstr ""
+
+#: main.c:72 misc.c:147
+msgid "ISDN"
+msgstr ""
+
+#: main.c:73
+msgid "'root' password"
+msgstr ""
+
+#: main.c:74
+msgid "'admin' password"
+msgstr ""
+
+#: main.c:90
+msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
+msgstr ""
+
+#: main.c:97
+msgid "Section menu"
+msgstr ""
+
+#: main.c:98
+msgid "Select the item you wish to configure."
+msgstr ""
+
+#: main.c:99
+msgid "Quit"
+msgstr ""
+
+#: main.c:172
+msgid "Setup is complete."
+msgstr ""
+
+#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
+msgid "Warning"
+msgstr ""
+
+#: main.c:175
+msgid ""
+"Initial setup was not entirely complete. You must ensure that Setup is "
+"properly finished by running setup again at the shell."
+msgstr ""
+
+#: misc.c:62
+#, c-format
+msgid "Unable to write %s/main/hostname.conf"
+msgstr ""
+
+#: misc.c:71
+msgid "Unable to open main hosts file."
+msgstr ""
+
+#: misc.c:76
+msgid "Unable to write /etc/hosts."
+msgstr ""
+
+#: misc.c:117
+msgid "Unable to write /etc/hosts.deny."
+msgstr ""
+
+#: misc.c:125
+msgid "Unable to write /etc/hosts.allow."
+msgstr ""
+
+#: misc.c:136
+msgid "Unable to set hostname."
+msgstr ""
+
+#: misc.c:147
+msgid "Scanning and configuring ISDN devices."
+msgstr ""
+
+#: misc.c:148
+msgid "Unable to scan for ISDN devices."
+msgstr ""
+
+#: netstuff.c:86
+#, c-format
+msgid "Interface - %s"
+msgstr ""
+
+#: netstuff.c:91
+#, c-format
+msgid "Enter the IP address information for the %s interface."
+msgstr ""
+
+#: netstuff.c:103
+msgid "Static"
+msgstr ""
+
+#: netstuff.c:104
+msgid "DHCP"
+msgstr ""
+
+#: netstuff.c:105
+msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
+msgstr ""
+
+#: netstuff.c:113
+msgid "DHCP Hostname:"
+msgstr ""
+
+#: netstuff.c:115
+msgid "Force DHCP MTU:"
+msgstr ""
+
+#: netstuff.c:134
+msgid "IP address:"
+msgstr ""
+
+#: netstuff.c:146
+msgid "Network mask:"
+msgstr ""
+
+#: netstuff.c:173 networking.c:749
+msgid "The following fields are invalid:"
+msgstr ""
+
+#: netstuff.c:183
+msgid "IP address"
+msgstr ""
+
+#: netstuff.c:189
+msgid "Network mask"
+msgstr ""
+
+#: netstuff.c:198
+msgid "DHCP hostname"
+msgstr ""
+
+#: netstuff.c:396 netstuff.c:709
+msgid "Unset"
+msgstr ""
+
+#: netstuff.c:669
+#, c-format
+msgid "Please choose a networkcard for the following interface - %s."
+msgstr ""
+
+#: netstuff.c:672
+msgid "Extended Network Menu"
+msgstr ""
+
+#: netstuff.c:673 networking.c:520
+msgid "Select"
+msgstr ""
+
+#: netstuff.c:673
+msgid "Identify"
+msgstr ""
+
+#: netstuff.c:678
+msgid "Device Identification"
+msgstr ""
+
+#: netstuff.c:678
+msgid "The lights on the selected port should flash now for 10 seconds..."
+msgstr ""
+
+#: netstuff.c:679
+msgid "Identification is not supported by this interface."
+msgstr ""
+
+#: netstuff.c:691
+msgid "There are no unassigned interfaces on your system."
+msgstr ""
+
+#: netstuff.c:732
+#, c-format
+msgid "Do you really want to remove the assigned %s interface?"
+msgstr ""
+
+#: netstuff.c:755
+msgid "Select network driver"
+msgstr ""
+
+#: netstuff.c:755
+msgid "Set additional module parameters"
+msgstr ""
+
+#: netstuff.c:762
+msgid "Loading module..."
+msgstr ""
+
+#: netstuff.c:777
+msgid "Unable to load driver module."
+msgstr ""
+
+#: netstuff.c:780
+msgid "Module name cannot be blank."
+msgstr ""
+
+#: networking.c:110
+msgid "Stopping network..."
+msgstr ""
+
+#: networking.c:115
+msgid "Restarting network..."
+msgstr ""
+
+#: networking.c:146
+msgid "No GREEN interface assigned."
+msgstr ""
+
+#: networking.c:152
+msgid "Missing an IP address on GREEN."
+msgstr ""
+
+#: networking.c:163
+msgid "Error"
+msgstr ""
+
+#: networking.c:163
+msgid "Ignore"
+msgstr ""
+
+#: networking.c:164
+msgid "No RED interface assigned."
+msgstr ""
+
+#: networking.c:173
+msgid "Missing an IP address on RED."
+msgstr ""
+
+#: networking.c:183
+msgid "No ORANGE interface assigned."
+msgstr ""
+
+#: networking.c:189
+msgid "Missing an IP address on ORANGE."
+msgstr ""
+
+#: networking.c:199
+msgid "No BLUE interface assigned."
+msgstr ""
+
+#: networking.c:205
+msgid "Missing an IP address on BLUE."
+msgstr ""
+
+#: networking.c:217
+msgid "Misssing DNS."
+msgstr ""
+
+#: networking.c:224
+msgid "Missing Default Gateway."
+msgstr ""
+
+#: networking.c:237 networking.c:304
+msgid "Network configuration type"
+msgstr ""
+
+#: networking.c:238 networking.c:409
+msgid "Drivers and card assignments"
+msgstr ""
+
+#: networking.c:239 networking.c:640
+msgid "Address settings"
+msgstr ""
+
+#: networking.c:240 networking.c:743
+msgid "DNS and Gateway settings"
+msgstr ""
+
+#: networking.c:260
+msgid "When configuration is complete, a network restart will be required."
+msgstr ""
+
+#: networking.c:267
+#, c-format
+msgid ""
+"Current config: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: networking.c:268
+msgid "Network configuration menu"
+msgstr ""
+
+#: networking.c:269 networking.c:520 networking.c:642
+msgid "Done"
+msgstr ""
+
+#: networking.c:300
+#, c-format
+msgid ""
+"Select the network configuration for %s. The following configuration types "
+"list those interfaces which have ethernet attached. If you change this "
+"setting, a network restart will be required, and you will have to "
+"reconfigure the network driver assignments."
+msgstr ""
+
+#: networking.c:307
+#, c-format
+msgid ""
+"Not enough netcards for your choice.\n"
+"\n"
+"Needed: %d - Available: %d\n"
+msgstr ""
+
+#: networking.c:359
+msgid ""
+"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
+"\n"
+msgstr ""
+
+#: networking.c:408
+msgid "Do you wish to change these settings?"
+msgstr ""
+
+#: networking.c:447
+msgid "Restarting non-local network..."
+msgstr ""
+
+#: networking.c:464
+msgid ""
+"Please choose the interface you wish to change.\n"
+"\n"
+msgstr ""
+
+#: networking.c:519
+msgid "Assigned Cards"
+msgstr ""
+
+#: networking.c:520
+msgid "Remove"
+msgstr ""
+
+#: networking.c:556 networking.c:649
+#, c-format
+msgid ""
+"If you change this IP address, and you are logged in remotely, your "
+"connection to the %s machine will be broken, and you will have to reconnect "
+"on the new IP. This is a risky operation, and should only be attempted if "
+"you have physical access to the machine, should something go wrong."
+msgstr ""
+
+#: networking.c:641
+msgid "Select the interface you wish to reconfigure."
+msgstr ""
+
+#: networking.c:729
+msgid "Default gateway:"
+msgstr ""
+
+#: networking.c:744
+msgid ""
+"Enter the DNS and gateway information. These settings are used only with "
+"Static IP (and DHCP if DNS set) on the RED interface."
+msgstr ""
+
+#: networking.c:773
+msgid "Default gateway"
+msgstr ""
+
+#: networking.c:780
+msgid "Secondary DNS specified without a Primary DNS"
+msgstr ""
+
+#: passwords.c:33
+msgid ""
+"Enter the 'root' user password. Login as this user for commandline access."
+msgstr ""
+
+#: passwords.c:38 passwords.c:61
+msgid "Setting password"
+msgstr ""
+
+#: passwords.c:38
+msgid "Setting 'root' password...."
+msgstr ""
+
+#: passwords.c:39
+msgid "Problem setting 'root' password."
+msgstr ""
+
+#: passwords.c:53
+#, c-format
+msgid ""
+"Enter %s 'admin' user password. This is the user to use for logging into the"
+" %s web administration pages."
+msgstr ""
+
+#: passwords.c:60
+#, c-format
+msgid "Setting %s 'admin' user password..."
+msgstr ""
+
+#: passwords.c:62
+#, c-format
+msgid "Problem setting %s 'admin' user password."
+msgstr ""
+
+#: passwords.c:76
+msgid "Password:"
+msgstr ""
+
+#: passwords.c:77
+msgid "Again:"
+msgstr ""
+
+#: passwords.c:95
+msgid "Password cannot be blank."
+msgstr ""
+
+#: passwords.c:102
+msgid "Passwords do not match."
+msgstr ""
+
+#: passwords.c:109
+msgid "Password cannot contain spaces."
+msgstr ""
+
+#: timezone.c:77
+msgid "Choose the timezone you are in from the list below."
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR The IPFire Project (www.ipfire.org)
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: IPFire Project\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-08-21 15:12+0000\n"
+"PO-Revision-Date: 2014-08-12 10:08+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Sundanese (http://www.transifex.com/projects/p/ipfire/language/su/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: su\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: dhcp.c:50
+msgid "Start address:"
+msgstr ""
+
+#: dhcp.c:51
+msgid "End address:"
+msgstr ""
+
+#: dhcp.c:52 networking.c:717
+msgid "Primary DNS:"
+msgstr ""
+
+#: dhcp.c:53 networking.c:723
+msgid "Secondary DNS:"
+msgstr ""
+
+#: dhcp.c:54
+msgid "Default lease (mins):"
+msgstr ""
+
+#: dhcp.c:55
+msgid "Max lease (mins):"
+msgstr ""
+
+#: dhcp.c:56
+msgid "Domain name suffix:"
+msgstr ""
+
+#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
+#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
+#: networking.c:134 networking.c:255 networking.c:291 networking.c:346
+#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
+#: networking.c:713 timezone.c:63
+msgid "Unable to open settings file"
+msgstr ""
+
+#: dhcp.c:111
+msgid "DHCP server configuration"
+msgstr ""
+
+#: dhcp.c:116
+msgid "Configure the DHCP server by entering the settings information."
+msgstr ""
+
+#: dhcp.c:125
+msgid "Enabled"
+msgstr ""
+
+#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
+#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
+#: networking.c:269 networking.c:305 networking.c:409 networking.c:560
+#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
+#: timezone.c:78
+msgid "OK"
+msgstr ""
+
+#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
+#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
+#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
+#: passwords.c:89 timezone.c:78
+msgid "Cancel"
+msgstr ""
+
+#: dhcp.c:156
+msgid ""
+"The following fields are invalid:\n"
+"\n"
+msgstr ""
+
+#: dhcp.c:159
+msgid "Start address"
+msgstr ""
+
+#: dhcp.c:165
+msgid "End address"
+msgstr ""
+
+#: dhcp.c:173 networking.c:755
+msgid "Primary DNS"
+msgstr ""
+
+#: dhcp.c:182 networking.c:764
+msgid "Secondary DNS"
+msgstr ""
+
+#: dhcp.c:189
+msgid "Default lease time"
+msgstr ""
+
+#: dhcp.c:195
+msgid "Max. lease time"
+msgstr ""
+
+#: domainname.c:42 main.c:70
+msgid "Domain name"
+msgstr ""
+
+#: domainname.c:42
+msgid "Enter Domain name"
+msgstr ""
+
+#: domainname.c:48
+msgid "Domain name cannot be empty."
+msgstr ""
+
+#: domainname.c:50
+msgid "Domain name cannot contain spaces."
+msgstr ""
+
+#: domainname.c:53
+msgid "Domain name may only contain letters, numbers, hyphens and periods."
+msgstr ""
+
+#: hostname.c:46 main.c:69
+msgid "Hostname"
+msgstr ""
+
+#: hostname.c:46
+msgid "Enter the machine's hostname."
+msgstr ""
+
+#: hostname.c:53
+msgid "Hostname cannot be empty."
+msgstr ""
+
+#: hostname.c:55
+msgid "Hostname cannot contain spaces."
+msgstr ""
+
+#: hostname.c:58
+msgid "Hostname may only contain letters, numbers and hyphens."
+msgstr ""
+
+#: keymap.c:84 main.c:67
+msgid "Keyboard mapping"
+msgstr ""
+
+#: keymap.c:85
+msgid "Choose the type of keyboard you are using from the list below."
+msgstr ""
+
+#: main.c:68 timezone.c:77
+msgid "Timezone"
+msgstr ""
+
+#: main.c:71 networking.c:110 networking.c:115 networking.c:447
+msgid "Networking"
+msgstr ""
+
+#: main.c:72 misc.c:147
+msgid "ISDN"
+msgstr ""
+
+#: main.c:73
+msgid "'root' password"
+msgstr ""
+
+#: main.c:74
+msgid "'admin' password"
+msgstr ""
+
+#: main.c:90
+msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
+msgstr ""
+
+#: main.c:97
+msgid "Section menu"
+msgstr ""
+
+#: main.c:98
+msgid "Select the item you wish to configure."
+msgstr ""
+
+#: main.c:99
+msgid "Quit"
+msgstr ""
+
+#: main.c:172
+msgid "Setup is complete."
+msgstr ""
+
+#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
+msgid "Warning"
+msgstr ""
+
+#: main.c:175
+msgid ""
+"Initial setup was not entirely complete. You must ensure that Setup is "
+"properly finished by running setup again at the shell."
+msgstr ""
+
+#: misc.c:62
+#, c-format
+msgid "Unable to write %s/main/hostname.conf"
+msgstr ""
+
+#: misc.c:71
+msgid "Unable to open main hosts file."
+msgstr ""
+
+#: misc.c:76
+msgid "Unable to write /etc/hosts."
+msgstr ""
+
+#: misc.c:117
+msgid "Unable to write /etc/hosts.deny."
+msgstr ""
+
+#: misc.c:125
+msgid "Unable to write /etc/hosts.allow."
+msgstr ""
+
+#: misc.c:136
+msgid "Unable to set hostname."
+msgstr ""
+
+#: misc.c:147
+msgid "Scanning and configuring ISDN devices."
+msgstr ""
+
+#: misc.c:148
+msgid "Unable to scan for ISDN devices."
+msgstr ""
+
+#: netstuff.c:86
+#, c-format
+msgid "Interface - %s"
+msgstr ""
+
+#: netstuff.c:91
+#, c-format
+msgid "Enter the IP address information for the %s interface."
+msgstr ""
+
+#: netstuff.c:103
+msgid "Static"
+msgstr ""
+
+#: netstuff.c:104
+msgid "DHCP"
+msgstr ""
+
+#: netstuff.c:105
+msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
+msgstr ""
+
+#: netstuff.c:113
+msgid "DHCP Hostname:"
+msgstr ""
+
+#: netstuff.c:115
+msgid "Force DHCP MTU:"
+msgstr ""
+
+#: netstuff.c:134
+msgid "IP address:"
+msgstr ""
+
+#: netstuff.c:146
+msgid "Network mask:"
+msgstr ""
+
+#: netstuff.c:173 networking.c:749
+msgid "The following fields are invalid:"
+msgstr ""
+
+#: netstuff.c:183
+msgid "IP address"
+msgstr ""
+
+#: netstuff.c:189
+msgid "Network mask"
+msgstr ""
+
+#: netstuff.c:198
+msgid "DHCP hostname"
+msgstr ""
+
+#: netstuff.c:396 netstuff.c:709
+msgid "Unset"
+msgstr ""
+
+#: netstuff.c:669
+#, c-format
+msgid "Please choose a networkcard for the following interface - %s."
+msgstr ""
+
+#: netstuff.c:672
+msgid "Extended Network Menu"
+msgstr ""
+
+#: netstuff.c:673 networking.c:520
+msgid "Select"
+msgstr ""
+
+#: netstuff.c:673
+msgid "Identify"
+msgstr ""
+
+#: netstuff.c:678
+msgid "Device Identification"
+msgstr ""
+
+#: netstuff.c:678
+msgid "The lights on the selected port should flash now for 10 seconds..."
+msgstr ""
+
+#: netstuff.c:679
+msgid "Identification is not supported by this interface."
+msgstr ""
+
+#: netstuff.c:691
+msgid "There are no unassigned interfaces on your system."
+msgstr ""
+
+#: netstuff.c:732
+#, c-format
+msgid "Do you really want to remove the assigned %s interface?"
+msgstr ""
+
+#: netstuff.c:755
+msgid "Select network driver"
+msgstr ""
+
+#: netstuff.c:755
+msgid "Set additional module parameters"
+msgstr ""
+
+#: netstuff.c:762
+msgid "Loading module..."
+msgstr ""
+
+#: netstuff.c:777
+msgid "Unable to load driver module."
+msgstr ""
+
+#: netstuff.c:780
+msgid "Module name cannot be blank."
+msgstr ""
+
+#: networking.c:110
+msgid "Stopping network..."
+msgstr ""
+
+#: networking.c:115
+msgid "Restarting network..."
+msgstr ""
+
+#: networking.c:146
+msgid "No GREEN interface assigned."
+msgstr ""
+
+#: networking.c:152
+msgid "Missing an IP address on GREEN."
+msgstr ""
+
+#: networking.c:163
+msgid "Error"
+msgstr ""
+
+#: networking.c:163
+msgid "Ignore"
+msgstr ""
+
+#: networking.c:164
+msgid "No RED interface assigned."
+msgstr ""
+
+#: networking.c:173
+msgid "Missing an IP address on RED."
+msgstr ""
+
+#: networking.c:183
+msgid "No ORANGE interface assigned."
+msgstr ""
+
+#: networking.c:189
+msgid "Missing an IP address on ORANGE."
+msgstr ""
+
+#: networking.c:199
+msgid "No BLUE interface assigned."
+msgstr ""
+
+#: networking.c:205
+msgid "Missing an IP address on BLUE."
+msgstr ""
+
+#: networking.c:217
+msgid "Misssing DNS."
+msgstr ""
+
+#: networking.c:224
+msgid "Missing Default Gateway."
+msgstr ""
+
+#: networking.c:237 networking.c:304
+msgid "Network configuration type"
+msgstr ""
+
+#: networking.c:238 networking.c:409
+msgid "Drivers and card assignments"
+msgstr ""
+
+#: networking.c:239 networking.c:640
+msgid "Address settings"
+msgstr ""
+
+#: networking.c:240 networking.c:743
+msgid "DNS and Gateway settings"
+msgstr ""
+
+#: networking.c:260
+msgid "When configuration is complete, a network restart will be required."
+msgstr ""
+
+#: networking.c:267
+#, c-format
+msgid ""
+"Current config: %s\n"
+"\n"
+"%s"
+msgstr ""
+
+#: networking.c:268
+msgid "Network configuration menu"
+msgstr ""
+
+#: networking.c:269 networking.c:520 networking.c:642
+msgid "Done"
+msgstr ""
+
+#: networking.c:300
+#, c-format
+msgid ""
+"Select the network configuration for %s. The following configuration types "
+"list those interfaces which have ethernet attached. If you change this "
+"setting, a network restart will be required, and you will have to "
+"reconfigure the network driver assignments."
+msgstr ""
+
+#: networking.c:307
+#, c-format
+msgid ""
+"Not enough netcards for your choice.\n"
+"\n"
+"Needed: %d - Available: %d\n"
+msgstr ""
+
+#: networking.c:359
+msgid ""
+"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
+"\n"
+msgstr ""
+
+#: networking.c:408
+msgid "Do you wish to change these settings?"
+msgstr ""
+
+#: networking.c:447
+msgid "Restarting non-local network..."
+msgstr ""
+
+#: networking.c:464
+msgid ""
+"Please choose the interface you wish to change.\n"
+"\n"
+msgstr ""
+
+#: networking.c:519
+msgid "Assigned Cards"
+msgstr ""
+
+#: networking.c:520
+msgid "Remove"
+msgstr ""
+
+#: networking.c:556 networking.c:649
+#, c-format
+msgid ""
+"If you change this IP address, and you are logged in remotely, your "
+"connection to the %s machine will be broken, and you will have to reconnect "
+"on the new IP. This is a risky operation, and should only be attempted if "
+"you have physical access to the machine, should something go wrong."
+msgstr ""
+
+#: networking.c:641
+msgid "Select the interface you wish to reconfigure."
+msgstr ""
+
+#: networking.c:729
+msgid "Default gateway:"
+msgstr ""
+
+#: networking.c:744
+msgid ""
+"Enter the DNS and gateway information. These settings are used only with "
+"Static IP (and DHCP if DNS set) on the RED interface."
+msgstr ""
+
+#: networking.c:773
+msgid "Default gateway"
+msgstr ""
+
+#: networking.c:780
+msgid "Secondary DNS specified without a Primary DNS"
+msgstr ""
+
+#: passwords.c:33
+msgid ""
+"Enter the 'root' user password. Login as this user for commandline access."
+msgstr ""
+
+#: passwords.c:38 passwords.c:61
+msgid "Setting password"
+msgstr ""
+
+#: passwords.c:38
+msgid "Setting 'root' password...."
+msgstr ""
+
+#: passwords.c:39
+msgid "Problem setting 'root' password."
+msgstr ""
+
+#: passwords.c:53
+#, c-format
+msgid ""
+"Enter %s 'admin' user password. This is the user to use for logging into the"
+" %s web administration pages."
+msgstr ""
+
+#: passwords.c:60
+#, c-format
+msgid "Setting %s 'admin' user password..."
+msgstr ""
+
+#: passwords.c:62
+#, c-format
+msgid "Problem setting %s 'admin' user password."
+msgstr ""
+
+#: passwords.c:76
+msgid "Password:"
+msgstr ""
+
+#: passwords.c:77
+msgid "Again:"
+msgstr ""
+
+#: passwords.c:95
+msgid "Password cannot be blank."
+msgstr ""
+
+#: passwords.c:102
+msgid "Passwords do not match."
+msgstr ""
+
+#: passwords.c:109
+msgid "Password cannot contain spaces."
+msgstr ""
+
+#: timezone.c:77
+msgid "Choose the timezone you are in from the list below."
+msgstr ""
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Ersan YILDIRIM <ersan73@gmail.com>, 2015
+# Kudret Emre <kudretemre@hotmail.com.tr>, 2014
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-02-28 22:59+0000\n"
+"Last-Translator: Ersan YILDIRIM <ersan73@gmail.com>\n"
"Language-Team: Turkish (http://www.transifex.com/projects/p/ipfire/language/tr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "Başlangıç adresi:"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "Bitiş adresi:"
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "Birincil DNS:"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "İkincil DNS:"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "Varsayılan kira (dakika):"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "En fazla kira (dakika):"
#: dhcp.c:56
msgid "Domain name suffix:"
-msgstr ""
+msgstr "Etki alanı adı son eki:"
#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "Ayar dosyası açılamıyor"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "DHCP Sunucu Yapılandırması"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "DHCP ayar bilgilerini girerek DHCP sunucusunu yapılandırın."
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "Etkin"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
#: timezone.c:78
msgid "OK"
-msgstr ""
+msgstr "Tamam"
#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "İptal"
#: dhcp.c:156
msgid ""
"The following fields are invalid:\n"
"\n"
-msgstr ""
+msgstr "Aşağıdaki alanlar geçersiz:\n\n"
#: dhcp.c:159
msgid "Start address"
-msgstr ""
+msgstr "Başlangış adresi"
#: dhcp.c:165
msgid "End address"
-msgstr ""
+msgstr "Bitiş adresi"
#: dhcp.c:173 networking.c:755
msgid "Primary DNS"
-msgstr ""
+msgstr "Birincil DNS"
#: dhcp.c:182 networking.c:764
msgid "Secondary DNS"
-msgstr ""
+msgstr "İkincil DNS"
#: dhcp.c:189
msgid "Default lease time"
-msgstr ""
+msgstr "Varsayılan kira süresi"
#: dhcp.c:195
msgid "Max. lease time"
-msgstr ""
+msgstr "En fazla kira süresi"
#: domainname.c:42 main.c:70
msgid "Domain name"
-msgstr ""
+msgstr "Etki alanı adı"
#: domainname.c:42
msgid "Enter Domain name"
-msgstr ""
+msgstr "Etki alanı adını girin"
#: domainname.c:48
msgid "Domain name cannot be empty."
-msgstr ""
+msgstr "Etki alanı adı boş olamaz."
#: domainname.c:50
msgid "Domain name cannot contain spaces."
-msgstr ""
+msgstr "Etki alanı adı boşluk içeremez."
#: domainname.c:53
msgid "Domain name may only contain letters, numbers, hyphens and periods."
-msgstr ""
+msgstr "Etki alanı adı sadece harf, sayı, tire ve nokta içerebilir."
#: hostname.c:46 main.c:69
msgid "Hostname"
-msgstr ""
+msgstr "Ana bilgisayar adı"
#: hostname.c:46
msgid "Enter the machine's hostname."
-msgstr ""
+msgstr "Makinanın ana bilgisayar adını girin."
#: hostname.c:53
msgid "Hostname cannot be empty."
-msgstr ""
+msgstr "Ana bilgisaya adı boş olamaz."
#: hostname.c:55
msgid "Hostname cannot contain spaces."
-msgstr ""
+msgstr "Ana bilgisayaradı boşluk içeremez."
#: hostname.c:58
msgid "Hostname may only contain letters, numbers and hyphens."
-msgstr ""
+msgstr "Ana bilgisayar adı sadece harf, sayı ve tire içerebilir."
#: keymap.c:84 main.c:67
msgid "Keyboard mapping"
-msgstr ""
+msgstr "Klavye eşlemesi"
#: keymap.c:85
msgid "Choose the type of keyboard you are using from the list below."
-msgstr ""
+msgstr "Aşağıdaki listeden kullandığınız klavye türünü seçin."
#: main.c:68 timezone.c:77
msgid "Timezone"
-msgstr ""
+msgstr "Zaman dilimi"
#: main.c:71 networking.c:110 networking.c:115 networking.c:447
msgid "Networking"
-msgstr ""
+msgstr "Ağ"
#: main.c:72 misc.c:147
msgid "ISDN"
-msgstr ""
+msgstr "ISDN"
#: main.c:73
msgid "'root' password"
-msgstr ""
+msgstr "'root' parolası"
#: main.c:74
msgid "'admin' password"
-msgstr ""
+msgstr "'admin' parolası"
#: main.c:90
msgid " <Tab>/<Alt-Tab> between elements | <Space> selects"
-msgstr ""
+msgstr " <Tab>/<Alt-Tab> elementler arası geçiş | <Space> seç"
#: main.c:97
msgid "Section menu"
-msgstr ""
+msgstr "Bölüm listesi"
#: main.c:98
msgid "Select the item you wish to configure."
-msgstr ""
+msgstr "Yapılandırmak istediğiniz öğeyi seçin"
#: main.c:99
msgid "Quit"
-msgstr ""
+msgstr "Çıkış"
#: main.c:172
msgid "Setup is complete."
-msgstr ""
+msgstr "Kurulum tamamlandı."
#: main.c:174 netstuff.c:733 networking.c:560 networking.c:653
msgid "Warning"
-msgstr ""
+msgstr "Uyarı"
#: main.c:175
msgid ""
"Initial setup was not entirely complete. You must ensure that Setup is "
"properly finished by running setup again at the shell."
-msgstr ""
+msgstr "İlk kurulum tamamen yapılamadı. Kurulumun terminalden yeniden başlatılıp düzgünce bitirildiğinden emin olmalısınız."
#: misc.c:62
#, c-format
msgid "Unable to write %s/main/hostname.conf"
-msgstr ""
+msgstr "%s/main/hostname.conf yazılamıyor"
#: misc.c:71
msgid "Unable to open main hosts file."
-msgstr ""
+msgstr "Ana hosts dosyası açılamıyor."
#: misc.c:76
msgid "Unable to write /etc/hosts."
-msgstr ""
+msgstr "/etc/hosts yazılamıyor."
#: misc.c:117
msgid "Unable to write /etc/hosts.deny."
-msgstr ""
+msgstr " /etc/hosts.deny yazılamıyor."
#: misc.c:125
msgid "Unable to write /etc/hosts.allow."
-msgstr ""
+msgstr "/etc/hosts.allow yazılamıyor."
#: misc.c:136
msgid "Unable to set hostname."
-msgstr ""
+msgstr "Ana bilgisayar adı ayarlanamıyor."
#: misc.c:147
msgid "Scanning and configuring ISDN devices."
-msgstr ""
+msgstr "ISDN cihazları taranıyor ve yapılandırılıyor."
#: misc.c:148
msgid "Unable to scan for ISDN devices."
-msgstr ""
+msgstr "ISDN cihazları için tarama yapılamıyor."
#: netstuff.c:86
#, c-format
msgid "Interface - %s"
-msgstr ""
+msgstr "Ara Birim - %s"
#: netstuff.c:91
#, c-format
msgid "Enter the IP address information for the %s interface."
-msgstr ""
+msgstr "%s ara birimi için IP adres bilgisini girin."
#: netstuff.c:103
msgid "Static"
-msgstr ""
+msgstr "Statik"
#: netstuff.c:104
msgid "DHCP"
-msgstr ""
+msgstr "DHCP"
#: netstuff.c:105
msgid "PPP DIALUP (PPPoE, modem, ATM ...)"
-msgstr ""
+msgstr "PPP DIALUP (PPPoE, modem, ATM ...)"
#: netstuff.c:113
msgid "DHCP Hostname:"
-msgstr ""
+msgstr "DHCP Ana bilgisayar adı:"
#: netstuff.c:115
msgid "Force DHCP MTU:"
-msgstr ""
+msgstr "DHCP MTU zorla:"
#: netstuff.c:134
msgid "IP address:"
-msgstr ""
+msgstr "IP adresi:"
#: netstuff.c:146
msgid "Network mask:"
-msgstr ""
+msgstr "Ağ maskesi:"
#: netstuff.c:173 networking.c:749
msgid "The following fields are invalid:"
-msgstr ""
+msgstr "Aşağıdaki alanlar geçersiz:"
#: netstuff.c:183
msgid "IP address"
-msgstr ""
+msgstr "IP adresi"
#: netstuff.c:189
msgid "Network mask"
-msgstr ""
+msgstr "Ağ maskesi"
#: netstuff.c:198
msgid "DHCP hostname"
-msgstr ""
+msgstr "DHCP Ana bilgisayar adı"
#: netstuff.c:396 netstuff.c:709
msgid "Unset"
-msgstr ""
+msgstr "Kurulmamış"
#: netstuff.c:669
#, c-format
msgid "Please choose a networkcard for the following interface - %s."
-msgstr ""
+msgstr "Lütfen %s ara birimi için bir ağ kartı seçin."
#: netstuff.c:672
msgid "Extended Network Menu"
-msgstr ""
+msgstr "Genişletilmiş Ağ Listesi"
#: netstuff.c:673 networking.c:520
msgid "Select"
-msgstr ""
+msgstr "Seç"
#: netstuff.c:673
msgid "Identify"
-msgstr ""
+msgstr "Tanımla"
#: netstuff.c:678
msgid "Device Identification"
-msgstr ""
+msgstr "Cihaz Tanımlama"
#: netstuff.c:678
msgid "The lights on the selected port should flash now for 10 seconds..."
-msgstr ""
+msgstr "Seçilen porttaki ışıklar şimdi 10 saniye boyunca yanıp sönmeli..."
#: netstuff.c:679
msgid "Identification is not supported by this interface."
-msgstr ""
+msgstr "Bu ara birim kimdik doğrulamayı desteklemiyor."
#: netstuff.c:691
msgid "There are no unassigned interfaces on your system."
-msgstr ""
+msgstr "Sisteminizde atanmamış ara birim yok."
#: netstuff.c:732
#, c-format
msgid "Do you really want to remove the assigned %s interface?"
-msgstr ""
+msgstr "Atanmış %s ara birimini gerçekten kaldırmak istiyor musunuz?"
#: netstuff.c:755
msgid "Select network driver"
-msgstr ""
+msgstr "Ağ sürücüsünü seç"
#: netstuff.c:755
msgid "Set additional module parameters"
-msgstr ""
+msgstr "Ek modül parametrelerini ayarla"
#: netstuff.c:762
msgid "Loading module..."
-msgstr ""
+msgstr "Modül yükleniyor..."
#: netstuff.c:777
msgid "Unable to load driver module."
-msgstr ""
+msgstr "Sürücü modülü yüklenemiyor."
#: netstuff.c:780
msgid "Module name cannot be blank."
-msgstr ""
+msgstr "Modül ismi boş olamaz."
#: networking.c:110
msgid "Stopping network..."
-msgstr ""
+msgstr "Ağ durduruluyor..."
#: networking.c:115
msgid "Restarting network..."
-msgstr ""
+msgstr "Ağ yeniden başlatılıyor..."
#: networking.c:146
msgid "No GREEN interface assigned."
-msgstr ""
+msgstr "Atanmış YEŞİL ara birim yok."
#: networking.c:152
msgid "Missing an IP address on GREEN."
-msgstr ""
+msgstr "YEŞİL üzerinde kayıp IP adresi."
#: networking.c:163
msgid "Error"
-msgstr ""
+msgstr "Hata"
#: networking.c:163
msgid "Ignore"
-msgstr ""
+msgstr "Yoksay"
#: networking.c:164
msgid "No RED interface assigned."
-msgstr ""
+msgstr "Atanmış KIRMIZI ara birim yok."
#: networking.c:173
msgid "Missing an IP address on RED."
-msgstr ""
+msgstr "KIRMIZI üzerinde kayıp IP adresi."
#: networking.c:183
msgid "No ORANGE interface assigned."
-msgstr ""
+msgstr "Atanmış TURUNCU ara birim yok."
#: networking.c:189
msgid "Missing an IP address on ORANGE."
-msgstr ""
+msgstr "TURUNCU üzerinde kayıp IP adresi."
#: networking.c:199
msgid "No BLUE interface assigned."
-msgstr ""
+msgstr "Atanmış MAVİ ara birim yok."
#: networking.c:205
msgid "Missing an IP address on BLUE."
-msgstr ""
+msgstr "MAVİ üzerinde kayıp IP adresi."
#: networking.c:217
msgid "Misssing DNS."
-msgstr ""
+msgstr "Kayıp DNS."
#: networking.c:224
msgid "Missing Default Gateway."
-msgstr ""
+msgstr "Kayıp Varsayılan Ağ Geçidi"
#: networking.c:237 networking.c:304
msgid "Network configuration type"
-msgstr ""
+msgstr "Ağ yapılandırma türü"
#: networking.c:238 networking.c:409
msgid "Drivers and card assignments"
-msgstr ""
+msgstr "Sürücüler ve kart atamaları"
#: networking.c:239 networking.c:640
msgid "Address settings"
-msgstr ""
+msgstr "Adres Ayarları"
#: networking.c:240 networking.c:743
msgid "DNS and Gateway settings"
-msgstr ""
+msgstr "DNS ve Ağ Geçidi Ayarları"
#: networking.c:260
msgid "When configuration is complete, a network restart will be required."
-msgstr ""
+msgstr "Yapılandırma tamamlandığında ağı yeniden başlatmanız gerekir."
#: networking.c:267
#, c-format
"Current config: %s\n"
"\n"
"%s"
-msgstr ""
+msgstr "Geçerli yapılandırma: %s\n\n%s"
#: networking.c:268
msgid "Network configuration menu"
-msgstr ""
+msgstr "Ağ Yapılandırma Listesi"
#: networking.c:269 networking.c:520 networking.c:642
msgid "Done"
-msgstr ""
+msgstr "Bitti"
#: networking.c:300
#, c-format
"list those interfaces which have ethernet attached. If you change this "
"setting, a network restart will be required, and you will have to "
"reconfigure the network driver assignments."
-msgstr ""
+msgstr "%s için ağ yapılandırmasını seçin. Aşağıdaki yapılandırma türleri ethernet kartlarına atanmış arabirimleri listeler. Eğer bu ayarları değiştirirseniz, ağın yeniden başlatılması ve ağ sürücüleri atamalarını tekrar yapılandırmanız gerekecektir."
#: networking.c:307
#, c-format
"Not enough netcards for your choice.\n"
"\n"
"Needed: %d - Available: %d\n"
-msgstr ""
+msgstr "Seçiminiz için yeterli kart yok.\n\nGereken: %d - Kullanılabilir: %d\n"
#: networking.c:359
msgid ""
"Configure network drivers, and which interface each card is assigned to. The current configuration is as follows:\n"
"\n"
-msgstr ""
+msgstr "Ağ sürücülerini ve her bir kart için atanmış ara birimleri yapılandırın. Geçerli yapılandırma aşağıdaki gibidir:\n\n"
#: networking.c:408
msgid "Do you wish to change these settings?"
-msgstr ""
+msgstr "Bu ayarları değiştirmek istiyor musunuz?"
#: networking.c:447
msgid "Restarting non-local network..."
-msgstr ""
+msgstr "Yerel olmayan ağ yeniden başlatılıyor..."
#: networking.c:464
msgid ""
"Please choose the interface you wish to change.\n"
"\n"
-msgstr ""
+msgstr "Lütfen değiştirmek istediğiniz ara birimi seçin.\n\n"
#: networking.c:519
msgid "Assigned Cards"
-msgstr ""
+msgstr "Atanmış Kartlar"
#: networking.c:520
msgid "Remove"
-msgstr ""
+msgstr "Kaldır"
#: networking.c:556 networking.c:649
#, c-format
"connection to the %s machine will be broken, and you will have to reconnect "
"on the new IP. This is a risky operation, and should only be attempted if "
"you have physical access to the machine, should something go wrong."
-msgstr ""
+msgstr "Eğer bu IP adresini değiştirirseniz, ve uzaktan oturum açmışsanız, %s makinesine olan bağlantınız kopacaktır ve yeni IP adresine tekrar bağlanmanız gerekecektir. Bu riskli bir işlemdir ve bir şeylerin ters gitmesi durumunda makineye fiziksel erişiminiz varsa kullanmalısınız."
#: networking.c:641
msgid "Select the interface you wish to reconfigure."
-msgstr ""
+msgstr "Yeniden yapılandırmak istediğiniz ara birimi seçin."
#: networking.c:729
msgid "Default gateway:"
-msgstr ""
+msgstr "Varsayılan ağ geçidi:"
#: networking.c:744
msgid ""
"Enter the DNS and gateway information. These settings are used only with "
"Static IP (and DHCP if DNS set) on the RED interface."
-msgstr ""
+msgstr "DNS ve ağ geçidi bilgilerini girin. Bu ayarlar sadece KIRMIZI ara birim adres ayarlarında Statik seçeneği seçilmişse kullanılır. Eğer KIRMIZI ara birim adres ayarlarında DHCP seçeneğini seçtiyseniz bu alanı boş bırakabilirsiniz."
#: networking.c:773
msgid "Default gateway"
-msgstr ""
+msgstr "Varsayılan ağ geçidi"
#: networking.c:780
msgid "Secondary DNS specified without a Primary DNS"
-msgstr ""
+msgstr "Birincil DNS olmadan İkincil DNS belirtildi."
#: passwords.c:33
msgid ""
"Enter the 'root' user password. Login as this user for commandline access."
-msgstr ""
+msgstr "%s 'root' kullanıcı parolasını girin. Komut satırı erişimi için bu kullanıcıyla oturum açın."
#: passwords.c:38 passwords.c:61
msgid "Setting password"
-msgstr ""
+msgstr "Parola ayarlanıyor"
#: passwords.c:38
msgid "Setting 'root' password...."
-msgstr ""
+msgstr "'root' parolası ayarlanıyor..."
#: passwords.c:39
msgid "Problem setting 'root' password."
-msgstr ""
+msgstr "'root' parolası ayarlama sorunu."
#: passwords.c:53
#, c-format
msgid ""
"Enter %s 'admin' user password. This is the user to use for logging into the"
" %s web administration pages."
-msgstr ""
+msgstr "%s 'admin' kullanıcı parolasını girin. Bu kullanıcı, %s web yönetimi sayfalarının kayıtlarına erişebilen kullanıcıdır."
#: passwords.c:60
#, c-format
msgid "Setting %s 'admin' user password..."
-msgstr ""
+msgstr "%s 'admin' kullanıcısının parolası ayarlanıyor..."
#: passwords.c:62
#, c-format
msgid "Problem setting %s 'admin' user password."
-msgstr ""
+msgstr "%s 'admin' kullanıcı parolası ayarlama sorunu."
#: passwords.c:76
msgid "Password:"
-msgstr ""
+msgstr "Parola:"
#: passwords.c:77
msgid "Again:"
-msgstr ""
+msgstr "Tekrar:"
#: passwords.c:95
msgid "Password cannot be blank."
-msgstr ""
+msgstr "Parola boş olamaz."
#: passwords.c:102
msgid "Passwords do not match."
-msgstr ""
+msgstr "Parolalar eşleşmiyor."
#: passwords.c:109
msgid "Password cannot contain spaces."
-msgstr ""
+msgstr "Parola boşluk içeremez."
#: timezone.c:77
msgid "Choose the timezone you are in from the list below."
-msgstr ""
+msgstr "Aşağıdaki listeden bulunduğunuz zaman dilimini seçin."
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# ipfire <qiwenqiu@yahoo.com.hk>, 2015
msgid ""
msgstr ""
"Project-Id-Version: IPFire Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-21 15:12+0000\n"
-"PO-Revision-Date: 2014-08-21 15:13+0000\n"
-"Last-Translator: Michael Tremer <michael.tremer@ipfire.org>\n"
+"PO-Revision-Date: 2015-01-31 09:57+0000\n"
+"Last-Translator: ipfire <qiwenqiu@yahoo.com.hk>\n"
"Language-Team: Chinese (http://www.transifex.com/projects/p/ipfire/language/zh/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
#: dhcp.c:50
msgid "Start address:"
-msgstr ""
+msgstr "起始地址"
#: dhcp.c:51
msgid "End address:"
-msgstr ""
+msgstr "结束地址"
#: dhcp.c:52 networking.c:717
msgid "Primary DNS:"
-msgstr ""
+msgstr "首选DNS服务器"
#: dhcp.c:53 networking.c:723
msgid "Secondary DNS:"
-msgstr ""
+msgstr "备用DNS服务器"
#: dhcp.c:54
msgid "Default lease (mins):"
-msgstr ""
+msgstr "默认租约(分钟)"
#: dhcp.c:55
msgid "Max lease (mins):"
-msgstr ""
+msgstr "最大租约(分钟)"
#: dhcp.c:56
msgid "Domain name suffix:"
-msgstr ""
+msgstr "域名后缀"
#: dhcp.c:86 dhcp.c:93 dhcp.c:101 domainname.c:34 hostname.c:37 keymap.c:70
#: misc.c:40 misc.c:52 netstuff.c:377 netstuff.c:566 netstuff.c:704
#: networking.c:442 networking.c:552 networking.c:603 networking.c:610
#: networking.c:713 timezone.c:63
msgid "Unable to open settings file"
-msgstr ""
+msgstr "无法打开配置文件"
#: dhcp.c:111
msgid "DHCP server configuration"
-msgstr ""
+msgstr "DHCP服务器配置"
#: dhcp.c:116
msgid "Configure the DHCP server by entering the settings information."
-msgstr ""
+msgstr "DHCP服务器配置信息"
#: dhcp.c:125
msgid "Enabled"
-msgstr ""
+msgstr "应用"
#: dhcp.c:142 domainname.c:43 hostname.c:47 keymap.c:86 main.c:99 main.c:172
#: main.c:174 netstuff.c:157 netstuff.c:733 netstuff.c:756 networking.c:163
#: networking.c:642 networking.c:653 networking.c:746 passwords.c:89
#: timezone.c:78
msgid "OK"
-msgstr ""
+msgstr "确定"
#: dhcp.c:143 domainname.c:43 hostname.c:47 keymap.c:86 netstuff.c:158
#: netstuff.c:673 netstuff.c:733 netstuff.c:756 networking.c:305
#: networking.c:410 networking.c:560 networking.c:653 networking.c:746
#: passwords.c:89 timezone.c:78
msgid "Cancel"
-msgstr ""
+msgstr "取消"
#: dhcp.c:156
msgid ""
int interfacecheck(struct keyvalue *kv, char *colour);
int rename_nics(void);
int init_knics(void);
-int create_udev(void);
int scan_network_cards(void);
int nicmenu(int colour);
int clear_card_entry(int cards);
my @billar = @{$_[0]}; #DATA from sendbill (just host/values)
my $month = $_[1];
$month = '0'.$month if $month < 10;
+ $month = '12' if $month == 0;
my $year = $_[2];
my $mwst = $_[3];
my @address_cust= @{$_[4]}; #Array which contains customer and hoster adresses and some additional info from billgroup
my @now = localtime(time);
$now[5] = $now[5] + 1900;
my $actmonth = $now[4];
- my $month = '0'.$actmonth if $actmonth < 10;
+ my $month;
+ $month = '0'.$actmonth if $actmonth < 10;
+ $month = '12' if $actmonth == 0;
my $actyear = $now[5];
my ($from,$till)=&ACCT::getmonth($actmonth,$actyear); #FIXME month and year as variables!
my @billar = &ACCT::GetTaValues($from,$till,$rggrp);
$BASEDIR/tools/check_strings.pl it > $BASEDIR/doc/language_issues.it
$BASEDIR/tools/check_langs.sh > $BASEDIR/doc/language_missings
beautify message DONE
+
+ echo -ne "Updating language lists..."
+ update_language_list ${BASEDIR}/src/installer/po
+ update_language_list ${BASEDIR}/src/setup/po
+ beautify message DONE
+}
+
+update_language_list() {
+ local path="${1}"
+
+ local lang
+ for lang in ${path}/*.po; do
+ lang="$(basename "${lang}")"
+ echo "${lang%*.po}"
+ done | sort -u > "${path}/LINGUAS"
}