CONFIG_DM_CRYPT=y
CONFIG_DM_UEVENT=y
CONFIG_NETDEVICES=y
-CONFIG_NET_ETHERNET=y
-CONFIG_RK29_VMAC=y
+CONFIG_PHYLIB=y
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
CONFIG_WLAN_80211=y
CONFIG_BCM4329=y
+CONFIG_USB_USBNET=y
CONFIG_PPP=y
CONFIG_PPP_MULTILINK=y
CONFIG_PPP_FILTER=y
* V1.5 - Support RK2818 (Debug the Register Function)
*/
-//#define DEBUG
+#define DEBUG
-#define RK2818
+//#define RK2818
#include <linux/module.h>
static void dm9620_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 || net->mc_count > DM_MAX_MCAST) {
- rx_ctl |= 0x04;
- } else if (net->mc_count) {
- struct dev_mc_list *mc_list = net->mc_list;
- int i;
-
- for (i = 0; i < net->mc_count; i++, mc_list = mc_list->next) {
- u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_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);
+ 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 |= 0x04;
+ } 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);
}
* kind, whether express or implied.
*/
-//#define DEBUG
+#define DEBUG
#include <linux/module.h>
#include <linux/sched.h>
static void sr9700_android_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; // enable, disable_long, disable_crc
-
- memset(hashes, 0x00, QF_MCAST_SIZE);
- hashes[QF_MCAST_SIZE - 1] |= 0x80; /* broadcast address */
-
- if (net->flags & IFF_PROMISC) {
- rx_ctl |= 0x02;
- } else if (net->flags & IFF_ALLMULTI || net->mc_count > QF_MCAST_MAX) {
- rx_ctl |= 0x04;
- } else if (net->mc_count) {
- struct dev_mc_list *mc_list = net->mc_list;
- int i;
-
- for (i = 0; i < net->mc_count; i++, mc_list = mc_list->next) {
- u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26;
- hashes[crc >> 3] |= 1 << (crc & 0x7);
- }
- }
-
- qf_write_async(dev, MAR, QF_MCAST_SIZE, hashes);
- qf_write_reg_async(dev, RCR, rx_ctl);
+ 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, QF_MCAST_SIZE);
+ hashes[QF_MCAST_SIZE - 1] |= 0x80; /* broadcast address */
+
+ if (net->flags & IFF_PROMISC) {
+ rx_ctl |= 0x02;
+ } else if (net->flags & IFF_ALLMULTI ||
+ netdev_mc_count(net) > QF_MCAST_MAX) {
+ rx_ctl |= 0x04;
+ } 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);
+ }
+ }
+
+ qf_write_async(dev, MAR, QF_MCAST_SIZE, hashes);
+ qf_write_reg_async(dev, RCR, rx_ctl);
}
static int sr9700_android_set_mac_address(struct net_device *net, void *p)
extern void usbnet_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
extern int usbnet_nway_reset(struct net_device *net);
+
+#ifdef DEBUG
+#define devdbg(usbnet, fmt, arg...) \
+ printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
+#else
+#define devdbg(usbnet, fmt, arg...) \
+ ({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \
+ ## arg); 0; })
+#endif
+
+#define deverr(usbnet, fmt, arg...) \
+ printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
+#define devwarn(usbnet, fmt, arg...) \
+ printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
+
+#define devinfo(usbnet, fmt, arg...) \
+ printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg);
+
#endif /* __LINUX_USB_USBNET_H */