type
stringclasses
5 values
content
stringlengths
9
163k
functions
bits for(i=0 ; i < 0x20 && hEth->phyCount < OMETH_MAX_PHY_CNT ; i++) { // do not search for this phy if list is activated and phy is not in list if(hEth->config.mode & OMETH_MODE_PHY_LIST) { for(len=0;len<hEth->config.phyCount;len++) { // break thi...
functions
startup if(data==0xFFFF) { hEth->phyCount--; continue; // phy not connected, look for next }
functions
user if(pEthConfig->mode & OMETH_MODE_SET_RES_IPG) { i = pEthConfig->responseIpg; }
functions
else if (hEth->phyCount==1) { if(phyId==MICREL_KS8721_PHY_ID) i = MICREL_KS8721_IPG; }
functions
else if (hEth->phyCount==2) { //e.g. EBV DB3C40 BOARD (Cyclone 3) if(phyId==NATIONAL_DP83640_PHY_ID) i = NATIONAL_DP83640_IPG; //e.g. TERASIC DE2-115 (Cyclone 4) else if(phyId==MARVELL_88E1111_PHY_ID) i = MARVELL_88E1111_IPG; //...add more if needed }
functions
descriptor if(i != ~0) { // calculate value for ipg-register (80 ns offset, 20ns resolution) if(i > 80) i = (i-80)/20; else i = 1; // value too small, take minimum if (i > OMETH_MAX_RES_IPG) i = OMETH_MAX_RES_IPG; // limit to maximum i = OMETH_RE...
functions
DPR switch(hEth->config.macType) { case OMETH_MAC_TYPE_01: // Typ 01 hEth->nbFilter = MAC_HW_TYP_01_NB_FILTER; len = sizeof(ometh_filter_typ) * hEth->nbFilter; // too many rx buffers configured (hardware dependent) if(hEth->config.rxBuffers > MAC_H...
functions
data if(hEth->config.pktLoc == OMETH_PKT_LOC_MACINT) { //use mac internal packet buffer pByte = hEth->config.pBufBase; //store tx buffer address for appi hEth->pTxBufBase = pByte + hEth->config.rxBuffers * len; }
functions
else if(hEth->config.pktLoc == OMETH_PKT_LOC_HEAP) { //use heap pByte = OMETH_MAKE_NONCACHABLE(calloc(hEth->config.rxBuffers * len ,1)); //store tx buffer address equ. rx buffer -> tx is handled by user! hEth->pTxBufBase = pByte; }
functions
duplex if(hEth->config.mode & OMETH_MODE_HALFDUPLEX) { if(hEth->config.mode & OMETH_MODE_100MBIT) data |= PHY_REG4_100TX_HALF; if(hEth->config.mode & OMETH_MODE_10MBIT) data |= PHY_REG4_10T_HALF; }
functions
phys for(i=0 ; i < hEth->phyCount ; i++) { len = 0; // autoneg disabled for all ports if(hEth->config.mode & OMETH_MODE_DIS_AUTO_NEG) len = 1; // check if autoneg is specially disabled for this port if( (i<8) && ((hEth->config.mode>>i) & OMETH_MODE_DIS_AUTO_NEG_P0) )...
functions
OMETH_H omethCreate ( ometh_config_typ *pEthConfig /* ptr to ethernet config struct */ ) { OMETH_H hEth; hEth = omethCreateInt(pEthConfig); // call internal create function assert(hEth); if(hEth==0) return 0; // instance was allocated but not successful initiali...
functions
int omethPhySetHalfDuplex ( void ) { OMETH_H hEth = omethInternal.pPeriodicEth; if (hEth == 0) return -1; // you must call omethPeriodic first hEth->config.mode |= OMETH_MODE_FULLDUPLEX; return 0; }
functions
void omethPeriodic ( void ) { OMETH_H hEth = omethInternal.pPeriodicEth; phy_reg_typ *pPhyReg; // ptr to registers of processed phy ometh_mii_typ *pMII; // ptr to MII unsigned short x,r4,speed; //WORD x,r4,speed; if(hEth==0) // initialize ...
functions
MII if (pMII->cmd.ack & 1) { return; // mii busy }
functions
interface if(hEth->phyCount == 0) { // switch to next adapter hEth = hEth->pNext; if(hEth==0) hEth = omethInternal.pFirstEth; // take first instance if this was the last omethInternal.pPeriodicEth = hEth; // save for next periodic call // start read command ...
functions
pending if(hEth->txVal) { pMII->data = hEth->txVal; pMII->cmd.req = hEth->phyCmdWrite[hEth->txPort] | (hEth->txReg << 2); hEth->txVal = 0; if(hEth->txReg==4) // reset phy after writing register 4 (write autoneg-restart to register 0) { hEth->txVal = PH...
functions
duplex if(x==PHY_REG1F_OP_10FULL || x==PHY_REG1F_OP_100FULL) { // (do not switch phys to half duplex if mac_type 2 is selected) if(((hEth->phyLinkActive > 1) || (hEth->phyHalfMax > 0) || ((hEth->config.mode & OMETH_MODE_FULLDUPLEX) == 0))) { ...
functions
processed if(hEth->phyPort >= hEth->phyCount) { hEth->phyLinkActive = hEth->phyLinkCount; // store total number of linked ports if(hEth->phyHalfCount > hEth->phyHalfMax) hEth->phyHalfMax = hEth->phyHalfCount; // change back to 100 MBit (and setup MAC) (not for MACs ...
functions
else if(hEth->config.pktLoc == OMETH_PKT_LOC_HEAP) { //pool has to be allocated in heap, since RX packets are stored there pBuf = (ometh_buf_typ*)OMETH_MAKE_NONCACHABLE(calloc(len * maxPending, 1)); }
functions
pointers for(i=0; i<maxPending ; i++) { pQueue->pBuf = pBuf; pQueue->pNext = pQueue+1; pQueue++; pBuf = (ometh_buf_typ*)((size_t)pBuf + len); // next buffer }
functions
int omethHookSetFunction ( OMETH_HOOK_H hHook, /* handle of existing hook */ OMETH_HOOK_FCT *pFct /* new callback function */ ) { if(hHook==0) return -1; if(pFct == OMETH_HOOK_DISABLED) pFct=0; hHook->pFct = pFct; return 0; }
functions
OMETH_FILTER_H omethFilterCreate ( OMETH_HOOK_H hHook, /* handle of a ethernet client */ void *arg, /* argument for hook function */ void *pMask, /* ptr to array with 17 mask bytes */ void *pValue ...
functions
OMETH_FILTER_H omethFilterCreateX ( OMETH_HOOK_H hHook, /* handle of a ethernet client */ void *arg, /* argument for hook function */ void *pMask, /* ptr to array with 17 mask bytes */ void *pValue ...
functions
int omethFilterSetPattern ( OMETH_FILTER_H hFilter, void *pMask, /* ptr to array with 17 mask bytes */ void *pValue /* ptr to array with 17 compare values */ ) { ometh_filter_data_typ *pFilterData; ometh_filter_entry_typ *p...
functions
void omethFilterSetByteMask ( OMETH_FILTER_H hFilter, /* filter handle */ unsigned short offset, /* offset in the filterarray */ unsigned char mask /* mask to set */ ) { hFilter->...
functions
int omethFilterSetArgument ( OMETH_FILTER_H hFilter, void *arg ) { if(hFilter==0) return -1; // verify filter hFilter->arg = arg; // overtake new argument return 0; }
functions
int omethFilterSetNoMatchIRQ ( OMETH_FILTER_H hFilter, /* filter handle */ int irqEnable /* TRUE: IRQ will be triggerd if frame does not match this filter */ ) { if (irqEnable) { // set RxMissFlag FILTER_SET_FLAG(hFilter->pF...
functions
void omethFilterSetHubPort ( OMETH_FILTER_H hFilter, /* filter handle */ int port /* -1 .. react to all ports, 0-x reac only to port x */ ) { ometh_filter_data_typ *pFilterData = hFilter->pFilterData; // switch hub selection...
functions
void omethFilterEnable ( OMETH_FILTER_H hFilter ) { // turn filter entry on FILTER_SET_FLAG(hFilter->pFilterData, CMD_FILTER_ON); }
functions
disabled if(hFilter == OMETH_INVALID_FILTER || hEth != hFilter->pFilterData->hEth ) { hEth->pFilterSCNM = 0; hEth->txQueueEnable = 0; // queue sending is disabled return -2; }
functions
available if(pInfo == pInfo->pNext) { assert(0); return 0; }
functions
last while(1) { pNew = pInfo->pNext; if(pNew->flags1 & FLAGS1_LAST) break; // last found pInfo = pNew; }
functions
int omethResponseInitBuf ( OMETH_FILTER_H hFilter, /* filter handle */ ometh_packet_typ *pPacket1, /* spare packet for change buffer */ ometh_packet_typ *pPacket2 /* spare packet for change buffer */ ) { OMETH_H ...
functions
hook if(hEth->pRegBase->txStatus.value & OMETH_REG_RUN) { assert(0); return -1; // new setup in run mode not allowed }
functions
int omethResponseInit ( OMETH_FILTER_H hFilter /* filter handle */ ) { return omethResponseInitBuf(hFilter,0,0); }
functions
done if(hFilter->pFilterData->txEnableRequest) { hFilter->pFilterData->txEnableRequest = 0; FILTER_SET_FLAG(hFilter->pFilterData, CMD_TX_ENABLE); }
functions
int omethResponseLink ( OMETH_FILTER_H hFilterDst, /* handle new filter which should get a response buffer */ OMETH_FILTER_H hFilterSrc /* response buffer from this filter is used */ ) { if(hFilterSrc==0) return -1; // hFilter invalid if(h...
functions
int omethResponseTime ( OMETH_FILTER_H hFilter, /* set time value for auto response */ unsigned long ticks /* delay ticks added to IPG */ ) { ometh_tx_info_typ *pTxInfo; if(hFilter==0) return -1; // hFilter invalid pTxInfo = hFilter-...
functions
int omethResponseDisable ( OMETH_FILTER_H hFilter /* filter handle */ ) { if(hFilter==0) return -1; // hFilter invalid // clear enable flag for omethResponseSet function hFilter->pFilterData->txEnableRequest = 0; FILTER_CLEAR_FLAG(hFilter->pFilterDat...
functions
int omethResponseEnable ( OMETH_FILTER_H hFilter /* filter handle */ ) { ometh_desc_typ *pDesc; // hFilter invalid if(hFilter==0 || hFilter->pTxInfo==0) return -1; // get tx descriptor pointer and validate pDesc = hFilter->pTxInfo->pDesc; ...
functions
long omethResponseCount ( OMETH_FILTER_H hFilter /* filter handle */ ) { if(hFilter==0 || hFilter->pTxInfo==0) return 0; return hFilter->pTxInfo->autoTxCount; }
functions
void omethResponseCountReset ( OMETH_FILTER_H hFilter /* filter handle */ ) { if(hFilter==0 || hFilter->pTxInfo==0) return; hFilter->pTxInfo->autoTxCount = 0; }
functions
void freePtr(void *p) { if(p) free(p); }
functions
else if (hFind) { while(hFind->pNext) { if(hFind->pNext == hEth) { // driver instance found ... take instance out of the internal instance list hFind->pNext = hEth->pNext; break; }
functions
else if(hEth->config.pktLoc == OMETH_PKT_LOC_HEAP) { //frame buffer pool is in heap, so free it... freePtr(hHook->pRxBufBase); // free frame buffers allocated from the hooks }
functions
image if(hEth->config.pktLoc == OMETH_PKT_LOC_HEAP) { freePtr(hEth->pRxBufBase); // free allocated rx-buffers }
functions
void omethRxIrqHandlerMux ( void ) { OMETH_H hEth = omethInternal.pFirstEth; // call irq handler for all ethernet adapters while(hEth) { omethRxIrqHandler(hEth); hEth=hEth->pNext; }
functions
void omethTxIrqHandlerMux ( void ) { OMETH_H hEth = omethInternal.pFirstEth; // call irq handler for all ethernet adapters while(hEth) { omethTxIrqHandler(hEth); hEth=hEth->pNext; }
functions
void omethRxTxIrqHandlerMux ( void ) { OMETH_H hEth = omethInternal.pFirstEth; OMETH_H hEthProcess=0; ometh_reg_typ *pRegBase; unsigned short pending=0 , maxPending=0; // search for the irq source with the highest pending counter while(hEth) { ...
includes
#include <config.h>
includes
#include <meta/errors.h>
includes
#include <meta/prefs.h>
includes
#include <meta/util.h>
includes
#include <X11/keysym.h>
includes
#include <string.h>
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <X11/XKBlib.h>
defines
#define _GNU_SOURCE
defines
#define _SVID_SOURCE /* for putenv() */
defines
#define SCHEMA_MUFFIN_KEYBINDINGS "org.cinnamon.desktop.keybindings.wm"
defines
#define SCHEMA_MUFFIN "org.cinnamon.muffin"
defines
#define HANDLER(name) g_hash_table_lookup (key_handlers, (name))
defines
#define SMALL_INCREMENT 1
defines
#define NORMAL_INCREMENT 10
defines
#define SMALL_INCREMENT 1
defines
#define NORMAL_INCREMENT 10
defines
#define REVERSES_AND_REVERSED (META_KEY_BINDING_REVERSES | \
functions
void meta_key_binding_free (MetaKeyBinding *binding) { g_slice_free (MetaKeyBinding, binding); }
functions
GType meta_key_binding_get_type (void) { static GType type_id = 0; if (G_UNLIKELY (type_id == 0)) type_id = g_boxed_type_register_static (g_intern_static_string ("MetaKeyBinding"), (GBoxedCopyFunc)meta_key_binding_copy, (GB...
functions
MetaVirtualModifier meta_key_binding_get_modifiers (MetaKeyBinding *binding) { return binding->modifiers; }
functions
guint meta_key_binding_get_mask (MetaKeyBinding *binding) { return binding->mask; }
functions
void key_handler_free (MetaKeyHandler *handler) { g_free (handler->name); if (handler->user_data_free_func && handler->user_data) handler->user_data_free_func (handler->user_data); g_free (handler); }
functions
void reload_keymap (MetaDisplay *display) { if (display->keymap) meta_XFree (display->keymap); /* This is expensive to compute, so we'll lazily load if and when we first * need it */ display->above_tab_keycode = 0; display->keymap = XGetKeyboardMapping (display->xdisplay, ...
functions
void reload_modmap (MetaDisplay *display) { XModifierKeymap *modmap; int map_size; int i; if (display->modmap) XFreeModifiermap (display->modmap); modmap = XGetModifierMapping (display->xdisplay); display->modmap = modmap; display->ignored_modifier_mask = 0; /* Multiple bits may get set in eac...
functions
else if (syms[j] == XK_Scroll_Lock) { display->scroll_lock_mask |= (1 << ( i / modmap->max_keypermod)); }
functions
else if (syms[j] == XK_Super_L || syms[j] == XK_Super_R) { display->super_mask |= (1 << ( i / modmap->max_keypermod)); }
functions
else if (syms[j] == XK_Hyper_L || syms[j] == XK_Hyper_R) { display->hyper_mask |= (1 << ( i / modmap->max_keypermod)); }
functions
else if (syms[j] == XK_Meta_L || syms[j] == XK_Meta_R) { display->meta_mask |= (1 << ( i / modmap->max_keypermod)); }
functions
guint keysym_to_keycode (MetaDisplay *display, guint keysym) { if (keysym == META_KEY_ABOVE_TAB) return meta_display_get_above_tab_keycode (display); else return XKeysymToKeycode (display->xdisplay, keysym); }
functions
void reload_keycodes (MetaDisplay *display) { meta_topic (META_DEBUG_KEYBINDINGS, "Reloading keycodes for binding tables\n"); if (display->key_bindings) { int i; i = 0; while (i < display->n_key_bindings) { if (display->key_bindings[i].keysym != 0) ...
functions
void reload_modifiers (MetaDisplay *display) { meta_topic (META_DEBUG_KEYBINDINGS, "Reloading keycodes for binding tables\n"); if (display->key_bindings) { int i; i = 0; while (i < display->n_key_bindings) { meta_display_devirtualize_modifiers (display...
functions
int count_bindings (GList *prefs) { GList *p; int count; count = 0; p = prefs; while (p) { MetaKeyPref *pref = (MetaKeyPref*)p->data; GSList *tmp = pref->bindings; while (tmp) { MetaKeyCombo *combo = tmp->data; if (combo && (combo->keysym != None || combo->...
functions
void rebuild_binding_table (MetaDisplay *display, MetaKeyBinding **bindings_p, int *n_bindings_p, GList *prefs) { GList *p; int n_bindings; int i; n_bindings = count_bindings (prefs); g_free (*bindings_p); *bin...
functions
void rebuild_key_binding_table (MetaDisplay *display) { GList *prefs; meta_topic (META_DEBUG_KEYBINDINGS, "Rebuilding key binding table from preferences\n"); prefs = meta_prefs_get_keybindings (); rebuild_binding_table (display, &display->key_bindings, ...
functions
void regrab_key_bindings (MetaDisplay *display) { GSList *tmp; GSList *windows; meta_error_trap_push (display); /* for efficiency push outer trap */ tmp = display->screens; while (tmp != NULL) { MetaScreen *screen = tmp->data; meta_screen_ungrab_keys (screen); meta_screen_grab_keys ...
functions
gboolean add_keybinding_internal (MetaDisplay *display, const char *name, const char *schema, MetaKeyBindingFlags flags, MetaKeyBindingAction action, MetaKeyHandle...
functions
gboolean add_builtin_keybinding (MetaDisplay *display, const char *name, const char *schema, MetaKeyBindingFlags flags, MetaKeyBindingAction action, MetaKeyHandlerFunc ...
functions
gboolean meta_display_add_keybinding (MetaDisplay *display, const char *name, const char *schema, MetaKeyBindingFlags flags, MetaKeyHandlerFunc handler, ...
functions
gboolean meta_display_remove_keybinding (MetaDisplay *display, const char *name) { if (!meta_prefs_remove_keybinding (name)) return FALSE; g_hash_table_remove (key_handlers, name); return TRUE; }
functions
gboolean add_custom_keybinding_internal (MetaDisplay *display, const char *name, const char **bindings, MetaKeyBindingFlags flags, MetaKeyBindingAction action, ...
functions
gboolean meta_display_add_custom_keybinding (MetaDisplay *display, const char *name, const char **bindings, MetaKeyHandlerFunc callback, gpointer u...
functions
gboolean meta_display_remove_custom_keybinding (MetaDisplay *display, const char *name) { if (!meta_prefs_remove_custom_keybinding (name)) return FALSE; g_hash_table_remove (key_handlers, name); return TRUE; }
functions
MetaKeyBindingAction meta_display_get_keybinding_action (MetaDisplay *display, unsigned int keycode, unsigned long mask) { MetaKeyBinding *binding; KeySym keysym; keysym = XkbKeycodeToKeysym (display->xdisplay, keycode, 0, 0); mask = mas...
functions
void meta_display_keybinding_action_invoke_by_code (MetaDisplay *display, unsigned int keycode, unsigned long mask) { MetaKeyBinding *binding; KeySym keysym; keysym = XkbKeycodeToKeysym (display->xdisplay, keycode, 0,...
functions
void meta_display_process_mapping_event (MetaDisplay *display, XEvent *event) { gboolean keymap_changed = FALSE; gboolean modmap_changed = FALSE; #ifdef HAVE_XKB if (event->type == display->xkb_base_event_type) { meta_topic (META_DEBUG_KEYBINDINGS, ...
functions
endif if (event->xmapping.request == MappingModifier) { meta_topic (META_DEBUG_KEYBINDINGS, "Received MappingModifier event, will reload modmap and redo keybindings\n"); modmap_changed = TRUE; }
functions
else if (event->xmapping.request == MappingKeyboard) { meta_topic (META_DEBUG_KEYBINDINGS, "Received MappingKeyboard event, will reload keycodes and redo keybindings\n"); keymap_changed = TRUE; }
functions
void bindings_changed_callback (MetaPreference pref, void *data) { MetaDisplay *display; display = data; switch (pref) { case META_PREF_KEYBINDINGS: rebuild_key_binding_table (display); reload_keycodes (display); reload_modifiers (display); r...