The Middle East might seem inhospitable territory for a zone free of weapons of mass destruction. But as long ago as 1974, the United Nations endorsed establishing a nuclear-weapon-free zone in the region, and progress toward that goal has been slow but not entirely imperceptible in the years since. Beginning after the 2010 Review Conference for the Nuclear Non-Proliferation Treaty, a vigorous diplomatic effort sought to transform a regional WMD-free zone from a far-fetched dream into—if not an immediate reality—a genuine possibility, supported by a durable process demonstrating tangible progress. But last year, after attempts to organize a conference on the zone ended in failure, progress seemed far from tangible. Below, Mansour Salsabili of Iran, Ehud Eiran of Israel, Martin Malin of the United States, and Ayman Khalil of Jordan debate how the process can be revived—and what failure to revive it would mean, both for the Middle East and for the nonproliferation regime.
In the fall of 2011, everything seemed to be in place to convene a 2012 conference on establishing a WMD-free zone in the Middle East. The meeting was to be sponsored by the United Nations as well as by the United States, Russia, and the United Kingdom. Finland had emerged as host country for the conference, which was envisioned for December 2012. UN Secretary-General Ban Ki-Moon named Finnish Ambassador Jaakko Laajava as facilitator of the process. The long delay in naming a facilitator was due to an extensive consultation process — but perhaps also to political transformations in many Middle Eastern countries. In any event, with Laajava's appointment the path toward a conference seemed relatively clear. But in the months that followed, no meeting agenda was announced. The precise date of the conference was not set.
A strong indication that the conference might not occur in 2012 emerged in September of last year when the head of Israel's Atomic Energy Commission made clear in a statement to the International Atomic Energy Agency (IAEA) that Israel would not attend. Israel is the only nuclear-armed country in the region, and the only Middle Eastern nation that has not joined the Nuclear Non-Proliferation Treaty (NPT); without Israel's participation, the relevance of the conference would obviously be diminished. But official notice that the conference would not occur only came in December, with a statement from the US State Department. The statement was very puzzling, not making it entirely clear whether the conference was to be postponed or simply cancelled. And because the statement spoke of a "deep conceptual gap persisting in the region," wording that bore similarities to earlier statements by Israeli officials, some analysts concluded that the meeting had been cancelled in order to preserve Israeli interests.
The unilateral nature of the statement also seemed to reveal that little coordination existed among the conference's sponsors — an impression intensified when other sponsors subsequently issued contradictory statements (Russia, for example, said that the December conference should not have been postponed without the parties' having agreed to a new date). An alarming lack of coordination between the sponsors and the facilitator was also revealed. Laajava's office issued a single statement after the meeting was suspended and otherwise maintained a deathly silence, giving little indication that the facilitator's mission was ongoing.
Still, the process toward establishing a WMD-free zone has not entirely collapsed. Indeed, the term "process" is used because the idea behind the planned conference was to create an ongoing initiative to establish a zone in the Middle East free from all WMD. A single meeting was never the point.
The facilitator's mandate runs in principle until 2015, when he is expected to submit his final conclusions to the NPT Review Conference. And according to a statement that Ambassador Laajava made in April at the preparatory committee meeting for the 2015 Review Conference, he is still committed to pursuing quiet, shuttle diplomacy. Still, Laajava has conducted more than 300 discussions with regional and international parties regarding the WMD-free zone, and all those consultations have not yet produced any tangible results.
The failure to organize the Helsinki conference represents a serious setback for nonproliferation efforts in the region — partly because, amid the Arab Spring, decision makers are under pressure to demonstrate to their citizens that Arab diplomacy will be passive no longer. Egypt walked out of the 2013 preparatory committee meeting for the 2015 Review Conference, and other states may take similar steps in the future. Already there is talk in the Arab world about reconsidering the indefinite extension of the NPT.
What can be done. Ambassador Laajava, of course, is not solely responsible for the failure of the conference. That is the combined responsibility of the facilitator, the conveners, states in the region, and multilateral bodies.
A few months ago, the Arab Institute for Security Studies was involved in producing a study that highlighted the role that civil society and multilateral organizations might play in the Helsinki process. The IAEA, the Organisation for the Prohibition of Chemical Weapons, and other multilateral entities could all play important roles. Nongovernmental organizations might be able to shape public opinion and influence governments — notably Israel's government. Indeed, if the deadlock is to be resolved, Israel must commit itself to the process. But for that to happen, decision makers in Tel Aviv must come to understand that possessing nuclear weapons is not the way to ensure their country's survival.
In November of last year, when efforts to organize a Middle East WMD-Free Zone Conference collapsed, the US State Department chalked up the failure to "present conditions in the Middle East and the fact that states in the region have not reached agreement on acceptable conditions for a conference." That assessment was frustratingly general but remains basically accurate. Since the statement was issued, conditions in the region have not become more conducive for discussions of a zone free of weapons of mass destruction: The United Nations has launched an investigation into alleged chemical weapons use in an imploding Syria, the Iranian nuclear standoff persists, revolution and political unrest continue to unsettle the region, and dashed Arab-Israeli peace initiatives remain bitter memories.
After more than 300 rounds of discussion with relevant parties inside and outside the region, Jaakko Laajava, the UN-appointed diplomat charged with facilitating the Middle East conference, has so far failed to arrange even a preliminary multilateral consultation to discuss modalities. Arab states are only willing to participate in a preliminary meeting with states that are on board to attend a WMD-Free Zone Conference—and Israel is reserving judgment about participating in the proposed conference until an agenda and procedures are agreed upon.
Unfortunately, the stalemate concerns much more than conference modalities. Israel views arms control as a process that can only begin after political relationships in the region improve; in its view, arms negotiations won't bring about better relations. As a country that bases its security in part on its regional nuclear monopoly, Israel places discussions of nuclear disarmament at the very bottom of its agenda. Nonproliferation and regional security are its chief concerns. Further, as a non-signatory of the Nuclear Non-Proliferation Treaty (NPT), Israel does not feel bound by mandates issuing from the treaty's review conferences and is wary of engaging in a process that is linked to the NPT. Leading Arab states, as well as Iran, take precisely the opposite view, arguing that Israel's nuclear disarmament and its accession to the treaty should be first steps on the path toward regional peace and security.
Consequences of failure. The failure to convene a conference in 2012 provoked deep frustration in the region, particularly among Arab League states. In these countries, diplomats are quick to recall that the indefinite extension of the NPT in 1995 hinged on an agreement to work toward the establishment of a WMD-free zone in the Middle East.
Failure to convene a conference will also register beyond NPT meetings. It will strengthen the position of nonproliferation obstructionists, who will point to the persistence of double standards surrounding the regime and of discrimination within it. It will deepen the rift between nuclear weapon states and non-nuclear weapon states. It will weaken efforts by the United States and like-minded nations to promote new nonproliferation initiatives. And the Obama administration will have a harder time mobilizing the resources and authority needed to strengthen the safeguards administered by the International Atomic Energy Agency and toughen consequences for those who violate their safeguards commitments—elements of the agenda that the president outlined in Prague four years ago.
But if efforts to convene a conference come to nothing, perhaps the most significant consequence will be the opportunities foregone. Holding a Middle East conference on WMD is far more than symbolic. No region-wide institutions exist in the Middle East today. A cooperative process for discussing regional security is important not because of what it might produce this year or next, but because of the foundation it might provide for regional problem-solving in years to come.
Reviving the process. It is not too late to get the process back on track. Despite their differences, all the region's states in principle favor the creation of a WMD-free zone. No party has unequivocally ruled out the possibility that a valuable arms control process might still be initiated. All relevant states have engaged in cooperative discussions with Ambassador Laajava.
The conference cosponsors—the United States, Russia, and Great Britain—must offer greater support to Laajava by pushing the parties in the region to hold face-to-face consultations on an agenda and procedures for a conference. The United States in particular must more energetically encourage Israel to commit to participating in a conference in 2013.
The cosponsors must also press the Arab states and Iran to agree to follow-on discussions, convened under a regional umbrella not directly tied to the NPT, covering a broad range of regional security issues. A regional security forum could serve as a coordinating body for ongoing discussions of WMD issues; an umbrella group for discussions of regional security cooperation; a host for information exchanges, technical meetings, and other transparency measures; and a site for the negotiation of confidence-building measures.
Even if all these steps were implemented, prospects for success in establishing a WMD-free zone would remain highly uncertain. But the stakes are too high to allow the effort to fail. Creativity, courage, flexibility, and goodwill—all of which are abundant among the people of the Middle East—are especially needed now for policy making on this issue.
Nearly 40 years ago, the UN General Assembly first adopted a resolution endorsing the establishment of a nuclear-weapon-free zone in the Middle East. At the 2010 Review Conference for the Nuclear Non-Proliferation Treaty (NPT), specific measures to advance this vision were agreed upon. In the years after the 2010 conference, more than at any other time over the course of four decades, international players took concrete steps toward implementing the vision of a WMD-free zone.
In 2011, the UN secretary-general and the NPT's depository states appointed Jaakko Laajava, Finland's able undersecretary of state, as facilitator of the process. Laajava's team met with all key players and developed an in-depth understanding of the issues. All relevant international actors, including the United States, offered their support. Despite these efforts, plans to move the initiative forward with a Middle East WMD-Free Zone Conference, envisioned for Helsinki in 2012, failed.
For those who subscribe to a realist view of international relations, the explanation is clear: Holding a conference was not aligned with the interests of significant players, namely Israel and Iran. Israel enjoys nuclear superiority in the Middle East, though it has never formally admitted its capabilities, and Iran is getting closer to developing a nuclear device. Both of these countries obscure details of their nuclear programs. Both countries, it seems, share a pessimistic view about international norms' ability to safeguard security. Israel has never joined the NPT; Iran is a treaty signatory but many argue that it is in violation of its treaty commitments.
But if the initiative to establish a WMD-free zone were reorganized in three fundamental ways, it might find greater acceptance. First, the project to this point has followed a liberal vision of trying to introduce a global norm into the region; a realist and interest-based approach might be more appropriate. Open conversations about the parties' realist motives, though they could be acrimonious, could also prove constructive. As Israel's peace accords with Egypt and Jordan demonstrate, stable agreements between former foes can result from concrete discussions about security concerns.
Second, the top-down structure of the project—it was initiated by an international body rather than by actors on the ground—could be replaced with a bottom-up structure. This could allow parties, through regional dialogue, to identify and address current, specific concerns. A major hurdle to such an approach is the lack of a regional agency that could facilitate the conversation, but perhaps the International Atomic Energy Agency (IAEA) could encourage the parties to create a regional forum modeled on the working group for arms control and regional security that was active in the 1990s.
Third, the initiative toward a WMD-free zone should be tailored to the current security environment. That is, the state-versus-state outlook that usually underlies arms control negotiations should be expanded to address conflicts involving governments and their own citizens (as in Syria) or governments versus non-state actors (as in the Israel-Hezbollah conflict).
I understand that this approach might meet resistance, notably from some Arab states that, I suspect, would prefer that the WMD-free zone project remain primarily focused on the nuclear issue. This resistance could be addressed by ensuring that the long-term goal of establishing a WMD-free zone remains in place—after all, Israel supports it too—while also giving increased prominence to immediate security concerns. This might mean setting a less ambitious but more attainable initial goal. One such goal might be to address fears about the spread of chemical weapons in the region, their use against civilians in internal conflicts, and their transfer to non-state actors. It would be better to succeed with these immediate concerns than try and fail to build a brave new region.
No disaster. The seeming failure of the WMD-free zone initiative carries negative but not disastrous consequences for the nonproliferation regime. Some Arab parties might be motivated to punish the broader NPT framework for the failure, as has already been seen in a threat made by Arab League members (with Egypt leading) not to participate in the recently concluded preparatory committee meeting for the 2015 NPT Review Conference, and in Egypt's ultimate withdrawal from the conference at the halfway point. Similarly, Arab parties might advance a resolution critical of Israel at the IAEA general conference set for this fall. But the region has in the past witnessed challenges to the nonproliferation regime from Iran, Iraq, and Syria, and failure to establish a new arms control regime will not wreak more havoc than has noncompliance with an existing regime.
Moreover, while the WMD-free zone has attracted interest among the small community of officials and scholars who focus on arms control, it has made no significant mark on the region's broader policy community or media. For example, the issue was not mentioned once during a Tel Aviv conference in April hosted by the Institute for National Security Studies—and this annual conference is Israel's most significant public gathering on security matters. Considering the initiative's light footprint, its failure might not hinder future efforts to establish a WMD-free zone.
The failure's effect on global arms control might be similar. The indefinite postponement of the Helsinki conference does not help, and may hinder, new nonproliferation and disarmament efforts such as the Global Zero campaign. But these efforts have not in any case ushered in a new era in nonproliferation and disarmament affairs. The failure of the initiative should be seen within the context of slower-than-expected progress in global nonproliferation and disarmament.
The cancellation of the 2012 Middle East WMD-Free Zone Conference is not the end of the world. But it could have poisonous effects on policy at the national, regional, and international levels.
Failure to organize the conference is a blow to the integrity of international agreements — above all, to the consensus decision made at the 2010 Review Conference for the Nuclear Non-Proliferation Treaty (NPT) that concrete steps should be taken toward establishing a zone free of weapons of mass destruction in the Middle East. With the failure to follow through on that decision, prospects are darkened for the 2015 NPT Review Conference. Additional delays would jeopardize the entire process of denuclearizing the Middle East, deprive the region of its only specifically designed and internationally supported mechanism for consolidating security through disarmament, and cause regional polarization to grow yet more intense.
Long, slow. In the history of nuclear arms control since 1946, when the United Nations devoted its very first resolution to nuclear issues, two main approaches have dominated: nonproliferation and disarmament. The nonproliferation approach tends to be favored by nuclear weapon states; they wish to prevent additional countries from joining their club. The disarmament approach is usually favored by non-nuclear weapon states. They want to ensure that the distinction between those with and without nuclear weapons does not become permanent.
The difference between the two approaches is plainly visible when one compares the NPT regime to processes for establishing nuclear-weapon-free zones. The NPT, though it is also meant to promote general disarmament and facilitate the spread of peaceful nuclear energy, mainly functions as a nonproliferation mechanism whose most enthusiastic supporters are nuclear weapon states. Nuclear-weapon-free zones, on the other hand, tend to receive their greatest support from developing nations. The 1974 UN General Assembly resolution in favor of establishing a Middle Eastern nuclear-weapon-free zone, for instance, was based on an Iranian proposal.
When the General Assembly passed its resolution, establishing a nuclear-weapon-free zone seemed a timely and perhaps promising project. Just a few years before, in 1969, the Treaty of Tlatelolco had come into force, establishing a zone free of nuclear weapons in Latin America and providing a durable model for similar zones elsewhere. And only a few months before the resolution was adopted, India had conducted its first nuclear test, raising awareness of the risks of proliferation in volatile regions.
But little progress was made toward banning nuclear weapons in the Middle East until the 1995 NPT Review Conference, which produced a resolution encouraging states in the region to take practical steps toward establishing a zone free of WMD. Still later, at the 2010 Review Conference, hopes were raised again when participants agreed on specific measures that might facilitate the creation of a WMD-free zone — including the initiative to organize the 2012 conference. But that initiative has run aground, and all past achievements are called into question.
Still alive? The process still might be revived if a few key steps were taken. The first involves the structure of the initiative itself. Efforts to establish a zone free of WMD in the Middle East are subsidiary to the NPT review conference and are technically under its supervision. This requires that negotiations be conducted only in the framework of the review conferences. But it might be possible to move the process forward if other elements of the UN's disarmament machinery were brought into play. For example, the Disarmament Commission could deliberate on the WMD-free zone under its current agenda and conduct a deep examination of the topic, as it did with nuclear weapon-free zones in 1999. The First Committee of the General Assembly, which also focuses on disarmament and related issues, could do likewise. These steps could increase international awareness of the issue and, in the limited time that remains before the 2015 NPT Review Conference, create political momentum.
Second, in order to moderate the excessive emphasis on nonproliferation that often characterizes the NPT regime, greater emphasis could be placed on Article VII of the treaty — which stipulates that groups of states retain the right to conclude regional treaties assuring the absence of nuclear weapons in their territories. If high-level meetings were organized that used Article VII as an explicit backdrop, regional players might gain breathing space and common denominators might be discovered. In any event, it is necessary at all times to maintain balance among disarmament, nonproliferation, and cooperation in the peaceful uses of nuclear technology.
Third, civil society organizations, and particularly disarmament-related nongovernmental organizations, could make an important contribution to the process. A majority of the NPT's member states are represented in negotiations such as those over the WMD-free zone by diplomats who circulate from posting to posting, and who may have limited knowledge about the history of the negotiations in which they are involved. Diplomats are constantly at risk of devoting time to issues that their predecessors have already covered exhaustively. So civil society organizations could play a simple but critical role by acting as a sort of organizational memory.
But a more fundamental issue needs to be kept in mind as well — that Israel's position among Middle Eastern states is unique insofar as it has not acceded to the NPT. This simple fact goes to the very core of the initiative to establish a WMD-free zone, and if security is to be promoted for all, Israel's status as the only treaty outlier in the region must be resolved. But this project must be approached in a spirit of patience and collaboration.
No clear consensus has emerged in this Roundtable on a very basic point: whether the effort to establish a zone without weapons of mass destruction in the Middle East has collapsed—or has merely been suspended. I would be interested in hearing my colleagues' views on this question. I, for one, would argue that the Helsinki process is gradually slipping into a coma, as evidenced by lack of consensus among the conference conveners and failure by the Finnish facilitator and his team to achieve any tangible progress.
As to how the process might be revived, my colleagues have proposed a number of measures, and many of them seem sound. Here I would like to add three ideas specifically to build confidence and increase transparency in the region.
First, nations in the Middle East could establish a regional cooperation scheme that would enable multilateral inspections of the region's nuclear facilities. Second, countries could engage in cooperative monitoring activities, including exchanges of data and of environmental samples from the peripheries of nuclear facilities. Third, a collaborative regional network could be established for detecting airborne radionuclides. These steps alone would not create the conditions necessary for establishing a WMD-free zone in the Middle East—but they could make a valuable contribution by enhancing trust in the region.
In everyone's interest. Ehud Eiran in his Round One essay wrote that, from a realist point of view, efforts to hold the Helsinki conference in 2012 failed because "holding a conference was not aligned with the interests of … Israel and Iran." But if that were the case, Iran would not have committed to participating in the Helsinki conference, as it did on November 6 of last year. That point aside, I differ with Eiran insofar as I believe that the Helsinki initiative is aligned with the interests of every state in the region, including Israel, and that it offers every state the best opportunity to preserve its interests for future generations. The initiative provides an ideal framework for resolving the stand-off over Iran's nuclear program, and many believe that Israel's participation in the zone could open avenues toward finally resolving the Arab-Israeli conflict. Ultimately, establishing a WMD-free zone is the only way to achieve stability in the Middle East on the basis of equity, not military superiority.
Eiran also wrote in Round One that the seeming failure of the WMD-free zone initiative carries negative but not disastrous consequences for the nonproliferation regime. I believe that Eiran underestimates the consequences: Success or failure of the review conferences for the Nuclear Non-Proliferation Treaty (NPT) is strongly tied to conditions in the Middle East. In fact, many judged the 2010 Review Conference successful because it produced a consensus that concrete steps should be taken toward eliminating WMD from the region. Prospects for the next conference do not appear very bright.
Egypt's delegation walked out of the recently concluded preparatory committee meeting for the 2015 NPT Review Conference, something that is likely to happen on a larger scale at next year's preparatory committee meeting. And protest against the lack of progress in the Helsinki initiative may soon intensify along two dimensions—vertically, in the sense that countries objecting to lack of progress may make greater demands in return for their participation in NPT processes, and horizontally, in the sense that countries not just from the Middle East but from further afield in the Non-Aligned Movement may join in. The consequences of that would be disastrous indeed.
Amid the Arab Spring, new leadership is emerging in the Middle East and many countries are struggling with internal political rivalries. But once these issues are settled, a diplomatic confrontation with Israel cannot be ruled out. It is time for Israel to take a new attitude toward a number of issues, not least the WMD-free zone. If Israel fails to comprehend new realities in the region, its isolation will only increase.
My colleagues and I agree on two fundamental points: that it is desirable to initiate a process toward banning weapons of mass destruction from the Middle East and that such a process will be long and difficult. Ehud Eiran looks at the situation through a realist lens but concedes that "joint mechanisms can help achieve security." Both Ayman Khalil and Mansour Salsabili strongly support the establishment of a WMD-free zone, but Khalil recognizes that the process must be an "ongoing initiative" and Salsabili notes that a lot of "patience and collaboration" will be required. These are constructive positions; unfortunately, official positions have not been so constructive, and the key question remains how to create conditions for initiating a serious process.
The challenges are formidable. Establishing a zone free of WMD is not the most urgent security matter facing the Middle East. Syria's civil war is more pressing, and so is the continuing stalemate over Iran's nuclear program. And though weapons of mass destruction are not unrelated to either the Syrian conflict or the Iranian stand-off, the WMD-free-zone proposal is not likely to be a meaningful vehicle for resolving either situation in the short run.
Nevertheless, initiating a process for discussing WMD remains feasible. But more than dates and modalities for a meeting in Helsinki are needed—fundamental reassessments are required as well. First, all parties must recognize that progress toward a WMD-free zone will require policy changes in areas only indirectly related to nuclear, biological, and chemical weapons and their delivery systems. This is not to say that peace must precede any discussion of disarmament, or that progress toward a WMD-free zone must be formally linked to improvements in bilateral relationships involving Arab nations, Israel, and Iran. Establishing rigid conditions such as these would only prolong the current stalemate. But banning weapons of mass destruction from the region inevitably depends on a relaxation of tensions. Conversely, tensions can be relaxed through productive engagement on disarmament. It would be useful for all parties to acknowledge publicly that arms control and the normalization of diplomatic relations in the region are interdependent processes, and to begin removing obstacles on both fronts.
Second, Israel must begin to grapple in its national security strategy with certain long-term regional trends. These include increased political participation in Arab countries, the erosion of US influence in the Middle East, and the diffusion of enrichment and reprocessing technologies. Israel's traditional reliance on deterrence, preventive strikes, alignment with the United States, and a nuclear monopoly is becoming less tenable, and a sensible hedging strategy would be to engage intensively in regional diplomacy. The process toward establishing a zone free of WMD offers a significant opportunity for this. Israelis often describe arms control as a slippery slope that might lead to concerted pressure on the nation to disarm. But if Israel doubles down on its national security strategies as the regional status quo shifts, it would find itself on a more slippery slope by far.
Finally, the Arab League, Iran, and the sponsors of the WMD-free-zone process—if they truly wish to prioritize banning weapons of mass destruction—should support the establishment of a regionally-based security forum, with independent convening authority, to carry out direct multilateral discussions on regional security and disarmament. Such a regional umbrella need not interfere with the mandate of the review conference for the Nuclear Non-Proliferation Treaty. Instead, the forum would complement the work of the review conference and facilitate Israel's participation in arms control processes even though Israel is not a signatory to the treaty. And Israel, presented with the opportunity under such circumstances to enter into discussions on banning weapons of mass destruction, might decide that doing so is in its own best interest.
This debate about the initiative to establish a WMD-free zone in the Middle East is, it seems to me, characterized by two competing outlooks. According to one, weapons of mass destruction are a realm unto themselves, independent of broader regional security issues, and WMDs can be governed by norms and effective institutions. This approach is not something that I have espoused in this discussion, but it does represent a world in which I would prefer to live.
According to the other perspective, weapons of mass destruction are an extension of the region's broader political cleavages—cleavages that have an inescapable violent dimension. The development, deployment, and use of WMDs are driven by material interests and security concerns. Sadly, this is the world in which we live. Or at least it's the Middle East that actually exists.
Three countries in the region have now used chemical weapons against civilians or are strongly suspected of having done so—Iraq and Syria against their own people, and Egypt during the North Yemen Civil War. Another nation, Iran, is under heavy UN sanctions that relate to its nuclear programs. In each of these instances, international norms have failed to override national perceptions of security interests. This suggests that imported norms will not eradicate weapons of mass destruction from the Middle East. Rather, the incentive structure that governs state decisions must be altered. Israel in particular finds its security environment threatening, and this is why it has not chosen so far to join a norm-based security arrangement regarding WMD.
From the Israeli perspective, the WMD-free-zone initiative can seem to spring not from a genuine desire to create a better future for all concerned, but from something nearer the opposite: the desire to erect a set of constraints that will prevent Israel from defending itself. Very few parties in the region have condemned the Syrian regime for using chemical weapons against its own citizens, or condemned Iran for its calls that Israel be destroyed. Abolishing WMDs can seem merely a cover for a political agenda that threatens Israel.
But this is not to say that Israel rejects outright the idea of banning weapons of mass destruction from the region. Indeed, as Martin Malin has noted, Israel is open to discussing arms control, though the process "can only begin after political relationships in the region improve." Israel was always frank about its perspective toward organizing a 2012 conference on WMD, but made no wholesale effort to postpone it. For example, the head of Israel's atomic energy commission made a statement in September 2012 at the general conference of the International Atomic Energy Agency that was critical of the planned meeting. But I understand from an individual connected to the process that the next day a senior Israeli official communicated to process facilitator Jaakko Laajava that the speech should not be understood to mean that Israel would not attend the conference.
I am no blind believer—not in realism and not in Israel's current policies. And I concur to some extent with my colleague Mansour Salsabili's arguments that, in effect, no state is an island and that joint mechanisms can help achieve security. I even concur to some extent that security is tied to states' notions about their own identity. But I am simply not convinced that Israel's identity and its realist outlook are the sole reasons for the failure of regional arms control efforts. I would add that, before Iran's revolution, Israel demonstrated its trust in joint security efforts by maintaining close relations with Tehran. But this alliance collapsed when Tehran—not Jerusalem—underwent a radical change in political and ideological identity.
My colleague Ehud Eiran argued in his first essay that "the seeming failure of the WMD-free zone initiative carries negative but not disastrous consequences for the nonproliferation regime." I wrote in my own first essay that cancellation of the 2012 Middle East WMD-Free Zone Conference was not the end of the world — but I do believe that the seeming failure of the overall initiative carries disastrous consequences for the nonproliferation regime. A warning sign came on April 29 when Egypt's delegation walked out of a preparatory committee meeting for the 2015 Review Conference for the Nuclear Non-Proliferation Treaty. But that is only a small indication of the frustration that parties in the Middle East feel about the cancellation of the 2012 conference. The frustration is likely to become more obvious as nations coordinate their approaches to the 2015 Review Conference. In addition, countries in the Middle East are now increasingly likely to sign nuclear contracts with firms — Russian, French, South Korean, Canadian, or even Chinese — that may be less restrictive than US companies about the transfer of enrichment-related technologies.
Throughout his essay, Eiran explicated a realist point of view that I believe is ill suited to the establishment of lasting security in the Middle East and is too restrictive to address all aspects of a WMD-free zone. Israeli realists harbor strong feelings about the military dimensions of a multilateral disarmament pact, but no state can achieve its goals solely through pursuit of self-interest. If the Middle East is to transform itself from a region characterized by enmity to one characterized by friendly relations, states must be willing to work together through multilateral institutional channels. They must be willing to revise long-held notions of what their regional interests actually are. Ultimately, they must be willing to forge new identities — identities not based on opposition to other states. For now, the process toward establishing a WMD-free zone is the only regionally and internationally accepted vehicle that might lead toward such a transformation.
A realist might be expected to perceive a WMD-free zone, with its constraints on state action, as an annoyance. But the zone would be more than that. It would be the outcome of joint decision making, an expression of participants' common interests. States engaging in negotiations would come to share certain values and obligations with other nations. And realists might in any event find participation in the WMD-free zone process more rewarding than they expect: Through negotiations, they would have the chance to maximize state interests, or gain concessions from others in exchange for concessions made.
Dark, not hopeless. The whole point behind the 2012 conference was that it might help the Middle East adapt the global norm of disarmament to its own purposes. By supporting UN resolutions since 1980 in favor of establishing a nuclear-weapon-free zone in the region, Israel has also supported that norm. But by standing in the way of the 2012 conference, Israel now suggests that its highest priority is maintaining nuclear superiority.
That would seem to darken very seriously prospects for a WMD-free zone. But Jaakko Laajava, facilitator of the process, still has another card to play. If the United States, Israel's main ally and a sponsor of the conference process, cannot persuade Israel to participate in a conference, Laajava could extend his diplomacy to the public realm, and perhaps through public pressure induce Israel to participate. Then again, not every player must necessarily be included. As has been pointed out by Hans Blix, former director general of the International Atomic Energy Agency, Israel's absence from a conference would present significant drawbacks — but could also eliminate roadblocks.
Isaac Newton observed, in so many words, that for every action there is an equal and opposite reaction. What does this have to do with the proposed Middle Eastern zone free of weapons of mass destruction? Well, when efforts to resolve a complex problem like WMD result in deadlock, it is essential to search for innovative, nontraditional approaches to the issue. And perhaps it's the case that the laws of physics, which regulate people's interactions with their physical environment, can be applied usefully to people's interactions with one another.
In Round Two Ehud Eiran identified, and aligned himself with, a certain outlook on the WMD-free zone. According to this outlook, "weapons of mass destruction are an extension of the region's broader political cleavages—cleavages that have an inescapable violent dimension." Unfortunately, this way of looking at things makes the mistake of justifying the existence of WMD. But it also ignores Newton: The "violent dimension" to which Eiran refers is often merely a reaction to an original action, namely the set of grave injustices practiced upon Palestinians amid Israel's ongoing occupation of Palestinian territories. Indeed, the region's deteriorating security situation can in large measure be attributed to these injustices. As long as this Israeli "action" persists, reactions of various kinds and magnitudes can be expected to persist as well, even beyond the occupation's immediate geographical context. Israel's occupation of Palestinian territory is among the few remaining occupations in the world, and many view it as the primary source of tensions in the region.
Meanwhile, many Israelis consider nuclear weapons an effective insurance policy for their nation's security—but this insurance policy could bring about the annihilation of an entire region, including Israel itself. Those who believe that nuclear weapons deserve the credit for Israel's survival to this point are simply mistaken. Israel's nuclear arsenal has failed to prevent several military confrontations between Israel and its Arab neighbors: Egypt and its allies launched an attack in 1973; Saddam Hussein fired Scud missiles at Israeli targets during the Gulf War; and Hezbollah has fired Katyusha rockets into Israel, notably in 2006. In short, Israel's nuclear arsenal has failed as a deterrent.
In the long run, Israel cannot ensure its security through military might (though one can argue that Israel, with an advanced arsenal of conventional weapons, could maintain its military superiority for a long time even if it foreswore nuclear weapons). In any event, history offers few examples of nations' using nonconventional military capabilities to deter ill-equipped rivals armed only with conventional weapons. For Israel, a better approach would be to establish a good-neighbor policy that might reduce hostility and enhance regional ties.
A new era? As this discussion comes to a close, I would like to emphasize that weapons of mass destruction and the Middle East's broader security issues cannot be treated independently. This should be apparent from the failure in the 1990s of the discussion forum known as Arms Control and Regional Security in the Middle East. That initiative was intended to work toward peace and conflict resolution, but it collapsed over Israel's complete refusal to discuss issues related to its nonconventional weapons.
Martin Malin argued in Round Two that establishing a WMD-free zone is not the most pressing security concern in the Middle East right now. Even if that is true, the effort to establish such a zone would provide a promising forum for resolving acute conflicts in a troubled region. Ultimately, the elimination of WMD from the Middle East would mean that countries in the region had achieved stable relations; ended hostilities; reached agreement on common security arrangements; and initiated an era of fruitful exchanges. That is why the initiative to establish a WMD-free zone must not be allowed to die.
In Round Two, Ayman Khalil asked his fellow authors to weigh in on whether the effort to create a WMD-free zone in the Middle East is dead. My answer is this: The effort will continue, but the opportunity presented by the 2010 Review Conference for the Nuclear Non-Proliferation Treaty (NPT) may be slipping out of reach.
Ambassador Wael al-Assad, who coordinates the arms control and disarmament positions of Arab League members, points out that states in the Middle East have only three options for responding to WMD threats: acquiescence, counterbalancing, or region-wide WMD elimination. The incentive to pursue a regional ban on WMDs will strengthen, I believe, because the alternatives are becoming ever more costly and dangerous. This is not only true for Iran and the Arab states but also for Israel, whose regional monopoly on nuclear capabilities is eroding.
But that doesn't mean leaders will work together to eliminate WMD from the region any time soon. Instead, fear may drive them to continue counterbalancing perceived threats with new capabilities of their own, which will only lead to deterioration in their security positions, even as their neighbors' security positions also deteriorate.
So how might nations in the region avoid this Middle Eastern version of "Thucydides' trap?" My colleagues have proposed several reasonable approaches. These include Salsabili's notion of building up to the establishment of a region-wide WMD-free zone by organizing subregional enclaves first; Khalil's proposal for developing regional verification measures through technical cooperation; and Eiran's suggestion that states exchange and discuss national threat assessments. All of my colleagues have also endorsed greater involvement by nongovernmental organizations, and I have suggested establishing a regional security forum, which could host the kinds of discussions envisioned in each of the proposals above.
These ideas are constructive and doable. Implementing them would not require regional consensus. None of the ideas would necessarily interfere with the convening of a Helsinki conference along the lines envisioned by the NPT review conference. But—and I hope my colleagues will forgive me—neither they nor I have proposed anything new.
Governments in the region have squandered opportunities for discussion of arms control and disarmament before, and it hasn't been for lack of viable proposals about how to move the process forward. Why all the squandering?
When I talk to Arab and Iranian colleagues, I often hear that Israel would exploit confidence-building measures to avoid the core issue: Israel's nuclear arsenal. They point to the post-1991 Israeli-Palestinian "peace process" as an example of an initiative that failed because of dead-end incrementalism and endless Israeli delaying tactics. Why make the same mistakes, they ask, when addressing nuclear, biological, and chemical weapons? They have a point.
When I talk to Israelis, they say they are prepared to meet with their neighbors but that their neighbors are only interested in bashing Israel's nuclear capability to score rhetorical points in international fora. Israelis say that if their neighbors were really interested in arms control, they wouldn't, for example, make speeches critical of Israel at NPT preparatory meetings at which Israel is not in attendance. Rather, they would pick up the phone. The Israelis have a point too.
Meanwhile, opportunities slip away, frustrations mount, confidence in the nonproliferation regime frays, and counterbalancing strategies become more ominous.
To prevent the current WMD initiative from sinking deeper into a coma (to use Khalil's characterization), regional parties need to engage in direct, ongoing consultations—and a meeting in Helsinki needs to be organized this year. The United Nations needs to sponsor the process—and a regional forum that goes beyond the NPT's purview needs to be established. Nations need to engage on core arms control issues—and conductbroader discussions about regional security.
If the political upheaval in the region teaches us anything, it is that weapons may turn out to have longer lives than the regimes that acquire them. The WMD problem in the Middle East must not wait until the time is right. The right time to begin is now.
My colleagues and I have discussed at length the principles behind banning weapons of mass destruction from the Middle East. But any analysis of such a project's feasibility should also include an honest examination of the region's political and social circumstances. The Arab Spring, and its effects on efforts to ban WMD, particularly deserve attention. It seems to me that the Arab Spring and the instability surrounding it affect the initiative in five distinct ways.
First, as Martin Malin argued in Round Two, regional security issues such as the civil war in Syria seem more pressing than does the initiative to ban weapons of mass destruction. These security issues can be expected to soak up much attention that local and international actors would otherwise devote to advancing the WMD-free zone. Moreover, the initiative to eliminate weapons of mass destruction from the region can contribute little to resolving the pressing security issues that the Arab Spring has produced. This decreases the chances that the WMD initiative will be revived soon.
Second, the Arab Spring creates incentives for the WMD-free zone—both negative and positive ones. Israel may become even more reluctant, amid Syria's ongoing civil war and the regime instability in Cairo, to advance the initiative. Israel might well feel that negotiations on this issue should only be conducted among stable and effective regimes. But, as Ayman Khalil pointed out in Round One, some states can be expected to adopt a more assertive approach to banning weapons of mass destruction as Arab publics demand more from their governments. The recent appointment of Nabil Fahmy, the former Egyptian ambassador to the United States, as Egypt's foreign minister may also add energy to the effort. Fahmy has long been committed to the WMD-free zone, and in the 1990s was a forceful leader for Egypt's delegation to the working group for arms control and regional security that grew out of the Madrid peace process.
Third, as Khalil touched on in Round One, the growing role of Arab publics in shaping policy might lead to a democratization of the initiative to ban weapons of mass destruction: New players from civil society and nongovernmental organizations might become involved. But if the WMD conversation is to retain any significance as it expands, Israel's capabilities cannot be the sole focus of discussion, as some actors seem to prefer. Another challenge is that civil society organizations in countries such as Iran may not be able to participate fully due to political restrictions. In other nations—Syria today, and possibly Egypt at some point—civil society has other, far more pressing issues to address.
Fourth, militarized non-state actors are becoming more prominent in the region; Hezbollah's involvement in the Syrian conflict provides an example. Meaningful conversations about regional security should include a framework to engage these actors. Strong restrictions on non-state actors' possession or use of weapons of mass destruction should be considered.
Finally, amid the instability of the Arab Spring, the Syrian government has used weapons of mass destruction against its own people. This is likely the third time that WMD have been used against the region's civilians: Iraq used them against the Kurdish town of Halabja in 1988 and Egypt is thought to have used WMD during the North Yemen Civil War. This suggests that the traditional state-to-state framework that underlies discussions of weapons of mass destruction is inadequate; the need to defend civilians from their own governments should also be addressed. In international law, "the responsibility to protect" is becoming more prominent, and this might provide a basis for linking the WMD-free zone with the immediate dangers faced by civilians in the Middle East.
The US State Department announced last November that no conference on eliminating weapons of mass destruction from the Middle East would be held in 2012. In the announcement, the State Department emphasized its view that "a comprehensive and durable peace in the region" is an essential precursor to a WMD-free zone. But any policy that assigns precedence to peace over disarmament entails two major flaws.
The first is that such a policy ignores the primary objective of a WMD-free zone: to protect civilians from weapons of mass destruction. These weapons are not primarily designed to vanquish an enemy's military, but to destroy military-industrial centers and trigger a collapse of the enemy's home front. They cannot have any place in the enduring peace that the United States says it desires.
The second flaw is that making peace a condition for disarmament legitimizes the WMD that already exist, in effect allowing their use as military instruments to support aggressive policies. I recognize that regional security and conflict resolution cannot be ignored while a WMD-free zone is established, but weapons of mass destruction don't deserve to be tolerated until "comprehensive and durable peace" is achieved. Assigning precedence to peace over disarmament is incorrect sequencing.
Incorrect sequencing bedeviled an initiative that came out of the Madrid peace process in the 1990s—the working group known as Arms Control and Regional Security in the Middle East. The working group's agenda of peace and conflict resolution could never accommodate discussions about establishing a WMD-free zone, and the group stopped functioning. And perhaps another sign that disarmament must not wait is that Egypt long ago made peace with Israel but still struggles to make progress toward eliminating WMD from the region.
Manageable parts. In Round Two, Ayman Khalil asked whether efforts to eliminate WMD from the Middle East have collapsed or have merely been suspended. My view is that an announcement by just one of the initiative's sponsors, the United States, cannot end the process. As long as Russia and Great Britain dedicate themselves to the effort, and coordinate policies along with other states in the region, the initiative remains alive.
But how to proceed? The process might still move forward if the Middle East were conceived of as three subregions: the Arab Maghreb (North Africa excluding Egypt); Israel and its immediate area; and the Persian Gulf. Such an approach—which would not replace but rather complement existing efforts to eliminate WMD—would enjoy three practical advantages. Diplomatic obstacles in each subregion would be minimized because a limited number of countries would be involved; neighboring countries' common interests would make trade-offs possible; and ambiguity and obfuscation would become more difficult.
In the Maghreb, the membership of North African nations other than Morocco in the Treaty of Pelindaba goes a long way toward readying that subregion for joining a Middle East WMD-free zone. In the Persian Gulf, a subregional approach would help fulfill the longstanding need for a Gulf security pact, and the idea has already received considerable support. Regarding Israel and its immediate area, efforts to eliminate WMD could proceed at the same time that territorial disputes are addressed; Israel's conventional military superiority as well US backing would enable that.
But above all, the success of the Helsinki initiative requires that the Israeli government adopt attitudes in line with those of its own people: Polling in 2011 showed that more than 60 percent of Israelis supported a nuclear-weapon-free zone. Israel's government could do itself and others a service by following the example of South Africa, which transformed itself from a nuclear-armed, apartheid regime into a non-nuclear, democratic state—and in so doing both enhanced its stature in its region and provided a major boost to efforts to eliminate nuclear weapons from Africa.


Moo, the service that lets you make sticker and postcard prints from your photos, has added Facebook to its repertoire.
From your Moo account, you can import your own photos from Facebook in order to make printed products like note cards and business cards. It will cost you just under $10 for 90 different stickers, 100 mini cards are $19.99, and 16 note cards will cost you $24.99. Orders placed before September 30th will get you a 15% discount. This new inclusion adds Facebook to a list of integrated networks like Flickr, LiveJournal, SecondLife and Bebo. In recent Moo news, the company teamed up with Fotolia to offer its custom printing options.


text:
Q: How to list icons to the right with text underneath each accordingly? I want to show pictures of icons from left to right and have their respective names underneath each and it spaced. the text "Icon1" underneath icon1 and so on. tierGo has no CSS in it.

Icon List

A: I had success using divs and a list.I also added a bit of CSS to the list.
Fiddle

Icon List

            Image 1

            Image 2

            Image 3

CSS:
li{
    list-style-type: none;
    display: inline;
    margin-right: 15px;
    float: left;
}

redpajama_set_name: RedPajamaStackExchange


text:
=========================
Writing a MUSB Glue Layer
=========================

:Author: Apelete Seketeli

Introduction
============

The Linux MUSB subsystem is part of the larger Linux USB subsystem. It
provides support for embedded USB Device Controllers (UDC) that do not
use Universal Host Controller Interface (UHCI) or Open Host Controller
Interface (OHCI).

Instead, these embedded UDC rely on the USB On-the-Go (OTG)
specification which they implement at least partially. The silicon
reference design used in most cases is the Multipoint USB Highspeed
Dual-Role Controller (MUSB HDRC) found in the Mentor Graphics Inventra™
design.

As a self-taught exercise I have written an MUSB glue layer for the
Ingenic JZ4740 SoC, modelled after the many MUSB glue layers in the
kernel source tree. This layer can be found at
``drivers/usb/musb/jz4740.c``. In this documentation I will walk through the
basics of the ``jz4740.c`` glue layer, explaining the different pieces and
what needs to be done in order to write your own device glue layer.

.. _musb-basics:

Linux MUSB Basics
=================

To get started on the topic, please read USB On-the-Go Basics (see
Resources) which provides an introduction of USB OTG operation at the
hardware level. A couple of wiki pages by Texas Instruments and Analog
Devices also provide an overview of the Linux kernel MUSB configuration,
albeit focused on some specific devices provided by these companies.
Finally, getting acquainted with the USB specification at USB home page
may come in handy, with practical instance provided through the Writing
USB Device Drivers documentation (again, see Resources).

Linux USB stack is a layered architecture in which the MUSB controller
hardware sits at the lowest. The MUSB controller driver abstract the
MUSB controller hardware to the Linux USB stack::

	  ------------------------
	  |                      | <------- drivers/usb/gadget
	  | Linux USB Core Stack | <------- drivers/usb/host
	  |                      | <------- drivers/usb/core
	  ------------------------
		     ⬍
	 --------------------------
	 |                        | <------ drivers/usb/musb/musb_gadget.c
	 | MUSB Controller driver | <------ drivers/usb/musb/musb_host.c
	 |                        | <------ drivers/usb/musb/musb_core.c
	 --------------------------
		     ⬍
      ---------------------------------
      | MUSB Platform Specific Driver |
      |                               | <-- drivers/usb/musb/jz4740.c
      |       aka "Glue Layer"        |
      ---------------------------------
		     ⬍
      ---------------------------------
      |   MUSB Controller Hardware    |
      ---------------------------------

As outlined above, the glue layer is actually the platform specific code
sitting in between the controller driver and the controller hardware.

Just like a Linux USB driver needs to register itself with the Linux USB
subsystem, the MUSB glue layer needs first to register itself with the
MUSB controller driver. This will allow the controller driver to know
about which device the glue layer supports and which functions to call
when a supported device is detected or released; remember we are talking
about an embedded controller chip here, so no insertion or removal at
run-time.

All of this information is passed to the MUSB controller driver through
a :c:type:`platform_driver` structure defined in the glue layer as::

    static struct platform_driver jz4740_driver = {
	.probe      = jz4740_probe,
	.remove     = jz4740_remove,
	.driver     = {
	    .name   = "musb-jz4740",
	},
    };

The probe and remove function pointers are called when a matching device
is detected and, respectively, released. The name string describes the
device supported by this glue layer. In the current case it matches a
platform_device structure declared in ``arch/mips/jz4740/platform.c``. Note
that we are not using device tree bindings here.

In order to register itself to the controller driver, the glue layer
goes through a few steps, basically allocating the controller hardware
resources and initialising a couple of circuits. To do so, it needs to
keep track of the information used throughout these steps. This is done
by defining a private ``jz4740_glue`` structure::

    struct jz4740_glue {
	struct device           *dev;
	struct platform_device  *musb;
	struct clk      *clk;
    };

The dev and musb members are both device structure variables. The first
one holds generic information about the device, since it's the basic
device structure, and the latter holds information more closely related
to the subsystem the device is registered to. The clk variable keeps
information related to the device clock operation.

Let's go through the steps of the probe function that leads the glue
layer to register itself to the controller driver.

.. note::

   For the sake of readability each function will be split in logical
   parts, each part being shown as if it was independent from the others.

.. code-block:: c
    :emphasize-lines: 8,12,18

    static int jz4740_probe(struct platform_device *pdev)
    {
	struct platform_device      *musb;
	struct jz4740_glue      *glue;
	struct clk                      *clk;
	int             ret;

	glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
	if (!glue)
	    return -ENOMEM;

	musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
	if (!musb) {
	    dev_err(&pdev->dev, "failed to allocate musb device\n");
	    return -ENOMEM;
	}

	clk = devm_clk_get(&pdev->dev, "udc");
	if (IS_ERR(clk)) {
	    dev_err(&pdev->dev, "failed to get clock\n");
	    ret = PTR_ERR(clk);
	    goto err_platform_device_put;
	}

	ret = clk_prepare_enable(clk);
	if (ret) {
	    dev_err(&pdev->dev, "failed to enable clock\n");
	    goto err_platform_device_put;
	}

	musb->dev.parent        = &pdev->dev;

	glue->dev           = &pdev->dev;
	glue->musb          = musb;
	glue->clk           = clk;

	return 0;

    err_platform_device_put:
	platform_device_put(musb);
	return ret;
    }

The first few lines of the probe function allocate and assign the glue,
musb and clk variables. The ``GFP_KERNEL`` flag (line 8) allows the
allocation process to sleep and wait for memory, thus being usable in a
locking situation. The ``PLATFORM_DEVID_AUTO`` flag (line 12) allows
automatic allocation and management of device IDs in order to avoid
device namespace collisions with explicit IDs. With :c:func:`devm_clk_get`
(line 18) the glue layer allocates the clock -- the ``devm_`` prefix
indicates that :c:func:`clk_get` is managed: it automatically frees the
allocated clock resource data when the device is released -- and enable
it.

Then comes the registration steps:

.. code-block:: c
    :emphasize-lines: 3,5,7,9,16

    static int jz4740_probe(struct platform_device *pdev)
    {
	struct musb_hdrc_platform_data  *pdata = &jz4740_musb_platform_data;

	pdata->platform_ops     = &jz4740_musb_ops;

	platform_set_drvdata(pdev, glue);

	ret = platform_device_add_resources(musb, pdev->resource,
			    pdev->num_resources);
	if (ret) {
	    dev_err(&pdev->dev, "failed to add resources\n");
	    goto err_clk_disable;
	}

	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
	if (ret) {
	    dev_err(&pdev->dev, "failed to add platform_data\n");
	    goto err_clk_disable;
	}

	return 0;

    err_clk_disable:
	clk_disable_unprepare(clk);
    err_platform_device_put:
	platform_device_put(musb);
	return ret;
    }

The first step is to pass the device data privately held by the glue
layer on to the controller driver through :c:func:`platform_set_drvdata`
(line 7). Next is passing on the device resources information, also privately
held at that point, through :c:func:`platform_device_add_resources` (line 9).

Finally comes passing on the platform specific data to the controller
driver (line 16). Platform data will be discussed in
:ref:`musb-dev-platform-data`, but here we are looking at the
``platform_ops`` function pointer (line 5) in ``musb_hdrc_platform_data``
structure (line 3). This function pointer allows the MUSB controller
driver to know which function to call for device operation::

    static const struct musb_platform_ops jz4740_musb_ops = {
	.init       = jz4740_musb_init,
	.exit       = jz4740_musb_exit,
    };

Here we have the minimal case where only init and exit functions are
called by the controller driver when needed. Fact is the JZ4740 MUSB
controller is a basic controller, lacking some features found in other
controllers, otherwise we may also have pointers to a few other
functions like a power management function or a function to switch
between OTG and non-OTG modes, for instance.

At that point of the registration process, the controller driver
actually calls the init function:

   .. code-block:: c
    :emphasize-lines: 12,14

    static int jz4740_musb_init(struct musb *musb)
    {
	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
	if (!musb->xceiv) {
	    pr_err("HS UDC: no transceiver configured\n");
	    return -ENODEV;
	}

	/* Silicon does not implement ConfigData register.
	 * Set dyn_fifo to avoid reading EP config from hardware.
	 */
	musb->dyn_fifo = true;

	musb->isr = jz4740_musb_interrupt;

	return 0;
    }

The goal of ``jz4740_musb_init()`` is to get hold of the transceiver
driver data of the MUSB controller hardware and pass it on to the MUSB
controller driver, as usual. The transceiver is the circuitry inside the
controller hardware responsible for sending/receiving the USB data.
Since it is an implementation of the physical layer of the OSI model,
the transceiver is also referred to as PHY.

Getting hold of the ``MUSB PHY`` driver data is done with ``usb_get_phy()``
which returns a pointer to the structure containing the driver instance
data. The next couple of instructions (line 12 and 14) are used as a
quirk and to setup IRQ handling respectively. Quirks and IRQ handling
will be discussed later in :ref:`musb-dev-quirks` and
:ref:`musb-handling-irqs`\ ::

    static int jz4740_musb_exit(struct musb *musb)
    {
	usb_put_phy(musb->xceiv);

	return 0;
    }

Acting as the counterpart of init, the exit function releases the MUSB
PHY driver when the controller hardware itself is about to be released.

Again, note that init and exit are fairly simple in this case due to the
basic set of features of the JZ4740 controller hardware. When writing an
musb glue layer for a more complex controller hardware, you might need
to take care of more processing in those two functions.

Returning from the init function, the MUSB controller driver jumps back
into the probe function::

    static int jz4740_probe(struct platform_device *pdev)
    {
	ret = platform_device_add(musb);
	if (ret) {
	    dev_err(&pdev->dev, "failed to register musb device\n");
	    goto err_clk_disable;
	}

	return 0;

    err_clk_disable:
	clk_disable_unprepare(clk);
    err_platform_device_put:
	platform_device_put(musb);
	return ret;
    }

This is the last part of the device registration process where the glue
layer adds the controller hardware device to Linux kernel device
hierarchy: at this stage, all known information about the device is
passed on to the Linux USB core stack:

   .. code-block:: c
    :emphasize-lines: 5,6

    static int jz4740_remove(struct platform_device *pdev)
    {
	struct jz4740_glue  *glue = platform_get_drvdata(pdev);

	platform_device_unregister(glue->musb);
	clk_disable_unprepare(glue->clk);

	return 0;
    }

Acting as the counterpart of probe, the remove function unregister the
MUSB controller hardware (line 5) and disable the clock (line 6),
allowing it to be gated.

.. _musb-handling-irqs:

Handling IRQs
=============

Additionally to the MUSB controller hardware basic setup and
registration, the glue layer is also responsible for handling the IRQs:

   .. code-block:: c
    :emphasize-lines: 7,9-11,14,24

    static irqreturn_t jz4740_musb_interrupt(int irq, void *__hci)
    {
	unsigned long   flags;
	irqreturn_t     retval = IRQ_NONE;
	struct musb     *musb = __hci;

	spin_lock_irqsave(&musb->lock, flags);

	musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
	musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
	musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);

	/*
	 * The controller is gadget only, the state of the host mode IRQ bits is
	 * undefined. Mask them to make sure that the musb driver core will
	 * never see them set
	 */
	musb->int_usb &= MUSB_INTR_SUSPEND | MUSB_INTR_RESUME |
	    MUSB_INTR_RESET | MUSB_INTR_SOF;

	if (musb->int_usb || musb->int_tx || musb->int_rx)
	    retval = musb_interrupt(musb);

	spin_unlock_irqrestore(&musb->lock, flags);

	return retval;
    }

