Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255627
b: refs/heads/master
c: 4aa3a71
h: refs/heads/master
i:
  255625: fb67ae3
  255623: ed670d1
v: v3
  • Loading branch information
Sebastian Poehn authored and David S. Miller committed Jun 20, 2011
1 parent d9a4506 commit 11af0e4
Show file tree
Hide file tree
Showing 4 changed files with 990 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d13d6bffb418a660c06a5a12afcf7e7081489548
refs/heads/master: 4aa3a715551c93eda32d79bd52042ce500bd5383
10 changes: 7 additions & 3 deletions trunk/drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,11 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
priv->num_rx_queues = num_rx_qs;
priv->num_grps = 0x0;

/* Init Rx queue filer rule set linked list*/
INIT_LIST_HEAD(&priv->rx_list.list);
priv->rx_list.count = 0;
mutex_init(&priv->rx_queue_access);

model = of_get_property(np, "model", NULL);

for (i = 0; i < MAXGROUPS; i++)
Expand Down Expand Up @@ -1150,9 +1155,8 @@ static int gfar_probe(struct platform_device *ofdev)
priv->rx_queue[i]->rxic = DEFAULT_RXIC;
}

/* enable filer if using multiple RX queues*/
if(priv->num_rx_queues > 1)
priv->rx_filer_enable = 1;
/* always enable rx filer*/
priv->rx_filer_enable = 1;
/* Enable most messages by default */
priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;

Expand Down
53 changes: 53 additions & 0 deletions trunk/drivers/net/gianfar.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
#include <linux/workqueue.h>
#include <linux/ethtool.h>

struct ethtool_flow_spec_container {
struct ethtool_rx_flow_spec fs;
struct list_head list;
};

struct ethtool_rx_list {
struct list_head list;
unsigned int count;
};

/* The maximum number of packets to be handled in one call of gfar_poll */
#define GFAR_DEV_WEIGHT 64

Expand Down Expand Up @@ -168,6 +178,7 @@ extern const char gfar_driver_version[];
#define MACCFG2_LENGTHCHECK 0x00000010
#define MACCFG2_MPEN 0x00000008

#define ECNTRL_FIFM 0x00008000
#define ECNTRL_INIT_SETTINGS 0x00001000
#define ECNTRL_TBI_MODE 0x00000020
#define ECNTRL_REDUCED_MODE 0x00000010
Expand Down Expand Up @@ -271,6 +282,7 @@ extern const char gfar_driver_version[];
#define RCTRL_TUCSEN 0x00000100
#define RCTRL_PRSDEP_MASK 0x000000c0
#define RCTRL_PRSDEP_INIT 0x000000c0
#define RCTRL_PRSFM 0x00000020
#define RCTRL_PROM 0x00000008
#define RCTRL_EMEN 0x00000002
#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \
Expand Down Expand Up @@ -1066,6 +1078,9 @@ struct gfar_private {

struct vlan_group *vlgrp;

/* RX queue filer rule set*/
struct ethtool_rx_list rx_list;
struct mutex rx_queue_access;

/* Hash registers and their width */
u32 __iomem *hash_regs[16];
Expand Down Expand Up @@ -1140,6 +1155,16 @@ static inline void gfar_write_filer(struct gfar_private *priv,
gfar_write(&regs->rqfpr, fpr);
}

static inline void gfar_read_filer(struct gfar_private *priv,
unsigned int far, unsigned int *fcr, unsigned int *fpr)
{
struct gfar __iomem *regs = priv->gfargrp[0].regs;

gfar_write(&regs->rqfar, far);
*fcr = gfar_read(&regs->rqfcr);
*fpr = gfar_read(&regs->rqfpr);
}

extern void lock_rx_qs(struct gfar_private *priv);
extern void lock_tx_qs(struct gfar_private *priv);
extern void unlock_rx_qs(struct gfar_private *priv);
Expand All @@ -1157,4 +1182,32 @@ int gfar_set_features(struct net_device *dev, u32 features);

extern const struct ethtool_ops gfar_ethtool_ops;

#define MAX_FILER_CACHE_IDX (2*(MAX_FILER_IDX))

#define RQFCR_PID_PRI_MASK 0xFFFFFFF8
#define RQFCR_PID_L4P_MASK 0xFFFFFF00
#define RQFCR_PID_VID_MASK 0xFFFFF000
#define RQFCR_PID_PORT_MASK 0xFFFF0000
#define RQFCR_PID_MAC_MASK 0xFF000000

struct gfar_mask_entry {
unsigned int mask; /* The mask value which is valid form start to end */
unsigned int start;
unsigned int end;
unsigned int block; /* Same block values indicate depended entries */
};

/* Represents a receive filer table entry */
struct gfar_filer_entry {
u32 ctrl;
u32 prop;
};


/* The 20 additional entries are a shadow for one extra element */
struct filer_table {
u32 index;
struct gfar_filer_entry fe[MAX_FILER_CACHE_IDX + 20];
};

#endif /* __GIANFAR_H */
Loading

0 comments on commit 11af0e4

Please sign in to comment.