Here the glue layer mostly has to read the relevant hardware registers
and pass their values on to the controller driver which will handle the
actual event that triggered the IRQ.

The interrupt handler critical section is protected by the
:c:func:`spin_lock_irqsave` and counterpart :c:func:`spin_unlock_irqrestore`
functions (line 7 and 24 respectively), which prevent the interrupt
handler code to be run by two different threads at the same time.

Then the relevant interrupt registers are read (line 9 to 11):

-  ``MUSB_INTRUSB``: indicates which USB interrupts are currently active,

-  ``MUSB_INTRTX``: indicates which of the interrupts for TX endpoints are
   currently active,

-  ``MUSB_INTRRX``: indicates which of the interrupts for TX endpoints are
   currently active.

Note that :c:func:`musb_readb` is used to read 8-bit registers at most, while
:c:func:`musb_readw` allows us to read at most 16-bit registers. There are
other functions that can be used depending on the size of your device
registers. See ``musb_io.h`` for more information.

Instruction on line 18 is another quirk specific to the JZ4740 USB
device controller, which will be discussed later in :ref:`musb-dev-quirks`.

The glue layer still needs to register the IRQ handler though. Remember
the instruction on line 14 of the init function::

    static int jz4740_musb_init(struct musb *musb)
    {
	musb->isr = jz4740_musb_interrupt;

	return 0;
    }

This instruction sets a pointer to the glue layer IRQ handler function,
in order for the controller hardware to call the handler back when an
IRQ comes from the controller hardware. The interrupt handler is now
implemented and registered.

.. _musb-dev-platform-data:

Device Platform Data
====================

In order to write an MUSB glue layer, you need to have some data
describing the hardware capabilities of your controller hardware, which
is called the platform data.

Platform data is specific to your hardware, though it may cover a broad
range of devices, and is generally found somewhere in the ``arch/``
directory, depending on your device architecture.

For instance, platform data for the JZ4740 SoC is found in
``arch/mips/jz4740/platform.c``. In the ``platform.c`` file each device of the
JZ4740 SoC is described through a set of structures.

Here is the part of ``arch/mips/jz4740/platform.c`` that covers the USB
Device Controller (UDC):

   .. code-block:: c
    :emphasize-lines: 2,7,14-17,21,22,25,26,28,29

    /* USB Device Controller */
    struct platform_device jz4740_udc_xceiv_device = {
	.name = "usb_phy_gen_xceiv",
	.id   = 0,
    };

    static struct resource jz4740_udc_resources[] = {
	[0] = {
	    .start = JZ4740_UDC_BASE_ADDR,
	    .end   = JZ4740_UDC_BASE_ADDR + 0x10000 - 1,
	    .flags = IORESOURCE_MEM,
	},
	[1] = {
	    .start = JZ4740_IRQ_UDC,
	    .end   = JZ4740_IRQ_UDC,
	    .flags = IORESOURCE_IRQ,
	    .name  = "mc",
	},
    };

    struct platform_device jz4740_udc_device = {
	.name = "musb-jz4740",
	.id   = -1,
	.dev  = {
	    .dma_mask          = &jz4740_udc_device.dev.coherent_dma_mask,
	    .coherent_dma_mask = DMA_BIT_MASK(32),
	},
	.num_resources = ARRAY_SIZE(jz4740_udc_resources),
	.resource      = jz4740_udc_resources,
    };

The ``jz4740_udc_xceiv_device`` platform device structure (line 2)
describes the UDC transceiver with a name and id number.

At the time of this writing, note that ``usb_phy_gen_xceiv`` is the
specific name to be used for all transceivers that are either built-in
with reference USB IP or autonomous and doesn't require any PHY
programming. You will need to set ``CONFIG_NOP_USB_XCEIV=y`` in the
kernel configuration to make use of the corresponding transceiver
driver. The id field could be set to -1 (equivalent to
``PLATFORM_DEVID_NONE``), -2 (equivalent to ``PLATFORM_DEVID_AUTO``) or
start with 0 for the first device of this kind if we want a specific id
number.

The ``jz4740_udc_resources`` resource structure (line 7) defines the UDC
registers base addresses.

The first array (line 9 to 11) defines the UDC registers base memory
addresses: start points to the first register memory address, end points
to the last register memory address and the flags member defines the
type of resource we are dealing with. So ``IORESOURCE_MEM`` is used to
define the registers memory addresses. The second array (line 14 to 17)
defines the UDC IRQ registers addresses. Since there is only one IRQ
register available for the JZ4740 UDC, start and end point at the same
address. The ``IORESOURCE_IRQ`` flag tells that we are dealing with IRQ
resources, and the name ``mc`` is in fact hard-coded in the MUSB core in
order for the controller driver to retrieve this IRQ resource by
querying it by its name.

Finally, the ``jz4740_udc_device`` platform device structure (line 21)
describes the UDC itself.

The ``musb-jz4740`` name (line 22) defines the MUSB driver that is used
for this device; remember this is in fact the name that we used in the
``jz4740_driver`` platform driver structure in :ref:`musb-basics`.
The id field (line 23) is set to -1 (equivalent to ``PLATFORM_DEVID_NONE``)
since we do not need an id for the device: the MUSB controller driver was
already set to allocate an automatic id in :ref:`musb-basics`. In the dev field
we care for DMA related information here. The ``dma_mask`` field (line 25)
defines the width of the DMA mask that is going to be used, and
``coherent_dma_mask`` (line 26) has the same purpose but for the
``alloc_coherent`` DMA mappings: in both cases we are using a 32 bits mask.
Then the resource field (line 29) is simply a pointer to the resource
structure defined before, while the ``num_resources`` field (line 28) keeps
track of the number of arrays defined in the resource structure (in this
case there were two resource arrays defined before).

With this quick overview of the UDC platform data at the ``arch/`` level now
done, let's get back to the MUSB glue layer specific platform data in
``drivers/usb/musb/jz4740.c``:

   .. code-block:: c
    :emphasize-lines: 3,5,7-9,11

    static struct musb_hdrc_config jz4740_musb_config = {
	/* Silicon does not implement USB OTG. */
	.multipoint = 0,
	/* Max EPs scanned, driver will decide which EP can be used. */
	.num_eps    = 4,
	/* RAMbits needed to configure EPs from table */
	.ram_bits   = 9,
	.fifo_cfg = jz4740_musb_fifo_cfg,
	.fifo_cfg_size = ARRAY_SIZE(jz4740_musb_fifo_cfg),
    };

    static struct musb_hdrc_platform_data jz4740_musb_platform_data = {
	.mode   = MUSB_PERIPHERAL,
	.config = &jz4740_musb_config,
    };

First the glue layer configures some aspects of the controller driver
operation related to the controller hardware specifics. This is done
through the ``jz4740_musb_config`` :c:type:`musb_hdrc_config` structure.

Defining the OTG capability of the controller hardware, the multipoint
member (line 3) is set to 0 (equivalent to false) since the JZ4740 UDC
is not OTG compatible. Then ``num_eps`` (line 5) defines the number of USB
endpoints of the controller hardware, including endpoint 0: here we have
3 endpoints + endpoint 0. Next is ``ram_bits`` (line 7) which is the width
of the RAM address bus for the MUSB controller hardware. This
information is needed when the controller driver cannot automatically
configure endpoints by reading the relevant controller hardware
registers. This issue will be discussed when we get to device quirks in
:ref:`musb-dev-quirks`. Last two fields (line 8 and 9) are also
about device quirks: ``fifo_cfg`` points to the USB endpoints configuration
table and ``fifo_cfg_size`` keeps track of the size of the number of
entries in that configuration table. More on that later in
:ref:`musb-dev-quirks`.

Then this configuration is embedded inside ``jz4740_musb_platform_data``
:c:type:`musb_hdrc_platform_data` structure (line 11): config is a pointer to
the configuration structure itself, and mode tells the controller driver
if the controller hardware may be used as ``MUSB_HOST`` only,
``MUSB_PERIPHERAL`` only or ``MUSB_OTG`` which is a dual mode.

Remember that ``jz4740_musb_platform_data`` is then used to convey
platform data information as we have seen in the probe function in
:ref:`musb-basics`.

.. _musb-dev-quirks:

Device Quirks
=============

Completing the platform data specific to your device, you may also need
to write some code in the glue layer to work around some device specific
limitations. These quirks may be due to some hardware bugs, or simply be
the result of an incomplete implementation of the USB On-the-Go
specification.

The JZ4740 UDC exhibits such quirks, some of which we will discuss here
for the sake of insight even though these might not be found in the
controller hardware you are working on.

Let's get back to the init function first:

   .. code-block:: c
    :emphasize-lines: 12

    static int jz4740_musb_init(struct musb *musb)
    {
	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
	if (!musb->xceiv) {
	    pr_err("HS UDC: no transceiver configured\n");
	    return -ENODEV;
	}

	/* Silicon does not implement ConfigData register.
	 * Set dyn_fifo to avoid reading EP config from hardware.
	 */
	musb->dyn_fifo = true;

	musb->isr = jz4740_musb_interrupt;

	return 0;
    }

Instruction on line 12 helps the MUSB controller driver to work around
the fact that the controller hardware is missing registers that are used
for USB endpoints configuration.

Without these registers, the controller driver is unable to read the
endpoints configuration from the hardware, so we use line 12 instruction
to bypass reading the configuration from silicon, and rely on a
hard-coded table that describes the endpoints configuration instead::

    static struct musb_fifo_cfg jz4740_musb_fifo_cfg[] = {
	{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
	{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
	{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 64, },
    };

Looking at the configuration table above, we see that each endpoints is
described by three fields: ``hw_ep_num`` is the endpoint number, style is
its direction (either ``FIFO_TX`` for the controller driver to send packets
in the controller hardware, or ``FIFO_RX`` to receive packets from
hardware), and maxpacket defines the maximum size of each data packet
that can be transmitted over that endpoint. Reading from the table, the
controller driver knows that endpoint 1 can be used to send and receive
USB data packets of 512 bytes at once (this is in fact a bulk in/out
endpoint), and endpoint 2 can be used to send data packets of 64 bytes
at once (this is in fact an interrupt endpoint).

Note that there is no information about endpoint 0 here: that one is
implemented by default in every silicon design, with a predefined
configuration according to the USB specification. For more examples of
endpoint configuration tables, see ``musb_core.c``.

Let's now get back to the interrupt handler function:

   .. code-block:: c
    :emphasize-lines: 18-19

    static irqreturn_t jz4740_musb_interrupt(int irq, void *__hci)
    {
	unsigned long   flags;
	irqreturn_t     retval = IRQ_NONE;
	struct musb     *musb = __hci;

	spin_lock_irqsave(&musb->lock, flags);

	musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
	musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
	musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);

	/*
	 * The controller is gadget only, the state of the host mode IRQ bits is
	 * undefined. Mask them to make sure that the musb driver core will
	 * never see them set
	 */
	musb->int_usb &= MUSB_INTR_SUSPEND | MUSB_INTR_RESUME |
	    MUSB_INTR_RESET | MUSB_INTR_SOF;

	if (musb->int_usb || musb->int_tx || musb->int_rx)
	    retval = musb_interrupt(musb);

	spin_unlock_irqrestore(&musb->lock, flags);

	return retval;
    }

Instruction on line 18 above is a way for the controller driver to work
around the fact that some interrupt bits used for USB host mode
operation are missing in the ``MUSB_INTRUSB`` register, thus left in an
undefined hardware state, since this MUSB controller hardware is used in
peripheral mode only. As a consequence, the glue layer masks these
missing bits out to avoid parasite interrupts by doing a logical AND
operation between the value read from ``MUSB_INTRUSB`` and the bits that
are actually implemented in the register.

These are only a couple of the quirks found in the JZ4740 USB device
controller. Some others were directly addressed in the MUSB core since
the fixes were generic enough to provide a better handling of the issues
for others controller hardware eventually.

Conclusion
==========

Writing a Linux MUSB glue layer should be a more accessible task, as
this documentation tries to show the ins and outs of this exercise.

The JZ4740 USB device controller being fairly simple, I hope its glue
layer serves as a good example for the curious mind. Used with the
current MUSB glue layers, this documentation should provide enough
guidance to get started; should anything gets out of hand, the linux-usb
mailing list archive is another helpful resource to browse through.

Acknowledgements
================

Many thanks to Lars-Peter Clausen and Maarten ter Huurne for answering
my questions while I was writing the JZ4740 glue layer and for helping
me out getting the code in good shape.

I would also like to thank the Qi-Hardware community at large for its
cheerful guidance and support.

Resources
=========

USB Home Page: http://www.usb.org

linux-usb Mailing List Archives: http://marc.info/?l=linux-usb

USB On-the-Go Basics:
http://www.maximintegrated.com/app-notes/index.mvp/id/1822

:ref:`Writing USB Device Drivers <writing-usb-driver>`

Texas Instruments USB Configuration Wiki Page:
http://processors.wiki.ti.com/index.php/Usbgeneralpage

Analog Devices Blackfin MUSB Configuration:
http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:musb

redpajama_set_name: RedPajamaGithub


The Cambridge Massage Company is headed by Sophie Whiffen MICHT, IIHHT, VTCT, ATL, who started her career in massage 14 years ago.
After discovering the emotional and physical benefits of massage while travelling through Indonesia aged 20, she returned to the UK to train as a therapist. After graduating, Sophie specialised in fertility and pregnancy treatments, working in various clinics in Cambridge and Chelsea, the healing fields of some of the UK's best music festivals, as well as blue chip companies in the city.
After becoming a mother herself in 2009 and seeing the effects of chronic stress and ill-health due to sedentary work and modern-day living, she realised there needed to be a way for people to reap the benefits of massage in a more mainstream way.
Understanding that everyone is unique to their schedules, whether that's work, motherhood or other commitments, The Cambridge Massage Company was born, bringing a luxury massage service to the workplace and home, as well as their city-centre clinic.
Sophie is a sought after therapist who's professionalism and client discretion is paramount. Her client base includes A-list celebrities and royalty.
Sophie has 14 years hands on and teaching experience, specialising in fertility and pregnancy treatments.
She has a real passion for her work and loves nothing more than leaving clients relaxed and feeling a lot lighter!


Where to put down roots?
I was trolling the internet, doing searches for best cities to live, or best creative towns, etc... and I stumbled here. I just joined this site in hopes of gaining some insight about places people end up after new york.
I have lived here in brooklyn for 8 years. I am an architect/designer, I am originally from new mexico, and also lived in portland oregon, and providence, RI.
I live in cobble hill and I love my neighborhood. I really love brooklyn actually. However, I know I am ready to move on. I am tired of high rent, not being able to save, cockroaches, stress, roommates, not being able to have a dog, apartment life, not having a garden, working for unsavory egomaniacs, noise, ambulances, did I say stress?
I know there are great things about these cities so I don't mean to come off sounding cynical. Moving used to be fairly easy for me, but I am at a stage where I want to really put down roots so it just feels like a lot of pressure. I also know that there are things about brooklyn that I will miss immensely - like walking around the neighborhood and doing all my errands, seeing people that live in the area. It's a simple pleasure, really.
Anyway, thanks for letting me ramble.
Nice to have you here. I haven't spent time in any of the cities you're looking at, but co-founder Anna Raddatz spent time in Austin--she will likely see this post soon or you can email her on the site. She ended up ditching Austin for Asheville. I'm in Boulder, and while it's a bubble, it's an amazing change of pace from NYC. The design jobs will not be as strong here as in NYC, of course, but I'd job-search and see what comes up for Boulder and for Denver (45 mins away). Good luck!
As Mari mentioned, I spent a few months in Austin checking it out as a potential place to call home. In the end, I preferred Asheville for its smaller size (i.e. less traffic) and mountain scenery. But Austin had a lot of great stuff to offer. I do miss it sometimes. But like you, I'm unsure I could have dealt with the heat. We were there Nov-Feb, and the weather was gorgeous most of the time - definitely better than dreary NYC winters! But I didn't experience the crazy summer heat. We were told that you treat Austin summer the same way you would winter anywhere else - you just don't spend any time outside. Everyone stays in their air conditioned oasis, and they seem to get by just fine. The music, nightlife, food are all amazing - and I'm sure there are many firms where you could find work. Maybe visit for a couple weeks in July and make sure you can take the heat.